Skip to content

Commit

Permalink
v6.0-rc2: * **Crawler** Added status updates to CLI. (Lars)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai Zheng committed Nov 17, 2023
1 parent cf7c759 commit 2bf69e1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 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-rc1
* Version: 6.0-rc2
* 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-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
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
16 changes: 15 additions & 1 deletion src/crawler.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2bf69e1

Please sign in to comment.