WebP Express - Version 0.3.0

Version Description

Download this release

Release Info

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

Code changes from version 0.3.1 to 0.3.0

Files changed (4) hide show
  1. README.md +2 -4
  2. README.txt +3 -8
  3. lib/helpers.php +1 -1
  4. webp-express.php +1 -1
README.md CHANGED
@@ -6,10 +6,10 @@ Serve autogenerated WebP images instead of jpeg/png to browsers that supports We
6
 
7
  This plugin let's you take advantage of the WebP image format with only a little effort. Install, configure, test, forget - and enjoy the increased performance of your website.
8
 
9
- The plugin works by .htaccess magic coupled with an image converter. Basically, jpegs and pngs are routed to the image converter, unless the image converter has already converted the image. In that case, it is routed directly to the converted image. The images are saved in a subfolder to the "uploads" folder, preserving the same structure as the originals. In order to allow caching on CDN, the .htaccess rules add a "Vary" HTTP header when serving the WebP images.
10
-
11
  The approach has the benefit that is works regardless of how an image found its way into your site. The plugin does not need to hook into Media Library events, Gallery events etc, because it does not need to maintain a complete collection of converted images. It makes it so much simpler -- and lighter.
12
 
 
 
13
  *Note:*
14
  The rules created in .htaccess are sensitive to the location of your image folder and the location of wordpress. If you at some point change one of these, the rules will have to be updated. .htaccess rules are updated whenever you change a setting (all configuration is actually stored in .htaccess, which allows the converter to run faster, than if it had the overhead of bootstrapping Wordpress)
15
 
@@ -52,8 +52,6 @@ Note that the plugin does not change any HTML. In the HTML the image src is stil
52
  - Reload the page
53
  - Find a jpeg or png image in the list. In the "type" column, it should say "webp"
54
 
55
- 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-On-Demand" header. It should say Routed to image converter" the first time, but "Routed to existing converted image" on subsequent requests (WebP-Express is based upon WebP On Demand).
56
-
57
  You can also append `?debug` after any image url, in order to run a conversion, and see the conversion report. Btw: If you append `?reconvert` after an image url, you will force a reconversion of the image.
58
 
59
 
6
 
7
  This plugin let's you take advantage of the WebP image format with only a little effort. Install, configure, test, forget - and enjoy the increased performance of your website.
8
 
 
 
9
  The approach has the benefit that is works regardless of how an image found its way into your site. The plugin does not need to hook into Media Library events, Gallery events etc, because it does not need to maintain a complete collection of converted images. It makes it so much simpler -- and lighter.
10
 
11
+ The plugin works by .htaccess magic coupled with an image converter. Basically, jpegs and pngs are routed to the image converter, unless the image converter has already converted the image. In that case, it is routed directly to the converted image. The images are saved in a subfolder to the "uploads" folder, preserving the same structure as the originals. In order to allow caching on CDN, the .htaccess rules add a "Vary" HTTP header when serving the WebP images.
12
+
13
  *Note:*
14
  The rules created in .htaccess are sensitive to the location of your image folder and the location of wordpress. If you at some point change one of these, the rules will have to be updated. .htaccess rules are updated whenever you change a setting (all configuration is actually stored in .htaccess, which allows the converter to run faster, than if it had the overhead of bootstrapping Wordpress)
15
 
52
  - Reload the page
53
  - Find a jpeg or png image in the list. In the "type" column, it should say "webp"
54
 
 
 
55
  You can also append `?debug` after any image url, in order to run a conversion, and see the conversion report. Btw: If you append `?reconvert` after an image url, you will force a reconversion of the image.
56
 
57
 
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.7.5
6
  Tested up to: 4.9.7
7
- Stable tag: 0.3.1
8
  Requires PHP: 5.5
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -15,10 +15,10 @@ Serve autogenerated WebP images instead of jpeg/png to browsers that supports We
15
 
16
  This plugin let's you take advantage of the WebP image format with only a little effort. Install, configure, test, forget - and enjoy the increased performance of your website.
17
 
18
- The plugin works by .htaccess magic coupled with an image converter. Basically, jpegs and pngs are routed to the image converter, unless the image converter has already converted the image. In that case, it is routed directly to the converted image. The images are saved in a subfolder to the "uploads" folder, preserving the same structure as the originals. In order to allow caching on CDN, the .htaccess rules add a "Vary" HTTP header when serving the WebP images.
19
-
20
  The approach has the benefit that is works regardless of how an image found its way into your site. The plugin does not need to hook into Media Library events, Gallery events etc, because it does not need to maintain a complete collection of converted images. It makes it so much simpler -- and lighter.
21
 
 
 
22
  Note: The rules created in .htaccess are sensitive to the location of your image folder and the location of wordpress. If you at some point change one of these, the rules will have to be updated. .htaccess rules are updated whenever you change a setting (all configuration is actually stored in .htaccess, which allows the converter to run faster, than if it had the overhead of bootstrapping Wordpress)
23
 
