wc-action-scheduler-jobs

Installation
SKILL.md

WooCommerce Action Scheduler jobs

Action Scheduler is bundled with WooCommerce and is the right tool for background work: order sync, product imports, webhooks, retries, batch recalculation, export jobs, and recurring maintenance.

Use it instead of doing slow work during checkout, order status hooks, admin saves, or frontend requests.

Misconception this skill corrects

"I will pass $unique = true, so this side effect can happen exactly once."

WooCommerce 11.0 bundles Action Scheduler 4.0. Its DB store suppresses a unique insert only when a pending/running action has the same hook + group + encoded args. Jobs for order 10 and order 11 no longer block each other merely because they share a hook and group.

This is queue-entry deduplication, not exactly-once execution. A job can be manually re-created, retried, replayed after a restored backup, or finish its remote side effect before its local state is saved. Keep the callback idempotent and use a durable owned claim/provider idempotency key when duplicate business effects are unacceptable.

Treat $unique identity as active-version/store-specific. Action Scheduler 3.x DBStore used only hook and group; 4.0 adds args. Confirm the loaded version, source, and data store when another plugin can bundle its own copy. For a plugin supporting mixed 3.x/4.x runtimes, use exact as_has_scheduled_action() checks as a compatibility guard and still rely on callback idempotency for correctness.

"Exact args" means the same JSON representation. Associative key insertion order and scalar types matter: array( 'id' => 1, 'mode' => 'full' ) does not match reversed keys, and integer 1 does not match string '1'.

When to use this skill

Installs
1
GitHub Stars
22
First Seen
1 day ago
wc-action-scheduler-jobs — lonsdale201/wp-agent-skills