WP-Cron-Control

This plugin allows you to take control over the execution of cron jobs.


Contributors: tott, automattic
Donate link: http://hitchhackerguide.com
Tags: wp-cron, cron, cron jobs
Requires at least:
Tested up to: 3.1.2
Stable tag: trunk


Description

This plugin allows you to take control over the execution of cron jobs. It’s mainly useful for sites that either don’t get enough comments to ensure a frequent execution of wp-cron or for sites where the execution of cron via regular methods can cause race conditions resulting in multiple execution of wp-cron at the same time.

This plugin implements a secret parameter and ensures that cron jobs are only executed when this parameter is existing.


Installation

  • Install either via the WordPress.org plugin directory, or by uploading the files to your server.
  • Activate the Plugin and ensure that you enable the feature in the plugins’ settings screen
  • Follow the instructions on the plugins’ settings screen in order to set up a cron job that either calls
    php wp-cron-control.php http://blog.address secret_string

    or

    wget -q "http://blog.address/wp-cron.php?doing_wp_cron&secret_string"
  • If you like to have a global secret string you can define it in your wp-config.php by adding
    define( 'WP_CRON_CONTROL_SECRET', my_secret_string' );

Screenshots


Changelog

Version 0.1

  • Initial version of this plugin.

Limitations

This plugin performs a

remove_action( 'sanitize_comment_cookies', 'wp_cron' );

call in order to disable the spawning of new cron processes via the regular WordPress method. If wp_cron is hooked in an other action or called directly this might cause trouble.

 

7 Responses to “WP-Cron-Control”

  1. As I said in my review: I like the plugin a lot. Two suggestions:

    – more inline comments / documentation
    – switching the class of the reset button to to button instead of button-primary.

  2. First off Thank you for WP-Cron-Control

    Some questions

    I run BlogLines.co.za “MultiSite” with Multi Domains hosted on it

    Do i need to set up a cron job per site i have or do i only set up one job for the hole net work

    Thx
    Mark mark@bloglines.co.za

    • Hi Mark,
      you would need one cron per site. But in this case I would likely just create a small wrapper that would iterate through all sites, if it’s a fairly low amount of them.
      You can grab the sites from SELECT * FROM $wpdb->blogs and grab their details via get_blog_details
      Does this make sense?

  3. @Thorsten That will work for a small site but the problem is we have about 11000 blogs and we running Multi DB / Multi Domains / Domain Mapping

    I have set up your plug on bloglines.co.za and it is working well 🙂

    The main site i never use to run cron on the sites as they would send my server in to over load i then added this line to wp-config define(‘DISABLE_WP_CRON’, true);

    So recap your plug works well and rock bloglines.co.za

  4. Thorsten,
    I run WP 3.3.1
    My server just got shut down because of spam sent from my 71 blogs.
    researching I found the culprit to be WP-Cron.
    I read that I can disable WP_cron in WP-config.
    Than I am to install a standard Cron Job and I have no Idea what to place in which file in my installations.
    Then I found your plugin but I am not a techie and I do not understand whether your plugin will solve my problem.
    either way it will be a lot of work.
    Aber Arbeit macht mir nichts wenn ich nur wuessste was ich tuen soll.

    Danke schoen
    Michael Schurmann
    michaelgschurmann@satx.rr.com

    • You should first figure out which script was sending out emails. It’s likely that even with my plugin these mails would still be sent as my plugin just changes the way the cron jobs are executed but does not alter which actions will be run.

Leave a comment