2017 © Pedro Peláez
 

wordpress-plugin wp-crontrol

WP Crontrol lets you view and control what's happening in the WP-Cron system.

image

johnbillion/wp-crontrol

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 11 Open issues
  • 10 Versions
  • 4 % Grown

The README.md

WP Crontrol

Contributors: johnbillion, scompt
Tags: cron, wp-cron, crontrol, debug, woocommerce
Tested up to: 6.6
Stable tag: 1.17.0
Donate link: https://github.com/sponsors/johnbillion, (*1)

WP Crontrol enables you to take control of the cron events on your WordPress website., (*2)

Description

WP Crontrol enables you to take control of the cron events on your WordPress website. From the admin screens you can:, (*3)

  • View all cron events along with their arguments, schedule, callback functions, and when they are next due.
  • Edit, delete, pause, resume, and immediately run cron events.
  • Add new cron events.
  • Bulk delete cron events.
  • Add and remove custom cron schedules.
  • Export and download cron event lists as a CSV file.

WP Crontrol is aware of timezones, will alert you to events that have no actions or that have missed their schedule, and will show you a helpful warning message if it detects any problems with your cron system., (*4)

Usage

  1. Go to the Tools → Cron Events menu to manage cron events.
  2. Go to the Settings → Cron Schedules menu to manage cron schedules.

Other Plugins

I maintain several other plugins for developers. Check them out:, (*5)

  • Query Monitor is the developer tools panel for WordPress.
  • User Switching provides instant switching between user accounts in WordPress.

Privacy Statement

WP Crontrol is private by default and always will be. It does not send data to any third party, nor does it include any third party resources. WP Crontrol's full privacy statement can be found here., (*6)

Accessibility Statement

WP Crontrol aims to be fully accessible to all of its users. WP Crontrol's full accessibility statement can be found here., (*7)

Frequently Asked Questions

Does this plugin work with PHP 8?

Yes, it's actively tested and working up to PHP 8.3., (*8)

I get the error "There was a problem spawning a call to the WP-Cron system on your site". How do I fix this?

You can read all about problems spawning WP-Cron on the WP Crontrol website., (*9)

Why do some cron events miss their schedule?

You can read all about cron events that miss their schedule on the WP Crontrol website., (*10)

Why do some cron events reappear shortly after I delete them?

If the event is added by a plugin then the plugin most likely rescheduled the event as soon as it saw that the event was missing. To get around this you can instead use the "Pause this hook" action which means it'll remain in place but won't perform any action when it runs., (*11)

Is it safe to delete cron events?

This depends entirely on the event. You can use your favourite search engine to search for the event name in order to find out which plugin it belongs to, and then decide whether or not to delete it., (*12)

If the event shows "None" as its action then it's usually safe to delete. Please see the other FAQs for more information about events with no action., (*13)

Why can't I delete some cron events?

The WordPress core software uses cron events for some of its functionality and removing these events is not possible because WordPress would immediately reschedule them if you did delete them. For this reason, WP Crontrol doesn't let you delete these persistent events from WordPress core in the first place., (*14)

If you don't want these events to run, you can use the "Pause this hook" action instead., (*15)

What happens when I pause an event?

Pausing an event will disable all actions attached to the event's hook. The event itself will remain in place and will run according to its schedule, but all actions attached to its hook will be disabled. This renders the event inoperative but keeps it scheduled so as to remain fully compatible with events which would otherwise get automatically rescheduled when they're missing., (*16)

As pausing an event actually pauses its hook, all events that use the same hook will be paused or resumed when pausing and resuming an event. This is much more useful and reliable than pausing individual events separately., (*17)

What happens when I resume an event?

Resuming an event re-enables all actions attached to the event's hook. All events that use the same hook will be resumed., (*18)

What does it mean when "None" is shown for the Action of a cron event?

This means the cron event is scheduled to run at the specified time but there is no corresponding functionality that will be triggered when the event runs, therefore the event is useless., (*19)

This is often caused by plugins that don't clean up their cron events when you deactivate them. You can use your favourite search engine to search for the event name in order to find out which plugin it belongs to, and then decide whether or not to delete it., (*20)

How do I change the next run time or the schedule of a cron event?

You can change the time and schedule of a cron event by clicking the "Edit" link next to the event., (*21)

How can I create a cron event that requests a URL?

From the Tools → Cron Events menu, click on Add New Cron Event. Select the "URL cron event" option, fill out the details, and press the "Add Event" button., (*22)

You can read all about the features and security of URL cron events on the WP Crontrol website., (*23)

Why do changes that I make to some cron events not get saved?

You can read all about problems with editing cron events on the WP Crontrol website., (*24)

Can I export a list of cron events?

Yes, a CSV file of the event list can be exported and downloaded via the "Export" button on the cron event listing screen. This file can be opened in any spreadsheet application., (*25)

Can I see a historical log of all the cron events that ran on my site?

Not yet, but I hope to add this functionality soon., (*26)

Can I see a historical log of edits, additions, and deletions of cron events and schedules?

Yes. The excellent Simple History plugin has built-in support for logging actions performed via WP Crontrol., (*27)

What's the use of adding new cron schedules?

