• Hello,

    We’re having trouble with an error caused by the Polldady shortcode plugin within Jetpack.

    [Fri Sep 16 09:31:12 2011] [error] [client xx.xxx.xxx.xx] PHP Warning: Division by zero in /clients/xxxxx/www/wp-content/plugins/jetpack/modules/shortcode
    s/polldaddy.php on line 144

    Within 5-10 minutes after this error the site will crash. Trying to weed out possibilities and narrow down the cause of the crash.

Viewing 2 replies - 1 through 2 (of 2 total)
  • PHP should be able to handle that, do you really think it was causing a crash? Anyway, he ERROR was filling up my error_log with WANRINGS, along with another line, so I made these two change to my copy of polldaddy.php to stop it.

    // ...........
    
    	$keywords['generated'] = time();
    
    +	if ($keywords_xml) // stop a warning at line 17
    	foreach ( $keywords_xml->keyword as $keyword_xml ){
    
    // ...........
    
    	$keywords = array();
    
    -	$mod = ( $poll % ( count( $keywords ) - 1 ) );
    +	// stop a warning at line 144
    +	$mod = count( $keywords ) == 1 ? 0 : ( $poll % ( count( $keywords ) - 1 ) );
    
    	return '<a name= // ..............

    Probably good enough. There’s still an odd “% -1” case.

    Forgot to edit my typos, sorry.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Jetpack] Divide by zero error causing site to crash.’ is closed to new replies.