Fatal error – Wordpress Multisite

#721956
  • Resolved Anonymous
    Rank Math free

    Hello,
    We encountered a Fatal error with Rank Math installed on WordPress Multisite.

    The error is as follows:

    [14-Jan-2024 19:28:14 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /dom45317/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php:522
    Stack trace:
    #0 /dom45317/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php(497): RankMath\OpenGraph\Image->set_content_image(Object(WP_Post))
    #1 /dom45317/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php(321): RankMath\OpenGraph\Image->set_singular_image()
    #2 /dom45317/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php(81): RankMath\OpenGraph\Image->set_images()
    #3 /dom45317/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-facebook.php(266): RankMath\OpenGraph\Image->__construct(Object(RankMath\OpenGraph\Facebook), Object(RankMath\OpenGraph\Facebook))
    #4 /wordpress-versions/6.4.2/wp-includes/class-wp-hook.php(324): RankMath\OpenGraph\Facebook->image(Object(RankMath\OpenGraph\Facebook))
    #5 /wordpress-versions/6.4.2/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #6 /wordpress-versions/6.4.2/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
    #7 /dom45317/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(88): do_action_ref_array(‘rank_math/openg…’, Array)
    #8 /dom45317/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-opengraph.php(74): RankMath\OpenGraph\OpenGraph->do_action(‘opengraph/faceb…’, Object(RankMath\OpenGraph\Facebook))
    #9 /wordpress-versions/6.4.2/wp-includes/class-wp-hook.php(324): RankMath\OpenGraph\OpenGraph->output_tags()
    #10 /wordpress-versions/6.4.2/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #11 /wordpress-versions/6.4.2/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
    #12 /dom45317/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(88): do_action_ref_array(‘rank_math/head’, Array)
    #13 /dom45317/wp-content/plugins/seo-by-rank-math/includes/frontend/class-head.php(172): RankMath\Frontend\Head->do_action(‘head’)
    #14 /wordpress-versions/6.4.2/wp-includes/class-wp-hook.php(324): RankMath\Frontend\Head->head(”)
    #15 /wordpress-versions/6.4.2/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #16 /wordpress-versions/6.4.2/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #17 /wordpress-versions/6.4.2/wp-includes/general-template.php(3052): do_action(‘wp_head’)
    #18 /wordpress-versions/6.4.2/wp-includes/template-canvas.php(17): wp_head()
    #19 /wordpress-versions/6.4.2/wp-includes/template-loader.php(106): include(‘/wordpress-vers…’)
    #20 /wordpress-versions/6.4.2/wp-blog-header.php(19): require_once(‘/wordpress-vers…’)
    #21 /wordpress-versions/6.4.2/index.php(17): require(‘/wordpress-vers…’)
    #22 {main}
     thrown in /dom45317/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php on line 522

    —–

    The error only occurs on some pages. Not all.

    We were able to add the filter below in our theme, which disabled the functionality which was causing the error, but we’re hoping to determine the cause, since the functionality disabled pertains to OpenGraph, and possibly we don’t wish this functionality disabled long term.

    Thank you!

    add_filter( ‘rank_math/opengraph/content_image_cache’, function( $ret ) {
    return false;
    }, PHP_INT_MAX );

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

    Thank you for your query and we are so sorry about the trouble this must have caused.

    This issue was caused because seems like your pages were built on a template, and in such cases, they don’t contain post ID, that’s why Rank Math was unable to go through with the intended procedure and was trying to set an image to OpenGraph image from the post content.

    Can you please confirm if you are using Elementor to create some templates for those affected pages?

    Looking forward to helping you.

    Anonymous
    Rank Math free

    Hi Jeremy,
    Thanks for the help!

    The page where the error was occurring is a standard WP page built w/ native Gutenberg blocks.

    We’re launching the live site Friday (The site is being launched for Northwood University.)

    When we launch, I’ll send you a link to the page where the error was occurring. So if you can keep this ticket open, I’ll follow up with you early next week. I can also provide any technical info you may need to track down the issue.

    Thanks!
    Cary Briel

    Hello,

    That works fine.

    Please update us as soon as the site is live.

    This ticket will be kept open so you can update us.

    However, if the ticket has been closed by the bot, you can open another ticket referencing this one.

    Thank you.

    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 3 replies - 1 through 3 (of 3 total)

The ticket ‘Fatal error – Wordpress Multisite’ is closed to new replies.