Initial commit: Atomaste website

This commit is contained in:
2025-12-10 12:17:30 -05:00
commit 0b9e5d1605
19260 changed files with 5206382 additions and 0 deletions

View File

@@ -0,0 +1,150 @@
<?php
/**
* LiteSpeed Cache Settings
*
* Displays the cache settings page with tabbed navigation for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
if ( $this->_is_network_admin ) {
$menu_list = array(
'cache' => __( 'Cache', 'litespeed-cache' ),
'purge' => __( 'Purge', 'litespeed-cache' ),
'excludes' => __( 'Excludes', 'litespeed-cache' ),
'object' => __( 'Object', 'litespeed-cache' ),
'browser' => __( 'Browser', 'litespeed-cache' ),
'advanced' => __( 'Advanced', 'litespeed-cache' ),
);
?>
<div class="wrap">
<h1 class="litespeed-h1">
<?php esc_html_e( 'LiteSpeed Cache Network Cache Settings', 'litespeed-cache' ); ?>
</h1>
<span class="litespeed-desc">
<?php echo esc_html( 'v' . 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 $this->cache_disabled_warning(); ?>
<?php
$this->form_action( Router::ACTION_SAVE_SETTINGS_NETWORK );
foreach ( $menu_list as $k => $val ) {
$k_escaped = esc_attr( $k );
?>
<div data-litespeed-layout="<?php echo esc_html( $k_escaped ); ?>">
<?php
require LSCWP_DIR . "tpl/cache/network_settings-$k.tpl.php";
?>
</div>
<?php
}
$this->form_end();
?>
</div>
</div>
<?php
return;
}
$menu_list = array(
'cache' => __( 'Cache', 'litespeed-cache' ),
'ttl' => __( 'TTL', 'litespeed-cache' ),
'purge' => __( 'Purge', 'litespeed-cache' ),
'excludes' => __( 'Excludes', 'litespeed-cache' ),
'esi' => __( 'ESI', 'litespeed-cache' ),
);
if ( ! $this->_is_multisite ) {
$menu_list['object'] = __( 'Object', 'litespeed-cache' );
$menu_list['browser'] = __( 'Browser', 'litespeed-cache' );
}
$menu_list['advanced'] = __( 'Advanced', 'litespeed-cache' );
/**
* Generate roles for setting usage
*
* @since 1.6.2
*/
global $wp_roles;
$wp_orig_roles = $wp_roles;
if ( ! isset( $wp_roles ) ) {
$wp_orig_roles = new \WP_Roles();
}
$roles = array();
foreach ( $wp_orig_roles->roles as $k => $v ) {
$roles[ $k ] = $v['name'];
}
ksort( $roles );
?>
<div class="wrap">
<h1 class="litespeed-h1">
<?php esc_html_e( 'LiteSpeed Cache Settings', 'litespeed-cache' ); ?>
</h1>
<span class="litespeed-desc">
<?php echo esc_html( 'v' . Core::VER ); ?>
</span>
<hr class="wp-header-end">
</div>
<div class="litespeed-wrap">
<h2 class="litespeed-header nav-tab-wrapper">
<?php
$i = 1;
$accesskey_set = array();
foreach ( $menu_list as $k => $val ) {
$accesskey = '';
if ( $i <= 9 ) {
$accesskey = $i;
} else {
$tmp = strtoupper( substr( $k, 0, 1 ) );
if ( ! in_array( $tmp, $accesskey_set, true ) ) {
$accesskey_set[] = $tmp;
$accesskey = esc_attr( $tmp );
}
}
printf('<a class="litespeed-tab nav-tab" href="#%1$s" data-litespeed-tab="%1$s" litespeed-accesskey="%2$s">%3$s</a>', esc_attr( $k ), esc_attr($accesskey), esc_html( $val ));
++$i;
}
do_action( 'litespeed_settings_tab', 'cache' );
?>
</h2>
<div class="litespeed-body">
<?php $this->cache_disabled_warning(); ?>
<?php
$this->form_action();
require LSCWP_DIR . 'tpl/inc/check_if_network_disable_all.php';
require LSCWP_DIR . 'tpl/cache/more_settings_tip.tpl.php';
foreach ( $menu_list as $k => $val ) {
echo '<div data-litespeed-layout="' . esc_attr( $k ) . '">';
require LSCWP_DIR . "tpl/cache/settings-$k.tpl.php";
echo '</div>';
}
do_action( 'litespeed_settings_content', 'cache' );
$this->form_end();
?>
</div>
</div>

View File

@@ -0,0 +1,32 @@
<?php
/**
* LiteSpeed Cache Setting Tip
*
* Displays a notice to inform users about additional LiteSpeed Cache settings.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
global $pagenow;
if ( 'options-general.php' !== $pagenow ) {
return;
}
?>
<div class="litespeed-callout notice notice-success inline">
<h4><?php esc_html_e( 'NOTE', 'litespeed-cache' ); ?></h4>
<p>
<?php
printf(
/* translators: %s: LiteSpeed Cache menu label */
esc_html__( 'More settings available under %s menu', 'litespeed-cache' ),
'<code>' . esc_html__( 'LiteSpeed Cache', 'litespeed-cache' ) . '</code>'
);
?>
</p>
</div>

View File

