xwp / wp-dependency-minification

Dependency Minification plugin for WordPress
http://wordpress.org/plugins/dependency-minification/
52 stars 10 forks source link

Add option for only CSS minification #56

Open msigley opened 10 years ago

msigley commented 10 years ago

Unfortunately JavaScript minification isn't fool proof it would be great if there was an option for only minifying CSS files. This would also decrease the CPU footprint on sites where JS minification is unnecessary.

msigley commented 10 years ago

For anyone else with this issue, commenting out this filter works well enough for now:

//add_filter( 'print_scripts_array', array( __CLASS__, 'filter_print_scripts_array' ) );
westonruter commented 10 years ago

@msigley or, instead of commenting out that line in the plugin itself, you could add another plugin like:

add_action( 'plugins_loaded', function () { 
    remove_filter( 'print_scripts_array', array( 'Dependency_Minification', 'filter_print_scripts_array' ) ); 
}, 101 );
msigley commented 10 years ago

@westonruter Thanks for the tip. I'll stick with the comment for as its more CPU efficient, my website has alot of traffic. A settings page in the admin area with checkboxes for things like this would be great for 1.0. JS concatenation isn't allows desired or possible.