WebP Express - Version 0.18.1

Version Description

(released: 24 Sep 2020) * Bugfix: Bulk Convert failed to show list on systems that did not have the utf8-encode() function.

Download this release

Release Info

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

Code changes from version 0.18.0 to 0.18.1

.github/FUNDING.yml CHANGED
@@ -1,2 +1,2 @@
 
1
  ko_fi: rosell
2
- patreon: rosell
1
+ github: rosell-dk
2
  ko_fi: rosell
 
README.md CHANGED
@@ -677,6 +677,10 @@ Here are my current plans ahead: 0.18 will probably be a file manager-like inter
677
 
678
  If you wish to affect priorities, it is certainly possible. You can try to argue your case in the forum or you can simply let the money do the talking. By donating as little as a cup of coffee on [ko-fi.com/rosell](https://ko-fi.com/rosell), you can leave a wish. I shall take these wishes into account when prioritizing between new features.
679
 
 
 
 
 
680
  ## Changes in 0.18.0
681
  *(released: 24 Sep 2020)*
682
  * You can now set cache control header in CDN friendly mode too
677
 
678
  If you wish to affect priorities, it is certainly possible. You can try to argue your case in the forum or you can simply let the money do the talking. By donating as little as a cup of coffee on [ko-fi.com/rosell](https://ko-fi.com/rosell), you can leave a wish. I shall take these wishes into account when prioritizing between new features.
679
 
680
+ ## Changes in 0.18.1
681
+ *(released: 24 Sep 2020)*
682
+ * Bugfix: Bulk Convert failed to show list on systems that did not have the [utf8-encode()](https://www.php.net/manual/en/function.utf8-encode.php) function.
683
+
684
  ## Changes in 0.18.0
685
  *(released: 24 Sep 2020)*
686
  * You can now set cache control header in CDN friendly mode too
README.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WebP Express ===
2
  Contributors: rosell.dk
3
- Donate link: https://ko-fi.com/rosell
4
  Tags: webp, images, performance
5
  Requires at least: 4.0
6
  Tested up to: 5.5
7
- Stable tag: 0.18.0
8
  Requires PHP: 5.6
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -134,22 +134,20 @@ Bread on the table don't come for free, even though this plugin does, and always
134
 
135
  * Max Kreminsky
136
  * [Mathieu Gollain-Dupont](https://www.linkedin.com/in/mathieu-gollain-dupont-9938a4a/)
 
137
 
138
  **Persons who contributed with coffee within the last 30 days (updated biweekly) - Thanks! **
139
 
140
  * Katja
141
  * Devashish Datt Mamgain
142
  * RobMoore
143
- * Anon
144
- * Eder Ribeiro
145
- * Christian
146
 
147
  **Persons who contributed with extra generously amounts of coffee / lifetime backing (>30$) - thanks!:**
148
 
149
  * Justin - BigScoots ($105)
150
  * Sebastian ($99)
151
  * Tammy Lee ($90)
152
- * Max Kreminsky ($65)
153
  * Steven Sullivan ($51)
154
 
155
  == Frequently Asked Questions ==
@@ -735,6 +733,10 @@ If you want to make sure that my coffee supplies don't run dry, you can even buy
735
 
736
  == Changelog ==
737
 
 
 
 
 
738
  = 0.18.0 =
739
  *(released: 24 Sep 2020)*
740
  * You can now set cache control header in CDN friendly mode too
@@ -1178,6 +1180,9 @@ For older releases, check out changelog.txt
1178
 
1179
  == Upgrade Notice ==
1180
 
 
 
 
1181
  = 0.18.0 =
1182
  * General maintenance and improvements
1183
 
1
  === WebP Express ===
2
  Contributors: rosell.dk
3
+ Donate link: https://wordpress.org/plugins/webp-express/#%0Ahow%20do%20i%20buy%20you%20a%20cup%20of%20coffee%3F%0A
4
  Tags: webp, images, performance
5
  Requires at least: 4.0
6
  Tested up to: 5.5
7
+ Stable tag: 0.18.1
8
  Requires PHP: 5.6
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
134
 
135
  * Max Kreminsky
136
  * [Mathieu Gollain-Dupont](https://www.linkedin.com/in/mathieu-gollain-dupont-9938a4a/)
137
+ * Ruben Solvang
138
 
139
  **Persons who contributed with coffee within the last 30 days (updated biweekly) - Thanks! **
140
 
141
  * Katja
142
  * Devashish Datt Mamgain
143
  * RobMoore
 
 
 
144
 
145
  **Persons who contributed with extra generously amounts of coffee / lifetime backing (>30$) - thanks!:**
146
 
147
  * Justin - BigScoots ($105)
148
  * Sebastian ($99)
149
  * Tammy Lee ($90)
150
+ * Max Kreminsky ($70)
151
  * Steven Sullivan ($51)
152
 
153
  == Frequently Asked Questions ==
733
 
734
  == Changelog ==
735
 
736
+ = 0.18.1 =
737
+ *(released: 24 Sep 2020)*
738
+ * Bugfix: Bulk Convert failed to show list on systems that did not have the [utf8-encode()](https://www.php.net/manual/en/function.utf8-encode.php) function.
739
+
740
  = 0.18.0 =
741
  *(released: 24 Sep 2020)*
742
  * You can now set cache control header in CDN friendly mode too
1180
 
1181
  == Upgrade Notice ==
1182
 
1183
+ = 0.18.1 =
1184
+ * Minor bug fix for bulk convert
1185
+
1186
  = 0.18.0 =
1187
  * General maintenance and improvements
1188
 
changelog.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  = 0.18.0 =
2
  *(released: 24 Sep 2020)*
3
  * You can now set cache control header in CDN friendly mode too
1
+ = 0.18.1 =
2
+ *(released: 24 Sep 2020)*
3
+ * Bugfix: Bulk Convert failed to show list on systems that did not have the [utf8-encode()](https://www.php.net/manual/en/function.utf8-encode.php) function.
4
+
5
  = 0.18.0 =
6
  *(released: 24 Sep 2020)*
7
  * You can now set cache control header in CDN friendly mode too
lib/classes/AdminUi.php CHANGED
@@ -22,7 +22,7 @@ class AdminUi
22
  } else {
23
  $mylinks = array(
24
  '<a href="' . admin_url('options-general.php?page=webp_express_settings_page') . '">Settings</a>',
25
- '<a href="https://ko-fi.com/rosell" target="_blank">Provide coffee for the developer</a>',
26
  );
27
 
28
  }
22
  } else {
23
  $mylinks = array(
24
  '<a href="' . admin_url('options-general.php?page=webp_express_settings_page') . '">Settings</a>',
25
+ '<a href="https://wordpress.org/plugins/webp-express/#%0Ahow%20do%20i%20buy%20you%20a%20cup%20of%20coffee%3F%0A" target="_blank">Provide coffee for the developer</a>',
26
  );
27
 
28
  }
lib/classes/BulkConvert.php CHANGED
@@ -135,8 +135,13 @@ class BulkConvert
135
  }
136
 
137
  if ($addThis) {
138
- // utf8_encode the filename so json_encode won't fail later on (#445)
139
- $results[] = substr($relDir . "/", 2) . utf8_encode($filename); // (we cut the leading "./" off with substr)
 
 
 
 
 
140
  }
141
  }
142
  }
135
  }
136
 
137
  if ($addThis) {
138
+
139
+ // utf8_encode is not available on all systems (#452)
140
+ if (function_exists('utf8_encode')) {
141
+ // utf8_encode the filename so json_encode won't fail later on (#445)
142
+ $filename = utf8_encode($filename);
143
+ }
144
+ $results[] = substr($relDir . "/", 2) . $filename; // (we cut the leading "./" off with substr)
145
  }
146
  }
