Conflict with WP PHP function

[ad_1]

Hello,

I ran into a bug which is caused by the CSS optimizer.
I’m using that function wp_add_inline_script in function.php and after lots of test, autoptimize doesn’t load the content of that page if that code is present AND if the page has the CSS optimizer enabled.

I’m using last versions of WordPress (6.4.2) and last of autoptimize (3.1.10) with PHP 8.1.16.

Hope information is useful to fix.

No server errors, only deprecation following the bug :
PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /srv/data/web/vhosts/{obfuscated}/htdocs/wp-content/plugins/autoptimize/classes/autoptimizeBase.php on line 617
PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /srv/data/web/vhosts/{obfuscated}/htdocs/wp-content/plugins/autoptimize/classes/autoptimizeBase.php on line 589

A previous warning, which doesn’t seem to be related :
PHP Warning: Undefined array key 1 in /srv/data/web/vhosts/{obfuscated}/htdocs/wp-content/plugins/autoptimize/classes/autoptimizeStyles.php on line 538

I remain available if necessary.
Have a good day !

  • This topic was modified 3 hours, 16 minutes ago by Jeromin.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer