• Resolved alekv

    (@alekv)


    Hi

    Is there a way to programmatically exclude certain scripts (enqueued and inline) from optimization?

    Thanks
    Aleksandar

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

    (@gabelivan)

    @alekv There’s no particular hook attached to the exclusion areas (e.g. “Settings” -> “Optimize CSS” -> “CSS Files Minification” -> “Do not minify the CSS files matching the patterns below (one per line):”). Are you interested in adding things like IF clauses to exclude certain scripts from getting minified (or altered in any way)? As far as I recall, this has never been requested.

    I’d like more information about what you want. The more you can provide to me, the better as I could think of something.

    Thread Starter alekv

    (@alekv)

    I’m also a plugin developer myself (woopt WooCommerce Pixel Manager), currently debugging an install where the scripts of my plugin are not being inserted into the website. At the moment I am not sure if it is because of Asset Cleanup (there are other possible causes I’m looking into). But if it is, I would like to exclude my plugins scripts from Asset Cleanup programmatically, solving this not just for that install but for every install that is using my and your plugin.

    Plugin Author Gabe Livan

    (@gabelivan)

    @alekv you said: “currently debugging an install where the scripts of my plugin are not being inserted into the website” – Asset CleanUp never prevents any scripts by default from being loaded. Everything is loaded and you can select to unload them. Check the “Overview” area from Asset CleanUp which has all the unload rules. Perhaps, on some pages, the scripts that you mentioned were marked for unloading.

    I would like to exclude my plugins scripts from Asset Cleanup programmatically, solving this not just for that install but for every install that is using my and your plugin
    You could exclude them by removing the unload rules (if any). Otherwise, there’s no exclusion to make as none shouldn’t have occurred in the first place.

    Thread Starter alekv

    (@alekv)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘exclude JavaScript files and inline JavaScript from optimization’ is closed to new replies.