WebP Express - Version 0.7.2

Version Description

Fixed a critical bug which generated an error message which caused corrupt images. It was not the bug itself, but the error message it generated, that caused the images to be corrupted. It only happened when debugging was enabled in php.ini

Download this release

Release Info

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

Code changes from version 0.7.1 to 0.7.2

Files changed (5) hide show
  1. README.md +5 -0
  2. README.txt +75 -10
  3. changelog.txt +3 -0
  4. webp-express.php +1 -1
  5. wod/webp-on-demand.php +0 -4
README.md CHANGED
@@ -97,3 +97,8 @@ Putting this question in the "frequently" asked questions section is of course s
97
This version added option to provide conversion service to other sites!
98
99
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
97
This version added option to provide conversion service to other sites!
98
99
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
100
+
101
+ ## Silly dance-ware
102
+ If you enjoy this software, feel free to express yourself now through bodily movements. Don't - be - shy!
103
+
104
+ *No animals were harmed and no women were sexually harassed either during the production of this plugin*
README.txt CHANGED
@@ -1,10 +1,10 @@
1
=== WebP Express ===
2
Contributors: rosell.dk
3
- 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.1
8
Requires PHP: 5.6
9
License: GPLv3
10
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -20,11 +20,11 @@ The plugin basically routes jpeg/png images to an image converter, or - if the i
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.
24
- Better user experience (whether performance goes from terrible to bad, or from good to impressive, it is a benefit)
25
- Better ranking in Google searches (performance is taken into account by Google)
26
- Less bandwidth consumption - makes a difference when abroad and in the parts of the world with slow and expensive internet connections.
27
-
28
29
== Installation ==
30
@@ -66,16 +66,78 @@ The plugin has not been tested in multisite configurations. It's on the roadmap.
66
67
== Limitations ==
68
69
- * The plugin does not work on Microsoft IIS server
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? =
80
The option will only display, if your system is able to detect jpeg qualities. To make your server capable to do that, install *Imagick* or *Gmagick*
81
@@ -96,6 +158,9 @@ Putting this question in the "frequently" asked questions section is of course s
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
1
=== WebP Express ===
2
Contributors: rosell.dk
3
+ Donate link: https://www.patreon.com/rosell
4
Tags: webp, images, performance
5
Requires at least: 4.0
6
+ Tested up to: 5.0
7
+ Stable tag: 0.7.2
8
Requires PHP: 5.6
9
License: GPLv3
10
License URI: https://www.gnu.org/licenses/gpl-3.0.html
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 browsers that supports 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.
24
- Better user experience (whether performance goes from terrible to bad, or from good to impressive, it is a benefit)
25
- Better ranking in Google searches (performance is taken into account by Google)
26
- Less bandwidth consumption - makes a difference when abroad and in the parts of the world with slow and expensive internet connections.
27
+ - Currently ~73% of all traffic, and ~78% of mobile browsing traffic are done with browsers supporting webp. With Mozilla and Microsoft [finally on board](https://medium.com/@richard_90141/webp-image-support-an-8-year-saga-7aa2bedb8d02), these numbers are bound to increase. Check current numbers on [caniuse.com](https://caniuse.com/webp)).
28
29
== Installation ==
30
66
67
== Limitations ==
68
69
+ * The plugin does not work on Microsoft IIS server, nor in WAMP
70
* The plugin has not been tested with multisite installation (it is on the roadmap!).
71
72
+ == Supporting WebP Express ==
73
+ Bread on the table don't come for free, even though this plugin does, and always will. I enjoy developing this, and supporting you guys, but I kind of need the bread too. Please make it possible for me to continue wasting time on this plugin:
74
+
75
+ *[Become a backer or sponsor on Patreon](https://www.patreon.com/rosell)*.
76
77
== Frequently Asked Questions ==
78
79
+ = How do I verify that the plugin is working? =
80
+ Once, you have a converter, that works, when you click the "test"-button, you are ready to test the whole stack, and the rewrite rules. To do this, first make sure to select something other than "Do not convert any images!" in *Image types to convert*. Next, click "Save settings". This will save settings, as well as update the *.htaccess*.
81
+
82
+ If you are working in a browser that supports webp (ie Google Chrome), you will see a link "Convert test image (show debug)" after a successful save. Click that to test if it works. The screen should show a textual report of the conversion process. If it shows an image, it means that the *.htaccess* redirection isn't working. It may be that your server just needs some time. Some servers has set up caching. It could also be that your images are handled by nginx.
83
+
84
+ Note that the plugin does not change any HTML. In the HTML the image src is still set to ie "example.jpg". To verify that the plugin is working (without clicking the test button), do the following:
85
+
86
+ - Open the page in Google Chrome
87
+ - Right-click the page and choose "Inspect"
88
+ - Click the "Network" tab
89
+ - Reload the page
90
+ - Find a jpeg or png image in the list. In the "type" column, it should say "webp"
91
+
92
+ In order to test that the image is not being reconverted every time, look at the Response headers of the image. There should be a "X-WebP-Convert-Status" header. It should say "Serving existing converted image" the first time, but "Serving existing converted image" on subsequent requests (WebP-Express is based upon [WebP Convert](https://github.com/rosell-dk/webp-convert)).
93
+
94
+ You can also append `?debug` after any image url, in order to run a conversion, and see the conversion report. Also, if you append `?reconvert` after an image url, you will force a reconversion of the image.
95
+
96
+ = No conversions methods are working out of the box =
97
+ Don't fret - you have options!
98
+
99
+ - If you a controlling another WordPress site (where the local conversion methods DO work), you can set up WebP Express there, and then connect to it by configuring the “Remote WebP Express” conversion method.
100
+ - You can also setup the ewww conversion method. To use it, you need to purchase an api key. They do not charge credits for webp conversions, so all you ever have to pay is the one dollar start-up fee 🙂 (unless they change their pricing – I have no control over that). You can buy an api key here: https://ewww.io/plans/
101
+ - If you are up to it, you can try to get one of the local converters working. Check out [this page](https://github.com/rosell-dk/webp-convert/wiki/Meeting-the-requirements-of-the-converters) on the webp-convert wiki
102
+ - Finally, if you have access to a server and are comfortable with installing projects with composer, you can install [webp-convert-cloud-service](https://github.com/rosell-dk/webp-convert-cloud-service). It's open source.
103
+
104
+ = It doesn't work - Although test conversions work, it still serves jpeg images =
105
+ Actually, you might be mistaking, so first, make sure that you didn't make the very common mistake of thinking that something with the URL *example.com/image.jpg* must be a jpeg image. The plugin serves webp images on same URL as the original (unconverted) images, so do not let appearances fool you! Confused? See next FAQ item.
106
+
107
+ Assuming that you have inspected the *content type* header, and it doesn't show "image/webp", please make sure that:
108
+ 1) You tested with a browser that supports webp (such as Chrome)
109
+ 2) The image URL you are looking at are not pointing to another server (such as gravatar.com)
110
+
111
+ Assuming that all above is in place, please look at the response headers to see if there is a *X-WebP-Convert-Status* header. If there isn't, well, then it seems that the problem is that the image request isn't handed over to WebP Express. Reasons for that can be:
112
+
113
+ - You are on NGINX (or an Apache/Nginx combination). NGINX requires special attention, please look at that FAQ item
114
+ - You are on WAMP. Please look at that FAQ item
115
+
116
+ I shall write more on this FAQ item... Stay tuned.
117
+
118
+
119
+ = How can a webp image be served on an URL ending with "jpg"? =
120
+ Easy enough. Browsers looks at the *content type* header rather than the URL to determine what it is that it gets. So, although it can be confusing that the resource at *example.com/image.jpg* is a webp image, rest asure that the browsers are not confused. To determine if the plugin is working, you must therefore examine the *content type* response header rather than the URL. See the "How do I verify that the plugin is working?" Faq item.
121
+
122
+ I am btw considering making an option to have the plugin redirect to the webp instead of serving immediately. That would remove the apparent mismatch between file extension and content type header. However, the cost of doing that will be an extra request for each image, which means extra time and worse performance. I believe you'd be ill advised to use that option, so I guess I will not implement it. But perhaps you have good reasons to use it? If you do, please let me know!
123
+
124
+ = I am on NGINX / OpenResty =
125
+ It is possible to make WebP Express work on NGINX, but it requieres manually inserting redirection rules in the NGINX configuration file (nginx.conf). For standard wordpress installations, the following rules should work:
126
+
127
+ ```
128
+ if ($http_accept ~* “webp”){
129
+ rewrite ^/(.*).(jpe?g|png)$ /wp-content/plugins/webp-express/wod/webp-on-demand.php?source=$document_root$request_uri&wp-content=wp-content&%1 break;
130
+ }
131
+ ```
132
+ However, the location of the wp-content folder and the plugins folder can be customized with Wordpress. In that case, the above rule must be changed accordingly.
133
+
134
+ I'd like to make the plugin print the NGINX rules that needs to be inserted, when running on NGINX / NGINX based setup (ie [OpenResty](https://openresty.org/en/)). Please help make that possible by [contributing](https://www.patreon.com/rosell).
135
+
136
+ Discussion on this topic here: https://wordpress.org/support/topic/nginx-rewrite-rules-4/
137
+
138
+ = I am on a WAMP stack =
139
+ It has been reported that WebP Express *almost* works on WAMP stack. I'd love to debug this, but do not own a Windows server or access to one... Can you help?
140
+
141
= Why do I not see the option to set WebP quality to auto? =
142
The option will only display, if your system is able to detect jpeg qualities. To make your server capable to do that, install *Imagick* or *Gmagick*
143
158
159
== Changelog ==
160
161
+ = 0.7.2 =
162
+ Fixed a critical bug which generated an error message which caused corrupt images. It was not the bug itself, but the error message it generated, that caused the images to be corrupted. It only happened when debugging was enabled in php.ini
163
+
164
= 0.7.1 =
165
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.
166
changelog.txt CHANGED
@@ -1,3 +1,6 @@
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
1
+ = 0.7.2 =
2
+ Fixed a critical bug which generated an error message which caused corrupt images. It was not the bug itself, but the error message it generated, that caused the images to be corrupted. It only happened when debugging was enabled in php.ini
3
+
4
= 0.7.1 =
5
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.
6
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.1
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.2
7
* Author: Bjørn Rosell
8
* Author URI: https://www.bitwise-it.dk
9
* License: GPL2
wod/webp-on-demand.php CHANGED
@@ -65,10 +65,6 @@ if (substr($source, 0, strlen($applicationRoot)) === $applicationRoot) {
65
}
66
//$destination = $imageRoot . $source . '.webp';
67
68
- if ($options['show-report']) {
69
- // echo '<pre>' . print_r($options, true) . '</pre>';
70
-
71
- }
72
73
//echo $source . '<br>';
74
//echo $destination . '<br>';
65
}
66
//$destination = $imageRoot . $source . '.webp';
67
68
69
//echo $source . '<br>';
70
//echo $destination . '<br>';