• Resolved Jeromin

    (@jerominrebatet)


    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 1 year, 3 months ago by Jeromin.
Viewing 16 replies (of 16 total)
  • Thread Starter Jeromin

    (@jerominrebatet)

    Thank you very much.

    I see what you mean but I can’t as for admins I don’t want to enabled AO.
    If I use that filter my code would be executed only with AO enabled.

    So for know I will keep CSS disabled for that page only… until I find a better idea.

Viewing 16 replies (of 16 total)
  • The topic ‘Conflict with WP PHP function’ is closed to new replies.