Fast Velocity Minify - Version 3.0.6

Version Description

[2021.01.01] = * Adjusted the HELP tab settings * Improved compatibility with CSS merging on WP Bakery

Download this release

Release Info

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

Code changes from version 3.0.5 to 3.0.6

Files changed (3) hide show
  1. fvm.php +1 -1
  2. layout/admin-layout-help.php +70 -30
  3. readme.txt +5 -1
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.0.5
10
  License: GPL2
11
 
12
  ------------------------------------------------------------------------
6
  Author: Raul Peixoto
7
  Author URI: http://fastvelocity.com
8
  Text Domain: fast-velocity-minify
9
+ Version: 3.0.6
10
  License: GPL2
11
 
12
  ------------------------------------------------------------------------
layout/admin-layout-help.php CHANGED
@@ -9,38 +9,56 @@
9
  <div>
10
  <p><strong>Notes:</strong></p>
11
  <p>JavaScript merging functionality went through a significant change on FVM 3 and it now requires manual configuration to work.</p>
12
- <p>If you are upgrading from FVM 2 please refer to the help section below, to understand how to reconfigure the plugin settings.</p>
13
- <p>Please note that this plugin is usually for advanced users and developers. If you just installed the plugin, please note that JS is not being optimized yet. You have to choose which files to be render blocking and which ones to be deferred, plus it's dependencies. </p>
14
- <p>Previously, FVM merged everything and relied on having options to filter out, or ignore scripts. This option frequently created issues after some plugin updates (most notably elementor, gravity forms and other plugins).</p>
15
- <p>The new method only merges what you tell it to merge, hence it's safer. Please understand, this plugin is and it has always been, aimed at advanced users and developers, so it's not meant to work fully without manual settings in place.</p>
16
- <p>On FVM 2 we were merging all scripts automatically which caused many scripts and plugins to stop working (we cannot test every single plugin). With the new method, you now have full control of your scripts.</p>
17
- <p>In addition, we now added a method to optimize third party scripts and load them on user interaction or automatically, after 5 seconds. This is a more recommended method to optimize scripts, as compared to FVM 2 which used document.write and other methods.</p>
18
  <p>Please refer to the JavaScript help section further down on this page to understand how you can optimize your scripts.</p>
19
  </div>
20
  <h3>Relevant CSS and Fonts changes</h3>
21
  <div>
22
  <p><strong>Notes:</strong></p>
23
- <p>You can now ignore, or completely remove CSS files by URI Path or domain name (such as google fonts or other unwanted CSS files).</p>
24
  <p>Known fonts, icon, animation and some other CSS files now have an option to be merged separately and loaded Async.</p>
25
- <p>The option to inline CSS has been removed because it's no longer best practice (unless your CSS is tiny), however FVM now preloads the external CSS files on the header.</p>
26
  </div>
27
  <h3>Relevant Cache changes</h3>
28
  <div>
29
  <p><strong>Notes:</strong></p>
30
- <p>Purging cache on FVM renames the cache directory path and file names in order to bypass CDN and Browser caches, however, expired css and js cache files are only deleted 24 hours after your last cache purge request.</p>
31
- <p>This is needed because some hosting services can cache your HTML regardless of your cache purge request. When this happens, your users are still seeing a cached version of your site, with references to the expired FVM CSS/JS files for a while longer, until their cache expires or you manually trigger a cache purge on your hosting or other page cache plugin. If we were to delete the FVM cached files right away, it would cause your layout to break in those situations, as the files would no longer exist.</p>
32
- <p>On FVM 3 you can now choose to purge the cache immediately, if you are sure no other page cache is going to do the above.</p>
33
  </div>
34
  <h3>Other changes</h3>
35
  <div>
36
  <p><strong>Notes:</strong></p>
37
- <p>CSS and JS files are now preloaded in the header by default.</p>
38
  <p>Preconnect and Preload Headers have been removed (please use your own PHP code and conditional tags for that).</p>
39
- <p>Critical Path CSS option has been removed (please use your own PHP code and conditional tags, or another plugin for that).</p>
40
  </div>
41
  </div>
42
 
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  <div style="height: 20px;"></div>
45
  <h2 class="title">HTML Settings</h2>
46
 
@@ -67,6 +85,11 @@
67
  <p>This options removes resource hints, generator tag, shortlinks, emoji, manifest link, etc from the HTML header.</p>
68
  <p>This is recommended because the head section, should be kept as lean as possible for the best TTFB response times and LCP metrics.</p>
69
  </div>
 
 
 
 
 
70
  </div>
71
 
72
 
