@mary2003 this is a combined JS file (since you activated the option to combine files) that is made up of several files. Some of them have unused JS code (as not all of it is triggered on certain pages) and even if you do not combine the files (e.g. leave them as they are), you will still get the same alert in Google PageSpeed Insights from each file individually. So, this is not a plugin problem.
One of the ways to reduce unused JS is to unload JS files that are needed on the page. You have to be careful of course to avoid unloading files that might be needed. This way, the newly generated combined JS file will be smaller in size and Google PageSpeed Insights will put less importance on it.
The same thing applies to combined CSS files. I hope it helps!
@gabelivan
Thank you very much for your quick answer, more or less I understood it, then it is best to disable the option to combine the js and css files?
I did not understand the second paragraph very well:
One of the ways to reduce unused JS is to unload JS files that are needed on the page. You have to be careful of course to avoid unloading files that might be needed. This way, the newly generated combined JS file will be smaller in size and Google PageSpeed Insights will put less importance on it.
Thank you very much for the help!
@mary2003 if the option to combine CSS/JS files works well for you, and you have noticed results in Google PageSpeed Insights, you can keep it. Even if you disable the option, Google PageSpeed Insights will still report unused CSS/JS from the files. The point is: even if you combine CSS/JS (e.g from 10 files), there will still be unused code there and it will be reported. Asset CleanUp does the combining for you (and minifying if enabled), but it doesn’t automatically remove any unused code.
Asset CleanUp can help you unload CSS/JS files. Let’s say you have 10 CSS files and you combine them into one CSS file. It will end up in a large file with all the unused CSS reported from those 10 files. If you find out that you do not need some of those files on the homepage (just an example), then you can unload them and you will end loading only 6 files (after you unload the useless ones). In the end, the combined CSS file will be smaller, and less unused code will be reported by Google PageSpeed Insights.
There’s no option in Asset CleanUp that will automatically just delete ONLY the unused code and load only the needed one. I hope it helps!
@gabelivan Thank You!!, now I understand how it works, !
bye! bye