Fast Velocity Minify - Version 2.8.0

Version Description

[2020.03.10] = * improved compatibility with Thrive Architect editor * improved compatibility with Divi theme

Download this release

Release Info

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

Code changes from version 2.7.9 to 2.8.0

Files changed (4) hide show
  1. fvm.php +3 -3
  2. inc/functions-upgrade.php +22 -20
  3. inc/functions.php +8 -5
  4. readme.txt +6 -2
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.7.9
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
@@ -1354,7 +1354,7 @@ for($i=0,$l=count($header);$i<$l;$i++) {
1354
  }
1355
 
1356
  # append code to merged file
1357
- $code.= fastvelocity_try_catch_wrap($res['code']);
1358
  $log.= $res['log'];
1359
 
1360
  # Add extra data from wp_add_inline_script after
@@ -1556,7 +1556,7 @@ for($i=0,$l=count($footer);$i<$l;$i++) {
1556
  }
1557
 
1558
  # append code to merged file
1559
- $code.= fastvelocity_try_catch_wrap($res['code']);
1560
  $log.= $res['log'];
1561
 
1562
  # Add extra data from wp_add_inline_script after
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.8.0
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
1354
  }
1355
 
1356
  # append code to merged file
1357
+ $code.= "/* $hurl */". PHP_EOL . fastvelocity_try_catch_wrap($res['code']);
1358
  $log.= $res['log'];
1359
 
1360
  # Add extra data from wp_add_inline_script after
1556
  }
1557
 
1558
  # append code to merged file
1559
+ $code.= "/* $hurl */". PHP_EOL . fastvelocity_try_catch_wrap($res['code']);
1560
  $log.= $res['log'];
1561
 
1562
  # Add extra data from wp_add_inline_script after
inc/functions-upgrade.php CHANGED
@@ -1,37 +1,39 @@
1
  <?php
2
 