@@ -0,0 +1,25 @@
<?php
/**
* LiteSpeed Cache Advanced Settings
*
* Displays the advanced settings section for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Advanced Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#advanced-tab' ); ?>
</h3>
<table class="wp-list-table striped litespeed-table">
<tbody>
<?php require LSCWP_DIR . 'tpl/cache/settings_inc.login_cookie.tpl.php'; ?>
</tbody>
</table>

View File

@@ -0,0 +1,15 @@
<?php
/**
* LiteSpeed Cache Browser Settings
*
* Includes the browser cache settings template for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
require LSCWP_DIR . 'tpl/cache/settings_inc.browser.tpl.php';

View File

@@ -0,0 +1,40 @@
<?php
/**
* LiteSpeed Cache Network Cache Settings
*
* Displays the network cache control settings section for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Cache Control Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/' ); ?>
</h3>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th><?php esc_html_e( 'Network Enable Cache', 'litespeed-cache' ); ?></th>
<td>
<?php $this->build_switch( Base::O_CACHE ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Enabling LiteSpeed Cache for WordPress here enables the cache for the network.', 'litespeed-cache' ); ?><br />
<?php esc_html_e( 'It is STRONGLY recommended that the compatibility with other plugins on a single/few sites is tested first.', 'litespeed-cache' ); ?><br />
<?php esc_html_e( 'This is to ensure compatibility prior to enabling the cache for all sites.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<?php
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_mobile.tpl.php';
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_dropquery.tpl.php';
?>
</tbody>
</table>

View File

@@ -0,0 +1,31 @@
<?php
/**
* LiteSpeed Cache Network Exclude Settings
*
* Displays the network exclude settings section for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Exclude Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#excludes-tab' ); ?>
</h3>
<table class="wp-list-table striped litespeed-table">
<tbody>
<?php
// Cookie
require LSCWP_DIR . 'tpl/cache/settings_inc.exclude_cookies.tpl.php';
// User Agent
require LSCWP_DIR . 'tpl/cache/settings_inc.exclude_useragent.tpl.php';
?>
</tbody>
</table>

View File

@@ -0,0 +1,15 @@
<?php
/**
* LiteSpeed Cache Network Object Settings
*
* Includes the network object cache settings template for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
require LSCWP_DIR . 'tpl/cache/settings_inc.object.tpl.php';

View File

@@ -0,0 +1,25 @@
<?php
/**
* LiteSpeed Cache Network Purge Settings
*
* Displays the network purge settings section for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Purge Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#purge-tab' ); ?>
</h3>
<table class="wp-list-table striped litespeed-table">
<tbody>
<?php require LSCWP_DIR . 'tpl/cache/settings_inc.purge_on_upgrade.tpl.php'; ?>
</tbody>
</table>

View File

@@ -0,0 +1,82 @@
<?php
/**
* Advanced Settings Template
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Advanced Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( esc_url( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#advanced-tab' ) ); ?>
</h3>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php esc_html_e( 'NOTICE:', 'litespeed-cache' ); ?></h4>
<p><?php esc_html_e( 'These settings are meant for ADVANCED USERS ONLY.', 'litespeed-cache' ); ?></p>
</div>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th scope="row">
<?php $option_id = Base::O_CACHE_AJAX_TTL; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<div class="litespeed-textarea-recommended">
<div>
<?php $this->build_textarea( $option_id, 60 ); ?>
</div>
</div>
<div class="litespeed-desc">
<?php esc_html_e( 'Specify an AJAX action in POST/GET and the number of seconds to cache that request, separated by a space.', 'litespeed-cache' ); ?>
<?php Doc::one_per_line(); ?>
</div>
</td>
</tr>
<?php if ( ! $this->_is_multisite ) : ?>
<?php require LSCWP_DIR . 'tpl/cache/settings_inc.login_cookie.tpl.php'; ?>
<?php endif; ?>
<tr>
<th scope="row">
<?php $option_id = Base::O_UTIL_NO_HTTPS_VARY; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Enable this option if you are using both HTTP and HTTPS in the same domain and are noticing cache irregularities.', 'litespeed-cache' ); ?>
<?php Doc::learn_more( esc_url( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#improve-httphttps-compatibility' ) ); ?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_UTIL_INSTANT_CLICK; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'When a visitor hovers over a page link, preload that page. This will speed up the visit to that link.', 'litespeed-cache' ); ?>
<?php Doc::learn_more( esc_url( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#instant-click' ) ); ?>
<br />
<span class="litespeed-danger">
⚠️
<?php esc_html_e( 'This will generate extra requests to the server, which will increase server load.', 'litespeed-cache' ); ?>
</span>
</div>
</td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,13 @@
<?php
/**
* LiteSpeed Cache Browser Cache Setting
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
require LSCWP_DIR . 'tpl/cache/settings_inc.browser.tpl.php';

View File

@@ -0,0 +1,180 @@
<?php
/**
* LiteSpeed Cache Control Settings
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Cache Control Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/' ); ?>
</h3>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th>
<?php $option_id = Base::O_CACHE; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php if ( $this->_is_multisite ) : ?>
<?php $this->build_switch( $option_id, array( esc_html__( 'OFF', 'litespeed-cache' ), esc_html__( 'ON', 'litespeed-cache' ), esc_html__( 'Use Network Admin Setting', 'litespeed-cache' ) ) ); ?>
<?php else : ?>
<?php $this->build_switch( $option_id ); ?>
<?php endif; ?>
<div class="litespeed-desc">
<?php
printf(
/* translators: %s: Link tags */
esc_html__( 'Please visit the %sInformation%s page on how to test the cache.', 'litespeed-cache' ),
'<a href="https://docs.litespeedtech.com/lscache/lscwp/installation/#testing" target="_blank" rel="noopener">',
'</a>'
);
?>
<br>
<strong><?php esc_html_e( 'NOTICE', 'litespeed-cache' ); ?>: </strong><?php esc_html_e( 'When disabling the cache, all cached entries for this site will be purged.', 'litespeed-cache' ); ?>
<br>
<?php if ( $this->_is_multisite ) : ?>
<?php esc_html_e( 'The network admin setting can be overridden here.', 'litespeed-cache' ); ?>
<br>
<?php endif; ?>
<?php if ( ! $this->conf( Base::O_CACHE ) && $this->conf( Base::O_CDN_QUIC ) ) : ?>
<span class="litespeed-success"><?php esc_html_e( 'With QUIC.cloud CDN enabled, you may still be seeing cache headers from your local server.', 'litespeed-cache' ); ?></span>
<?php endif; ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_PRIV; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Privately cache frontend pages for logged-in users. (LSWS %s required)', 'litespeed-cache' ), 'v5.2.1+' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_COMMENTER; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Privately cache commenters that have pending comments. Disabling this option will serve non-cacheable pages to commenters. (LSWS %s required)', 'litespeed-cache' ), 'v5.2.1+' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_REST; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Cache requests made by WordPress REST API calls.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_PAGE_LOGIN; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Disabling this option may negatively affect performance.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<?php if ( ! $this->_is_multisite ) : ?>
<?php require LSCWP_DIR . 'tpl/cache/settings_inc.cache_mobile.tpl.php'; ?>
<?php endif; ?>
<tr>
<th>
<?php $option_id = Base::O_CACHE_PRIV_URI; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'URI Paths containing these strings will NOT be cached as public.', 'litespeed-cache' ); ?>
<?php $this->_uri_usage_example(); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_FORCE_URI; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Paths containing these strings will be cached regardless of no-cacheable settings.', 'litespeed-cache' ); ?>
<?php $this->_uri_usage_example(); ?>
<br>
<?php esc_html_e( 'To define a custom TTL for a URI, add a space followed by the TTL value to the end of the URI.', 'litespeed-cache' ); ?>
<?php
printf(
esc_html__( 'For example, %1$s defines a TTL of %2$s seconds for %3$s.', 'litespeed-cache' ),
'<code>/mypath/mypage 300</code>',
300,
'<code>/mypath/mypage</code>'
);
?>
<?php Doc::one_per_line(); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_FORCE_PUB_URI; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Paths containing these strings will be forced to public cached regardless of no-cacheable settings.', 'litespeed-cache' ); ?>
<?php $this->_uri_usage_example(); ?>
<br>
<?php esc_html_e( 'To define a custom TTL for a URI, add a space followed by the TTL value to the end of the URI.', 'litespeed-cache' ); ?>
<?php
printf(
esc_html__( 'For example, %1$s defines a TTL of %2$s seconds for %3$s.', 'litespeed-cache' ),
'<code>/mypath/mypage 300</code>',
300,
'<code>/mypath/mypage</code>'
);
?>
<?php Doc::one_per_line(); ?>
</div>
</td>
</tr>
<?php if ( ! $this->_is_multisite ) : ?>
<?php require LSCWP_DIR . 'tpl/cache/settings_inc.cache_dropquery.tpl.php'; ?>
<?php endif; ?>
</tbody>
</table>

