Skip to content

Commit

Permalink
v6.1-a3: * **Image Optimize** Fixed possible PHP warning for WP reque…
Browse files Browse the repository at this point in the history
…sts library response.
  • Loading branch information
Hai Zheng committed Dec 18, 2023
1 parent a5019f5 commit b3616c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions litespeed-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: LiteSpeed Cache
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
* Description: High-performance page caching and site optimization from LiteSpeed
* Version: 6.0.0.1
* Version: 6.1-a3
* Author: LiteSpeed Technologies
* Author URI: https://www.litespeedtech.com
* License: GPLv3
Expand Down Expand Up @@ -34,7 +34,7 @@
return;
}

!defined('LSCWP_V') && define('LSCWP_V', '6.0.0.1');
!defined('LSCWP_V') && define('LSCWP_V', '6.1-a3');

!defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR);
!defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The

== Changelog ==

= 6.1 - Feb 2024 =
* 🌱**Database** Clear Orphaned Post Meta.
* **Image Optimize** Fixed possible PHP warning for WP requests library response.

= 6.0.0.1 - Dec 15 2023 =
* 🐞**Image Optimize** Grouped the taken notification to regional center servers to reduce the load after image pulled.

Expand Down
6 changes: 3 additions & 3 deletions src/img-optm.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,8 @@ public function pull($manual = false)
$local_file = $this->wp_upload_dir['basedir'] . '/' . $row_img->src;
$server_info = json_decode($row_img->server_info, true);

if (!$response->success) {
if (404 == $response->status_code) {
if (empty($response->success)) {
if (!empty($response->status_code) && 404 == $response->status_code) {
$this->_step_back_image($row_img->id);

$msg = __('Some optimized image file(s) has expired and was cleared.', 'litespeed-cache');
Expand All @@ -1030,7 +1030,7 @@ public function pull($manual = false)
} else {
// handle error
$image_url = $server_info['server'] . '/' . $server_info[$row_type];
self::debug('❌ failed to pull image (' . $row_type . '): ' . $response->status_code . ' [Local: ' . $row_img->src . '] / [remote: ' . $image_url . ']');
self::debug('❌ failed to pull image (' . $row_type . '): ' . (!empty($response->status_code) ? $response->status_code : '') . ' [Local: ' . $row_img->src . '] / [remote: ' . $image_url . ']');
return;
}
}
Expand Down

0 comments on commit b3616c7

Please sign in to comment.