3
- function fastvelocity_version_check() {
 
 
 
 
4
  global $fastvelocity_plugin_version;
5
 
6
  # current FVM install date, create if it doesn't exist
7
  $ver = get_option("fastvelocity_plugin_version");
8
- if ($ver == false) { $ver = '0.0.0'; }
9
 
10
  # save current version on upgrade
11
  if ($ver != $fastvelocity_plugin_version) {
12
  update_option( "fastvelocity_plugin_version", $fastvelocity_plugin_version);
13
  }
14
 
15
- # compare versions (0.1.2)
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
 
36
 
37
  # upgrade notifications
1
  <?php
2
 
3
+
4
+ # run after updating
5
+ add_action( 'upgrader_process_complete', 'fastvelocity_plugin_upgrade_completed', 10, 2 );
6
+ function fastvelocity_plugin_upgrade_completed($upgrader_object, $options) {
7
+
8
  global $fastvelocity_plugin_version;
9
 
10
  # current FVM install date, create if it doesn't exist
11
  $ver = get_option("fastvelocity_plugin_version");
12
+ if ($ver == false) { $ver = '1'; }
13
 
14
  # save current version on upgrade
15
  if ($ver != $fastvelocity_plugin_version) {
16
  update_option( "fastvelocity_plugin_version", $fastvelocity_plugin_version);
17
  }
18
 
19
+ if( $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) {
20
+ # Iterate through the plugins being updated and check if ours is there
21
+ foreach( $options['plugins'] as $plugin ) {
22
+ if( $plugin == plugin_basename( __FILE__ )) {
23
+
24
+ # run for any update lower than 2.8.0
25
+ if (version_compare($ver, '2.8.0', '<')) {
26
+
27
+ # default ignore list
28
+ $exc = array('/themes/Avada/assets/js/main.min.js', '/plugins/woocommerce-product-search/js/product-search.js', '/plugins/revslider/public/assets/js/jquery.themepunch.tools.min.js', '/js/TweenMax.min.js', '/themes/jupiter/assets/js/min/full-scripts', '/plugins/LayerSlider/static/layerslider/js/greensock.js', '/themes/kalium/assets/js/main.min.js', '/js/mediaelement/', '/plugins/elementor/assets/js/common.min.js', '/plugins/elementor/assets/js/frontend.min.js', '/plugins/elementor-pro/assets/js/frontend.min.js', '/themes/kalium/assets/js/main.min.js');
29
+ update_option('fastvelocity_min_ignorelist', implode(PHP_EOL, $exc));
30
+
31
+ }
32
+ }
33
+ }
 
34
  }
 
35
  }
36
+
37
 
38
 
39
  # upgrade notifications
inc/functions.php CHANGED
@@ -42,7 +42,6 @@ function fvm_function_available($func) {
42
  return true;
43
  }
44
 
45
-
46
  # run during activation
47
  function fastvelocity_plugin_activate() {
48
 
@@ -69,7 +68,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', '/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
  }
@@ -110,9 +109,11 @@ function fastvelocity_plugin_uninstall() {
110
  }
111
 
112
 
 
 
113
  # try catch wrapper for merged javascript
114
  function fastvelocity_try_catch_wrap($js) {
115
- return 'try{'.PHP_EOL . $js . PHP_EOL . '}' . PHP_EOL . 'catch(e){console.error("An error has occurred: "+e.message);}'.PHP_EOL;
116
  }
117
 
118
 
@@ -785,6 +786,9 @@ function fastvelocity_load_fvuag() {
785
  $arr = array('tve_form_type', 'tve_lead_shortcode', 'tqb_splash');
786
  foreach ($arr as $a) { if(isset($_GET['post_type']) && $_GET['post_type'] == $a) { return true; } }
787
 
 
 
 
788
  # elementor
789
  if(isset($_GET['elementor-preview'])) { return true; }
790
  if(is_array($_GET)) {
@@ -864,8 +868,7 @@ if(is_array($ignore)) {
864
 
865
  # should we exclude jquery when defer is enabled?
866
  $exclude_defer_jquery = get_option('fastvelocity_min_exclude_defer_jquery');
867
- $enable_defer_js = get_option('fastvelocity_min_enable_defer_js');
868
- if($enable_defer_js == true && $exclude_defer_jquery == true) {
869
  $exc[] = '/jquery.js';
870
  $exc[] = '/jquery.min.js';
871
  }
42
  return true;
43
  }
44
 
 
45
  # run during activation
46
  function fastvelocity_plugin_activate() {
47
 
68
  update_option('fastvelocity_min_blacklist', implode(PHP_EOL, $exc));
69
 
70
  # default ignore list
71
+ $exc = array('/themes/Avada/assets/js/main.min.js', '/plugins/woocommerce-product-search/js/product-search.js', '/plugins/revslider/public/assets/js/jquery.themepunch.tools.min.js', '/js/TweenMax.min.js', '/themes/jupiter/assets/js/min/full-scripts', '/plugins/LayerSlider/static/layerslider/js/greensock.js', '/themes/kalium/assets/js/main.min.js', '/js/mediaelement/', '/plugins/elementor/assets/js/common.min.js', '/plugins/elementor/assets/js/frontend.min.js', '/plugins/elementor-pro/assets/js/frontend.min.js', '/themes/kalium/assets/js/main.min.js');
72
  update_option('fastvelocity_min_ignorelist', implode(PHP_EOL, $exc));
73
 
74
  }
109
  }
110
 
111
 
112
+
113
+
114
  # try catch wrapper for merged javascript
115
  function fastvelocity_try_catch_wrap($js) {
116
+ return 'try{'.PHP_EOL . $js . PHP_EOL . '}' . PHP_EOL . 'catch(e){console.error("An error has occurred: "+e.stack);}'.PHP_EOL;
117
  }
118
 
119
 
786
  $arr = array('tve_form_type', 'tve_lead_shortcode', 'tqb_splash');
787
  foreach ($arr as $a) { if(isset($_GET['post_type']) && $_GET['post_type'] == $a) { return true; } }
788
 
789
+ # thrive architect
790
+ if(isset($_GET['tve']) && $_GET['tve'] == 'true') { return true; }
791
+
792
  # elementor
793
  if(isset($_GET['elementor-preview'])) { return true; }
794
  if(is_array($_GET)) {
868
 
869
  # should we exclude jquery when defer is enabled?
870
  $exclude_defer_jquery = get_option('fastvelocity_min_exclude_defer_jquery');
871
+ if($exclude_defer_jquery == true) {
 
872
  $exc[] = '/jquery.js';
873
  $exc[] = '/jquery.min.js';
874
  }
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, FVM
4
  Requires at least: 4.7
5
  Requires PHP: 5.6
6
- Stable tag: 2.7.9
7
- Tested up to: 5.3
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -198,6 +198,10 @@ Please backup your site before updating. Version 3.0 will have a major code rewr
198
 
199
  == Changelog ==
200
 
 
 
 
 
201
  = 2.7.9 [2020.02.18] =
202
  * changed cache file names hash to longer names to avoid colisions on elementor plugin
203
 
3
  Tags: PHP Minify, Lighthouse, GTmetrix, Pingdom, Pagespeed, CSS Merging, JS Merging, CSS Minification, JS Minification, Speed Optimization, HTML Minification, Performance, Optimization, FVM
4
  Requires at least: 4.7
5
  Requires PHP: 5.6
6
+ Stable tag: 2.8.0
7
+ Tested up to: 5.4
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
198
 
199
  == Changelog ==
200
 
201
+ = 2.8.0 [2020.03.10] =
202
+ * improved compatibility with Thrive Architect editor
203
+ * improved compatibility with Divi theme
204
+
205
  = 2.7.9 [2020.02.18] =
206
  * changed cache file names hash to longer names to avoid colisions on elementor plugin
207