Database Schema
All tables use {$wpdb->prefix}om_ prefix. Access table names via OM_DB::table( 'name' ).
Core Tables
om_subscribers
| Column | Type | Notes |
|---|---|---|
id | BIGINT UNSIGNED PK | Auto-increment |
email | VARCHAR(255) UNIQUE | Required |
first_name | VARCHAR(100) | |
last_name | VARCHAR(100) | |
status | ENUM | subscribed, unsubscribed, bounced, pending |
source | VARCHAR(100) | manual, import, shortcode, api, oforms, oonboard, woocommerce |
ip_address | VARCHAR(45) | IPv4 or IPv6 |
confirmed_at | DATETIME | Double opt-in confirmation time |
created_at | DATETIME | |
updated_at | DATETIME | Auto-updated |
confirmation_token | VARCHAR(64) | Double opt-in token |
engagement_score | TINYINT UNSIGNED | 0–100, decays daily |
last_engaged_at | DATETIME | Last open or click |
cold_since | DATETIME | When score dropped below cold threshold |
lead_score | INT | Cumulative lead score points |
lifecycle_stage | VARCHAR(60) | lead, subscriber, engaged, customer, advocate, churned |
optimal_send_hour | TINYINT UNSIGNED | 0–23, calculated from open history |
consent_timestamp | DATETIME | GDPR consent time |
consent_ip | VARCHAR(45) | |
consent_source | VARCHAR(100) | |
consent_text | TEXT | Consent language shown at signup |
om_campaigns
| Column | Type | Notes |
|---|---|---|
id | BIGINT UNSIGNED PK | |
subject | VARCHAR(255) | |
preview_text | VARCHAR(255) | Pre-header |
from_name | VARCHAR(100) | |
from_email | VARCHAR(100) | |
html_content | LONGTEXT | Rendered HTML |
json_design | LONGTEXT | Builder block JSON |
status | ENUM | draft, scheduled, sending, sent, paused |
list_id | BIGINT UNSIGNED | NULL = all subscribers |
scheduled_at | DATETIME | |
total_sent | INT UNSIGNED | |
total_opened | INT UNSIGNED | Unique opens |
total_clicked | INT UNSIGNED | Unique clicks |
total_bounced | INT UNSIGNED | |
ab_parent_id | BIGINT UNSIGNED | A/B test parent |
ab_split_pct | TINYINT | % of list for this variant |
ab_winner_metric | ENUM | open_rate, click_rate |
ab_eval_hours | SMALLINT | Evaluation window |
ab_status | ENUM | none, control, variant, winner, loser |
send_mode | ENUM | immediate, smart, scheduled |
revenue_attributed | DECIMAL(10,2) | WooCommerce revenue |
Additional Tables
| Table | Purpose |
|---|---|
om_lists | Named mailing lists |
om_list_subscriber | Junction: subscribers ↔ lists |
om_sends | Per-subscriber send record (status, open/click) |
om_events | Granular event log (open, click, bounce, unsubscribe, complaint) |
om_tags | Tag definitions (name, slug) |
om_subscriber_tags | Junction: subscribers ↔ tags |
om_custom_fields | Custom field definitions |
om_subscriber_meta | Custom field values per subscriber |
om_automations | Automation definitions (trigger, status) |
om_automation_steps | Ordered steps per automation |
om_automation_runs | Subscriber progress through automations |
om_consent_log | GDPR consent and erasure log |
om_lead_score_rules | Lead scoring rules (event type → points) |
om_segments | Segment definitions (conditions JSON) |
om_suppressed | Global suppression list |
om_wc_carts | WooCommerce abandoned cart snapshots |
om_wc_revenue | WooCommerce revenue attribution |
om_webhooks | Outbound webhook definitions |
om_webhook_log | Webhook delivery log |
om_rss_feeds | RSS feed monitor config |
om_lifecycle_stages | Lifecycle stage definitions |
