Skip to content

Commit 86bcfd9

Browse files
author
Hai Zheng
committed
v7.4-b11: * **Data** Dropped legacy code and upgrade data migration support to LSCWP v5.7-.
1 parent 742dcf3 commit 86bcfd9

5 files changed

Lines changed: 6 additions & 713 deletions

File tree

litespeed-cache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: LiteSpeed Cache
44
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
55
* Description: High-performance page caching and site optimization from LiteSpeed
6-
* Version: 7.4-b10
6+
* Version: 7.4-b11
77
* Author: LiteSpeed Technologies
88
* Author URI: https://www.litespeedtech.com
99
* License: GPLv3
@@ -35,7 +35,7 @@
3535
return;
3636
}
3737

38-
! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '7.4-b10' );
38+
! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '7.4-b11' );
3939

4040
! defined( 'LSCWP_CONTENT_DIR' ) && define( 'LSCWP_CONTENT_DIR', WP_CONTENT_DIR );
4141
! 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
@@ -265,6 +265,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
265265
* **Page Optimize** Dropped v4.2 legacy `LITESPEED_BYPASS_OPTM`.
266266
* **Crawler** Used .html file to test port in case some security plugins blocked .txt which caused port test failure. (#661828)
267267
* **GUI** Showed current live values for options if they are overridden by filters or the server environment. (PR#885)
268+
* **Data** Dropped legacy code and upgrade data migration support to LSCWP v5.7-.
268269
* **Misc** Supported `LITESPEED_DEV` const to switch to dev environment.
269270
* **Misc** Allows leading `_` for private func/vars in format checker.
270271
* **Misc** Suppressed frequent version check when certain database option is cached.

src/conf.cls.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
* This maintains all the options and settings for this plugin.
77
*
88
* @since 1.0.0
9-
* @since 1.5 Moved into /inc
109
* @package LiteSpeed
11-
* @subpackage LiteSpeed/inc
1210
* @author LiteSpeed Technologies <info@litespeedtech.com>
1311
*/
1412

@@ -74,11 +72,8 @@ private function _conf_db_init() {
7472
/**
7573
* Version is less than v3.0, or, is a new installation
7674
*/
77-
$ver_check_tag = '';
78-
if (!$ver) {
79-
// Try upgrade first (network will upgrade inside too)
80-
$ver_check_tag = Data::cls()->try_upgrade_conf_3_0();
81-
} else {
75+
$ver_check_tag = 'new';
76+
if ($ver) {
8277
defined('LSCWP_CUR_V') || define('LSCWP_CUR_V', $ver);
8378

8479
/**
@@ -101,7 +96,7 @@ private function _conf_db_init() {
10196
// New install
10297
$this->set_conf(self::$_default_options);
10398

104-
$ver_check_tag .= ' activate' . (defined('LSCWP_REF') ? '_' . LSCWP_REF : '');
99+
$ver_check_tag .= ' activate' . (defined('LSCWP_REF') ? '_' . constant( 'LSCWP_REF' ) : '');
105100
}
106101

107102
// Init new default/missing options

src/data.cls.php

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ class Data extends Root {
1818
const LOG_TAG = '🚀';
1919

2020
private $_db_updater = array(
21-
'3.5.0.3' => array( 'litespeed_update_3_5' ),
22-
'4.0' => array( 'litespeed_update_4' ),
23-
'4.1' => array( 'litespeed_update_4_1' ),
24-
'4.3' => array( 'litespeed_update_4_3' ),
25-
'4.4.4-b1' => array( 'litespeed_update_4_4_4' ),
2621
'5.3-a5' => array( 'litespeed_update_5_3' ),
2722
'7.0-b26' => array( 'litespeed_update_7' ),
2823
'7.0.1-b1' => array( 'litespeed_update_7_0_1' ),
@@ -237,62 +232,6 @@ private function _set_upgrade_lock( $lock ) {
237232
}
238233
}
239234

240-
/**
241-
* Upgrade the conf to v3.0 from previous v3.0- data
242-
*
243-
* NOTE: Only for v3.0-
244-
*
245-
* @since 3.0
246-
* @access public
247-
*/
248-
public function try_upgrade_conf_3_0() {
249-
$previous_options = get_option('litespeed-cache-conf');
250-
if (!$previous_options) {
251-
return 'new';
252-
}
253-
254-
$ver = $previous_options['version'];
255-
256-
!defined('LSCWP_CUR_V') && define('LSCWP_CUR_V', $ver);
257-
258-
// Init log manually
259-
if ($this->conf(Base::O_DEBUG)) {
260-
$this->cls('Debug2')->init();
261-
}
262-
self::debug('Upgrading previous settings [from] ' . $ver . ' [to] v3.0');
263-
264-
if ($this->_get_upgrade_lock()) {
265-
return;
266-
}
267-
268-
$this->_set_upgrade_lock(true);
269-
270-
require_once LSCWP_DIR . 'src/data.upgrade.func.php';
271-
272-
// Here inside will update the version to v3.0
273-
litespeed_update_3_0($ver);
274-
275-
$this->_set_upgrade_lock(false);
276-
277-
self::debug('Upgraded to v3.0');
278-
279-
// Upgrade from 3.0 to latest version
280-
$ver = '3.0';
281-
if (Core::VER != $ver) {
282-
return $this->conf_upgrade($ver);
283-
} else {
284-
// Reload options
285-
$this->cls('Conf')->load_options();
286-
287-
$this->correct_tb_existence();
288-
289-
!defined('LSWCP_EMPTYCACHE') && define('LSWCP_EMPTYCACHE', true); // clear all sites caches
290-
Purge::purge_all();
291-
292-
return 'upgrade';
293-
}
294-
}
295-
296235
/**
297236
* Get the table name
298237
*

0 commit comments

Comments
 (0)