• Resolved tmuka

    (@tmuka)


    Using google-analytics-for-wordpress v8.4.0 I’m setting this fatal error on several sites with WordPress 5.9.1 and php

    PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in wp-content/plugins/google-analytics-for-wordpress/includes/admin/notifications/notification-upgrade-eu-traffic.php:43

    My hunch is that the error is because the plugin doesn’t have a value set for $sessions in the report data. One site uses a manually entered UA Code, and another has an expired GA authentication session.

    Hope this helps detect this case and avoid the PHP Fatal Error!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tmuka

    (@tmuka)

    It got cut off above. I’m using PHP 8.0.16.

    for now I added this code on line 37 to stop the fatal errors.
    if(! is_numeric($sessions) || $sessions == 0 ){ return false; }

    • This reply was modified 2 years, 8 months ago by tmuka.
    Plugin Support Michelle D.

    (@devmich)

    Hi @tmuka,

    Thanks for this information. I’m so sorry about the trouble!

    I’ve let our developer team know about it and they’re working on resolving the issue.

    We really appreciate you for bringing this to our attention!

    Please let me know if there’s anything else I can help with. Or if you would rather, feel free to reach out to us at https://www.monsterinsights.com/lite-support/ ??

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Fatal error: Uncaught DivisionByZeroError’ is closed to new replies.