147
  }
lib/classes/ConvertHelperIndependent.php CHANGED
@@ -571,7 +571,7 @@ APACHE
571
  $text = preg_replace('#' . preg_quote($_SERVER["DOCUMENT_ROOT"]) . '#', '[doc-root]', $text);
572
 
573
  // TODO: Put version number somewhere else. Ie \WebPExpress\VersionNumber::version
574
- $text = 'WebP Express 0.18.0. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text;
575
 
576
  $logFile = self::getLogFilename($source, $logDir);
577
 
571
  $text = preg_replace('#' . preg_quote($_SERVER["DOCUMENT_ROOT"]) . '#', '[doc-root]', $text);
572
 
573
  // TODO: Put version number somewhere else. Ie \WebPExpress\VersionNumber::version
574
+ $text = 'WebP Express 0.18.1. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text;
575
 
576
  $logFile = self::getLogFilename($source, $logDir);
577
 
lib/classes/SelfTestRedirectToWebPRealizer.php CHANGED
@@ -41,6 +41,9 @@ class SelfTestRedirectToWebPRealizer extends SelfTestRedirectAbstract
41
  AlterHtmlHelper::$options = json_decode(Option::getOption('webp-express-alter-html-options', null), true);
42
  AlterHtmlHelper::$options['only-for-webps-that-exists'] = false;
