I think you need to understand what blocking javascript and css means first, because this is not doable without manual extensive work.
Blocking CSS exists for a reason, which is to tell the browser how “to render” the design before showing anything else. If you are to remove the render blocking css, you would need a preloader with javascript or else your page would show without any style (broken design) and then, if you have a slow mobile connection, it would take a few seconds to start showing properly.
CSS is meant to be blocking and should be decided by the theme authors, not plugins.
You could inline all the css in order to bypass that message on pagespeed… but this is nonsense. While you would have better score, your site would be slower and you wouldn’t take benefit of browser cache for external css files (which are downloaded once only) and instead, you would force people to download all your inlined css every pageload.
But great, you would have better pagescore while in reality, visitors would be annoyed.
It’s also a misconception that better score means better rankings… but that’s another story.
The same is valid for javascript. Many sites need to load jquery before anything else, so you cannot even defer javascript for that reason alone.
For example, a slider will possibly have a div, that calls a jquery function inline… but if you have deferred it, jQuery would be undefined when the dom loads that div, resulting in errors and the slider not working.
The only time you can defer javascript is when your theme absolutely doesn’t rely on jquery to do something as it loads. Even in these cases, submit or search buttons often rely on it to submit a form, so if a user is fast enough to open the page and quicly perform a search, it will not work until he finishes downloading that deferred javascript (but he will think the site is broken, because there’s no way for him to know when jquery is ready or not before clicking anywhere).
Again, the solution would be a preloader that unlocks once the deferred javascript loads… but yet again, that’s for the theme authors to implement.
Also, are the users on mobile willing to wait for several seconds for a preloader?
I certainly not, so I’ll go to another page… but you’ll still have good pagespeed score.
Perhaps you could take a read here:
https://blog.wp-rocket.me/the-truth-about-google-pagespeed-insights/
-
This reply was modified 8 years, 1 month ago by Raul P..