WebP Express - Version 0.7.1

Version Description

Fixed minor "bug". The Api version combobox in Remote WebP Express converter was showing on new sites, but I only want it to show when old api is being used.

Download this release

Release Info

Developer rosell.dk
Plugin Icon 128x128 WebP Express
Version 0.7.1
Comparing to
See all releases

Code changes from version 0.7.0 to 0.7.1

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.bitwise-it.dk/contact
4
  Tags: webp, images, performance
5
  Requires at least: 4.0
6
  Tested up to: 4.9
7
- Stable tag: 0.7.0
8
  Requires PHP: 5.6
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -17,7 +17,7 @@ Almost 4 out of 5 mobile users use a browser that is able to display webp images
17
 
18
  The plugin basically routes jpeg/png images to an image converter, or - if the image converter has already converted the image - directly to a converted image. The approach has the benefit that is works regardless of how an image found its way into your server - be it Media Library, Galleries, or even theme images referenced with CSS.
19
 
20
- The plugin builds on [WebPConvert](https://github.com/rosell-dk/webp-convert) and its "WebP On Demand" solution described [here](https://github.com/rosell-dk/webp-convert/blob/master/docs/webp-on-demand/webp-on-demand.md)
21
 
22
  #### Benefits
23
  - Much faster load time for images in blink based browsers such as Chrome and Opera (accounting for ~73% of all traffic, according to [caniuse.com](https://caniuse.com/webp)). The converted images are typically *less than half the size* (for jpeg), while maintaining the same quality. Bear in mind that for most web sites, images are responsible for the largest part of the waiting time.
@@ -70,6 +70,10 @@ The plugin has not been tested in multisite configurations. It's on the roadmap.
70
  * The plugin has not been tested with multisite installation (it is on the roadmap!).
71
  * There might be compatability issues with other plugins. For example .htaccess rules from other plugins might interfere. Please report if you discover any problems!
72
 
 
 
 
 
73
  == Frequently Asked Questions ==
74
 
75
  = Why do I not see the option to set WebP quality to auto? =
@@ -85,18 +89,64 @@ https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation/List_of_de
85
  = How do I donate? =
86
  Putting this question in the "frequently" asked questions section is of course some mixture of humour, sarcasm and wishful thinking. In case there really is someone out there wanting to donate, you can simply write to me, and we can arrange. My contact information is available here https://www.bitwise-it.dk/contact. I have paypal, mobilepay and of course an ordinary bank account.
87
 
 
88
  == Screenshots ==
89
 
90
  1. WebP Express settings
91
 
92
  == Changelog ==
93
 
 
 
 
94
  = 0.7.0 =
95
  This version added option to provide conversion service to other sites!
96
 
97
  For more info, see the closed issues on the 0.7.0 milestone on the github repository: https://github.com/rosell-dk/webp-express/issues?q=is%3Aclosed+milestone%3A0.7.0
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  == Upgrade Notice ==
100
 
101
- = 0.7.0 =
102
  This version added option to provide conversion service to other sites!
4
  Tags: webp, images, performance
5
  Requires at least: 4.0
6
  Tested up to: 4.9
7
+ Stable tag: 0.7.1
8
  Requires PHP: 5.6
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
17
 
18
  The plugin basically routes jpeg/png images to an image converter, or - if the image converter has already converted the image - directly to a converted image. The approach has the benefit that is works regardless of how an image found its way into your server - be it Media Library, Galleries, or even theme images referenced with CSS.
19
 
20
+ The plugin is developed on [github](https://github.com/rosell-dk/webp-express/). It builds upon the [WebPConvert](https://github.com/rosell-dk/webp-convert) library and the "WebP On Demand" solution described [here](https://github.com/rosell-dk/webp-convert/blob/master/docs/webp-on-demand/webp-on-demand.md)
21
 
22
  #### Benefits
23
  - Much faster load time for images in blink based browsers such as Chrome and Opera (accounting for ~73% of all traffic, according to [caniuse.com](https://caniuse.com/webp)). The converted images are typically *less than half the size* (for jpeg), while maintaining the same quality. Bear in mind that for most web sites, images are responsible for the largest part of the waiting time.
70
  * The plugin has not been tested with multisite installation (it is on the roadmap!).
71
  * There might be compatability issues with other plugins. For example .htaccess rules from other plugins might interfere. Please report if you discover any problems!
72
 
73
+ == Relax-ware ==
74
+ If you enjoy this software, feel free to take the rest of the day off.
75
+ Well, why not? You have probably deserved it.
76
+
77
  == Frequently Asked Questions ==
78
 
79
  = Why do I not see the option to set WebP quality to auto? =
89
  = How do I donate? =
90
  Putting this question in the "frequently" asked questions section is of course some mixture of humour, sarcasm and wishful thinking. In case there really is someone out there wanting to donate, you can simply write to me, and we can arrange. My contact information is available here https://www.bitwise-it.dk/contact. I have paypal, mobilepay and of course an ordinary bank account.
91
 
92
+
93
  == Screenshots ==
94
 
95
  1. WebP Express settings
96
 
97
  == Changelog ==
98
 
99
+ = 0.7.1 =
100
+ Fixed minor "bug". The Api version combobox in Remote WebP Express converter was showing on new sites, but I only want it to show when old api is being used.
101
+
102
  = 0.7.0 =
103
  This version added option to provide conversion service to other sites!
104
 
105
  For more info, see the closed issues on the 0.7.0 milestone on the github repository: https://github.com/rosell-dk/webp-express/issues?q=is%3Aclosed+milestone%3A0.7.0
106
 
107
+ = 0.6.0 =
108
+ This version added option for setting caching header, fixed a serious issue with *Imagick*, added a new converter, *Gmagick*, added a great deal of options to *Cwebp* and generally improved the interface.
109
+
110
+ * Added option for caching
111
+ * Fixed long standing and serious issue with Imagick converter. It no longer generates webp images in poor quality
112
+ * Added gmagick as a new conversion method
113
+ * WebPExpress now runs on newly released WebP-Convert 1.2.0
114
+ * Added many new options for *cwebp*
115
+ * You can now quickly see converter status by hovering over a converter
116
+ * You can now choose between having quality auto-detected or not (if the server supports detecting quality).
117
+ * If the server does not support detecting quality, the WPC converter will display a quality "auto" option
118
+ * Added special intro message for those who has no working conversion methods
119
+ * Added help texts for options
120
+ * Settings are now saved, when changing converter options. Too many times, I found myself forgetting to save...
121
+
122
+ For more info, see the closed issues on the 0.6.0 milestone on our github repository: https://github.com/rosell-dk/webp-express/issues?q=is%3Aclosed+milestone%3A0.6.0
123
+
124
+ = 0.5.0 =
125
+ This version works on many more setups than the previous. Also uses less resources and handles when images are changed.
126
+
127
+ * Configuration is now stored in a separate configuration file instead of storing directly in the *.htaccess* file and passing it on via query string. When updating, these settings are migrated automatically.
128
+ * Handles setups where Wordpress has been given its own directory (both methods mentioned [here](https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory))
129
+ * Handles setups where *wp-content* has been moved, even out of Wordpress root.
130
+ * Handles setups where Uploads folder has been moved, even out of *wp-content*.
131
+ * Handles setups where Plugins folder has been moved, even out of *wp-content* or out of Wordpress root
132
+ * Is not as likely to be subject to firewalls blocking requests (in 0.4.0, we passed all options in a querystring, and that could trigger firewalls under some circumstances)
133
+ * Is not as likely to be subject to rewrite rules from other plugins interfering. WebP Express now stores the .htaccess in the wp-content folder (if you allow it). As this is deeper than the root folder, the rules in here takes precedence over rules in the main *.htaccess*
134
+ * The *.htaccess* now passes the complete absulute path to the source file instead of a relative path. This is a less error-prone method.
135
+ * Reconverts the webp, if source image has changed
136
+ * Now runs on version 1.0.0 of [WebP On Demand](https://github.com/rosell-dk/webp-on-demand). Previously ran on 0.3.0
137
+ * Now takes care of only loading the PHP classes when needed in order not to slow down your Wordpress. The frontend will only need to process four lines of code. The backend footprint is also quite small now (80 lines of code of hooks)
138
+ * Now works in Wordpress 4.0 - 4.6.
139
+ * Added cache-breaking tokens to image test links
140
+ * Denies deactivation if rewrite rules could not be removed
141
+ * Refactored thoroughly
142
+ * More helpful texts.
143
+ * Extensive testing. Tested on Wordpress 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8 and 4.9. Tested with PHP 5.6, PHP 7.0 and PHP 7.1. Tested on Apache and LiteSpeed. Tested when missing various write permissions. Tested migration. Tested when installed in root, in subfolder, when Wordpress has its own directory (both methods), when wp-content is moved out of Wordpress directory, when plugins is moved out of Wordpress directory, when both of them are moved and when uploads have been moved.
144
+
145
+ For more info, see the closed issues on the 0.5.0 milestone on our github repository: https://github.com/rosell-dk/webp-express/milestone/2?closed=1
146
+
147
+ For older releases, check out changelog.txt
148
+
149
  == Upgrade Notice ==
150
 
151
+ = 0.7.1 =
152
  This version added option to provide conversion service to other sites!
changelog.txt CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  = 0.6.0 =
2
  This version added option for setting caching header, fixed a serious issue with *Imagick*, added a new converter, *Gmagick*, added a great deal of options to *Cwebp* and generally improved the interface.
3
 
1
+ = 0.7.1 =
2
+ Fixed minor "bug". The Api version combobox in Remote WebP Express converter was showing on new sites, but I only want it to show when old api is being used.
3
+
4
+ = 0.7.0 =
5
+ This version added option to provide conversion service to other sites!
6
+
7
+ For more info, see the closed issues on the 0.7.0 milestone on the github repository: https://github.com/rosell-dk/webp-express/issues?q=is%3Aclosed+milestone%3A0.7.0
8
+
9
  = 0.6.0 =
10
  This version added option for setting caching header, fixed a serious issue with *Imagick*, added a new converter, *Gmagick*, added a great deal of options to *Cwebp* and generally improved the interface.
11
 
lib/classes/ConvertersHelper.php CHANGED
@@ -17,7 +17,7 @@ class ConvertersHelper
17
  ]],
18
  ['converter' => 'imagick'],
19
  ['converter' => 'gmagick'],
20
- ['converter' => 'wpc', 'options' => ['quality' => 'auto']],
21
  ['converter' => 'ewww'],
22
  ];
23
 
17
  ]],
18
  ['converter' => 'imagick'],
19
  ['converter' => 'gmagick'],
20
+ ['converter' => 'wpc', 'options' => ['quality' => 'auto']], // we should not set api-version default - it is handled in the javascript
21
  ['converter' => 'ewww'],
22
  ];
23
 
lib/options/enqueue_scripts.php CHANGED
@@ -9,7 +9,7 @@ wp_enqueue_script('sortable');
9
  wp_register_script('daspopup', plugins_url('js/das-popup.js', __FILE__), [], '0.7.0-dev5');
10
  wp_enqueue_script('daspopup');
11
 
12
- wp_register_script('converters', plugins_url('js/converters.js', __FILE__), ['sortable','daspopup'], '0.7.0-dev21');
13
  wp_enqueue_script('converters');
14
 
15
  wp_register_script('whitelist', plugins_url('js/whitelist.js', __FILE__), ['daspopup'], '0.7.0-dev15');
9
  wp_register_script('daspopup', plugins_url('js/das-popup.js', __FILE__), [], '0.7.0-dev5');
10
  wp_enqueue_script('daspopup');
11
 
12
+ wp_register_script('converters', plugins_url('js/converters.js', __FILE__), ['sortable','daspopup'], '0.7.0-dev24');
13
  wp_enqueue_script('converters');
14
 
15
  wp_register_script('whitelist', plugins_url('js/whitelist.js', __FILE__), ['daspopup'], '0.7.0-dev15');
lib/options/js/converters.js CHANGED
@@ -207,6 +207,13 @@ function wpe_addCloudConverter(converter) {
207
 
208
  }
209
 
 
 
 
 
 
 
 
210
  function getConverterOption(converter, optionName, defaultValue) {
211
  if ((converter['options'] == undefined) || (converter['options'][optionName] == undefined)) {
212
  return defaultValue;
@@ -269,6 +276,17 @@ function configureConverter(id) {
269
  }
270
 
271
  apiVersion = getConverterOption(converter, 'api-version', 0);
 
 
 
 
 
 
 
 
 
 
 
272
  document.getElementById('wpc_api_version').value = apiVersion.toString();
273
 
274
  if (apiVersion != 0) {
@@ -284,6 +302,7 @@ function configureConverter(id) {
284
 
285
  document.getElementById('wpc_crypt_api_key_in_transfer').checked = getConverterOption(converter, 'crypt-api-key-in-transfer', true);
286
 
 
287
  wpcApiVersionChanged();
288
 
289
  //document.getElementById('wpc_secret').value = getConverterOption(converter, 'secret', '');
207
 
208
  }
209
 
210
+ function isConverterOptionSet(converter, optionName) {
211
+ if ((converter['options'] == undefined) || (converter['options'][optionName] == undefined)) {
212
+ return false;
213
+ }
214
+ return true;
215
+ }
216
+
217
  function getConverterOption(converter, optionName, defaultValue) {
218
  if ((converter['options'] == undefined) || (converter['options'][optionName] == undefined)) {
219
  return defaultValue;
276
  }
277
 
278
  apiVersion = getConverterOption(converter, 'api-version', 0);
279
+
280
+ // if api version isn't set, then either
281
+ // - It is running on old api 0. In that case, URL is set
282
+ // - Wpc has never been configured. In that case, URL is not set,
283
+ // and we should not mention api 0 (we should set apiVersion to 1)
284
+ if (!isConverterOptionSet(converter, 'api-version')) {
285
+ if (getConverterOption(converter, 'url', '') == '') {
286
+ apiVersion = 1;
287
+ }
288
+ }
289
+
290
  document.getElementById('wpc_api_version').value = apiVersion.toString();
291
 
292
  if (apiVersion != 0) {
302
 
303
  document.getElementById('wpc_crypt_api_key_in_transfer').checked = getConverterOption(converter, 'crypt-api-key-in-transfer', true);
304
 
305
+ // Hide/show the fields for the api version
306
  wpcApiVersionChanged();
307
 
308
  //document.getElementById('wpc_secret').value = getConverterOption(converter, 'secret', '');
lib/options/page.php CHANGED
@@ -591,7 +591,7 @@ echo '<ul id="converters" style="margin-top: -13px"></ul>';
591
  <div id="wpc_api_version_div">
592
  <label for="wpc_api_version">
593
  Api version
594
- <?php echo helpIcon('Select 2, if connecting to a remote webp-express. Api 1 was never used with this plugin, and should only be used to connect to webp-convert-cloud-service running api version 1'); ?>
595
  </label>
596
  <select id="wpc_api_version" onchange="wpcApiVersionChanged()">
597
  <option value="0">0</option>
591
  <div id="wpc_api_version_div">
592
  <label for="wpc_api_version">
593
  Api version
594
+ <?php echo helpIcon('Select 1, if connecting to a remote webp-express. Api 0 was never used with this plugin, and should only be used to connect to webp-convert-cloud-service v.0.1 instances'); ?>
595
  </label>
596
  <select id="wpc_api_version" onchange="wpcApiVersionChanged()">
597
  <option value="0">0</option>
webp-express.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WebP Express
4
  * Plugin URI: https://github.com/rosell-dk/webp-express
5
  * Description: Serve autogenerated WebP images instead of jpeg/png to browsers that supports WebP. Works on anything (media library images, galleries, theme images etc).
6
- * Version: 0.7.0
7
  * Author: Bjørn Rosell
8
  * Author URI: https://www.bitwise-it.dk
9
  * License: GPL2
3
  * Plugin Name: WebP Express
4
  * Plugin URI: https://github.com/rosell-dk/webp-express
5
  * Description: Serve autogenerated WebP images instead of jpeg/png to browsers that supports WebP. Works on anything (media library images, galleries, theme images etc).
6
+ * Version: 0.7.1
7
  * Author: Bjørn Rosell
8
  * Author URI: https://www.bitwise-it.dk
9
  * License: GPL2