Changeset 2030895
- Timestamp:
- 02/14/2019 10:44:00 PM (7 years ago)
- Location:
- mc-w3tc-minify-helper/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (4 diffs)
-
w3tc-minify-helper.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mc-w3tc-minify-helper/trunk/readme.txt
r2030817 r2030895 1 1 === W3TC Minify Helper === 2 2 Contributors: Magenta Cuda 3 Tags: W3TC, minify 3 Tags: W3TC, minify, JavaScript 4 4 Requires at least: 5.0 5 5 Tested up to: 5.0 6 Stable tag: 1.0 6 Stable tag: 1.0.0.1 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 13 13 == Description == 14 14 15 This is a helper plugin for the W3 Total Cache plugin. It generates a W3TC 16 JSON configuration file that can be imported into W3TC. 15 This is a helper plugin for the W3 Total Cache plugin. It generates a W3TC JSON configuration file that can be imported into W3TC. 17 16 18 The W3TC auto minify mode does not work on my web site. The problem 19 is the order of the JavaScript files using the auto minify mode is different 20 from the order without minification. This results in undefined JavaScript 21 function errors. W3TC has a help tool for manually setting the order of 22 JavaScript files. I think this tool is tiresome to use. I just want to have 23 the same order as without minification. So, I wrote this plugin to do this. 17 The W3TC auto minify mode does not work on my web site. The problem is the order of the JavaScript files using the auto minify mode is different from the order without minification. This results in undefined JavaScript function errors. W3TC has a help tool for manually setting the order of JavaScript files. I think this tool is tiresome to use. I just want to have the same order as without minification. So, I wrote this plugin to do this. 24 18 25 Every view of a web page sets the ordered list of JavaScript files of the 26 template of that web page. If this ordered list has changed a new W3TC 27 configuration file is generated by modifying the value of the field 28 'minify.js.groups' of the current W3TC configuration to be compatible with 29 the new ordered list of JavaScript files for that template. This process is 30 cumulative so after viewing a representative web page for each template a 31 complete W3TC configuration file will be built. Further, if the ordered list 32 of JavaScript files for a template changes then this will also build a new 33 compatible W3TC configuration file. N.B. - W3TC assumes that the ordered list 34 of JavaScript files for a template is fixed. If your web pages are dynamically 35 computing the JavaScript files and two different web pages using the same 36 template compute different lists of JavaScript files then W3TC cannot be used to 37 minify those JavaScript files. N.B. - W3TC in manual minify mode only sees the 38 template files in the theme directories. However, using the 'template_include' 39 filter a plugin can force WordPress to load a template in the plugin's directory 40 instead of a template in the theme's directory. W3TC in manual minify mode 41 cannot be used minify the JavaScript files of templates in plugin directories. 19 This plugin needs to learn about the JavaScript files that your website uses. Every view of a web page sets the ordered list of JavaScript files for the template of that web page. If this ordered list has changed a new W3TC configuration file is generated by modifying the value of the field 'minify.js.groups' of the current W3TC configuration to be compatible with the new ordered list of JavaScript files for that template. This process is cumulative so after viewing a representative web page for each template a complete W3TC configuration file will be generated. Further, if some time later the ordered list of JavaScript files for a template changes then this will also generate a new compatible W3TC configuration file. 20 21 N.B. - W3TC assumes that the ordered list of JavaScript files for a template is fixed. If your web pages are dynamically computing the JavaScript files and two different web pages using the same template compute different lists of JavaScript files then W3TC cannot be used to minify those JavaScript files. Also, W3TC in manual minify mode only sees the template files in the active theme directory. However, using the 'template_include' filter a plugin can force WordPress to load a template in the plugin's directory instead of a template in the theme's directory. W3TC in manual minify mode cannot be used minify the JavaScript files of templates in plugin directories. 42 22 43 This generated JSON configuration file can be downloaded and further edited to 44 fine tune the minify process and imported back into W3TC. The download link is 45 on the "Installed Plugins" admin page after the "Deactivate" link. But, before 46 you import this new configuration file into W3TC, you should download the 47 current configuration of W3TC so that you can restore the current configuration 48 if the new configuration does not work. Also, before importing the new 49 configuration file into W3TC you should diff the new configuration file against 50 the current configuration file of W3TC to verify that the new configuration file 51 has no obvious errors. You should also verify that you have a complete 52 configuration by viewing the 'minify.js.groups' section and checking that there 53 is an entry for each of your templates. N.B. - W3TC "Minify mode" must be set to 54 "Manual" for W3TC to use the ordered list of JavaScript files generated by this 23 The new JSON configuration file generated by this plugin can be downloaded, further edited to fine tune the minify process and imported back into W3TC. The download link is on the "Installed Plugins" admin page after the "Deactivate" link. But, before you import this new configuration file into W3TC, you should download the current configuration of W3TC so that you can restore the current configuration if the new configuration does not work. Also, before importing the new configuration file into W3TC you should diff the new configuration file against the current configuration file to verify that the new configuration file has no obvious errors. You should also verify that you have a complete configuration by viewing the 'minify.js.groups' section and checking that there is an entry for each of your templates. 24 25 N.B. - W3TC "Minify mode" must be set to "Manual" for W3TC to use the ordered list of JavaScript files generated by this 55 26 plugin. 56 27 … … 80 51 == Changelog == 81 52 53 = 1.0.0.1 = 54 * Reformat the readme.txt 55 82 56 = 1.0 = 83 57 * Initial … … 85 59 == Upgrade Notice == 86 60 61 = 1.0.0.1 = 62 * Reformat the readme.txt 63 87 64 = 1.0 = 88 65 * Initial -
mc-w3tc-minify-helper/trunk/w3tc-minify-helper.php
r2030817 r2030895 3 3 * Plugin Name: W3TC Minify Helper 4 4 * Description: record the sent order of the JavaScript files and use this to create a W3TC Minify configuration 5 * Version: 1.0 5 * Version: 1.0.0.1 6 6 * Plugin URI: http://magentacuda.com/an-alternate-way-to-set-w3tc-minify-file-order/ 7 7 * Author: Magenta Cuda
Note: See TracChangeset
for help on using the changeset viewer.