Duplicate scheduled actions bug
-
Hello CartBounty support team,
I'm writing to report what appears to be a bug with how CartBounty schedules its recurring Action Scheduler actions on my WooCommerce site.
Issue summary:
The cartbounty_sync_hook action is being scheduled and executed twice at exactly the same timestamp, every 5 minutes, 24 hours a day. This results in approximately 288 duplicate executions per day.
Evidence from my Action Scheduler database:
In a recent 5-hour analysis window (01:00–06:00 site time), I found:
114 total cartbounty_sync_hook completed actions
57 of them were exact duplicates (same scheduled_date_gmt to the second)
Sample of duplicate entries (each timestamp shows 2 separate action_id rows):
2026-05-05 01:01:40 → 2 duplicate actions
2026-05-05 01:06:53 → 2 duplicate actions
2026-05-05 01:12:38 → 2 duplicate actions
2026-05-05 01:18:14 → 2 duplicate actions
2026-05-05 01:23:40 → 2 duplicate actions
… (pattern continues every ~5 minutes)
The same pattern is currently visible in my Pending actions queue — two cartbounty_sync_hook rows scheduled for the exact same future timestamp.
Likely cause:
This is a known pattern that occurs when as_schedule_recurring_action() is called without the $unique = true parameter (or without an as_unschedule_action() check before re-registering). Each plugin load registers the action again, creating a duplicate. The same bug existed in another plugin I use (Product Feed Pro / AdTribes) and was fixed by adding the unique flag.
Environment:
WordPress: 6.9.4
WooCommerce: 10.7
CartBounty: 8.10
PHP: 8.3.30
HPOS: enabled
Action Scheduler: bundled with WooCommerce
Impact:
While each individual sync is lightweight, running it twice every 5 minutes (288 times/day instead of 144) doubles the database load and CPU usage from this hook. On shared hosting environments this contributes measurably to resource consumption.
Request:
Could you confirm whether this is a known issue?
If yes, is there a fix available or planned?
In the meantime, is it safe for me to manually unschedule the duplicate using as_unschedule_action() without breaking plugin functionality?
I'm happy to provide additional logs or run any diagnostic snippet you suggest.
Thank you for your time,The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.