The plugin creates two custom database tables during activation. Both tables are created using the WordPress dbDelta() function, which handles both initial creation and schema upgrades. The current database schema version is 1.2.0, stored in the mautic_woo_db_version option.
Table names use the WordPress database prefix (typically wp_). The examples below use wp_ as the prefix, but your tables will use whatever prefix is configured in your wp-config.php file.
wp_mautic_woo_abandoned_carts
Stores abandoned cart data captured from the checkout page. Each row represents a single cart session, tracking its lifecycle from active through abandoned and optionally recovered.
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | BIGINT(20) UNSIGNED | NOT NULL | AUTO_INCREMENT | Primary key. |
session_id | VARCHAR(255) | NOT NULL | '' | The WooCommerce session ID or a generated UUID for guest visitors. |
user_id | BIGINT(20) UNSIGNED | YES | NULL | The WordPress user ID if the visitor is logged in. |
email | VARCHAR(255) | YES | NULL | The email address captured from the checkout billing email field. |
cart_contents | LONGTEXT | NOT NULL | – | JSON-encoded array of cart items. Each item contains product_id, name, price, quantity, variation_id, and variation data. |
cart_total | DECIMAL(10,2) | NOT NULL | 0.00 | The total value of the cart. |
currency | VARCHAR(3) | NOT NULL | 'USD' | The three-letter ISO currency code for the cart total. |
product_names | TEXT | YES | NULL | A human-readable list of product names in the cart. |
gdpr_consent | TINYINT(1) | NOT NULL | 0 | Whether the visitor checked the GDPR consent checkbox. 1 = consented, 0 = not consented. |
status | VARCHAR(20) | NOT NULL | 'active' | The current status of the cart. Possible values: active, abandoned, synced, recovered. |
mautic_contact_id | BIGINT(20) UNSIGNED | YES | NULL | The Mautic contact ID once the cart has been synced. |
created_at | DATETIME | NOT NULL | CURRENT_TIMESTAMP | When the cart record was first created. |
updated_at | DATETIME | NOT NULL | CURRENT_TIMESTAMP | When the cart record was last updated (e.g., cart contents changed). |
abandoned_at | DATETIME | YES | NULL | When the cart was marked as abandoned by the cron processor. |
synced_at | DATETIME | YES | NULL | When the cart data was successfully synced to Mautic. |
recovery_token | VARCHAR(64) | YES | NULL | A unique token used to build the cart recovery URL. |
coupon_code | VARCHAR(64) | YES | NULL | The WooCommerce coupon code generated for this cart (if coupon generation is enabled). |
recovered_at | DATETIME | YES | NULL | When the cart was recovered (i.e., when the customer completed checkout). |
Indexes
| Index Name | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary Key | id | Unique row identifier. |
idx_recovery_token | Unique Key | recovery_token | Fast lookup of carts by recovery token for the recovery URL handler. Enforces uniqueness of tokens. |
idx_session | Index | session_id | Find carts by WooCommerce session ID for cart updates. |
idx_email | Index | email | Find carts by email address for recovery matching on checkout. |
idx_status | Index | status | Filter carts by status for cron processing. |
idx_status_updated | Compound Index | status, updated_at | Efficiently query active carts that have been idle past the abandonment timeout. |
idx_user | Index | user_id | Find carts by logged-in user ID. |
Status Lifecycle
Cart records move through the following statuses:
- active – The cart is being tracked. Updated each time the visitor modifies their cart on the checkout page.
- abandoned – The cron processor has determined the cart is abandoned (inactive past the timeout). The
abandoned_attimestamp is set. - synced – The abandoned cart data has been successfully sent to Mautic. The
synced_attimestamp andmautic_contact_idare set. - recovered – The customer returned and completed checkout. The
recovered_attimestamp is set, and the recovered cart tag is applied in Mautic.
wp_mautic_woo_sync_log
Records every sync operation performed by the plugin. This table provides an audit trail for debugging and monitoring sync activity. Entries can be viewed and cleared from the Tools tab in the plugin settings.
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | BIGINT(20) UNSIGNED | NOT NULL | AUTO_INCREMENT | Primary key. |
object_type | VARCHAR(50) | NOT NULL | – | The type of WordPress object being synced. Values: contact, order, abandoned_cart. |
object_id | BIGINT(20) UNSIGNED | NOT NULL | – | The WordPress ID of the object (user ID, order ID, or abandoned cart ID). |
mautic_contact_id | BIGINT(20) UNSIGNED | YES | NULL | The Mautic contact ID involved in the operation, if available. |
action | VARCHAR(50) | NOT NULL | – | The sync action performed. Values: create_or_update, cart_sync, cart_recovery, add_to_segment, create_note, send_email. |
status | VARCHAR(20) | NOT NULL | 'pending' | The result of the operation. Values: pending, success, error. |
message | TEXT | YES | NULL | A human-readable description of the result, such as “Synced to contact #42” or an error message. |
request_data | LONGTEXT | YES | NULL | JSON-encoded request payload sent to the Mautic API (for debugging). |
response_data | LONGTEXT | YES | NULL | JSON-encoded response received from the Mautic API (for debugging). |
created_at | DATETIME | NOT NULL | CURRENT_TIMESTAMP | When the log entry was created. |
Indexes
| Index Name | Type | Columns | Purpose |
|---|---|---|---|
PRIMARY | Primary Key | id | Unique row identifier. |
idx_object | Compound Index | object_type, object_id | Lookup all sync log entries for a specific object (e.g., all entries for order #123). |
idx_status | Index | status | Filter entries by result status (success, error, pending). |
idx_created | Index | created_at | Sort and filter entries by creation date for paginated display. |
WordPress Options
In addition to the custom tables, the plugin uses the following entries in the wp_options table:
| Option Name | Type | Description |
|---|---|---|
mautic_woo_settings | Serialized array | All plugin settings stored as a single serialized option. Accessed via dot-notation through the Settings::get() method. |
mautic_woo_db_version | String | The current database schema version. Used to trigger automatic schema upgrades on the admin side. |
User Meta
The plugin stores the following user meta values:
| Meta Key | Values | Description |
|---|---|---|
_mautic_woo_marketing_consent | yes / no | Records whether the user checked the marketing consent checkbox during registration. Used by Contact Sync to determine whether to sync the user to Mautic. |
Transients
The plugin uses the following transient for temporary state:
| Transient Key | Expiry | Description |
|---|---|---|
mautic_woo_bulk_sync_state | 1 hour | Stores the current state of a bulk sync operation, including total users, synced count, errors array, offset, and status (running, completed, cancelled, idle). |