• I keep getting the following error.

    [13-Jun-2014 00:26:47 UTC] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in ...\wp-includes\class-http.php on line 1375
    
    [13-Jun-2014 00:26:47 UTC] PHP Stack trace:
    
    [13-Jun-2014 00:26:47 UTC] PHP   1. {main}() ...\wp-cron.php:0
    
    [13-Jun-2014 00:26:47 UTC] PHP   2. do_action_ref_array() ...\wp-cron.php:100
    
    [13-Jun-2014 00:26:47 UTC] PHP   3. call_user_func_array() ...\wp-includes\plugin.php:546
    
    [13-Jun-2014 00:26:47 UTC] PHP   4. do_all_pings() ...\wp-includes\plugin.php:546
    
    [13-Jun-2014 00:26:47 UTC] PHP   5. do_enclose() ...\wp-includes\comment.php:2067
    
    [13-Jun-2014 00:26:47 UTC] PHP   6. wp_get_http_headers() ...\wp-includes\functions.php:506
    
    [13-Jun-2014 00:26:47 UTC] PHP   7. wp_safe_remote_head() ...\wp-includes\functions.php:602
    
    [13-Jun-2014 00:26:47 UTC] PHP   8. WP_Http->head() ...\wp-includes\http.php:112
    
    [13-Jun-2014 00:26:47 UTC] PHP   9. WP_Http->request() ...\wp-includes\class-http.php:414
    
    [13-Jun-2014 00:26:47 UTC] PHP  10. WP_Http->_dispatch_request() ...\wp-includes\class-http.php:249
    
    [13-Jun-2014 00:26:47 UTC] PHP  11. WP_Http_Curl->request() ...\wp-includes\class-http.php:333

    For this, other scheduled tasks often do not complete. If I add the following code, the other scheduled tasks flawlessly complete.

    if ( isset( $_GET['doing_wp_cron'] ) ) {
    	remove_action( 'do_pings', 'do_all_pings' );
    }

    However, this disables the ‘do_pings’ task all the time. I’d like to disable it only my tasks are triggered in wp-cron.php.

    Does anybody know how?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Pings only happen during the cron process.

    You can disable it for new posts by turning off the “Attempt to notify any blogs linked to from the article” on the Settings->Discussion page.

    But basically, the pings process is trying to retrieve the pages that you linked to in your post, and sometimes, other sites might be slow. So you can either disable the pings, or extend the PHP execution time to give those sites time to respond, or not link to slow sites. Your choice.

    Thread Starter umchal

    (@umchal)

    Thanks for the information. Otto. I’m looking for a way to disable the ‘do_pings’ action programmatically.

    My tasks use the wp_update_post() function and I’m not sure but guessing that wp_update_post() adds the ‘do_pings’ action. If that is the case, is there any way to prevent the function from scheduling ‘do_pings’ tasks?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    No. The do_pings will always be scheduled. However, if there are no pings to be processed, then it doesn’t do anything for them.

    But the do_pings task also handles the case for enclosures, which are audio or video files linked to in the post. These need special handling so that the RSS feeds can be updated correctly (for podcasts, for example). So the scheduled task needs to run regardless of whether pings are enabled.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The 'do_pings' action causes the maximum execution time error in wp-cron.php’ is closed to new replies.