Critical error after switching from PHP 7.4 to 8.1

#819115
  • Resolved Frank Czygan
    Rank Math free

    Good evening, when I switch from PHP 7.4 to 8.1, I get a critical error with the following messages. Can you please help me here? Thanks, Frank

    Warning: foreach() argument must be of type array|object, string given in /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-content/plugins/seo-by-rank-math/includes/frontend/paper/class-paper.php on line 526

    Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-frontend.php:73 Stack trace: #0 [internal function]: RankMath\Schema\Frontend->RankMath\Schema\{closure}(‘{“metadata”:{“t…’) #1 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-frontend.php(74): array_filter(Array, Object(Closure)) #2 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/class-wp-hook.php(324): RankMath\Schema\Frontend->add_schema(Array, Object(RankMath\Schema\JsonLD)) #3 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/plugin.php(256): WP_Hook->apply_filters(Array, Array) #4 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(106): apply_filters_ref_array(‘rank_math/json_…’, Array) #5 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-jsonld.php(149): RankMath\Schema\JsonLD->do_filter(‘json_ld’, Array, Object(RankMath\Schema\JsonLD)) #6 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/class-wp-hook.php(324): RankMath\Schema\JsonLD->json_ld() #7 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #8 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/plugin.php(565): WP_Hook->do_action(Array) #9 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(90): do_action_ref_array(‘rank_math/head’, Array) #10 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-content/plugins/seo-by-rank-math/includes/frontend/class-head.php(172): RankMath\Frontend\Head->do_action(‘head’) #11 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/class-wp-hook.php(324): RankMath\Frontend\Head->head(”) #12 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #13 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #14 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/general-template.php(3050): do_action(‘wp_head’) #15 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-content/themes/generatepress/header.php(16): wp_head() #16 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/template.php(810): require_once(‘/var/www/vhosts…’) #17 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/template.php(745): load_template(‘/var/www/vhosts…’, true, Array) #18 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/general-template.php(48): locate_template(Array, true, true, Array) #19 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-content/plugins/woocommerce/templates/single-product.php(22): get_header(‘shop’) #20 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-includes/template-loader.php(106): include(‘/var/www/vhosts…’) #21 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-blog-header.php(19): require_once(‘/var/www/vhosts…’) #22 /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/index.php(17): require(‘/var/www/vhosts…’) #23 {main} thrown in /var/www/vhosts/hosting155586.a2edc.XY.net/httpdocs/beglaubigte/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-frontend.php on line 73

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

    Thank you for contacting support.

    This would indicate that there is an incorrect Schema markup on the website for the particular page that is throwing this error.

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    We are glad that you got it sorted out.

    If you 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 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this ticket.