43
 
 
 
 
44
  $requestUrl = AlterHtmlHelper::getWebPUrlInImageRoot(
45
  $sourceUrl,
46
  $rootId,
@@ -49,16 +52,18 @@ class SelfTestRedirectToWebPRealizer extends SelfTestRedirectAbstract
49
  );
50
 
51
  if ($requestUrl === false) {
52
- $log[] = 'Hm, strange. The source URL does not seem to be in the base root';
53
- $log[] = 'Source URL:' . $sourceUrl;
54
- //$log[] = 'Root ID:' . $rootId;
55
- $log[] = 'Root Url:' . Paths::getUrlById($rootId);
56
- $log[] = 'Request Url:' . $requestUrl;
57
- $log[] = 'parsed url:' . print_r(parse_url($sourceUrl), true);
58
- $log[] = 'parsed url:' . print_r(parse_url(Paths::getUrlById($rootId)), true);
59
- $log[] = 'scope:' . print_r(AlterHtmlHelper::$options['scope'], true);
60
- $log[] = 'cached options:' . print_r(AlterHtmlHelper::$options, true);
61
- $log[] = 'cached options: ' . print_r(Option::getOption('webp-express-alter-html-options', 'not there!'), true);
 
 
62
  }
63
 
64
 
41
  AlterHtmlHelper::$options = json_decode(Option::getOption('webp-express-alter-html-options', null), true);
42
  AlterHtmlHelper::$options['only-for-webps-that-exists'] = false;
43
 
44
+ // TODO: Check that AlterHtmlHelper::$options['scope'] is not empty
45
+ // - it has been seen to happen
46
+
47
  $requestUrl = AlterHtmlHelper::getWebPUrlInImageRoot(
48
  $sourceUrl,
49
  $rootId,
52
  );
53
 
54
  if ($requestUrl === false) {
55
+ // PS: this has happened due to AlterHtmlHelper::$options['scope'] being empty...
56
+
57
+ $log[] = 'Hm, strange. The source URL does not seem to be in the base root';
58
+ $log[] = 'Source URL:' . $sourceUrl;
59
+ //$log[] = 'Root ID:' . $rootId;
60
+ $log[] = 'Root Url:' . Paths::getUrlById($rootId);
61
+ $log[] = 'Request Url:' . $requestUrl;
62
+ $log[] = 'parsed url:' . print_r(parse_url($sourceUrl), true);
63
+ $log[] = 'parsed url:' . print_r(parse_url(Paths::getUrlById($rootId)), true);
64
+ $log[] = 'scope:' . print_r(AlterHtmlHelper::$options['scope'], true);
65
+ $log[] = 'cached options:' . print_r(AlterHtmlHelper::$options, true);
66
+ $log[] = 'cached options: ' . print_r(Option::getOption('webp-express-alter-html-options', 'not there!'), true);
67
  }
68
 
69
 
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.18.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.18.1
7
  * Author: Bjørn Rosell
8
  * Author URI: https://www.bitwise-it.dk
9
  * License: GPL2