Fast Velocity Minify - Version 2.5.4

Version Description

[2019.01.11] = * css merging bug fixes

Download this release

Release Info

Developer Alignak
Plugin Icon 128x128 Fast Velocity Minify
Version 2.5.4
Comparing to
See all releases

Code changes from version 2.5.3 to 2.5.4

Files changed (2) hide show
  1. fvm.php +21 -12
  2. readme.txt +4 -1
fvm.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://fastvelocity.com
5
  Description: Improve your speed score on GTmetrix, Pingdom Tools and Google PageSpeed Insights by merging and minifying CSS and JavaScript files into groups, compressing HTML and other speed optimizations.
6
  Author: Raul Peixoto
7
  Author URI: http://fastvelocity.com
8
- Version: 2.5.3
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
@@ -196,8 +196,6 @@ if(is_admin()) {
196
 
197
  # merge, if inline is not selected
198
  if($force_inline_css != true) {
199
- #add_action('wp_print_styles', 'fastvelocity_min_merge_header_css', PHP_INT_MAX );
200
- #add_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_css', 9.999999 );
201
  add_filter('style_loader_tag', 'fastvelocity_min_merge_css', PHP_INT_MAX, 4 );
202
  add_action('wp_print_styles','fastvelocity_add_google_fonts_merged', PHP_INT_MAX);
203
  add_action('wp_print_footer_scripts','fastvelocity_add_google_fonts_merged', PHP_INT_MAX );
@@ -256,6 +254,9 @@ global $fvm_fix_editor, $disable_js_merge, $disable_css_merge, $skip_emoji_remov
256
  remove_action('wp_print_scripts', 'fastvelocity_min_merge_header_scripts', PHP_INT_MAX );
257
  remove_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_scripts', 9.999999 );
258
  remove_action('wp_print_styles', 'fastvelocity_min_merge_css', PHP_INT_MAX );
 
 
 
259
  remove_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_css', 9.999999 );
260
  remove_action('init', 'fastvelocity_min_disable_wp_emojicons');
261
  remove_action('template_redirect', 'fastvelocity_min_html_compression_start', PHP_INT_MAX);
@@ -1669,7 +1670,7 @@ return $tag;
1669
  ###########################################
1670
  # collect all css files as well as inline css code, to be printed later
1671
  function fastvelocity_min_merge_css($html, $handle, $href, $media){
1672
- global $fvm_debug, $wp_domain, $wp_home, $force_inline_css, $fvmualist, $fvm_collect_google_fonts, $force_inline_googlefonts, $min_async_googlefonts, $remove_googlefonts, $skip_google_fonts, $css_hide_googlefonts, $remove_print_mediatypes, $ignore, $blacklist, $ignorelist, $wp_home, $fvmloadcss, $fvm_remove_css, $fvm_cdn_url, $disable_minification, $fvm_min_excludecsslist, $disable_css_minification, $fvm_fix_editor, $fvm_fawesome_method, $csscollect;
1673
 
1674
  # current timestamp
1675
  $ctime = get_option('fvm-last-cache-update', '0');
@@ -1684,11 +1685,6 @@ function fastvelocity_min_merge_css($html, $handle, $href, $media){
1684
  return $html;
1685
  }
1686
 
1687
- # skip all this, if the async css option is enabled
1688
- if($fvmloadcss != false) {
1689
- return $html;
1690
- }
1691
-
1692
  # remove all css?
1693
  if($fvm_remove_css != false) {
1694
  return false;
@@ -1904,7 +1900,7 @@ function fastvelocity_add_merged_css(){
1904
  global $csscollect, $cachedir, $cachedirurl, $fvmloadcss, $fvm_remove_css, $fvm_enabled_css_preload, $collect_preload_css;
1905
 
1906
  # return if disabled
1907
- if ($csscollect != true) {
1908
  return false;
1909
  }
1910
 
@@ -1917,6 +1913,11 @@ function fastvelocity_add_merged_css(){
1917
  # foreach meadiatype, generate css file name, merge, save and print it
1918
  $i = 0; foreach ($csscollect as $mediatype=>$arr) {
1919
 
 
 
 
 
 
1920
  # initialization
1921
  $uid = '';
1922
  $log = '';
@@ -1925,6 +1926,14 @@ function fastvelocity_add_merged_css(){
1925
  # filename for this mediatype
1926
  foreach ($arr as $k=>$narr) {
1927
 
 
 
 
 
 
 
 
 
1928
  # unset as we go
1929
  if(isset($csscollect[$mediatype][$k])) {
1930
  unset($csscollect[$mediatype][$k]);
@@ -1955,10 +1964,10 @@ function fastvelocity_add_merged_css(){
1955
 
1956
  # define file and id prefix
1957
  if ($current_action == 'wp_head') {
1958
- $cssid = 'header-'.$i;
1959
  $fprefix = 'header-';
1960
  } else {
1961
- $cssid = 'footer-'.$i;
1962
  $fprefix = 'footer-';
1963
  }
1964
 
5
  Description: Improve your speed score on GTmetrix, Pingdom Tools and Google PageSpeed Insights by merging and minifying CSS and JavaScript files into groups, compressing HTML and other speed optimizations.
6
  Author: Raul Peixoto
7
  Author URI: http://fastvelocity.com
8
+ Version: 2.5.4
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
196
 
197
  # merge, if inline is not selected
198
  if($force_inline_css != true) {
 
 
199
  add_filter('style_loader_tag', 'fastvelocity_min_merge_css', PHP_INT_MAX, 4 );
200
  add_action('wp_print_styles','fastvelocity_add_google_fonts_merged', PHP_INT_MAX);
201
  add_action('wp_print_footer_scripts','fastvelocity_add_google_fonts_merged', PHP_INT_MAX );
254
  remove_action('wp_print_scripts', 'fastvelocity_min_merge_header_scripts', PHP_INT_MAX );
255
  remove_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_scripts', 9.999999 );
256
  remove_action('wp_print_styles', 'fastvelocity_min_merge_css', PHP_INT_MAX );
257
+ remove_filter('style_loader_src', 'fastvelocity_min_merge_css', PHP_INT_MAX, 4);
258
+ remove_action('wp_print_styles', 'fastvelocity_add_google_fonts_merged', PHP_INT_MAX);
259
+ remove_action('wp_print_footer_scripts', 'fastvelocity_add_google_fonts_merged', PHP_INT_MAX );
260
  remove_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_css', 9.999999 );
261
  remove_action('init', 'fastvelocity_min_disable_wp_emojicons');
262
  remove_action('template_redirect', 'fastvelocity_min_html_compression_start', PHP_INT_MAX);
1670
  ###########################################
1671
  # collect all css files as well as inline css code, to be printed later
1672
  function fastvelocity_min_merge_css($html, $handle, $href, $media){
1673
+ global $fvm_debug, $wp_domain, $wp_home, $fvmualist, $fvm_collect_google_fonts, $force_inline_googlefonts, $min_async_googlefonts, $remove_googlefonts, $skip_google_fonts, $css_hide_googlefonts, $remove_print_mediatypes, $ignore, $blacklist, $ignorelist, $fvm_remove_css, $fvm_min_excludecsslist, $disable_css_minification, $fvm_fix_editor, $fvm_fawesome_method, $csscollect;
1674
 
1675
  # current timestamp
1676
  $ctime = get_option('fvm-last-cache-update', '0');
1685
  return $html;
1686
  }
1687
 
 
 
 
 
 
1688
  # remove all css?
1689
  if($fvm_remove_css != false) {
1690
  return false;
1900
  global $csscollect, $cachedir, $cachedirurl, $fvmloadcss, $fvm_remove_css, $fvm_enabled_css_preload, $collect_preload_css;
1901
 
1902
  # return if disabled
1903
+ if (!is_array($csscollect)) {
1904
  return false;
1905
  }
1906
 
1913
  # foreach meadiatype, generate css file name, merge, save and print it
1914
  $i = 0; foreach ($csscollect as $mediatype=>$arr) {
1915
 
1916
+ # no empty array
1917
+ if(count($arr) == 0) {
1918
+ return false;
1919
+ }
1920
+
1921
  # initialization
1922
  $uid = '';
1923
  $log = '';
1926
  # filename for this mediatype
1927
  foreach ($arr as $k=>$narr) {
1928
 
1929
+ # no empty array
1930
+ if(count($narr) == 0) {
1931
+ return false;
1932
+ }
1933
+
1934
+ # no empty arrays
1935
+ $narr = array_filter($narr);
1936
+
1937
  # unset as we go
1938
  if(isset($csscollect[$mediatype][$k])) {
1939
  unset($csscollect[$mediatype][$k]);
1964
 
1965
  # define file and id prefix
1966
  if ($current_action == 'wp_head') {
1967
+ $cssid = 'header-css-'.$i;
1968
  $fprefix = 'header-';
1969
  } else {
1970
+ $cssid = 'footer-css-'.$i;
1971
  $fprefix = 'footer-';
1972
  }
1973
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: Alignak
3
  Tags: PHP Minify, Lighthouse, GTmetrix, Pingdom, Pagespeed, CSS Merging, JS Merging, CSS Minification, JS Minification, Speed Optimization, HTML Minification, Performance, Optimization, Speed, Fast
4
  Requires at least: 4.5
5
- Stable tag: 2.5.3
6
  Tested up to: 5.0.3
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -201,6 +201,9 @@ If you would like to donate any amount to the plugin author (thank you in advanc
201
 
202
  == Changelog ==
203
 
 
 
 
204
  = 2.5.3 [2019.01.11] =
205
  * fixed inlined css code being minified, even when minification is off
206
  * compatibility and performance improvements for the CSS merging and inlining functionality
2
  Contributors: Alignak
3
  Tags: PHP Minify, Lighthouse, GTmetrix, Pingdom, Pagespeed, CSS Merging, JS Merging, CSS Minification, JS Minification, Speed Optimization, HTML Minification, Performance, Optimization, Speed, Fast
4
  Requires at least: 4.5
5
+ Stable tag: 2.5.4
6
  Tested up to: 5.0.3
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
201
 
202
  == Changelog ==
203
 
204
+ = 2.5.4 [2019.01.11] =
205
+ * css merging bug fixes
206
+
207
  = 2.5.3 [2019.01.11] =
208
  * fixed inlined css code being minified, even when minification is off
209
  * compatibility and performance improvements for the CSS merging and inlining functionality