Fast Velocity Minify - Version 2.6.6

Version Description

[2019.06.20] = * cache purging bug fixes * php notice fixes

Download this release

Release Info

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

Code changes from version 2.6.5 to 2.6.6

Files changed (3) hide show
  1. fvm.php +4 -2
  2. inc/functions-cache.php +17 -17
  3. readme.txt +15 -10
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.6.5
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
@@ -160,7 +160,7 @@ if($fvm_gfonts_method != false) {
160
 
161
 
162
  # default ua list
163
- $fvmualist = array('x11.*fox\/54', 'x11.*ome\/39', 'x11.*ome\/62', 'oobot', 'ighth', 'tmetr', 'eadles');
164
 
165
 
166
  # add admin page and rewrite defaults
@@ -2099,6 +2099,8 @@ $done = $styles->done;
2099
  $footer = array();
2100
  $google_fonts = array();
2101
  $inline_css = array();
 
 
2102
 
2103
  # dequeue all styles
2104
  if($fvm_remove_css != false) {
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.6.6
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
160
 
161
 
162
  # default ua list
163
+ $fvmualist = array('x11.*fox\/54', 'oid\s4.*xus.*ome\/62', 'x11.*ome\/62', 'oobot', 'ighth', 'tmetr', 'eadles', 'ingdo');
164
 
165
 
166
  # add admin page and rewrite defaults
2099
  $footer = array();
2100
  $google_fonts = array();
2101
  $inline_css = array();
2102
+ $code = '';
2103
+ $log = '';
2104
 
2105
  # dequeue all styles
2106
  if($fvm_remove_css != false) {
inc/functions-cache.php CHANGED
@@ -39,7 +39,7 @@ function fvm_cachepath() {
39
  $fvm_change_cache_path = get_option('fastvelocity_min_change_cache_path');
40
  $fvm_change_cache_base = get_option('fastvelocity_min_change_cache_base_url');
41
  $upload = array();
42
- if($fvm_change_cache_path !== false && $fvm_change_cache_base !== false && strlen($fvm_change_cache_path) > 1) {
43
  $upload['basedir'] = trim($fvm_change_cache_path);
44
  $upload['baseurl'] = trim($fvm_change_cache_base);
45
  } else {
@@ -134,33 +134,31 @@ function fvm_purge_all_uninstall() {
134
  return true;
135
  }
136
 
137
- # purge cache files older than 3 months
138
- fvm_purge_old();
139
  function fvm_purge_old() {
140
 
141
  # get cache directories and urls
142
  $cachepath = fvm_cachepath();
143
  $cachebaseparent = dirname($cachepath['cachebase']);
144
  $ctime = get_option('fvm-last-cache-update', '0');
145
- $expires = time() - 86400 * 90; # three months
146
 
147
  # get all directories that are a direct child of current directory
148
- if ($handle = opendir($cachebaseparent)) {
149
- while (false !== ($d = readdir($handle))) {
150
- if (strcmp($d, '.')==0 || strcmp($d, '..')==0) { continue; }
151
- if($d != $ctime && (is_numeric($d) && $d <= $expires)) {
152
- $dir = $cachebaseparent.'/'.$d;
153
- if(is_dir($dir)) {
154
- fastvelocity_rrmdir($dir);
155
- rmdir($dir);
 
 
156
  }
157
  }
158
-
159
  }
160
-
161
- closedir($handle);
162
  }
163
-
164
  return true;
165
  }
166
 
@@ -228,7 +226,6 @@ function fastvelocity_get_cachestats() {
228
 
229
  # remove all cache files
230
  function fastvelocity_rrmdir($path) {
231
- # purge
232
  clearstatcache();
233
  if(is_dir($path)) {
234
  $i = new DirectoryIterator($path);
@@ -239,6 +236,9 @@ function fastvelocity_rrmdir($path) {
239
  rmdir($f->getRealPath());
240
  }
241
  }
 
 
 
242
  }
243
  }
244
 
39
  $fvm_change_cache_path = get_option('fastvelocity_min_change_cache_path');
40
  $fvm_change_cache_base = get_option('fastvelocity_min_change_cache_base_url');
41
  $upload = array();
42
+ if($fvm_change_cache_path !== false && $fvm_change_cache_base !== false && strlen($fvm_change_cache_path) > 1 && is_dir($fvm_change_cache_path) && is_writable(dirname($fvm_change_cache_path))) {
43
  $upload['basedir'] = trim($fvm_change_cache_path);
44
  $upload['baseurl'] = trim($fvm_change_cache_base);
45
  } else {
134
  return true;
135
  }
136
 
137
+ # purge cache files older than 30 days
 
138
  function fvm_purge_old() {
139
 
140
  # get cache directories and urls
141
  $cachepath = fvm_cachepath();
142
  $cachebaseparent = dirname($cachepath['cachebase']);
143
  $ctime = get_option('fvm-last-cache-update', '0');
144
+ $expires = time() - 86400 * 30;
145
 
146
  # get all directories that are a direct child of current directory
147
+ if(is_dir($cachebaseparent) && is_writable(dirname($cachebaseparent))) {
148
+ if ($handle = opendir($cachebaseparent)) {
149
+ while (false !== ($d = readdir($handle))) {
150
+ if (strcmp($d, '.')==0 || strcmp($d, '..')==0) { continue; }
151
+ if($d != $ctime && (is_numeric($d) && $d <= $expires)) {
152
+ $dir = $cachebaseparent.'/'.$d;
153
+ if(is_dir($dir)) {
154
+ fastvelocity_rrmdir($dir);
155
+ rmdir($dir);
156
+ }
157
  }
158
  }
159
+ closedir($handle);
160
  }
 
 
161
  }
 
162
  return true;
163
  }
164
 
226
 
227
  # remove all cache files
228
  function fastvelocity_rrmdir($path) {
 
229
  clearstatcache();
230
  if(is_dir($path)) {
231
  $i = new DirectoryIterator($path);
236
  rmdir($f->getRealPath());
237
  }
238
  }
239
+
240
+ # self
241
+ if(is_dir($path)) { rmdir($path); }
242
  }
243
  }
244
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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
  Requires PHP: 5.5
6
- Stable tag: 2.6.5
7
- Tested up to: 5.2
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -12,14 +12,12 @@ Improve your speed score on GTmetrix, Pingdom Tools and Google PageSpeed Insight
12
 
13
 
14
  == Description ==
15
-
16
- This plugin reduces HTTP requests by merging CSS & Javascript files into groups of files, while attempting to use the least amount of files as possible. It minifies CSS and JS files with PHP Minify (no extra requirements).
17
-
18
- There are also options to apply critical CSS and load CSS async, as well as to define HTTP preload and preconnect headers (server push).
19
 
20
  Minification is done on the frontend during the first uncached request. Once the first request is processed, any other pages that require the same set of CSS and JavaScript files, will be served that same (static) cache file.
21
 
22
  This plugin includes options for developers and advanced users, however the default settings should work just fine for most sites.
 
23
 
24
  = Aditional Optimization =
25
 
@@ -125,11 +123,11 @@ Yes, it generates a new cache file for every different set of JS and CSS require
125
  If you are just inserting ads on your pages, yes. If you are using a custom script to inject those ads, please double check if it works.
126
 
127
 
128
- = After installing, why are some images and sliders not working? =
129
 
130
  a) You cannot do double minification, so make sure you have disabled any features on your theme or other plugins that perform minification of css, html and js files.
131
 
132
- b) If you enabled the option to defer JS or CSS, please note that some themes and plugins need jQuery and other libraries to be render blocking, so they are not "undefined" during page load.
133
 
134
  c) The plugin relies on PHP Minify to minify JavaScript and css files, however it is not a perfect library and there are plugins that are already minified and do not output a "min.js" or "min.css" filename (and end up being minified again). Try to disable minification on JS and CSS files and purge the cache, then either dequeue it and enqueue an alternative file or add it to the ignore list.
