#130550 Error with news plugin: division by zero error
Nico Eschner 1 month, 3 weeks ago
I use this WP plugin to display news.
I had Jupiter v5.9.2 running with WPBakery Visual Composer (Modified Version) v5.2.1 & jupiter donut v1.0.2
I had no problems with that version and now I upgraded to the Jupiter version 6.9, WPBakery Visual Composer (Modified Version) v6.6.0 and Jupiter Donut v1.3.0
Now when a news page is open, this error gets displayed ontop of the site:
Warning: Division by zero in C:\xampp\apps\wordpress\htdocs\wp-content\plugins\jupiter-donut\includes\helpers\image-resize.php on line 174
Warning: A non-numeric value encountered in C:\xampp\apps\wordpress\htdocs\wp-content\plugins\jupiter-donut\includes\helpers\image-resize.php on line 181
When looking into that file I see the function “public static function resize_by_id_adaptive( $attachment_id, $image_size, $width, $height, $crop = true, $dummy = true )”.
The arguments are filled with:
- $image_size: ‘crop’
- $width: 1100
- $crop: 1
- $dummy: 1
That $height has no value cause this error because:
$ratio_factor = ($width && $height) ? ($width / $height) : false; <== will be set to false
$mobile_height = ($mobile_width) ? $mobile_width / $ratio_factor : false; <== $mobile_width(736) / 0 cause the error
Except that the error message is shown ontop of the page, the page looks and works like it should. Should I just modify the code a bit to prevent the error message or should I do something else?
PS: I can’t share any FTP access because the website is currently not liveAlexander Hutsol Support Team 1 month, 3 weeks ago
Could you please upload your site to any hosting service and provide us with wp-admin and FTP access to it to check the issue?
I tried to replicate it on a test installation but don’t see the mentioned warnings.