-
Hi Rank Math Support,
We’ve identified a fatal error in the Analytics Dashboard of Rank Math when running on PHP 8. The issue occurs when the dashboard receives non-numeric data (such as “n/a”) from the analytics source. PHP 8 no longer allows functions like abs() to process strings, which leads to a fatal error if no validation is in place.
The affected code behaves like:
$total = abs($total_value); // $total_value may be "n/a"
This worked in PHP 7 but breaks in PHP 8 due to stricter typing.Temporary Patch:
We’ve applied the following patch in our staging environment to prevent the error:$total = abs((float) $total_value);
This safely casts the value and avoids type-related crashes.Would it be possible to address this in a future plugin update? That way we can remove the patch and ensure stability after future updates.
Thanks in advance for your help!
Best regards,
Steven
The ticket ‘Fatal Error in Analytics Dashboard with Non-Numeric Data in PHP 8’ is closed to new replies.