Support » Plugin: WP-Cron Control » Conflict with Genesis themes

  • Just noticed Genesis was not saving SEO meta items from the edit page/post view.
    Trial and error pinpointed conflict with WP Cron Control.
    Disable WP Cron Control then Genesis SEO meta will save again.
    I read the other forum post about a similar problem with WP RSS Aggregator plugin.
    That forum post suggested an issue with DOING_CRON
    line 319 of wp-cron-control.php
    define( 'DOING_CRON', true );
    may be the problem.
    It seems to be defining DOING_CRON to TRUE for ALL requests.
    It seems logical that you would only want to define DOING_CRON to TRUE for requests with the secret key, not every request.

    In the Genesis code at line 259 of genesis\lib\functions\options.php
    in the genesis_save_custom_fields() function
    is a check for DOING_CRON being TRUE

    if ( defined( 'DOING_CRON' ) && DOING_CRON ) {

    So nothing is saved if DOING_CRON is TRUE.

    Same situation occurs in WP RSS Aggregator plugin.
    On line 328 of wp-rss-aggregator\includes\admin-metaboxes.php
    in the wprss_save_custom_fields() function

    if ( defined( 'DOING_CRON' ) && DOING_CRON )

    The code is so similar that it must be a boilerplate for saving custom fields.
    So is the define( 'DOING_CRON', true ); in WP Cron Control really necesary for all requests?

    At this stage I don’t think it is.

    • This topic was modified 6 months, 2 weeks ago by  wallyO.
Viewing 4 replies - 1 through 4 (of 4 total)
  • After inspecting wp-includes/cron.php
    At line 348…

    function wp_cron() {
    	// Prevent infinite loops caused by lack of wp-cron.php
    	if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false || ( defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ) )

    It seem more than enough to just define…
    define( 'DISABLE_WP_CRON', true );
    to prevent wp-cron from running.

    I am running into the same issue with another plugin. I have define( ‘DISABLE_WP_CRON’, true ); and I am still getting the same issue.

    Were you able to resolve yours?

    The only resolution I found to this problem is to edit WP Cron Control
    line 319 of wp-cron-control.php
    define( 'DOING_CRON', true );
    // define( 'DOING_CRON', true );
    As far as I understand, this line is to prevent spawn_cron() function from executing when called directly by other plugins.
    4 lines below it on line 322
    define( 'DISABLE_WP_CRON', true ); prevents wp-cron() from executing when initiated by a http request.

    This is a poor solution because it will have to be re-edited every time WP Cron Control plugin is updated.

    PS. you don’t have to define( ‘DISABLE_WP_CRON’, true ); The WP Cron Control plugin does this in its own code.

    • This reply was modified 6 months, 1 week ago by  wallyO.

    Hi @wallyo, Thank you for your update. I have implemented the patch and it seems to have cleared up the issue. Now just to see if all the scheduled tasks still work lol.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Conflict with Genesis themes’ is closed to new replies.