WordPress.org

Ready to get started?Download WordPress

Forums

Warm Cache
[resolved] Division by zero (4 posts)

  1. thorstone137
    Member
    Posted 1 year ago #

    Hello. I'm getting this error..

    Warning: Division by zero in /var/www/wp-content/plugins/warm-cache/warm-cache.php on line 132 Warning: Division by zero in /var/www/wp-content/plugins/warm-cache/warm-cache.php on line 132

    Any clues?

    Thanks, Dustin

    http://wordpress.org/extend/plugins/warm-cache/

  2. ramon fincken
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks Dustin, has the plugin spidered/crawled some pages or none yet?

  3. khromov
    Member
    Posted 1 year ago #

    @Ramon
    Yes, it occurs when a crawl has already been performed.

    The error occurs when calculating the load time per page. If amount of pages crawled in a run is 0, you will get this error.

    It's possible to fix by changing line 132 of warm-cache.php to the following:

    $table_string .= (intval($temp['pages_count'])!=0) ? $temp['time']/$temp['pages_count'].'</td><td valign="top">' : '- </td><td valign="top">';

    This adds a check and doesn't run the code if the amount of pages crawled is 0.

  4. ramon fincken
    Member
    Plugin Author

    Posted 1 year ago #

    Excellent piece of code and solution, I will implement this right away.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.