Skip to content

Commit

Permalink
v7.0-a10: * **GUI** New QUIC.cloud CDN tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai Zheng committed Sep 27, 2024
1 parent 5455f3c commit f68351e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 68 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: 7.0-a9
* Version: 7.0-a10
* 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-a9');
!defined('LSCWP_V') && define('LSCWP_V', '7.0-a10');

!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
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
* **Core** Minimum required PHP version escalated to PHP v7.2.0.
* **Core** Minimum required WP version escalated to WP v5.3.
* **Cloud** Dropped `Domain Key`. Used sodium encryption for authentication and validation.
* **Config** Improved QUIC.cloud CDN config to auto turn ON after activiated online service.
* **GUI** New QUIC.cloud CDN tab.
* **GUI** Switch buttons rtl compatibility. (Eliza/Mehrshad Darzi #603)
* **Tag** Fixed a potential warning in tags. (ikiterder)
* **Misc** Improved readme file by adding min supported PHP/WP versions. (Viktor Szépe)
Expand Down
119 changes: 53 additions & 66 deletions tpl/cdn/qc.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,79 +4,66 @@

defined('WPINC') || exit;

$__cloud = Cloud::cls();
$cloud_summary = Cloud::get_summary();

?>

<div class="litespeed-dashboard-header">
<h3 class="litespeed-dashboard-title"><?php echo __('QUIC.cloud', 'litespeed-cache'); ?></h3>
<hr>
<?php echo __('To manage QUIC.cloud options, please visit', 'litespeed-cache'); ?>: <a href="<?php echo Cloud::cls()->qc_link(); ?>" target="_blank" class="button litespeed-btn-warning">My QUIC.cloud</a>
<a class="button litespeed-btn-success litespeed-right10" href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_SYNC_STATUS); ?>">
<span class="dashicons dashicons-update"></span>
<?php echo __('Sync', 'litespeed-cache'); ?>
<span class="screen-reader-text"><?php echo __('Refresh QUIC.cloud status', 'litespeed-cache'); ?></span>
</a>
<?php echo __('To manage QUIC.cloud options, please visit', 'litespeed-cache'); ?>: <a href="<?php echo $__cloud->qc_link(); ?>" target="_blank" class="button litespeed-btn-warning">My QUIC.cloud</a>
</div>

<?php if (isset($setup_summary['cdn_dns_summary'])) { ?>
<h4>
<?php echo __('QUIC.cloud Detected Records Summary', 'litespeed-cache'); ?>
</h4>
<table class="wp-list-table widefat striped litespeed-width-auto litespeed-table-compact">
<thead>
<tr>
<th>
<?php echo __('Record Type', 'litespeed-cache'); ?>
</th>
<th>
<?php echo __('Count', 'litespeed-cache'); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($setup_summary['cdn_dns_summary']['types'] as $type => $cnt) {
echo '<tr><td>' . wp_kses_post($type) . '</td><td>' . wp_kses_post($cnt) . '</td></tr>';
} ?>
</tbody>
</table>
<?php if (!$__cloud->activated()) : ?>
<div class="litespeed-top20 litespeed-relative">
<div class="litespeed-dashboard-unlock">
<div>
<h3 class="litespeed-dashboard-unlock-title"><strong class="litespeed-qc-text-gradient">Accelerate, Optimize, Protect</strong></h3>
<p class="litespeed-dashboard-unlock-desc">Speed up your WordPress site even further with <strong>QUIC.cloud Online Services and CDN</strong>.</p>
<p>Free monthly quota available.</p>
<p><a class="button button-primary" href="<?php echo Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE); ?>"><span class="dashicons dashicons-yes"></span>Enable QUIC.cloud services</a></p>
<p class="litespeed-dashboard-unlock-footer">
<a href="https://www.quic.cloud/" target="_blank">Learn More about QUIC.cloud</a><br>
QUIC.cloud services are not required
</p>
</div>
</div>
</div>

<p>
<?php echo __('Record names found', 'litespeed-cache') . ': ' . wp_kses_post($setup_summary['cdn_dns_summary']['names']); ?>
</p>
<p>
<?php echo __('Is something missing?', 'litespeed-cache'); ?>
<div class="litespeed-top20">
<?php Doc::learn_more(
Cloud::CLOUD_SERVER_DASH . '/dns/find/' . $dom,
__('Review DNS records', 'litespeed-cache') . ' <span class="dashicons dashicons-external"></span>',
false,
'litespeed-link-with-icon'
Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE),
__('Activate QUIC.cloud', 'litespeed-cache'),
true,
'button litespeed-btn-warning'
); ?>
</p>
<p>
<?php echo __('Note: For 15 to 20 minutes after setup completes, browsers may issue a "not secure" warning for your site while QUIC.cloud generates your SSL certificate.', 'litespeed-cache'); ?>
</p>
<?php } ?>

<?php if ($nameservers) { ?>

<div>
<?php Doc::learn_more(($disabled ? '#' : Utility::build_url(Router::ACTION_CDN_SETUP, $apply_btn_type)), $apply_btn_txt, true, 'button button-primary ' . $disabled); ?>
</div>

<h3 class="litespeed-title-section">
<?php echo __('Nameservers', 'litespeed-cache'); ?>
</h3>

<p>
<?php echo __('Please update your domain registrar to use these custom nameservers:', 'litespeed-cache'); ?>
</p>
<ul>
<?php
foreach ($nameservers as $nameserver) {
echo '<li><strong>' . $nameserver . '</strong></li>';
}
?>
</ul>
<p>
<?php echo __('QUIC.cloud will attempt to verify the DNS update.', 'litespeed-cache'); ?>
<?php echo __('If it does not verify within 24 hours, the CDN setup will mark the verification as failed.', 'litespeed-cache'); ?>
<?php echo __('At that stage, you may re-start the verification process by pressing the Run CDN Setup button.', 'litespeed-cache'); ?>
</p>
<?php } ?>

<p>
<?php echo __('After you set your nameservers/cname, QUIC.cloud will detect the change and automatically enable the CDN.', 'litespeed-cache'); ?>
</p>
<?php elseif (empty($cloud_summary['qc_activated']) || $cloud_summary['qc_activated'] != 'cdn') : ?>
<div class="litespeed-top20">
<p class="litespeed-text-bold litespeed-margin-bottom20">
<?php Doc::learn_more(
Utility::build_url(Router::ACTION_CLOUD, Cloud::TYPE_ENABLE_CDN),
__('Enable QUIC.cloud CDN', 'litespeed-cache'),
true,
'button litespeed-btn-success'
); ?>
</p>
<p class="litespeed-margin-y5">
<?php echo __('Best available WordPress performance', 'litespeed-cache'); ?>
</p>
<p class="litespeed-margin-y5">
<?php echo sprintf(__('Globally fast TTFB, easy setup, and <a %s>more</a>!', 'litespeed-cache'), ' href="https://www.quic.cloud/quic-cloud-services-and-features/litespeed-cache-service/" target="_blank"'); ?>
</p>
<div class="litespeed-top10">
<img src="<?php echo LSWCP_PLUGIN_URL; ?>assets/img/quic-cloud-logo.svg" alt="QUIC.cloud" width="45%" height="auto">
</div>
</div>
<?php else : ?>
<?php echo $__cloud->load_qc_status_for_dash('cdn_dash'); ?>
<?php endif; ?>

0 comments on commit f68351e

Please sign in to comment.