Rankmath Error Logs Reported by Web Hosting

#709783
  • Resolved Raman Sharma
    Rank Math free

    Here are some error logs reported by my web host and asked to contact support. I am even facing issues with updating posts.

    Here are the logs:

    WordPress database error Table ‘l3e5whl_lxnn.wp_rank_math_analytics_objects’ doesn’t exist for query SELECT * FROM wp_rank_math_analytics_objects WHERE object_id = ‘3346’ LIMIT 0, 1 made by require(‘wp-blog-header.php’), wp, WP->main, WP->parse_request, do_action_ref_array(‘parse_request’), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, RankMathAnalyticsRest->get_post, RankMathAnalyticsPosts->get_post, RankMathAdminDatabaseQuery_Builder->one

    [28-Dec-2023 03:48:09 UTC] PHP Fatal error: Uncaught Error: Class ‘RankMathPost’ not found in /home/l3e5whl/public_html/wp-content/themes/allusefulinfo/index.php:76
    Stack trace:
    #0 /home/l3e5whl/public_html/wp-includes/template-loader.php(106): include()
    #1 /home/l3e5whl/public_html/wp-blog-header.php(19): require_once(‘/home/l3e5whl/p…’)
    #2 /home/l3e5whl/public_html/index.php(17): require(‘/home/l3e5whl/p…’)
    #3 {main}
    thrown in /home/l3e5whl/public_html/wp-content/themes/allusefulinfo/index.php on line 76

    Please let me know why this is happening and how it can be fixed. This is a critical issue for me.

Viewing 12 replies - 31 through 42 (of 42 total)
  • If you guys really think that it is due to cloudflare or hosting, I can try hosting it on another web host.

    Yeah, it’s highly likely that’s it’s the one blocking the OPTIONS requests, please try a different one and share with us the outcome.

    In the meantime, please remove that critical error issue that I attached image for around 4 hours ago.

    Hello,

    Just confirmed critical issue is cleared, please take another look.

    My web host replied:

    I would advise sharing the screenshot of the issues again as I believe it’s happening due to the domain variant.

    Perhaps we need to use one varient to fix the issues rather then enabling CORS and making it more complex.

    Oh yes, I found the culprit. It is that redirect rule in .htaccess file (added after your suggestion) that is redirecting URLs from non trailing slash to trailing slash. When I removed that rule, it all started working fine.

    The following rule was added:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ https://www.allusefulinfo.com/$1/ [L,R=301]

    Can you please suggest a correct rule so that it works only for the blog post URLs, not others.

    Ohh no, they redirected from non-www (which is my preferred domain) to www version in htaccess by mistake. This is why it was causing the issues, I think.

    I modified that code and now I am going to test it for some hours.

    Hello,

    Please monitor the situation and let us know if the issue persists.

    We are here to assist.

    Now I found that the issue is with this redirect rule. With the following rule (removed www from the URL) I am now able to update the posts, but still it is not allowing me to activate Analytics module in Rankmath.

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ https://allusefulinfo.com/$1/ [L,R=301]

    But, when I am removed this rule completely, everything works fine and I can even re-create tables and activate the module in Rankmath.

    So, can you please give me a correct rule to add in the .htaccess file for URLs from non-trailing slash to trailing slash as only you suggested me to setup a redirect at server level.

    I am sure you can give me a perfect redirect rule for this so that it won’t block any route.

    Waiting for positive response.

    Actually, what I found that this rule is working even on the backend URLs such as wp-admin, wp-json etc. that is why it is blocking the route. Such rule should work only on front-end URLs.

    Can you help me suggest a modified rule for redirect from non-trailing flash front-end URLs to trailing slash front end URLs (that are allow in robotx.txt for Google to index).

    My hosting added the following rule and it’s working fine. Would you like to suggest a different one or add any other backend URI to exclude?

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteCond %{REQUEST_URI} !^/wp-admin/ [NC]
    RewriteCond %{REQUEST_URI} !^/wp-json/ [NC]
    RewriteRule ^(.*)$ https://allusefulinfo.com/$1/ [L,R=301]

    Hello,

    That rule seems fine and shouldn’t conflict with anything from our plugin. You are already excluding the wp-json directory which is used for REST API routes, so everything should be fine.

    Don’t hesitate to get in touch if you have any other questions.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 12 replies - 31 through 42 (of 42 total)

The ticket ‘Rankmath Error Logs Reported by Web Hosting’ is closed to new replies.