@sethbutler Thank you for the kind words.
It is easy to disable any script from being included in the minification process. You can disable any script from being minified by adding:
function _exclude_nextgen_from_depmin( $is_excluded, $handle, $src ) {
if ( 'nextgen' === $handle ) { // not sure what handle is used, can also check $src
$is_excluded = true;
}
return $is_excluded;
}
add_filter( 'dependency_minification_excluded', '_exclude_nextgen_from_depmin' , 10, 3);
You can adjust that condition in there to match any number of dependencies, based on the $handle or the $src URL. Put this in your functions.php or in a mu-plugin.
See also http://wordpress.org/support/topic/woocommerce-not-supported?replies=4#post-4555036
Weston,
Thank you for the super-quick response!
Should I wrap this code excerpt in anything before adding to functions.php or can I paste verbatim and thus exclude the Nextgen scripts?
Forgive me for asking, but I am no PHP ninja.
Cheers
Seth
P.S. Off hand, have you ever used in conjunction with WC3 total cache and disabled WC3 from handling the CSS & JS?
@sethbutler You should be able to paste it in verbatim, although the 'nextgen' part may need to be adjusted to reflect the actual handle registered for the NextGEN script(s). And actually, it seems there are lots of scripts that NextGEN enqueues, so you may need to add multiple conditionals to select multiple scripts to reject. Here’s another way to do this. Let’s say you want to reject, nextgen-a.js, nextgen-b.js, and nextgen-c.js. You could so so as follows:
function _exclude_nextgen_from_depmin( $is_excluded, $handle, $src ) {
if ( preg_match( '/(nextgen-a|nextgen-b|nextgen-c)\.js/', $src ) ) {
$is_excluded = true;
}
return $is_excluded;
}
add_filter( 'dependency_minification_excluded', '_exclude_nextgen_from_depmin' , 10, 3);
@sethbutler Regarding:
P.S. Off hand, have you ever used in conjunction with WC3 total cache and disabled WC3 from handling the CSS & JS?
No, I have not tried this. And I would shy away from W3 Total Cache and the other comprehensive caching plugins and instead try to use ones that do one thing and do it well. Perhaps the best caching plugin in this vein is Batcache, a version of which is used on WordPress.com itself.
Weston,
Thank you again for the sound council!
We were able to implement W3 Total Cache in conjunction with Dependency Minification in the short term by removing W3 Total Cache’s control of CSS/JS minification and look forward to working on testing and implementing a more lightweight and singular caching plugin such as Batcache here in the near future!
Thank you for all your positive inputs!
Cheers
Seth