Not sure what exactly is broken (the linked page does load and looks OK-ish) nor how WPFC is involved, but I do see “wp is not defined” error on the browser console. Can you try adding wp-includes/js to the JS optimization exclusion list (and clearing WPFC’s cache)?
Ah but I meant excluding it in Autoptimize’s JS optimization settings 🙂
hmm, something (WPFC or something else?) is still deferring the excluded JS, you’ll have to disable that.
I disabled all plugins and enabled them one by one. The error appears when you enable the “Woody code snippets (PHP snippets | Insert PHP)” or “WP Fastest Cache” plugins, either separately or together.
after I turned off my code in WoodySnipet. It all worked without errors. Please check it for yourself.
add_filter('script_loader_tag', 'add_async_attribute', 10, 2);
function add_async_attribute($tag, $handle)
{
if(!is_admin()){
if ('jquery-core' == $handle) {
return $tag;
}
return str_replace(' src', ' defer src', $tag);
}else{
return $tag;
}
ah, that 100% sure is the culprit 🙂
Perhaps you have some recommendations for me to increase PageSpeed Insights indicators
-
This reply was modified 1 year, 5 months ago by
James Huff. Reason: redundant link removed
well, first thing to do would be to remove as much of the render-blocking resources (CSS & JS) as possible.
for CSS have a look at the “eliminate render-blocking CSS” option, but do take into account you’ll have to either;
a) generate & copy/paste the “above the fold CSS” in the field below (more info in the AO FAQ, look for “inline & defer CSS”) OR
b) create manual rules on the “critical CSS” tab (generating critical css for each rule) OR
c) take a subscription over at criticalcss and paste your API in the field on the critical CSS tab
for JS consider switching from “aggregate JS” to “don’t aggregate JS but defer” + “also defer inline JS”.
hope this helps,
frank