Remove render-blocking JavaScript - jQuery and jQuery Migrate

Hello,
I’m trying to optimize performance for my website. After testing with Google PageSpeed I’m getting a warning: “Should fix - Eliminate render-blocking JavaScript and CSS in above-the-fold content” for 2 js files located in BB plugin:

…/plugins/bb-plugin/js/jquery.js
…/plugins/bb-plugin/js/jquery.migrate.min.js

I was able to optimize all other js files with Speed Booster Pack(move files to the footer and defer) but it doesn’t work for the files above.

Link to the PageSpeed result

I would appreciate any help with this issue.

Best regards,
Damian

Hey Damian,

Your site isn’t actually loading those files, those are just fallbacks in case the theme you’re using is loading an older version of jQuery. If you want to remove it, you can add the function below.
remove_action(‘wp_footer’, ‘FLBuilder::include_jquery’);

Hope this helps and let us know if we can assist further! :slight_smile:

Ben

Hey Ben,

thank you, it fixes the issue :slight_smile:

Best regards,
Damian

Hey Ben,

only one question more, are you using with bb plugin the yui files:

http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js

http://yui.yahooapis.com/combo?3.5.1/build/widget-base/assets/skins/sam/widget-base.css

I have problem to optimize them on another website. It’s strange because on metapartner website I don’t see these files and I have bb plugin installed.

Best regards,
Damian

Hi Damian,

I believe the yui-min.js is from the slidershow module. However, I am unable to find any widget-base.css in the source. This is likely coming from another plugin or script.

Thanks,
Danny

Hi Danny,

I’m using the slideshow as a background in the row, so yes, you’re right and I think the css file is also from the slideshow module. I don’t see this file on the other pages or when I disable the slideshow.

I was able to fix the js file after adding a defer attribute to the script, but the css file is giving me hard time, as it’s external, not minified version with 2 lines of code. Even GTmetrix gives me 30 penalty points for using not minified version.

http://yui.yahooapis.com/combo?3.5.1/build/widget-base/assets/skins/sam/widget-base.css

Is it possible to use for these 2 lines of csscode a minified version or embed it locally?

Best regards,
Damian

Hey Damian,

The only script that the builder loads is this one when the Slideshow module is used as it’s built on YUI…

http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js

The other YUI scripts/styles that you are seeing get loaded by that script after the page is loaded, so it shouldn’t actually affect your page load time. Those resources are in fact being deferred even though it does look like GTmetrix might not be seeing them that way.

Unfortunately, we don’t have control over the scripts/styles that the main YUI script loads, so the only way to change that is to use a different slideshow plugin.

Sorry I don’t have a better answer for you there.

Justin