View File

@@ -0,0 +1,148 @@
<?php
/**
* LiteSpeed Cache ESI Settings
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php echo esc_html__( 'ESI Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#esi-tab' ); ?>
</h3>
<div class="litespeed-description">
<p><?php echo esc_html__( 'With ESI (Edge Side Includes), pages may be served from cache for logged-in users.', 'litespeed-cache' ); ?></p>
<p><?php echo esc_html__( 'ESI allows you to designate parts of your dynamic page as separate fragments that are then assembled together to make the whole page. In other words, ESI lets you “punch holes” in a page, and then fill those holes with content that may be cached privately, cached publicly with its own TTL, or not cached at all.', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://blog.litespeedtech.com/2017/08/30/wpw-private-cache-vs-public-cache/', esc_html__( 'WpW: Private Cache vs. Public Cache', 'litespeed-cache' ) ); ?>
</p>
<p>
💡:
<?php echo esc_html__( 'You can turn shortcodes into ESI blocks.', 'litespeed-cache' ); ?>
<?php
printf(
esc_html__( 'Replace %1$s with %2$s.', 'litespeed-cache' ),
'<code>[shortcodeA att1="val1" att2="val2"]</code>',
'<code>[esi shortcodeA att1="val1" att2="val2"]</code>'
);
?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/admin/#turning-wordpress-shortcodes-into-esi-blocks' ); ?>
</p>
<p>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/api/#generate-esi-block-url', esc_html__( 'ESI sample for developers', 'litespeed-cache' ) ); ?>
</p>
</div>
<div class="litespeed-relative">
<?php if ( ! LSWCP_ESI_SUPPORT && ! $this->conf( Base::O_CDN_QUIC ) ) : ?>
<div class="litespeed-callout-danger">
<h4><?php echo esc_html__( 'WARNING', 'litespeed-cache' ); ?></h4>
<h4><?php echo esc_html__( 'These options are only available with LiteSpeed Enterprise Web Server or QUIC.cloud CDN.', 'litespeed-cache' ); ?></h4>
</div>
<?php endif; ?>
<table class="wp-list-table striped litespeed-table"><tbody>
<tr>
<th>
<?php $option_id = Base::O_ESI; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php echo esc_html__( 'Turn ON to cache public pages for logged in users, and serve the Admin Bar and Comment Form via ESI blocks. These two blocks will be uncached unless enabled below.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_ESI_CACHE_ADMBAR; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php echo esc_html__( 'Cache the built-in Admin Bar ESI block.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_ESI_CACHE_COMMFORM; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php echo esc_html__( 'Cache the built-in Comment Form ESI block.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_ESI_NONCE; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<div>
<?php $this->build_textarea( $option_id ); ?>
</div>
<p class="litespeed-desc">
<?php echo esc_html__( 'The list will be merged with the predefined nonces in your local data file.', 'litespeed-cache' ); ?>
<?php echo esc_html__( 'The latest data file is', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/master/data/esi.nonces.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/master/data/esi.nonces.txt</a>
<br><span class="litespeed-success">
<?php echo esc_html__( 'API', 'litespeed-cache' ); ?>:
<?php printf( esc_html__( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_esi_nonces</code>' ); ?>
</span>
</p>
<div class="litespeed-desc">
<?php echo esc_html__( 'The above nonces will be converted to ESI automatically.', 'litespeed-cache' ); ?>
<?php Doc::one_per_line(); ?>
<br><?php echo esc_html__( 'An optional second parameter may be used to specify cache control. Use a space to separate', 'litespeed-cache' ); ?>: <code>my_nonce_action private</code>
</div>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Wildcard %1$s supported (match zero or more characters). For example, to match %2$s and %3$s, use %4$s.', 'litespeed-cache' ), '<code>*</code>', '<code>nonce_formid_1</code>', '<code>nonce_formid_3</code>', '<code>nonce_formid_*</code>' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_VARY_GROUP; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<table class="litespeed-vary-table wp-list-table striped litespeed-table form-table"><tbody>
<?php foreach ( $roles as $curr_role => $curr_title ) : ?>
<tr>
<td class="litespeed-vary-title"><?php echo esc_html( $curr_title ); ?></td>
<td class="litespeed-vary-val">
<?php
$this->build_input(
$option_id . '[' . $curr_role . ']',
'litespeed-input-short',
$this->cls( 'Vary' )->in_vary_group( $curr_role )
);
?>
</td>
</tr>
<?php endforeach; ?>
</tbody></table>
<div class="litespeed-desc">
<?php echo esc_html__( 'If your site contains public content that certain user roles can see but other roles cannot, you can specify a Vary Group for those user roles. For example, specifying an administrator vary group allows there to be a separate publicly-cached page tailored to administrators (with “edit” links, etc), while all other user roles see the default public page.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
</tbody></table>
</div>

View File

@@ -0,0 +1,146 @@
<?php
/**
* LiteSpeed Cache Exclude Settings
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php echo esc_html__( 'Exclude Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#excludes-tab' ); ?>
</h3>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th>
<?php $option_id = Base::O_CACHE_EXC; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id ); ?>
<div class="litespeed-desc">
<?php echo esc_html__( 'Paths containing these strings will not be cached.', 'litespeed-cache' ); ?>
<?php $this->_uri_usage_example(); ?>
<br><?php echo esc_html__( 'Predefined list will also be combined w/ the above settings', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/cache_nocacheable.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/cache_nocacheable.txt</a>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_EXC_QS; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id ); ?>
<div class="litespeed-desc">
<?php echo esc_html__( 'Query strings containing these parameters will not be cached.', 'litespeed-cache' ); ?>
<?php printf( esc_html__( 'For example, for %1$s, %2$s and %3$s can be used here.', 'litespeed-cache' ), '<code>?aa=bb&cc=dd</code>', '<code>aa</code>', '<code>cc</code>' ); ?>
<?php Doc::one_per_line(); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_EXC_CAT; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php
$excludes_buf = '';
if ( $this->conf( $option_id ) ) {
$excludes_buf = implode( "\n", array_map( 'get_cat_name', $this->conf( $option_id ) ) );
}
$this->build_textarea( $option_id, false, $excludes_buf );
?>
<div class="litespeed-desc">
<b><?php echo esc_html__( 'All categories are cached by default.', 'litespeed-cache' ); ?></b>
<?php printf( esc_html__( 'To prevent %s from being cached, enter them here.', 'litespeed-cache' ), esc_html__( 'categories', 'litespeed-cache' ) ); ?>
<?php Doc::one_per_line(); ?>
</div>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php echo esc_html__( 'NOTE', 'litespeed-cache' ); ?>:</h4>
<ol>
<li><?php echo esc_html__( 'If the category name is not found, the category will be removed from the list on save.', 'litespeed-cache' ); ?></li>
</ol>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_EXC_TAG; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php
$excludes_buf = '';
if ( $this->conf( $option_id ) ) {
$tag_names = array();
foreach ( array_map( 'get_tag', $this->conf( $option_id ) ) as $curr_tag ) {
$tag_names[] = $curr_tag->name;
}
if ( ! empty( $tag_names ) ) {
$excludes_buf = implode( "\n", $tag_names );
}
}
$this->build_textarea( $option_id, false, $excludes_buf );
?>
<div class="litespeed-desc">
<b><?php echo esc_html__( 'All tags are cached by default.', 'litespeed-cache' ); ?></b>
<?php printf( esc_html__( 'To prevent %s from being cached, enter them here.', 'litespeed-cache' ), esc_html__( 'tags', 'litespeed-cache' ) ); ?>
<?php Doc::one_per_line(); ?>
</div>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php echo esc_html__( 'NOTE', 'litespeed-cache' ); ?>:</h4>
<ol>
<li><?php echo esc_html__( 'If the tag slug is not found, the tag will be removed from the list on save.', 'litespeed-cache' ); ?></li>
<li>
<?php
printf(
esc_html__( 'To exclude %1$s, insert %2$s.', 'litespeed-cache' ),
'<code>http://www.example.com/tag/category/tag-slug/</code>',
'<code>tag-slug</code>'
);
?>
</li>
</ol>
</div>
</td>
</tr>
<?php
if ( ! $this->_is_multisite ) :
require LSCWP_DIR . 'tpl/cache/settings_inc.exclude_cookies.tpl.php';
require LSCWP_DIR . 'tpl/cache/settings_inc.exclude_useragent.tpl.php';
endif;
?>
<tr>
<th>
<?php $option_id = Base::O_CACHE_EXC_ROLES; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<div class="litespeed-desc">
<?php echo esc_html__( 'Selected roles will be excluded from cache.', 'litespeed-cache' ); ?>
</div>
<div class="litespeed-tick-list">
<?php foreach ( $roles as $curr_role => $curr_title ) : ?>
<?php $this->build_checkbox( $option_id . '[]', esc_html( $curr_title ), Control::cls()->in_cache_exc_roles( $curr_role ), $curr_role ); ?>
<?php endforeach; ?>
</div>
</td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,13 @@
<?php
/**
* LiteSpeed Cache Object Cache Settings
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
require LSCWP_DIR . 'tpl/cache/settings_inc.object.tpl.php';

View File

@@ -0,0 +1,158 @@
<?php
/**
* LiteSpeed Cache Purge Settings
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Purge Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#purge-tab' ); ?>
</h3>
<?php
$option_list = array(
Base::O_PURGE_POST_ALL => esc_html__( 'All pages', 'litespeed-cache' ),
Base::O_PURGE_POST_FRONTPAGE => esc_html__( 'Front page', 'litespeed-cache' ),
Base::O_PURGE_POST_HOMEPAGE => esc_html__( 'Home page', 'litespeed-cache' ),
Base::O_PURGE_POST_PAGES => esc_html__( 'Pages', 'litespeed-cache' ),
Base::O_PURGE_POST_PAGES_WITH_RECENT_POSTS => esc_html__( 'All pages with Recent Posts Widget', 'litespeed-cache' ),
Base::O_PURGE_POST_AUTHOR => esc_html__( 'Author archive', 'litespeed-cache' ),
Base::O_PURGE_POST_POSTTYPE => esc_html__( 'Post type archive', 'litespeed-cache' ),
Base::O_PURGE_POST_YEAR => esc_html__( 'Yearly archive', 'litespeed-cache' ),
Base::O_PURGE_POST_MONTH => esc_html__( 'Monthly archive', 'litespeed-cache' ),
Base::O_PURGE_POST_DATE => esc_html__( 'Daily archive', 'litespeed-cache' ),
Base::O_PURGE_POST_TERM => esc_html__( 'Term archive (include category, tag, and tax)', 'litespeed-cache' ),
);
// break line at these ids
$break_arr = array(
Base::O_PURGE_POST_PAGES,
Base::O_PURGE_POST_PAGES_WITH_RECENT_POSTS,
Base::O_PURGE_POST_POSTTYPE,
Base::O_PURGE_POST_DATE,
);
?>
<table class="wp-list-table striped litespeed-table"><tbody>
<?php if ( ! $this->_is_multisite ) : ?>
<?php require LSCWP_DIR . 'tpl/cache/settings_inc.purge_on_upgrade.tpl.php'; ?>
<?php endif; ?>
<tr>
<th><?php esc_html_e( 'Auto Purge Rules For Publish/Update', 'litespeed-cache' ); ?></th>
<td>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php esc_html_e( 'Note', 'litespeed-cache' ); ?></h4>
<p>
<?php esc_html_e( 'Select "All" if there are dynamic widgets linked to posts on pages other than the front or home pages.', 'litespeed-cache' ); ?><br>
<?php esc_html_e( 'Other checkboxes will be ignored.', 'litespeed-cache' ); ?><br>
<?php esc_html_e( 'Select only the archive types that are currently used, the others can be left unchecked.', 'litespeed-cache' ); ?>
</p>
</div>
<div class="litespeed-top20">
<div class="litespeed-tick-wrapper">
<?php
foreach ( $option_list as $option_id => $cur_title ) {
$this->build_checkbox( $option_id, $cur_title );
if ( in_array( $option_id, $break_arr, true ) ) {
echo '</div><div class="litespeed-tick-wrapper litespeed-top10">';
}
}
?>
</div>
</div>
<div class="litespeed-desc">
<?php esc_html_e( 'Select which pages will be automatically purged when posts are published/updated.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_PURGE_STALE; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'If ON, the stale copy of a cached page will be shown to visitors until a new cache copy is available. Reduces the server load for following visits. If OFF, the page will be dynamically generated while visitors wait.', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#serve-stale' ); ?>
</div>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php esc_html_e( 'Note', 'litespeed-cache' ); ?></h4>
<p>
<?php esc_html_e( 'By design, this option may serve stale content. Do not enable this option, if that is not OK with you.', 'litespeed-cache' ); ?><br>
</p>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_PURGE_TIMED_URLS; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id, 80 ); ?>
<div class="litespeed-desc">
<?php printf( esc_html__( 'The URLs here (one per line) will be purged automatically at the time set in the option "%s".', 'litespeed-cache' ), esc_html__( 'Scheduled Purge Time', 'litespeed-cache' ) ); ?><br>
<?php printf( esc_html__( 'Both %1$s and %2$s are acceptable.', 'litespeed-cache' ), '<code>http://www.example.com/path/url.php</code>', '<code>/path/url.php</code>' ); ?>
<?php Doc::one_per_line(); ?>
</div>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Wildcard %1$s supported (match zero or more characters). For example, to match %2$s and %3$s, use %4$s.', 'litespeed-cache' ), '<code>*</code>', '<code>/path/u-1.html</code>', '<code>/path/u-2.html</code>', '<code>/path/u-*.html</code>' ); ?>
</div>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php esc_html_e( 'Note', 'litespeed-cache' ); ?></h4>
<p>
<?php esc_html_e( 'For URLs with wildcards, there may be a delay in initiating scheduled purge.', 'litespeed-cache' ); ?><br>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#scheduled-purge-urls' ); ?>
</p>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_PURGE_TIMED_URLS_TIME; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id, null, null, 'time' ); ?>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Specify the time to purge the "%s" list.', 'litespeed-cache' ), esc_html__( 'Scheduled Purge URLs', 'litespeed-cache' ) ); ?>
<?php printf( esc_html__( 'Current server time is %s.', 'litespeed-cache' ), '<code>' . esc_html( gmdate( 'H:i:s', time() + LITESPEED_TIME_OFFSET ) ) . '</code>' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_PURGE_HOOK_ALL; ?>
<?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( 'A Purge All will be executed when WordPress runs these hooks.', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#purge-all-hooks' ); ?>
</div>
</td>
</tr>
</tbody></table>

View File

@@ -0,0 +1,117 @@
<?php
/**
* LiteSpeed Cache TTL Settings
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php echo esc_html__( 'TTL', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#ttl-tab' ); ?>
</h3>
<table class="wp-list-table striped litespeed-table"><tbody>
<tr>
<th>
<?php $option_id = Base::O_CACHE_TTL_PUB; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id ); ?> <?php $this->readable_seconds(); ?>
<div class="litespeed-desc">
<?php echo esc_html__( 'Specify how long, in seconds, public pages are cached.', 'litespeed-cache' ); ?>
<?php $this->recommended( $option_id ); ?>
<?php $this->_validate_ttl( $option_id, 30 ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_TTL_PRIV; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id ); ?> <?php $this->readable_seconds(); ?>
<div class="litespeed-desc">
<?php echo esc_html__( 'Specify how long, in seconds, private pages are cached.', 'litespeed-cache' ); ?>
<?php $this->recommended( $option_id ); ?>
<?php $this->_validate_ttl( $option_id, 60, 3600 ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_TTL_FRONTPAGE; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id ); ?> <?php $this->readable_seconds(); ?>
<div class="litespeed-desc">
<?php echo esc_html__( 'Specify how long, in seconds, the front page is cached.', 'litespeed-cache' ); ?>
<?php $this->recommended( $option_id ); ?>
<?php $this->_validate_ttl( $option_id, 30 ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_TTL_FEED; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id ); ?> <?php $this->readable_seconds(); ?>
<div class="litespeed-desc">
<?php echo esc_html__( 'Specify how long, in seconds, feeds are cached.', 'litespeed-cache' ); ?>
<?php echo esc_html__( 'If this is set to a number less than 30, feeds will not be cached.', 'litespeed-cache' ); ?>
<?php $this->recommended( $option_id ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_TTL_REST; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id ); ?> <?php $this->readable_seconds(); ?>
<div class="litespeed-desc">
<?php echo esc_html__( 'Specify how long, in seconds, REST calls are cached.', 'litespeed-cache' ); ?>
<?php echo esc_html__( 'If this is set to a number less than 30, feeds will not be cached.', 'litespeed-cache' ); ?>
<?php $this->recommended( $option_id ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_CACHE_TTL_STATUS; ?>
<?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 echo esc_html__( 'Specify an HTTP status code and the number of seconds to cache that page, separated by a space.', 'litespeed-cache' ); ?>
<?php Doc::one_per_line(); ?>
</div>
</td>
</tr>
</tbody></table>

View File

@@ -0,0 +1,70 @@
<?php
/**
* LiteSpeed Cache Browser Cache Settings
*
* Displays the browser cache settings section for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Browser Cache Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#browser-tab' ); ?>
</h3>
<?php if ( 'LITESPEED_SERVER_OLS' === LITESPEED_SERVER_TYPE ) : ?>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php esc_html_e( 'NOTICE:', 'litespeed-cache' ); ?></h4>
<p>
<?php esc_html_e( 'OpenLiteSpeed users please check this', 'litespeed-cache' ); ?>:
<?php Doc::learn_more( 'https://openlitespeed.org/kb/how-to-set-up-custom-headers/', esc_html__( 'Setting Up Custom Headers', 'litespeed-cache' ) ); ?>
</p>
</div>
<?php endif; ?>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th scope="row">
<?php $option_id = Base::O_CACHE_BROWSER; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( "Browser caching stores static files locally in the user's browser. Turn on this setting to reduce repeated requests for static files.", 'litespeed-cache' ); ?><br>
<?php Doc::notice_htaccess(); ?><br>
<?php
printf(
/* translators: %s: Link tags */
esc_html__( 'You can turn on browser caching in server admin too. %sLearn more about LiteSpeed browser cache settings%s.', 'litespeed-cache' ),
'<a href="https://docs.litespeedtech.com/lscache/lscwp/cache/#how-to-set-it-up" target="_blank" rel="noopener">',
'</a>'
);
?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_CACHE_TTL_BROWSER; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id ); ?> <?php $this->readable_seconds(); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'The amount of time, in seconds, that files will be stored in browser cache before expiring.', 'litespeed-cache' ); ?>
<?php $this->recommended( $option_id ); ?>
<?php $this->_validate_ttl( $option_id, 30 ); ?>
</div>
</td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,46 @@
<?php
/**
* LiteSpeed Cache Drop Query Strings Setting
*
* Displays the drop query strings setting for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<tr>
<th scope="row">
<?php $option_id = Base::O_CACHE_DROP_QS; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id, 40 ); ?>
<div class="litespeed-desc">
<?php
printf(
/* translators: %s: LiteSpeed Web Server version */
esc_html__( 'Ignore certain query strings when caching. (LSWS %s required)', 'litespeed-cache' ),
'v5.2.3+'
);
?>
<?php
printf(
/* translators: %1$s: Example query string, %2$s: Example wildcard */
esc_html__( 'For example, to drop parameters beginning with %1$s, %2$s can be used here.', 'litespeed-cache' ),
'<code>utm</code>',
'<code>utm*</code>'
);
?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#drop-query-string' ); ?>
<br />
<?php Doc::one_per_line(); ?>
<br />
<?php Doc::notice_htaccess(); ?>
</div>
</td>
</tr>

