Skip to content

Commit b3837bb

Browse files
author
Hai Zheng
committed
v7.0-b36: * **Purge** PURGE will purge the single URL only like PURGESINGLE.
1 parent 4f3c697 commit b3837bb

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed

litespeed-cache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin Name: LiteSpeed Cache
55
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
66
* Description: High-performance page caching and site optimization from LiteSpeed
7-
* Version: 7.0-b35
7+
* Version: 7.0-b36
88
* Author: LiteSpeed Technologies
99
* Author URI: https://www.litespeedtech.com
1010
* License: GPLv3
@@ -34,7 +34,7 @@
3434
return;
3535
}
3636

37-
!defined('LSCWP_V') && define('LSCWP_V', '7.0-b35');
37+
!defined('LSCWP_V') && define('LSCWP_V', '7.0-b36');
3838

3939
!defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR);
4040
!defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
280280
* **Purge** Allowed `LSWCP_EMPTYCACHE` defined to false to disable Purge all sites.
281281
* **Purge** Each purge action now has a hook.
282282
* **Purge** Fixed `PURGESINGLE` and `PURGE` query string purge tag bug.
283+
* **Purge** `PURGE` will purge the single URL only like `PURGESINGLE`.
283284
* **ESI** Fixed a log logic failure when ESI buffer is empty.
284285
* **ESI** Added Elementor nonces (jujube0ajluxl PR#736)
285286
* **Crawler** Enhanced hash generation function for cryptographic security.

src/core.cls.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Core extends Root
2323
const ACTION_PURGE_BY = 'PURGE_BY';
2424
const ACTION_PURGE_EMPTYCACHE = 'PURGE_EMPTYCACHE';
2525
const ACTION_QS_PURGE = 'PURGE';
26-
const ACTION_QS_PURGE_SINGLE = 'PURGESINGLE';
26+
const ACTION_QS_PURGE_SINGLE = 'PURGESINGLE'; // This will be same as `ACTION_QS_PURGE` (purge single url only)
2727
const ACTION_QS_SHOW_HEADERS = 'SHOWHEADERS';
2828
const ACTION_QS_PURGE_ALL = 'purge_all';
2929
const ACTION_QS_PURGE_EMPTYCACHE = 'empty_all';
@@ -305,14 +305,11 @@ public function proceed_action($action)
305305
$msg = false;
306306
// handle actions
307307
switch ($action) {
308-
case self::ACTION_QS_PURGE:
309-
Purge::set_purge_related();
310-
break;
311-
312308
case self::ACTION_QS_SHOW_HEADERS:
313309
self::$_debug_show_header = true;
314310
break;
315311

312+
case self::ACTION_QS_PURGE:
316313
case self::ACTION_QS_PURGE_SINGLE:
317314
Purge::set_purge_single();
318315
break;

src/purge.cls.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class Purge extends Base
1818
protected $_pub_purge = array();
1919
protected $_pub_purge2 = array();
2020
protected $_priv_purge = array();
21-
protected $_purge_related = false;
2221
protected $_purge_single = false;
2322

2423
const X_HEADER = 'X-LiteSpeed-Purge';
@@ -609,11 +608,10 @@ private function _prepend_bid($tags)
609608
*
610609
* @since 1.1.3
611610
* @access public
611+
* @deprecated @7.0 Drop @v7.5
612612
*/
613613
public static function set_purge_related()
614614
{
615-
self::cls()->_purge_related = true;
616-
do_action('litespeed_purged_related');
617615
}
618616

619617
/**
@@ -1003,21 +1001,11 @@ private function _finalize()
10031001

10041002
do_action('litespeed_purge_finalize');
10051003

1006-
// Append unique uri purge tags if Admin QS is `PURGESINGLE`
1004+
// Append unique uri purge tags if Admin QS is `PURGESINGLE` or `PURGE`
10071005
if ($this->_purge_single) {
10081006
$tags = array(Tag::build_uri_tag());
10091007
$this->_pub_purge = array_merge($this->_pub_purge, $this->_prepend_bid($tags));
10101008
}
1011-
// Append related purge tags if Admin QS is `PURGE`
1012-
if ($this->_purge_related) {
1013-
// Before this, tags need to be finalized
1014-
$tags_related = Tag::output_tags();
1015-
// NOTE: need to remove the empty item `B1_` to avoid purging all
1016-
$tags_related = array_filter($tags_related);
1017-
if ($tags_related) {
1018-
$this->_pub_purge = array_merge($this->_pub_purge, $this->_prepend_bid($tags_related));
1019-
}
1020-
}
10211009

10221010
if (!empty($this->_pub_purge)) {
10231011
$this->_pub_purge = array_unique($this->_pub_purge);

0 commit comments

Comments
 (0)