Fast Velocity Minify - Version 3.3.6

Version Description

[2022.12.13] = * buffer compatibility improvements with WP-Super-Cache, W3 Total Cache, WP Rocket, LiteSpeed Cache and Cache Enabler

Download this release

Release Info

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

Code changes from version 3.3.5 to 3.3.6

fvm.php CHANGED
@@ -6,7 +6,7 @@ Description: Improve your speed score on GTmetrix, Pingdom Tools and Google Page
6
  Author: Raul Peixoto
7
  Author URI: http://fastvelocity.com
8
  Text Domain: fast-velocity-minify
9
- Version: 3.3.5
10
  License: GPL2
11
 
12
  ------------------------------------------------------------------------
@@ -104,10 +104,24 @@ if(!is_admin()) {
104
  add_action('admin_bar_menu', 'fvm_admintoolbar', 100);
105
  add_action('init', 'fvm_process_cache_purge_request');
106
 
107
- # allow overwrite
108
- if (!defined('FVM_HOOK_INTO')) { define('FVM_HOOK_INTO', 'setup_theme'); }
109
- add_action(constant("FVM_HOOK_INTO"), 'fvm_start_buffer', 50);
110
- add_action('shutdown', 'fvm_end_buffer', -50);
111
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
 
6
  Author: Raul Peixoto
7
  Author URI: http://fastvelocity.com
8
  Text Domain: fast-velocity-minify
9
+ Version: 3.3.6
10
  License: GPL2
11
 
12
  ------------------------------------------------------------------------
104
  add_action('admin_bar_menu', 'fvm_admintoolbar', 100);
105
  add_action('init', 'fvm_process_cache_purge_request');
106
 
107
+ # load after all plugins
108
+ add_action( 'plugins_loaded', 'fvm_loader' );
109
+ function fvm_loader() {
110
+ if (defined('WPCACHECONFIGPATH')) {
111
+ add_filter( 'wpsupercache_buffer', 'fvm_process_page' ); # WP-Super-Cache
112
+ } else if (defined('W3TC')) {
113
+ add_filter( 'w3tc_process_content', 'fvm_process_page' ); # W3 Total Cache
114
+ } else if (defined('WP_ROCKET_VERSION')) {
115
+ add_filter( 'rocket_buffer', 'fvm_process_page' ); # WP Rocket
116
+ } else if (defined('LSCWP_V')) {
117
+ add_filter( 'litespeed_buffer_before', 'fvm_process_page' ); # LiteSpeed Cache
118
+ } else if (defined('CE_VERSION')) {
119
+ add_filter( 'cache_enabler_page_contents_before_store', 'fvm_process_page' ); # Cache Enabler
120
+ } else {
121
+ if (!defined('FVM_HOOK_INTO')) { define('FVM_HOOK_INTO', 'setup_theme'); }
122
+ add_action(constant("FVM_HOOK_INTO"), 'fvm_start_buffer', 999999);
123
+ }
124
+ }
125
+
126
  }
127
 
inc/frontend.php CHANGED
@@ -35,16 +35,10 @@ include_once($fvm_var_inc_lib_mm . 'path-converter' . DIRECTORY_SEPARATOR . 'src
35
  # start buffering on template load
36
  function fvm_start_buffer() {
37
  if(fvm_can_minify_css() || fvm_can_minify_js() || fvm_can_process_html()) {
38
- ob_start('fvm_process_page', 0, PHP_OUTPUT_HANDLER_FLUSHABLE);
39
  }
40
  }
41
 
42
- # process the buffer
43
- function fvm_end_buffer() {
44
- if(fvm_can_minify_css() || fvm_can_minify_js() || fvm_can_process_html()) {
45
- ob_end_flush();
46
- }
47
- }
48
 
49
  # process html
50
  function fvm_process_page($html) {
@@ -1098,7 +1092,7 @@ function fvm_process_page($html) {
1098
  if(function_exists('fvm_filter_final_html')) {
1099
  $html = fvm_filter_final_html($html);
1100
  }
1101
-
1102
  }
1103
 
1104
  # return html
35
  # start buffering on template load
36
  function fvm_start_buffer() {
37
  if(fvm_can_minify_css() || fvm_can_minify_js() || fvm_can_process_html()) {
38
+ ob_start('fvm_process_page', 0, PHP_OUTPUT_HANDLER_REMOVABLE);
39
  }
40
  }
41
 
 
 
 
 
 
 
42
 
43
  # process html
44
  function fvm_process_page($html) {
1092
  if(function_exists('fvm_filter_final_html')) {
1093
  $html = fvm_filter_final_html($html);
1094
  }
1095
+
1096
  }
1097
 
1098
  # return html
libs/simplehtmldom/simple_html_dom.php CHANGED
@@ -1034,7 +1034,7 @@ class fvm_simple_html_dom_node
1034
 
1035
  if ($this->dom) {
1036
  $sourceCharset = strtoupper($this->dom->_charset);
1037
- $targetCharset = strtoupper($this->dom->_target_charset).'//IGNORE';
1038
  }
1039
 
1040
  if (is_object($debug_object)) {
@@ -1054,7 +1054,15 @@ class fvm_simple_html_dom_node
1054
  && ($this->is_utf8($text))) {
1055
  $converted_text = $text;
1056
  } else {
1057
- $converted_text = iconv($sourceCharset, $targetCharset, $text);
 
 
 
 
 
 
 
 
1058
  }
1059
  }
1060
 
1034
 
1035
  if ($this->dom) {
1036
  $sourceCharset = strtoupper($this->dom->_charset);
1037
+ $targetCharset = strtoupper($this->dom->_target_charset);
1038
  }
1039
 
1040
  if (is_object($debug_object)) {
1054
  && ($this->is_utf8($text))) {
1055
  $converted_text = $text;
1056
  } else {
1057
+
1058
+ # replace legacy code
1059
+ //$converted_text = iconv($sourceCharset, $targetCharset, $text);
1060
+
1061
+ # with mb_string
1062
+ if(function_exists('mb_substitute_character')) { mb_substitute_character("none"); }
1063
+ $converted_text= mb_convert_encoding($text, $targetCharset, $sourceCharset);
1064
+
1065
+
1066
  }
1067
  }
1068
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Alignak
3
  Tags: PHP Minify, Lighthouse, GTmetrix, Pingdom, Pagespeed, Merging, Minification, Optimization, Speed, Performance, FVM
4
  Requires at least: 5.0
5
  Requires PHP: 7.0
6
- Stable tag: 3.3.5
7
  Tested up to: 6.1.3
8
  Text Domain: fast-velocity-minify
9
  License: GPLv3 or later
@@ -49,6 +49,9 @@ You need a public directory to store and serve minified cache files. If you need
49
 
50
  == Changelog ==
51
 
 
 
 
52
  = 3.3.5 [2022.12.13] =
53
  * fixed a notice with php cli
54
 
3
  Tags: PHP Minify, Lighthouse, GTmetrix, Pingdom, Pagespeed, Merging, Minification, Optimization, Speed, Performance, FVM
4
  Requires at least: 5.0
5
  Requires PHP: 7.0
6
+ Stable tag: 3.3.6
7
  Tested up to: 6.1.3
8
  Text Domain: fast-velocity-minify
9
  License: GPLv3 or later
49
 
50
  == Changelog ==
51
 
52
+ = 3.3.6 [2022.12.13] =
53
+ * buffer compatibility improvements with WP-Super-Cache, W3 Total Cache, WP Rocket, LiteSpeed Cache and Cache Enabler
54
+
55
  = 3.3.5 [2022.12.13] =
56
  * fixed a notice with php cli
57