• Resolved leandrosilvaarq

    (@leandrosilvaarq)


    Hello,

    I am trying to reduce the unused JavaScript and identified CSS on PageSpeed Insights using W3 Total Cache and Flying Scripts.

    JS
    /wp-content/cache/minify/bd65e.js
    /wp-content/cache/minify/864c2.js

    CSS
    /wp-content/cache/minify/70f78.css
    /wp-content/cache/minify/a5ff7.css

    I have already attempted to exclude the 4 files through the options “Never minify the following JS files” and “Never minify the following CSS files,” but unfortunately, it’s not working.

    Thanks in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @leandrosilvaarq

    Thank you for reaching out and I am happy to help!

    The problem is that the unused JavaScript and CSS are unused before the minification. What you are attempting to do is to exclude from the Minify the files that are created by the Minify option.
    What you should do is to disable Minify, check the individual files that are marked as unused, optimize those files with the other plugin (Please note that this removes the file entirely and may break your pages), and before you re-enable Minify, make sure to add those files to ?“Never minify the following JS files” and “Never minify the following CSS files,” To ensure that the files are not minified.
    Make sure to save all settings and purge the cache.

    I hope this helps and let me know if you have any other questions

    Thanks!

    Thread Starter leandrosilvaarq

    (@leandrosilvaarq)

    Hello @vmarko,

    Thank you for your response and solution.

    Disabling Minify shows the following list of files identified as unused:

    /wp-content/themes/semplice6/assets/js/shared.scripts.min.js?ver=6.2.4
    /wp-content/themes/semplice6/assets/js/frontend.scripts.min.js?ver=6.2.4
    /wp-content/themes/semplice6/assets/js/frontend.min.js?ver=6.2.4
    /wp-includes/js/mediaelement/mediaelement-and-player.min.js?ver=4.2.17
    /wp-includes/js/mediaelement/mediaelement-migrate.min.js?ver=6.4.3
    /wp-includes/js/jquery/jquery.min.js?ver=3.7.1

    /wp-content/themes/semplice6/assets/css/frontend.min.css?ver=6.2.4
    /wp-includes/css/dist/block-library/style.min.css?ver=6.4.3

    /wp-content/plugins/w3-total-cache/pub/js/lazyload.min.js

    “Semplice” is the theme we use for website development, so I’m unsure if it’s possible to delay/delete any of the files mentioned above using the other plugin.

    With Minify turned off, if I add them in the other plugin, activate Minify, and the website stops working, can I revert those changes? Or will I need to remove W3 Total Cache, delete the folders in cPanel, and reinstall it again?

    Thanks in advance.

    Best regards,
    Leandro

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @leandrosilvaarq

    Sorry for the delay.

    Have you added those files to exclusion in minify settings? And if the minify is disabled, with those files added to the other plugin, does the issue persist?

    Thanks!

    Thread Starter leandrosilvaarq

    (@leandrosilvaarq)

    Hello @vmarko,

    Thanks for your reply.

    I disabled Minify and then added the following keywords (based on the list of files identified as unused) to Flying Scripts:

    js/shared.scripts.min.js
    js/frontend.scripts.min.js
    js/frontend.min.js
    js/mediaelement/mediaelement-and-player.min.js
    js/mediaelement/mediaelement-migrate.min.js
    js/jquery/jquery.min.js

    css/frontend.min.css
    css/dist/block-library/style.min.css

    js/lazyload.min.js

    I attempted to add keywords one by one (to observe the outcome), but each time I added one, the website ceased to function properly (everything appeared blank) due to the inclusion of those keywords in Flying Scripts.

    Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @leandrosilvaarq

    Sorry for the late reply.

    This seems to be related to the other plugin you are using. You should approach this with care and only remove the files from the pages those files are not needed.

    We have added similar feature in the latest 2.7.0 release.

    Thanks!

    Thread Starter leandrosilvaarq

    (@leandrosilvaarq)

    Hello @vmarko,

    Those keywords are related to the “Semplice” theme used on the website, so I can’t correctly identify which specific pages those keywords are being used on.

    If I’m not mistaken, the other plugin only allows adding keywords in a general manner and does not apply them to specific pages (it only allows excluding keywords on specific pages).

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Excluding minified css and js files’ is closed to new replies.