Fast Velocity Minify - Version 2.8.3

Version Description

[2020.04.17] = * Removed some options out of the autoload wp_option to avoid getting cached on the alloptions when using OPCache * Removed the CDN purge option for WP Engine (not needed since FVM automatically does cache busting) * Added support for Kinsta, Pagely, Pressidum, Savvii and Pantheon * Better sourcemaps regex removal from minified css and js files

Download this release

Release Info

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

Code changes from version 2.8.2 to 2.8.3

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.8.2
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
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.3
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
inc/functions-cache.php CHANGED
@@ -107,12 +107,17 @@ return array('cachebase'=>$cachebase,'tmpdir'=>$tmpdir, 'cachedir'=>$cachedir, '
107
 
108
  # increment file names
109
  function fvm_cache_increment() {
110
- update_option('fvm-last-cache-update', time());
111
  }
112
 
113
  # will delete temporary intermediate stuff but leave final css/js alone for compatibility
114
  function fvm_purge_all() {
115
 
 
 
 
 
 
116
  # get cache directories and urls
117
  $cachepath = fvm_cachepath();
118
  $tmpdir = $cachepath['tmpdir'];
@@ -133,6 +138,13 @@ function fvm_purge_all() {
133
 
134
  # purge all public files on uninstall
135
  function fvm_purge_all_uninstall() {
 
 
 
 
 
 
 
136
  $cachepath = fvm_cachepath();
137
  $cachebaseparent = dirname($cachepath['cachebase']);
138
  if(is_dir($cachebaseparent)) { fastvelocity_rrmdir($cachebaseparent); }
@@ -142,6 +154,11 @@ function fvm_purge_all_uninstall() {
142
  # purge cache files older than 30 days
143
  function fvm_purge_old() {
144
 
 
 
 
 
 
145
  # get cache directories and urls
146
  $cachepath = fvm_cachepath();
147
  $cachebaseparent = dirname($cachepath['cachebase']);
@@ -263,7 +280,7 @@ function fastvelocity_godaddy_request( $method, $url = null ) {
263
  $host = parse_url( $url, PHP_URL_HOST );
264
  $url = set_url_scheme( str_replace( $host, WPaas\Plugin::vip(), $url ), 'http' );
265
  wp_cache_flush();
266
- update_option( 'gd_system_last_cache_flush', time() ); # purge apc
267
  wp_remote_request( esc_url_raw( $url ), array('method' => $method, 'blocking' => false, 'headers' => array('Host' => $host)) );
268
  }
269
 
@@ -271,102 +288,155 @@ function fastvelocity_godaddy_request( $method, $url = null ) {
271
  # purge supported hosting and plugins
272
  function fvm_purge_others(){
273
 
274
- # wordpress default cache
275
- if (function_exists('wp_cache_flush')) {
276
- wp_cache_flush();
277
- }
278
 
279
  # Purge all W3 Total Cache
280
  if (function_exists('w3tc_pgcache_flush')) {
281
  w3tc_pgcache_flush();
282
- return __('<div class="notice notice-info is-dismissible"><p>All caches from <strong>W3 Total Cache</strong> have also been purged.</p></div>');
283
  }
284
 
285
  # Purge WP Super Cache
286
  if (function_exists('wp_cache_clear_cache')) {
287
  wp_cache_clear_cache();
288
- return __('<div class="notice notice-info is-dismissible"><p>All caches from <strong>WP Super Cache</strong> have also been purged.</p></div>');
289
  }
290
 
291
  # Purge WP Rocket
292
  if (function_exists('rocket_clean_domain')) {
293
  rocket_clean_domain();
294
- return __('<div class="notice notice-info is-dismissible"><p>All caches from <strong>WP Rocket</strong> have also been purged.</p></div>');
295
  }
296
 
297
  # Purge Cachify
298
  if (function_exists('cachify_flush_cache')) {
299
  cachify_flush_cache();
300
- return __('<div class="notice notice-info is-dismissible"><p>All caches from <strong>Cachify</strong> have also been purged.</p></div>');
301
  }
302
 
303
  # Purge Comet Cache
304
  if ( class_exists("comet_cache") ) {
305
  comet_cache::clear();
306
- return __('<div class="notice notice-info is-dismissible"><p>All caches from <strong>Comet Cache</strong> have also been purged.</p></div>');
307
  }
308
 
309
  # Purge Zen Cache
310
  if ( class_exists("zencache") ) {
311
  zencache::clear();
312
- return __('<div class="notice notice-info is-dismissible"><p>All caches from <strong>Comet Cache</strong> have also been purged.</p></div>');
313
  }
314
 
315
  # Purge LiteSpeed Cache
316
  if (class_exists('LiteSpeed_Cache_Tags')) {
317
  LiteSpeed_Cache_Tags::add_purge_tag('*');
318
- return __('<div class="notice notice-info is-dismissible"><p>All caches from <strong>LiteSpeed Cache</strong> have also been purged.</p></div>');
319
- }
320
-
321
- # Purge SG Optimizer
322
- if (function_exists('sg_cachepress_purge_cache')) {
323
- sg_cachepress_purge_cache();
324
- return __('<div class="notice notice-info is-dismissible"><p>All caches from <strong>SG Optimizer</strong> have also been purged.</p></div>');
325
  }
326
 
327
  # Purge Hyper Cache
328
  if (class_exists( 'HyperCache' )) {
329
  do_action( 'autoptimize_action_cachepurged' );
330
- return __( '<div class="notice notice-info is-dismissible"><p>All caches from <strong>HyperCache</strong> have also been purged.</p></div>');
331
- }
332
-
333
- # Purge Godaddy Managed WordPress Hosting (Varnish + APC)
334
- if (class_exists('WPaaS\Plugin')) {
335
- fastvelocity_godaddy_request('BAN');
336
- return __('<div class="notice notice-info is-dismissible"><p>A cache purge request has been sent to <strong>Go Daddy Varnish</strong></p></div><div class="notice notice-info is-dismissible"><p>Please note that it may not work 100% of the time, due to cache rate limiting by your host!</p></div>');
337
  }
338
 
339
  # purge cache enabler
340
  if ( has_action('ce_clear_cache') ) {
341
  do_action('ce_clear_cache');
342
- return __( '<div class="notice notice-info is-dismissible"><p>All caches from <strong>Cache Enabler</strong> have also been purged.</p></div>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  }
344
 
345
 
346
  # Purge WP Engine
347
  if (class_exists("WpeCommon")) {
348
  if (method_exists('WpeCommon', 'purge_memcached')) { WpeCommon::purge_memcached(); }
349
- if (method_exists('WpeCommon', 'clear_maxcdn_cache')) { WpeCommon::clear_maxcdn_cache(); }
350
  if (method_exists('WpeCommon', 'purge_varnish_cache')) { WpeCommon::purge_varnish_cache(); }
351
 
352
- if (method_exists('WpeCommon', 'purge_memcached') || method_exists('WpeCommon', 'clear_maxcdn_cache') || method_exists('WpeCommon', 'purge_varnish_cache')) {
353
- return __('<div class="notice notice-info is-dismissible"><p>A cache purge request has been sent to <strong>WP Engine</strong></p></div><div class="notice notice-info is-dismissible"><p>Please note that it may not work 100% of the time, due to cache rate limiting by your host!</p></div>');
354
  }
355
  }
356
 
357
- # add breeze cache purge support
358
- if (class_exists("Breeze_PurgeCache")) {
359
- Breeze_PurgeCache::breeze_cache_flush();
360
- return __( '<div class="notice notice-info is-dismissible"><p>All caches from <strong>Breeze</strong> have also been purged.</p></div>');
 
 
 
 
361
  }
362
 
 
 
 
 
 
 
363
 
364
- # other lesser plugins
 
 
 
 
 
365
 
366
- # swift
367
- if (class_exists("Swift_Performance_Cache")) {
368
- Swift_Performance_Cache::clear_all_cache();
369
- return __( '<div class="notice notice-info is-dismissible"><p>All caches from <strong>Swift Performance</strong> have also been purged.</p></div>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  }
371
 
372
  }
107
 
108
  # increment file names
109
  function fvm_cache_increment() {
110
+ update_option('fvm-last-cache-update', time(), 'no');
111
  }
112
 
113
  # will delete temporary intermediate stuff but leave final css/js alone for compatibility
114
  function fvm_purge_all() {
115
 
116
+ # flush opcache
117
+ if(function_exists('opcache_reset')) {
118
+ opcache_reset();
119
+ }
120
+
121
  # get cache directories and urls
122
  $cachepath = fvm_cachepath();
123
  $tmpdir = $cachepath['tmpdir'];
138
 
139
  # purge all public files on uninstall
140
  function fvm_purge_all_uninstall() {
141
+
142
+ # flush opcache
143
+ if(function_exists('opcache_reset')) {
144
+ opcache_reset();
145
+ }
146
+
147
+ # de;ete dirs
148
  $cachepath = fvm_cachepath();
149
  $cachebaseparent = dirname($cachepath['cachebase']);
150
  if(is_dir($cachebaseparent)) { fastvelocity_rrmdir($cachebaseparent); }
154
  # purge cache files older than 30 days
155
  function fvm_purge_old() {
156
 
157
+ # flush opcache
158
+ if(function_exists('opcache_reset')) {
159
+ opcache_reset();
160
+ }
161
+
162
  # get cache directories and urls
163
  $cachepath = fvm_cachepath();
164
  $cachebaseparent = dirname($cachepath['cachebase']);
280
  $host = parse_url( $url, PHP_URL_HOST );
281
  $url = set_url_scheme( str_replace( $host, WPaas\Plugin::vip(), $url ), 'http' );
282
  wp_cache_flush();
283
+ update_option( 'gd_system_last_cache_flush', time(), 'no'); # purge apc
284
  wp_remote_request( esc_url_raw( $url ), array('method' => $method, 'blocking' => false, 'headers' => array('Host' => $host)) );
285
  }
286
 
288
  # purge supported hosting and plugins
289
  function fvm_purge_others(){
290
 
291
+ # third party plugins
 
 
 
292
 
293
  # Purge all W3 Total Cache
294
  if (function_exists('w3tc_pgcache_flush')) {
295
  w3tc_pgcache_flush();
296
+ return __('<div class="notice notice-info is-dismissible"><p>All caches on <strong>W3 Total Cache</strong> have been purged.</p></div>');
297
  }
298
 
299
  # Purge WP Super Cache
300
  if (function_exists('wp_cache_clear_cache')) {
301
  wp_cache_clear_cache();
302
+ return __('<div class="notice notice-info is-dismissible"><p>All caches on <strong>WP Super Cache</strong> have been purged.</p></div>');
303
  }
304
 
305
  # Purge WP Rocket
306
  if (function_exists('rocket_clean_domain')) {
307
  rocket_clean_domain();
308
+ return __('<div class="notice notice-info is-dismissible"><p>All caches on <strong>WP Rocket</strong> have been purged.</p></div>');
309
  }
310
 
311
  # Purge Cachify
312
  if (function_exists('cachify_flush_cache')) {
313
  cachify_flush_cache();
314
+ return __('<div class="notice notice-info is-dismissible"><p>All caches on <strong>Cachify</strong> have been purged.</p></div>');
315
  }
316
 
317
  # Purge Comet Cache
318
  if ( class_exists("comet_cache") ) {
319
  comet_cache::clear();
320
+ return __('<div class="notice notice-info is-dismissible"><p>All caches on <strong>Comet Cache</strong> have been purged.</p></div>');
321
  }
322
 
323
  # Purge Zen Cache
324
  if ( class_exists("zencache") ) {
325
  zencache::clear();
326
+ return __('<div class="notice notice-info is-dismissible"><p>All caches on <strong>Comet Cache</strong> have been purged.</p></div>');
327
  }
328
 
329
  # Purge LiteSpeed Cache
330
  if (class_exists('LiteSpeed_Cache_Tags')) {
331
  LiteSpeed_Cache_Tags::add_purge_tag('*');
332
+ return __('<div class="notice notice-info is-dismissible"><p>All caches on <strong>LiteSpeed Cache</strong> have been purged.</p></div>');
 
 
 
 
 
 
333
  }
334
 
335
  # Purge Hyper Cache
336
  if (class_exists( 'HyperCache' )) {
337
  do_action( 'autoptimize_action_cachepurged' );
338
+ return __( '<div class="notice notice-info is-dismissible"><p>All caches on <strong>HyperCache</strong> have been purged.</p></div>');
 
 
 
 
 
 
339
  }
340
 
341
  # purge cache enabler
342
  if ( has_action('ce_clear_cache') ) {
343
  do_action('ce_clear_cache');
344
+ return __( '<div class="notice notice-info is-dismissible"><p>All caches on <strong>Cache Enabler</strong> have been purged.</p></div>');
345
+ }
346
+
347
+ # purge wpfc
348
+ if (function_exists('wpfc_clear_all_cache')) {
349
+ wpfc_clear_all_cache(true);
350
+ }
351
+
352
+ # add breeze cache purge support
353
+ if (class_exists("Breeze_PurgeCache")) {
354
+ Breeze_PurgeCache::breeze_cache_flush();
355
+ return __( '<div class="notice notice-info is-dismissible"><p>All caches on <strong>Breeze</strong> have been purged.</p></div>');
356
+ }
357
+
358
+
359
+ # swift
360
+ if (class_exists("Swift_Performance_Cache")) {
361
+ Swift_Performance_Cache::clear_all_cache();
362
+ return __( '<div class="notice notice-info is-dismissible"><p>All caches on <strong>Swift Performance</strong> have been purged.</p></div>');
363
+ }
364
+
365
+
366
+ # hosting companies
367
+
368
+ # Purge SG Optimizer (Siteground)
369
+ if (function_exists('sg_cachepress_purge_cache')) {
370
+ sg_cachepress_purge_cache();
371
+ return __('<div class="notice notice-info is-dismissible"><p>All caches on <strong>SG Optimizer</strong> have been purged.</p></div>');
372
+ }
373
+
374
+ # Purge Godaddy Managed WordPress Hosting (Varnish + APC)
375
+ if (class_exists('WPaaS\Plugin') && method_exists( 'WPass\Plugin', 'vip' )) {
376
+ fastvelocity_godaddy_request('BAN');
377
+ return __('<div class="notice notice-info is-dismissible"><p>A cache purge request has been sent to <strong>Go Daddy Varnish</strong></p></div>');
378
  }
379
 
380
 
381
  # Purge WP Engine
382
  if (class_exists("WpeCommon")) {
383
  if (method_exists('WpeCommon', 'purge_memcached')) { WpeCommon::purge_memcached(); }
 
384
  if (method_exists('WpeCommon', 'purge_varnish_cache')) { WpeCommon::purge_varnish_cache(); }
385
 
386
+ if (method_exists('WpeCommon', 'purge_memcached') || method_exists('WpeCommon', 'purge_varnish_cache')) {
387
+ return __('<div class="notice notice-info is-dismissible"><p>A cache purge request has been sent to <strong>WP Engine</strong></p></div>');
388
  }
389
  }
390
 
391
+
392
+ # Purge Kinsta
393
+ global $kinsta_cache;
394
+ if ( isset($kinsta_cache) && class_exists('\\Kinsta\\CDN_Enabler')) {
395
+ if (!empty( $kinsta_cache->kinsta_cache_purge)){
396
+ $kinsta_cache->kinsta_cache_purge->purge_complete_caches();
397
+ return __('<div class="notice notice-info is-dismissible"><p>A cache purge request has been sent to <strong>Kinsta</strong></p></div>');
398
+ }
399
  }
400
 
401
+ # Purge Pagely
402
+ if ( class_exists( 'PagelyCachePurge' ) ) {
403
+ $purge_pagely = new PagelyCachePurge();
404
+ $purge_pagely->purgeAll();
405
+ return __('<div class="notice notice-info is-dismissible"><p>A cache purge request has been sent to <strong>Pagely</strong></p></div>');
406
+ }
407
 
408
+ # Purge Pressidum
409
+ if (defined('WP_NINUKIS_WP_NAME') && class_exists('Ninukis_Plugin')){
410
+ $purge_pressidum = Ninukis_Plugin::get_instance();
411
+ $purge_pressidum->purgeAllCaches();
412
+ return __('<div class="notice notice-info is-dismissible"><p>A cache purge request has been sent to <strong>Pressidium</strong></p></div>');
413
+ }
414
 
415
+ # Purge Savvii
416
+ if (defined( '\Savvii\CacheFlusherPlugin::NAME_DOMAINFLUSH_NOW')) {
417
+ $purge_savvii = new \Savvii\CacheFlusherPlugin();
418
+ if ( method_exists( $plugin, 'domainflush' ) ) {
419
+ $purge_savvii->domainflush();
420
+ return __('<div class="notice notice-info is-dismissible"><p>A cache purge request has been sent to <strong>Savvii</strong></p></div>');
421
+ }
422
+ }
423
+
424
+ # Purge Pantheon Advanced Page Cache plugin
425
+ if(function_exists('pantheon_wp_clear_edge_all')) {
426
+ pantheon_wp_clear_edge_all();
427
+ }
428
+
429
+ # last actions, php and wordpress in this order
430
+
431
+ # flush opcache if available
432
+ if(function_exists('opcache_reset')) {
433
+ opcache_reset();
434
+ return __( '<div class="notice notice-info is-dismissible"><p>All caches on <strong>OPCache</strong> have been purged.</p></div>');
435
+ }
436
+
437
+ # wordpress default cache
438
+ if (function_exists('wp_cache_flush')) {
439
+ wp_cache_flush();
440
  }
441
 
442
  }
inc/functions-upgrade.php CHANGED
@@ -13,7 +13,7 @@ function fastvelocity_plugin_upgrade_completed($upgrader_object, $options) {
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'] ) ) {
@@ -26,7 +26,7 @@ function fastvelocity_plugin_upgrade_completed($upgrader_object, $options) {
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
  }
13
 
14
  # save current version on upgrade
15
  if ($ver != $fastvelocity_plugin_version) {
16
+ update_option( "fastvelocity_plugin_version", $fastvelocity_plugin_version, 'no');
17
  }
18
 
19
  if( $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) {
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), 'no');
30
 
31
  }
32
  }
inc/functions.php CHANGED
@@ -60,16 +60,16 @@ function fastvelocity_plugin_activate() {
60
  # default options to enable (1)
61
  $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');
62
  foreach($options_enable_default as $option) {
63
- update_option($option, 1, 'yes');
64
  }
65
 
66
  # default blacklist
67
  $exc = array('/html5shiv.js', '/html5shiv-printshiv.min.js', '/excanvas.js', '/avada-ie9.js', '/respond.js', '/respond.min.js', '/selectivizr.js', '/Avada/assets/css/ie.css', '/html5.js', '/IE9.js', '/fusion-ie9.js', '/vc_lte_ie9.min.css', '/old-ie.css', '/ie.css', '/vc-ie8.min.css', '/mailchimp-for-wp/assets/js/third-party/placeholders.min.js', '/assets/js/plugins/wp-enqueue/min/webfontloader.js', '/a.optnmstr.com/app/js/api.min.js', '/pixelyoursite/js/public.js', '/assets/js/wcdrip-drip.js');
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
  }
75
  }
@@ -325,10 +325,8 @@ if(!$disable_js_minification) {
325
  $js = fvm_compat_urls($js);
326
  }
327
 
328
- # try to remove source mapping files
329
- $filename = basename($url);
330
- $remove = array("//# sourceMappingURL=$filename.map", "//# sourceMappingURL = $filename.map");
331
- $js = str_ireplace($remove, '', $js);
332
 
333
  # needed when merging js files
334
  $js = trim($js);
@@ -396,6 +394,9 @@ $css = str_ireplace('@charset "UTF-8";', '', $css);
396
  $ctime = get_option('fvm-last-cache-update', '0'); # last update or zero
397
  $css = preg_replace('/(.eot|.woff2|.woff|.ttf)+[?+](.+?)(\)|\'|\")/ui', "$1"."#".$ctime."$3", $css); # fonts cache buster
398
 
 
 
 
399
  # minify CSS
400
  if(!$disable_css_minification) {
401
  $css = fastvelocity_min_minify_css_string($css);
60
  # default options to enable (1)
61
  $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');
62
  foreach($options_enable_default as $option) {
63
+ update_option($option, 1, 'no');
64
  }
65
 
66
  # default blacklist
67
  $exc = array('/html5shiv.js', '/html5shiv-printshiv.min.js', '/excanvas.js', '/avada-ie9.js', '/respond.js', '/respond.min.js', '/selectivizr.js', '/Avada/assets/css/ie.css', '/html5.js', '/IE9.js', '/fusion-ie9.js', '/vc_lte_ie9.min.css', '/old-ie.css', '/ie.css', '/vc-ie8.min.css', '/mailchimp-for-wp/assets/js/third-party/placeholders.min.js', '/assets/js/plugins/wp-enqueue/min/webfontloader.js', '/a.optnmstr.com/app/js/api.min.js', '/pixelyoursite/js/public.js', '/assets/js/wcdrip-drip.js');
68
+ update_option('fastvelocity_min_blacklist', implode(PHP_EOL, $exc), 'no');
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), 'no');
73
 
74
  }
75
  }
325
  $js = fvm_compat_urls($js);
326
  }
327
 
328
+ # remove sourcemaps
329
+ $js = preg_replace('~//[#@]\s(source(?:Mapping)?URL)=\s*(\S+)~', '', $js);
 
 
330
 
331
  # needed when merging js files
332
  $js = trim($js);
394
  $ctime = get_option('fvm-last-cache-update', '0'); # last update or zero
395
  $css = preg_replace('/(.eot|.woff2|.woff|.ttf)+[?+](.+?)(\)|\'|\")/ui', "$1"."#".$ctime."$3", $css); # fonts cache buster
396
 
397
+ # remove sourcemaps
398
+ $css = preg_replace('~//[#@]\s(source(?:Mapping)?URL)=\s*(\S+)~', '', $css);
399
+
400
  # minify CSS
401
  if(!$disable_css_minification) {
402
  $css = fastvelocity_min_minify_css_string($css);
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.8.2
7
  Tested up to: 5.4
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -198,6 +198,12 @@ Please backup your site before updating. Version 3.0 will have a major code rewr
198
 
199
  == Changelog ==
200
 
 
 
 
 
 
 
201
  = 2.8.2 [2020.04.13] =
202
  * Skip changing clip-path: url(#some-svg); to absolute urls during css minification
203
  * Added a better cronjob duplicate cleanup task, when uninstalling the plugin
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.3
7
  Tested up to: 5.4
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
198
 
199
  == Changelog ==
200
 
201
+ = 2.8.3 [2020.04.17] =
202
+ * Removed some options out of the autoload wp_option to avoid getting cached on the alloptions when using OPCache
203
+ * Removed the CDN purge option for WP Engine (not needed since FVM automatically does cache busting)
204
+ * Added support for Kinsta, Pagely, Pressidum, Savvii and Pantheon
205
+ * Better sourcemaps regex removal from minified css and js files
206
+
207
  = 2.8.2 [2020.04.13] =
208
  * Skip changing clip-path: url(#some-svg); to absolute urls during css minification
209
  * Added a better cronjob duplicate cleanup task, when uninstalling the plugin