WebP Express - Version 0.18.2

Version Description

  • Fixed bug on settings page
Download this release

Release Info

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

Code changes from version 0.18.1 to 0.18.2

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wordpress.org/plugins/webp-express/#%0Ahow%20do%20i%20buy%2
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
@@ -1180,6 +1180,9 @@ For older releases, check out changelog.txt
1180
 
1181
  == Upgrade Notice ==
1182
 
 
 
 
1183
  = 0.18.1 =
1184
  * Minor bug fix for bulk convert
1185
 
4
  Tags: webp, images, performance
5
  Requires at least: 4.0
6
  Tested up to: 5.5
7
+ Stable tag: 0.18.2
8
  Requires PHP: 5.6
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
1180
 
1181
  == Upgrade Notice ==
1182
 
1183
+ = 0.18.2 =
1184
+ * Fixed bug on settings page
1185
+
1186
  = 0.18.1 =
1187
  * Minor bug fix for bulk convert
1188
 
changelog.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
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.
1
+ = 0.18.2 =
2
+ *(released: 28 Sep 2020)*
3
+ * Bugfix: Fixed error on the settings page on a handful of setups.
4
+
5
  = 0.18.1 =
6
  *(released: 24 Sep 2020)*
7
  * 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.
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.1. ' . $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.2. ' . $msgTop . ', ' . date("Y-m-d H:i:s") . "\n\r\n\r" . $text;
575
 
576
  $logFile = self::getLogFilename($source, $logDir);
577
 
lib/classes/WPHttpRequester.php CHANGED
@@ -19,10 +19,18 @@ class WPHttpRequester implements HttpRequesterInterface
19
  $response = wp_remote_get($url, ['timeout' => 10]);
20
  //echo '<pre>' . print_r($response, true) . '</pre>';
21
 
22
- $body = wp_remote_retrieve_body($response);
23
- $statusCode = wp_remote_retrieve_response_code($response);
24
- $headersMap = wp_remote_retrieve_headers($response)->getAll();
25
-
26
- return new HttpResponse($body, $statusCode, $headersMap);
 
 
 
 
 
 
 
 
27
  }
28
  }
19
  $response = wp_remote_get($url, ['timeout' => 10]);
20
  //echo '<pre>' . print_r($response, true) . '</pre>';
21
 
22
+ if (is_wp_error($response)) {
23
+ return new HttpResponse('0','',[]);
24
+ } else {
25
+ $body = wp_remote_retrieve_body($response);
26
+ $statusCode = wp_remote_retrieve_response_code($response);
27
+ $headersDict = wp_remote_retrieve_headers($response);
28
+ if (method_exists($headersDict, 'getAll')) {
29
+ $headersMap = $headersDict->getAll();
30
+ } else {
31
+ $headersMap = [];
32
+ }
33
+ return new HttpResponse($body, $statusCode, $headersMap);
34
+ }
35
  }
36
  }
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.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.18.2
7
  * Author: Bjørn Rosell
8
  * Author URI: https://www.bitwise-it.dk
9
  * License: GPL2