Upgrading from PHP 7.4.33 to PHP 8.3.22 causes a critical error on my WordPress

#1076166
  • Resolved Галым Акулов
    Rank Math free

    Good day! Upgrading from PHP 7.4.33 to PHP 8.3.22 causes a critical error on my WordPress site in the Search section. By disabling plugins one by one, I identified that the issue is caused by the Rank Math SEO plugin. I had to deactivate Rank Math SEO. What could be the reason?

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

    We apologize for the issue you are facing with the Rank Math SEO plugin after upgrading your PHP version. This critical error could be due to compatibility issues between the Rank Math plugin and the PHP version you are using. Rank Math requires PHP 7.4 or greater, but sometimes newer PHP versions can introduce changes that may not be fully compatible with all plugins immediately.

    Here are a few steps you can take to troubleshoot this issue:

    1. Check for Updates: Ensure that you are using the latest version of the Rank Math plugin. Updates often include compatibility fixes for newer PHP versions.
    2. Error Logs: Check your server’s error logs for any specific error messages related to Rank Math. This can provide more insight into what might be causing the critical error.
    3. Conflict with Other Plugins: Sometimes, conflicts with other plugins can cause issues when upgrading PHP. You might want to check if other plugins are also updated and compatible with PHP 8.3.22.
    4. Revert PHP Version: If the issue persists, consider reverting back to PHP 7.4.33 until a fix is provided by the Rank Math team.

    If you would like more detailed assistance or if this is a technical issue on your site, please reply to this ticket with your site URL, and a human agent from our support team will assist you further.

    Sources:
    Fatal Error Happening on Some Installations After 1.0.49 Update » Rank Math

    Hello,

    You must have received an email from WordPress with the details about the error. Please share it with us here so we can check.

    If you haven’t received the email with the error code, you can follow this guide to enable debugging in WordPress
    https://wordpress.org/support/article/debugging-in-wordpress/ or you can get in touch with your web host, and they will help you locate the log file.

    Having an error log will help us determine what is causing the critical error.

    Looking forward to helping you.

    Hello.

    Error in log:

    Uncaught Exception: Missing format specifier at end of string in /wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php on line 275
    The issue appears to be caused by calling sprintf() without passing the required argument when formatting the string ‘Search results for: %s’.

    Temporary workaround: disabling breadcrumbs in Rank Math settings, or fixing the code like:

    $search = is_scalar($this->search) ? $this->search : ”;
    $label = sprintf( __( ‘Search results for: %s’, ‘rank-math’ ), $search );

    The patch was made by AI, I haven’t installed it yet, I’ve turned off breadcrumbs in the settings. Please consider patching this in future updates.
    Thank you!

    Hello,

    This issue occurs when the format for the archives in the breadcrumbs is incorrect and lacks the padding character in the settings for breadcrumbs.

    To fix this, head over to Rank Math > General Settings > Breadcrumbs > and add the default padding characters to these fields %s as those are required

    archive

    results

    In this case, you won’t need to disable the breadcrumbs settings and use it on your site.

    Looking forward to helping you.

    Hello! Did as you said. Everything works, thank you.

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on
    https://www.trustpilot.com/evaluate/www.rankmath.com

    about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

You must be logged in to reply to this ticket.