@bredamcguigan I’ve checked your website, its PageSpeed Insights report and the “System Info” you sent me and everything is looking good there.
As you noticed CSS & JS files are combined into groups as they should with few exceptions:
- CSS/JS from different domains are never combined (e.g. from cdnjs.cloudflare.com, use.fontawesome.com)
- There are a few files from “smart-slider-3” plugin that do not get combined. From what I’ve noticed their URL is not starting with
http://, but with //– It looks like the plugin is stripping the “http:” from the beginning to make it relative (it will adapt based on whether you’re using an SSL or not). However, this should have still worked. I’ll double-check and if that’s the case (there’s no other reason I could think of), I’ll update the plugin so it will combine those files too.
- One file that should have been combined is just not combine for some reason and I need to make an investigation for this one. It’s
/wp-content/plugins/google-analytics-for-wordpress/assets/js/frontend.min.js?ver=7.9.0
I’ll get back to you after I’ll check the last two things from the things I’ve mentioned.
thanks Gabe I look forward to hearing from you.
Regards
Breda
@bredamcguigan I have news about the “Smart Slider 3” plugin and why it doesn’t combine its JavaScript files. After an investigation, it looks like the plugin is using output buffering to alter the contents of the HTML source after Asset CleanUp does its optimization.
The best way to load CSS/JS in WordPress is to enqueue the assets (read more here: https://developer.ww.wp.xz.cn/themes/basics/including-css-javascript/). However, since “Smart Slider 3” doesn’t do this (e.g. could be very old code that they haven’t updated in a long time related to the loading of the files), it needs special code to make it work. Fortunately, I found a way to apply it as they are offering support (via WordPress hooks) for other performance plugins (e.g. Autoptimize, Hyper Cache).
I’ve updated the development version of Asset CleanUp which is like a beta version for the next tag release (which will obviously have the fix). Just deactivate and delete the current plugin (no worries, all settings will be preserved), and replace it with the one from here: https://ww.wp.xz.cn/plugins/wp-asset-clean-up/advanced/#plugin-download-history-stats (make sure ‘Development Version’ is chosen from the drop-down). Once you do this, you should get the “Smart Slider 3” JavaScript (.js) files combined. It worked well in my tests.
Let me know how it goes or if you have any questions about it at your earliest convenience!
thanks Gabe,
I’ve installed the development version and it seems to have worked for the Slider files.
Would you mind running the google page speed test again have have a look at the results, it is showing 4 js files all on my hosting as seperate files. The gtmetrix is showing “1.0MiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.”
thanks
Breda
Update, I am after buying the pro version. I’ll try using it and see if there is any difference.
thanks
Breda
@bredamcguigan I’ve checked the GTmetrix score. You can either unload useless JS (if you will find anymore via trial and error) to reduce the total size (e.g from 1MB to 600KB which will make a difference).
Then, you can use the Pro version to “defer” remaining loaded (render-blocking) JS files. This would guarantee the boost of the score in both the GTmetrix and PageSpeed score. Please enable “Test Mode” if you’re unsure whether something needs to be deferred or not. After all, libraries such as jQuery and those that are needed very early in the page should be left render-blocking. Also, by using the Pro feature “Move SCRIPTS from HEAD to BODY” will boost even further the PageSpeed Insights score (GTmetrix is more picky about it).
Let me know how it goes. From what I’ve noticed, the “Defer parsing of JavaScript” GTmetrix score can be improved a lot 100% without breaking any functionality or making compromises.
thanks I will try that.
Regards
Breda