135
 
@@ -137,7 +135,7 @@ d) Sometimes a plugin conflicts with another when merged (look at google chrome
137
 
138
  e) If you have a conflict, try to add each CSS and each JS file to the ignore list one by one, until you find the one that causes the conflict. If you have no idea of which files to add, check the log file on the "status page" for a list of files being merged into each generated file.
139
 
140
- f) If you coded some inline JS code that depends on some JS file being loaded before it's execution, try to save that code into an external file and enqueue it as a dependency. It will be merged together, thus no longer being "undefined".
141
 
142
 
143
  = Why are some of the CSS and JS files not being merged? =
@@ -167,6 +165,9 @@ On the "Speed" tab, deselect the Auto Minify for JavaScript, CSS and HTML as wel
167
  = How can I load CSS async? =
168
  You are probably a developer if you are trying this. The answer is: make sure FVM is only generating 1 CSS file, because "async" means multiple files will load out of order (however CSS needs order most of the times). If FVM is generating more than 1 CSS file per mediatype, try to manually dequeue some of the CSS files that are breaking the series on FVM (such as external enqueued files), or add their domain to the settings to be merged together. Please note... this is an advanced option for skilled developers. Do not try to fiddle with these settings if you are not one, as it will almost certainly break your site layout and functionality.
169
 
 
 
 
170
 
171
  = I have a complaint or I need support right now. =
172
  Before getting angry because you have no answer within a few hours (even with paid plugins, sometimes it takes weeks...), please be informed about how wordpress.org and the plugins directory work. The plugins directory is an open source, free service where developers and programmers contribute (on their free time) with plugins that can be downloaded and installed by anyone "at their own risk" and are all released under the GPL license. While all plugins have to be approved and reviewed by the WordPress team before being published (for dangerous code, spam, etc.) this does not change the license or add any warranty. All plugins are provided as they are, free of charge and should be used at your own risk (so you should make backups before installing any plugin or performing updates) and it is your sole responsibility if you break your site after installing a plugin from the plugins directory. For a full version of the license, please read: https://wordpress.org/about/gpl/
@@ -197,9 +198,13 @@ Please backup your site before updating. Version 3.0 will have a major code rewr
197
 
