10up / 10up-experience

The 10up Experience plugin configures WordPress to better protect and inform clients, aligned to 10up’s best practices.
GNU General Public License v2.0
129 stars 27 forks source link

PHP 8.1/8.2 Compat #142

Closed turtlepod closed 10 months ago

turtlepod commented 11 months ago

Describe the bug

Activating the plugin in site with PHP 8.2 trigger this deprecated notice:

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /nas/content/live/devcic/wp-includes/functions.php on line 7127

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /nas/content/live/devcic/wp-includes/functions.php on line 2182

Steps to Reproduce

  1. Install the plugin.
  2. Make sure you use PHP 8.2
  3. Make sure you set WP_DEBUG to true
  4. Activate the plugin.
  5. See the php notice

Screenshots, screen recording, code snippet

image

Environment information

Windows 11 Pro. Chome (latest)

WordPress information

Host: WP Engine WP: Version 6.3.2

Code of Conduct

TylerB24890 commented 10 months ago

This occurs on PHP 8.1 as well.

EDIT: Looks like there's a PR open already: https://github.com/10up/10up-experience/pull/135

turtlepod commented 10 months ago

Thanks @TylerB24890 Title updated.

darylldoyle commented 10 months ago

This is closed by #135