Stack Matrix Hub (8)
Disabling Staging WP-Cron, Action Scheduler & Transactional Mail
Stop cloned WooCommerce Subscriptions, reminder emails, and webhook bursts from firing twice from staging databases.
DISABLE_WP_CRON=true · Action Scheduler paused · Outbound SMTP sinked
The Double-Execution Hazard in Cloned Stores
A freshly imported production database carries queued Action Scheduler jobs, WooCommerce renewal triggers, and CRM webhooks. The first unguarded request to a staging URL can fire duplicate renewal invoices or overwrite external ERP stock.
Three-Layer Cron, Webhook & Mail Kill Switch
Immediately after DB import, set DISABLE_WP_CRON true in wp-config.php, pause Action Scheduler queues via WP-CLI, switch payment gateways to sandbox keys, and route wp_mail() into Mailpit or a no-op mu-plugin filter.
Measured Thresholds & Configuration
| Staging Hazard Vector | Impact if Left Active | Mandatory Clone Mitigation |
|---|---|---|
| WP-Cron & Action Scheduler | Duplicate subscription renewals | wp config set DISABLE_WP_CRON true --raw |
| SMTP / Transactional Mail | Confuses real customers with test mail | MU-plugin pre_wp_mail sink or Mailpit |
| Live Stripe / ERP Webhooks | Corrupts live inventory & billing | WP_ENVIRONMENT_TYPE=staging + key scrub |