Overview
oPWA (v1.0.0) adds PWA capabilities to any WordPress site with no third-party push service.
Constants:
| Constant | Value |
|---|---|
OPWA_VERSION | '1.0.0' |
OPWA_OPTION | 'opwa_settings' (wp_options key) |
OPWA_PATH | Absolute plugin directory path |
OPWA_URL | Plugin directory URL |
OPWA_DB_VERSION | '1.0' |
Key capabilities:
| Feature | Description |
|---|---|
| Web App Manifest | App name, icons, theme colors, screenshots, share target |
| Service Worker | 5 caching strategies, custom URL routing, precache, offline fallback |
| Push Notifications | Self-hosted VAPID (RFC 8030), AES-128-GCM encrypted payloads |
| Install Prompt | 5 trigger modes, customisable banner, iOS instructions |
| Background Sync | IndexedDB form queue, syncs on reconnect |
| Cache Management | Live stats via SW postMessage, clear all / by URL |
| Analytics | Beacon-based: page views, SW coverage, cache hit rate, installs |
| WooCommerce Mode | Network-only for checkout/cart/account URLs |
Requirements
- WordPress: 6.0+, PHP: 7.4+ (8.1+ recommended)
- PHP extensions:
opensslwith EC support;gmp(fallback ECDH for PHP < 8.1) - HTTPS required — service workers only run on secure origins
- Browser: Chrome 67+, Firefox 63+, Edge 79+, Safari 16.4+
Installation
- Upload
opwa/towp-content/plugins/, activate - Navigate to oPWA in WP admin
- Complete Manifest tab — app name, colors, icons
- Generate VAPID keys to enable push
- Visit your site — the SW registers and manifest is served
On activation: Creates 3 database tables (opwa_subscribers, opwa_campaigns, opwa_analytics), auto-detects site icon, generates default precache URL list.
