WooCommerce export queue issue

User
WooCommerce Customer/Order/Coupon Export plugin Export scherdule job not woeing always shows queueued
Assistant
Got it—when that export stays “Queued,” it’s almost always a cron/Action Scheduler issue, not the plugin itself. Do this quick, surgical checklist:

# 1) Verify WP‑Cron is actually running
– Open: `https://your-site.com/wp-cron.php?doing_wp_cron`
– If it downloads/200s quickly, good. If it times out or returns an HTML/login page, something (auth, firewall, cache) is blocking it.

– In `wp-config.php`:

// If you don't have a real system cron, leave this as false or remove it:
define('DISABLE_WP_CRON', false);

// If your host blocks loopback requests, try:
define('ALTERNATE_WP_CRON', true);

// Give WP some headroom:
define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '256M');

– If you **do** prefer a real cron (recommended), set:

* * * * * curl -s https://your-site.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

…and in `wp-config.php` set `define('DISABLE_WP_CRON', true);`

# 2) Check Action Scheduler (the queue engine WooCommerce + this plugin use)
WP‑Admin → **WooCommerce → Status → Scheduled actions**
– Filter by **Pending** and search for hooks like:
– `wc_customer_order_csv_export_*`
– `wc_customer_order_export_*`
– If you see many **Pending** and none **Completing/Completed**, the runner isn’t firing.
– If you see **Failed/In‑progress** stuck, select them → **Cancel** (or **Run** one) to unblock.

**WP‑CLI** (fastest way to kick it):

# Run all due actions:
wp action-scheduler run

# If there’s a backlog, increase batch size:
wp action-scheduler run --batch-size=100

# Inspect just export hooks:
wp action-scheduler list --search=wc_customer_order --status=pending --per-page=50

# 3) Kill common blockers
– **HTTP Auth / Maintenance plugins / Under construction**: allowlist `/wp-cron.php` and loopback requests.
– **Cloudflare / Caching**: add page rules to **Bypass cache** for:
– `/wp-cron.php*`
– `/wp-admin/admin-ajax.php*`
– **Security plugins**: ensure loopback requests aren’t blocked (Site Health should show Loopback OK).

# 4) Destination sanity (when it *does* run)
If your Scheduled Export is set to **Save to Server/FTP/SFTP/HTTP POST**:
– **Save to Server**: folder exists, writable by PHP (owner/group), perms `755` dir / `644` files.
– **FTP/SFTP**: “Test” the connection in the export settings; verify passive mode if needed.
– **HTTP POST**: endpoint reachable (no auth/cors/403).

# 5) Nudge the runner, then re‑queue your job
– Cancel the stuck “Queued” export.
– Recreate the schedule (or click **Run** once).
– Watch **Scheduled actions** for a minute—should go Pending → In‑progress → Complete.

# 6) Optional hardening for busy sites
Add these to `wp-config.php` to help the Action Scheduler runner:

// Let Action Scheduler run longer if big exports:
define('ACTION_SCHEDULER_QUEUE_RUNNER_TIME_LIMIT', 120);
define('ACTION_SCHEDULER_DEFAULT_CRON_INTERVAL', 60); // seconds

# 7) Quick health checks
– **Tools → Site Health**: Loopback requests = **Passing**.
– **WooCommerce → Status → Logs**: check for export or Action Scheduler errors.
– PHP `max_execution_time` ≥ 120s, and no fatal errors in server error logs.

If you want, paste:
– a screenshot of **Scheduled actions** filtered to the export hooks,
– your `wp-config.php` cron-related lines,
– and how you’re delivering the file (Server/FTP/POST),

and I’ll pinpoint the exact blocker + give the minimal fix.

User
can you give me real job name
Assistant
Yes 👍
The **WooCommerce Customer/Order/Coupon Export** plugin runs its exports through **Action Scheduler**. The job (hook) names you’ll actually see in **WooCommerce → Status → Scheduled Actions** are usually like this:

– For **automatic scheduled exports**:

wc_customer_order_csv_export_auto_export

– For **manual/single exports** (triggered in the admin):

wc_customer_order_csv_export_batch_export

– If you’re exporting **coupons**:

wc_customer_order_coupon_export_batch_export

– If you’re exporting **customers**:

wc_customer_export_batch_export

✅ So in your case, look in **Scheduled Actions** for:

**`wc_customer_order_csv_export_auto_export`** → this is the one that stays “Queued” if cron/Action Scheduler isn’t firing.

Do you want me to give you the exact **WP-CLI command** that will find and force-run just that job, so you can confirm exports work immediately?

User
/wp-cron.php?doing_wp_cron return blank page quickly
Assistant
That behavior is normal. A fast, blank response from `/wp-cron.php?doing_wp_cron` just means WP‑Cron is reachable and returned 200 with no output. So cron itself isn’t the blocker—your export action likely isn’t being created or isn’t being picked up by Action Scheduler.

Do this (quick + exact):

1) Find the actual queued job
WooCommerce → Status → Scheduled actions
– Filter: **Pending**
– Search hooks for:
– `wc_customer_order_csv_export_auto_export` (scheduled/automatic orders export)
– `wc_customer_order_csv_export_batch_export` (manual/batch orders export)
– `wc_customer_export_batch_export` (customers)
– `wc_customer_order_coupon_export_batch_export` (coupons)

2) If you see it Pending, force-run it
– Click **Run** on one pending action and watch it go In‑progress → Complete.
– If you have WP‑CLI:

# See pending export actions
  wp action-scheduler list --status=pending --search=wc_customer_order_csv_export --per-page=50

  # Run due actions (kicks the queue)
  wp action-scheduler run

  # If there’s a backlog:
  wp action-scheduler run --batch-size=100

3) If you don’t see any export actions at all
Your schedule isn’t being created. Re‑save it:
WooCommerce → **Customer/Order/Coupon Export** → **Export** (or “Export List”)
– Edit your export **profile** → **Enable automatic export**
– Set a start time in the future (e.g., a few minutes ahead), pick recurrence, **Save**.
– Wait a minute, then recheck Scheduled actions for `wc_customer_order_csv_export_auto_export`.

4) If actions get “In‑progress” and stick
– Bump limits in `wp-config.php`:

define('ACTION_SCHEDULER_QUEUE_RUNNER_TIME_LIMIT', 120);
  define('ACTION_SCHEDULER_DEFAULT_CRON_INTERVAL', 60);
  define('WP_MEMORY_LIMIT', '256M');
  define('WP_MAX_MEMORY_LIMIT', '256M');

– Ensure PHP `max_execution_time` ≥ 120s.
– If you’re on Cloudflare or heavy caching, bypass:
– `/wp-cron.php*` and `/wp-admin/admin-ajax.php*` (no cache/Firewall challenges)

5) Prefer a real (system) cron (optional but solid)
– In `wp-config.php`:

define('DISABLE_WP_CRON', true);

– Server crontab (every minute):

* * * * * curl -s https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

6) Quick sanity checks
– Tools → **Site Health** → Loopback requests should be **Passing**.
– WooCommerce → **Status → Logs**: look for Action Scheduler or export errors.
– If exporting to **Save to Server**, verify the destination folder exists and is writable. For **FTP/SFTP**, hit the “Test” button in the export settings.

If you paste a screenshot of Scheduled actions (filtered to `wc_customer_order_csv_export_*`) and your export profile’s schedule settings, I’ll tell you exactly which step is blocking it.

Leave a Comment

Your email address will not be published. Required fields are marked *