View File

@@ -0,0 +1,99 @@
<?php
/**
* LiteSpeed Cache Mobile View Settings
*
* Displays the mobile view cache settings for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<tr>
<th scope="row">
<?php $cid = Base::O_CACHE_MOBILE; ?>
<?php $this->title( $cid ); ?>
</th>
<td>
<?php $this->build_switch( $cid ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Serve a separate cache copy for mobile visitors.', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#cache-mobile', esc_html__( 'Learn more about when this is needed', 'litespeed-cache' ) ); ?>
<br /><?php Doc::notice_htaccess(); ?>
<br /><?php Doc::crawler_affected(); ?>
</div>
</td>
</tr>
<tr>
<th scope="row" class="litespeed-padding-left">
<?php $cid = Base::O_CACHE_MOBILE_RULES; ?>
<?php $this->title( $cid ); ?>
</th>
<td>
<?php
if ( $this->conf( Base::O_CACHE_MOBILE ) ) {
if ( defined( 'LITESPEED_ON' ) ) {
try {
$mobile_agents = Htaccess::cls()->current_mobile_agents();
if ( Utility::arr2regex( $this->conf( $cid ), true ) !== $mobile_agents ) {
?>
<div class="litespeed-callout notice notice-error inline">
<p>
<?php esc_html_e( 'Htaccess did not match configuration option.', 'litespeed-cache' ); ?>
<?php
printf(
/* translators: %s: Current mobile agents in htaccess */
esc_html__( 'Htaccess rule is: %s', 'litespeed-cache' ),
'<code>' . esc_html( $mobile_agents ) . '</code>'
);
?>
</p>
</div>
<?php
}
} catch ( \Exception $e ) {
?>
<div class="litespeed-callout notice notice-error inline">
<p><?php echo wp_kses_post( $e->getMessage() ); ?></p>
</div>
<?php
}
}
}
?>
<div class="litespeed-textarea-recommended">
<div>
<?php $this->build_textarea( $cid, 40 ); ?>
</div>
<div>
<?php $this->recommended( $cid ); ?>
</div>
</div>
<div class="litespeed-desc">
<?php Doc::one_per_line(); ?>
<?php $this->_validate_syntax( $cid ); ?>
<?php if ( $this->conf( Base::O_CACHE_MOBILE ) && ! $this->conf( $cid ) ) : ?>
<span class="litespeed-warning">
<?php
printf(
/* translators: %1$s: Cache Mobile label, %2$s: ON status, %3$s: List of Mobile User Agents label */
esc_html__( 'If %1$s is %2$s, then %3$s must be populated!', 'litespeed-cache' ),
'<code>' . esc_html__( 'Cache Mobile', 'litespeed-cache' ) . '</code>',
'<code>' . esc_html__( 'ON', 'litespeed-cache' ) . '</code>',
'<code>' . esc_html__( 'List of Mobile User Agents', 'litespeed-cache' ) . '</code>'
);
?>
</span>
<?php endif; ?>
</div>
</td>
</tr>