Cron schedules are used by WordPress and plugins for scheduling events to be executed at regular intervals. Intervals must be provided by the WordPress core or a plugin in order to be used. As an example, many backup plugins provide support for periodic backups. In order to do a weekly backup, a weekly cron schedule must be entered into WP Crontrol first and then a backup plugin can take advantage of it as an interval., (*28)

How do I create a new cron event?

There are two steps to getting a functioning cron event that executes regularly. The first step is telling WordPress about the hook. This is the part that WP Crontrol was created to provide. The second step is calling a function when your hook is executed., (*29)

Step One: Adding the event, (*30)

From the Tools → Cron Events menu, click on Add New Cron Event. Fill out the details of the event. You're best off using a hook name that conforms to normal PHP variable naming conventions. The schedule is how often the event will be executed. If you don't see a good interval, then add one in the Settings → Cron Schedules menu., (*31)

Step Two: Writing the function, (*32)

This part takes place in PHP code (for example, in the functions.php file from your theme). To execute your hook, WordPress runs an action. For this reason, we need to tell WordPress which function to execute when this action is run. The following line accomplishes that:, (*33)

add_action( 'my_hookname', 'my_function' );

The next step is to write your function. Here's a simple example:, (*34)

function my_function() {
    wp_mail( 'hello@example.com', 'WP Crontrol', 'WP Crontrol rocks!' );
}

How do I create a new PHP cron event?

From the Tools → Cron Events menu, click on "Add New Cron Event". Select the "PHP cron event" option and enter the schedule and next run time. The event schedule is how often your event will be executed. If you don't see a good interval, then add one in the Settings → Cron Schedules menu. In the "PHP Code" area, enter the PHP code that should be run when your cron event is executed. You don't need to provide the PHP opening tag (<?php)., (*35)

Creating, editing, and running PHP cron events is subject to restrictive security permissions. You can read all about the features and security of PHP cron events on the WP Crontrol website., (*36)

Which users can manage cron events and schedules?

Only users with the manage_options capability can manage cron events and schedules. By default, only Administrators have this capability., (*37)

Which users can manage PHP cron events? Is this dangerous?

Only users with the edit_files capability can manage PHP cron events. This means if a user cannot edit files via the WordPress admin area (i.e. through the Plugin Editor or Theme Editor) then they also cannot add, edit, or delete a PHP cron event in WP Crontrol. By default only Administrators have this capability, and with Multisite enabled only Super Admins have this capability., (*38)

If file editing has been disabled via the DISALLOW_FILE_MODS or DISALLOW_FILE_EDIT configuration constants then no user will have the edit_files capability, which means adding, editing, or deleting a PHP cron event will not be permitted., (*39)

Therefore, the user access level required to execute arbitrary PHP code does not change with WP Crontrol activated., (*40)

You can read all about the features and security of PHP cron events on the WP Crontrol website., (*41)

Are any WP-CLI commands available?

The cron commands which were previously included in WP Crontrol are now part of WP-CLI itself. See wp help cron for more info., (*42)

What happens when I deactivate the WP Crontrol plugin?

You can read all about what happens when you deactivate the plugin on the WP Crontrol website., (*43)

How can I report a security bug?

You can report security bugs through the official WP Crontrol Vulnerability Disclosure Program on Patchstack. The Patchstack team helps validate, triage, and handle any security vulnerabilities., (*44)

Who took the photo in the plugin header image?

The photo was taken by Michael Pardo and is in the public domain., (*45)

Screenshots

  1. Cron events can be modified, deleted, and executed
    , (*46)

  2. New cron events can be added
    , (*47)

  3. New cron schedules can be added, giving plugin developers more options when scheduling events
    , (*48)

The Versions

22/11 2017

dev-master

9999999-dev https://github.com/johnbillion/wp-crontrol/

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  Sources   Download

GPL-2.0+

The Requires

 

22/11 2017

dev-develop

dev-develop https://github.com/johnbillion/wp-crontrol/

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  Sources   Download

GPL-2.0+

The Requires

 

22/11 2017

1.6.2

1.6.2.0 https://github.com/johnbillion/wp-crontrol/

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  Sources   Download

GPL-2.0+

The Requires

 

22/11 2017

1.6.1

1.6.1.0 https://github.com/johnbillion/wp-crontrol/

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  Sources   Download

GPL-2.0+

The Requires

 

22/11 2017

1.6

1.6.0.0 https://github.com/johnbillion/wp-crontrol/

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  Sources   Download

GPL-2.0+

The Requires

 

04/04 2017

1.5.0

1.5.0.0 https://github.com/johnbillion/wp-crontrol/

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  Sources   Download

GPL-2.0+

The Requires

 

23/12 2016

1.4

1.4.0.0 https://github.com/johnbillion/wp-crontrol/

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  Sources   Download

GPL-2.0+

The Requires

 

03/07 2016

1.3.1

1.3.1.0 https://github.com/johnbillion/wp-crontrol/

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  Sources   Download

GPL-2.0+

The Requires

 

05/10 2015

1.3

1.3.0.0 https://github.com/johnbillion/wp-crontrol/

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  Sources   Download

GPL-2.0+

The Requires

 

04/03 2014

1.2.3

1.2.3.0 https://github.com/johnbillion/wp-crontrol/

WP Crontrol lets you view and control what's happening in the WP-Cron system.

  Sources   Download

GPL-2.0+

The Requires