DocsoPWA5. Admin Interface
Reference

5. Admin Interface

oPWAorravo.com/docs/opwa/5-admin-interface

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 (192px and 512px URLs 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.

FieldSetting keyNotes
App nameapp_nameUsed as name in manifest
Short nameapp_short_nameUp to 12 chars recommended
Descriptionapp_description
Start URLstart_urlDefaults to /
ScopescopeDefaults to /
Displaydisplaystandalone, fullscreen, minimal-ui, browser
Orientationorientationany, portrait, landscape
Theme colortheme_colorHex — browser UI tint
Background colorbackground_colorSplash screen background
Icon source (512px)icon_512_idAttachment ID for source image
Icon 192px URLicon_192_urlAuto-set after generation
Icon 512px URLicon_512_urlAuto-set after generation
Maskable icon URLicon_maskable_urlAuto-generated with safe zone
Screenshots (×5)screenshots[]src, form_factor, label
Share target enabledshare_targetAdds share_target to manifest
Share target URLshare_target_urlReceives 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 typeSetting keyOptions
HTML pagesstrategy_pagesnetwork-first (default), cache-first, stale-while-revalidate, network-only, cache-only
Static assets (JS/CSS)strategy_staticcache-first (default), network-first, stale-while-revalidate
Imagesstrategy_imagescache-first (default), network-first, stale-while-revalidate
Fontsstrategy_fontscache-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

PresetDescription
BlogNetwork-first pages, cache-first static/images/fonts
WooCommerceSame as blog + network-only for checkout/cart/account
PortfolioCache-first everything, long TTLs

Other SW options

OptionKeyDescription
Navigation preloadnavigation_preloadEnables navigationPreload.enable() in SW
Background syncbackground_syncEnables IndexedDB form queue
SW versionsw_versionInteger; bump to force cache clear

5.4 Offline

Configures the offline fallback experience.

FieldKeyDescription
Offline page URLoffline_urlURL served when page is unavailable offline. Must exist.
Offline messageoffline_messageText shown on the offline fallback template
Show logo on offline pageoffline_show_logoRenders the 192px icon
Show cached pages listoffline_show_cachedLists previously cached page titles
Enable form queueoffline_form_queueQueues 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

FieldDescription
TitleNotification title
BodyNotification body text
Icon URLSmall notification icon
Image URLLarge hero image (optional)
Click URLWhere the notification takes the user on click
TagNotification 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.

FieldKeyDescription
Banner messagebanner_messageMain install text
Install buttonbanner_buttonCTA button label
Dismiss daysdismiss_daysDays before showing again after dismiss
Show iOS overlayios_overlayAdds "Tap Share → Add to Home Screen" for Safari users

Trigger types

TypeKey valueExtra fields
Immediatelyimmediate
After N secondsdelaytrigger_delay (seconds)
After N page viewspageviewstrigger_pageviews
On scrollscrolltrigger_scroll_pct (% page scrolled)
On exit intentexit_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):

CardMetric
Push SubscribersCount of active subscriptions
SW Coverage% of page views where SW was active
Cache Hit Ratecache_hits / (cache_hits + cache_misses) × 100
Offline SessionsSessions where network was unavailable
Install PromptsTimes the install banner was shown
InstallsTimes the appinstalled event fired
Install Rateinstalls / prompts × 100
DismissalsTimes 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 assets
  • navigation_preload — Enable Navigation Preload in SW
  • lazy_subscribe — Delay push subscription prompt

WooCommerce

  • woocommerce_mode — Forces network-only on /checkout, /cart, /my-account

Analytics & Privacy

  • analytics_enabled — Toggle beacon collection
  • analytics_retention — Days to keep raw rows (default 90)

Advanced

  • debug_mode — Adds console.log statements to SW output
  • bypass_logged_in — Skip SW for logged-in users
  • custom_sw_code — Append raw JS to the generated SW

Developer reference — Lists all available filters and WP-CLI commands.


5. Admin Interface — oPWA Docs — Orravo