Database Tables

Updated on February 9, 2026

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

ColumnTypeNullableDefaultDescription
idBIGINT(20) UNSIGNEDNOT NULLAUTO_INCREMENTPrimary key.
session_idVARCHAR(255)NOT NULL''The WooCommerce session ID or a generated UUID for guest visitors.
user_idBIGINT(20) UNSIGNEDYESNULLThe WordPress user ID if the visitor is logged in.
emailVARCHAR(255)YESNULLThe email address captured from the checkout billing email field.
cart_contentsLONGTEXTNOT NULLJSON-encoded array of cart items. Each item contains product_id, name, price, quantity, variation_id, and variation data.
cart_totalDECIMAL(10,2)NOT NULL0.00The total value of the cart.
currencyVARCHAR(3)NOT NULL'USD'The three-letter ISO currency code for the cart total.
product_namesTEXTYESNULLA human-readable list of product names in the cart.
gdpr_consentTINYINT(1)NOT NULL0Whether the visitor checked the GDPR consent checkbox. 1 = consented, 0 = not consented.
statusVARCHAR(20)NOT NULL'active'The current status of the cart. Possible values: active, abandoned, synced, recovered.
mautic_contact_idBIGINT(20) UNSIGNEDYESNULLThe Mautic contact ID once the cart has been synced.
created_atDATETIMENOT NULLCURRENT_TIMESTAMPWhen the cart record was first created.
updated_atDATETIMENOT NULLCURRENT_TIMESTAMPWhen the cart record was last updated (e.g., cart contents changed).
abandoned_atDATETIMEYESNULLWhen the cart was marked as abandoned by the cron processor.
synced_atDATETIMEYESNULLWhen the cart data was successfully synced to Mautic.
recovery_tokenVARCHAR(64)YESNULLA unique token used to build the cart recovery URL.
coupon_codeVARCHAR(64)YESNULLThe WooCommerce coupon code generated for this cart (if coupon generation is enabled).
recovered_atDATETIMEYESNULLWhen the cart was recovered (i.e., when the customer completed checkout).

Indexes

Index NameTypeColumnsPurpose
PRIMARYPrimary KeyidUnique row identifier.
idx_recovery_tokenUnique Keyrecovery_tokenFast lookup of carts by recovery token for the recovery URL handler. Enforces uniqueness of tokens.
idx_sessionIndexsession_idFind carts by WooCommerce session ID for cart updates.
idx_emailIndexemailFind carts by email address for recovery matching on checkout.
idx_statusIndexstatusFilter carts by status for cron processing.
idx_status_updatedCompound Indexstatus, updated_atEfficiently query active carts that have been idle past the abandonment timeout.
idx_userIndexuser_idFind carts by logged-in user ID.

Status Lifecycle

Cart records move through the following statuses:

  1. active – The cart is being tracked. Updated each time the visitor modifies their cart on the checkout page.
  2. abandoned – The cron processor has determined the cart is abandoned (inactive past the timeout). The abandoned_at timestamp is set.
  3. synced – The abandoned cart data has been successfully sent to Mautic. The synced_at timestamp and mautic_contact_id are set.
  4. recovered – The customer returned and completed checkout. The recovered_at timestamp 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

ColumnTypeNullableDefaultDescription
idBIGINT(20) UNSIGNEDNOT NULLAUTO_INCREMENTPrimary key.
object_typeVARCHAR(50)NOT NULLThe type of WordPress object being synced. Values: contact, order, abandoned_cart.
object_idBIGINT(20) UNSIGNEDNOT NULLThe WordPress ID of the object (user ID, order ID, or abandoned cart ID).
mautic_contact_idBIGINT(20) UNSIGNEDYESNULLThe Mautic contact ID involved in the operation, if available.
actionVARCHAR(50)NOT NULLThe sync action performed. Values: create_or_update, cart_sync, cart_recovery, add_to_segment, create_note, send_email.
statusVARCHAR(20)NOT NULL'pending'The result of the operation. Values: pending, success, error.
messageTEXTYESNULLA human-readable description of the result, such as “Synced to contact #42” or an error message.
request_dataLONGTEXTYESNULLJSON-encoded request payload sent to the Mautic API (for debugging).
response_dataLONGTEXTYESNULLJSON-encoded response received from the Mautic API (for debugging).
created_atDATETIMENOT NULLCURRENT_TIMESTAMPWhen the log entry was created.

Indexes

Index NameTypeColumnsPurpose
PRIMARYPrimary KeyidUnique row identifier.
idx_objectCompound Indexobject_type, object_idLookup all sync log entries for a specific object (e.g., all entries for order #123).
idx_statusIndexstatusFilter entries by result status (success, error, pending).
idx_createdIndexcreated_atSort 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 NameTypeDescription
mautic_woo_settingsSerialized arrayAll plugin settings stored as a single serialized option. Accessed via dot-notation through the Settings::get() method.
mautic_woo_db_versionStringThe 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 KeyValuesDescription
_mautic_woo_marketing_consentyes / noRecords 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 KeyExpiryDescription
mautic_woo_bulk_sync_state1 hourStores the current state of a bulk sync operation, including total users, synced count, errors array, offset, and status (running, completed, cancelled, idle).

Next