PHP: Division by Zero In /mainwp/class/class-mainwp-system.php on line 889
-
After upgrading to version 4.0.3 of the Dashboard, my error log started filling up with PHP warnings like the following every 15 minutes:
PHP Warning: Division by zero in /home/username/public_html/mainwp/wp-content/plugins/mainwp/class/class-mainwp-system.php on line 889
I took a look at that line in the code:
$mins_between = 24 * 60 / $frequencyDailyUpdate; // mins
It looks like $frequencyDailyUpdate is set on the Global Options page, but wasn’t given a default value in the wp_options table when I updated.
I ran the following on the database and got an empty result:
SELECT * FROM wp_options WHERE option_name = "mainwp_frequencyDailyUpdate"
The fix appears to be to simply save the settings on the Global Options page; you don’t have to make any changes because the setting Daily Update Frequency defaults to “Once per day” in the UI.
Following that, the SQL query returned a value of “1” for frequencyDailyUpdate.
- The topic ‘PHP: Division by Zero In /mainwp/class/class-mainwp-system.php on line 889’ is closed to new replies.