Hi, this notice usually means one of the inline style blocks on that page is very large (roughly more than 1 MB of CSS inside a single style tag). When a block is that big, PHP’s regular expression engine hits its backtrack limit (pcre.backtrack_limit, 1000000 by default), so the Autoptimize HTML minifier gets “null” instead of the page HTML, and PHP 8.3 shows this deprecation notice.
It is only a notice: the page still loads, and Autoptimize simply skips HTML minification for that page.
A few ways to solve it:
- Find what adds the large inline CSS (often a page builder or a theme option) and set it to load the CSS as a file instead of inline.
- Ask your host to raise pcre.backtrack_limit, for example to 10000000.
- Or turn off “Optimize HTML Code” in Settings > Autoptimize.
On a live site you can also keep notices off the screen by setting WP_DEBUG_DISPLAY to false: https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
Which theme or page builder does that page use? That will help find where the large inline style comes from.
thanks @softglaze some good points there, the amount of HTML (including large amounts of inline CSS & JS) indeed seems to be the root cause! 🙂
I think “inline all CSS” in Autoptimize is active now, disabling that would be a first step. if you want to ensure the CSS is not render-blocking, you should go down the “critical CSS” path, manually creating rules OR taking an AOPro subscription to have those rules generated automatically.
Lastly; line 118 is where comment removal in the HTML minifier starts, so enabling “keep comments” might help in this case. additionally disabling “minify inline CSS/ JS” might also prove useful.
hope this helps,
frank (ao dev)
Thanks @futtta, happy to help, and thanks for adding the details about line 118 and the inline CSS settings.
@calliko, I would start with Frank’s first step: in Settings > Autoptimize, uncheck “Inline all CSS?”, save, clear the cache and check the page again. If the notice is still there, check “Keep HTML comments?” next. Let us know which one fixes it for you.