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,90 @@
<?php
/**
* LiteSpeed Cache Beta Test
*
* Renders the beta test interface for LiteSpeed Cache, allowing users to switch plugin versions or test GitHub commits.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
// List of available public versions
$v_list = array(
'7.6.2',
'7.6.1',
'7.6',
'7.5.0.1',
'7.4',
'7.3.0.1',
'7.3',
'7.2',
'7.1',
'7.0.1',
'6.5.4',
'5.7.0.1',
'4.6',
'3.6.4',
);
?>
<?php $this->form_action( Router::ACTION_DEBUG2, Debug2::TYPE_BETA_TEST ); ?>
<h3 class="litespeed-title">
<?php esc_html_e( 'Try GitHub Version', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#beta-test-tab' ); ?>
</h3>
<?php if ( defined( 'LITESPEED_DISABLE_ALL' ) && LITESPEED_DISABLE_ALL ) : ?>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php esc_html_e( 'NOTICE:', 'litespeed-cache' ); ?></h4>
<p><?php esc_html_e( 'LiteSpeed Cache is disabled. This functionality will not work.', 'litespeed-cache' ); ?></p>
</div>
<?php endif; ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Use this section to switch plugin versions. To beta test a GitHub commit, enter the commit URL in the field below.', 'litespeed-cache' ); ?>
</div>
<div class="litespeed-desc">
<?php esc_html_e( 'Example', 'litespeed-cache' ); ?>: <code>https://github.com/litespeedtech/lscache_wp/commit/example_comment_hash_d3ebec0535aaed5c932c0</code>
</div>
<input type="text" name="<?php echo esc_attr( Debug2::BETA_TEST_URL ); ?>" class="litespeed-input-long" id="litespeed-beta-test" value="">
<p>
<a href="javascript:;" class="button litespeed-btn-success" onclick="document.getElementById('litespeed-beta-test').value='dev';"><?php esc_html_e( 'Use latest GitHub Dev commit', 'litespeed-cache' ); ?></a> <code>dev</code>
</p>
<p>
<a href="javascript:;" class="button litespeed-btn-success" onclick="document.getElementById('litespeed-beta-test').value='master';"><?php esc_html_e( 'Use latest GitHub Master commit', 'litespeed-cache' ); ?></a> <code>master</code>
</p>
<p>
<a href="javascript:;" class="button litespeed-btn-success" onclick="document.getElementById('litespeed-beta-test').value='latest';"><?php esc_html_e( 'Use latest WordPress release version', 'litespeed-cache' ); ?></a> <code><?php echo esc_attr( Debug2::BETA_TEST_URL_WP ); ?></code> <?php esc_html_e( 'OR', 'litespeed-cache' ); ?> <code>latest</code>
</p>
<p>
<?php foreach ( $v_list as $v ) : ?>
<a href="javascript:;" class="button <?php echo '3.6.4' === $v ? 'litespeed-btn-danger' : 'litespeed-btn-success'; ?>" onclick="document.getElementById('litespeed-beta-test').value='<?php echo esc_attr( $v ); ?>';"><?php echo esc_html( $v ); ?></a>
<?php endforeach; ?>
<span class="litespeed-danger">
🚨 <?php esc_html_e( 'Downgrade not recommended. May cause fatal error due to refactored code.', 'litespeed-cache' ); ?>
</span>
</p>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Press the %s button to use the most recent GitHub commit. Master is for release candidate & Dev is for experimental testing.', 'litespeed-cache' ), '<code>' . esc_html__( 'Use latest GitHub Dev/Master commit', 'litespeed-cache' ) . '</code>' ); ?>
</div>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Press the %s button to stop beta testing and go back to the current release from the WordPress Plugin Directory.', 'litespeed-cache' ), '<code>' . esc_html__( 'Use latest WordPress release version', 'litespeed-cache' ) . '</code>' ); ?>
</div>
<p class="litespeed-danger">
🚨 <?php printf( esc_html__( 'In order to avoid an upgrade error, you must be using %1$s or later before you can upgrade to %2$s versions.', 'litespeed-cache' ), '<code>v3.6.4</code>', '<code>dev/master/v4+</code>' ); ?>
</p>
<button type="submit" class="button button-primary"><?php esc_html_e( 'Upgrade', 'litespeed-cache' ); ?></button>
</form>

View File

@@ -0,0 +1,97 @@
<?php
/**
* LiteSpeed Cache View .htaccess
*
* Renders the .htaccess view interface for LiteSpeed Cache, displaying the contents and paths of frontend and backend .htaccess files.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
$content = null;
try {
$content = Htaccess::cls()->htaccess_read();
} catch ( \Exception $e ) {
?>
<div class="notice notice-error is-dismissible">
<p><?php echo wp_kses_post( $e->getMessage() ); ?></p>
</div>
<?php
}
$htaccess_path = Htaccess::get_frontend_htaccess();
// Check for `ExpiresDefault` in .htaccess when LiteSpeed is enabled
if ( defined( 'LITESPEED_ON' ) && $content && stripos( $content, "\nExpiresDefault" ) !== false ) {
$is_dismissed = GUI::get_option( self::DB_DISMISS_MSG );
if ( self::RULECONFLICT_DISMISSED !== $is_dismissed ) {
if ( self::RULECONFLICT_ON !== $is_dismissed ) {
GUI::update_option( self::DB_DISMISS_MSG, self::RULECONFLICT_ON );
}
require_once LSCWP_DIR . 'tpl/inc/show_rule_conflict.php';
}
}
?>
<h3 class="litespeed-title">
<?php esc_html_e( 'LiteSpeed Cache View .htaccess', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#view-htaccess-tab' ); ?>
</h3>
<h3 class="litespeed-title-short">
<?php esc_html_e( '.htaccess Path', 'litespeed-cache' ); ?>
</h3>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th>
<?php esc_html_e( 'Frontend .htaccess Path', 'litespeed-cache' ); ?>
</th>
<td>
<code><?php echo esc_html( $htaccess_path ); ?></code>
<div class="litespeed-desc">
<?php esc_html_e( 'Default path is', 'litespeed-cache' ); ?>: <code><?php echo esc_html( Htaccess::get_frontend_htaccess( true ) ); ?></code>
<br />
<font class="litespeed-success">
<?php esc_html_e( 'API', 'litespeed-cache' ); ?>:
<?php printf( esc_html__( 'PHP Constant %s is supported.', 'litespeed-cache' ), '<code>LITESPEED_CFG_HTACCESS</code>' ); ?>
<?php printf( esc_html__( 'You can use this code %1$s in %2$s to specify the htaccess file path.', 'litespeed-cache' ), '<code>defined("LITESPEED_CFG_HTACCESS") || define("LITESPEED_CFG_HTACCESS", "your path on server");</code>', '<code>wp-config.php</code>' ); ?>
</font>
</div>
</td>
</tr>
<tr>
<th>
<?php esc_html_e( 'Backend .htaccess Path', 'litespeed-cache' ); ?>
</th>
<td>
<code><?php echo esc_html( Htaccess::get_backend_htaccess() ); ?></code>
<div class="litespeed-desc">
<?php esc_html_e( 'Default path is', 'litespeed-cache' ); ?>: <code><?php echo esc_html( Htaccess::get_backend_htaccess( true ) ); ?></code>
<br />
<font class="litespeed-success">
<?php esc_html_e( 'API', 'litespeed-cache' ); ?>:
<?php printf( esc_html__( 'PHP Constant %s is supported.', 'litespeed-cache' ), '<code>LITESPEED_CFG_HTACCESS_BACKEND</code>' ); ?>
<?php printf( esc_html__( 'You can use this code %1$s in %2$s to specify the htaccess file path.', 'litespeed-cache' ), '<code>defined("LITESPEED_CFG_HTACCESS_BACKEND") || define("LITESPEED_CFG_HTACCESS_BACKEND", "your path on server");</code>', '<code>wp-config.php</code>' ); ?>
</font>
</div>
</td>
</tr>
</tbody>
</table>
<?php if ( null !== $content ) : ?>
<h3 class="litespeed-title">
<?php printf( esc_html__( 'Current %s Contents', 'litespeed-cache' ), '.htaccess' ); ?>
</h3>
<h4><?php echo esc_html( $htaccess_path ); ?></h4>
<textarea readonly wrap="off" rows="50" class="large-text"><?php echo esc_textarea( $content ); ?></textarea>
<?php endif; ?>

View File

@@ -0,0 +1,61 @@
<?php
/**
* LiteSpeed Cache Toolbox
*
* Renders the toolbox interface for LiteSpeed Cache, providing access to various administrative tools and settings.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
$menu_list = array(
'purge' => esc_html__( 'Purge', 'litespeed-cache' ),
);
if ( ! $this->_is_network_admin ) {
$menu_list['import_export'] = esc_html__( 'Import / Export', 'litespeed-cache' );
}
if ( ! $this->_is_multisite || $this->_is_network_admin ) {
$menu_list['edit_htaccess'] = esc_html__( 'View .htaccess', 'litespeed-cache' );
}
if ( ! $this->_is_network_admin ) {
$menu_list['heartbeat'] = esc_html__( 'Heartbeat', 'litespeed-cache' );
$menu_list['report'] = esc_html__( 'Report', 'litespeed-cache' );
}
if ( ! $this->_is_multisite || $this->_is_network_admin ) {
$menu_list['settings-debug'] = esc_html__( 'Debug Settings', 'litespeed-cache' );
$menu_list['log_viewer'] = esc_html__( 'Log View', 'litespeed-cache' );
$menu_list['beta_test'] = esc_html__( 'Beta Test', 'litespeed-cache' );
}
?>
<div class="wrap">
<h1 class="litespeed-h1">
<?php esc_html_e( 'LiteSpeed Cache Toolbox', '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 $curr_tab => $val ) : ?>
<div data-litespeed-layout="<?php echo esc_attr( $curr_tab ); ?>">
<?php require LSCWP_DIR . "tpl/toolbox/$curr_tab.tpl.php"; ?>
</div>
<?php endforeach; ?>
</div>
</div>

View File

@@ -0,0 +1,128 @@
<?php
/**
* LiteSpeed Cache Heartbeat Control
*
* Renders the heartbeat control settings interface for LiteSpeed Cache, allowing configuration of WordPress heartbeat intervals.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
$this->form_action();
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Heartbeat Control', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#heartbeat-tab' ); ?>
</h3>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php esc_html_e( 'NOTICE:', 'litespeed-cache' ); ?></h4>
<p>
<?php esc_html_e( 'Disable WordPress interval heartbeat to reduce server load.', 'litespeed-cache' ); ?>
<span class="litespeed-warning">
🚨 <?php esc_html_e( 'Disabling this may cause WordPress tasks triggered by AJAX to stop working.', 'litespeed-cache' ); ?>
</span>
</p>
</div>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th>
<?php $option_id = Base::O_MISC_HEARTBEAT_FRONT; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Turn ON to control heartbeat on frontend.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_MISC_HEARTBEAT_FRONT_TTL; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id, 'litespeed-input-short' ); ?> <?php $this->readable_seconds(); ?>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Specify the %s heartbeat interval in seconds.', 'litespeed-cache' ), 'frontend' ); ?>
<?php printf( esc_html__( 'WordPress valid interval is %s seconds.', 'litespeed-cache' ), '<code>15</code> - <code>120</code>' ); ?><br />
<?php printf( esc_html__( 'Set to %1$s to forbid heartbeat on %2$s.', 'litespeed-cache' ), '<code>0</code>', 'frontend' ); ?><br />
<?php $this->recommended( $option_id ); ?>
<?php $this->_validate_ttl( $option_id, 15, 120, true ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_MISC_HEARTBEAT_BACK; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Turn ON to control heartbeat on backend.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_MISC_HEARTBEAT_BACK_TTL; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id, 'litespeed-input-short' ); ?> <?php $this->readable_seconds(); ?>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Specify the %s heartbeat interval in seconds.', 'litespeed-cache' ), 'backend' ); ?>
<?php printf( esc_html__( 'WordPress valid interval is %s seconds.', 'litespeed-cache' ), '<code>15</code> - <code>120</code>' ); ?><br />
<?php printf( esc_html__( 'Set to %1$s to forbid heartbeat on %2$s.', 'litespeed-cache' ), '<code>0</code>', 'backend' ); ?><br />
<?php $this->recommended( $option_id ); ?>
<?php $this->_validate_ttl( $option_id, 15, 120, true ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_MISC_HEARTBEAT_EDITOR; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Turn ON to control heartbeat in backend editor.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_MISC_HEARTBEAT_EDITOR_TTL; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id, 'litespeed-input-short' ); ?> <?php $this->readable_seconds(); ?>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Specify the %s heartbeat interval in seconds.', 'litespeed-cache' ), 'backend editor' ); ?>
<?php printf( esc_html__( 'WordPress valid interval is %s seconds.', 'litespeed-cache' ), '<code>15</code> - <code>120</code>' ); ?><br />
<?php printf( esc_html__( 'Set to %1$s to forbid heartbeat on %2$s.', 'litespeed-cache' ), '<code>0</code>', 'backend editor' ); ?><br />
<?php $this->recommended( $option_id ); ?>
<?php $this->_validate_ttl( $option_id, 15, 120, true ); ?>
</div>
</td>
</tr>
</tbody>
</table>
<?php $this->form_end(); ?>

View File

@@ -0,0 +1,73 @@
<?php
/**
* LiteSpeed Cache Import/Export Settings
*
* Renders the import/export settings interface for LiteSpeed Cache, allowing users to export, import, or reset plugin settings.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
$summary = Import::get_summary();
?>
<h3 class="litespeed-title">
<?php esc_html_e( 'Export Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#importexport-tab' ); ?>
</h3>
<div>
<a href="<?php echo esc_url( Utility::build_url( Router::ACTION_IMPORT, Import::TYPE_EXPORT ) ); ?>" class="button button-primary">
<?php esc_html_e( 'Export', 'litespeed-cache' ); ?>
</a>
</div>
<?php if ( ! empty( $summary['export_file'] ) ) : ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Last exported', 'litespeed-cache' ); ?>: <code><?php echo esc_html( $summary['export_file'] ); ?></code> <?php echo esc_html( Utility::readable_time( $summary['export_time'] ) ); ?>
</div>
<?php endif; ?>
<div class="litespeed-desc">
<?php esc_html_e( 'This will export all current LiteSpeed Cache settings and save them as a file.', 'litespeed-cache' ); ?>
</div>
<h3 class="litespeed-title">
<?php esc_html_e( 'Import Settings', 'litespeed-cache' ); ?>
</h3>
<?php $this->form_action( Router::ACTION_IMPORT, Import::TYPE_IMPORT, true ); ?>
<div class="litespeed-div">
<input type="file" name="ls_file" class="litespeed-input" />
</div>
<div class="litespeed-div">
<?php submit_button( esc_html__( 'Import', 'litespeed-cache' ), 'button button-primary', 'litespeed-submit' ); ?>
</div>
</form>
<?php if ( ! empty( $summary['import_file'] ) ) : ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Last imported', 'litespeed-cache' ); ?>: <code><?php echo esc_html( $summary['import_file'] ); ?></code> <?php echo esc_html( Utility::readable_time( $summary['import_time'] ) ); ?>
</div>
<?php endif; ?>
<div class="litespeed-desc">
<?php esc_html_e( 'This will import settings from a file and override all current LiteSpeed Cache settings.', 'litespeed-cache' ); ?>
</div>
<h3 class="litespeed-title">
<?php esc_html_e( 'Reset All Settings', 'litespeed-cache' ); ?>
</h3>
<div>
<p class="litespeed-danger">🚨 <?php esc_html_e( 'This will reset all settings to default settings.', 'litespeed-cache' ); ?></p>
</div>
<div>
<a href="<?php echo esc_url( Utility::build_url( Router::ACTION_IMPORT, Import::TYPE_RESET ) ); ?>" data-litespeed-cfm="<?php echo esc_attr( __( 'Are you sure you want to reset all settings back to the default settings?', 'litespeed-cache' ) ); ?>" class="button litespeed-btn-danger-bg">
<?php esc_html_e( 'Reset Settings', 'litespeed-cache' ); ?>
</a>
</div>

View File

@@ -0,0 +1,76 @@
<?php
/**
* LiteSpeed Cache Log Viewer
*
* Renders the log viewer interface for LiteSpeed Cache, displaying debug, purge, and crawler logs with options to copy or clear logs.
*
* @package LiteSpeed
* @since 4.7
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
$logs = array(
array(
'name' => 'debug',
'label' => esc_html__( 'Debug Log', 'litespeed-cache' ),
'accesskey' => 'A',
),
array(
'name' => 'purge',
'label' => esc_html__( 'Purge Log', 'litespeed-cache' ),
'accesskey' => 'B',
),
array(
'name' => 'crawler',
'label' => esc_html__( 'Crawler Log', 'litespeed-cache' ),
'accesskey' => 'C',
),
);
?>
<h3 class="litespeed-title">
<?php esc_html_e( 'LiteSpeed Logs', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#log-view-tab' ); ?>
</h3>
<div class="litespeed-log-subnav-wrapper">
<?php foreach ( $logs as $log ) : ?>
<a href="#<?php echo esc_attr( $log['name'] ); ?>_log" class="button button-secondary" data-litespeed-subtab="<?php echo esc_attr( $log['name'] ); ?>_log" litespeed-accesskey="<?php echo esc_attr( $log['accesskey'] ); ?>">
<?php echo esc_html( $log['label'] ); ?>
</a>
<?php endforeach; ?>
<a href="<?php echo esc_url( Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG ) ); ?>" class="button button-primary" litespeed-accesskey="D">
<?php esc_html_e( 'Clear Logs', 'litespeed-cache' ); ?>
</a>
</div>
<?php
foreach ( $logs as $log ) :
$file = $this->cls( 'Debug2' )->path( $log['name'] );
$lines = File::count_lines( $file );
$max_lines = apply_filters( 'litespeed_debug_show_max_lines', 1000 );
$start = $lines > $max_lines ? $lines - $max_lines : 0;
$lines = File::read( $file, $start );
$lines = $lines ? trim( implode( "\n", $lines ) ) : '';
$log_body_id = 'litespeed-log-' . esc_attr( $log['name'] );
?>
<div class="litespeed-log-view-wrapper" data-litespeed-sublayout="<?php echo esc_attr( $log['name'] ); ?>_log">
<h3 class="litespeed-title">
<?php echo esc_html( $log['label'] ); ?>
<a href="#<?php echo esc_attr( $log['name'] ); ?>_log" class="button litespeed-info-button litespeed-wrap" onClick="litespeed_copy_to_clipboard('<?php echo esc_js( $log_body_id ); ?>', this)" aria-label="<?php esc_attr_e( 'Click to copy', 'litespeed-cache' ); ?>" data-balloon-pos="down">
<?php esc_html_e( 'Copy Log', 'litespeed-cache' ); ?>
</a>
</h3>
<div class="litespeed-log-body" id="<?php echo esc_attr( $log_body_id ); ?>">
<?php echo nl2br( esc_html( $lines ) ); ?>
</div>
</div>
<?php endforeach; ?>
<a href="<?php echo esc_url( Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG ) ); ?>" class="button button-primary">
<?php esc_html_e( 'Clear Logs', 'litespeed-cache' ); ?>
</a>

View File

@@ -0,0 +1,279 @@
<?php
/**
* LiteSpeed Cache Purge Interface
*
* Renders the purge interface for LiteSpeed Cache, allowing users to clear various cache types and purge specific content.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
$_panels = array(
array(
'title' => esc_html__( 'Purge Front Page', 'litespeed-cache' ),
'desc' => esc_html__( 'This will Purge Front Page only', 'litespeed-cache' ),
'icon' => 'purge-front',
'append_url' => Purge::TYPE_PURGE_FRONTPAGE,
),
array(
'title' => esc_html__( 'Purge Pages', 'litespeed-cache' ),
'desc' => esc_html__( 'This will Purge Pages only', 'litespeed-cache' ),
'icon' => 'purge-pages',
'append_url' => Purge::TYPE_PURGE_PAGES,
),
);
foreach ( Tag::$error_code_tags as $code ) {
$_panels[] = array(
'title' => sprintf( esc_html__( 'Purge %s Error', 'litespeed-cache' ), esc_html( $code ) ),
'desc' => sprintf( esc_html__( 'Purge %s error pages', 'litespeed-cache' ), esc_html( $code ) ),
'icon' => 'purge-' . esc_attr( $code ),
'append_url' => Purge::TYPE_PURGE_ERROR . esc_attr( $code ),
);
}
$_panels[] = array(
'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - LSCache',
'desc' => esc_html__( 'Purge the LiteSpeed cache entries created by this plugin', 'litespeed-cache' ),
'icon' => 'purge-all',
'append_url' => Purge::TYPE_PURGE_ALL_LSCACHE,
);
$_panels[] = array(
'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'CSS/JS Cache', 'litespeed-cache' ),
'desc' => esc_html__( 'This will purge all minified/combined CSS/JS entries only', 'litespeed-cache' ),
'icon' => 'purge-cssjs',
'append_url' => Purge::TYPE_PURGE_ALL_CSSJS,
);
if ( defined( 'LSCWP_OBJECT_CACHE' ) ) {
$_panels[] = array(
'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Object Cache', 'litespeed-cache' ),
'desc' => esc_html__( 'Purge all the object caches', 'litespeed-cache' ),
'icon' => 'purge-object',
'append_url' => Purge::TYPE_PURGE_ALL_OBJECT,
);
}
if ( Router::opcache_enabled() ) {
$_panels[] = array(
'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Opcode Cache', 'litespeed-cache' ),
'desc' => esc_html__( 'Reset the entire opcode cache', 'litespeed-cache' ),
'icon' => 'purge-opcache',
'append_url' => Purge::TYPE_PURGE_ALL_OPCACHE,
);
}
if ( $this->has_cache_folder( 'ccss' ) ) {
$_panels[] = array(
'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Critical CSS', 'litespeed-cache' ),
'desc' => esc_html__( 'This will delete all generated critical CSS files', 'litespeed-cache' ),
'icon' => 'purge-cssjs',
'append_url' => Purge::TYPE_PURGE_ALL_CCSS,
);
}
if ( $this->has_cache_folder( 'ucss' ) ) {
$_panels[] = array(
'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Unique CSS', 'litespeed-cache' ),
'desc' => esc_html__( 'This will delete all generated unique CSS files', 'litespeed-cache' ),
'icon' => 'purge-cssjs',
'append_url' => Purge::TYPE_PURGE_ALL_UCSS,
);
}
if ( $this->has_cache_folder( 'localres' ) ) {
$_panels[] = array(
'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Localized Resources', 'litespeed-cache' ),
'desc' => esc_html__( 'This will delete all localized resources', 'litespeed-cache' ),
'icon' => 'purge-cssjs',
'append_url' => Purge::TYPE_PURGE_ALL_LOCALRES,
);
}
if ( $this->has_cache_folder( 'lqip' ) ) {
$_panels[] = array(
'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'LQIP Cache', 'litespeed-cache' ),
'desc' => esc_html__( 'This will delete all generated image LQIP placeholder files', 'litespeed-cache' ),
'icon' => 'purge-front',
'append_url' => Purge::TYPE_PURGE_ALL_LQIP,
);
}
if ( $this->has_cache_folder( 'vpi' ) ) {
$_panels[] = array(
'title' => __( 'Purge All', 'litespeed-cache' ) . ' - VPI',
'desc' => __( 'This will delete all generated Viewport Images', 'litespeed-cache' ),
'icon' => 'purge-front',
'append_url' => Purge::TYPE_PURGE_ALL_VPI,
);
}
if ( $this->has_cache_folder( 'avatar' ) ) {
$_panels[] = array(
'title' => esc_html__( 'Purge All', 'litespeed-cache' ) . ' - ' . esc_html__( 'Gravatar Cache', 'litespeed-cache' ),
'desc' => esc_html__( 'This will delete all cached Gravatar files', 'litespeed-cache' ),
'icon' => 'purge-cssjs',
'append_url' => Purge::TYPE_PURGE_ALL_AVATAR,
);
}
$_panels[] = array(
'title' => esc_html__( 'Purge All', 'litespeed-cache' ),
'desc' => esc_html__( 'Purge the cache entries created by this plugin except for Critical CSS & Unique CSS & LQIP caches', 'litespeed-cache' ),
'icon' => 'purge-all',
'title_cls' => 'litespeed-warning',
'newline' => true,
'append_url' => Purge::TYPE_PURGE_ALL,
);
if ( ! is_multisite() || is_network_admin() ) {
$_panels[] = array(
'title' => esc_html__( 'Empty Entire Cache', 'litespeed-cache' ),
'desc' => esc_html__( 'Clears all cache entries related to this site, including other web applications.', 'litespeed-cache' ) . ' <b>' . esc_html__( 'This action should only be used if things are cached incorrectly.', 'litespeed-cache' ) . '</b>',
'tag' => Core::ACTION_PURGE_EMPTYCACHE,
'icon' => 'empty-cache',
'title_cls' => 'litespeed-danger',
'cfm' => esc_html__( 'This will clear EVERYTHING inside the cache.', 'litespeed-cache' ) . ' ' . esc_html__( 'This may cause heavy load on the server.', 'litespeed-cache' ) . ' ' . esc_html__( 'If only the WordPress site should be purged, use Purge All.', 'litespeed-cache' ),
);
}
?>
<?php require_once LSCWP_DIR . 'tpl/inc/check_cache_disabled.php'; ?>
<h3 class="litespeed-title">
<?php esc_html_e( 'Purge', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#purge-tab' ); ?>
</h3>
<div class="litespeed-panel-wrapper litespeed-cards-wrapper">
<?php foreach ( $_panels as $panel ) : ?>
<?php
$action_tag = ! empty( $panel['tag'] ) ? $panel['tag'] : Router::ACTION_PURGE;
$append_url = ! empty( $panel['append_url'] ) ? $panel['append_url'] : false;
$cfm = ! empty( $panel['cfm'] ) ? Str::trim_quotes( $panel['cfm'] ) : false;
?>
<?php if ( ! empty( $panel['newline'] ) ) : ?>
<div class="litespeed-col-br"></div>
<?php endif; ?>
<a class="litespeed-panel postbox" href="<?php echo esc_url( Utility::build_url( $action_tag, $append_url ) ); ?>" data-litespeed-cfm="<?php echo esc_attr( $cfm ); ?>">
<section class="litespeed-panel-wrapper-icon">
<span class="litespeed-panel-icon-<?php echo esc_attr( $panel['icon'] ); ?>"></span>
</section>
<section class="litespeed-panel-content">
<div class="litespeed-h3 <?php echo ! empty( $panel['title_cls'] ) ? esc_attr( $panel['title_cls'] ) : ''; ?>">
<?php echo esc_html( $panel['title'] ); ?>
</div>
<span class="litespeed-panel-para"><?php echo wp_kses_post( $panel['desc'] ); ?></span>
</section>
</a>
<?php endforeach; ?>
</div>
<?php
if ( is_multisite() && is_network_admin() ) {
return;
}
?>
<h3 class="litespeed-title">
<?php esc_html_e( 'Purge By...', 'litespeed-cache' ); ?>
</h3>
<p class="litespeed-description">
<?php esc_html_e( 'Select below for "Purge by" options.', 'litespeed-cache' ); ?>
<?php Doc::one_per_line(); ?>
</p>
<?php $this->form_action( Core::ACTION_PURGE_BY ); ?>
<div class="litespeed-row">
<div class="litespeed-switch litespeed-mini litespeed-right20 litespeed-margin-bottom10">
<?php $val = Admin_Display::PURGEBY_CAT; ?>
<input type="radio" autocomplete="off" name="<?php echo esc_attr( Admin_Display::PURGEBYOPT_SELECT ); ?>" id="purgeby_option_category" value="<?php echo esc_attr( $val ); ?>" checked />
<label for="purgeby_option_category"><?php esc_html_e( 'Category', 'litespeed-cache' ); ?></label>
<?php $val = Admin_Display::PURGEBY_PID; ?>
<input type="radio" autocomplete="off" name="<?php echo esc_attr( Admin_Display::PURGEBYOPT_SELECT ); ?>" id="purgeby_option_postid" value="<?php echo esc_attr( $val ); ?>" />
<label for="purgeby_option_postid"><?php esc_html_e( 'Post ID', 'litespeed-cache' ); ?></label>
<?php $val = Admin_Display::PURGEBY_TAG; ?>
<input type="radio" autocomplete="off" name="<?php echo esc_attr( Admin_Display::PURGEBYOPT_SELECT ); ?>" id="purgeby_option_tag" value="<?php echo esc_attr( $val ); ?>" />
<label for="purgeby_option_tag"><?php esc_html_e( 'Tag', 'litespeed-cache' ); ?></label>
<?php $val = Admin_Display::PURGEBY_URL; ?>
<input type="radio" autocomplete="off" name="<?php echo esc_attr( Admin_Display::PURGEBYOPT_SELECT ); ?>" id="purgeby_option_url" value="<?php echo esc_attr( $val ); ?>" />
<label for="purgeby_option_url"><?php esc_html_e( 'URL', 'litespeed-cache' ); ?></label>
</div>
<div class="litespeed-cache-purgeby-text litespeed-desc">
<div class="" data-purgeby="<?php echo esc_attr( Admin_Display::PURGEBY_CAT ); ?>">
<?php printf( esc_html__( 'Purge pages by category name - e.g. %2$s should be used for the URL %1$s.', 'litespeed-cache' ), '<code>http://example.com/category/category-name/</code>', '<code>category-name</code>' ); ?>
</div>
<div class="litespeed-hide" data-purgeby="<?php echo esc_attr( Admin_Display::PURGEBY_PID ); ?>">
<?php esc_html_e( 'Purge pages by post ID.', 'litespeed-cache' ); ?>
</div>
<div class="litespeed-hide" data-purgeby="<?php echo esc_attr( Admin_Display::PURGEBY_TAG ); ?>">
<?php printf( esc_html__( 'Purge pages by tag name - e.g. %2$s should be used for the URL %1$s.', 'litespeed-cache' ), '<code>http://example.com/tag/tag-name/</code>', '<code>tag-name</code>' ); ?>
</div>
<div class="litespeed-hide" data-purgeby="<?php echo esc_attr( Admin_Display::PURGEBY_URL ); ?>">
<?php esc_html_e( 'Purge pages by relative or full URL.', 'litespeed-cache' ); ?>
<?php printf( esc_html__( 'e.g. Use %1$s or %2$s.', 'litespeed-cache' ), '<code>/2016/02/24/hello-world/</code>', '<code>http://example.com/2016/02/24/hello-world/</code>' ); ?>
</div>
</div>
</div>
<p>
<textarea name="<?php echo esc_attr( Admin_Display::PURGEBYOPT_LIST ); ?>" rows="5" class="litespeed-textarea"></textarea>
</p>
<p>
<button type="submit" class="button button-primary"><?php esc_html_e( 'Purge List', 'litespeed-cache' ); ?></button>
</p>
</form>
<script>
(function ($) {
function setCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/; SameSite=Strict";
}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1, c.length);
}
if (c.indexOf(nameEQ) == 0) {
return c.substring(nameEQ.length, c.length);
}
}
return null;
}
jQuery(document).ready(function () {
var savedPurgeBy = getCookie('litespeed_purgeby_option');
if (savedPurgeBy) {
$('input[name="<?php echo esc_attr( Admin_Display::PURGEBYOPT_SELECT ); ?>"][value="' + savedPurgeBy + '"]').prop('checked', true);
$('[data-purgeby]').addClass('litespeed-hide');
$('[data-purgeby="' + savedPurgeBy + '"]').removeClass('litespeed-hide');
}
// Manage page -> purge by
$('[name=purgeby]').on('change', function (event) {
$('[data-purgeby]').addClass('litespeed-hide');
$('[data-purgeby=' + this.value + ']').removeClass('litespeed-hide');
setCookie('litespeed_purgeby_option', this.value, 30);
});
});
})(jQuery);
</script>

View File

@@ -0,0 +1,141 @@
<?php
/**
* LiteSpeed Cache Report Interface
*
* Renders the report interface for LiteSpeed Cache, allowing users to generate and send environment reports to LiteSpeed Support.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
$_report = Report::cls();
$report = $_report->generate_environment_report();
$env_ref = Report::get_summary();
// Detect passwordless plugin
$dologin_link = '';
$has_pswdless_plugin = false;
if ( function_exists( 'dologin_gen_link' ) ) {
$has_pswdless_plugin = true;
if ( ! empty( $_GET['dologin_gen_link'] ) && ! empty( $_GET['litespeed_purge_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['litespeed_purge_nonce'] ) ), 'litespeed_purge_action' ) ) {
unset( $_GET['dologin_gen_link'] );
$dologin_link = dologin_gen_link( 'Litespeed Report' );
?>
<script>
window.history.pushState('remove_gen_link', document.title, window.location.href.replace('&dologin_gen_link=1', ''));
</script>
<?php
}
}
$install_link = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_3RD, false, null, array( 'plugin' => 'dologin' ) );
$btn_title = esc_html__( 'Send to LiteSpeed', 'litespeed-cache' );
if ( ! empty( $env_ref['num'] ) ) {
$btn_title = esc_html__( 'Regenerate and Send a New Report', 'litespeed-cache' );
}
?>
<?php if ( ! $has_pswdless_plugin ) : ?>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php esc_html_e( 'NOTICE:', 'litespeed-cache' ); ?></h4>
<p>
<?php printf( esc_html__( 'To generate a passwordless link for LiteSpeed Support Team access, you must install %s.', 'litespeed-cache' ), '<a href="https://wordpress.org/plugins/dologin/" target="_blank">DoLogin Security</a>' ); ?>
</p>
<p>
<a href="<?php echo esc_url( $install_link ); ?>" class="button litespeed-btn litespeed-right20"><?php esc_html_e( 'Install DoLogin Security', 'litespeed-cache' ); ?></a>
<a href="<?php echo esc_url( admin_url( 'plugin-install.php?s=dologin+security&tab=search&type=term' ) ); ?>" target="_blank"><?php esc_html_e( 'Go to plugins list', 'litespeed-cache' ); ?></a>
</p>
</div>
<?php endif; ?>
<h3 class="litespeed-title">
<?php esc_html_e( 'LiteSpeed Report', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#report-tab' ); ?>
</h3>
<p><?php esc_html_e( 'Last Report Number', 'litespeed-cache' ); ?>: <b><?php echo ! empty( $env_ref['num'] ) ? '<span id="report_span" style="cursor: pointer;" onClick="litespeed_copy_to_clipboard(\'report_span\', this)" aria-label="' . esc_attr__( 'Click to copy', 'litespeed-cache' ) . '" data-balloon-pos="down" class="litespeed-wrap">' . esc_html( $env_ref['num'] ) . '</span>' : '-'; ?></b></p>
<p><?php esc_html_e( 'Last Report Date', 'litespeed-cache' ); ?>: <b><?php echo ! empty( $env_ref['dateline'] ) ? esc_html( gmdate( 'm/d/Y H:i:s', $env_ref['dateline'] ) ) : '-'; ?></b></p>
<p class="litespeed-desc">
<?php esc_html_e( 'The environment report contains detailed information about the WordPress configuration.', 'litespeed-cache' ); ?>
<br />
<?php esc_html_e( 'If you run into any issues, please refer to the report number in your support message.', 'litespeed-cache' ); ?>
</p>
<?php $this->form_action( Router::ACTION_REPORT, Report::TYPE_SEND_REPORT ); ?>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th><?php esc_html_e( 'System Information', 'litespeed-cache' ); ?></th>
<td>
<textarea id="litespeed-report" rows="20" cols="100" readonly><?php echo esc_textarea( $report ); ?></textarea>
</td>
</tr>
<tr>
<th></th>
<td>
<?php
$this->build_checkbox(
'attach_php',
sprintf(
esc_html__( 'Attach PHP info to report. Check this box to insert relevant data from %s.', 'litespeed-cache' ),
'<a href="https://www.php.net/manual/en/function.phpinfo.php" target="_blank">phpinfo()</a>'
),
false
);
?>
</td>
</tr>
<tr>
<th><?php esc_html_e( 'Passwordless Link', 'litespeed-cache' ); ?></th>
<td>
<input type="text" class="litespeed-regular-text" id="litespeed-report-link" name="link" value="<?php echo esc_attr( $dologin_link ); ?>" style="width:500px;" />
<?php if ( $has_pswdless_plugin ) : ?>
<a href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin.php?page=litespeed-toolbox&dologin_gen_link=1' ), 'litespeed_purge_action', 'litespeed_purge_nonce' ) ); ?>" class="button button-secondary"><?php esc_html_e( 'Generate Link for Current User', 'litespeed-cache' ); ?></a>
<?php else : ?>
<button type="button" class="button button-secondary" disabled><?php esc_html_e( 'Generate Link for Current User', 'litespeed-cache' ); ?></button>
<?php endif; ?>
<div class="litespeed-desc">
<?php esc_html_e( 'To grant wp-admin access to the LiteSpeed Support Team, please generate a passwordless link for the current logged-in user to be sent with the report.', 'litespeed-cache' ); ?>
<?php if ( $dologin_link ) : ?>
<br /><strong>🚨 <?php esc_html_e( 'Please do NOT share the above passwordless link with anyone.', 'litespeed-cache' ); ?></strong>
<strong>
<?php
printf(
/* translators: %s: Link tags */
esc_html__( 'Generated links may be managed under %sSettings%s.', 'litespeed-cache' ),
'<a href="' . esc_url( menu_page_url( 'dologin', false ) ) . '#pswdless">',
'</a>' );
?>
</strong>
<?php endif; ?>
</div>
</td>
</tr>
<tr>
<th><?php esc_html_e( 'Notes', 'litespeed-cache' ); ?></th>
<td>
<textarea name="notes" rows="10" cols="100"></textarea>
<div class="litespeed-desc">
<?php esc_html_e( 'Optional', 'litespeed-cache' ); ?>:
<?php esc_html_e( 'provide more information here to assist the LiteSpeed team with debugging.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
</tbody>
</table>
<div class="litespeed-top20"></div>
<button class="button button-primary" type="submit"><?php echo esc_html( $btn_title ); ?></button>
<button class="button button-primary litespeed-float-submit" type="submit"><?php echo esc_html( $btn_title ); ?></button>
<p class="litespeed-top30 litespeed-left10 litespeed-desc">
<?php esc_html_e( 'Send this report to LiteSpeed. Refer to this report number when posting in the WordPress support forum.', 'litespeed-cache' ); ?>
</p>
</form>

View File

@@ -0,0 +1,196 @@
<?php
/**
* LiteSpeed Cache Debug Settings Interface
*
* Renders the debug settings interface for LiteSpeed Cache, allowing users to configure debugging options and view the site with specific settings bypassed.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
$this->form_action( $this->_is_network_admin ? Router::ACTION_SAVE_SETTINGS_NETWORK : false );
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Debug Helpers', 'litespeed-cache' ); ?>
</h3>
<a href="<?php echo esc_url( home_url( '/' ) . '?' . Router::ACTION . '=before_optm' ); ?>" class="button button-success" target="_blank">
<?php esc_html_e( 'View Site Before Optimization', 'litespeed-cache' ); ?>
</a>
<a href="<?php echo esc_url( home_url( '/' ) . '?' . Router::ACTION . '=' . Core::ACTION_QS_NOCACHE ); ?>" class="button button-success" target="_blank">
<?php esc_html_e( 'View Site Before Cache', 'litespeed-cache' ); ?>
</a>
<?php
$temp_disabled_time = $this->conf( Base::DEBUG_TMP_DISABLE );
$temp_disabled = Debug2::is_tmp_disable();
if ( !$temp_disabled ) {
?>
<a href="<?php echo wp_kses_post( Utility::build_url(Router::ACTION_TMP_DISABLE, false, false, '_ori') ); ?>" class="button litespeed-btn-danger">
<?php esc_html_e( 'Disable All Features for 24 Hours', 'litespeed-cache' ); ?>
</a>
<?php
} else {
$date = wp_date( get_option('date_format') . ' ' . get_option( 'time_format' ), $temp_disabled_time );
?>
<a href="<?php echo wp_kses_post( Utility::build_url(Router::ACTION_TMP_DISABLE, false, false, '_ori') ); ?>" class="button litespeed-btn-warning">
<?php esc_html_e( 'Remove `Disable All Feature` Flag Now', 'litespeed-cache' ); ?>
</a>
<div class="litespeed-callout notice notice-warning inline">
<h4><?php esc_html_e( 'NOTICE', 'litespeed-cache' ); ?></h4>
<p><?php echo wp_kses_post( sprintf ( __( 'LiteSpeed Cache is temporarily disabled until: %s.', 'litespeed-cache' ), '<strong>' . $date . '</strong>' ) ); ?></p>
</div>
<?php
}
?>
<h3 class="litespeed-title-short">
<?php esc_html_e( 'Debug Settings', 'litespeed-cache' ); ?>
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#debug-settings-tab' ); ?>
</h3>
<table class="wp-list-table striped litespeed-table">
<tbody>
<tr>
<th>
<?php $option_id = Base::O_DEBUG_DISABLE_ALL; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'This will disable LSCache and all optimization features for debug purpose.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_DEBUG; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id, array( esc_html__( 'OFF', 'litespeed-cache' ), esc_html__( 'ON', 'litespeed-cache' ), esc_html__( 'Admin IP Only', 'litespeed-cache' ) ) ); ?>
<div class="litespeed-desc">
<?php printf( esc_html__( 'Outputs to a series of files in the %s directory.', 'litespeed-cache' ), '<code>wp-content/litespeed/debug</code>' ); ?>
<?php esc_html_e( 'To prevent filling up the disk, this setting should be OFF when everything is working.', 'litespeed-cache' ); ?>
<?php esc_html_e( 'The Admin IP option will only output log messages on requests from admin IPs listed below.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_DEBUG_IPS; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id, 50 ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Allows listed IPs (one per line) to perform certain actions from their browsers.', 'litespeed-cache' ); ?>
<?php esc_html_e( 'Your IP', 'litespeed-cache' ); ?>: <code><?php echo esc_html( Router::get_ip() ); ?></code>
<?php $this->_validate_ip( $option_id ); ?>
<br />
<?php
Doc::learn_more(
'https://docs.litespeedtech.com/lscache/lscwp/admin/#admin-ip-commands',
esc_html__( 'More information about the available commands can be found here.', 'litespeed-cache' )
);
?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_DEBUG_LEVEL; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id, array( esc_html__( 'Basic', 'litespeed-cache' ), esc_html__( 'Advanced', 'litespeed-cache' ) ) ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Advanced level will log more details.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_DEBUG_FILESIZE; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_input( $option_id, 'litespeed-input-short' ); ?> <?php esc_html_e( 'MB', 'litespeed-cache' ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Specify the maximum size of the log file.', 'litespeed-cache' ); ?>
<?php $this->recommended( $option_id ); ?>
<?php $this->_validate_ttl( $option_id, 3, 3000 ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_DEBUG_COLLAPSE_QS; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Shorten query strings in the debug log to improve readability.', 'litespeed-cache' ); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_DEBUG_INC; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Only log listed pages.', 'litespeed-cache' ); ?>
<?php $this->_uri_usage_example(); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_DEBUG_EXC; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Prevent any debug log of listed pages.', 'litespeed-cache' ); ?>
<?php $this->_uri_usage_example(); ?>
</div>
</td>
</tr>
<tr>
<th>
<?php $option_id = Base::O_DEBUG_EXC_STRINGS; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_textarea( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Prevent writing log entries that include listed strings.', 'litespeed-cache' ); ?>
<?php Doc::one_per_line(); ?>
</div>
</td>
</tr>
</tbody>
</table>
<?php $this->form_end(); ?>