Fast Velocity Minify - Version 2.6.1

Version Description

[2019.03.26] = * fixed compatibility with the latest elementor plugin * fixed adding duplicate cron jobs + existing duplicate cronjobs cleanup * fixed duplicate "cache/cache" directory path * changed the minimum PHP requirements to PHP 5.5

Download this release

Release Info

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

Code changes from version 2.6.0 to 2.6.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.6.0
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
@@ -24,7 +24,6 @@ along with this program; if not, write to the Free Software
24
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
  */
26
 
27
-
28
  # check for minimum requirements and prevent activation or disable if not fully compatible
29
  function fvm_compat_checker() {
30
  global $wp_version;
@@ -34,8 +33,8 @@ function fvm_compat_checker() {
34
  $nwpv = implode('.', array_slice(explode('.', $wp_version), 0, 2)); # get 2 p only
35
 
36
  # php version requirements
37
- if (version_compare( PHP_VERSION, '5.4', '<' )) {
38
- $error = 'Fast Velocity Minify requires PHP 5.4 or higher. You’re still on '. PHP_VERSION;
39
  }
40
 
41
  # php extension requirements
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.1
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
24
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
  */
26
 
 
27
  # check for minimum requirements and prevent activation or disable if not fully compatible
28
  function fvm_compat_checker() {
29
  global $wp_version;
33
  $nwpv = implode('.', array_slice(explode('.', $wp_version), 0, 2)); # get 2 p only
34
 
35
  # php version requirements
36
+ if (version_compare( PHP_VERSION, '5.5', '<' )) {
37
+ $error = 'Fast Velocity Minify requires PHP 5.5 or higher. You’re still on '. PHP_VERSION;
38
  }
39
 
40
  # php extension requirements
inc/functions-cache.php CHANGED
@@ -61,8 +61,8 @@ if($fvm_change_cache_path !== false && $fvm_change_cache_base !== false && strle
61
  $ctime = get_option('fvm-last-cache-update', '0');
62
 
63
  # create
64
- $uploadsdir = $upload['basedir'].'/cache';
65
- $uploadsurl = $upload['baseurl'].'/cache';
66
  $cachebase = $uploadsdir.'/fvm/'.$ctime;
67
  $cachebaseurl = $uploadsurl.'/fvm/'.$ctime;
68
  $cachedir = $cachebase.'/out';
61
  $ctime = get_option('fvm-last-cache-update', '0');
62
 
63
  # create
64
+ $uploadsdir = str_ireplace('cache/cache', 'cache', $upload['basedir'].'/cache');
65
+ $uploadsurl = str_ireplace('cache/cache', 'cache', $upload['baseurl'].'/cache');
66
  $cachebase = $uploadsdir.'/fvm/'.$ctime;
67
  $cachebaseurl = $uploadsurl.'/fvm/'.$ctime;
68
  $cachedir = $cachebase.'/out';
inc/functions-upgrade.php CHANGED
@@ -16,44 +16,20 @@ function fastvelocity_version_check() {
16
  $dots = explode('.', $ver);
17
  if(!is_array($dots) || count($dots) != 3) { return false; }
18
 
19
-
20
- # changed options in 2.4.0
21
- if($dots[0] < 2 || ($dots[0] == 2 && $dots[1] < 4)) {
22
-
23
- # delete some old fields and define them on a radio option, by this priority
24
- if(get_option("fastvelocity_css_hide_googlefonts") != false) {
25
- update_option( "fastvelocity_gfonts_method", 3);
26
- delete_option('fastvelocity_min_force_inline_googlefonts');
27
- delete_option('fastvelocity_min_async_googlefonts');
28
- delete_option('fastvelocity_css_hide_googlefonts');
29
- }
30
 
31
- if(get_option("fastvelocity_min_async_googlefonts") != false) {
32
- update_option( "fastvelocity_gfonts_method", 2);
33
- delete_option('fastvelocity_min_force_inline_googlefonts');
34
- delete_option('fastvelocity_min_async_googlefonts');
35
- delete_option('fastvelocity_css_hide_googlefonts');
36
- }
37
 
38
- if(get_option("fastvelocity_min_force_inline_googlefonts") != false) {
39
- update_option( "fastvelocity_gfonts_method", 1);
40
- delete_option('fastvelocity_min_force_inline_googlefonts');
41
- delete_option('fastvelocity_min_async_googlefonts');
42
- delete_option('fastvelocity_css_hide_googlefonts');
43
- }
44
-
45
  }
46
 
47
-
48
- # changed on 2.6.0
49
- if($dots[0] < 2 || ($dots[0] == 2 && $dots[1] < 6)) {
50
-
51
- # add old cache purge event cron
52
- if (!wp_next_scheduled ('fastvelocity_purge_old_cron')) {
53
- wp_schedule_event(time(), 'daily', 'fastvelocity_purge_old_cron_event');
54
- }
55
-
56
- }
57
  }
58
  add_action( 'plugins_loaded', 'fastvelocity_version_check' );
59
 
16
  $dots = explode('.', $ver);
17
  if(!is_array($dots) || count($dots) != 3) { return false; }
18
 
19
+ # changed options on 2.6.1 (elementor fixes)
20
+ if($dots[0] <= 2 && $dots[1] <= 6 && $dots[2] < 1) {
 
 
 
 
 
 
 
 
 
21
 
22
+ # ignore list
23
+ $ignorelist = array_filter(array_map('trim', explode(PHP_EOL, get_option('fastvelocity_min_ignorelist', ''))));
24
+ $exc = array('/Avada/assets/js/main.min.js', '/woocommerce-product-search/js/product-search.js', '/includes/builder/scripts/frontend-builder-scripts.js', '/assets/js/jquery.themepunch.tools.min.js', '/js/TweenMax.min.js', '/jupiter/assets/js/min/full-scripts', '/Divi/core/admin/js/react-dom.production.min.js', '/LayerSlider/static/layerslider/js/greensock.js', '/kalium/assets/js/main.min.js', '/elementor/assets/js/common.min.js', '/elementor/assets/js/frontend.min.js', '/elementor-pro/assets/js/frontend.min.js');
25
+ $new = array_unique(array_merge($ignorelist, $exc));
26
+ update_option('fastvelocity_min_ignorelist', implode(PHP_EOL, $new));
 
27
 
28
+ # default minimal settings
29
+ update_option('fastvelocity_preserve_settings_on_uninstall', 1);
30
+ update_option('fastvelocity_min_fvm_fix_editor', 1);
 
 
 
 
31
  }
32
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
  add_action( 'plugins_loaded', 'fastvelocity_version_check' );
35
 
inc/functions.php CHANGED
@@ -50,16 +50,16 @@ function fastvelocity_plugin_activate() {
50
  fvm_cache_increment();
51
 
52
  # old cache purge event cron
53
- if (!wp_next_scheduled ('fastvelocity_purge_old_cron')) {
54
- wp_schedule_event(time(), 'daily', 'fastvelocity_purge_old_cron_event');
 
55
  }
56
 
57
-
58
  # setup defaults if no option to preserve exists
59
  if(get_option('fastvelocity_preserve_settings_on_uninstall') == false) {
60
 
61
  # default options to enable (1)
62
- $options_enable_default = array('fastvelocity_min_remove_print_mediatypes', 'fastvelocity_fvm_clean_header_one', 'fastvelocity_min_skip_google_fonts', 'fastvelocity_min_force_inline_css_footer', 'fastvelocity_min_skip_cssorder', 'fastvelocity_gfonts_method', 'fastvelocity_fontawesome_method', 'fastvelocity_min_disable_css_inline_merge');
63
  foreach($options_enable_default as $option) {
64
  update_option($option, 1, 'yes');
65
  }
@@ -69,7 +69,7 @@ function fastvelocity_plugin_activate() {
69
  update_option('fastvelocity_min_blacklist', implode(PHP_EOL, $exc));
70
 
71
  # default ignore list
72
- $exc = array('/Avada/assets/js/main.min.js', '/woocommerce-product-search/js/product-search.js', '/includes/builder/scripts/frontend-builder-scripts.js', '/assets/js/jquery.themepunch.tools.min.js', '/js/TweenMax.min.js', '/jupiter/assets/js/min/full-scripts', '/wp-content/themes/Divi/core/admin/js/react-dom.production.min.js', '/LayerSlider/static/layerslider/js/greensock.js', '/themes/kalium/assets/js/main.min.js');
73
  update_option('fastvelocity_min_ignorelist', implode(PHP_EOL, $exc));
74
 
75
  }
@@ -83,10 +83,7 @@ function fastvelocity_plugin_deactivate() {
83
  fvm_purge_others();
84
 
85
  # old cache purge event cron
86
- if (wp_next_scheduled ('fastvelocity_purge_old_cron')) {
87
- $timestamp = wp_next_scheduled ('fastvelocity_purge_old_cron');
88
- wp_unschedule_event ($timestamp, 'fastvelocity_purge_old_cron_event');
89
- }
90
 
91
  }
92
 
@@ -804,6 +801,22 @@ function fastvelocity_exclude_contents() {
804
  $arr = array('tve_form_type', 'tve_lead_shortcode', 'tqb_splash');
805
  foreach ($arr as $a) { if(isset($_GET['post_type']) && $_GET['post_type'] == $a) { return true; } }
806
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
807
  # default
808
  return false;
809
  }
50
  fvm_cache_increment();
51
 
52
  # old cache purge event cron
53
+ wp_clear_scheduled_hook( 'fastvelocity_purge_old_cron_event' );
54
+ if (!wp_next_scheduled('fastvelocity_purge_old_cron_event')) {
55
+ wp_schedule_event(time()+86400, 'daily', 'fastvelocity_purge_old_cron_event');
56
  }
57
 
 
58
  # setup defaults if no option to preserve exists
59
  if(get_option('fastvelocity_preserve_settings_on_uninstall') == false) {
60
 
61
  # default options to enable (1)
62
+ $options_enable_default = array('fastvelocity_min_fvm_fix_editor', 'fastvelocity_min_remove_print_mediatypes', 'fastvelocity_fvm_clean_header_one', 'fastvelocity_min_skip_google_fonts', 'fastvelocity_min_force_inline_css_footer', 'fastvelocity_min_skip_cssorder', 'fastvelocity_gfonts_method', 'fastvelocity_fontawesome_method', 'fastvelocity_min_disable_css_inline_merge');
63
  foreach($options_enable_default as $option) {
64
  update_option($option, 1, 'yes');
65
  }
69
  update_option('fastvelocity_min_blacklist', implode(PHP_EOL, $exc));
70
 
71
  # default ignore list
72
+ $exc = array('/Avada/assets/js/main.min.js', '/woocommerce-product-search/js/product-search.js', '/includes/builder/scripts/frontend-builder-scripts.js', '/assets/js/jquery.themepunch.tools.min.js', '/js/TweenMax.min.js', '/jupiter/assets/js/min/full-scripts', '/wp-content/themes/Divi/core/admin/js/react-dom.production.min.js', '/LayerSlider/static/layerslider/js/greensock.js', '/themes/kalium/assets/js/main.min.js', '/elementor/assets/js/common.min.js', '/elementor/assets/js/frontend.min.js', '/elementor-pro/assets/js/frontend.min.js');
73
  update_option('fastvelocity_min_ignorelist', implode(PHP_EOL, $exc));
74
 
75
  }
83
  fvm_purge_others();
84
 
85
  # old cache purge event cron
86
+ wp_clear_scheduled_hook( 'fastvelocity_purge_old_cron_event' );
 
 
 
87
 
88
  }
89
 
801
  $arr = array('tve_form_type', 'tve_lead_shortcode', 'tqb_splash');
802
  foreach ($arr as $a) { if(isset($_GET['post_type']) && $_GET['post_type'] == $a) { return true; } }
803
 
804
+ # elementor
805
+ if(isset($_GET['elementor-preview']) && $_GET['post_type'] == $a) { return true; }
806
+ if(is_array($_GET)) {
807
+ foreach ($_GET as $k=>$v) {
808
+ if(stripos($k, 'elementor') !== false || stripos($v, 'elementor') !== false) {
809
+ return true;
810
+ }
811
+ }
812
+ }
813
+
814
+
815
+ # any wp-admin url
816
+ if(isset($_SERVER['REQUEST_URI']) && stripos($_SERVER['REQUEST_URI'], '/wp-admin/') !== false) {
817
+ return true;
818
+ }
819
+
820
  # default
821
  return false;
822
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
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.6.0
6
- Tested up to: 5.1
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -196,6 +196,12 @@ Please backup your site before updating. Version 3.0 will have a major code rewr
196
 
197
  == Changelog ==
198
 
 
 
 
 
 
 
199
  = 2.6.0 [2019.03.02] =
200
  * fixed cache purging with the hypercache plugin
201
  * fixed a bug with inline scripts and styles not showing up if there is no url for the enqueued handle
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.6.1
6
+ Tested up to: 5.1.1
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
196
 
197
  == Changelog ==
198
 
199
+ = 2.6.1 [2019.03.26] =
200
+ * fixed compatibility with the latest elementor plugin
201
+ * fixed adding duplicate cron jobs + existing duplicate cronjobs cleanup
202
+ * fixed duplicate "cache/cache" directory path
203
+ * changed the minimum PHP requirements to PHP 5.5
204
+
205
  = 2.6.0 [2019.03.02] =
206
  * fixed cache purging with the hypercache plugin
207
  * fixed a bug with inline scripts and styles not showing up if there is no url for the enqueued handle