@@ -83,8 +106,12 @@
83
  <div>
84
  <p><strong>Notes:</strong></p>
85
  <p>Although rare, it's possible that CSS minification may strip too much code thus breaking your styles.</p>
86
- <p>Also note, that if your theme or some plugin uses <code>@import</code> rules, they may be the reason for your styles to be broken.</p>
87
- <p>You can use this option to test if minification is the reason for your broken styles, but it won't do anything about your @import rules (remove the <code>@import</code> rules and enqueue them properly before using FVM).</p>
 
 
 
 
88
  </div>
89
  <h3>Remove "Print" stylesheets</h3>
90
  <div>
@@ -103,19 +130,18 @@
103
  <p>This will load the generated CSS files Async, however, without a manually added critical path code, you will likely see a Flash of Unstyled Content before that CSS finishes loading.</p>
104
  <p>Use your own PHP code or another plugin to add the critical path CSS code using conditional tags, filters, hooks or other method.</p>
105
  </div>
106
- <h3>CSS Ignore List</h3>
107
  <div>
108
  <p><strong>Notes:</strong></p>
109
  <p>You can use this option to prevent a certain CSS file from being merged, for example, when it breaks something when merged.</p>
110
  <p>This uses uses PHP stripos against the href attribute on the link tag, to decide if a CSS should be left alone or not.</p>
111
- <p>If you are having issues with a CSS file being merged, please make sure that the file being merged doesn't have any <code>@import</code> rules (remove and enqueue those files properly instead).</p>
112
- <p>This should be left empty if there are no CSS issues breaking your layout.</p>
113
  </div>
114
  <h3>Remove CSS files</h3>
115
  <div>
116
  <p><strong>Notes:</strong></p>
117
- <p>There may be situations, where you wish to remove some CSS file you are not using anywhere on the site, without editing the originating file.</p>
118
- <p>For example, you could remove google fonts, or the default Gutenberg CSS file enqueued by WordPress.</p>
119
  <p>You should still first try to remove it or dequeue it with PHP code, when possible.</p>
120
  </div>
121
  </div>
@@ -142,12 +168,18 @@
142
  <p>If your theme and plugins make use of modern standards and doesn't include outdated jQuery code, you can force the usage of the smaller jQuery 3 instead of the older, default WordPress jQuery.</p>
143
  <p>You must check your browser console log in incognito mode, for possible errors after enabling this feature. Sometimes there are no errors but some scripts may not work as well, so use this feature with care.</p>
144
  </div>
 
 
 
 
 
 
145
  <h3>Merge render blocking JS files in the header</h3>
146
  <div>
147
  <p><strong>Notes:</strong></p>
148
  <p>In most WordPress themes and for a significant amount of plugins, you need to render block jQuery and possibly other scripts.</p>
149
  <p>If you are a developer and are sure that there is no inlined code requiring jQuery to be defined earlier, then leave this section empty and add your scripts on the "Merge and Defer Scripts" section instead.</p>
150
- <p>It's important for speed, that you keep this section to a bare minimum, usually, jQuery and jQuery migrate.</p>
151
  <p>Some plugins such as gravity forms may also require to be render blocking, so you should look out for browser console log errors in incognito mode.</p>
152
  <p><strong>Recommended Default Settings:</strong></p>
153
  <p class="fvm-code-full">
