Skip to main content
Cookbook Maintenance WP Crontrol

Find Out Why a Scheduled Task Failed with WP Crontrol and AI

Find the task, read its last runs and errors in WP Crontrol, and get the cause and the one fix in plain words.

Difficulty Beginner
Time ~10 min

Prerequisites

A site connected to WPVibe running WP Crontrol 2.0 or newer (tested on 2.0.0, free) on WordPress 6.9 or newer, with an administrator account.

The prompt
My WordPress site uses WP Crontrol. [Describe what didn't happen, for example: my backup didn't run last night, or the weekly digest email never went out.] Find out why.

1. Run discover_abilities with category wp-crontrol. If the ability this needs is not there, stop and tell me to install or update the free WP Crontrol plugin (2.0 or newer, on WordPress 6.9 or newer).
2. Run wp-crontrol/list-events with search set to one lowercase word from the hook name (hook names are lowercase with underscores and the search matches exact text, so try a few, such as the plugin's name or slug, backup, digest, sync). If several match, show me the hook names and what they do, and ask which one. If none match, tell me the task is not a WP-Cron event on this site: many plugins, WooCommerce among them, run their jobs through Action Scheduler instead (WooCommerce, Status, Scheduled Actions), which WP Crontrol does not list. Otherwise the plugin that owns it has not scheduled it, and its settings or support docs are the place to look. Then stop.
3. For that event, tell me in plain words: paused true means it is paused and does nothing when it runs; has_action false means nothing was attached to the hook when WP Crontrol looked: usually the plugin that added it is inactive or removed, but some active plugins attach their handler only while cron runs, so check it against my active plugins before calling it left over; schedule_missing true means its schedule was removed; next_run_site in the past means it is overdue, and late true means more than 10 minutes overdue, which points at WP-Cron itself not running.
4. Run wp-crontrol/list-logs with the hook and hours 720. If there are runs, run wp-crontrol/get-log on the latest errored one, or the latest one, and explain its errors, messages, failed emails and HTTP requests. A run marked completed can still have failed: check warning, emails_failed and messages too.
5. If logged_hooks does not include this hook, tell me logging was off, so past runs were not recorded. Ask me before turning it on, then run wp-crontrol/set-hook-logging with the hook and enabled true.
6. If the event is paused, do not run it: it would do nothing, and run-event refuses paused events. If the event is overdue, do not run it: WPVibe's own requests count as visits, so it has probably started already. Run wp-crontrol/list-events with the same search again. If its next_run_site is now in the future, or a one-off event is gone, it ran: if logging is on for it, run wp-crontrol/list-logs with the hook and hours 1 and read the new run with wp-crontrol/get-log. If it is still overdue and late is true, tell me WP-Cron is probably not running on this site. In every other case, if logging is on for it, ask me whether to run it once now, telling me first that it does the task's real work (emails, payments, syncs) right now. Only if I say yes, run wp-crontrol/run-event once with its hook and sig, then run wp-crontrol/list-logs with the hook and hours 1 (the run takes a few seconds to appear, so check again if it is not there yet) and read the new run with wp-crontrol/get-log. If logging is off for it, do not run it: the result would not be recorded.
7. Tell me the cause in one or two sentences, which plugin or code it comes from (the actions list names the function or file), and the one fix. Do not change anything else. If you turned logging on only for this, ask whether to keep it on or turn it off with wp-crontrol/set-hook-logging enabled false.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Find Out Why a Scheduled Task Failed with WP Crontrol and AI” recipe from the WPVibe cookbook on my connected site.

A backup didn’t run, a digest email never went out, a stock sync stopped. WordPress runs those jobs in the background with WP-Cron, and when one fails nothing tells you. Finding out usually means reading code or error logs you can’t easily reach.

The AI finds the task in WP Crontrol, checks whether it is paused, overdue or left behind by a plugin you removed, and reads its logs: the error, failed emails, HTTP requests and how long it took. If the task isn’t logged yet, it asks before turning logging on and before running it once, then explains what went wrong in plain words and the one thing that would fix it.

WP Crontrol only records runs of tasks with logging on, and logging is off until you turn it on, so a first check may have no history to read. Running a task does its real work: a task that sends email or takes payments does it again, so the AI asks first. An overdue task starts on the next visit to your site anyway, so the AI waits for that rather than running it on top. For a general check of every task, use this recipe.

Outcome

You know why the task failed or didn't run, and the one fix, with nothing changed except what you said yes to.