I also noticed less files being concatenated, without style order or number having changed on my site, and took a look as to why. MMR makes sure that styles with different media types don’t get concatenated into one (which is good because that could break the look of the site otherwise), but it doesn’t fall back to the default of ‘all’ for enqueued styles where no media type was given. This is easily fixed by some slight re-ordering of the code that does check the media type (diff against MMR 1.7.2):
--- merge-minify-refresh.php Tue Feb 28 03:16:28 2017
+++ merge-minify-refresh.php Tue Feb 28 13:59:55 2017
@@ -682,8 +682,8 @@
if( $this->host_match($wp_styles->registered[$handle]->src) && !in_array($wp_styles->registered[$handle]->src, $this->ignore) && !isset($wp_styles->registered[$handle]->extra["conditional"])) { //is a local script
- if(!$this->mergecss || isset($footer[count($footer)-1]['handle']) || count($footer) == 0 || $footer[count($footer)-1]['media'] != $wp_styles->registered[$handle]->args ) {
- $media = isset($wp_styles->registered[$handle]->args) ? $wp_styles->registered[$handle]->args : 'all';
+ $media = isset($wp_styles->registered[$handle]->args) ? $wp_styles->registered[$handle]->args : 'all';
+ if(!$this->mergecss || isset($footer[count($footer)-1]['handle']) || count($footer) == 0 || $footer[count($footer)-1]['media'] != $media ) {
array_push($footer, array('modified'=>0,'handles'=>array(),'media'=>$media ));
}
@@ -830,8 +830,8 @@
if( $this->host_match($wp_styles->registered[$handle]->src) && !in_array($wp_styles->registered[$handle]->src, $this->ignore) && !isset($wp_styles->registered[$handle]->extra["conditional"])) { //is a local script
- if(!$this->mergecss || isset($header[count($header)-1]['handle']) || count($header) == 0 || $header[count($header)-1]['media'] != $wp_styles->registered[$handle]->args ) {
- $media = isset($wp_styles->registered[$handle]->args) ? $wp_styles->registered[$handle]->args : 'all';
+ $media = isset($wp_styles->registered[$handle]->args) ? $wp_styles->registered[$handle]->args : 'all';
+ if(!$this->mergecss || isset($header[count($header)-1]['handle']) || count($header) == 0 || $header[count($header)-1]['media'] != $media ) {
array_push($header, array('modified'=>0,'handles'=>array(),'media'=>$media ));
}