Initial commit: Atomaste website
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache General Settings
|
||||
*
|
||||
* Manages general settings interface for LiteSpeed Cache.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$menu_list = array(
|
||||
'online' => esc_html__( 'Online Services', 'litespeed-cache' ),
|
||||
'settings' => esc_html__( 'General Settings', 'litespeed-cache' ),
|
||||
'settings_tuning' => esc_html__( 'Tuning', 'litespeed-cache' ),
|
||||
);
|
||||
|
||||
if ( is_network_admin() ) {
|
||||
$menu_list = array(
|
||||
'network_settings' => esc_html__( 'General Settings', 'litespeed-cache' ),
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="litespeed-h1">
|
||||
<?php esc_html_e( 'LiteSpeed Cache General Settings', 'litespeed-cache' ); ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo esc_html( Core::VER ); ?>
|
||||
</span>
|
||||
<hr class="wp-header-end">
|
||||
</div>
|
||||
|
||||
<div class="litespeed-wrap">
|
||||
<h2 class="litespeed-header nav-tab-wrapper">
|
||||
<?php GUI::display_tab_list( $menu_list ); ?>
|
||||
</h2>
|
||||
|
||||
<div class="litespeed-body">
|
||||
<?php
|
||||
foreach ( $menu_list as $menu_key => $val ) {
|
||||
echo '<div data-litespeed-layout="' . esc_attr( $menu_key ) . '">';
|
||||
require LSCWP_DIR . 'tpl/general/' . $menu_key . '.tpl.php';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Network General Settings
|
||||
*
|
||||
* Manages network-wide general settings for LiteSpeed Cache.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$this->form_action();
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php esc_html_e( 'General Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/' ); ?>
|
||||
</h3>
|
||||
|
||||
<?php
|
||||
$this->form_action( Router::ACTION_SAVE_SETTINGS_NETWORK );
|
||||
?>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<?php require LSCWP_DIR . 'tpl/general/settings_inc.auto_upgrade.tpl.php'; ?>
|
||||
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Use Primary Site Configuration', 'litespeed-cache' ); ?></th>
|
||||
<td>
|
||||
<?php $this->build_switch( Base::NETWORK_O_USE_PRIMARY ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php esc_html_e( "Check this option to use the primary site's configuration for all subsites.", 'litespeed-cache' ); ?>
|
||||
<?php esc_html_e( 'This will disable the settings page on all subsites.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php require LSCWP_DIR . 'tpl/general/settings_inc.guest.tpl.php'; ?>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
$this->form_end();
|
||||
?>
|
||||
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache QUIC.cloud Online Services
|
||||
*
|
||||
* Manages QUIC.cloud online services integration for LiteSpeed Cache.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$cloud_summary = Cloud::get_summary();
|
||||
|
||||
$cloud_instance = Cloud::cls();
|
||||
$cloud_instance->finish_qc_activation( 'online' );
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php esc_html_e( 'QUIC.cloud Online Services', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://www.quic.cloud/quic-cloud-services-and-features/' ); ?>
|
||||
</h3>
|
||||
|
||||
<div class="litespeed-desc"><?php esc_html_e( 'QUIC.cloud provides CDN and online optimization services, and is not required. You may use many features of this plugin without QUIC.cloud.', 'litespeed-cache' ); ?></div>
|
||||
|
||||
<?php if ( $cloud_instance->activated() ) : ?>
|
||||
<div class="litespeed-callout notice notice-success inline">
|
||||
<h4><?php esc_html_e( 'Current Cloud Nodes in Service', 'litespeed-cache' ); ?>
|
||||
<a class="litespeed-right litespeed-redetect" href="<?php echo esc_url( Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_CLEAR_CLOUD, false, null, array( 'ref' => 'online' ) ) ); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php esc_html_e( 'Click to clear all nodes for further redetection.', 'litespeed-cache' ); ?>' data-litespeed-cfm="<?php esc_html_e( 'Are you sure you want to clear all cloud nodes?', 'litespeed-cache' ); ?>"><i class='litespeed-quic-icon'></i> <?php esc_html_e( 'Redetect', 'litespeed-cache' ); ?></a>
|
||||
</h4>
|
||||
<p>
|
||||
<?php
|
||||
$has_service = false;
|
||||
foreach ( Cloud::$services as $svc ) {
|
||||
if ( isset( $cloud_summary[ 'server.' . $svc ] ) ) {
|
||||
$has_service = true;
|
||||
printf(
|
||||
'<p><strong>%1$s</strong> <code>%2$s</code> <strong>%3$s</strong> <code>%4$s</code> <strong>%5$s</strong> <code>%6$s</code></p>',
|
||||
esc_html__( 'Service:', 'litespeed-cache' ),
|
||||
esc_html( $svc ),
|
||||
esc_html__( 'Node:', 'litespeed-cache' ),
|
||||
esc_html( $cloud_summary[ 'server.' . $svc ] ),
|
||||
esc_html__( 'Connected Date:', 'litespeed-cache' ),
|
||||
esc_html( Utility::readable_time( $cloud_summary[ 'server_date.' . $svc ] ) )
|
||||
);
|
||||
}
|
||||
}
|
||||
if ( ! $has_service ) {
|
||||
esc_html_e( 'No cloud services currently in use', 'litespeed-cache' );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $cloud_instance->activated() ) : ?>
|
||||
<h4 class="litespeed-text-md litespeed-top30"><span class="dashicons dashicons-no-alt litespeed-danger"></span> <?php esc_html_e( 'QUIC.cloud Integration Disabled', 'litespeed-cache' ); ?></h4>
|
||||
<p><?php esc_html_e( 'Speed up your WordPress site even further with QUIC.cloud Online Services and CDN.', 'litespeed-cache' ); ?></p>
|
||||
<div class="litespeed-desc"><?php esc_html_e( 'Free monthly quota available.', 'litespeed-cache' ); ?></div>
|
||||
<p><a class="button button-primary" href="<?php echo esc_url( Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE, false, null, array( 'ref' => 'online' ) ) ); ?>">
|
||||
<span class="dashicons dashicons-yes"></span>
|
||||
<?php esc_html_e( 'Enable QUIC.cloud services', 'litespeed-cache' ); ?>
|
||||
</a></p>
|
||||
|
||||
<div>
|
||||
<h3 class="litespeed-title-section"><?php esc_html_e( 'Online Services', 'litespeed-cache' ); ?></h3>
|
||||
<p><?php esc_html_e( "QUIC.cloud's Online Services improve your site in the following ways:", 'litespeed-cache' ); ?></p>
|
||||
<ul>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo wp_kses_post( __( '<strong>Image Optimization</strong> gives you smaller image file sizes that transmit faster.', 'litespeed-cache' ) ); ?></li>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo wp_kses_post( __( '<strong>Page Optimization</strong> streamlines page styles and visual elements for faster loading.', 'litespeed-cache' ) ); ?></li>
|
||||
</ul>
|
||||
|
||||
<h4 class="litespeed-text-md litespeed-margin-bottom-remove"><?php esc_html_e( 'Image Optimization', 'litespeed-cache' ); ?></h4>
|
||||
<p><?php esc_html_e( "QUIC.cloud's Image Optimization service does the following:", 'litespeed-cache' ); ?></p>
|
||||
<ul>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php esc_html_e( "Processes your uploaded PNG and JPG images to produce smaller versions that don't sacrifice quality.", 'litespeed-cache' ); ?></li>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php esc_html_e( 'Optionally creates next-generation WebP or AVIF image files.', 'litespeed-cache' ); ?></li>
|
||||
</ul>
|
||||
<p><?php esc_html_e( 'Processing for PNG, JPG, and WebP image formats is free. AVIF is available for a fee.', 'litespeed-cache' ); ?> <a href="https://www.quic.cloud/quic-cloud-services-and-features/image-optimization-service/" target="_blank"><?php esc_html_e( 'Learn More', 'litespeed-cache' ); ?></a></p>
|
||||
|
||||
<h4 class="litespeed-text-md litespeed-margin-bottom-remove"><?php esc_html_e( 'Page Optimization', 'litespeed-cache' ); ?></h4>
|
||||
<p><?php esc_html_e( "QUIC.cloud's Page Optimization services address CSS bloat, and improve the user experience during page load, which can lead to improved page speed scores.", 'litespeed-cache' ); ?></p>
|
||||
<ul>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo wp_kses_post( __( '<strong>Critical CSS (CCSS)</strong> loads visible above-the-fold content faster and with full styling.', 'litespeed-cache' ) ); ?></li>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo wp_kses_post( __( '<strong>Unique CSS (UCSS)</strong> removes unused style definitions for a speedier page load overall.', 'litespeed-cache' ) ); ?></li>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo wp_kses_post( __( '<strong>Low Quality Image Placeholder (LQIP)</strong> gives your imagery a more pleasing look as it lazy loads.', 'litespeed-cache' ) ); ?></li>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo wp_kses_post( __( '<strong>Viewport Images (VPI)</strong> provides a well-polished fully-loaded view above the fold.', 'litespeed-cache' ) ); ?></li>
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
<a href="https://www.quic.cloud/quic-cloud-services-and-features/page-optimization/"><?php esc_html_e( 'Learn More', 'litespeed-cache' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="litespeed-title-section"><?php esc_html_e( 'Content Delivery Network', 'litespeed-cache' ); ?></h3>
|
||||
|
||||
<h4 class="litespeed-text-md litespeed-margin-bottom-remove"><?php esc_html_e( 'QUIC.cloud CDN:', 'litespeed-cache' ); ?></h4>
|
||||
<ul>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo wp_kses_post( __( 'Caches your entire site, including dynamic content and <strong>ESI blocks</strong>.', 'litespeed-cache' ) ); ?></li>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo wp_kses_post( __( 'Delivers global coverage with a growing <strong>network of 80+ PoPs</strong>.', 'litespeed-cache' ) ); ?></li>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo wp_kses_post( __( 'Provides <strong>security at the CDN level</strong>, protecting your server from attack.', 'litespeed-cache' ) ); ?></li>
|
||||
<li><span class="dashicons dashicons-saved litespeed-primary"></span> <?php echo wp_kses_post( __( 'Offers optional <strong>built-in DNS service</strong> to simplify CDN onboarding.', 'litespeed-cache' ) ); ?></li>
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
<a href="https://www.quic.cloud/quic-cloud-services-and-features/quic-cloud-cdn-service/"><?php esc_html_e( 'Learn More', 'litespeed-cache' ); ?></a>
|
||||
</div>
|
||||
|
||||
<hr class="litespeed-hr-with-space">
|
||||
|
||||
<p class="litespeed-desc"><?php esc_html_e( 'In order to use most QUIC.cloud services, you need quota. QUIC.cloud gives you free quota every month, but if you need more, you can purchase it.', 'litespeed-cache' ); ?> <a href="https://docs.quic.cloud/billing/services/" target="_blank"><?php esc_html_e( 'Learn More', 'litespeed-cache' ); ?></a></p>
|
||||
|
||||
<div class="litespeed-flex litespeed-flex-align-center">
|
||||
<a class="button button-secondary litespeed-right20" href="<?php echo esc_url( Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE, false, null, array( 'ref' => 'online' ) ) ); ?>">
|
||||
<span class="dashicons dashicons-yes"></span>
|
||||
<?php esc_html_e( 'Enable QUIC.cloud services', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php elseif ( ! empty( $cloud_summary['qc_activated'] ) && ( 'linked' === $cloud_summary['qc_activated'] || 'cdn' === $cloud_summary['qc_activated'] ) ) : ?>
|
||||
<h4 class="litespeed-text-md litespeed-top30"><span class="dashicons dashicons-saved litespeed-success"></span> <?php esc_html_e( 'QUIC.cloud Integration Enabled', 'litespeed-cache' ); ?></h4>
|
||||
<p><?php esc_html_e( 'Your site is connected and ready to use QUIC.cloud Online Services.', 'litespeed-cache' ); ?>
|
||||
<?php if ( empty( $cloud_summary['partner'] ) ) : ?>
|
||||
<a href="<?php echo esc_url( $cloud_instance->qc_link() ); ?>" class="litespeed-link-with-icon" target="_blank"><?php esc_html_e( 'Go to QUIC.cloud dashboard', 'litespeed-cache' ); ?> <span class="dashicons dashicons-external"></span></a>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><span class="dashicons dashicons-yes litespeed-success"></span> <?php esc_html_e( 'Page Optimization', 'litespeed-cache' ); ?></li>
|
||||
<li><span class="dashicons dashicons-yes litespeed-success"></span> <?php esc_html_e( 'Image Optimization', 'litespeed-cache' ); ?></li>
|
||||
<?php if ( 'cdn' === $cloud_summary['qc_activated'] ) : ?>
|
||||
<li><span class="dashicons dashicons-yes litespeed-success"></span> <?php esc_html_e( 'CDN - Enabled', 'litespeed-cache' ); ?></li>
|
||||
<?php else : ?>
|
||||
<li><span class="dashicons dashicons-no-alt litespeed-default"></span> <span class="litespeed-default"><?php esc_html_e( 'CDN - Disabled', 'litespeed-cache' ); ?></span></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<?php else : ?>
|
||||
<h4 class="litespeed-text-md litespeed-top30"><span class="dashicons dashicons-saved litespeed-success"></span> <?php esc_html_e( 'QUIC.cloud Integration Enabled with limitations', 'litespeed-cache' ); ?></h4>
|
||||
<p><?php echo wp_kses_post( __( 'Your site is connected and using QUIC.cloud Online Services as an <strong>anonymous user</strong>. The CDN function and certain features of optimization services are not available for anonymous users. Link to QUIC.cloud to use the CDN and all available Online Services features.', 'litespeed-cache' ) ); ?></p>
|
||||
<div class="litespeed-desc"><?php esc_html_e( 'Free monthly quota available.', 'litespeed-cache' ); ?></div>
|
||||
|
||||
<ul>
|
||||
<li><span class="dashicons dashicons-yes litespeed-success"></span> <?php esc_html_e( 'Page Optimization', 'litespeed-cache' ); ?></li>
|
||||
<li><span class="dashicons dashicons-yes litespeed-success"></span> <?php esc_html_e( 'Image Optimization', 'litespeed-cache' ); ?></li>
|
||||
<li><span class="dashicons dashicons-no-alt litespeed-danger"></span> <?php esc_html_e( 'CDN - not available for anonymous users', 'litespeed-cache' ); ?></li>
|
||||
</ul>
|
||||
|
||||
<p><a class="button button-primary" href="<?php echo esc_url( Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_ACTIVATE, false, null, array( 'ref' => 'online' ) ) ); ?>"><span class="dashicons dashicons-yes"></span><?php esc_html_e( 'Link to QUIC.cloud', 'litespeed-cache' ); ?></a></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $cloud_instance->activated() ) : ?>
|
||||
<div class="litespeed-empty-space-medium"></div>
|
||||
<div class="litespeed-column-with-boxes-footer">
|
||||
<a href="<?php echo esc_url( Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_RESET, false, null, array( 'ref' => 'online' ) ) ); ?>" class="litespeed-link-with-icon litespeed-danger" data-litespeed-cfm="<?php esc_html_e( 'Are you sure you want to disconnect from QUIC.cloud? This will not remove any data from the QUIC.cloud dashboard.', 'litespeed-cache' ); ?>"><span class="dashicons dashicons-dismiss"></span><?php esc_html_e( 'Disconnect from QUIC.cloud', 'litespeed-cache' ); ?></a>
|
||||
<div class="litespeed-desc litespeed-margin-bottom-remove"><?php esc_html_e( 'Remove QUIC.cloud integration from this site. Note: QUIC.cloud data will be preserved so you can re-enable services at any time. If you want to fully remove your site from QUIC.cloud, delete the domain through the QUIC.cloud Dashboard first.', 'litespeed-cache' ); ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache General Settings
|
||||
*
|
||||
* Manages general settings for LiteSpeed Cache, including Guest Mode optimization, server IP, and news settings.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$cloud_instance = Cloud::cls();
|
||||
$cloud_summary = Cloud::get_summary();
|
||||
|
||||
$ajax_url_get_ip = function_exists('get_rest_url') ? get_rest_url(null, 'litespeed/v1/tool/check_ip') : '/';
|
||||
|
||||
$this->form_action();
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php esc_html_e( 'General Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table">
|
||||
<tbody>
|
||||
<?php if ( ! $this->_is_multisite ) : ?>
|
||||
<?php require LSCWP_DIR . 'tpl/general/settings_inc.auto_upgrade.tpl.php'; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->_is_multisite ) : ?>
|
||||
<?php require LSCWP_DIR . 'tpl/general/settings_inc.guest.tpl.php'; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $option_id = Base::O_GUEST_OPTM; ?>
|
||||
<?php $this->title( $option_id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $option_id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<span class="litespeed-danger litespeed-text-bold">
|
||||
🚨
|
||||
<?php esc_html_e( 'This option enables maximum optimization for Guest Mode visitors.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/#guest-optimization', esc_html__( 'Please read all warnings before enabling this option.', 'litespeed-cache' ), false, 'litespeed-danger' ); ?>
|
||||
</span>
|
||||
|
||||
<?php
|
||||
$type_list = array();
|
||||
if ( $this->conf( Base::O_GUEST ) && ! $this->conf( Base::O_OPTM_UCSS ) ) {
|
||||
$type_list[] = 'UCSS';
|
||||
}
|
||||
if ( $this->conf( Base::O_GUEST ) && ! $this->conf( Base::O_OPTM_CSS_ASYNC ) ) {
|
||||
$type_list[] = 'CCSS';
|
||||
}
|
||||
if ( ! empty( $type_list ) ) {
|
||||
$the_type = implode( '/', $type_list );
|
||||
echo '<br />';
|
||||
echo '<font class="litespeed-info">';
|
||||
echo '⚠️ ' . sprintf( esc_html__( 'Your %1$s quota on %2$s will still be in use.', 'litespeed-cache' ), esc_html( $the_type ), 'QUIC.cloud' );
|
||||
echo '</font>';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( ! $this->conf( Base::O_GUEST ) ) : ?>
|
||||
<br />
|
||||
<font class="litespeed-warning litespeed-left10">
|
||||
⚠️ <?php esc_html_e( 'Notice', 'litespeed-cache' ); ?>: <?php printf( esc_html__( '%s must be turned ON for this setting to work.', 'litespeed-cache' ), '<code>' . esc_html( Lang::title( Base::O_GUEST ) ) . '</code>' ); ?>
|
||||
</font>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->conf( Base::O_CACHE_MOBILE ) ) : ?>
|
||||
<br />
|
||||
<font class="litespeed-primary litespeed-left10">
|
||||
⚠️ <?php esc_html_e( 'Notice', 'litespeed-cache' ); ?>: <?php printf( esc_html__( 'You need to turn %s on to get maximum result.', 'litespeed-cache' ), '<code>' . esc_html( Lang::title( Base::O_CACHE_MOBILE ) ) . '</code>' ); ?>
|
||||
</font>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->conf( Base::O_IMG_OPTM_WEBP ) ) : ?>
|
||||
<br />
|
||||
<font class="litespeed-primary litespeed-left10">
|
||||
⚠️ <?php esc_html_e( 'Notice', 'litespeed-cache' ); ?>: <?php printf( esc_html__( 'You need to turn %s on and finish all WebP generation to get maximum result.', 'litespeed-cache' ), '<code>' . esc_html( Lang::title( Base::O_IMG_OPTM_WEBP ) ) . '</code>' ); ?>
|
||||
</font>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $option_id = Base::O_SERVER_IP; ?>
|
||||
<?php $this->title( $option_id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $option_id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php esc_html_e( "Enter this site's IP address to allow cloud services directly call IP instead of domain name. This eliminates the overhead of DNS and CDN lookups.", 'litespeed-cache' ); ?>
|
||||
<br /><?php esc_html_e( 'Your server IP', 'litespeed-cache' ); ?>: <code id='litespeed_server_ip'>-</code> <a href="javascript:;" class="button button-link" id="litespeed_get_ip"><?php esc_html_e( 'Check my public IP from', 'litespeed-cache' ); ?> CyberPanel.sh</a>
|
||||
⚠️ <?php esc_html_e( 'Notice', 'litespeed-cache' ); ?>: <?php esc_html_e( 'the auto-detected IP may not be accurate if you have an additional outgoing IP set, or you have multiple IPs configured on your server.', 'litespeed-cache' ); ?>
|
||||
<br /><?php esc_html_e( 'Please make sure this IP is the correct one for visiting your site.', 'litespeed-cache' ); ?>
|
||||
|
||||
<?php $this->_validate_ip( $option_id ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $option_id = Base::O_NEWS; ?>
|
||||
<?php $this->title( $option_id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $option_id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php esc_html_e( 'Turn this option ON to show latest news automatically, including hotfixes, new releases, available beta versions, and promotions.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php $this->form_end(); ?>
|
||||
|
||||
<script>
|
||||
(function ($) {
|
||||
jQuery(document).ready(function () {
|
||||
/**
|
||||
* Get server IP
|
||||
* @since 3.0
|
||||
*/
|
||||
$('#litespeed_get_ip').on('click', function (e) {
|
||||
console.log('[litespeed] get server IP');
|
||||
$.ajax({
|
||||
url: '<?php echo $ajax_url_get_ip; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>',
|
||||
dataType: 'json',
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader('X-WP-Nonce', '<?php echo esc_js(wp_create_nonce('wp_rest')); ?>');
|
||||
$('#litespeed_server_ip').html('Detecting...');
|
||||
},
|
||||
success: function (data) {
|
||||
$('#litespeed_server_ip').html('Done');
|
||||
console.log('[litespeed] get server IP response: ' + data);
|
||||
$('#litespeed_server_ip').html(data);
|
||||
},
|
||||
error: function (xhr, error) {
|
||||
console.log('[litespeed] get server IP error', error);
|
||||
$('#litespeed_server_ip').html('Failed to detect IP');
|
||||
},
|
||||
complete: function (xhr, status) {
|
||||
console.log('[litespeed] AJAX complete', status, xhr);
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Auto Upgrade Setting
|
||||
*
|
||||
* Manages the auto-upgrade setting for LiteSpeed Cache.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<!-- build_setting_auto_upgrade -->
|
||||
<tr>
|
||||
<th>
|
||||
<?php $option_id = Base::O_AUTO_UPGRADE; ?>
|
||||
<?php $this->title( $option_id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $option_id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php esc_html_e( 'Turn this option ON to have LiteSpeed Cache updated automatically, whenever a new version is released. If OFF, update manually as usual.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Guest Mode Setting
|
||||
*
|
||||
* Manages the Guest Mode setting for LiteSpeed Cache.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$guest_update_url = wp_parse_url( LSWCP_PLUGIN_URL . GUI::PHP_GUEST, PHP_URL_PATH );
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $option_id = Base::O_GUEST; ?>
|
||||
<?php $this->title( $option_id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $option_id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php esc_html_e( "Guest Mode provides an always cacheable landing page for an automated guest's first time visit, and then attempts to update cache varies via AJAX.", 'litespeed-cache' ); ?>
|
||||
<?php esc_html_e( 'This option can help to correct the cache vary for certain advanced mobile or tablet visitors.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/#guest-mode' ); ?>
|
||||
<br /><?php Doc::notice_htaccess(); ?>
|
||||
<br /><?php Doc::crawler_affected(); ?>
|
||||
</div>
|
||||
<?php if ( $this->conf( $option_id ) ) : ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php esc_html_e( 'Guest Mode testing result', 'litespeed-cache' ); ?>:
|
||||
<font id='litespeed_gm_status'><?php esc_html_e( 'Testing', 'litespeed-cache' ); ?>...</font>
|
||||
</div>
|
||||
<script>
|
||||
(function ($) {
|
||||
jQuery(document).ready(function () {
|
||||
$.post( '<?php echo $guest_update_url; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>', function(data){
|
||||
if ( data === '[]' || data === '{"reload":"yes"}' ) {
|
||||
$('#litespeed_gm_status').html('<font class="litespeed-success"><?php esc_html_e( 'Guest Mode passed testing.', 'litespeed-cache' ); ?></font>');
|
||||
}
|
||||
else {
|
||||
$('#litespeed_gm_status').html('<font class="litespeed-danger"><?php esc_html_e( 'Guest Mode failed to test.', 'litespeed-cache' ); ?></font>');
|
||||
}
|
||||
}).fail( function(){
|
||||
$('#litespeed_gm_status').html('<font class="litespeed-danger"><?php esc_html_e( 'Guest Mode failed to test.', 'litespeed-cache' ); ?></font>');
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Tuning Settings
|
||||
*
|
||||
* Manages tuning settings for LiteSpeed Cache, including Guest Mode configurations.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$this->form_action();
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php esc_html_e( 'Tuning Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/#tuning-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $option_id = Base::O_GUEST_UAS; ?>
|
||||
<?php $this->title( $option_id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $option_id, 30 ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $option_id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php esc_html_e( 'Listed User Agents will be considered as Guest Mode visitors.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $option_id = Base::O_GUEST_IPS; ?>
|
||||
<?php $this->title( $option_id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $option_id, 50 ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $option_id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php esc_html_e( 'Listed IPs will be considered as Guest Mode visitors.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<?php $this->form_end(); ?>
|
||||
Reference in New Issue
Block a user