Support » Plugin: Dependency Minification » Conflict between NextGen Gallery & T(-) Countdown scripts

  • Resolved sethbutler

    (@sethbutler)


    Hello Weston,

    First off… thank you so much for building such a simple and useful tool! WOW. This plugin had a HUGE positive impact on our load time and we were oh so close to being able to use it.

    It looks like we are mighty close to being able to impliment it, there just seems to be a small conflict in our NextGen Gallery & T(-) Countdown scripts somewhere that messes up the loading on the T(-) Countdown widget on any page with a gallery on it.

    Is there any way to easily remove the scripts and/or style sheets that are called in the Dependency Minification workflow?

    Please Advise!

    Cheers
    Seth

    http://wordpress.org/plugins/dependency-minification/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    @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?

    Plugin Author Weston Ruter

    (@westonruter)

    @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);
    Plugin Author Weston Ruter

    (@westonruter)

    @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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Conflict between NextGen Gallery & T(-) Countdown scripts’ is closed to new replies.