@@ -185,20 +217,23 @@
185
  <p>You must check your browser console log in incognito mode, for possible errors after enabling this feature, and either move them to the header, remove them from this list (be more specific with paths so it doesn't match certain files), or use the Inline JavaScript Dependencies to force inline scripts to wait for this file to load.</p>
186
  <p>This is empty by default, unless you determine that it's needed (the plugin is for advanced users and developers, so you need to debug yourself).</p>
187
  </div>
188
- <h3>Execute third party inline scripts after user interaction</h3>
189
  <div>
190
  <p><strong>Notes:</strong></p>
191
  <p>Scripts like analytics, ads, tracking codes, etc, consume important CPU and Network resources needed for the initial pageview.</p>
192
  <p>This option uses PHP stripos against the script <code>innerHTML</code> or <code>src</code> attribute for async/defer scripts.</p>
193
  <p>It will delay the specified script execution until the user interacts with the page, on the first <code>'mouseover','keydown','touchmove','touchstart'</code> event, or <code>up to 5 seconds after page load</code>(whichever happens first).</p>
194
- <p>Most Async and Defer scripts can be rewritten to support this feature with the <code>HTML DOM createElement() Method</code>, however, note that if you blindly use this method for render blocking scripts, it may trigger "undefined" errors on the browser console log or some elements may stop working (some scripts only work in render blocking mode).</p>
 
195
  <p>If you have render blocking third party scripts, ask your provider if they can provide you with an async implementation (else remove them, because render blocking scripts are not recommended for speed).</p>
196
  <p><strong>Example Settings:</strong></p>
197
  <p class="fvm-code-full">
198
  function(w,d,s,l,i)<br>
199
  function(f,b,e,v,n,t,s)<br>
200
  function(h,o,t,j,a,r)<br>
201
- www.googletagmanager.com/gtm.js
 
 
202
  </p>
203
  </div>
204
  <h3>Remove JavaScript Scripts</h3>
@@ -263,12 +298,6 @@
263
  <h2 class="title">Cache Settings</h2>
264
 
265
  <div class="accordion">
266
- <h3>Instant Cache Purge</h3>
267
- <div>
268
- <p><strong>Notes:</strong></p>
269
- <p>This option should be disabled when your hosting or server is doing page cache without integration with FVM.</p>
270
- <p>If you enable this option and FVM doesn't have integration with your hosting or cache plugin, your HTML page will still be pointing to your (now deleted) generated JS/CSS files, resulting in a broken layout for your anonymous users until your page cache expires or is manually purged.</p>
271
- </div>
272
  <h3>Public Cache Path</h3>
273
  <div>
274
  <p><strong>Notes:</strong></p>
@@ -283,6 +312,17 @@
283
  </div>
284
  </div>
285
 
 
 
 
 
 
 
 
 
 
 
 
286
 
287
 
288
 
9
  <div>
10
  <p><strong>Notes:</strong></p>
11
  <p>JavaScript merging functionality went through a significant change on FVM 3 and it now requires manual configuration to work.</p>
12
+ <p>If you are upgrading from FVM 2 please refer to the help section below, to understand how to reconfigure each plugin setting.</p>
13
+ <p>If you just installed the plugin, please note that JS is not being optimized yet. You have to choose which files to be render blocking and which ones to be deferred, plus it's dependencies (if any). </p>
14
+ <p>Previously, FVM merged everything and relied on having options to ignore scripts. This option frequently created issues with other plugin updates, when they changed something JavaScript related.</p>
15
+ <p>Please understand that this plugin is and it has always been aimed at being a tool for advanced users and developers, so it's not meant just be plug and play, without manual settings in place.</p>
16
+ <p>There is a new method to optimize third party scripts and load them on user interaction or automatically, after 5 seconds. This is a more recommended method to optimize scripts, as compared to FVM 2 which used document.write and other deprecated methods.</p>
 
17
  <p>Please refer to the JavaScript help section further down on this page to understand how you can optimize your scripts.</p>
18
  </div>
19
  <h3>Relevant CSS and Fonts changes</h3>
20
  <div>
21
  <p><strong>Notes:</strong></p>
22
+ <p>You can now ignore or completely remove CSS files by URI Path or domain name (such as google fonts or other unwanted CSS files).</p>
23
  <p>Known fonts, icon, animation and some other CSS files now have an option to be merged separately and loaded Async.</p>
24
+ <p>FVM now preloads the external CSS files on the header, before render blocking them later on the page.</p>
25
  </div>
26
  <h3>Relevant Cache changes</h3>
27
  <div>
28
  <p><strong>Notes:</strong></p>
29
+ <p>Purging cache on FVM, renames the file name in order to bypass CDN and browser cache, however, expired CSS and JS cache files are only deleted 24 hours (by default) after your last cache purge request.</p>
30
+ <p>This is needed because some hosting services can cache your HTML regardless of your cache purge request. If we were to delete the FVM cached files right away, it would break your layout for anonymous users, as the files would no longer exist but your page would still be referencing them.</p>
 
31
  </div>
32
  <h3>Other changes</h3>
33
  <div>
34
  <p><strong>Notes:</strong></p>
 
35
  <p>Preconnect and Preload Headers have been removed (please use your own PHP code and conditional tags for that).</p>
36
+ <p>Critical Path CSS option has been removed (add your own code with code and <code>&lt;style id=&quot;critical-path&quot;&gt;</code> your code &lt;/style&gt; ).</p>
37
  </div>
38
  </div>
39
 
40
 
41
+ <div style="height: 20px;"></div>
42
+ <h2 class="title">Global Settings</h2>
43
+
44
+ <div class="accordion">
45
+ <h3>Purge Minified CSS/JS files instantly</h3>
46
+ <div>
47
+ <p><strong>Notes:</strong></p>
48
+ <p>If your hosting has no page cache enabled, you can force the plugin to immediately purge it's cache files instead of waiting for 24 hours before deletion.</p>
49
+ </div>
50
+ <h3>Preserve settings on uninstall</h3>
51
+ <div>
52
+ <p><strong>Notes:</strong></p>
53
+ <p>When you are testing things, sometimes you may want to preserve all FVM settings when you uninstall or delete the plugin.</p>
54
+ </div>
55
+ <h3>Force HTTPS urls on merged files</h3>
56
+ <div>
57
+ <p><strong>Notes:</strong></p>
58
+ <p>This will make sure that when FVM generates a CSS and JS file, that it's linked on your page with https.</p>
59
+ </div>
60
+ </div>
61
+
62
  <div style="height: 20px;"></div>
63
  <h2 class="title">HTML Settings</h2>
64
 
85
  <p>This options removes resource hints, generator tag, shortlinks, emoji, manifest link, etc from the HTML header.</p>
86
  <p>This is recommended because the head section, should be kept as lean as possible for the best TTFB response times and LCP metrics.</p>
87
  </div>
88
+ <h3>Remove Emoji</h3>
89
+ <div>
90
+ <p><strong>Notes:</strong></p>
91
+ <p>This will remove the default emoji scripts from wordpress, thus reducing the amount of code during page loading.</p>
92
+ </div>
93
  </div>
94
 
95
 
106
  <div>
107
  <p><strong>Notes:</strong></p>
108
  <p>Although rare, it's possible that CSS minification may strip too much code thus breaking your styles.</p>
109
+ </div>
110
+ <h3>Disable Merging and Inline all CSS</h3>
111
+ <div>
112
+ <p><strong>Notes:</strong></p>
113
+ <p>If your total CSS code is very small (under 25 Kb uncompressed), it's recommended to inline all CSS.</p>
114
+ <p>If your CSS files combined are large, inlining it will delay the time needed for the first byte, as you are forcing the server to compress the HTML and the CSS on the same process.</p>
115
  </div>
116
  <h3>Remove "Print" stylesheets</h3>
117
  <div>
130
  <p>This will load the generated CSS files Async, however, without a manually added critical path code, you will likely see a Flash of Unstyled Content before that CSS finishes loading.</p>
131
  <p>Use your own PHP code or another plugin to add the critical path CSS code using conditional tags, filters, hooks or other method.</p>
132
  </div>
133
+ <h3>Ignore CSS files</h3>
134
  <div>
135
  <p><strong>Notes:</strong></p>
136
  <p>You can use this option to prevent a certain CSS file from being merged, for example, when it breaks something when merged.</p>
137
  <p>This uses uses PHP stripos against the href attribute on the link tag, to decide if a CSS should be left alone or not.</p>
138
+ <p>This should be empty by default, and only used strictly when a CSS being merged is breaking the page layout.</p>
 
139
  </div>
140
  <h3>Remove CSS files</h3>
141
  <div>
142
  <p><strong>Notes:</strong></p>
143
+ <p>If you wish to remove a CSS file from the frontend without editing code or using other settings, you can use this option.</p>
144
+ <p>For example, you can remove google fonts link tags, or the default Gutenberg CSS file enqueued by WordPress.</p>
145
  <p>You should still first try to remove it or dequeue it with PHP code, when possible.</p>
146
  </div>
147
  </div>
168
  <p>If your theme and plugins make use of modern standards and doesn't include outdated jQuery code, you can force the usage of the smaller jQuery 3 instead of the older, default WordPress jQuery.</p>
169
  <p>You must check your browser console log in incognito mode, for possible errors after enabling this feature. Sometimes there are no errors but some scripts may not work as well, so use this feature with care.</p>
170
  </div>
171
+ <h3>Ignore Script Files</h3>
172
+ <div>
173
+ <p><strong>Notes:</strong></p>
174
+ <p>When you are adding a lot of JS files to consider, it may be more convenient to add the default recommended paths and exclude individual files.</p>
175
+ <p>This should be empty by default, and only used strictly when a CSS being merged is breaking the page layout.</p>
176
+ </div>
177
  <h3>Merge render blocking JS files in the header</h3>
178
  <div>
179
  <p><strong>Notes:</strong></p>
180
  <p>In most WordPress themes and for a significant amount of plugins, you need to render block jQuery and possibly other scripts.</p>
181
  <p>If you are a developer and are sure that there is no inlined code requiring jQuery to be defined earlier, then leave this section empty and add your scripts on the "Merge and Defer Scripts" section instead.</p>
182
+ <p>It's important for speed, that you keep this section to a bare minimum, usually, jQuery and jQuery migrate only.</p>
183
  <p>Some plugins such as gravity forms may also require to be render blocking, so you should look out for browser console log errors in incognito mode.</p>
184
  <p><strong>Recommended Default Settings:</strong></p>
185
  <p class="fvm-code-full">
217
  <p>You must check your browser console log in incognito mode, for possible errors after enabling this feature, and either move them to the header, remove them from this list (be more specific with paths so it doesn't match certain files), or use the Inline JavaScript Dependencies to force inline scripts to wait for this file to load.</p>
218
  <p>This is empty by default, unless you determine that it's needed (the plugin is for advanced users and developers, so you need to debug yourself).</p>
219
  </div>
220
+ <h3>Execute matching third party scripts after user interaction</h3>
221
  <div>
222
  <p><strong>Notes:</strong></p>
223
  <p>Scripts like analytics, ads, tracking codes, etc, consume important CPU and Network resources needed for the initial pageview.</p>
224
  <p>This option uses PHP stripos against the script <code>innerHTML</code> or <code>src</code> attribute for async/defer scripts.</p>
225
  <p>It will delay the specified script execution until the user interacts with the page, on the first <code>'mouseover','keydown','touchmove','touchstart'</code> event, or <code>up to 5 seconds after page load</code>(whichever happens first).</p>
226
+ <p>FVM will delay most Async and Defer scripts, a well as inline code matching these settings.</p>
227
+ <p>You can rewrite most scripts to support this feature by adding the Async or Defer attribute, however, note that if you blindly use this method for render blocking scripts, it may trigger "undefined" errors on the browser console log or some elements may stop working (some scripts only work in render blocking mode).</p>
228
  <p>If you have render blocking third party scripts, ask your provider if they can provide you with an async implementation (else remove them, because render blocking scripts are not recommended for speed).</p>
229
  <p><strong>Example Settings:</strong></p>
230
  <p class="fvm-code-full">
231
  function(w,d,s,l,i)<br>
232
  function(f,b,e,v,n,t,s)<br>
233
  function(h,o,t,j,a,r)<br>
234
+ www.googletagmanager.com/gtm.js<br>
235
+ gtag(<br>
236
+ fbq(<br>
237
  </p>
238
  </div>
239
  <h3>Remove JavaScript Scripts</h3>
298
  <h2 class="title">Cache Settings</h2>
299
 
300
  <div class="accordion">
 
 
 
 
 
 
301
  <h3>Public Cache Path</h3>
302
  <div>
303
  <p><strong>Notes:</strong></p>
312
  </div>
313
  </div>
314
 
315
+ <div style="height: 20px;"></div>
316
+ <h2 class="title">User Settings</h2>
317
+
318
+ <div class="accordion">
319
+ <h3>User Options</h3>
320
+ <div>
321
+ <p><strong>Notes:</strong></p>
322
+ <p>This will allow you to force CSS, HTML and JS processing for specific user roles.</p>
323
+ <p>By default, only anonymous users should be optimized, to ensure that there is nothing broken for logged in users (unless you know what you are doing).</p>
324
+ </div>
325
+ </div>
326
 
327
 
328
 
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: 4.7
5
  Requires PHP: 5.6
6
- Stable tag: 3.0.5
7
  Tested up to: 5.6
8
  Text Domain: fast-velocity-minify
9
  License: GPLv3 or later
@@ -55,6 +55,10 @@ Version 3.0 is a major code rewrite to improve JS and CSS merging, but it requir
55
 
56
  == Changelog ==
57
 
 
 
 
 
58
  = 3.0.5 [2021.01.01] =
59
  * Fixed the cache paths on Windows Servers
60
  * Fixed incorrect paths on subdirectory sites
3
  Tags: PHP Minify, Lighthouse, GTmetrix, Pingdom, Pagespeed, Merging, Minification, Optimization, Speed, Performance, FVM
4
  Requires at least: 4.7
5
  Requires PHP: 5.6
6
+ Stable tag: 3.0.6
7
  Tested up to: 5.6
8
  Text Domain: fast-velocity-minify
9
  License: GPLv3 or later
55
 
56
  == Changelog ==
57
 
58
+ = 3.0.6 [2021.01.01] =
59
+ * Adjusted the HELP tab settings
60
+ * Improved compatibility with CSS merging on WP Bakery
61
+
62
  = 3.0.5 [2021.01.01] =
63
  * Fixed the cache paths on Windows Servers
64
  * Fixed incorrect paths on subdirectory sites