View File

@@ -0,0 +1,36 @@
<?php
/**
* LiteSpeed Cache Exclude Cookies Setting
*
* Displays the exclude cookies setting for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<tr>
<th scope="row">
<?php $option_id = Base::O_CACHE_EXC_COOKIES; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id ); ?>
<div class="litespeed-desc">
<?php
printf(
/* translators: %s: "cookies" */
esc_html__( 'To prevent %s from being cached, enter them here.', 'litespeed-cache' ),
esc_html__( 'cookies', 'litespeed-cache' )
);
?>
<?php Doc::one_per_line(); ?>
<?php $this->_validate_syntax( $option_id ); ?>
<br /><?php Doc::notice_htaccess(); ?>
</div>
</td>
</tr>

View File

@@ -0,0 +1,36 @@
<?php
/**
* LiteSpeed Cache Exclude User Agents Setting
*
* Displays the exclude user agents setting for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<tr>
<th scope="row">
<?php $option_id = Base::O_CACHE_EXC_USERAGENTS; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id ); ?>
<div class="litespeed-desc">
<?php
printf(
/* translators: %s: "user agents" */
esc_html__( 'To prevent %s from being cached, enter them here.', 'litespeed-cache' ),
esc_html__( 'user agents', 'litespeed-cache' )
);
?>
<?php Doc::one_per_line(); ?>
<?php $this->_validate_syntax( $option_id ); ?>
<br /><?php Doc::notice_htaccess(); ?>
</div>
</td>
</tr>

