This page documents all the WordPress action hooks, AJAX endpoints, and custom cron schedules registered by the plugin. Use this as a reference when debugging, extending, or integrating with the plugin’s behavior.
WordPress Action Hooks
The plugin hooks into the following WordPress and WooCommerce actions to trigger sync operations and render UI elements.
Contact Sync Hooks
These hooks fire when the Contact Sync module is enabled and auto-sync on registration is turned on.
Hook
Priority
Description
woocommerce_created_customer
10
Syncs a newly registered WooCommerce customer to Mautic.
user_register
10
Syncs a newly registered WordPress user to Mautic.
profile_update
10
Syncs updated user profile data to Mautic.
Registration Consent Hooks
These hooks fire when the consent checkbox feature is enabled in Contact Sync settings.
Hook
Priority
Description
woocommerce_register_form
10
Renders the marketing consent checkbox on the WooCommerce registration form.
register_form
10
Renders the marketing consent checkbox on the WordPress registration form.
woocommerce_created_customer
5
Saves the consent checkbox value to user meta when a WooCommerce customer registers.
user_register
5
Saves the consent checkbox value to user meta when a WordPress user registers.
Order Sync Hooks
These hooks fire when the Order Sync module is enabled.
Hook
Priority
Description
woocommerce_order_status_changed
99
Triggers order data sync to Mautic when an order status changes. Sends contact data, order JSON, tags, lifetime value, optional notes, and optional email triggers.
woocommerce_subscription_status_updated
100
Handles WooCommerce Subscriptions status updates (requires WooCommerce Subscriptions plugin).
Abandoned Cart Hooks
These hooks fire when the Abandoned Cart module is enabled.
Hook
Priority
Description
wp_enqueue_scripts
10
Enqueues the abandoned cart capture JavaScript and CSS on the checkout page.
woocommerce_after_checkout_billing_form
10
Renders the GDPR consent checkbox on the checkout page (when GDPR is enabled and silent capture is off).
template_redirect
10
Handles cart recovery URLs (?mautic_woo_recover=TOKEN). Restores the cart contents and redirects to checkout.
woocommerce_checkout_order_processed
10
Marks abandoned carts as recovered when an order is placed with a matching email address.
Authentication Hooks
Hook
Priority
Description
admin_init
10
Handles the OAuth2 callback when Mautic redirects back with an authorization code.
Admin and UI Hooks
Hook
Priority
Description
admin_menu
10
Registers the settings page under WooCommerce and the top-level Mautic WooCommerce admin menu.
admin_enqueue_scripts
10
Enqueues admin CSS and JavaScript on the plugin settings pages.
admin_notices
10
Displays admin notices for requirements checks (PHP version, WooCommerce missing) and transient notices.
Frontend Asset Hooks
Hook
Priority
Description
wp_enqueue_scripts
10
Registers the subscribe form JavaScript and CSS (loaded only when the shortcode is used).
wp_enqueue_scripts
10
Enqueues the form capture JavaScript on all frontend pages (when Form Capture is enabled).
Cron Filter
Filter
Description
cron_schedules
Registers a custom fifteen_minutes cron interval (900 seconds) used by the abandoned cart processor.
AJAX Endpoints
All AJAX endpoints are registered through the plugin’s Ajax class. Each endpoint requires a valid nonce (mautic_woo_nonce) passed as the nonce POST parameter. Admin-only endpoints also require the manage_woocommerce capability. Responses are returned as JSON via wp_send_json_success() or wp_send_json_error().
Connection
Action Name
Access
Description
mautic_woo_test_connection
Admin only
Tests the connection to the configured Mautic instance by fetching a single contact. Returns success status and total contact count.
Mautic Fields
Action Name
Access
Description
mautic_woo_check_fields
Admin only
Checks which required custom fields exist in Mautic. Returns a status map of field aliases (mautic_woo_order_data, mautic_woo_cart_data, mautic_woo_recovery_url, mautic_woo_total_spent, mautic_woo_order_count, mautic_woo_coupon_code) with boolean values.
mautic_woo_create_fields
Admin only
Creates all required custom fields in Mautic that do not already exist. Returns the count of fields created and any errors.
Bulk Sync
Action Name
Access
Description
mautic_woo_start_bulk_sync
Admin only
Starts a bulk sync of all WooCommerce users to Mautic. Initializes the sync state transient and returns the total user count.
mautic_woo_bulk_sync_status
Admin only
Returns the current bulk sync progress (total, synced, errors, status). If the sync is running, it also processes the next batch of 5 users before returning the updated progress.
mautic_woo_cancel_bulk_sync
Admin only
Cancels an in-progress bulk sync and unschedules any pending cron batch.
mautic_woo_preview_bulk_sync
Admin only
Returns a preview of the mapped data for the first 10 users without actually syncing them.
Subscribe Form
Action Name
Access
Description
mautic_woo_subscribe
Public (nopriv)
Handles subscribe form submissions. Accepts email and optional tag POST parameters. Creates or updates a contact in Mautic with the email address and applies the specified tag along with the default tag from settings. This endpoint is available to both logged-in and logged-out users.
Abandoned Cart
Action Name
Access
Description
mautic_woo_capture_cart
Public (nopriv)
Captures cart data from the checkout page via AJAX. Saves or updates the cart contents, email, session ID, and GDPR consent status to the abandoned carts database table. This endpoint is available to both logged-in and logged-out users.
Tools
Action Name
Access
Description
mautic_woo_migrate_wootic
Admin only
Migrates settings from the legacy Wootic plugin. Reads old mautic_woocommerce_settings_* options and maps them into the new unified settings format. Returns the count of migrated settings.
mautic_woo_cleanup_legacy
Admin only
Deletes all legacy Wootic settings options from the database after migration. Returns the count of deleted options.
mautic_woo_clear_sync_log
Admin only
Truncates the sync log database table, removing all entries.
mautic_woo_get_sync_log
Admin only
Retrieves paginated sync log entries. Accepts page and per_page POST parameters (default: page 1, 25 per page, max 100). Returns rows, total count, current page, and total pages.
Custom Cron Schedules
The plugin registers the following WordPress cron events. All cron events are automatically cleared when the plugin is deactivated.
Cron Hook
Interval
Description
mautic_woo_process_abandoned_carts
Every 15 minutes
Scans for carts that have been inactive past the configured timeout, marks them as abandoned, and syncs them to Mautic. Applies the abandoned cart tag, sends cart data JSON, sets the recovery URL, optionally generates a coupon code, and adds the contact to a Mautic segment if configured.
mautic_woo_cleanup_old_carts
Daily
Deletes abandoned cart records older than 90 days from the database. Also cleans up expired recovery coupons when coupon generation is enabled.
mautic_woo_bulk_sync_batch
On demand
Processes batches of users during a bulk sync operation. This event is scheduled dynamically when a bulk sync is started and is unscheduled when the sync completes or is cancelled.
Recovery URL
The plugin registers a custom query parameter for cart recovery. When a visitor loads any page with the mautic_woo_recover query parameter, the plugin intercepts the request on the template_redirect hook, restores the cart contents, optionally applies a recovery coupon, and redirects the visitor to the checkout page.