24
  Note: Do not simply remove the plugin without deactivating it first. Deactivation takes care of removing the rules in the .htaccess file. With the rules there, but converter gone, your Google Chrome visitors will not see any jpeg images.
@@ -59,8 +59,6 @@ Note that the plugin does not change any HTML. In the HTML the image src is stil
59
  - Reload the page
60
  - Find a jpeg or png image in the list. In the "type" column, it should say "webp"
61
 
62
- 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-On-Demand" header. It should say Routed to image converter" the first time, but "Routed to existing converted image" on subsequent requests (WebP-Express is based upon WebP On Demand).
63
-
64
  You can also append ?debug after any image url, in order to run a conversion, and see the conversion report.
65
  Btw: If you append ?reconvert after an image url, you will force a reconversion of the image.
66
 
@@ -96,9 +94,6 @@ Putting this question in the "frequently" asked questions section is of course s
96
 
97
  == Changelog ==
98
 
99
- = 0.3.1 =
100
- * The "Only jpeg" setting wasn't respected in 0.3.0. It now works again
101
-
102
  = 0.3 =
103
  * Now works on LiteSpeed webservers
104
  * Now sends X-WebP-On-Demand headers for easier debugging
4
  Tags: webp, images, performance
5
  Requires at least: 4.7.5
6
  Tested up to: 4.9.7
7
+ Stable tag: 0.3.0
8
  Requires PHP: 5.5
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
15
 
16
  This plugin let's you take advantage of the WebP image format with only a little effort. Install, configure, test, forget - and enjoy the increased performance of your website.
17
 
 
 
18
  The approach has the benefit that is works regardless of how an image found its way into your site. The plugin does not need to hook into Media Library events, Gallery events etc, because it does not need to maintain a complete collection of converted images. It makes it so much simpler -- and lighter.
19
 
20
+ The plugin works by .htaccess magic coupled with an image converter. Basically, jpegs and pngs are routed to the image converter, unless the image converter has already converted the image. In that case, it is routed directly to the converted image. The images are saved in a subfolder to the "uploads" folder, preserving the same structure as the originals. In order to allow caching on CDN, the .htaccess rules add a "Vary" HTTP header when serving the WebP images.
21
+
22
  Note: The rules created in .htaccess are sensitive to the location of your image folder and the location of wordpress. If you at some point change one of these, the rules will have to be updated. .htaccess rules are updated whenever you change a setting (all configuration is actually stored in .htaccess, which allows the converter to run faster, than if it had the overhead of bootstrapping Wordpress)
23
 
24
  Note: Do not simply remove the plugin without deactivating it first. Deactivation takes care of removing the rules in the .htaccess file. With the rules there, but converter gone, your Google Chrome visitors will not see any jpeg images.
59
  - Reload the page
60
  - Find a jpeg or png image in the list. In the "type" column, it should say "webp"
61
 
 
 
62
  You can also append ?debug after any image url, in order to run a conversion, and see the conversion report.
63
  Btw: If you append ?reconvert after an image url, you will force a reconversion of the image.
64
 
94
 
95
  == Changelog ==
96
 
 
 
 
97
  = 0.3 =
98
  * Now works on LiteSpeed webservers
99
  * Now sends X-WebP-On-Demand headers for easier debugging
lib/helpers.php CHANGED
@@ -188,7 +188,7 @@ class WebPExpressHelpers
188
  " RewriteCond %{QUERY_STRING} (^reconvert.*)|(^debug.*) [OR]\n" .
189
  " RewriteCond %{DOCUMENT_ROOT}/" . $basePath . "/" . $destinationRoot . "/$1.$2.webp !-f\n" .
190
  " RewriteCond %{QUERY_STRING} (.*)\n" .
191
- " RewriteRule ^\/?(.*)\.(" . $fileExt . ")$ " . $scriptPath . "/webp-on-demand.php?base-path=" . $basePath . "&destination-root=" . $destinationRoot . "&source=$1.$2" . $options . "&%1 [NC,E=WEBPACCEPT:1,E=WEBPNEW:1]\n" .
192
  "</IfModule>\n\n" .
193
 
194
  "<IfModule mod_headers.c>\n" .
188
  " RewriteCond %{QUERY_STRING} (^reconvert.*)|(^debug.*) [OR]\n" .
189
  " RewriteCond %{DOCUMENT_ROOT}/" . $basePath . "/" . $destinationRoot . "/$1.$2.webp !-f\n" .
190
  " RewriteCond %{QUERY_STRING} (.*)\n" .
191
+ " RewriteRule ^\/?(.*)\.(jpe?g|png)$ " . $scriptPath . "/webp-on-demand.php?base-path=" . $basePath . "&destination-root=" . $destinationRoot . "&source=$1.$2" . $options . "&%1 [NC,E=WEBPACCEPT:1,E=WEBPNEW:1]\n" .
192
  "</IfModule>\n\n" .
193
 
194
  "<IfModule mod_headers.c>\n" .
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.3.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.3.1
7
  * Author: Bjørn Rosell
8
  * Author URI: https://www.bitwise-it.dk
9
  * License: GPL2