View File

@@ -0,0 +1,109 @@
<?php
/**
* LiteSpeed Cache Login Cookie and Vary Cookies Settings
*
* Displays the login cookie and vary cookies settings for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<tr>
<th scope="row">
<?php $option_id = Base::O_CACHE_LOGIN_COOKIE; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id ); ?>
<?php $this->_validate_syntax( $option_id ); ?>
<div class="litespeed-desc">
<?php
esc_html_e( 'SYNTAX: alphanumeric and "_". No spaces and case sensitive. MUST BE UNIQUE FROM OTHER WEB APPLICATIONS.', 'litespeed-cache' );
?>
<br />
<?php
printf(
/* translators: %s: Default login cookie name */
esc_html__( 'The default login cookie is %s.', 'litespeed-cache' ),
'<code>_lscache_vary</code>'
);
?>
<?php esc_html_e( 'The server will determine if the user is logged in based on the existence of this cookie.', 'litespeed-cache' ); ?>
<?php esc_html_e( 'This setting is useful for those that have multiple web applications for the same domain.', 'litespeed-cache' ); ?>
<?php esc_html_e( 'If every web application uses the same cookie, the server may confuse whether a user is logged in or not.', 'litespeed-cache' ); ?>
<?php esc_html_e( 'The cookie set here will be used for this WordPress installation.', 'litespeed-cache' ); ?>
<br />
<?php esc_html_e( 'Example use case:', 'litespeed-cache' ); ?><br />
<?php
printf(
/* translators: %s: Example domain */
esc_html__( 'There is a WordPress installed for %s.', 'litespeed-cache' ),
'<u>www.example.com</u>'
);
?>
<br />
<?php
printf(
/* translators: %s: Example subdomain */
esc_html__( 'Then another WordPress is installed (NOT MULTISITE) at %s', 'litespeed-cache' ),
'<u>www.example.com/blog/</u>'
);
?>
<?php esc_html_e( 'The cache needs to distinguish who is logged into which WordPress site in order to cache correctly.', 'litespeed-cache' ); ?><br />
<?php Doc::notice_htaccess(); ?>
</div>
<?php if ( preg_match( '#[^\w\-]#', $this->conf( $option_id ) ) ) : ?>
<div class="litespeed-callout notice notice-error inline">
<p>❌ <?php esc_html_e( 'Invalid login cookie. Invalid characters found.', 'litespeed-cache' ); ?></p>
</div>
<?php endif; ?>
<?php
if ( defined( 'LITESPEED_ON' ) && $this->conf( $option_id ) ) {
$cookie_rule = '';
try {
$cookie_rule = Htaccess::cls()->current_login_cookie();
} catch ( \Exception $e ) {
?>
<div class="litespeed-callout notice notice-error inline">
<p><?php echo esc_html( $e->getMessage() ); ?></p>
</div>
<?php
}
$cookie_arr = explode( ',', $cookie_rule );
if ( ! in_array( $this->conf( $option_id ), $cookie_arr, true ) ) {
?>
<div class="litespeed-callout notice notice-warning inline">
<p><?php esc_html_e( 'WARNING: The .htaccess login cookie and Database login cookie do not match.', 'litespeed-cache' ); ?></p>
</div>
<?php
}
}
?>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_CACHE_VARY_COOKIES; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id, 50 ); ?>
<?php $this->_validate_syntax( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'SYNTAX: alphanumeric and "_". No spaces and case sensitive.', 'litespeed-cache' ); ?>
<br />
<?php esc_html_e( 'You can list the 3rd party vary cookies here.', 'litespeed-cache' ); ?>
<br />
<?php Doc::notice_htaccess(); ?>
</div>
</td>
</tr>

