Support » Fixing WordPress » Deprecated warnings for core WP with PHP 8.1

  • Resolved willemb2

    (@willemb2)


    I’m reading here that PHP 8.x is still in beta support for WP 6.0 but security updates for PHP 7.4 are ending 28 Nov 2022. So I decided tot test with WP 6.02 and PHP 8.1 on our staging site.

    Unfortunately we get many Depricated lines. Some on the front end, and the dashboard gets flooded with these lines. I think /wp-includes/functions.php and /wp-includes/formatting.php are WP core, not some outdated plugin or theme.

    Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/ams01-dbjv/sites/lvbhbnldev/public/wp-includes/functions.php on line 7035
    
    Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/ams01-dbjv/sites/lvbhbnldev/public/wp-includes/functions.php on line 2164

    (repeated many times)

    Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/ams01-dbjv/sites/lvbhbnldev/public/wp-includes/formatting.php on line 2772

    (repeated 2 times)

    Theme is Avada 7.8.2, but I don’t think the above is related to the theme.

    • This topic was modified 8 months ago by willemb2.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Do the errors continue with _all_ plugins deactivated and the Twenty Twenty-Two theme in use?

    If so, please report them by following the steps at https://make.wordpress.org/core/handbook/testing/reporting-bugs/

    If not, please re-activate each plugin, and Avada after those, one by one until you find the one causing the problem and report that to the plugin’s or theme’s support.

    Thread Starter willemb2

    (@willemb2)

    Hmmm, no, with twenty-twenty-two and all plugins (except staging) disabled I’m not getting any ‘depricated warnings’. I don’t understand why some plugin or theme could cause errors in /wp-includes/functions.php and /wp-includes/formatting.php but that must be my lack of PHP knowledge.

    So I guess I’m up to the task of activating 45 plugins one by one…..

    Thread Starter willemb2

    (@willemb2)

    Well it looks like 3 little plugins that were custom build for us are causing the problem. They seem to cause a cascade of errors in WP, Ninja Forms, Newsletter and Woocommerce when PHP is set to 8.1

    When I leave them deactivated everything else seem to work fine.

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    I don’t understand why some plugin or theme could cause errors in /wp-includes/functions.php and /wp-includes/formatting.php

    Both files process and include functions from plugins and themes as well as core. 🙂

    Ninja Forms, Newsletter and Woocommerce

    Excellent, those aren’t custom-built plugins, so please report those at:

    https://wordpress.org/support/plugin/ninja-forms/
    https://wordpress.org/support/plugin/newsletter/
    https://wordpress.org/support/plugin/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Deprecated warnings for core WP with PHP 8.1’ is closed to new replies.