All commands use the wp opwa namespace.
wp opwa clear-cache
Bumps sw_version by 1, forcing all clients to delete and re-create caches on next SW activation.
bashwp opwa clear-cache
# Success: Cache cleared. New SW version: 4
wp opwa send-push
Send a push notification to all subscribers.
bashwp opwa send-push --title="New post" --body="Check out our latest article" --url="https://site.com/post"
# Success: Done. Sent: 142 / Failed: 3 / Total: 145
Options:
| Flag | Required | Description |
|---|---|---|
--title | Yes | Notification title |
--body | Yes | Notification body |
--url | No | Click-through URL |
--icon | No | Icon URL |
wp opwa list-subscribers
List all push subscribers.
bashwp opwa list-subscribers
wp opwa list-subscribers --format=json
wp opwa list-subscribers --format=csv
Output columns: ID, Device, User ID, Subscribed, Endpoint (truncated).
wp opwa generate-icons
Generate all PWA icon sizes from a WordPress attachment.
bashwp opwa generate-icons 42
# Success: Icons generated: 72x72, 96x96, 128x128, 144x144, 152x152, 192x192, 384x384, 512x512, maskable
The attachment must be a PNG or JPG at least 512×512 pixels.
wp opwa generate-vapid
Generate a new EC P-256 VAPID key pair and save it to the plugin options.
bashwp opwa generate-vapid
# Prompts for confirmation, then:
# Success: VAPID keys generated and saved.
# Public key: BFi2R7...
wp opwa generate-vapid --yes # Skip confirmation
wp opwa status
Display a summary of current plugin configuration.
bashwp opwa status
Output table:
| Setting | Value |
|---|---|
| Plugin version | 1.0.0 |
| SW version | 3 |
| App name | My Site |
| VAPID configured | Yes |
| Push subscribers | 142 |
| Pages strategy | network-first |
| … | … |
