• Resolved dmccan

    (@dmccan)


    Hi Slim SEO Team,

    I see a PHP error. I have WordPress 6.7, Slim SEO 4.1.0, and PHP version 8.3.9. The Breadcrumbs option is disabled. I see this in the logs:

    [16-Nov-2024 22:57:59 UTC] PHP Warning: Trying to access array offset on null in /Users/david/Sites/wpdailynews/wp-content/plugins/slim-seo/src/Breadcrumbs.php on line 111
    [16-Nov-2024 22:57:59 UTC] PHP Fatal error: Uncaught TypeError: SlimSEO\Breadcrumbs::add_link(): Argument #2 ($text) must be of type string, null given, called in /Users/david/Sites/wpdailynews/wp-content/plugins/slim-seo/src/Breadcrumbs.php on line 111 and defined in /Users/david/Sites/wpdailynews/wp-content/plugins/slim-seo/src/Breadcrumbs.php:229
    Stack trace: 0 /Users/david/Sites/wpdailynews/wp-content/plugins/slim-seo/src/Breadcrumbs.php(111): SlimSEO\Breadcrumbs->add_link(‘https://wpdaily…’, NULL) 1 /Users/david/Sites/wpdailynews/wp-content/plugins/slim-seo/src/Schema/Types/BreadcrumbList.php(12): SlimSEO\Breadcrumbs->parse() 2 /Users/david/Sites/wpdailynews/wp-content/plugins/slim-seo/src/Schema/Types/Base.php(41): SlimSEO\Schema\Types\BreadcrumbList->is_active() 3 /Users/david/Sites/wpdailynews/wp-content/plugins/slim-seo/src/Schema/Manager.php(75): SlimSEO\Schema\Types\Base->add_reference(‘breadcrumb’, Object(SlimSEO\Schema\Types\BreadcrumbList)) 4 /Users/david/Sites/wpdailynews/wp-content/plugins/slim-seo/src/Schema/Manager.php(30): SlimSEO\Schema\Manager->add_schemas() 5 /Users/david/Sites/wpdailynews/wp-includes/class-wp-hook.php(324): SlimSEO\Schema\Manager->output(”) 6 /Users/david/Sites/wpdailynews/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) 7 /Users/david/Sites/wpdailynews/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 8 /Users/david/Sites/wpdailynews/wp-includes/general-template.php(3080): do_action(‘wp_footer’) 9 /Users/david/Sites/wpdailynews/wp-content/themes/bricks/footer.php(12): wp_footer() 10 /Users/david/Sites/wpdailynews/wp-includes/template.php(810): require_once(‘/Users/david/Si…’) 11 /Users/david/Sites/wpdailynews/wp-includes/template.php(745): load_template(‘/Users/david/Si…’, true, Array) 12 /Users/david/Sites/wpdailynews/wp-includes/general-template.php(92): locate_template(Array, true, true, Array) 13 /Users/david/Sites/wpdailynews/wp-content/themes/bricks/page.php(17): get_footer() 14 /Users/david/Sites/wpdailynews/wp-includes/template-loader.php(106): include(‘/Users/david/Si…’) 15 /Users/david/Sites/wpdailynews/wp-blog-header.php(19): require_once(‘/Users/david/Si…’) 16 /Users/david/Sites/wpdailynews/index.php(17): require(‘/Users/david/Si…’) 17 {main}

    thrown in /Users/david/Sites/wpdailynews/wp-content/plugins/slim-seo/src/Breadcrumbs.php on line 229

Viewing 3 replies - 1 through 3 (of 3 total)
  • biboocl

    (@biboocl)

    Hi, you can fix it by doing the following in the Breadcrumbs.php file

    correcting line 104:
    $this->args = apply_filters( ‘slim_seo_breadcrumbs_args’, $this->args );

    to this:
    $this->args = apply_filters( ‘slim_seo_breadcrumbs_args’, is_array( $this->args ) ? $this->args : [] );

    I had the same error, but I solved it like this, making sure it is always an array, even if it comes null.

    marxgal

    (@marxgal)

    Same problem as @dmccan , tried the fix suggested by @biboocl, didn’t fix it though.

    Deactivated until this is resolved, sorted the problem but not ideal.

    • This reply was modified 4 months ago by marxgal. Reason: Extra information
    Plugin Author Anh Tran

    (@rilwis)

    Hi @dmccan @marxgal @biboocl ,

    I’ve just fixed this bug. Please update to the latest version.

    The problem happens when you deactivate the Breadcrumbs feature, but use the Schema feature in Slim SEO.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.