WP Crontrol

Beskrivning

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

  • Se alla cron-händelser tillsammans med deras argument, schema, återanrops-funktioner och när de ska köras nästa gång.
  • Ändra, ta bort, pausa, återstarta och kör omedelbart cron-händelser.
  • Lägg till nya Cron-händelser.
  • Massborttagning av Cron-händelser.
  • Lägg till, redigera och ta bort anpassade Cron-scheman.
  • 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.

Användning

  1. Gå till menyn Verktyg Cron-händelser för att hantera Cron-händelser.
  2. Gå till menyn Inställningar Cron-scheman för att hantera Cron-scheman.

Andra tillägg

Jag underhåller flera andra tillägg för utvecklare. Kolla in dem:

  • Query Monitor är panelen för utvecklarverktyg för WordPress.
  • User Switching gör det möjligt att omedelbart växla mellan användarkonton i WordPress.

Integritetsmeddelande

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.

Tillgänglighetsförklaring

WP Crontrol aims to be fully accessible to all of its users. WP Crontrol’s full accessibility statement can be found here.

Skärmdumpar

  • Cron events can be modified, deleted, and executed

  • Nya cron-händelser kan läggas till

  • Nya Cron-scheman kan läggas till, vilket ger tilläggsutvecklare fler alternativ när de schemalägger händelser

Vanliga frågor

Fungerar detta tillägg med PHP 8?

Ja, det testas regelbundet och fungerar upp till PHP 8.3.

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.

Varför missar vissa cron-händelser sitt schema?

You can read all about cron events that miss their schedule on the WP Crontrol website.

Varför dyker vissa cron-händelser upp igen kort efter att jag tagit bort dem?

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.

Är det säkert att ta bort cron-händelser?

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.

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.

Varför kan jag inte ta bort några cron-händelser?

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.

If you don’t want these events to run, you can use the ”Pause this hook” action instead.

Vad sker när jag pausar en händelse?

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.

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.

Vad sker när jag återstartar en händelse?

Att återuppta en händelse återaktiverar alla åtgärder kopplade till händelsens åtgärds-hook. Alla händelser som använder samma åtgärds-hook kommer att återupptas.

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.

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.

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.

Hur kan jag skapa en cron-händelse som begär en 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.

You can read all about the features and security of URL cron events on the WP Crontrol website.

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.

Kan jag exportera en lista över cron-händelser?

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.

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

Inte än, men jag hoppas kunna lägga till denna funktion snart.

Kan jag se en logghistorik med ändringar, tillägg och borttagningar av cron-händelser och -scheman?

Yes. The excellent Simple History plugin has built-in support for logging actions performed via WP Crontrol.

Vad är nyttan med att lägga till nya Cron-scheman?

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.

Hur skapar jag en ny Cron-händelse?

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.

Steg ett: Lägga till händelsen

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.

Steg två: skriva funktionen

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:

add_action( 'my_hookname', 'my_function' );

Nästa steg är att skriva din funktion. Här är ett enkelt exempel:

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

Hur skapar jag en ny PHP Cron-händelse?

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).

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.

Vilka användare kan hantera Cron-händelser och scheman?

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

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.

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.

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

You can read all about the features and security of PHP cron events on the WP Crontrol website.

Är några WP-CLI-kommandon tillgängliga?

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

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.

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.

Vem tog bilden i tilläggets sidhuvud?

The photo was taken by Michael Pardo and is in the public domain.

Recensioner

15 juli 2024
I’ve used this plugin personally and recommended it professionally. Hands down, this is the most useful tool for fixing stuck cron jobs, identifying problems, etc. Thanks John for providing a such a great free plugin. You’re amazing. :)Much <3 and respect, Mia
9 mars 2024
Use this tool to run my own php script to maintain my uploaded webcam images. Thanks a lot for this plugin.
9 mars 2024
Why people are heartless and rate something so good and yet free be given poor rating? These guys have no respect for the opensource and the people who dedicate their time for the great cause. I love your plugin and i can’t say enough that its worth 5 stars rating and nothing less. This is the 4th review that i am writing for plugins which are great but some idiots give them poor rating. God bless you guys for sparing your valuable time for those who believe in the Open-source and its spirit of unity from across the world breaking all the barriers. Cheers.
20 november 2023
Thank you a lot, helped me understanding how WP-Cron works. Thanks! 😄
Läs alla 149 betyg

Bidragsgivare och utvecklare

”WP Crontrol” är programvara med öppen källkod. Följande personer har bidragit till detta tillägg.

Bidragande personer

”WP Crontrol” har översatts till 18 språk. Tack till översättarna för deras bidrag.

Översätt ”WP Crontrol” till ditt språk.

Intresserad av programutveckling?

Läs programkoden, kika på SVN-filförvaret eller prenumerera på utvecklarloggen via RSS.

Ändringslogg

1.17.0 (15 July 2024)

1.16.3 (19 April 2024)

  • Corrects the displayed PHP cron event name if one is provided

1.16.2 (24 March 2024)

1.16.1 (16 November 2023)

  • Confirms support for WordPress 6.4

1.16.0 (17 October 2023)

  • Allow persistent WordPress core hooks to be cleared if there’s more than one event with that hook
  • Add the number of matching events to the hook deletion link text
  • Scrap the Ajax request that checks if the current page of cron events has changed since loading
  • Make some improvements to sorting the cron event list table columns
  • Increase the minimum supported PHP version to 7.4

1.15.3 (30 June 2023)

  • Pass the $doing_wp_cron value to the cron_request filter so it matches WordPress core
  • Miscellaneous code quality improvements

1.15.2 (15 March 2023)

  • Improves the terminology around pausing and deleting hooks and events
  • Improves accessibility of the event listing table for keyboard users
  • Removes an unnecessary SQL query when fetching the list of paused events
  • Adds an FAQ about deactivating the plugin

1.15.1 (29 December 2022)

  • Confirms the plugin is compatible with PHP 8.2
  • Increases compatibility with other plugins that include very old Composer autoloader implementations

1.15.0 (29 November 2022)

  • Introducerar möjligheten att pausa och återstarta cron-händelser från listvyn med händelser, se ”Vanliga frågor” för fullständig information
  • Adds the site time to the cron event editing screen
  • Implements an autoloader to reduce memory usage
  • Höjer den lägsta PHP-versionen som stöds till 5.6

1.14.0 (10 July 2022)

  • Reverts the changes introduced in version 1.13 while I look into the problem with the deployment process for wordpress.org

1.13.2 (10 July 2022)

  • Fixes another issue with missing files in the release

1.13.1 (10 July 2022)

  • Åtgärdar ett problem med saknade filer i 1.13.0-utgåvan

1.13.0 (10 July 2022)

  • Introducerar möjligheten att pausa och återstarta cron-händelser från listvyn med händelser, se ”Vanliga frågor” för fullständig information
  • Implements an autoloader to reduce memory usage
  • Höjer den lägsta PHP-versionen som stöds till 5.6

1.12.1 (15 April 2022)

  • Corrects an issue where an invalid hook callback isn’t always identified
  • Various code quality improvements

1.12.0 (22 November 2021)

  • Fix the PHP cron event management.
  • More ”namespacing” of query variables to avoid conflicts with other cron management plugins.

Earlier versions

For the changelog of earlier versions, please refer to the releases page on GitHub.