Fast Velocity Minify - Version 2.7.4

Version Description

[2019.08.18] = * hange to open JS/CSS files suspected of having PHP code via HTTP request, instead of reading the file directly from disk

Download this release

Release Info

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

Code changes from version 2.7.7 to 2.7.4

Files changed (2) hide show
  1. fvm.php +10 -24
  2. readme.txt +295 -15
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.7
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
@@ -303,7 +303,7 @@ function fastvelocity_admintoolbar() {
303
 
304
  # function to list all cache files
305
  function fastvelocity_min_files_callback() {
306
-
307
  # must be able to cleanup cache
308
  if (!current_user_can('manage_options')) {
309
  wp_die( __('You do not have sufficient permissions to access this page.'));
@@ -1346,23 +1346,16 @@ for($i=0,$l=count($header);$i<$l;$i++) {
1346
  continue;
1347
  }
1348
 
1349
- # Add extra data from wp_add_inline_script before
1350
- if (!empty( $wp_scripts->registered[$handle]->extra)) {
1351
- if (!empty( $wp_scripts->registered[$handle]->extra['before'])){
1352
- $code.= PHP_EOL . implode(PHP_EOL, $wp_scripts->registered[$handle]->extra['before']);
1353
- }
1354
- }
1355
-
1356
  # append code to merged file
1357
  $code.= $res['code'];
1358
  $log.= $res['log'];
1359
 
1360
- # Add extra data from wp_add_inline_script after
1361
  if (!empty( $wp_scripts->registered[$handle]->extra)) {
1362
- if (!empty( $wp_scripts->registered[$handle]->extra['after'])){
1363
- $code.= PHP_EOL . implode(PHP_EOL, $wp_scripts->registered[$handle]->extra['after']);
1364
  }
1365
- }
1366
 
1367
  # consider dependencies on handles with an empty src
1368
  } else {
@@ -1548,21 +1541,14 @@ for($i=0,$l=count($footer);$i<$l;$i++) {
1548
  continue;
1549
  }
1550
 
1551
- # Add extra data from wp_add_inline_script before
1552
- if (!empty($wp_scripts->registered[$handle]->extra)){
1553
- if (!empty($wp_scripts->registered[$handle]->extra['before'])){
1554
- $code.= PHP_EOL.implode(PHP_EOL, $wp_scripts->registered[$handle]->extra['before']);
1555
- }
1556
- }
1557
-
1558
  # append code to merged file
1559
  $code.= $res['code'];
1560
  $log.= $res['log'];
1561
-
1562
- # Add extra data from wp_add_inline_script after
1563
  if (!empty($wp_scripts->registered[$handle]->extra)){
1564
- if (!empty($wp_scripts->registered[$handle]->extra['after'])){
1565
- $code.= PHP_EOL.implode(PHP_EOL, $wp_scripts->registered[$handle]->extra['after']);
1566
  }
1567
  }
1568
 
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.4
9
  License: GPL2
10
 
11
  ------------------------------------------------------------------------
303
 
304
  # function to list all cache files
305
  function fastvelocity_min_files_callback() {
306
+
307
  # must be able to cleanup cache
308
  if (!current_user_can('manage_options')) {
309
  wp_die( __('You do not have sufficient permissions to access this page.'));
1346
  continue;
1347
  }
1348
 
 
 
 
 
 
 
 
1349
  # append code to merged file
1350
  $code.= $res['code'];
1351
  $log.= $res['log'];
1352
 
1353
+ # Add extra data from wp_add_inline_script before
1354
  if (!empty( $wp_scripts->registered[$handle]->extra)) {
1355
+ if (!empty( $wp_scripts->registered[$handle]->extra['before'])){
1356
+ $code.= PHP_EOL . implode(PHP_EOL, $wp_scripts->registered[$handle]->extra['before']);
1357
  }
1358
+ }
1359
 
1360
  # consider dependencies on handles with an empty src
1361
  } else {
1541
  continue;
1542
  }
1543
 
 
 
 
 
 
 
 
1544
  # append code to merged file
1545
  $code.= $res['code'];
1546
  $log.= $res['log'];
1547
+
1548
+ # Add extra data from wp_add_inline_script before
1549
  if (!empty($wp_scripts->registered[$handle]->extra)){
1550
+ if (!empty($wp_scripts->registered[$handle]->extra['before'])){
1551
+ $code.= PHP_EOL.implode(PHP_EOL, $wp_scripts->registered[$handle]->extra['before']);
1552
  }
1553
  }
1554
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Fast Velocity Minify ===
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.7
5
- Requires PHP: 5.6
6
- Stable tag: 2.7.7
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,17 +198,8 @@ Please backup your site before updating. Version 3.0 will have a major code rewr
198
 
199
  == Changelog ==
200
 
201
- = 2.7.7 [2019.10.15] =
202
- * added a capability check on the status page ajax request, which could show the cache file path when debug mode is enabled to subscribers
203
-
204
- = 2.7.6 [2019.10.10] =
205
- * bug fix release
206
-
207
- = 2.7.5 [2019.10.09] =
208
- * added support to "after" scripts added via wp_add_inline_script
209
-
210
  = 2.7.4 [2019.08.18] =
211
- * change to open JS/CSS files suspected of having PHP code via HTTP request, instead of reading the file directly from disk
212
 
213
  = 2.7.3 [2019.07.29] =
214
  * Beaver Builder compatibility fix
@@ -265,8 +256,297 @@ Please backup your site before updating. Version 3.0 will have a major code rewr
265
  * improved compatibility with page cache plugins and servers (purging FVM without purging the page cache should be fine now)
266
  * added a daily cronjob, to delete public invalid cache files that are older than 3 months (your page cache should expire before this)
267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  = 2.0.0 [2017.05.11] =
269
- * version 2.x branch release
 
 
 
 
 
 
 
270
 
271
  = 1.0 [2016.06.19] =
272
  * Initial Release
1
  === Fast Velocity Minify ===
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
+ Requires PHP: 5.5
6
+ Stable tag: 2.7.4
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
 
198
 
199
  == Changelog ==
200
 
 
 
 
 
 
 
 
 
 
201
  = 2.7.4 [2019.08.18] =
202
+ * hange to open JS/CSS files suspected of having PHP code via HTTP request, instead of reading the file directly from disk
203
 
204
  = 2.7.3 [2019.07.29] =
205
  * Beaver Builder compatibility fix
256
  * improved compatibility with page cache plugins and servers (purging FVM without purging the page cache should be fine now)
257
  * added a daily cronjob, to delete public invalid cache files that are older than 3 months (your page cache should expire before this)
258
 
259
+ = 2.5.9 [2019.02.19] =
260
+ * fixed some PHP notices, when wordpress fails to download a missing js/css file
261
+
262
+ = 2.5.8 [2019.02.06] =
263
+ * minor bug fix with the defer for pagespeed option
264
+
265
+ = 2.5.7 [2019.02.04] =
266
+ * reverted back the css merging method to version 2.5.2 due to some compatibility issues
267
+
268
+ = 2.5.6 [2019.01.18] =
269
+ * fixed some php notices
270
+ * disabled FVM on amp pages
271
+ * expected to be the last update on the 2.x branch, before 3.0 major release
272
+
273
+ = 2.5.5 [2019.01.12] =
274
+ * fixed the dynamic urls being forced as http://
275
+ * fixed the inlined styles being stripped when the inline all CSS option is enabled
276
+ * added option to disable merging of inlined css code (for when you have dynamic inline css code)
277
+ * other minor bug fixes
278
+
279
+ = 2.5.4 [2019.01.11] =
280
+ * css merging bug fixes
281
+
282
+ = 2.5.3 [2019.01.11] =
283
+ * fixed inlined css code being minified, even when minification is off
284
+ * compatibility and performance improvements for the CSS merging and inlining functionality
285
+
286
+ = 2.5.2 [2019.01.11] =
287
+ * removed CURL as a fallback method (CURL is already a fallback on the WP HTTP API) as per WP recommendation
288
+ * fixed a query monitor notice about mkdir
289
+ * removed some legacy code + some minor performance improvements on the code
290
+ * improvement for the defer for pagespeed option and ignore list
291
+ * improvement for the loadCSS functionality
292
+ * improvements for merging the google fonts option
293
+
294
+ = 2.5.1 [2018.12.17] =
295
+ * minor bug fix related to the font awesome option
296
+ * added cache purging support to Breeze (Cloudways)
297
+
298
+ = 2.5.0 [2018.12.13] =
299
+ * bug fixes with the google fonts merging option
300
+ * better default settings
301
+
302
+ = 2.4.9 [2018.12.13] =
303
+ * improved the google fonts merging to only allow existing google fonts (no more google fonts 404 errors due to the merging of the fonts)
304
+ * downgraded PHP Minify to version 1.3.60 due to someone reporting a server error with the new version
305
+
306
+ = 2.4.8 [2018.12.07] =
307
+ * changed the file permissions for the generated cache directory and files, to match the uploads directory
308
+ * added some extra checks for when PHP is running in safe mode
309
+
310
+ = 2.4.7 [2018.12.06] =
311
+ * added better default options after new install
312
+ * added option to preserve FVM settings on deactivation
313
+ * added an HTML comment to the frontend with the path and notification, when FVM cannot generate the cache files (ie: wrong file permissions)
314
+ * added a notification on wp-admin when FVM cannot generate the cache files due to wrong permissions
315
+ * added an option to force "chmod 0777" on FVM cache files, to avoid errors on servers that need more than "chmod 0755"
316
+ * improved the google fonts merging option when the enqueue is faulty (ie: incomplete google font urls )
317
+ * fixed the cache purge notifications not showing on wp-admin
318
+
319
+ = 2.4.6 [2018.12.05] =
320
+ * fixed a bug that could cause an error 500 if an enqueued CSS or JS file was not found
321
+ * added brotli_static support, if you have the php-ext-brotli extension installed - https://github.com/kjdev/php-ext-brotli
322
+
323
+ = 2.4.5 [2018.12.04] =
324
+ * fixed a bug, where it may show a warning during cache purge on wp-admin
325
+ * exclude footer FVM generated files from the HTTP header preload option (footer files are not in the critical path)
326
+
327
+ = 2.4.4 [2018.12.03] =
328
+ * added option to inline CSS in the footer, while still preserving the merged file in the header
329
+ * improvements for the google fonts merging option
330
+ * fixed double notification, when purging caches without a cache plugin
331
+
332
+ = 2.4.3 [2018.12.03] =
333
+ * added font-display, to ensure text remains visible during webfont load for inlined google fonts and font-awesome
334
+ * added automatic removal of "source mappings" from JS files during merging or minification
335
+ * added font awesome async and exclusion from PSI options, as well as merging and inlining when the url matches "font-awesome" (ie: cdnjs)
336
+ * added automatically inline of small CSS code (up to 20KB) for any FVM CSS files in the footer (requests reduction)
337
+ * added automatically inline of small CSS code (up to 20KB) for any FVM CSS files in the header, which are not of mediatype "all"
338
+ * improved the cache purge button (no more redirect from frontend to backend)
339
+ * updated PHP Minify and Path Converter from master
340
+ * bug fixes related to "Exclude JS files from PSI" option
341
+
342
+ = 2.4.2 [2018.11.29] =
343
+ * fixed a bug with the "Exclude JS files in the ignore list from PSI" option (it wasn't excluding properly)
344
+ * improved functionality with the "Exclude CSS files from PSI" option (now works with both inline and link stylesheets)
345
+ * added an option to automatically preload the CSS and JS files generated by FVM (beware that some server caches like Pantheon may push old css and js files even after purging caches on FVM)
346
+ * improved JavaScript minification
347
+
348
+ = 2.4.1 [2018.11.27] =
349
+ * better FVM default settings
350
+
351
+ = 2.4.0 [2018.11.26] =
352
+ * bug fixes related to the inline css option
353
+ * changed a few options and added better descriptions to the admin options
354
+
355
+ = 2.3.9 [2018.11.24] =
356
+ * there was an error on my end while pushing 2.3.8... this is a version bump
357
+
358
+ = 2.3.8 [2018.11.24] =
359
+ * removed the dynamic protocol in favour of auto detecting HTTP(s)
360
+ * fixed a bug where some CSS files were being removed with the latest CSS inline method
361
+ * fixed a bug where the wrong file path was being generated for fonts and some static assets (when the plugin or theme, uses relative paths and the Inline CSS option is enabled)
362
+
363
+ = 2.3.7 [2018.11.24] =
364
+ * bug fixes and performance improvements
365
+ * changed a few "options" location to other tabs
366
+ * changed the "Inline CSS" method to inline each file right separatly, instead of merging it and then inline it (also improves compatibility)
367
+ * added option to exclude JS and CSS files from PSI separatly (will load them Async, so make sure to read the instructions for each)
368
+ * added a dedicated Critical Path CSS for "is_front_page" (more conditionals on the roadmap)
369
+ * renamed some labels to be more explicit regardless of what they do
370
+
371
+ = 2.3.6 [2018.11.20] =
372
+ * added better header preloader and preconnect headers for css and js files
373
+ * added support to automatically purge the cache enabler plugin
374
+ * added option to reload the cache, while preserving the old static files
375
+ * added better default options after first install
376
+ * added and reorganized some options
377
+ * added a new developers tab
378
+ * removed the YUI compressor option (defaults to PHP Minify)
379
+ * readme and screenshots update
380
+ * tested up to WP 5.0 tag
381
+
382
+ = 2.3.5 [2018.08.27] =
383
+ * added thinkwithgoogle support for the defer for insights option
384
+ * added HyperCache support, thanks to @erich_k4wp
385
+ * added suport for wp_add_inline_script, thanks to @yuriipavlov
386
+ * fixed a bug where some inlined css was missing if not attached to a parent css file
387
+ * the ignore list now also supports CSS handle names (no JS yet)
388
+ * updated PHP Minify from master on github
389
+ * improved performance for gtmetrix tests
390
+
391
+ = 2.3.4 [2018.06.30] =
392
+ * bug fix
393
+
394
+ = 2.3.3 [2018.06.30] =
395
+ * added a check to prevent creating an empty js or css file
396
+ * added an option to force the CDN option when using the defer for insights option
397
+ * removed the alternative HTML minification method
398
+ * minor performance and bug fixes
399
+
400
+ = 2.3.2 [2018.06.03] =
401
+ * added some compatibility fixes when merging and minifying JS files
402
+ * added an option to enable an "FVM Purge" button on the admin bar
403
+ * moved all large transients (cached css or js code) to temporary disk files to reduce the database load
404
+
405
+ = 2.3.1 [2018.06.01] =
406
+ * bug fixes and performance tweaks for the "fix page editors" option
407
+
408
+ = 2.3.0 [2018.05.24] =
409
+ * added wp cli support for purge cache (usage: wp fvm purge)
410
+ * added wp cli support for getting the cache size (usage: wp fvm stats)
411
+
412
+ = 2.2.9 [2018.05.23] =
413
+ * fixed several bugs related to notices, css minification and file paths
414
+ * added more pcre.backtrack_limit and pcre.recursion_limit to avoid blank pages on some servers
415
+ * added new option to defer the ignore list for pagespeed
416
+
417
+ = 2.2.8 [2018.01.21] =
418
+ * rollback to 2.2.6 + bugfixes
419
+
420
+ = 2.2.7 [2018.02.19] =
421
+ * fixed a bug with the blacklist functionality
422
+ * replaced PHP Minify with JSMin as the default JS minification
423
+ * replaced PHP Minify with CSSTidy as the default CSS minification
424
+ * replaced PHP Minify with Minify HTML as the default HTML minification
425
+ * moved the intermediary cache from transients to disk files
426
+
427
+ = 2.2.6 [2018.01.06] =
428
+ * fixed a bug with html minification on some files that should not be minified
429
+ * fixed a bug with the defer for pagespeed insights
430
+ * updated the default blacklist (delete all entries and save again, to restore)
431
+
432
+ = 2.2.5 [2017.12.18] =
433
+ * fixed a fatal error reported on the support forum
434
+
435
+ = 2.2.4 [2017.12.17] =
436
+ * added custom cache directory and url support
437
+ * cleaned up some old unused code
438
+ * updated to the latest PHP Minify version
439
+ * added better descriptions and labels for some options
440
+ * added auto exclusion for js and css files when defer for pagespeed is enabled
441
+
442
+ = 2.2.3 [2017.12.16] =
443
+ * added robots.txt and ajax requests to the exclusion list
444
+ * added some cdn fixes
445
+ * added a new Pro tab
446
+ * added a global critical path css section
447
+ * added an option to dequeue all css files
448
+ * added an option to load CSS Async with LoadCSS (experimental)
449
+ * added an option to merge external resources together
450
+ * added the possibility to manage the default ignore list (reported files that cause conflicts when merged)
451
+ * added the possibility to manage the blacklist (files that cannot be merged with normal files)
452
+ * added better descriptions and labels for some options
453
+
454
+ = 2.2.2 [2017.11.12] =
455
+ * fixed the current cdn option box
456
+ * fixed some other minor bugs and notices
457
+ * added option to remove all enqueued google fonts (so you can use your own CSS @fontfaces manually)
458
+ * added font hinting for the "Inline Google Fonts CSS" option, so it looks better on Windows
459
+
460
+ = 2.2.1 [2017.08.21] =
461
+ * added unicode support to the alternative html minification option
462
+ * improved some options description
463
+
464
+ = 2.2.0 [2017.08.13] =
465
+ * fixed some debug notices
466
+ * fixed the alternative html minification option
467
+
468
+ = 2.1.9 [2017.08.11] =
469
+ * fixed a development bug
470
+
471
+ = 2.1.8 [2017.08.11] =
472
+ * fixed the html minification not working
473
+ * added support for the cdn enabler plugin (force http or https method)
474
+
475
+ = 2.1.7 [2017.07.17] =
476
+ * improved html minification speed and response time to the first byte
477
+ * fixed a random bug with the html minification library on large html pages (white pages)
478
+ * added support for the "Nginx Cache" plugin purge, by Till Krüss
479
+
480
+ = 2.1.6 [2017.07.17] =
481
+ * fixed a php notice in debug mode
482
+ * children styles (added with wp_add_inline_style) are now kept in order and merged together in place
483
+ * added faqs for possible "visual composer" issues
484
+
485
+ = 2.1.5 [2017.07.17] =
486
+ * css bug fixes and performance improvements
487
+ * added support for auto purging on WP Engine
488
+
489
+ = 2.1.4 [2017.07.14] =
490
+ * added compatibility with WP Engine.com and other providers that use a CNAME with their own subdomain
491
+
492
+ = 2.1.3 [2017.07.11] =
493
+ * updated PHP Minify for better compatibility
494
+ * added an alternative mode for html minification (because PHP Minify sometimes breaks things)
495
+ * css bug fixes and performance improvements
496
+
497
+ = 2.1.2 [2017.06.27] =
498
+ * fixed another error notice when debug mode is on
499
+
500
+ = 2.1.1 [2017.06.24] =
501
+ * fixed an error notice
502
+
503
+ = 2.1.0 [2017.06.21] =
504
+ * some performance improvements
505
+
506
+ = 2.0.9 [2017.06.01] =
507
+ * several bug and compatibility fixes
508
+
509
+ = 2.0.8 [2017.05.28] =
510
+ * fixed a notice alert on php for undefined function
511
+
512
+ = 2.0.7 [2017.05.28] =
513
+ * added support for auto purging of LiteSpeed Cache
514
+ * added support for auto purging on Godaddy Managed WordPress Hosting
515
+ * added the ie only blacklist, wich doesn't split merged files anymore, like the ignore list does
516
+ * added auto updates for the default ignore list and blacklist from our api once every 24 hours
517
+ * added cdn rewrite support for generated css and js files only
518
+ * removed url protocol rewrites and set default to dynamic "//" protocols
519
+ * updated the faqs
520
+
521
+ = 2.0.6 [2017.05.22] =
522
+ * added a "Troubleshooting" option to fix frontend editors for admin and editor level users
523
+ * updated the faqs
524
+
525
+ = 2.0.5 [2017.05.15] =
526
+ * fixed preserving the SVG namespace definition "http://www.w3.org/2000/svg" used on Bootstrap 4
527
+ * added some exclusions for Thrive and Visual Composer frontend preview and editors
528
+
529
+ = 2.0.4 [2017.05.15] =
530
+ * improved compatibility with Windows operating systems
531
+
532
+ = 2.0.3 [2017.05.15] =
533
+ * fixed an "undefined" notice
534
+
535
+ = 2.0.2 [2017.05.14] =
536
+ * improved compatibility on JS merging and minification
537
+
538
+ = 2.0.1 [2017.05.11] =
539
+ * fixed missing file that caused some errors on new installs
540
+
541
  = 2.0.0 [2017.05.11] =
542
+ * moved the css and js merging base code back to 1.4.3 because it was better for compatibility
543
+ * removed the font awesome optimization tweaks because people have multiple versions and requirements (but duplicate css and js files are always removed)
544
+ * added all usable improvements and features up to 1.5.2, except for the "Defer CSS" and "Critical Path" features (will consider for the future)
545
+ * added info to the FAQ's about our internal blacklist for known CSS or JS files that are always ignored by the plugin
546
+ * changed the way CSS and JS files are fetched and merged to make use of the new improvements that were supposed to be on 1.4.4+
547
+ * changed the advanced settings tab back to the settings page for quicker selection of options by the advanced users
548
+ * changed the cache purging option to also delete our plugin transients via the API, rather than just let them expire
549
+ * changed the "Inline all CSS" option into header and footer separately
550
 
551
  = 1.0 [2016.06.19] =
552
  * Initial Release