Skip to content

Commit

Permalink
v7.0-a28: Fixed qc activation CLI sync issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai Zheng committed Oct 18, 2024
1 parent cf89127 commit 6729505
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
2 changes: 2 additions & 0 deletions cli/online.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function init()
{
$resp = $this->__cloud->init_qc_cli();
if (!empty($resp['qc_activated'])) {
$this->__cloud->update_qc_activation($resp['qc_activated']);
WP_CLI::success('Init successfully. Activated type: ' . $resp['qc_activated']);
} else {
WP_CLI::error('Init failed!');
Expand Down Expand Up @@ -79,6 +80,7 @@ public function cdn_init($args, $assoc_args)

$resp = $this->__cloud->init_qc_cdn_cli($assoc_args['method'], $cert, $key, $cf_token);
if (!empty($resp['qc_activated'])) {
$this->__cloud->update_qc_activation($resp['qc_activated']);
WP_CLI::success('Init QC CDN successfully. Activated type: ' . $resp['qc_activated']);
} else {
WP_CLI::error('Init QC CDN failed!');
Expand Down
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: 7.0-a27
* Version: 7.0-a28
* 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', '7.0-a27');
!defined('LSCWP_V') && define('LSCWP_V', '7.0-a28');

!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
21 changes: 16 additions & 5 deletions src/cloud.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,25 +514,36 @@ public function finish_qc_activation($ref = false)
return;
}

$this->_summary['qc_activated'] = $_GET['qc_activated'];
$this->update_qc_activation($_GET['qc_activated']);

wp_redirect($this->_get_ref_url($ref));
}

/**
* Finish qc activation process
*
* @since 7.0
*/
public function update_qc_activation($qc_activated)
{
$this->_summary['qc_activated'] = $qc_activated;
$this->save_summary();


$msg = sprintf(__('Congratulations, %s successfully set this domain up for the anonymous online services.', 'litespeed-cache'), 'QUIC.cloud');
if ($_GET['qc_activated'] == 'linked') {
if ($qc_activated == 'linked') {
$msg = sprintf(__('Congratulations, %s successfully set this domain up for the online services.', 'litespeed-cache'), 'QUIC.cloud');
// Sync possible partner info
$this->sync_usage();
}
if ($_GET['qc_activated'] == 'cdn') {
if ($qc_activated == 'cdn') {
$msg = sprintf(__('Congratulations, %s successfully set this domain up for the online services with CDN service.', 'litespeed-cache'), 'QUIC.cloud');
// Turn on CDN option
$this->cls('Conf')->update_confs(array(self::O_CDN_QUIC => true));
}
Admin_Display::success('🎊 ' . $msg);

$this->clear_cloud();

wp_redirect($this->_get_ref_url($ref));
}

/**
Expand Down

0 comments on commit 6729505

Please sign in to comment.