I've really been struggling with my wordpress running smoothly and have been constantly dealing with a variety of issues. One thing that i continue to experience is Cron scheduled tasks will end up past due, then that will start to prevent analytics and other things to stop working and i believe just cause my site to get sluggish overall possibly?

I recently set my server to run my cron and take over to see if that fixes things. Something interesting was after i set it to "run now" it said it completed but with an error in 3 seconds. This was the error:

Task "httpdocs/wp-cron.php" completed with error in 3 seconds, output:

Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /var/www/vhosts/newstatebranding.com/httpdocs/wp-includes/cron.php:436 Stack trace: #0 /var/www/vhosts/newstatebranding.com/httpdocs/wp-cron.php(129): wp_reschedule_event() #1 {main} thrown in /var/www/vhosts/newstatebranding.com/httpdocs/wp-includes/cron.php on line 436

This is whats on line 436:

    $timestamp = $now + ( $interval - ( ( $now - $timestamp ) % $interval ) );

Currently i have cron scheduled for every 10minutes via plesk. I'm not too sure if it is working though as when i manually run it that shows up but then also when i check my Wordpress scheduled tasks - i always have "past due" tasks.

Any idea on what this means exactly, and better yet - how to fix all of this?

Any help would be greatly appreciated!

  • 1
    This looks like $interval is 0, and so the ( $now - $timestamp ) % $interval is attempting to divide by zero. Please edit your question to include how you're scheduling your cron tasks, if you can; that'll give us a better chance at diagnosing the problem.
    – Pat J
    Apr 3 at 3:52
  • Thanks Pat. I updated it with that info. Apr 3 at 15:12


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.