File not getting minified

Ran a test via another SEO tool, and could notice that certain files are appearing as not compressed. On giving a closer look, the files aren't being listed in the Hummingbirds Asset Optimization page.

Please check the chat notes for more info, and help this get fixed asap.

  • Adam Czajczyk

    Hello James

    I hope you're well today and thank you for your question!

    The resources that are reported as not minified are JS scripts and an URL containing ?sccss attribute so let me first address the JS files.

    There's one file that is for sure already minified (the /js/1.11.3/jquery.min.js one) and you can see it by simply opening the file. I'm not quite sure how SemRush is checking that so it's possible that it simply says that "it could be minified even more" but it's also quite possible that it's giving just a "false alarm".

    The main issue with these files, however, seems to be different. If you look into the source code of the page, they are loaded directly in the header section via "<script src>" tag. In WordPress all the CSS/JS files should instead be enqueued (see for reference please: https://premium.wpmudev.org/blog/adding-scripts-and-styles-wordpress-enqueueing/) and only such resources can properly be processed by additional tools.

    That being said, even an enqueued script would actually result in "<script src=>" tag being used in source code, so why am I assuming they are not enqueued? Mostly because of the fact they are not being minified and are not accessible on Hummingbird's "Asset Optimization" list and also because the regular HTML comment above them in source code suggests they were "additionally added".

    Also, while I don't have access to the same version of Enfold theme that you are using, I did check with a slightly newer one and there's no reference to such files at all. That would mean that either this was fixed in newer versions or that they were added manually (e.g. by modifying some header code in the theme or by adding some code to the functions.php file of the theme). They could also be added by some plugin but it's rather unlikely, as I don't see any plugin that would seem to be doing that and also they do reside in Enfold's folder.

    Unfortunately, I couldn't check it because I don't have any access to the theme files and the editor ("Appearance -> Edit") is not available on the site.

    In that case, if you don't recognize these JS scripts and/or don't know why/how they were added, I would need to check the particular theme on your site. In order to be able to do this I'd need FTP access to the site (or access via cPanel) so if that's fine for you, please put FTP credentials for me on "WPMU DEV -> Support" page in a text box under "Access active for X days" button. They won't be posted anywhere publicly - so just let me know here when you added them, make sure that support access is still active, and I'll access the site again and use them to check site files against those JS resources.

    I won't make any changes of course without your prior consent but hopefully this will let me find why those files are not even available for optimization

    As for the SCCSS URL. That is some attribute added by Simple Custom CSS plugin and while I'm not quite sure why, by the looks of it I assume its there to actually prevent caching/minification of it. On "Hummingbird -> Advanced Tools -> General" page you will find an "URL Query Strings" option. Give it a try, please: enable, clear all the caches on site (for Hummingbird that will be "Hummingbird Pro -> Dashboard" page, "Clear Cache" button), give it a moment to re-build cache and check if that solved that particular issue.

    If not, the other option would be to actually move the entire custom CSS from Simple Custom CSS plugin to "Appearance -> Customize -> Additional CSS" and then disable the Simple Custom CSS plugin entirely (after that - again clear caches, wait for it to be rebuild and check again).

    Kind regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.