• Resolved svenms

    (@svenms)


    Hello,

    When updating php to 8.1 we can see a lot of Warnings in debug:

    str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

    This is what we can also get in New Relic:
    
    
    in str_replace called at /home/chilevapo.cl/public_html/wp-includes/formatting.php (3993)
    in wp_trim_excerpt called at /home/chilevapo.cl/public_html/wp-includes/class-wp-hook.php (324)
    in WP_Hook::apply_filters called at /home/chilevapo.cl/public_html/wp-includes/plugin.php (205)
    in apply_filters called at /home/chilevapo.cl/public_html/wp-includes/post-template.php (434)
    in get_the_excerpt called at /home/chilevapo.cl/public_html/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-opengraph.php (148)
    in RankMath\OpenGraph\OpenGraph::fallback_description called at /home/chilevapo.cl/public_html/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-opengraph.php (125)
    in RankMath\OpenGraph\OpenGraph::get_description called at /home/chilevapo.cl/public_html/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-twitter.php (174)
    in RankMath\OpenGraph\Twitter::description called at /home/chilevapo.cl/public_html/wp-includes/class-wp-hook.php (324)
    in WP_Hook::apply_filters called at /home/chilevapo.cl/public_html/wp-includes/class-wp-hook.php (348)
    in WP_Hook::do_action called at /home/chilevapo.cl/public_html/wp-includes/plugin.php (565)
    in do_action_ref_array called at /home/chilevapo.cl/public_html/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php (90)
    in RankMath\OpenGraph\OpenGraph::do_action called at /home/chilevapo.cl/public_html/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-opengraph.php (74)
    in RankMath\OpenGraph\OpenGraph::output_tags called at /home/chilevapo.cl/public_html/wp-includes/class-wp-hook.php (324)
    in WP_Hook::apply_filters called at /home/chilevapo.cl/public_html/wp-includes/class-wp-hook.php (348)
    in WP_Hook::do_action called at /home/chilevapo.cl/public_html/wp-includes/plugin.php (565)
    in do_action_ref_array called at /home/chilevapo.cl/public_html/wp-content/plugins/seo-by-rank-math/includes/traits/class-hooker.php (90)
    in RankMath\Frontend\Head::do_action called at /home/chilevapo.cl/public_html/wp-content/plugins/seo-by-rank-math/includes/frontend/class-head.php (172)
    in RankMath\Frontend\Head::head called at /home/chilevapo.cl/public_html/wp-includes/class-wp-hook.php (324)
    in WP_Hook::apply_filters called at /home/chilevapo.cl/public_html/wp-includes/class-wp-hook.php (348)
    in WP_Hook::do_action called at /home/chilevapo.cl/public_html/wp-includes/plugin.php (517)

    The message goes away when disabling Rank Math Plugin.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @svenms,
     
    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.
     
    Please confirm if you’re using the latest version of the Rank Math plugin on your site: https://rankmath.com/changelog/
     
    If the issue persists, please share the full error message with this line:
    str_replace(): Passing null to parameter #3
     
    Looking forward to helping you.

    Thread Starter svenms

    (@svenms)

    Hello,

    Using the last version of Rank Math and Php 8.1

    I did a trace back after the Deprecated was issued:

    [17-May-2024 17:50:29 America/Santiago] PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/aaa/public_html/wp-includes/functions.php on line 2191


    [17-May-2024 17:50:29 America/Santiago] #0 /home/aaa/public_html/wp-includes/link-template.php(3653): wp_normalize_path() 1 /home/aaa/public_html/wp-includes/plugin.php(848): plugins_url() 2 /home/aaa/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/404-monitor/class-admin.php(139): plugin_dir_url() 3 /home/aaa/public_html/wp-content/plugins/seo-by-rank-math/includes/module/class-base.php(86): RankMath\Monitor\Admin->register_admin_page() 4 /home/aaa/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/404-monitor/class-admin.php(71): RankMath\Module\Base->__construct() 5 /home/aaa/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/404-monitor/class-monitor.php(41): RankMath\Monitor\Admin->__construct() 6 /home/aaa/public_html/wp-content/plugins/seo-by-rank-math/includes/module/class-manager.php(487): RankMath\Monitor\Monitor->__construct() 7 /home/aaa/public_html/wp-content/plugins/seo-by-rank-math/includes/module/class-manager.php(467): RankMath\Module\Manager->load_module() 8 /home/aaa/public_html/wp-includes/class-wp-hook.php(324): RankMath\Module\Manager->load_modules() 9 /home/aaa/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 10 /home/aaa/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() 11 /home/aaa/public_html/wp-settings.php(550): do_action() 12 /home/aaa/public_html/wp-config.php(94): require_once('…') 13 /home/aaa/public_html/wp-load.php(50): require_once('…') 14 /home/aaa/public_html/wp-admin/admin-ajax.php(22): require_once('…') 15 {main}

    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @svenms,
     
    If your plugins and your WordPress versions are all in the latest version, this could be due to a conflict with other plugins. Can you please check that by following this guide? https://rankmath.com/kb/check-plugin-conflicts/
     
    If the issue persists, please head over to your WP Dashboard > Rank Math > Status & Tools > System Status and click the “Copy System Info to Clipboard” button, and paste it here so we can further analyze the issue.
     
    Looking forward to helping you.

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

The topic ‘str_replace(): Passing null to parameter #3 Deprecated’ is closed to new replies.