• Resolved jotaf

    (@jotaf)


    Hi Gabe!

    Congratulations and thank you for such an amazing plugin, started using it this week and already fell in love with it <3

    But I’m having an issue! Trying to combine JS but somehow they’re not combined on the output source code.

    I can see 7 files in the header like this:

    <script data-wpacu-script-handle=javascript defer=defer src=https://example.com/javascript.js>

    And then another 21 on the Footer with the same structure.

    I’ve checked with my hosting and they’ve confirmed that the DOMDocument XML DOM Parser is enabled in PHP and also that the folder /wp-content/cache/asset-cleanup/ is writable

    Is there anything we could look at to know why the files are not getting combined or is this expected behavior?

    Many thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @jotaf I’d like to check this for you. I’m glad you like the plugin and hopefully, you will use it for the long term. Can you send me your “System Info” (you can find it in “Tools”, plugin’s menu) privately via https://gabelivan.com/contact/ as it contains sensitive information? It would help me debug the issue. Thanks in advance!

    Thread Starter jotaf

    (@jotaf)

    Thanks so much @gabelivan just sent you the submission through the form ??

    Plugin Author Gabe Livan

    (@gabelivan)

    @jotaf it looks like you’re using Asset CleanUp, Autoptimize, Async Javascript & W3 Total Cache. You don’t need all of them for optimization as some of their features interfere one with another. Also, minify HTML is enabled in one of those plugins which likely affects the alteration of the HTML source by Asset CleanUp.

    I’ll make a few tests with W3 Total Cache (latest version) and let you know if I find anything that could be incompatible. From what I noticed, the feature that minifies the HTML is triggering BEFORE Asset CleanUp alters the HTML source (e.g. for combination and other things). The Asset CleanUp minification seems to work fine for the JavaScript files.

    Plugin Author Gabe Livan

    (@gabelivan)

    @jotaf Update: HTML Minify from W3 Total Cache is enabled on your end. This interferes with Asset CleanUp’s combine CSS/JS feature. I came up with a fix as W3 Total Cache has its own WordPress hook for compatibility with other plugins in case of situations like this one.

    So, I made a change that would make the combine CSS/JS work. I’ve already pushed it to the “development” version. It will be released in the next tag which will be 1.3.5.1.

    In order to benefit from the fix earlier, you could delete the current version of Asset CleanUp (no worries, all settings will be preserved) and replace it with the “Development Version” here: https://www.ads-software.com/plugins/wp-asset-clean-up/advanced/ (Scroll to “Previous Version” at the bottom of the page and you will notice it).

    PS: Please make sure that if you decide to also use Minify CSS, only choose either the one in W3 Total Cache or the one in Asset CleanUp. The same goes for JS optimization. Mixing the feature from both plugins would lead to the usage of more resources and potential conflicts when it comes to optimization. For instance, you can have “Minify HTML” enabled in W3 Total Cache and Minify CSS/JS enabled in Asset CleanUp as they will both work fine from now on.

    Thread Starter jotaf

    (@jotaf)

    Hi @gabelivan awesome, thanks so much for the development ??

    I’ll try and let you know how it goes

    Thread Starter jotaf

    (@jotaf)

    Hey @gabelivan first I tried your instructions with the new version of the plugin but .js files were still not combining

    I’ve realized we also had HTML minification enabled on Autoptimize, apart from also having it on W3 total cache. I’ve disabled both but now js files don’t even show the “data-wpacu-script-handle=” or the defer atribute, they only show as:

    <script type=’text/javascript’ src=’https://example.com/wp-content/themes/theme-folder/js/javascript.js’></script&gt;

    What else could we try?

    Thread Starter jotaf

    (@jotaf)

    Forgot to say we also disabled Async Javascript to help the tests

    Plugin Author Gabe Livan

    (@gabelivan)

    @jotaf I’ve checked your website and it looks like you’re using the Autoptimize minify/combine for the JavaScript files. If it works fine, you can keep it and just use Asset CleanUp to unload the useless CSS/JS from certain pages.

    You wouldn’t see “data-wpacu-script-handle” anymore because the SCRIPT tags are getting stripped since they are combined into fewer files which are not belonging to Asset CleanUp.

    Is everything alright now?

    Thread Starter jotaf

    (@jotaf)

    Hi @gabelivan

    Thanks so much for your help and for the quick fix on development version.

    After you pointed us to HTML minifcation being the possible culprit we were finally able to combine the files with Autoptimize without breaking the site and now we’re using Asset CleanUp only for striping unnecessary CSS/JS from pages and posts.

    When I have some free time will definetely test Asset Clean Up for combining/minifying and see if we get better results with that than the ones we have with the approach we’ve taken.

    Again, your help and dedication is really appreciated

    Cheers

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Not combining JS files’ is closed to new replies.