The oPWA admin uses the Orravo 3-row sticky header pattern:
- Row 1 — Brand bar (
top: 32px): oPWA logo, version pill, WP admin bar avatar, light/dark toggle. - Row 2 — Top nav (
top: 82px): Horizontal tab links grouped by function. - Row 3 — Topbar (
top: 126px): Page title, save button, secondary actions.
The WordPress sidebar is hidden on all plugin pages (body.toplevel_page_opwa-pwa). Content is full-width.
5.1 Dashboard
A quick-health overview of the PWA installation.
JS-side checks (live in browser):
- HTTPS:
location.protocol === 'https:' - Service Worker:
navigator.serviceWorker.getRegistration('/') - Manifest linked:
<link rel="manifest">in document head - Installed:
window.matchMedia('(display-mode: standalone)')
PHP-side checklist:
- Icons generated (
192pxand512pxURLs configured) - Offline fallback URL set and the page exists
- VAPID keys generated
The dashboard also shows an iOS instructions card with the share-button steps for iOS Safari users.
5.2 Manifest
Controls the manifest.webmanifest served at /manifest.webmanifest.
| Field | Setting key | Notes |
|---|---|---|
| App name | app_name | Used as name in manifest |
| Short name | app_short_name | Up to 12 chars recommended |
| Description | app_description | |
| Start URL | start_url | Defaults to / |
| Scope | scope | Defaults to / |
| Display | display | standalone, fullscreen, minimal-ui, browser |
| Orientation | orientation | any, portrait, landscape |
| Theme color | theme_color | Hex — browser UI tint |
| Background color | background_color | Splash screen background |
| Icon source (512px) | icon_512_id | Attachment ID for source image |
| Icon 192px URL | icon_192_url | Auto-set after generation |
| Icon 512px URL | icon_512_url | Auto-set after generation |
| Maskable icon URL | icon_maskable_url | Auto-generated with safe zone |
| Screenshots (×5) | screenshots[] | src, form_factor, label |
| Share target enabled | share_target | Adds share_target to manifest |
| Share target URL | share_target_url | Receives shared content |
Icon Generator: Upload a single 512×512 PNG/JPG. Click Generate All Sizes to create icons at 72, 96, 128, 144, 152, 192, 384, and 512px, plus a maskable variant — all saved in wp-content/uploads/opwa-icons/. Requires the PHP GD extension.
Manifest preview: A phone mockup in the sidebar updates live as you type the app name, choose colors, and pick icons.
5.3 Service Worker
Controls the dynamically-generated SW at /sw.js.
Global caching strategies
| Asset type | Setting key | Options |
|---|---|---|
| HTML pages | strategy_pages | network-first (default), cache-first, stale-while-revalidate, network-only, cache-only |
| Static assets (JS/CSS) | strategy_static | cache-first (default), network-first, stale-while-revalidate |
| Images | strategy_images | cache-first (default), network-first, stale-while-revalidate |
| Fonts | strategy_fonts | cache-first (default), network-first |
Precache list
A newline-delimited list of URLs to cache immediately on SW install. Auto-generated from WordPress via Generate Precache List (home page, theme static assets, common WP URLs).
Custom route builder
Add per-URL rules with regex patterns. Each row has:
- Pattern — JavaScript regex, matched against
request.url - Strategy — one of 5 strategies
- TTL (seconds) — max age for cached entries (0 = no expiry)
- Max entries — cap on cache storage entries (0 = unlimited)
Custom routes are serialised to JSON and stored in opwa_settings['custom_routes'].
Preset buttons
| Preset | Description |
|---|---|
| Blog | Network-first pages, cache-first static/images/fonts |
| WooCommerce | Same as blog + network-only for checkout/cart/account |
| Portfolio | Cache-first everything, long TTLs |
Other SW options
| Option | Key | Description |
|---|---|---|
| Navigation preload | navigation_preload | Enables navigationPreload.enable() in SW |
| Background sync | background_sync | Enables IndexedDB form queue |
| SW version | sw_version | Integer; bump to force cache clear |
5.4 Offline
Configures the offline fallback experience.
| Field | Key | Description |
|---|---|---|
| Offline page URL | offline_url | URL served when page is unavailable offline. Must exist. |
| Offline message | offline_message | Text shown on the offline fallback template |
| Show logo on offline page | offline_show_logo | Renders the 192px icon |
| Show cached pages list | offline_show_cached | Lists previously cached page titles |
| Enable form queue | offline_form_queue | Queues form submissions via Background Sync API |
Note: The offline URL page must exist in WordPress. The plugin validates this on save and warns if the page is missing.
5.5 Push Notifications
Self-hosted Web Push (RFC 8030) with VAPID authentication — no FCM or other third-party service required.
VAPID Wizard
Step 1 — Generate keys: Clicking Generate VAPID Keys calls OPWA_Push::generate_vapid_keys() which creates an EC P-256 key pair via OpenSSL. The public key (base64url, 65-byte uncompressed point) and private key (PEM) are stored in wp_options.
Step 2 — Set subject: Enter a mailto: or https: URI identifying your site. This is included in the VAPID JWT claim as sub.
IMPORTANT: Regenerating keys invalidates all existing subscriber endpoints. Users must re-subscribe.
Push Composer
| Field | Description |
|---|---|
| Title | Notification title |
| Body | Notification body text |
| Icon URL | Small notification icon |
| Image URL | Large hero image (optional) |
| Click URL | Where the notification takes the user on click |
| Tag | Notification tag for deduplication (opwa default) |
Send to All Subscribers dispatches to every stored endpoint. Results show sent/failed/total counts.
Subscriber Table
Lists all push subscribers with:
- ID, device type badge (mobile/tablet/desktop)
- User ID (if logged in when subscribing)
- Subscribed date
- Endpoint preview
- Delete action
Campaign History
Records each send batch: timestamp, title, body, sent/failed counts.
5.6 Install Prompt
Controls when and how the PWA install banner appears.
| Field | Key | Description |
|---|---|---|
| Banner message | banner_message | Main install text |
| Install button | banner_button | CTA button label |
| Dismiss days | dismiss_days | Days before showing again after dismiss |
| Show iOS overlay | ios_overlay | Adds "Tap Share → Add to Home Screen" for Safari users |
Trigger types
| Type | Key value | Extra fields |
|---|---|---|
| Immediately | immediate | — |
| After N seconds | delay | trigger_delay (seconds) |
| After N page views | pageviews | trigger_pageviews |
| On scroll | scroll | trigger_scroll_pct (% page scrolled) |
| On exit intent | exit_intent | — |
The window.opPWA public API allows themes/plugins to trigger the banner programmatically:
jswindow.opPWA.showBanner(); // Show install banner
window.opPWA.dismiss(); // Dismiss banner
5.7 Cache
Live cache inspection and management.
Load Cache Stats uses a postMessage channel to query the active service worker:
js// JS sends:
reg.active.postMessage({ type: 'OPWA_CACHE_STATS' }, [messageChannel.port2]);
// SW responds with:
{ 'opwa-pages-v1': { count: 12, size_kb: 340 }, 'opwa-static-v1': { count: 8, size_kb: 120 }, … }
Clear All Caches bumps sw_version, which causes the SW to delete all old caches on next activate.
Clear URL allows removing a specific URL from the pages cache.
5.8 Analytics
All analytics are collected via a JS beacon (navigator.sendBeacon) to the REST endpoint /wp-json/opwa/v1/beacon.
Stat cards (all-time):
| Card | Metric |
|---|---|
| Push Subscribers | Count of active subscriptions |
| SW Coverage | % of page views where SW was active |
| Cache Hit Rate | cache_hits / (cache_hits + cache_misses) × 100 |
| Offline Sessions | Sessions where network was unavailable |
| Install Prompts | Times the install banner was shown |
| Installs | Times the appinstalled event fired |
| Install Rate | installs / prompts × 100 |
| Dismissals | Times the install banner was dismissed |
Bar charts (30-day):
- SW Registrations per day
- Installs per day
- Page views per day
- Cache hits per day
5.9 Settings
Performance
preload_links—<link rel="preload">for critical assetsnavigation_preload— Enable Navigation Preload in SWlazy_subscribe— Delay push subscription prompt
WooCommerce
woocommerce_mode— Forces network-only on/checkout,/cart,/my-account
Analytics & Privacy
analytics_enabled— Toggle beacon collectionanalytics_retention— Days to keep raw rows (default 90)
Advanced
debug_mode— Addsconsole.logstatements to SW outputbypass_logged_in— Skip SW for logged-in userscustom_sw_code— Append raw JS to the generated SW
Developer reference — Lists all available filters and WP-CLI commands.
