Error from Object Cache Pro related to RankMath?!

#1056487
  • Resolved Robert R. Voigt
    Rank Math free

    Hi,

    We noticed an error from Object Cache Pro and our host Rocket.net told us this seems to be related to your plugin RankMath.

    But checking your error logs, seems like the current error is related to the RankMath plugin:

    Our site: https://socialsuriname.com/

    [24-Jun-2025 15:09:26 UTC] PHP Fatal error: Uncaught TypeError: abs(): Argument #1 ($num) must be of type int|float, string given in /home/vvr4vmy/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-analytics-common.php:338
    Stack trace:
    #0 /home/vvr4vmy/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-analytics-common.php(338): abs()
    #1 /home/vvr4vmy/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-analytics-common.php(96): RankMathAnalyticsAnalytics_Common->get_analytic_block()
    #2 /home/vvr4vmy/public_html/wp-includes/class-wp-hook.php(324): RankMathAnalyticsAnalytics_Common->dashboard_widget()
    #3 /home/vvr4vmy/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #4 /home/vvr4vmy/public_html/wp-includes/plugin.php(565): WP_Hook->do_action()
    #5 /home/vvr4vmy/public_html/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(90): do_action_ref_array()
    #6 /home/vvr4vmy/public_html/wp-content/plugins/seo-by-rank-math/includes/rest/class-admin.php(145): RankMathRestAdmin->do_action()
    #7 /home/vvr4vmy/public_html/wp-includes/rest-api/class-wp-rest-server.php(1292): RankMathRestAdmin->dashboard_widget_items()
    #8 /home/vvr4vmy/public_html/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request()
    #9 /home/vvr4vmy/public_html/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch()
    #10 /home/vvr4vmy/public_html/wp-includes/rest-api.php(459): WP_REST_Server->serve_request()
    #11 /home/vvr4vmy/public_html/wp-includes/class-wp-hook.php(324): rest_api_loaded()
    #12 /home/vvr4vmy/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #13 /home/vvr4vmy/public_html/wp-includes/plugin.php(565): WP_Hook->do_action()
    #14 /home/vvr4vmy/public_html/wp-includes/class-wp.php(418): do_action_ref_array()
    #15 /home/vvr4vmy/public_html/wp-includes/class-wp.php(818): WP->parse_request()
    #16 /home/vvr4vmy/public_html/wp-includes/functions.php(1342): WP->main()
    #17 /home/vvr4vmy/public_html/wp-blog-header.php(16): wp()
    #18 /home/vvr4vmy/public_html/index.php(17): require(‘/home/vvr4vmy/p…’)
    #19 {main}
    thrown in /home/vvr4vmy/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/class-analytics-common.php on line 338

    Regards,
    Robert

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    We apologize for the issue you are facing with the Rank Math plugin. The error you provided indicates a type mismatch in the abs() function, which expects an integer or float but is receiving a string instead. This can happen due to various reasons, such as incorrect data being passed to the function.

    To troubleshoot this issue, we recommend the following steps:

    1. Update Rank Math: Ensure that you are using the latest version of the Rank Math plugin. Updates often include bug fixes and improvements that may resolve your issue.

    2. Check for Plugin Conflicts: Deactivate other plugins temporarily to see if the error persists. If the error goes away, reactivate the plugins one by one to identify which one is causing the conflict.

    3. Review Your Settings: Sometimes, specific settings or configurations can lead to unexpected behavior. Review your Rank Math settings to ensure everything is configured correctly.

    4. Clear Cache: If you are using any caching plugins or server-side caching, clear all caches after making changes to ensure that you are testing the most recent version of your site.

    If these steps do not resolve the issue, please reply to this ticket with any additional details or changes you’ve made, and a human agent from our support team will assist you further.

    Thank you for bringing this to our attention, and we appreciate your patience as we work to resolve it!

    Sources:
    This Plugin Does Not Work with Your Version of PHP » Rank Math

    Hi,

    We are using the latest plugin (1.0.247) and cache has already been cleared a couple of times.
    As far as we can see, there are no conflicts, settings see good (as newbies).

    Please have one of your human experts double check for us.
    We are planning to move to the ‘pro’ version very soon. And want to make sure the free is running smooth on our platform.

    Regards,
    Robert

    Hello,

    Thank you for contacting Rank Math support.

    Please include the FTP details in the sensitive data section as well, so we may troubleshoot further.

    We look forward to having this issue resolved.

    Thank you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hi Adetayo,

    Information has been updated.

    Regards,
    Robert

    Hello,

    We have found the cause and are working on a fix, but before then, you may patch this by changing the file seo-by-rank-math/includes/modules/analytics/class-analytics-common.php lines 339 and 340

    from:

    $difference = isset( $item['difference'] ) ? abs( $item['difference'] ) : 0;
    $is_negative = isset( $item['difference'] ) && abs( $item['difference'] ) !== $item['difference'];

    to:

    $difference = isset( $item['difference'] ) && 'n/a' !== $item['difference'] ? abs( $item['difference'] ) : 0;
    $is_negative = isset( $item['difference'] ) && 'n/a' !== $item['difference'] && abs( $item['difference'] ) !== $item['difference'];

    We apologize for any inconveniences that might have been caused as a result of this issue.

    Please do not hesitate to let us know if you need our assistance with anything else.

    Hi Ike,
    Thank you!

    Regards,
    Robert

    Hello,

    We’re delighted to hear that this issue has been resolved. We appreciate your feedback.

    This ticket will be closed now, but if you ever have another question or need any help in the future, please don’t hesitate to create a new forum topic. We’ll be more than happy to assist you again.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)

The ticket ‘Error from Object Cache Pro related to RankMath?!’ is closed to new replies.