WordPress.org

Ready to get started?Download WordPress

Forums

WP-Popular Posts Tool
Division by 0. (1 post)

  1. alpha1beta
    Member
    Posted 1 year ago #

    I've been getting many PHP division by 0 errors on line 58. Whether you see the error or not will depend on your PHP configuration, if warnings are set to show or log or be ignored. Your PHP version may also count to whether or not you see these errors.

    Anyway, i took a look, and wrote a quick patch (Maybe you can do better) but it seems to stop those errors.

    Replace line 58 in wp-popular-posts-tool.php with the following lines.
    `
    if( ($maxPostComments * $areaSize /2) == 0){
    $width = 0;
    } else {
    $width = $post->comment_count / $maxPostComments * $areaSize / 2;
    }

    http://wordpress.org/extend/plugins/wp-popular-posts-tool/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags