{prefix}opwa_subscribers
| Column | Type | Description |
|---|---|---|
id | BIGINT UNSIGNED AUTO_INCREMENT | Primary key |
endpoint | TEXT NOT NULL | Push subscription URL |
p256dh | TEXT NOT NULL | Client public key |
auth | VARCHAR(255) | Auth secret |
user_id | BIGINT UNSIGNED NULL | WP user ID if logged in |
device_type | VARCHAR(20) | mobile, tablet, desktop |
user_agent | TEXT | Raw UA string |
created_at | DATETIME | Subscription time |
Unique index on MD5 hash of endpoint to prevent duplicates.
{prefix}opwa_campaigns
| Column | Type | Description |
|---|---|---|
id | BIGINT UNSIGNED AUTO_INCREMENT | Primary key |
title | VARCHAR(255) | Notification title |
body | TEXT | Notification body |
icon_url | VARCHAR(1000) | Icon URL |
click_url | VARCHAR(1000) | Click-through URL |
sent | INT | Successful deliveries |
failed | INT | Failed deliveries |
total | INT | Total subscribers at send time |
created_at | DATETIME | Send time |
{prefix}opwa_analytics
One row per calendar date.
| Column | Type | Description |
|---|---|---|
id | BIGINT UNSIGNED AUTO_INCREMENT | Primary key |
stat_date | DATE NOT NULL | Date (YYYY-MM-DD) |
page_views_total | INT | Total page view beacons |
page_views_sw | INT | PVs where SW was active |
cache_hits | INT | Cache-served responses |
cache_misses | INT | Network-fallback responses |
offline_sessions | INT | Sessions without network |
install_prompts_shown | INT | Install banner impressions |
installs | INT | appinstalled events |
install_dismissals | INT | Banner dismissals |
sw_registrations | INT | SW registration events |
Unique key on stat_date. record_beacon() uses INSERT … ON DUPLICATE KEY UPDATE so concurrent requests safely increment counters.