198
  == Changelog ==
199
 
 
 
 
 
200
  = 2.6.5 [2019.05.04] =
201
  * fixed cache purging on Hyper Cache plugin
202
- * removed support for WPFC (that plugin author implemented a notice stating that FVM is incompatible with WPFC)
203
  * improved the filtering engine for pagespeed insights on desktop
204
 
205
  = 2.6.4 [2019.03.31] =
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
  Requires PHP: 5.5
6
+ Stable tag: 2.6.6
7
+ Tested up to: 5.2.2
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
12
 
13
 
14
  == Description ==
15
+ WP speed optimization plugin for developers and advanced users. This plugin reduces HTTP requests by merging CSS & Javascript files into groups of files, while attempting to use the least amount of files as possible. It minifies CSS and JS files with PHP Minify (no extra requirements).
 
 
 
16
 
17
  Minification is done on the frontend during the first uncached request. Once the first request is processed, any other pages that require the same set of CSS and JavaScript files, will be served that same (static) cache file.
18
 
19
  This plugin includes options for developers and advanced users, however the default settings should work just fine for most sites.
20
+ Kindly read our faqs about possible issues with you theme or specific plugins.
21
 
22
  = Aditional Optimization =
23
 
123
  If you are just inserting ads on your pages, yes. If you are using a custom script to inject those ads, please double check if it works.
124
 
125
 
126
+ = After installing, why are some images, sections, sliders, galleries, menus (etc) not working? =
127
 
128
  a) You cannot do double minification, so make sure you have disabled any features on your theme or other plugins that perform minification of css, html and js files.
129
 
130
+ b) If you enabled the option to defer JS or CSS, please note that some themes and plugins need jQuery and other libraries to be render blocking. If you enable the option to defer, any javascript code on the page will trigger an "undefined" error on the google chrome console log after page load.
131
 
132
  c) The plugin relies on PHP Minify to minify JavaScript and css files, however it is not a perfect library and there are plugins that are already minified and do not output a "min.js" or "min.css" filename (and end up being minified again). Try to disable minification on JS and CSS files and purge the cache, then either dequeue it and enqueue an alternative file or add it to the ignore list.
133
 
135
 
136
  e) If you have a conflict, try to add each CSS and each JS file to the ignore list one by one, until you find the one that causes the conflict. If you have no idea of which files to add, check the log file on the "status page" for a list of files being merged into each generated file.
137
 
138
+ f) If you coded some inline JS code that depends on a JS file being loaded before it's execution (render blocking), try to save that code into an external file and enqueue it as a dependency. It will be merged together and run after the other file, thus no longer being "undefined".
139
 
140
 
141
  = Why are some of the CSS and JS files not being merged? =
165
  = How can I load CSS async? =
166
  You are probably a developer if you are trying this. The answer is: make sure FVM is only generating 1 CSS file, because "async" means multiple files will load out of order (however CSS needs order most of the times). If FVM is generating more than 1 CSS file per mediatype, try to manually dequeue some of the CSS files that are breaking the series on FVM (such as external enqueued files), or add their domain to the settings to be merged together. Please note... this is an advanced option for skilled developers. Do not try to fiddle with these settings if you are not one, as it will almost certainly break your site layout and functionality.
167
 
168
+ = Why is FVM using defer instead of async javascript? =
169
+ The answer is simple. For compatibility reasons and to avoid some undefined javascript errors, we need to preserve the order of scripts. Async means that any js files will load in parallel without waiting for each other or without following a specific order. If FVM generates multiple JS files for your site, using Async could cause footer scripts to load before the header scripts in an inconsistent manner. By using defer, we make sure the scripts load in order, as defined by each plugin and theme developer.
170
+ Your ads or scripts wich are already specifically async will continue to be so, unless you specifically mark them to be merged as well.
171
 
172
  = I have a complaint or I need support right now. =
173
  Before getting angry because you have no answer within a few hours (even with paid plugins, sometimes it takes weeks...), please be informed about how wordpress.org and the plugins directory work. The plugins directory is an open source, free service where developers and programmers contribute (on their free time) with plugins that can be downloaded and installed by anyone "at their own risk" and are all released under the GPL license. While all plugins have to be approved and reviewed by the WordPress team before being published (for dangerous code, spam, etc.) this does not change the license or add any warranty. All plugins are provided as they are, free of charge and should be used at your own risk (so you should make backups before installing any plugin or performing updates) and it is your sole responsibility if you break your site after installing a plugin from the plugins directory. For a full version of the license, please read: https://wordpress.org/about/gpl/
198
 
199
  == Changelog ==
200
 
201
+ = 2.6.6 [2019.06.20] =
202
+ * cache purging bug fixes
203
+ * php notice fixes
204
+
205
  = 2.6.5 [2019.05.04] =
206
  * fixed cache purging on Hyper Cache plugin
207
+ * removed support for WPFC (plugin author implemented a notice stating that FVM is incompatible with WPFC)
208
  * improved the filtering engine for pagespeed insights on desktop
209
 
210
  = 2.6.4 [2019.03.31] =