=== DMValdez Cron Auditor ===
Contributors:      donaldmvaldez
Tags:               cron, wp-cron, performance, scheduler, debug
Requires at least: 5.8
Tested up to:      7.0
Requires PHP:      7.4
Stable tag:        1.2.1
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

See every WP-Cron job on your site in one dashboard, run or pause any of them on demand, and track how long each one actually takes to run.

== Description ==

WP-Cron quietly runs dozens of scheduled tasks on every WordPress site — core updates, plugin maintenance, email queues — and most site owners have no visibility into what's actually registered, when it will next run, or how much it costs in execution time. **DMValdez Cron Auditor** puts all of that in one clean dashboard.

= What's included in the free version =

**Cron Dashboard**
* Lists every registered cron job: hook name, arguments, next run date/time, and recurrence
* Search jobs by hook name
* Sortable columns

**Action Controls**
* Run any scheduled job immediately, on demand
* Pause a hook so it stops firing without deleting its schedule
* Resume a paused hook at any time
* Edit a job's recurrence and next-run time in place, without losing its hook or arguments
* Delete a single scheduled event
* Bulk pause/resume multiple jobs at once

**Schedule Manager**
* Add custom recurrence intervals (e.g. "Every 15 Minutes") beyond WordPress's built-in hourly/twicedaily/daily/weekly schedules
* Schedule brand-new cron events (one-time or recurring) with custom arguments

**Performance Impact**
* Measures real execution time for each cron hook, both from live WP-Cron ticks and manual "Run Now" triggers
* Rolling average execution time per hook
* Site-wide estimated cron impact summary

DMValdez Cron Auditor never deletes a job's underlying schedule when you pause it — pausing simply stops it from firing until you resume it, so nothing is lost.

= Pro (coming soon) =

A few Pro-only areas are visible (clearly marked, never functional in the free version) as a preview of what's coming:

* Advanced Historical Logs — full run history with success/failure and error output
* Email Alerts for Failed Crons

The free plugin will always remain fully functional on its own — these are optional additions, not a crippled trial.

== Installation ==

1. Upload the `dmvaldez-cron-auditor` folder to `/wp-content/plugins/`, or install it directly through **Plugins → Add New** in your WordPress dashboard.
2. Activate the plugin through the **Plugins** screen.
3. Go to **Cron Auditor** in your dashboard menu to view your site's scheduled cron jobs.

== Frequently Asked Questions ==

= Does this plugin create any new cron jobs on my site? =

No. DMValdez Cron Auditor only reads and manages the cron jobs already registered by WordPress core, your theme, and your other plugins, unless you explicitly use the Schedule Manager to add a new one yourself.

= What happens to a job when I pause it — is it deleted? =

No. Pausing a hook stops it from executing on future WP-Cron ticks, but its underlying schedule is left completely intact. Resuming it immediately restores normal behavior with no need to re-create the schedule.

= Does this work if I've disabled WP-Cron and use a real system cron job instead? =

Yes. DMValdez Cron Auditor reads from and writes to the same `cron` option that WordPress itself uses, so it works identically whether WP-Cron fires on page loads or you trigger `wp-cron.php` via a real system cron job.

= Will pausing or deleting a job break the plugin or theme that registered it? =

It can, if that plugin or theme depends on the job running on schedule. Use the pause/delete controls the same way you would use any cron management tool: understand what a hook does before disabling it. Core WordPress maintenance hooks are safe to leave alone.

= Does this plugin send any data outside my site? =

No. All cron data, schedules, and performance stats stay in your WordPress database. Nothing is transmitted externally.

= Does the performance profiler slow down my site? =

No. Timing callbacks are only attached during actual WP-Cron execution (`wp_doing_cron()`), never on regular front-end or admin page loads, and stats are stored with a small rolling window rather than an ever-growing log.

== Screenshots ==

1. The Cron Dashboard, listing every registered job with next run, recurrence, and average execution time.
2. The Schedule Manager, for adding custom recurrence intervals and scheduling new events.

== Changelog ==

= 1.2.1 =
* Fixed a bug where Run Now, Edit, and Delete could fail with "That cron event no longer exists" on any scheduled event — an internal sanitization step was corrupting the event reference before it could be looked up. Editing and deleting jobs now works reliably, including for jobs left behind by a plugin that's since been deactivated.
* Scheduling a new cron event under a hook name that already has an existing job now shows a confirmation, since pausing or resuming affects every job under that hook name together.

= 1.2.0 =
* Cron runs (real WP-Cron ticks, manual "Run Now", and even fatal-error failures) now fire an internal completion event, and failed runs are detected via a shutdown handler — this powers the optional DMValdez Cron Auditor Pro add-on's Historical Logs and Email Alerts features. No change in behavior for the free plugin on its own.

= 1.1.0 =
* Added an Edit action to the Cron Dashboard: change a scheduled job's recurrence and next-run time in place, without deleting and re-adding it.

= 1.0.0 =
* Initial release: cron dashboard, run/pause/resume/delete controls, custom schedule manager, and execution-time profiling.

== Upgrade Notice ==

= 1.1.0 =
Adds an in-place Edit action for changing a job's recurrence and next-run time.

= 1.0.0 =
Initial release.
