From 2bf69e193801cb308a015f7f496a97b39a5ce612 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 17 Nov 2023 13:31:34 -0500 Subject: [PATCH] v6.0-rc2: * **Crawler** Added status updates to CLI. (Lars) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/crawler.cls.php | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 9fb5e6e72..3831a72b6 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -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-rc1 + * Version: 6.0-rc2 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.0-rc1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.0-rc2'); !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 diff --git a/readme.txt b/readme.txt index 4ebb04ec9..0e401a9e7 100644 --- a/readme.txt +++ b/readme.txt @@ -271,6 +271,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Image Optimize** Increased time limit for pull process. * **Image Optimize** Last pull time and cron tag now included in optimization summary. * **Image Optimize** Fixed Elementors Slideshow unusal background images. (Ryan D) +* **Crawler** Added status updates to CLI. (Lars) * **3rd** WPML product category purge for WooCommerce. (Tynan #577) = 5.7.0.1 - Oct 25 2023 = diff --git a/src/crawler.cls.php b/src/crawler.cls.php index 5d79c00f2..83e9a9a1e 100644 --- a/src/crawler.cls.php +++ b/src/crawler.cls.php @@ -594,6 +594,7 @@ private function _do_running() } $status = $this->_status_parse($rets[$row['id']]['header'], $rets[$row['id']]['code'], $row['url']); // B or H or M or N(nocache) + self::debug('[status] ' . $this->_status2title($status) . "\t\t [url] " . $row['url']); $this->_map_status_list[$status][$row['id']] = array( 'url' => $row['url'], 'code' => $rets[$row['id']]['code'], // 201 or 200 or 404 @@ -750,6 +751,19 @@ private function _multi_request($rows, $options) return $ret; } + /** + * Translate the status to title + * @since 6.0 + */ + private function _status2title($status) + { + if ($status == 'H') return '✅ Hit'; + if ($status == 'M') return '😊 Miss'; + if ($status == 'B') return '😅 Blacklisted'; + if ($status == 'N') return '😅 Blacklisted'; + return '🛸 Unknown'; + } + /** * Check returned curl header to find if cached or not * @@ -1193,7 +1207,7 @@ public function handler() } break; - // Handle the ajax request to proceed crawler manually by admin + // Handle the ajax request to proceed crawler manually by admin case self::TYPE_START: self::start_async(); break;