There is an error in your code when searching in a website

#904210
  • Resolved Diana Tincheva
    Rank Math free

    Hello,
    When searching in a website (website.com?s=<search-string>) your plugin throws an error:

    [02-Nov-2024 13:06:45 UTC] PHP Fatal error: Uncaught ValueError: Missing padding character /public_html/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php:273

    Stack trace:
    #0 public_html/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php(273): sprintf(‘… …’, ‘something’)
    #1 [internal function]: RankMath\Frontend\Breadcrumbs->add_crumbs_search()
    #2 public_html/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php(231): call_user_func(Array)
    #3 public_html/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php(174): RankMath\Frontend\Breadcrumbs->generate()
    #4 public_html/wp-content/plugins/seo-by-rank-math/includes/modules/schema/snippets/class-breadcrumbs.php(34): RankMath\Frontend\Breadcrumbs->get_crumbs()
    #5 public_html/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-jsonld.php(247): RankMath\Schema\Breadcrumbs->process(Array, Object(RankMath\Schema\JsonLD))
    #6 public_html/wp-includes/class-wp-hook.php(326): RankMath\Schema\JsonLD->add_context_data(Array)
    #7 public_html/wp-includes/plugin.php(256): WP_Hook->apply_filters(Array, Array)
    #8 public_html/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(106): apply_filters_ref_array(‘rank_math/json_…’, Array)
    #9 public_html/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))
    #10 public_html/wp-includes/class-wp-hook.php(324): RankMath\Schema\JsonLD->json_ld()
    #11 public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #12 public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
    #13 public_html/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php(90): do_action_ref_array(‘rank_math/head’, Array)
    #14 public_html/wp-content/plugins/seo-by-rank-math/includes/frontend/class-head.php(180): RankMath\Frontend\Head->do_action(‘head’)
    #15 public_html/wp-includes/class-wp-hook.php(324): RankMath\Frontend\Head->head(”)
    #16 public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
    #17 public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #18 public_html/wp-includes/general-template.php(3065): do_action(‘wp_head’)
    #19 public_html/wp-content/themes/cesis_child_theme/header.php(551): wp_head()
    #20 public_html/wp-includes/template.php(810): require_once(‘p…’)
    #21 public_html/wp-includes/template.php(745): load_template(‘p…’, true, Array)
    #22 public_html/wp-includes/general-template.php(48): locate_template(Array, true, true, Array)
    #23 public_html/wp-content/themes/cesis/search.php(12): get_header()
    #24 public_html/wp-includes/template-loader.php(106): include(‘p…’)
    #25 public_html/wp-blog-header.php(19): require_once(‘p…’)
    #26 public_html/index.php(17): require(‘p…’)
    #27 {main}
    thrown in public_html/wp-content/plugins/seo-by-rank-math/includes/frontend/class-breadcrumbs.php on line 273

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

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    Please head over to WordPress Dashboard > Rank Math > General Settings > Breadcrumbs and change the “Search Results Format” to: Search for %s

    Once done, clear your website’s cache and see if that fixes the issue.

    Let us know how that goes. Looking forward to helping you.

    Thank you.

    Hello!

    It us fixed. Thank you for your help.

    Just for your info:
    We have not removed the %s by purpose before. It is possible that we have entered quotes in the text before and after the %s like this “%s” or ‘%s’ which gas caused %s to disappear. Your development team may add some filtering on saving and loading the text data if the field so this issue will not show up again in other cases. (And the breadcrumbs were not even Enabled now. I had to enable them to add %s there.)

    Hello,

    Thank you for the feedback! We appreciate the details on how this issue might have occurred. If this is something our development team can improve in the future, we will surely let you know. Thanks again for sharing.

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

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

You must be logged in to reply to this ticket.