View File

@@ -0,0 +1,306 @@
<?php
/**
* LiteSpeed Cache Object Cache Settings
*
* Displays the object cache settings section for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
$lang_enabled = '<span class="litespeed-success">' . esc_html__( 'Enabled', 'litespeed-cache' ) . '</span>';
$lang_disabled = '<span class="litespeed-warning">' . esc_html__( 'Disabled', 'litespeed-cache' ) . '</span>';
$mem_enabled = class_exists( 'Memcached' ) ? $lang_enabled : $lang_disabled;
$redis_enabled = class_exists( 'Redis' ) ? $lang_enabled : $lang_disabled;
$mem_conn = $this->cls( 'Object_Cache' )->test_connection();
if ( null === $mem_conn ) {
$mem_conn_desc = '<span class="litespeed-desc">' . esc_html__( 'Not Available', 'litespeed-cache' ) . '</span>';
} elseif ( $mem_conn ) {
$mem_conn_desc = '<span class="litespeed-success">' . esc_html__( 'Passed', 'litespeed-cache' ) . '</span>';
} else {
$severity = $this->conf( Base::O_OBJECT, true ) ? 'danger' : 'warning';
$mem_conn_desc = '<span class="litespeed-' . esc_attr( $severity ) . '">' . esc_html__( 'Failed', 'litespeed-cache' ) . '</span>';
}
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Object Cache Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#object-tab' ); ?>
</h3>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Use external object cache functionality.', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/admin/#memcached-lsmcd-and-redis-object-cache-support-in-lscwp' ); ?>
</div>
<div class="litespeed-block">
<div class="litespeed-col-auto">
<h4><?php esc_html_e( 'Status', 'litespeed-cache' ); ?></h4>
</div>
<div class="litespeed-col-auto">
<?php
printf(
/* translators: %s: Object cache name */
esc_html__( '%s Extension', 'litespeed-cache' ),
'Memcached'
);
?>
: <?php echo wp_kses_post( $mem_enabled ); ?><br>
<?php
printf(
/* translators: %s: Object cache name */
esc_html__( '%s Extension', 'litespeed-cache' ),
'Redis'
);
?>
: <?php echo wp_kses_post( $redis_enabled ); ?><br>
<?php esc_html_e( 'Connection Test', 'litespeed-cache' ); ?>: <?php echo wp_kses_post( $mem_conn_desc ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/admin/#how-to-debug' ); ?>
</div>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_KIND; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id, array( 'Memcached', 'Redis' ) ); ?>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_HOST; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id ); ?>
<div class="litespeed-desc">
<?php
printf(
/* translators: %s: Object cache name */
esc_html__( 'Your %s Hostname or IP address.', 'litespeed-cache' ),
'Memcached/<a href="https://docs.litespeedtech.com/products/lsmcd/" target="_blank" rel="noopener">LSMCD</a>/Redis'
);
?>
<br>
<?php
printf(
/* translators: %1$s: Socket name, %2$s: Host field title, %3$s: Example socket path */
esc_html__( 'If you are using a %1$s socket, %2$s should be set to %3$s', 'litespeed-cache' ),
'UNIX',
esc_html( Lang::title( $option_id ) ),
'<code>/path/to/memcached.sock</code>'
);
?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_PORT; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id, 'litespeed-input-short2' ); ?>
<div class="litespeed-desc">
<?php
printf(
/* translators: %1$s: Object cache name, %2$s: Port number */
esc_html__( 'Default port for %1$s is %2$s.', 'litespeed-cache' ),
'Memcached',
'<code>11211</code>'
);
?>
<br>
<?php
printf(
/* translators: %1$s: Object cache name, %2$s: Port number */
esc_html__( 'Default port for %1$s is %2$s.', 'litespeed-cache' ),
'Redis',
'<code>6379</code>'
);
?>
<br>
<?php
printf(
/* translators: %1$s: Socket name, %2$s: Port field title, %3$s: Port value */
esc_html__( 'If you are using a %1$s socket, %2$s should be set to %3$s', 'litespeed-cache' ),
'UNIX',
esc_html( Lang::title( $option_id ) ),
'<code>0</code>'
);
?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_LIFE; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id, 'litespeed-input-short2' ); ?> <?php esc_html_e( 'seconds', 'litespeed-cache' ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Default TTL for cached objects.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_USER; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id ); ?>
<div class="litespeed-desc">
<?php
printf(
/* translators: %s: SASL */
esc_html__( 'Only available when %s is installed.', 'litespeed-cache' ),
'SASL'
);
?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_PSWD; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Specify the password used when connecting.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_DB_ID; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id, 'litespeed-input-short' ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Database to be used', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_GLOBAL_GROUPS; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id, 30 ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Groups cached at the network level.', 'litespeed-cache' ); ?>
<?php Doc::one_per_line(); ?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_NON_PERSISTENT_GROUPS; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id, 30 ); ?>
<div class="litespeed-desc">
<?php Doc::one_per_line(); ?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_PERSISTENT; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Use keep-alive connections to speed up cache operations.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_ADMIN; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Improve wp-admin speed through caching. (May encounter expired data)', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th scope="row">
<?php $option_id = Base::O_OBJECT_TRANSIENTS; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php
printf(
/* translators: %1$s: Object Cache Admin title, %2$s: OFF status */
esc_html__( 'Save transients in database when %1$s is %2$s.', 'litespeed-cache' ),
'<code>' . esc_html( Lang::title( Base::O_OBJECT_ADMIN ) ) . '</code>',
'<code>' . esc_html__( 'OFF', 'litespeed-cache' ) . '</code>'
);
?>
<br>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#store-transients' ); ?>
</div>
</td>
</tr>
</tbody>
</table>
<script>
jQuery(document).ready(function($) {
// Auto-fill port based on object cache type
$('input[name="object-kind"]').on('change', function() {
var portInput = $('#input_objectport');
var selectedKind = $(this).val();
// Memcached (0) -> 11211, Redis (1) -> 6379
if (selectedKind === '0') {
portInput.val('11211');
} else if (selectedKind === '1') {
portInput.val('6379');
}
});
});
</script>

View File

@@ -0,0 +1,28 @@
<?php
/**
* LiteSpeed Cache Purge on Upgrade Setting
*
* Displays the purge on upgrade setting for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
?>
<!-- build_setting_purge_on_upgrade -->
<tr>
<th scope="row">
<?php $option_id = Base::O_PURGE_ON_UPGRADE; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'When enabled, the cache will automatically purge when any plugin, theme or the WordPress core is upgraded.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>