Sites that have a ton of individual JavaScript and CSS files loading for a single page view ended up having so many files trying to be preloaded that it would run up against limits on the HTTP response size being imposed by certain web servers and/or frontend proxies (like Cloudflare).
You need...
No worries… and also sorry about the trouble.
Makes sense now why only a couple people saw it and I couldn’t replicate it though (only on sites loading a ton of individual JavaScript and CSS files causing the headers in HTTP response to be overloaded… not technically a PHP error to be logged or...
So I was able to get a 502 error from Cloudflare... Basically I took all the scripts and CSS you have on that page and then preloaded each of them 10 times. Was just seeing if Cloudflare's side has a limit on HTTP response headers (apparently they do when it gets very, very big).
Given that, it...
Do you have an example URL of your site (even if the plugin is disabled currently)? One possibility might be that your web server has a limitation on the size of the HTTP response headers (normally there's a limitation on the request headers, but not response headers). If that's the case, then...
What happens if you comment just this line (none of the other ones)?
// add_action('wp_print_footer_scripts', [$this, 'handlePrintFooterScripts'], 9999999);
Another option might be to install this plugin:
https://wordpress.org/plugins/query-monitor/
Will capture PHP errors and let you view them in Admin bar...
Anything if the guts of the methods are wrapped in try/catch?
public function handleScriptLoaderTag($tag, $handle, $src)
{
try {
if (is_string($src) && strlen($src) > 3)
{
$this->preload['<' . sanitize_url($src) . '>;as=script;rel=preload']...
Okay... one last test (hopefully).
If you uncomment those two lines, and also replace the handleScriptLoaderTag and handleStyleLoaderTag methods farther down that file (approx line #223) with this:
public function handleScriptLoaderTag($tag, $handle, $src)
{
if (is_string($src)...
I've been digging and trying to think of various "what if" situations. One possibility I've come up with (and would cause an issue regardless if the new option was enabled or not) would be an invalid script or CSS URL came through WordPress's filter mechanism. It's *supposed* to be a string, but...
May be as easy as adding this to your config.php file once it's ready:
define('WP_DEBUG', true);
https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
Did I mention how much I hate that I can't replicate it? 😂