initial commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* @deprecated 3.3 Will only show banner after user manually checked score
|
||||
*/
|
||||
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$url = Utility::build_url( Router::ACTION_HEALTH, Health::TYPE_SPEED, true ) ;
|
||||
$url = htmlspecialchars_decode( $url ) ;
|
||||
?>
|
||||
<script>
|
||||
document.addEventListener( 'DOMContentLoaded', function( event ) {
|
||||
jQuery(document).ready( function() {
|
||||
jQuery.get( '<?php echo $url; ?>' ) ;
|
||||
} ) ;
|
||||
} ) ;
|
||||
</script>
|
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
?>
|
||||
|
||||
<div class="litespeed-wrap notice notice-success litespeed-banner-promo-full">
|
||||
|
||||
<div class="litespeed-banner-promo-content">
|
||||
<h3 class="litespeed-banner-title litespeed-top15"><?php echo $this->_summary[ 'news.title' ] ; ?></h3>
|
||||
<div class="litespeed-banner-description" style="flex-direction: column;">
|
||||
<div class="litespeed-banner-description-padding-right-15">
|
||||
<p class="litespeed-banner-desciption-content">
|
||||
<?php echo $this->_summary[ 'news.content' ]; ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="litespeed-inline">
|
||||
<div class="litespeed-banner-description-padding-right-15 litespeed-margin-bottom10">
|
||||
<?php if ( ! empty( $this->_summary[ 'news.plugin' ] ) ) : ?>
|
||||
<?php $install_link = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_3RD, false, null, array( 'plugin' => $this->_summary[ 'news.plugin' ] ) ); ?>
|
||||
<a href="<?php echo $install_link ; ?>" class="button litespeed-btn-success">
|
||||
<?php echo __( 'Install', 'litespeed-cache' ); ?>
|
||||
<?php if ( ! empty( $this->_summary[ 'news.plugin_name' ] ) ) echo $this->_summary[ 'news.plugin_name' ]; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ( ! empty( $this->_summary[ 'news.zip' ] ) ) : ?>
|
||||
<?php $install_link = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_ZIP ); ?>
|
||||
<a href="<?php echo $install_link ; ?>" class="button litespeed-btn-success">
|
||||
<?php echo __( 'Install', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<?php $dismiss_url = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_DISMISS_RECOMMENDED ) ; ?>
|
||||
<span class="screen-reader-text">Dismiss this notice.</span>
|
||||
<a href="<?php echo $dismiss_url ; ?>" class="litespeed-notice-dismiss">X</a>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
?>
|
||||
|
||||
<div class="litespeed-wrap notice notice-success litespeed-banner-promo-qc">
|
||||
|
||||
<div class="litespeed-banner-promo-qc-content">
|
||||
|
||||
<div class="litespeed-banner-promo-qc-description">
|
||||
<h2><?php echo __( 'You just unlocked a promotion from QUIC.cloud!', 'litespeed-cache' );?></h2>
|
||||
<p>Spread the love and earn <strong><?php echo $this->_summary[ 'promo' ][ 0 ][ 'quota' ]; ?></strong> credits to use in our QUIC.cloud online services.</p>
|
||||
<p>
|
||||
<a class="button button-primary" href="<?php echo $this->_summary[ 'promo' ][ 0 ][ 'url' ]; ?>" target="_blank">Send to twitter to get <?php echo $this->_summary[ 'promo' ][ 0 ][ 'quota' ]; ?> bonus</a>
|
||||
<a href="https://www.quic.cloud/faq/#credit" target="_blank"><?php echo __( 'Learn more', 'litespeed-cache' );?></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-banner-promo-qc-preview">
|
||||
<h4 class="litespeed-tweet-preview-title"><?php echo __( 'Tweet preview', 'litespeed-cache' );?></h4>
|
||||
<div class="litespeed-tweet-preview">
|
||||
|
||||
<div class="litespeed-tweet-img"><img src="<?php echo $this->_summary[ 'promo' ][ 0 ][ 'image' ]; ?>"></div>
|
||||
|
||||
<div class="litespeed-tweet-preview-content">
|
||||
<p class="litespeed-tweet-text"><?php echo $this->_summary[ 'promo' ][ 0 ][ 'content' ]; ?></p>
|
||||
|
||||
<div class="litespeed-tweet-cta">
|
||||
<a href="<?php echo $this->_summary[ 'promo' ][ 0 ][ 'url' ]; ?>" class="litespeed-tweet-btn" target="_blank"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 250 250" xml:space="preserve">
|
||||
<path class="st0" d="M78.6,226.6c94.3,0,145.9-78.2,145.9-145.9c0-2.2,0-4.4-0.1-6.6c10-7.3,18.7-16.3,25.6-26.5
|
||||
c-9.4,4.1-19.3,6.9-29.5,8.1c10.7-6.4,18.7-16.5,22.5-28.4c-10.1,6-21.1,10.2-32.6,12.4c-19.4-20.7-51.9-21.7-72.6-2.2
|
||||
c-13.3,12.5-19,31.2-14.8,49C81.9,84.3,43.4,64.8,17.4,32.8c-13.6,23.4-6.7,53.4,15.9,68.5c-8.2-0.2-16.1-2.4-23.3-6.4
|
||||
c0,0.2,0,0.4,0,0.6c0,24.4,17.2,45.4,41.2,50.3c-7.6,2.1-15.5,2.4-23.2,0.9c6.7,20.9,26,35.2,47.9,35.6c-18.2,14.3-40.6,22-63.7,22
|
||||
c-4.1,0-8.2-0.3-12.2-0.7C23.5,218.6,50.7,226.6,78.6,226.6"/>
|
||||
</svg>
|
||||
<?php echo __( 'Tweet this', 'litespeed-cache' );?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<?php $dismiss_url = Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_CLEAR_PROMO ) ; ?>
|
||||
<span class="screen-reader-text"><?php echo __( 'Dismiss this notice', 'litespeed-cache' );?>.</span>
|
||||
<a href="<?php echo $dismiss_url ; ?>" class="litespeed-notice-dismiss">X</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
/**
|
||||
* NOTE: Only show for single site
|
||||
*/
|
||||
if ( is_multisite() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->conf( Base::O_AUTO_UPGRADE ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$current = get_site_transient( 'update_plugins' );
|
||||
if ( ! isset( $current->response[ Core::PLUGIN_FILE ] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$last_check = empty( $this->_summary[ 'new_version.last_check' ] ) ? 0 : $this->_summary[ 'new_version.last_check' ];
|
||||
// Check once in a half day
|
||||
if ( time() - $last_check > 43200 ) {
|
||||
$this->_summary[ 'new_version.last_check' ] = time();
|
||||
Admin_Display::save_summary( $this->_summary );
|
||||
|
||||
// Detect version
|
||||
$auto_v = Cloud::version_check( 'new_version_banner' );
|
||||
if ( ! empty( $auto_v[ 'latest' ] ) ) {
|
||||
$this->_summary[ 'new_version.v' ] = $auto_v[ 'latest' ];
|
||||
Admin_Display::save_summary( $this->_summary );
|
||||
}
|
||||
// After detect, don't show, just return and show next time
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! isset( $this->_summary[ 'new_version.v' ] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if current version is newer than auto_v or not
|
||||
if ( version_compare( Core::VER, $this->_summary[ 'new_version.v' ], '>=' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
//********** Can show now **********//
|
||||
|
||||
$this->_promo_true = true;
|
||||
|
||||
if ( $check_only ) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="litespeed-wrap notice notice-success litespeed-banner-promo-full">
|
||||
<div class="litespeed-banner-promo-logo"></div>
|
||||
|
||||
<div class="litespeed-banner-promo-content">
|
||||
<h3 class="litespeed-banner-title litespeed-top15"><?php echo __( 'LiteSpeed Cache', 'litespeed-cache' ); ?>: <?php echo __( 'New Version Available!', 'litespeed-cache' ); ?></h3>
|
||||
<div class="litespeed-banner-description">
|
||||
<div class="litespeed-banner-description-padding-right-15">
|
||||
<p class="litespeed-banner-desciption-content">
|
||||
<?php echo sprintf( __( 'New release %s is available now.', 'litespeed-cache' ), 'v' . $this->_summary[ 'new_version.v' ] ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="litespeed-row-flex litespeed-banner-description">
|
||||
<div class="litespeed-banner-description-padding-right-15">
|
||||
<?php $url = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_UPGRADE ); ?>
|
||||
<a href="<?php echo $url; ?>" class="button litespeed-btn-success litespeed-btn-mini">
|
||||
<i class="dashicons dashicons-image-rotate"> </i>
|
||||
<?php echo __( 'Upgrade', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="litespeed-banner-description-padding-right-15">
|
||||
<?php
|
||||
$cfg = array( Conf::TYPE_SET . '[' . Base::O_AUTO_UPGRADE . ']' => 1 );
|
||||
$url = Utility::build_url( Router::ACTION_CONF, Conf::TYPE_SET, false, null, $cfg );
|
||||
?>
|
||||
<a href="<?php echo $url; ?>" class="button litespeed-btn-primary litespeed-btn-mini">
|
||||
<i class="dashicons dashicons-update"> </i>
|
||||
<?php echo __( 'Turn On Auto Upgrade', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="litespeed-banner-description-padding-right-15">
|
||||
<?php $url = Utility::build_url( Core::ACTION_DISMISS, GUI::TYPE_DISMISS_PROMO, false, null, array( 'promo_tag' => 'new_version' ) ); ?>
|
||||
<a href="<?php echo $url; ?>" class="button litespeed-btn-warning litespeed-btn-mini">
|
||||
<?php echo __( 'Maybe Later', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<?php $dismiss_url = Utility::build_url( Core::ACTION_DISMISS, GUI::TYPE_DISMISS_PROMO, false, null, array( 'promo_tag' => 'new_version', 'later' => 1 ) ); ?>
|
||||
<span class="screen-reader-text">Dismiss this notice.</span>
|
||||
<a href="<?php echo $dismiss_url; ?>" class="litespeed-notice-dismiss">X</a>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
?>
|
||||
|
||||
<div class="litespeed-wrap notice notice-warning litespeed-banner-promo-full">
|
||||
<div class="litespeed-banner-promo-logo"></div>
|
||||
|
||||
<div class="litespeed-banner-promo-content">
|
||||
<h3 class="litespeed-banner-title litespeed-top15"><?php echo __( 'LiteSpeed Cache', 'litespeed-cache' ) ; ?>: <?php echo __( 'New Developer Version Available!', 'litespeed-cache' ) ; ?></h3>
|
||||
<div class="litespeed-banner-description">
|
||||
<div class="litespeed-banner-description-padding-right-15">
|
||||
<p class="litespeed-banner-desciption-content">
|
||||
<?php echo sprintf( __( 'New developer version %s is available now.', 'litespeed-cache' ), 'v' . $this->_summary[ 'version.dev' ] ) ; ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="litespeed-row-flex litespeed-banner-description">
|
||||
<div class="litespeed-banner-description-padding-right-15">
|
||||
<?php $url = Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_BETA_TEST, false, null, array( Debug2::BETA_TEST_URL => 'dev' ) ) ; ?>
|
||||
<a href="<?php echo $url ; ?>" class="button litespeed-btn-success litespeed-btn-mini">
|
||||
<i class="dashicons dashicons-image-rotate"> </i>
|
||||
<?php echo __( 'Upgrade', 'litespeed-cache' ) ; ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$health_scores = Health::cls()->scores();
|
||||
|
||||
// If speed is not reduced half or score is larger
|
||||
if ( $health_scores[ 'speed_before' ] <= $health_scores[ 'speed_after' ] * 2 || $health_scores[ 'score_before' ] >= $health_scores[ 'score_after' ] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
//********** Can show now **********//
|
||||
$this->_promo_true = true;
|
||||
|
||||
if ( $check_only ) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="litespeed-wrap notice notice-info litespeed-banner-promo-full">
|
||||
<div class="litespeed-banner-promo-logo"></div>
|
||||
|
||||
<div class="litespeed-banner-promo-content">
|
||||
<h3 class="litespeed-banner-title litespeed-banner-promo-content"><?php echo __( 'Thank You for Using the LiteSpeed Cache Plugin!', 'litespeed-cache' ); ?></h3>
|
||||
|
||||
<div class="litespeed-row-flex litespeed-banner-promo-content litespeed-margin-left-remove litespeed-flex-wrap">
|
||||
<div class="litespeed-right50 litespeed-margin-bottom20">
|
||||
<h2 class="litespeed-text-grey litespeed-margin-bottom-remove litespeed-top10"><?php echo __( 'Page Load Time', 'litespeed-cache' ); ?></h2>
|
||||
<hr class="litespeed-margin-bottom-remove" />
|
||||
<div class="litespeed-row-flex" style="margin-left: -10px;">
|
||||
<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
|
||||
<div>
|
||||
<p class="litespeed-text-grey litespeed-margin-y-remove">
|
||||
<?php echo __( 'Before', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="litespeed-top10 litespeed-text-jumbo litespeed-text-grey">
|
||||
<?php echo $health_scores[ 'speed_before' ]; ?><span class="litespeed-text-large">s</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
|
||||
<div>
|
||||
<p class="litespeed-text-grey litespeed-margin-y-remove">
|
||||
<?php echo __( 'After', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="litespeed-top10 litespeed-text-jumbo litespeed-success">
|
||||
<?php echo $health_scores[ 'speed_after' ]; ?><span class="litespeed-text-large">s</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
|
||||
<div>
|
||||
<p class="litespeed-text-grey litespeed-margin-y-remove" style="white-space: nowrap;">
|
||||
<?php echo __( 'Improved by', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="litespeed-top10 litespeed-text-jumbo litespeed-text-fern">
|
||||
<?php echo $health_scores[ 'speed_improved' ]; ?><span class="litespeed-text-large">%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( $health_scores[ 'score_before' ] < $health_scores[ 'score_after' ] ) : ?>
|
||||
<div class="litespeed-margin-bottom20">
|
||||
<h2 class="litespeed-text-grey litespeed-margin-bottom-remove litespeed-top10"><?php echo __( 'PageSpeed Score', 'litespeed-cache' ); ?></h2>
|
||||
<hr class="litespeed-margin-bottom-remove" />
|
||||
<div class="litespeed-row-flex" style="margin-left: -10px;">
|
||||
<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
|
||||
<div>
|
||||
<p class="litespeed-text-grey litespeed-text-center litespeed-margin-y-remove">
|
||||
<?php echo __( 'Before', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="litespeed-promo-score" style="margin-top:-5px;">
|
||||
<?php echo GUI::pie( $health_scores[ 'score_before' ], 45, false, true, 'litespeed-pie-' . $this->get_cls_of_pagescore( $health_scores[ 'score_before' ] ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
|
||||
<div>
|
||||
<p class="litespeed-text-grey litespeed-text-center litespeed-margin-y-remove">
|
||||
<?php echo __( 'After', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="litespeed-promo-score" style="margin-top:-5px;">
|
||||
<?php echo GUI::pie( $health_scores[ 'score_after' ], 45, false, true, 'litespeed-pie-' . $this->get_cls_of_pagescore( $health_scores[ 'score_after' ] ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
|
||||
<div>
|
||||
<p class="litespeed-text-grey litespeed-margin-y-remove" style="white-space: nowrap;">
|
||||
<?php echo __( 'Improved by', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="litespeed-top10 litespeed-text-jumbo litespeed-text-fern">
|
||||
<?php echo $health_scores[ 'score_improved' ]; ?><span class="litespeed-text-large">%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="litespeed-row-flex litespeed-flex-wrap litespeed-margin-y5">
|
||||
<div class="litespeed-banner-description-padding-right-15">
|
||||
|
||||
<a href="https://wordpress.org/support/plugin/litespeed-cache/reviews/?filter=5#new-post" target="_blank" style="text-decoration: none;">
|
||||
<button class="button litespeed-btn-success litespeed-btn-mini">
|
||||
<?php echo __( 'Sure I\'d love to review!', 'litespeed-cache' ); ?>
|
||||
⭐⭐⭐⭐⭐
|
||||
</button>
|
||||
</a>
|
||||
<button type="button" class="button litespeed-btn-primary litespeed-btn-mini" id="litespeed-promo-done"> <?php echo __( 'I\'ve already left a review', 'litespeed-cache' ); ?></button>
|
||||
<button type="button" class="button litespeed-btn-warning litespeed-btn-mini" id="litespeed-promo-later"> <?php echo __( 'Maybe later', 'litespeed-cache' ); ?></button>
|
||||
</div>
|
||||
<div>
|
||||
<p class="litespeed-text-small">
|
||||
<?php echo __( 'Created with ❤️ by LiteSpeed team.', 'litespeed-cache' ); ?>
|
||||
<?php echo sprintf(
|
||||
__( '<a %s>Support forum</a> | <a %s>Submit a ticket</a>', 'litespeed-cache' ),
|
||||
'href="https://wordpress.org/support/plugin/litespeed-cache" target="_blank"',
|
||||
'href="https://www.litespeedtech.com/support" target="_blank"'
|
||||
); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<?php $dismiss_url = Utility::build_url( Core::ACTION_DISMISS, GUI::TYPE_DISMISS_PROMO, false, null, array( 'promo_tag' => 'score', 'later' => 1 ) ); ?>
|
||||
<span class="screen-reader-text">Dismiss this notice.</span>
|
||||
<a href="<?php echo $dismiss_url; ?>" class="litespeed-notice-dismiss">X</a>
|
||||
</div>
|
||||
|
||||
</div>
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
?>
|
||||
<div class="litespeed-wrap notice notice-info litespeed-banner-promo-full" id="litespeed-banner-promo-slack">
|
||||
<div class="litespeed-banner-promo-logo"></div>
|
||||
|
||||
<div class="litespeed-banner-promo-content">
|
||||
<h3 class="litespeed-banner-title"><?php echo __( 'Welcome to LiteSpeed', 'litespeed-cache' ) ; ?></h3>
|
||||
<div class="litespeed-banner-description">
|
||||
<div class="litespeed-banner-description-padding-right-15">
|
||||
<p class="litespeed-banner-desciption-content">
|
||||
<?php echo __( 'Want to connect with other LiteSpeed users?', 'litespeed-cache' ) ; ?>
|
||||
<?php echo sprintf( __( 'Join the %s community.', 'litespeed-cache' ), '<a href="https://join.slack.com/t/golitespeed/shared_invite/enQtMzE5ODgxMTUyNTgzLTNiNWQ1MWZlYmI4YjEzNTM4NjdiODY2YTQ0OWVlMzBlNGZkY2E3Y2E4MjIzNmNmZmU0ZjIyNWM1ZmNmMWRlOTk" target="_blank" class="litespeed-banner-promo-slack-textlink">LiteSpeed Slack</a>' ) ; ?>
|
||||
</p>
|
||||
<p class="litespeed-banner-promo-slack-line2">
|
||||
golitespeed.slack.com
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="litespeed-banner-button-link">
|
||||
<a href="https://join.slack.com/t/golitespeed/shared_invite/enQtMzE5ODgxMTUyNTgzLTNiNWQ1MWZlYmI4YjEzNTM4NjdiODY2YTQ0OWVlMzBlNGZkY2E3Y2E4MjIzNmNmZmU0ZjIyNWM1ZmNmMWRlOTk" target="_blank">
|
||||
<?php echo __( 'Join Us on Slack', 'litespeed-cache' ) ; ?>
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<?php $dismiss_url = Utility::build_url( Core::ACTION_DISMISS, GUI::TYPE_DISMISS_PROMO, false, null, array( 'promo_tag' => 'slack' ) ) ; ?>
|
||||
<span class="screen-reader-text">Dismiss this notice.</span>
|
||||
<a href="<?php echo $dismiss_url ; ?>" class="litespeed-notice-dismiss">
|
||||
Dismiss
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
93
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/entry.tpl.php
vendored
Normal file
93
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/entry.tpl.php
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$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 rules for setting usage
|
||||
* @since 1.6.2
|
||||
*/
|
||||
global $wp_roles;
|
||||
if ( !isset( $wp_roles ) ) {
|
||||
$wp_roles = new \WP_Roles();
|
||||
}
|
||||
|
||||
$roles = array();
|
||||
foreach ( $wp_roles->roles as $k => $v ) {
|
||||
$roles[ $k ] = $v[ 'name' ];
|
||||
}
|
||||
ksort( $roles );
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="litespeed-h1">
|
||||
<?php echo __('LiteSpeed Cache Settings', 'litespeed-cache'); ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo 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 $tab => $val ) {
|
||||
$accesskey = '';
|
||||
if ( $i <= 9 ) {
|
||||
$accesskey = "litespeed-accesskey='$i'";
|
||||
}
|
||||
else {
|
||||
$tmp = strtoupper( substr( $tab, 0, 1 ) );
|
||||
if ( ! in_array( $tmp, $accesskey_set ) ) {
|
||||
$accesskey_set[] = $tmp;
|
||||
$accesskey = "litespeed-accesskey='$tmp'";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
|
||||
$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";
|
||||
|
||||
// include all tpl for faster UE
|
||||
foreach ( $menu_list as $tab => $val ) {
|
||||
echo "<div data-litespeed-layout='$tab'>";
|
||||
require LSCWP_DIR . "tpl/cache/settings-$tab.tpl.php";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
do_action( 'litespeed_settings_content', 'cache' );
|
||||
|
||||
$this->form_end();
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
54
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/entry_network.tpl.php
vendored
Normal file
54
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/entry_network.tpl.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$menuArr = 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 echo __('LiteSpeed Cache Network Cache Settings', 'litespeed-cache'); ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo Core::VER; ?>
|
||||
</span>
|
||||
<hr class="wp-header-end">
|
||||
</div>
|
||||
|
||||
<div class="litespeed-wrap">
|
||||
<h2 class="litespeed-header nav-tab-wrapper">
|
||||
<?php
|
||||
$i = 1;
|
||||
foreach ($menuArr as $tab => $val){
|
||||
$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
|
||||
echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
|
||||
$i ++;
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
<div class="litespeed-body">
|
||||
<?php $this->cache_disabled_warning(); ?>
|
||||
|
||||
<?php
|
||||
$this->form_action( Router::ACTION_SAVE_SETTINGS_NETWORK );
|
||||
|
||||
// include all tpl for faster UE
|
||||
foreach ($menuArr as $tab => $val) {
|
||||
echo "<div data-litespeed-layout='$tab'>";
|
||||
require LSCWP_DIR . "tpl/cache/network_settings-$tab.tpl.php";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
$this->form_end( true );
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
18
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/more_settings_tip.tpl.php
vendored
Normal file
18
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/more_settings_tip.tpl.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
global $pagenow;
|
||||
if ( $pagenow != 'options-general.php' ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div class="litespeed-callout notice notice-success inline">
|
||||
|
||||
<h4><?php echo __( 'NOTE', 'litespeed-cache' ); ?></h4>
|
||||
|
||||
<p>
|
||||
<?php echo sprintf( __( 'More settings available under %s menu', 'litespeed-cache' ), '<code>' . __( 'LiteSpeed Cache', 'litespeed-cache' ) . '</code>' ); ?>
|
||||
</p>
|
||||
|
||||
</div>
|
18
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/network_settings-advanced.tpl.php
vendored
Normal file
18
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/network_settings-advanced.tpl.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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>
|
||||
|
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
require LSCWP_DIR . 'tpl/cache/settings_inc.browser.tpl.php';
|
32
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/network_settings-cache.tpl.php
vendored
Normal file
32
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/network_settings-cache.tpl.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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 echo __( 'Network Enable Cache', 'litespeed-cache' ); ?></th>
|
||||
<td>
|
||||
<?php $this->build_switch( Base::O_CACHE ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('Enabling LiteSpeed Cache for WordPress here enables the cache for the network.', 'litespeed-cache'); ?><br />
|
||||
<?php echo __('It is <b>STRONGLY</b> recommend that the compatibility with other plugins on a single/few sites is tested first.', 'litespeed-cache'); ?>
|
||||
<?php echo __('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_favicon.tpl.php';
|
||||
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_resources.tpl.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>
|
||||
|
22
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/network_settings-excludes.tpl.php
vendored
Normal file
22
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/network_settings-excludes.tpl.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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>
|
||||
|
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
require LSCWP_DIR . 'tpl/cache/settings_inc.object.tpl.php';
|
18
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/network_settings-purge.tpl.php
vendored
Normal file
18
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/network_settings-purge.tpl.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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>
|
||||
|
57
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-advanced.tpl.php
vendored
Normal file
57
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-advanced.tpl.php
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'Advanced Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#advanced-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4><?php echo __( 'NOTICE:', 'litespeed-cache' ); ?></h4>
|
||||
<p><?php echo __( 'These settings are meant for ADVANCED USERS ONLY.', 'litespeed-cache' ); ?></p>
|
||||
</div>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
|
||||
<?php
|
||||
if ( ! $this->_is_multisite ) :
|
||||
require LSCWP_DIR . 'tpl/cache/settings_inc.login_cookie.tpl.php';
|
||||
endif;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_UTIL_NO_HTTPS_VARY; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( '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( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#improve-httphttps-compatibility' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_UTIL_INSTANT_CLICK; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( '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( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#instant-click' ); ?>
|
||||
<br /><font class="litespeed-danger">
|
||||
⚠️
|
||||
<?php echo __( 'This will generate extra requests to the server, which will increase server load.', 'litespeed-cache' ); ?>
|
||||
</font>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
5
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-browser.tpl.php
vendored
Normal file
5
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-browser.tpl.php
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
require LSCWP_DIR . 'tpl/cache/settings_inc.browser.tpl.php';
|
155
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-cache.tpl.php
vendored
Normal file
155
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-cache.tpl.php
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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 $id = Base::O_CACHE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php if ( $this->_is_multisite ) : ?>
|
||||
<?php $this->build_switch( $id, array( __( 'OFF', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ), __( 'Use Network Admin Setting', 'litespeed-cache' ) ) ); ?>
|
||||
<?php else : ?>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<?php endif; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf(__('Please visit the <a %s>Information</a> page on how to test the cache.', 'litespeed-cache'),
|
||||
'href="https://docs.litespeedtech.com/lscache/lscwp/installation/#testing" target="_blank"'); ?>
|
||||
|
||||
<strong><?php echo __('NOTICE', 'litespeed-cache'); ?>: </strong><?php echo __('When disabling the cache, all cached entries for this site will be purged.', 'litespeed-cache'); ?>
|
||||
|
||||
<?php if ( $this->_is_multisite ): ?>
|
||||
<br><?php echo __('The network admin setting can be overridden here.', 'litespeed-cache'); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->conf( Base::O_CACHE ) && $this->conf( Base::O_CDN_QUIC ) ): ?>
|
||||
<br><font class="litespeed-success"><?php echo __( 'With QUIC.cloud CDN enabled, you may still be seeing cache headers from your local server.', 'litespeed-cache' ); ?></font>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_PRIV; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Privately cache frontend pages for logged-in users. (LSWS %s required)', 'litespeed-cache' ), 'v5.2.1+' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_COMMENTER; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( '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 $id = Base::O_CACHE_REST; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Cache requests made by WordPress REST API calls.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_PAGE_LOGIN; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Disabling this option may negatively affect performance.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
if ( ! $this->_is_multisite ) :
|
||||
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_favicon.tpl.php';
|
||||
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_resources.tpl.php';
|
||||
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_mobile.tpl.php';
|
||||
endif;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_PRIV_URI; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'URI Paths containing these strings will NOT be cached as public.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_uri_usage_example(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_FORCE_URI; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Paths containing these strings will be cached regardless of no-cacheable settings.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_uri_usage_example(); ?>
|
||||
<br /><?php echo __( '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 echo sprintf( __( '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 $id = Base::O_CACHE_FORCE_PUB_URI; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Paths containing these strings will be forced to public cached regardless of no-cacheable settings.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_uri_usage_example(); ?>
|
||||
<br /><?php echo __( '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 echo sprintf( __( '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 ) :
|
||||
require LSCWP_DIR . 'tpl/cache/settings_inc.cache_dropquery.tpl.php';
|
||||
endif;
|
||||
?>
|
||||
|
||||
</tbody></table>
|
||||
|
142
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-esi.tpl.php
vendored
Normal file
142
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-esi.tpl.php
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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 __( 'With ESI (Edge Side Includes), pages may be served from cache for logged-in users.', 'litespeed-cache' ) ; ?></p>
|
||||
<p><?php echo __( '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/', __( 'WpW: Private Cache vs. Public Cache', 'litespeed-cache' ) ); ?>
|
||||
</p>
|
||||
<p>
|
||||
💡:
|
||||
<?php echo __( 'You can turn shortcodes into ESI blocks.', 'litespeed-cache' ) ; ?>
|
||||
<?php echo sprintf(
|
||||
__( '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', __( '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 __( 'WARNING', 'litespeed-cache' ) ; ?></h4>
|
||||
<h4><?php echo __( '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 $id = Base::O_ESI ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( '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 $id = Base::O_ESI_CACHE_ADMBAR ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __(' Cache the built-in Admin Bar ESI block.', 'litespeed-cache' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_ESI_CACHE_COMMFORM ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Cache the built-in Comment Form ESI block.', 'litespeed-cache' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_ESI_NONCE ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="litespeed-row-flex">
|
||||
<div class="">
|
||||
<?php $this->build_textarea( $id ) ; ?>
|
||||
</div>
|
||||
<div class="litespeed-width-3-10">
|
||||
<p class="litespeed-desc">
|
||||
<?php echo __( 'The list will be merged with the predefined nonces in your local data file.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( '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 /><font class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_esi_nonces</code>' ); ?>
|
||||
</font>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'The above nonces will be converted to ESI automatically.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
<br /><?php echo __( '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 echo sprintf( __( '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 $id = Base::O_CACHE_VARY_GROUP ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<table class="litespeed-vary-table wp-list-table striped litespeed-table form-table"><tbody>
|
||||
<?php foreach ( $roles as $role => $title ): ?>
|
||||
<tr>
|
||||
<td class='litespeed-vary-title'><?php echo $title ; ?></td>
|
||||
<td class='litespeed-vary-val'>
|
||||
<?php
|
||||
$this->build_input(
|
||||
$id . '[' . $role . ']',
|
||||
'litespeed-input-short',
|
||||
$this->cls( 'Vary' )->in_vary_group( $role )
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody></table>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( '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>
|
134
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-excludes.tpl.php
vendored
Normal file
134
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-excludes.tpl.php
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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 $id = Base::O_CACHE_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Paths containing these strings will not be cached.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_uri_usage_example(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_EXC_QS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Query strings containing these parameters will not be cached.', 'litespeed-cache' ); ?>
|
||||
<?php echo sprintf( __( 'For example, for %s, %s and %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 $id = Base::O_CACHE_EXC_CAT; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php
|
||||
$excludes_buf = '';
|
||||
if ( $this->conf( $id ) ) {
|
||||
$excludes_buf = implode( "\n", array_map( 'get_cat_name', $this->conf( $id ) ) );
|
||||
}
|
||||
$this->build_textarea( $id, false, $excludes_buf );
|
||||
?>
|
||||
<div class="litespeed-desc">
|
||||
<b><?php echo __( 'All categories are cached by default.', 'litespeed-cache' ); ?></b>
|
||||
<?php echo sprintf( __( 'To prevent %s from being cached, enter them here.', 'litespeed-cache' ), __( 'categories', 'litespeed-cache') ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4><?php echo __( 'NOTE', 'litespeed-cache' ); ?>:</h4>
|
||||
<ol>
|
||||
<li><?php echo __( '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 $id = Base::O_CACHE_EXC_TAG; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php
|
||||
$excludes_buf = '';
|
||||
if ( $this->conf( $id ) ) {
|
||||
$tag_names = array();
|
||||
foreach ( array_map( 'get_tag', $this->conf( $id ) ) as $tag ) {
|
||||
$tag_names[] = $tag->name;
|
||||
}
|
||||
if ( ! empty( $tag_names ) ) {
|
||||
$excludes_buf = implode( "\n", $tag_names );
|
||||
}
|
||||
}
|
||||
$this->build_textarea( $id, false, $excludes_buf );
|
||||
?>
|
||||
<div class="litespeed-desc">
|
||||
<b><?php echo __( 'All tags are cached by default.', 'litespeed-cache' ); ?></b>
|
||||
<?php echo sprintf( __( 'To prevent %s from being cached, enter them here.', 'litespeed-cache' ), __( 'tags', 'litespeed-cache') ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4><?php echo __( 'NOTE', 'litespeed-cache' ); ?>:</h4>
|
||||
<ol>
|
||||
<li><?php echo __( 'If the tag slug is not found, the tag will be removed from the list on save.', 'litespeed-cache' ); ?></li>
|
||||
<li><?php echo sprintf( __( '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 ) :
|
||||
// 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';
|
||||
|
||||
endif;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_EXC_ROLES; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Selected roles will be excluded from cache.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
<div class="litespeed-tick-list">
|
||||
<?php foreach ( $roles as $role => $title ): ?>
|
||||
<?php $this->build_checkbox( $id . '[]', $title, Control::cls()->in_cache_exc_roles( $role ), $role ); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
5
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-object.tpl.php
vendored
Normal file
5
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-object.tpl.php
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
require LSCWP_DIR . 'tpl/cache/settings_inc.object.tpl.php';
|
161
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-purge.tpl.php
vendored
Normal file
161
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-purge.tpl.php
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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 => __( 'All pages', 'litespeed-cache' ),
|
||||
Base::O_PURGE_POST_FRONTPAGE => __( 'Front page', 'litespeed-cache' ),
|
||||
Base::O_PURGE_POST_HOMEPAGE => __( 'Home page', 'litespeed-cache' ),
|
||||
Base::O_PURGE_POST_PAGES => __( 'Pages', 'litespeed-cache' ),
|
||||
|
||||
Base::O_PURGE_POST_PAGES_WITH_RECENT_POSTS => __( 'All pages with Recent Posts Widget', 'litespeed-cache' ),
|
||||
|
||||
Base::O_PURGE_POST_AUTHOR => __( 'Author archive', 'litespeed-cache' ),
|
||||
Base::O_PURGE_POST_POSTTYPE => __( 'Post type archive', 'litespeed-cache' ),
|
||||
|
||||
Base::O_PURGE_POST_YEAR => __( 'Yearly archive', 'litespeed-cache' ),
|
||||
Base::O_PURGE_POST_MONTH => __( 'Monthly archive', 'litespeed-cache' ),
|
||||
Base::O_PURGE_POST_DATE => __( 'Daily archive', 'litespeed-cache' ),
|
||||
|
||||
Base::O_PURGE_POST_TERM => __( '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 echo __( 'Auto Purge Rules For Publish/Update', 'litespeed-cache' ); ?></th>
|
||||
<td>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4><?php echo __( 'Note', 'litespeed-cache' ); ?></h4>
|
||||
<p>
|
||||
<?php echo __( 'Select "All" if there are dynamic widgets linked to posts on pages other than the front or home pages.', 'litespeed-cache' ); ?><br />
|
||||
<?php echo __( 'Other checkboxes will be ignored.', 'litespeed-cache' ); ?><br />
|
||||
<?php echo __( '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 $id => $title ) {
|
||||
|
||||
$this->build_checkbox( $id, $title );
|
||||
|
||||
if ( in_array( $id, $break_arr ) ) {
|
||||
echo '</div><div class="litespeed-tick-wrapper litespeed-top10">';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Select which pages will be automatically purged when posts are published/updated.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_PURGE_STALE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( '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 echo __( 'Note', 'litespeed-cache' ); ?></h4>
|
||||
<p>
|
||||
<?php echo __( '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 $id = Base::O_PURGE_TIMED_URLS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id, 80 ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'The URLs here (one per line) will be purged automatically at the time set in the option "%s".', 'litespeed-cache' ), __( 'Scheduled Purge Time', 'litespeed-cache' ) ); ?><br />
|
||||
<?php echo sprintf( __( '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 echo sprintf( __( '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 echo __( 'Note', 'litespeed-cache' ); ?></h4>
|
||||
<p>
|
||||
<?php echo __( '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 $id = Base::O_PURGE_TIMED_URLS_TIME; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, null, null, 'time' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Specify the time to purge the "%s" list.', 'litespeed-cache' ), __( 'Scheduled Purge URLs', 'litespeed-cache' ) ); ?>
|
||||
<?php echo sprintf( __( 'Current server time is %s.', 'litespeed-cache' ), '<code>' . date( 'H:i:s' ) . '</code>' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_PURGE_HOOK_ALL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $id, 50 ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( '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>
|
||||
|
112
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-ttl.tpl.php
vendored
Normal file
112
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings-ttl.tpl.php
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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 $id = Base::O_CACHE_TTL_PUB ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('Specify how long, in seconds, public pages are cached.', 'litespeed-cache'); ?>
|
||||
<?php $this->recommended( $id ) ; ?>
|
||||
<?php $this->_validate_ttl( $id, 30 ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_TTL_PRIV ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify how long, in seconds, private pages are cached.', 'litespeed-cache' ) ; ?>
|
||||
<?php $this->recommended( $id ) ; ?>
|
||||
<?php $this->_validate_ttl( $id, 60, 3600 ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_TTL_FRONTPAGE ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify how long, in seconds, the front page is cached.', 'litespeed-cache' ) ; ?>
|
||||
<?php $this->recommended( $id ) ; ?>
|
||||
<?php $this->_validate_ttl( $id, 30 ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_TTL_FEED ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify how long, in seconds, feeds are cached.', 'litespeed-cache' ) ; ?>
|
||||
<?php echo __( 'If this is set to a number less than 30, feeds will not be cached.', 'litespeed-cache' ) ; ?>
|
||||
<?php $this->recommended( $id ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_TTL_REST ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify how long, in seconds, REST calls are cached.', 'litespeed-cache' ) ; ?>
|
||||
<?php echo __( 'If this is set to a number less than 30, feeds will not be cached.', 'litespeed-cache' ) ; ?>
|
||||
<?php $this->recommended( $id ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_TTL_STATUS ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $id, 30 ) ; ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $id ) ; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( '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>
|
||||
|
48
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings_inc.browser.tpl.php
vendored
Normal file
48
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings_inc.browser.tpl.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'Browser Cache Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#browser-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<?php if ( LITESPEED_SERVER_TYPE === 'LITESPEED_SERVER_OLS' ) : ?>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4><?php echo __( 'NOTICE:', 'litespeed-cache' ); ?></h4>
|
||||
<p><?php echo __( 'OpenLiteSpeed users please check this', 'litespeed-cache' ); ?>:
|
||||
<?php Doc::learn_more( 'https://openlitespeed.org/kb/how-to-set-up-custom-headers/', __( 'Setting Up Custom Headers', 'litespeed-cache' ) ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_BROWSER; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( '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 echo sprintf( __( 'You can turn on browser caching in server admin too. <a %s>Learn more about LiteSpeed browser cache settings</a>.', 'litespeed-cache' ), 'href="https://docs.litespeedtech.com/lscache/lscwp/cache/#how-to-set-it-up" target="_blank"' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_TTL_BROWSER; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id ); ?> <?php $this->readable_seconds(); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'The amount of time, in seconds, that files will be stored in browser cache before expiring.', 'litespeed-cache' ); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 30 ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_DROP_QS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id, 40 ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Ignore certain query strings when caching. (LSWS %s required)', 'litespeed-cache' ), 'v5.2.3+' ); ?>
|
||||
<?php echo sprintf( __( 'For example, to drop parameters beginning with %s, %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>
|
19
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings_inc.cache_favicon.tpl.php
vendored
Normal file
19
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings_inc.cache_favicon.tpl.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_FAVICON ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'favicon.ico is requested on most pages.', 'litespeed-cache' ) ; ?>
|
||||
<?php echo __( 'Caching this resource may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache' ) ; ?>
|
||||
<br /><?php Doc::notice_htaccess() ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
77
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings_inc.cache_mobile.tpl.php
vendored
Normal file
77
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings_inc.cache_mobile.tpl.php
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
?>
|
||||
|
||||
<!-- build_setting_mobile_view start -->
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_MOBILE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php
|
||||
$this->build_switch( $id );
|
||||
?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Serve a separate cache copy for mobile visitors.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#cache-mobile', __( 'Learn more about when this is needed', 'litespeed-cache' ) ); ?>
|
||||
<br /><?php Doc::notice_htaccess(); ?>
|
||||
<br /><?php Doc::crawler_affected(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_CACHE_MOBILE_RULES; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php
|
||||
// if set, use value as input value
|
||||
if ( $this->conf( Base::O_CACHE_MOBILE ) ) {
|
||||
|
||||
// if enabled, check the setting in file
|
||||
if ( defined( 'LITESPEED_ON' ) ) {
|
||||
|
||||
try {
|
||||
$mobile_agents = Htaccess::cls()->current_mobile_agents();
|
||||
if ( $mobile_agents !== Utility::arr2regex( $this->conf( $id ), true ) ) {
|
||||
echo '<div class="litespeed-callout notice notice-error inline"><p>'
|
||||
. __( 'Htaccess did not match configuration option.', 'litespeed-cache' )
|
||||
. ' ' . sprintf( __( 'Htaccess rule is: %s', 'litespeed-cache' ), '<code>' . $mobile_agents . '</code>' )
|
||||
. '</p></div>';
|
||||
}
|
||||
} catch( \Exception $e ) {
|
||||
echo '<div class="litespeed-callout notice notice-error inline"><p>' . $e->getMessage() . '</p></div>';
|
||||
}
|
||||
|
||||
}
|
||||
} ?>
|
||||
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $id, 40 ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php Doc::one_per_line(); ?>
|
||||
|
||||
<?php $this->_validate_syntax( $id ); ?>
|
||||
|
||||
<?php if ( $this->conf( Base::O_CACHE_MOBILE ) && ! $this->conf( $id ) ) : ?>
|
||||
<font class="litespeed-warning">
|
||||
❌
|
||||
<?php echo sprintf( __( 'If %1$s is %2$s, then %3$s must be populated!', 'litespeed-cache' ), '<code>' . __('Cache Mobile', 'litespeed-cache') . '</code>', '<code>' . __('ON', 'litespeed-cache') . '</code>', '<code>' . __('List of Mobile User Agents', 'litespeed-cache') . '</code>' ); ?>
|
||||
</font>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- build_setting_mobile_view end -->
|
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<!-- build_setting_cache_resources -->
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_RES; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Some themes and plugins add resources via a PHP request.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'Caching these pages may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache' ); ?>
|
||||
<br /><?php Doc::notice_htaccess(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_EXC_COOKIES ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'To prevent %s from being cached, enter them here.', 'litespeed-cache' ), __( 'cookies', 'litespeed-cache') ) ; ?>
|
||||
<?php Doc::one_per_line() ; ?>
|
||||
<?php $this->_validate_syntax( $id ) ; ?>
|
||||
<br /><?php Doc::notice_htaccess() ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_EXC_USERAGENTS ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'To prevent %s from being cached, enter them here.', 'litespeed-cache' ), __( 'user agents', 'litespeed-cache') ) ; ?>
|
||||
<?php Doc::one_per_line() ; ?>
|
||||
<?php $this->_validate_syntax( $id ) ; ?>
|
||||
<br /><?php Doc::notice_htaccess() ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
66
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings_inc.login_cookie.tpl.php
vendored
Normal file
66
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings_inc.login_cookie.tpl.php
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CACHE_LOGIN_COOKIE ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php
|
||||
$this->build_input( $id ) ;
|
||||
|
||||
$this->_validate_syntax( $id ) ;
|
||||
|
||||
echo '<p class="litespeed-desc">' . __('SYNTAX: alphanumeric and "_".', 'litespeed-cache')
|
||||
. ' ' . __('No spaces and case sensitive.', 'litespeed-cache')
|
||||
. ' ' . __('MUST BE UNIQUE FROM OTHER WEB APPLICATIONS.', 'litespeed-cache')
|
||||
. '</p>'
|
||||
. '<p class="litespeed-desc">'
|
||||
. sprintf(__('The default login cookie is %s.', 'litespeed-cache'), '<code>_lscache_vary</code>')
|
||||
. ' ' . __('The server will determine if the user is logged in based on the existence of this cookie.', 'litespeed-cache')
|
||||
. ' ' . __('This setting is useful for those that have multiple web applications for the same domain.', 'litespeed-cache')
|
||||
. ' ' . __('If every web application uses the same cookie, the server may confuse whether a user is logged in or not.', 'litespeed-cache')
|
||||
. ' ' . __('The cookie set here will be used for this WordPress installation.', 'litespeed-cache')
|
||||
. '</p>'
|
||||
. '<p class="litespeed-desc">'
|
||||
. __('Example use case:', 'litespeed-cache')
|
||||
. '<br />'
|
||||
. sprintf(__('There is a WordPress installed for %s.', 'litespeed-cache'), '<u>www.example.com</u>')
|
||||
. '<br />'
|
||||
. sprintf(__('Then another WordPress is installed (NOT MULTISITE) at %s', 'litespeed-cache'), '<u>www.example.com/blog/</u>')
|
||||
. ' ' . __('The cache needs to distinguish who is logged into which WordPress site in order to cache correctly.', 'litespeed-cache')
|
||||
. '<br />'
|
||||
; ?>
|
||||
<?php Doc::notice_htaccess() ;
|
||||
echo '</p>' ; ?>
|
||||
<?php
|
||||
|
||||
if ( preg_match( '#[^\w\-]#', $this->conf( $id ) ) ) {
|
||||
echo '<div class="litespeed-callout notice notice-error inline"><p>❌ ' . __( 'Invalid login cookie. Invalid characters found.', 'litespeed-cache' ) . '</p></div>' ;
|
||||
}
|
||||
|
||||
if ( defined( 'LITESPEED_ON' ) && $this->conf( $id ) ) {
|
||||
$cookie_rule = '';
|
||||
try {
|
||||
$cookie_rule = Htaccess::cls()->current_login_cookie() ;
|
||||
} catch ( \Exception $e ) {
|
||||
echo '<div class="litespeed-callout notice notice-error inline"><p>' . $e->getMessage() . '</p></div>' ;
|
||||
}
|
||||
|
||||
$cookie_arr = explode( ',', $cookie_rule ) ;
|
||||
if ( ! in_array( $this->conf( $id ), $cookie_arr ) ) {
|
||||
echo '<div class="litespeed-callout notice notice-warning inline"><p>'
|
||||
. __( 'WARNING: The .htaccess login cookie and Database login cookie do not match.', 'litespeed-cache' )
|
||||
. '</p></div>'
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
218
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings_inc.object.tpl.php
vendored
Normal file
218
hamrokhaanpaan/wp-content/__plugins/litespeed-cache/tpl/cache/settings_inc.object.tpl.php
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
|
||||
$lang_enabled = '<font class="litespeed-success">' . __( 'Enabled', 'litespeed-cache' ) . '</font>' ;
|
||||
$lang_disabled = '<font class="litespeed-warning">' . __( 'Disabled', 'litespeed-cache' ) . '</font>' ;
|
||||
|
||||
$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 ( $mem_conn === null ) {
|
||||
$mem_conn_desc = '<font class="litespeed-desc">' . __( 'Not Available', 'litespeed-cache' ) . '</font>' ;
|
||||
}
|
||||
elseif ( $mem_conn ) {
|
||||
$mem_conn_desc = '<font class="litespeed-success">' . __( 'Passed', 'litespeed-cache' ) . '</font>' ;
|
||||
}
|
||||
else {
|
||||
$mem_conn_desc = '<font class="litespeed-warning">' . __( 'Failed', 'litespeed-cache' ) . '</font>' ;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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>
|
||||
<?php $id = Base::O_OBJECT ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( '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 echo __( 'Status', 'litespeed-cache' ) ; ?></h4>
|
||||
</div>
|
||||
<div class='litespeed-col-auto'>
|
||||
<?php echo sprintf( __( '%s Extension', 'litespeed-cache' ), 'Memcached' ) ; ?>: <?php echo $mem_enabled ; ?><br />
|
||||
<?php echo sprintf( __( '%s Extension', 'litespeed-cache' ), 'Redis' ) ; ?>: <?php echo $redis_enabled ; ?><br />
|
||||
<?php echo __( 'Connection Test', 'litespeed-cache' ) ; ?>: <?php echo $mem_conn_desc ; ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/admin/#how-to-debug' ); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_KIND ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id, array( 'Memcached', 'Redis' ) ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_HOST; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Your %s Hostname or IP address.', 'litespeed-cache' ), 'Memcached/<a href="https://docs.litespeedtech.com/products/lsmcd/" target="_blank">LSMCD</a>/Redis' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_PORT; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short2' ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Default port for %1$s is %2$s.', 'litespeed-cache' ), 'Memcached', '<code>11211</code>' ) ; ?>
|
||||
<?php echo sprintf( __( 'Default port for %1$s is %2$s.', 'litespeed-cache' ), 'Redis', '<code>6379</code>' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_LIFE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short2' ) ; ?> <?php echo __( 'seconds', 'litespeed-cache' ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Default TTL for cached objects.', 'litespeed-cache' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_USER; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Only available when %s is installed.', 'litespeed-cache' ), 'SASL' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_PSWD; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify the password used when connecting.', 'litespeed-cache' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_DB_ID; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Database to be used', 'litespeed-cache' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_GLOBAL_GROUPS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id, 30 ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Groups cached at the network level.', 'litespeed-cache' ) ; ?>
|
||||
<?php Doc::one_per_line() ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_NON_PERSISTENT_GROUPS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id, 30 ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php Doc::one_per_line() ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_PERSISTENT; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Use keep-alive connections to speed up cache operations.', 'litespeed-cache' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_ADMIN; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Improve wp-admin speed through caching. (May encounter expired data)', 'litespeed-cache' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OBJECT_TRANSIENTS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Save transients in database when %1$s is %2$s.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_OBJECT_ADMIN ) . '</code>', '<code>' . __( 'OFF', 'litespeed-cache' ) . '</code>' ) ; ?>
|
||||
<br />
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#store-transients' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody></table>
|
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
?>
|
||||
|
||||
<!-- build_setting_purge_on_upgrade -->
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_PURGE_ON_UPGRADE ; ?>
|
||||
<?php $this->title( $id ) ; ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ) ; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'When enabled, the cache will automatically purge when any plugin, theme or the WordPress core is upgraded.', 'litespeed-cache' ) ; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$menu_list = array(
|
||||
'settings' => __( 'CDN Settings', 'litespeed-cache' ),
|
||||
'manage' => __( 'Manage', 'litespeed-cache' ),
|
||||
) ;
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="litespeed-h1">
|
||||
<?php echo __( 'LiteSpeed Cache CDN', 'litespeed-cache' ) ; ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo Core::VER ; ?>
|
||||
</span>
|
||||
<hr class="wp-header-end">
|
||||
</div>
|
||||
|
||||
<div class="litespeed-wrap">
|
||||
<h2 class="litespeed-header nav-tab-wrapper">
|
||||
<?php
|
||||
$i = 1 ;
|
||||
foreach ($menu_list as $tab => $val){
|
||||
$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '' ;
|
||||
echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>" ;
|
||||
$i ++ ;
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<div class="litespeed-body">
|
||||
<?php
|
||||
|
||||
// include all tpl for faster UE
|
||||
foreach ($menu_list as $tab => $val) {
|
||||
echo "<div data-litespeed-layout='$tab'>" ;
|
||||
require LSCWP_DIR . "tpl/cdn/$tab.tpl.php" ;
|
||||
echo "</div>" ;
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$cf_on = $this->conf( Base::O_CDN_CLOUDFLARE ) ;
|
||||
$cf_domain = $this->conf( Base::O_CDN_CLOUDFLARE_NAME ) ?: '-' ;
|
||||
$cf_zone = $this->conf( Base::O_CDN_CLOUDFLARE_ZONE ) ?: '-' ;
|
||||
|
||||
$curr_status = CDN\Cloudflare::get_option( CDN\Cloudflare::ITEM_STATUS, array() ) ;
|
||||
|
||||
?>
|
||||
<h3 class="litespeed-title"><?php echo __('QUIC.cloud', 'litespeed-cache'); ?></h3>
|
||||
|
||||
<p><?php echo __('To manage QUIC.cloud options, please visit', 'litespeed-cache'); ?>: <a href="<?php echo Cloud::CLOUD_SERVER_DASH; ?>" target="_blank"><?php echo Cloud::CLOUD_SERVER_DASH; ?></a></p>
|
||||
|
||||
|
||||
<h3 class="litespeed-title"><?php echo __('Cloudflare', 'litespeed-cache'); ?></h3>
|
||||
|
||||
<?php if ( ! $cf_on ) : ?>
|
||||
<div class="litespeed-callout notice notice-error inline">
|
||||
<h4><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?></h4>
|
||||
<p>
|
||||
<?php echo __('To enable the following functionality, turn ON Cloudflare API in CDN Settings.', 'litespeed-cache'); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif ; ?>
|
||||
|
||||
<p><?php echo __('Cloudflare Domain', 'litespeed-cache'); ?>: <code><?php echo $cf_domain ; ?></code></p>
|
||||
<p><?php echo __('Cloudflare Zone', 'litespeed-cache'); ?>: <code><?php echo $cf_zone ; ?></code></p>
|
||||
|
||||
<p>
|
||||
<b><?php echo __( 'Development Mode', 'litespeed-cache' ) ; ?>:</b>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_SET_DEVMODE_ON ) ; ?>" class="button litespeed-btn-warning">
|
||||
<?php echo __( 'Turn ON', 'litespeed-cache' ) ; ?>
|
||||
</a>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_SET_DEVMODE_OFF ) ; ?>" class="button litespeed-btn-warning">
|
||||
<?php echo __( 'Turn OFF', 'litespeed-cache' ) ; ?>
|
||||
</a>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_GET_DEVMODE ) ; ?>" class="button litespeed-btn-success">
|
||||
<?php echo __( 'Check Status', 'litespeed-cache' ) ; ?>
|
||||
</a>
|
||||
|
||||
<?php if ( $curr_status ) : ?>
|
||||
<span class="litespeed-desc">
|
||||
<?php
|
||||
if ( time() >= $curr_status[ 'devmode_expired' ] ) {
|
||||
$expired_at = date( 'm/d/Y H:i:s', $curr_status[ 'devmode_expired' ] + LITESPEED_TIME_OFFSET ) ;
|
||||
$curr_status[ 'devmode' ] = 'OFF' ;
|
||||
echo sprintf( __( 'Current status is %1$s since %2$s.', 'litespeed-cache' ), '<code>' . strtoupper( $curr_status[ 'devmode' ] ) . '</code>', '<code>' . $expired_at . '</code>' ) ;
|
||||
}
|
||||
else {
|
||||
$expired_at = $curr_status[ 'devmode_expired' ] - time() ;
|
||||
$expired_at = Utility::readable_time( $expired_at, 3600 * 3, true );
|
||||
?>
|
||||
<?php echo sprintf( __( 'Current status is %s.', 'litespeed-cache' ), '<code>' . strtoupper( $curr_status[ 'devmode' ] ) . '</code>' ) ; ?>
|
||||
<?php echo sprintf( __( 'Development mode will be automatically turned off in %s.', 'litespeed-cache' ), '<code>' . $expired_at . '</code>' ) ; ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<?php endif ; ?>
|
||||
|
||||
<p class="litespeed-desc">
|
||||
<?php echo __( 'Temporarily bypass Cloudflare cache. This allows changes to the origin server to be seen in realtime.', 'litespeed-cache' ) ; ?>
|
||||
<?php echo __( 'Development Mode will be turned off automatically after three hours.', 'litespeed-cache' ) ; ?>
|
||||
<a href="https://support.cloudflare.com/hc/en-us/articles/200168246" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b><?php echo __( 'Cloudflare Cache', 'litespeed-cache' ) ; ?>:</b>
|
||||
<?php if ( ! $cf_on ) : ?>
|
||||
<a href="#" class="button button-secondary disabled">
|
||||
<?php else : ?>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_PURGE_ALL ) ; ?>" class="button litespeed-btn-danger">
|
||||
<?php endif ; ?>
|
||||
<?php echo __( 'Purge Everything', 'litespeed-cache' ) ; ?>
|
||||
</a>
|
||||
</p>
|
@@ -0,0 +1,239 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$home_url = home_url( '/' );
|
||||
$parsed = parse_url( $home_url );
|
||||
$home_url = str_replace( $parsed[ 'scheme' ] . ':', '', $home_url );
|
||||
$cdn_url = 'https://cdn.' . substr( $home_url, 2 );
|
||||
|
||||
$cdn_mapping = $this->conf( Base::O_CDN_MAPPING );
|
||||
// Special handler: Append one row if somehow the DB default preset value got deleted
|
||||
if ( ! $cdn_mapping ) {
|
||||
$this->load_default_vals();
|
||||
$cdn_mapping = self::$_default_options[ Base::O_CDN_MAPPING ];
|
||||
}
|
||||
|
||||
$this->form_action();
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'CDN Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cdn/' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CDN_QUIC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Enable %s CDN API functionality.', 'litespeed-cache' ), 'QUIC.cloud' ); ?>
|
||||
<?php Doc::learn_more( 'https://quic.cloud/docs/cdn/getting-started/verify-quic-cloud-cdn-is-working/#check-lscache-wordpress-plugin' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CDN; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Turn this setting %1$s if you are using a traditional Content Delivery Network (CDN) or a subdomain for static content with QUIC.cloud CDN.', 'litespeed-cache' ), '<code>' . __( 'ON', 'litespeed-cache' ) . '</code>' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cdn/#use-cdn-mapping' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'NOTE: QUIC.cloud CDN and Cloudflare do not use CDN Mapping. If you are are only using QUIC.cloud or Cloudflare, leave this setting %1$s.', 'litespeed-cache' ), '<code>' . __( 'OFF', 'litespeed-cache' ) . '</code>' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left"></th>
|
||||
<td>
|
||||
<?php $this->enroll( Base::O_CDN_MAPPING . '[' . Base::CDN_MAPPING_URL . '][]' ); ?>
|
||||
<?php $this->enroll( Base::O_CDN_MAPPING . '[' . Base::CDN_MAPPING_INC_IMG . '][]' ); ?>
|
||||
<?php $this->enroll( Base::O_CDN_MAPPING . '[' . Base::CDN_MAPPING_INC_CSS . '][]' ); ?>
|
||||
<?php $this->enroll( Base::O_CDN_MAPPING . '[' . Base::CDN_MAPPING_INC_JS . '][]' ); ?>
|
||||
<?php $this->enroll( Base::O_CDN_MAPPING . '[' . Base::CDN_MAPPING_FILETYPE . '][]' ); ?>
|
||||
|
||||
<div id="litespeed_cdn_mapping_div"></div>
|
||||
|
||||
<script type="text/babel">
|
||||
ReactDOM.render(
|
||||
<CDNMapping list={ <?php echo json_encode( $cdn_mapping ); ?> } />,
|
||||
document.getElementById( 'litespeed_cdn_mapping_div' )
|
||||
);
|
||||
</script>
|
||||
|
||||
<div class="litespeed-warning">
|
||||
<?php echo __( 'NOTE', 'litespeed-cache' ); ?>:
|
||||
<?php echo __( 'To randomize CDN hostname, define multiple hostnames for the same resources.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<b><?php $this->title( Base::CDN_MAPPING_INC_IMG ); ?></b>:
|
||||
<?php echo sprintf( __( 'Serve all image files through the CDN. This will affect all attachments, HTML %s tags, and CSS %s attributes.', 'litespeed-cache' ), '<code><img</code>', '<code>url()</code>' ); ?>
|
||||
|
||||
<br />
|
||||
<b><?php $this->title( Base::CDN_MAPPING_INC_CSS ); ?></b>:
|
||||
<?php echo __( 'Serve all CSS files through the CDN. This will affect all enqueued WP CSS files.', 'litespeed-cache' ); ?>
|
||||
|
||||
<br />
|
||||
<b><?php $this->title( Base::CDN_MAPPING_INC_JS ); ?></b>:
|
||||
<?php echo __( 'Serve all JavaScript files through the CDN. This will affect all enqueued WP JavaScript files.', 'litespeed-cache' ); ?>
|
||||
|
||||
<br />
|
||||
<b><?php $this->title( Base::CDN_MAPPING_FILETYPE ); ?></b>:
|
||||
<?php echo __( 'Static file type links to be replaced by CDN links.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
<?php echo sprintf( __( 'This will affect all tags containing attributes: %s %s %s.', 'litespeed-cache' ), '<code>src=""</code>', '<code>data-src=""</code>', '<code>href=""</code>' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cdn/#include-file-types', __( 'Default value', 'litespeed-cache' ) ); ?>
|
||||
|
||||
<br />
|
||||
<?php echo sprintf( __( 'If you turn any of the above settings OFF, please remove the related file types from the %s box.', 'litespeed-cache' ), '<b>' . __( 'Include File Types', 'litespeed-cache' ) . '</b>' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cdn/#include-file-types' ); ?>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CDN_ATTR; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $id, 40 ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify which HTML element attributes will be replaced with CDN Mapping.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'Only attributes listed here will be replaced.', 'litespeed-cache' ); ?>
|
||||
<br /><?php echo sprintf( __( 'Use the format %1$s or %2$s (element is optional).', 'litespeed-cache' ), '<code>element.attribute</code>', '<code>.attribute</code>' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_CDN_ORI; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Site URL to be served through the CDN. Beginning with %1$s. For example, %2$s.', 'litespeed-cache' ), '<code>//</code>', '<code>' . $home_url . '</code>' ); ?>
|
||||
<br /><?php echo sprintf( __( '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>//www.aa.com</code>', '<code>//aa.com</code>', '<code>//*aa.com</code>' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_CDN_ORI_DIR; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $id, 40 ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Only files within these directories will be pointed to the CDN.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_CDN_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Paths containing these strings will not be served from the CDN.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CDN_CLOUDFLARE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Use %s API functionality.', 'litespeed-cache' ), 'Cloudflare' ); ?>
|
||||
<?php echo sprintf( __( 'This can be managed from %1$s%2$s tab.', 'litespeed-cache' ), '<b>' . __( 'CDN', 'litespeed-cache' ) . '</b> -> <b>', __( 'Manage', 'litespeed-cache' ) .'</b>' ); ?>
|
||||
</div>
|
||||
<div class="litespeed-block">
|
||||
<div class='litespeed-col'>
|
||||
<label class="litespeed-form-label"><?php echo __( 'Global API Key / API Token', 'litespeed-cache' ); ?></label>
|
||||
|
||||
<?php $this->build_input( Base::O_CDN_CLOUDFLARE_KEY ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Your API key / token is used to access %s APIs.', 'litespeed-cache' ), 'Cloudflare' ); ?>
|
||||
<?php echo sprintf( __( 'Get it from <a %1$s>%2$s</a>.', 'litespeed-cache' ), 'href="https://dash.cloudflare.com/profile/api-tokens" target="_blank"', 'Cloudflare' ); ?>
|
||||
<?php echo sprintf( __( 'Recommended to generate the token from Cloudflare API token template "WordPress".', 'litespeed-cache' ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='litespeed-col'>
|
||||
<label class="litespeed-form-label"><?php echo __( 'Email Address', 'litespeed-cache' ); ?></label>
|
||||
|
||||
<?php $this->build_input( Base::O_CDN_CLOUDFLARE_EMAIL ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Your Email address on %s.', 'litespeed-cache' ), 'Cloudflare' ); ?>
|
||||
<?php echo sprintf( __( 'Optional when API token used.', 'litespeed-cache' ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='litespeed-col'>
|
||||
<label class="litespeed-form-label"><?php echo __( 'Domain', 'litespeed-cache' ); ?></label>
|
||||
|
||||
<?php
|
||||
$cf_zone = $this->conf( Base::O_CDN_CLOUDFLARE_ZONE );
|
||||
$cls = $cf_zone ? ' litespeed-input-success' : ' litespeed-input-warning';
|
||||
$this->build_input( Base::O_CDN_CLOUDFLARE_NAME, $cls );
|
||||
?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'You can just type part of the domain.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'Once saved, it will be matched with the current list and completed automatically.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
$this->form_end();
|
||||
|
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$crawler_summary = Crawler::get_summary();
|
||||
|
||||
$__map = Crawler_Map::cls();
|
||||
|
||||
$list = $__map->list_blacklist( 30 );
|
||||
$count = $__map->count_blacklist();
|
||||
$pagination = Utility::pagination( $count, 30 );
|
||||
|
||||
?>
|
||||
<p class="litespeed-right">
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CRAWLER, Crawler::TYPE_BLACKLIST_EMPTY ); ?>" class="button litespeed-btn-warning" data-litespeed-cfm="<?php echo __( 'Are you sure to delete all existing blocklist items?', 'litespeed-cache' ) ; ?>" >
|
||||
<?php echo __( 'Empty blocklist', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Blocklist', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/crawler/#blacklist-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<?php echo __( 'Total', 'litespeed-cache' ) . ': ' . $count; ?>
|
||||
|
||||
<?php echo $pagination; ?>
|
||||
<table class="wp-list-table widefat striped">
|
||||
<thead><tr >
|
||||
<th scope="col">#</th>
|
||||
<th scope="col"><?php echo __( 'URL', 'litespeed-cache' ); ?></th>
|
||||
<th scope="col"><?php echo __( 'Status', 'litespeed-cache' ); ?></th>
|
||||
<th scope="col"><?php echo __( 'Operation', 'litespeed-cache' ); ?></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ( $list as $i => $v ) : ?>
|
||||
<tr>
|
||||
<td><?php echo $i + 1; ?></td>
|
||||
<td>
|
||||
<?php echo $v[ 'url' ]; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo Crawler::cls()->display_status( $v[ 'res' ], $v[ 'reason' ] ); ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CRAWLER, Crawler::TYPE_BLACKLIST_DEL, false, null, array( 'id' => $v[ 'id' ] ) ); ?>" class="button button-secondary"><?php echo __( 'Remove from Blocklist', 'litespeed-cache' ); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php echo $pagination; ?>
|
||||
|
||||
<p>
|
||||
<i class="litespeed-dot litespeed-bg-default"></i> = <?php echo __( 'Not blocklisted', 'litespeed-cache' ); ?><br>
|
||||
<i class="litespeed-dot litespeed-bg-warning"></i> = <?php echo __( 'Blocklisted due to not cacheable', 'litespeed-cache' ); ?><br>
|
||||
<i class="litespeed-dot litespeed-bg-danger"></i> = <?php echo __( 'Blocklisted', 'litespeed-cache' ); ?><br>
|
||||
</p>
|
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$menu_list = array(
|
||||
'summary' => __( 'Summary', 'litespeed-cache' ),
|
||||
'map' => __( 'Map', 'litespeed-cache' ),
|
||||
'blacklist' => __( 'Blocklist', 'litespeed-cache' ),
|
||||
'settings-general' => __( 'General Settings', 'litespeed-cache' ),
|
||||
'settings-simulation' => __( 'Simulation Settings', 'litespeed-cache' ),
|
||||
'settings-sitemap' => __( 'Sitemap Settings', 'litespeed-cache' ),
|
||||
) ;
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="litespeed-h1">
|
||||
<?php echo __( 'LiteSpeed Cache Crawler', 'litespeed-cache' ) ; ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo Core::VER ; ?>
|
||||
</span>
|
||||
<hr class="wp-header-end">
|
||||
</div>
|
||||
|
||||
<div class="litespeed-wrap">
|
||||
<h2 class="litespeed-header nav-tab-wrapper">
|
||||
<?php
|
||||
$i = 1 ;
|
||||
foreach ($menu_list as $tab => $val){
|
||||
$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '' ;
|
||||
echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>" ;
|
||||
$i ++ ;
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<div class="litespeed-body">
|
||||
<?php
|
||||
|
||||
// include all tpl for faster UE
|
||||
foreach ($menu_list as $tab => $val) {
|
||||
echo "<div data-litespeed-layout='$tab'>" ;
|
||||
require LSCWP_DIR . "tpl/crawler/$tab.tpl.php" ;
|
||||
echo "</div>" ;
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<iframe name="litespeedHiddenIframe" src="" width="0" height="0" frameborder="0"></iframe>
|
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$crawler_summary = Crawler::get_summary();
|
||||
|
||||
$__map = Crawler_Map::cls();
|
||||
|
||||
$list = $__map->list_map( 30 );
|
||||
$count = $__map->count_map();
|
||||
$pagination = Utility::pagination( $count, 30 );
|
||||
|
||||
?>
|
||||
<p class="litespeed-right">
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CRAWLER, Crawler::TYPE_EMPTY ); ?>" class="button litespeed-btn-warning">
|
||||
<?php echo __( 'Clean Crawler Map', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CRAWLER, Crawler::TYPE_REFRESH_MAP ); ?>" class="button button-secondary">
|
||||
<?php echo __( 'Refresh Crawler Map', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
if ( ! empty( $crawler_summary[ 'sitemap_time' ] ) ) {
|
||||
echo sprintf( __( 'Generated at %s', 'litespeed-cache' ), Utility::readable_time( $crawler_summary[ 'sitemap_time' ] ) );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Sitemap List', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/crawler/#map-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<?php echo __( 'Sitemap Total', 'litespeed-cache' ) . ': ' . $count; ?>
|
||||
|
||||
<?php echo $pagination; ?>
|
||||
<table class="wp-list-table widefat striped">
|
||||
<thead><tr >
|
||||
<th scope="col">#</th>
|
||||
<th scope="col"><?php echo __( 'URL', 'litespeed-cache' ); ?></th>
|
||||
<th scope="col"><?php echo __( 'Crawler Status', 'litespeed-cache' ); ?></th>
|
||||
<th scope="col"><?php echo __( 'Operation', 'litespeed-cache' ); ?></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ( $list as $i => $v ) : ?>
|
||||
<tr>
|
||||
<td><?php echo $i + 1; ?></td>
|
||||
<td>
|
||||
<?php echo $v[ 'url' ]; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo Crawler::cls()->display_status( $v[ 'res' ], $v[ 'reason' ] ); ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CRAWLER, Crawler::TYPE_BLACKLIST_ADD, false, null, array( 'id' => $v[ 'id' ] ) ); ?>" class="button button-secondary"><?php echo __( 'Add to Blocklist', 'litespeed-cache' ); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php echo $pagination; ?>
|
||||
|
||||
<p>
|
||||
<i class="litespeed-dot litespeed-bg-success"></i> = <?php echo __( 'Cache Hit', 'litespeed-cache' ); ?><br>
|
||||
<i class="litespeed-dot litespeed-bg-primary"></i> = <?php echo __( 'Cache Miss', 'litespeed-cache' ); ?><br>
|
||||
<i class="litespeed-dot litespeed-bg-warning"></i> = <?php echo __( 'Blocklisted due to not cacheable', 'litespeed-cache' ); ?><br>
|
||||
<i class="litespeed-dot litespeed-bg-danger"></i> = <?php echo __( 'Blocklisted', 'litespeed-cache' ); ?><br>
|
||||
</p>
|
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$this->form_action();
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __('Crawler General Settings', 'litespeed-cache'); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/crawler/#general-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'This will enable crawler cron.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_USLEEP; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input($id); ?> <?php echo __('microseconds', 'litespeed-cache'); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('Specify time in microseconds for the delay between requests during a crawl.', 'litespeed-cache'); ?>
|
||||
|
||||
<?php if ( ! empty( $_SERVER[ Base::ENV_CRAWLER_USLEEP ] ) ) : ?>
|
||||
<font class="litespeed-warning">
|
||||
<?php echo __('NOTE', 'litespeed-cache'); ?>:
|
||||
<?php echo __( 'Server allowed min value', 'litespeed-cache'); ?>: <code><?php echo $_SERVER[ Base::ENV_CRAWLER_USLEEP ]; ?></code>
|
||||
</font>
|
||||
<?php else : ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $this->_validate_ttl( $id, false, 30000 ); ?>
|
||||
|
||||
<br />
|
||||
<?php $this->_api_env_var( Base::ENV_CRAWLER_USLEEP ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_RUN_DURATION; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input($id); ?> <?php echo __('seconds', 'litespeed-cache'); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('Specify time in seconds for the duration of the crawl interval.', 'litespeed-cache'); ?>
|
||||
<?php $this->recommended($id); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_RUN_INTERVAL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input($id); ?> <?php echo __('seconds', 'litespeed-cache'); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('Specify time in seconds for the time between each run interval.', 'litespeed-cache'); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 60 ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_CRAWL_INTERVAL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input($id); ?> <?php echo __('seconds', 'litespeed-cache'); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('Specify how long in seconds before the crawler should initiate crawling the entire sitemap again.', 'litespeed-cache'); ?>
|
||||
<?php $this->recommended($id); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_THREADS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('Specify Number of Threads to use while crawling.', 'litespeed-cache'); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 1, 16 ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_TIMEOUT; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify the timeout while crawling each URL.', 'litespeed-cache' ); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 10, 300 ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_LOAD_LIMIT; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input($id); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'The maximum average server load allowed while crawling. The number of crawler threads in use will be actively reduced until average server load falls under this limit. If this cannot be achieved with a single thread, the current crawler run will be terminated.', 'litespeed-cache' );
|
||||
?>
|
||||
|
||||
<?php if ( ! empty( $_SERVER[ Base::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ) ) : ?>
|
||||
<font class="litespeed-warning">
|
||||
<?php echo __('NOTE', 'litespeed-cache'); ?>:
|
||||
<?php echo __( 'Server enforced value', 'litespeed-cache'); ?>: <code><?php echo $_SERVER[ Base::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ]; ?></code>
|
||||
</font>
|
||||
<?php elseif ( ! empty( $_SERVER[ Base::ENV_CRAWLER_LOAD_LIMIT ] ) ) : ?>
|
||||
<font class="litespeed-warning">
|
||||
<?php echo __('NOTE', 'litespeed-cache'); ?>:
|
||||
<?php echo __( 'Server allowed max value', 'litespeed-cache'); ?>: <code><?php echo $_SERVER[ Base::ENV_CRAWLER_LOAD_LIMIT ]; ?></code>
|
||||
</font>
|
||||
<?php else : ?>
|
||||
<?php $this->recommended($id); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<br />
|
||||
<?php $this->_api_env_var( Base::ENV_CRAWLER_LOAD_LIMIT, Base::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
$this->form_end();
|
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$this->form_action();
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __('Crawler Simulation Settings', 'litespeed-cache'); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/crawler/#simulation-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_ROLES; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id, 20 ); ?>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('To crawl the site as a logged-in user, enter the user ids to be simulated.', 'litespeed-cache'); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_COOKIES; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->enroll( $id . '[name][]' ); ?>
|
||||
<?php $this->enroll( $id . '[vals][]' ); ?>
|
||||
|
||||
<div id="litespeed_crawler_simulation_div"></div>
|
||||
|
||||
<script type="text/babel">
|
||||
ReactDOM.render(
|
||||
<CrawlerSimulate list={ <?php echo json_encode( $this->conf( $id ) ); ?> } />,
|
||||
document.getElementById( 'litespeed_crawler_simulation_div' )
|
||||
);
|
||||
</script>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('To crawl for a particular cookie, enter the cookie name, and the values you wish to crawl for. Values should be one per line. There will be one crawler created per cookie value, per simulated role.', 'litespeed-cache'); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/crawler/#cookie-simulation' ); ?>
|
||||
<p><?php echo sprintf( __( 'Use %1$s in %2$s to indicate this cookie has not been set.', 'litespeed-cache' ), '<code>_null</code>', __( 'Cookie Values', 'litespeed-cache' ) ); ?></p>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
$this->form_end();
|
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$this->form_action();
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __('Crawler Sitemap Settings', 'litespeed-cache'); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/crawler/#sitemap-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_SITEMAP; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-long' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('The crawler will use your XML sitemap or sitemap index. Enter the full URL to your sitemap here.', 'litespeed-cache'); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_DROP_DOMAIN; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'The crawler will parse the sitemap and save into the database before crawling. When parsing the sitemap, dropping the domain can save DB storage.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'If you are using multiple domains for one site, and have multiple domains in the sitemap, please keep this option OFF so the crawler knows to crawl every domain.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_CRAWLER_MAP_TIMEOUT; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify the timeout while parsing the sitemap.', 'litespeed-cache' ); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 15, 1800 ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
$this->form_end();
|
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$__crawler = Crawler::cls();
|
||||
$crawler_list = $__crawler->list_crawlers();
|
||||
|
||||
$summary = Crawler::get_summary();
|
||||
if ( $summary[ 'curr_crawler' ] >= count( $crawler_list ) ) {
|
||||
$summary[ 'curr_crawler' ] = 0;
|
||||
}
|
||||
|
||||
$is_running = time() - $summary[ 'is_running' ] <= $this->conf( Base::O_CRAWLER_RUN_DURATION );
|
||||
|
||||
$disabled = Router::can_crawl() ? '' : 'disabled';
|
||||
|
||||
$seconds = $this->conf( Base::O_CRAWLER_RUN_INTERVAL );
|
||||
if($seconds > 0):
|
||||
$recurrence = '';
|
||||
$hours = (int)floor($seconds / 3600);
|
||||
if ( $hours ) {
|
||||
if ( $hours > 1) {
|
||||
$recurrence .= sprintf(__('%d hours', 'litespeed-cache'), $hours);
|
||||
}
|
||||
else {
|
||||
$recurrence .= sprintf(__('%d hour', 'litespeed-cache'), $hours);
|
||||
}
|
||||
}
|
||||
$minutes = (int)floor( ($seconds % 3600 ) / 60 );
|
||||
if ( $minutes ) {
|
||||
$recurrence .= ' ';
|
||||
if ( $minutes > 1) {
|
||||
$recurrence .= sprintf(__('%d minutes', 'litespeed-cache'), $minutes);
|
||||
}
|
||||
else {
|
||||
$recurrence .= sprintf(__('%d minute', 'litespeed-cache'), $minutes);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title litespeed-relative">
|
||||
<?php echo __('Crawler Cron', 'litespeed-cache'); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/crawler/' ); ?>
|
||||
</h3>
|
||||
|
||||
<?php if ( ! Router::can_crawl() ): ?>
|
||||
<div class="litespeed-callout notice notice-error inline">
|
||||
<h4><?php echo __('WARNING', 'litespeed-cache'); ?></h4>
|
||||
<p><?php echo __('The crawler feature is not enabled on the LiteSpeed server. Please consult your server admin or hosting provider.', 'litespeed-cache'); ?></p>
|
||||
<p><?php echo sprintf(__('See <a %s>Introduction for Enabling the Crawler</a> for detailed information.', 'litespeed-cache'), 'href="https://docs.litespeedtech.com/lscache/lscwp/admin/#enabling-and-limiting-the-crawler" target="_blank"'); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if ( $summary[ 'this_full_beginning_time' ] ) : ?>
|
||||
<p>
|
||||
<b><?php echo __( 'Current sitemap crawl started at', 'litespeed-cache' ); ?>:</b>
|
||||
<?php echo Utility::readable_time( $summary[ 'this_full_beginning_time' ] ); ?>
|
||||
</p>
|
||||
|
||||
<?php if ( ! $is_running ) : ?>
|
||||
<p>
|
||||
<b><?php echo __( 'The next complete sitemap crawl will start at', 'litespeed-cache' ); ?>:</b>
|
||||
<?php echo date('m/d/Y H:i:s',$summary[ 'this_full_beginning_time' ] + LITESPEED_TIME_OFFSET + $summary[ 'last_full_time_cost' ] + $this->conf( Base::O_CRAWLER_CRAWL_INTERVAL )); ?>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php if ( $summary[ 'last_full_time_cost' ] ) : ?>
|
||||
<p>
|
||||
<b><?php echo __( 'Last complete run time for all crawlers', 'litespeed-cache' ); ?>:</b>
|
||||
<?php echo sprintf( __( '%d seconds', 'litespeed-cache' ), $summary[ 'last_full_time_cost' ] ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $summary[ 'last_crawler_total_cost' ] ) : ?>
|
||||
<p>
|
||||
<b><?php echo __('Run time for previous crawler', 'litespeed-cache'); ?>:</b>
|
||||
<?php echo sprintf( __( '%d seconds', 'litespeed-cache' ), $summary[ 'last_crawler_total_cost' ] ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $summary[ 'curr_crawler_beginning_time' ] ) : ?>
|
||||
<p>
|
||||
<b><?php echo __('Current crawler started at', 'litespeed-cache'); ?>:</b>
|
||||
<?php echo Utility::readable_time( $summary[ 'curr_crawler_beginning_time' ] ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $summary[ 'last_start_time' ] ) : ?>
|
||||
<p class='litespeed-desc'>
|
||||
<b><?php echo __('Last interval', 'litespeed-cache'); ?>:</b>
|
||||
<?php echo Utility::readable_time( $summary[ 'last_start_time' ] ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $summary[ 'end_reason' ] ) : ?>
|
||||
<p class='litespeed-desc'>
|
||||
<b><?php echo __( 'Ended reason', 'litespeed-cache' ); ?>:</b>
|
||||
<?php echo esc_html( $summary[ 'end_reason' ] ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $summary[ 'last_crawled' ] ) : ?>
|
||||
<p class='litespeed-desc'>
|
||||
<?php echo sprintf(__('<b>Last crawled:</b> %s item(s)', 'litespeed-cache'), $summary[ 'last_crawled' ] ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<p>
|
||||
<?php echo " <a href='" . Utility::build_url( Router::ACTION_CRAWLER, Crawler::TYPE_RESET ) . "' class='button litespeed-btn-warning'>" . __('Reset position', 'litespeed-cache') . "</a>";
|
||||
|
||||
$href = Router::can_crawl() ? Utility::build_url( Router::ACTION_CRAWLER, Crawler::TYPE_START ) : 'javascript:;';
|
||||
echo " <a href='$href' id='litespeed_manual_trigger' class='button litespeed-btn-success' litespeed-accesskey='R' $disabled>" . __('Manually run', 'litespeed-cache') . "</a>";
|
||||
?>
|
||||
</p>
|
||||
|
||||
|
||||
<table class="wp-list-table widefat striped">
|
||||
<thead><tr >
|
||||
<th scope="col">#</th>
|
||||
<th scope="col"><?php echo __('Cron Name', 'litespeed-cache'); ?></th>
|
||||
<th scope="col"><?php echo __('Run Frequency', 'litespeed-cache'); ?></th>
|
||||
<th scope="col"><?php echo __( 'Status', 'litespeed-cache' ); ?></th>
|
||||
<th scope="col"><?php echo __( 'Activate', 'litespeed-cache' ); ?></th>
|
||||
<th scope="col"><?php echo __( 'Running', 'litespeed-cache' ); ?></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ( $crawler_list as $i => $v ) :
|
||||
$hit = ! empty( $summary[ 'crawler_stats' ][ $i ][ 'H' ] ) ? $summary[ 'crawler_stats' ][ $i ][ 'H' ] : 0;
|
||||
$miss = ! empty( $summary[ 'crawler_stats' ][ $i ][ 'M' ] ) ? $summary[ 'crawler_stats' ][ $i ][ 'M' ] : 0;
|
||||
|
||||
$blacklisted = ! empty( $summary[ 'crawler_stats' ][ $i ][ 'B' ] ) ? $summary[ 'crawler_stats' ][ $i ][ 'B' ] : 0;
|
||||
$blacklisted += ! empty( $summary[ 'crawler_stats' ][ $i ][ 'N' ] ) ? $summary[ 'crawler_stats' ][ $i ][ 'N' ] : 0;
|
||||
|
||||
if ( isset( $summary[ 'crawler_stats' ][ $i ][ 'W' ] ) ) {
|
||||
$waiting = $summary[ 'crawler_stats' ][ $i ][ 'W' ] ?: 0;
|
||||
}
|
||||
else {
|
||||
$waiting = $summary[ 'list_size' ] - $hit - $miss - $blacklisted;
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo $i + 1;
|
||||
if ( $i == $summary[ 'curr_crawler' ] ) {
|
||||
echo "<img class='litespeed-crawler-curr' src='" . LSWCP_PLUGIN_URL . "assets/img/Litespeed.icon.svg' />";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $v[ 'title' ]; ?>
|
||||
</td>
|
||||
<td><?php echo $recurrence; ?></td>
|
||||
<td>
|
||||
<?php echo '<i class="litespeed-badge litespeed-bg-default" data-balloon-pos="up" aria-label="' . __( 'Waiting', 'litespeed-cache' ) . '">' . ( $waiting ?: '-' ) . '</i> '; ?>
|
||||
<?php echo '<i class="litespeed-badge litespeed-bg-success" data-balloon-pos="up" aria-label="' . __( 'Hit', 'litespeed-cache' ) . '">' . ( $hit ?: '-' ) . '</i> '; ?>
|
||||
<?php echo '<i class="litespeed-badge litespeed-bg-primary" data-balloon-pos="up" aria-label="' . __( 'Miss', 'litespeed-cache' ) . '">' . ( $miss ?: '-' ) . '</i> '; ?>
|
||||
<?php echo '<i class="litespeed-badge litespeed-bg-danger" data-balloon-pos="up" aria-label="' . __( 'Blocklisted', 'litespeed-cache' ) . '">' . ( $blacklisted ?: '-' ) . '</i> '; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php $this->build_toggle( 'litespeed-crawler-'.$i , $__crawler->is_active( $i ) ); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $i == $summary[ 'curr_crawler' ] ) {
|
||||
echo "Position: " . ( $summary[ 'last_pos' ] + 1 );
|
||||
if ( $is_running ) {
|
||||
echo " <span class='litespeed-label-success'>" . __( 'running', 'litespeed-cache' ) . "</span>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<i class="litespeed-badge litespeed-bg-default"></i> = <?php echo __( 'Waiting to be Crawled', 'litespeed-cache' ); ?><br>
|
||||
<i class="litespeed-badge litespeed-bg-success"></i> = <?php echo __( 'Already Cached', 'litespeed-cache' ); ?><br>
|
||||
<i class="litespeed-badge litespeed-bg-primary"></i> = <?php echo __( 'Successfully Crawled', 'litespeed-cache' ); ?><br>
|
||||
<i class="litespeed-badge litespeed-bg-danger"></i> = <?php echo __( 'Blocklisted', 'litespeed-cache' ); ?><br>
|
||||
</p>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<div><?php echo __('Run frequency is set by the Interval Between Runs setting.','litespeed-cache'); ?></div>
|
||||
<div><?php echo __('Crawlers cannot run concurrently.', 'litespeed-cache')
|
||||
. __(' If both the cron and a manual run start at similar times, the first to be started will take precedence.','litespeed-cache'); ?></div>
|
||||
<div><?php echo sprintf(__('Please see <a %s>Hooking WP-Cron Into the System Task Scheduler</a> to learn how to create the system cron task.','litespeed-cache'), ' href="https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/" target="_blank" '); ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<h3 class="litespeed-title"><?php echo __('Watch Crawler Status', 'litespeed-cache'); ?></h3>
|
||||
|
||||
<?php
|
||||
$ajaxUrl = $__crawler->json_path();
|
||||
if ( $ajaxUrl ):
|
||||
?>
|
||||
|
||||
<input type="button" id="litespeed-crawl-url-btn" value="<?php echo __('Show crawler status', 'litespeed-cache'); ?>" class="button button-secondary" data-url="<?php echo $ajaxUrl; ?>" />
|
||||
|
||||
<div class="litespeed-shell litespeed-hide">
|
||||
<div class="litespeed-shell-header-bar"></div>
|
||||
<div class="litespeed-shell-header">
|
||||
<div class="litespeed-shell-header-bg"></div>
|
||||
<div class="litespeed-shell-header-icon-container">
|
||||
<img id="litespeed-shell-icon" src="<?php echo LSWCP_PLUGIN_URL . 'assets/img/Litespeed.icon.svg'; ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<ul class="litespeed-shell-body">
|
||||
<li>Start watching...</li>
|
||||
<li id="litespeed-loading-dot"></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
<p>
|
||||
<?php echo __('No crawler meta file generated yet', 'litespeed-cache'); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
@@ -0,0 +1,575 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$lscache_stats = GUI::cls()->lscache_stats();
|
||||
|
||||
$health_scores = Health::cls()->scores();
|
||||
|
||||
$crawler_summary = Crawler::get_summary();
|
||||
|
||||
// Image related info
|
||||
$optm_summary = Img_Optm::get_summary();
|
||||
$img_count = Img_Optm::cls()->img_count();
|
||||
if ( ! empty( $img_count[ 'groups_all' ] ) ) {
|
||||
$img_gathered_percentage = 100 - floor( $img_count[ 'groups_not_gathered' ] * 100 / $img_count[ 'groups_all' ] );
|
||||
}
|
||||
else {
|
||||
$img_gathered_percentage = 0;
|
||||
}
|
||||
|
||||
if ( ! empty( $img_count[ 'imgs_gathered' ] ) ) {
|
||||
$img_finished_percentage = 100 - floor( $img_count[ 'img.' . Img_Optm::STATUS_RAW ] * 100 / $img_count[ 'imgs_gathered' ] );
|
||||
}
|
||||
else {
|
||||
$img_finished_percentage = 0;
|
||||
}
|
||||
|
||||
$cloud_summary = Cloud::get_summary();
|
||||
$css_summary = CSS::get_summary();
|
||||
$placeholder_summary = Placeholder::get_summary();
|
||||
|
||||
$ccss_count = count( $this->load_queue( 'ccss' ) );
|
||||
$ucss_count = count( $this->load_queue( 'ucss' ) );
|
||||
$placeholder_queue_count = count( $this->load_queue( 'lqip' ) );
|
||||
?>
|
||||
|
||||
<div class="litespeed-dashboard">
|
||||
|
||||
|
||||
<div class="litespeed-dashboard-header">
|
||||
<h3 class="litespeed-dashboard-title">
|
||||
<?php echo __( 'QUIC.cloud Service Usage Statistics', 'litespeed-cache' ); ?>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_SYNC_USAGE ); ?>">
|
||||
<span class="dashicons dashicons-update"></span>
|
||||
<span class="screen-reader-text"><?php echo __( 'Sync data from Cloud', 'litespeed-cache' ); ?></span>
|
||||
</a>
|
||||
</h3>
|
||||
<hr>
|
||||
<a href="https://docs.litespeedtech.com/lscache/lscwp/dashboard/#usage-statistics" target="_blank" class="litespeed-learn-more"><?php echo __( 'Learn More', 'litespeed-cache' );?></a>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-dashboard-stats-wrapper">
|
||||
<?php
|
||||
$cat_list = array(
|
||||
'img_optm' => __( 'Image Optimization', 'litespeed-cache' ),
|
||||
'page_optm' => __( 'Page Optimization', 'litespeed-cache' ),
|
||||
'cdn' => __( 'CDN Bandwidth', 'litespeed-cache' ),
|
||||
'lqip' => __( 'Low Quality Image Placeholder', 'litespeed-cache' ),
|
||||
);
|
||||
|
||||
foreach ( $cat_list as $svc => $title ) :
|
||||
$finished_percentage = 0;
|
||||
$total_used = $used = $quota = $pag_used = $pag_total = '-';
|
||||
$pag_width = 0;
|
||||
$percentage_bg = 'success';
|
||||
$pag_txt_color = '';
|
||||
$usage = false;
|
||||
|
||||
if ( ! empty( $cloud_summary[ 'usage.' . $svc ] ) ) {
|
||||
$usage = $cloud_summary[ 'usage.' . $svc ];
|
||||
$finished_percentage = floor( $usage[ 'used' ] * 100 / $usage[ 'quota' ] );
|
||||
$used = (int)$usage[ 'used' ];
|
||||
$quota = (int)$usage[ 'quota' ];
|
||||
$pag_used = ! empty( $usage[ 'pag_used' ] ) ? (int)$usage[ 'pag_used' ] : 0;
|
||||
$pag_bal = ! empty( $usage[ 'pag_bal' ] ) ? (int)$usage[ 'pag_bal' ] : 0;
|
||||
$pag_total = $pag_used + $pag_bal;
|
||||
if ( ! empty( $usage[ 'total_used' ] ) ) {
|
||||
$total_used = (int)$usage[ 'total_used' ];
|
||||
}
|
||||
|
||||
if ( $pag_total ) {
|
||||
$pag_width = round( $pag_used / $pag_total * 100 ) . '%';
|
||||
}
|
||||
|
||||
if ( $finished_percentage > 85 ) {
|
||||
$percentage_bg = 'warning';
|
||||
if ( $finished_percentage > 95 ) {
|
||||
$percentage_bg = 'danger';
|
||||
if ( $pag_bal ) { // is using PAG quota
|
||||
$percentage_bg = 'warning';
|
||||
$pag_txt_color = 'litespeed-success';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $svc == 'cdn' ) {
|
||||
// $used = Utility::real_size( $used * 1000000 * 100, true );
|
||||
// $quota = Utility::real_size( $quota * 1000000 * 100, true );
|
||||
// $pag_used = Utility::real_size( $pag_used * 1000000 * 100, true );
|
||||
// $pag_bal = Utility::real_size( $pag_bal * 1000000 * 100, true );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="postbox litespeed-postbox">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title"><?php echo $title; ?></h3>
|
||||
|
||||
<div class="litespeed-flex-container">
|
||||
<div class="litespeed-icon-vertical-middle litespeed-pie-<?php echo $percentage_bg;?>">
|
||||
<?php echo GUI::pie( $finished_percentage, 60, false ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<div class="litespeed-dashboard-stats">
|
||||
<h3><?php echo ( $svc == 'img_optm' ? __('Fast Queue Usage','litespeed-cache') : __( 'Usage', 'litespeed-cache' ) ); ?></h3>
|
||||
<p>
|
||||
<strong><?php echo $used; ?></strong>
|
||||
<?php if( $used != $quota ) { ?>
|
||||
<span class="litespeed-desc"> of <?php echo $quota; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ( $pag_total > 0 ) { ?>
|
||||
<p class="litespeed-dashboard-stats-payg <?php echo $pag_txt_color; ?>">
|
||||
<?php echo __('PAYG Balance','litespeed-cache'); ?>: <strong><?php echo $pag_bal; ?></strong>
|
||||
<button class="litespeed-info-button" data-balloon-pos="up" aria-label="<?php echo __('This Month Usage','litespeed-cache'); ?>: <?php echo $pag_used;?>">
|
||||
<span class="dashicons dashicons-info"></span>
|
||||
<span class="screen-reader-text"><?php echo __( 'Pay as You Go Usage Statistics', 'litespeed-cache' );?></span>
|
||||
</button>
|
||||
</p>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( $svc == 'page_optm' ) : ?>
|
||||
<?php if ( ! empty( $usage[ 'sub_svc' ] ) ) : ?>
|
||||
<p class="litespeed-dashboard-stats-total">
|
||||
<?php $i=0;foreach ( $usage[ 'sub_svc' ] as $sub_svc => $sub_usage ) : ?>
|
||||
<?php if ($sub_svc=='vpi') continue; ?>
|
||||
<span class="<?php if ( $i++>0 ) echo 'litespeed-left10'; ?>"><?php echo strtoupper( esc_html( $sub_svc ) ); ?>: <strong><?php echo (int)$sub_usage; ?></strong></span>
|
||||
<?php endforeach; ?>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $svc == 'img_optm' ) { ?>
|
||||
<p class="litespeed-dashboard-stats-total">
|
||||
<?php echo __('Total Usage','litespeed-cache'); ?>: <strong><?php echo $total_used; ?> / ∞</strong>
|
||||
<button class="litespeed-info-button" data-balloon-pos="up" aria-label="<?php echo __('Total images optimized in this month','litespeed-cache'); ?>">
|
||||
<span class="dashicons dashicons-info"></span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( isset( $usage[ 'remaining_daily_quota' ] ) && $usage[ 'remaining_daily_quota' ] >= 0 && isset( $usage[ 'daily_quota' ] ) && $usage[ 'daily_quota' ] >= 0 ) { ?>
|
||||
<p class="litespeed-dashboard-stats-total">
|
||||
<?php echo __('Remaining Daily Quota','litespeed-cache'); ?>: <strong><?php echo $usage[ 'remaining_daily_quota' ]; ?> / <?php echo $usage[ 'daily_quota' ]; ?></strong>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<p class="litespeed-right litespeed-qc-dashboard-link"><a href="<?php echo Cloud::CLOUD_SERVER_DASH; ?>" class="litespeed-link-with-icon" target="_blank"><?php echo __( 'Go to QUIC.cloud dashboard', 'litespeed-cache' ) ;?> <span class="dashicons dashicons-external"></span></a></p>
|
||||
|
||||
<div class="litespeed-dashboard-group">
|
||||
<hr>
|
||||
<div class="litespeed-flex-container">
|
||||
|
||||
<div class="postbox litespeed-postbox litespeed-postbox-pagetime">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Page Load Time', 'litespeed-cache' ); ?>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_HEALTH, Health::TYPE_SPEED ); ?>">
|
||||
<span class="dashicons dashicons-update"></span>
|
||||
<span class="screen-reader-text"><?php echo __('Refresh page load time', 'litespeed-cache'); ?></span>
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
<div>
|
||||
<div class="litespeed-flex-container">
|
||||
|
||||
<?php if ( $health_scores[ 'speed_before' ] ) : ?>
|
||||
<div class="litespeed-score-col">
|
||||
<p class="litespeed-text-grey">
|
||||
<?php echo __( 'Before', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
<div class="litespeed-text-md litespeed-text-grey">
|
||||
<?php echo $health_scores[ 'speed_before' ]; ?><span class="litespeed-text-large">s</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="litespeed-score-col">
|
||||
<p class="litespeed-text-grey">
|
||||
<?php echo __( 'After', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
<div class="litespeed-text-md litespeed-text-success">
|
||||
<?php echo $health_scores[ 'speed_after' ]; ?><span class="litespeed-text-large">s</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="litespeed-score-col litespeed-score-col--imp">
|
||||
<p class="litespeed-text-grey" style="white-space: nowrap;">
|
||||
<?php echo __( 'Improved by', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
<div class="litespeed-text-jumbo litespeed-text-success">
|
||||
<?php echo $health_scores[ 'speed_improved' ]; ?><span class="litespeed-text-large">%</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
|
||||
<?php if ( ! empty( $cloud_summary[ 'last_request.health-speed' ] ) ) : ?>
|
||||
<?php echo __( 'Last requested', 'litespeed-cache' ) . ': ' . Utility::readable_time( $cloud_summary[ 'last_request.health-speed' ] ) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $closest_server = Cloud::get_summary( 'server.' . CLoud::SVC_HEALTH ); ?>
|
||||
<?php if ( $closest_server ) : ?>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array( 'svc' => Cloud::SVC_HEALTH ) ); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo sprintf( __( 'Current closest Cloud server is %s. Click to redetect.', 'litespeed-cache' ), $closest_server ); ?>' data-litespeed-cfm="<?php echo __( 'Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache' ) ; ?>" class="litespeed-right"><i class='litespeed-quic-icon'></i></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="postbox litespeed-postbox litespeed-postbox-pagespeed">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'PageSpeed Score', 'litespeed-cache' ); ?>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_HEALTH, Health::TYPE_SCORE ); ?>">
|
||||
<span class="dashicons dashicons-update"></span>
|
||||
<span class="screen-reader-text"><?php echo __('Refresh page score', 'litespeed-cache'); ?></span>
|
||||
</a>
|
||||
|
||||
<?php $id = Base::O_GUEST; ?>
|
||||
<a href="<?php echo admin_url( 'admin.php?page=litespeed-general' ); ?>" class="litespeed-title-right-icon"><?php echo Lang::title( $id ); ?></a>
|
||||
<?php if ( $this->conf( $id ) ) : ?>
|
||||
<span class="litespeed-label-success litespeed-label-dashboard">ON</span>
|
||||
<?php else: ?>
|
||||
<span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
|
||||
<?php endif; ?>
|
||||
|
||||
</h3>
|
||||
|
||||
<div>
|
||||
|
||||
<div class="litespeed-margin-bottom20">
|
||||
<div class="litespeed-row-flex" style="margin-left: -10px;">
|
||||
|
||||
<?php if ( ! empty( $health_scores[ 'score_before' ] ) ) : ?>
|
||||
<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
|
||||
<p class="litespeed-text-grey litespeed-text-center">
|
||||
<?php echo __( 'Before', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
<div class="litespeed-promo-score">
|
||||
<?php echo GUI::pie( $health_scores[ 'score_before' ], 45, false, true, 'litespeed-pie-' . GUI::cls()->get_cls_of_pagescore( $health_scores[ 'score_before' ] ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
|
||||
<p class="litespeed-text-grey litespeed-text-center">
|
||||
<?php echo __( 'After', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
<div class="litespeed-promo-score">
|
||||
<?php echo GUI::pie( $health_scores[ 'score_after' ], 45, false, true, 'litespeed-pie-' . GUI::cls()->get_cls_of_pagescore( $health_scores[ 'score_after' ] ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="litespeed-width-1-3 litespeed-padding-space litespeed-margin-x5">
|
||||
<p class="litespeed-text-grey" style="white-space: nowrap;">
|
||||
<?php echo __( 'Improved by', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
<div class="litespeed-postbox-score-improve litespeed-text-fern">
|
||||
<?php echo $health_scores[ 'score_improved' ]; ?><span class="litespeed-text-large">%</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ( ! empty( $cloud_summary[ 'last_request.health-score' ] ) ) : ?>
|
||||
<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
|
||||
<?php echo __( 'Last requested', 'litespeed-cache' ) . ': ' . Utility::readable_time( $cloud_summary[ 'last_request.health-score' ] ) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="postbox litespeed-postbox litespeed-postbox-double litespeed-postbox-imgopt">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Image Optimization Summary', 'litespeed-cache' ); ?>
|
||||
<a href="<?php echo admin_url( 'admin.php?page=litespeed-img_optm' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
|
||||
</h3>
|
||||
<div class="litespeed-postbox-double-content">
|
||||
<div class="litespeed-postbox-double-col">
|
||||
<div class="litespeed-flex-container">
|
||||
<div class="litespeed-icon-vertical-middle">
|
||||
<?php echo GUI::pie( $img_gathered_percentage, 70, true ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<div class="litespeed-dashboard-stats">
|
||||
<h3><?php echo __('Image Groups Prepared','litespeed-cache'); ?></h3>
|
||||
<p>
|
||||
<strong><?php echo ( $img_count[ 'groups_all' ] - $img_count[ 'groups_not_gathered' ] ); ?></strong>
|
||||
<span class="litespeed-desc">of <?php echo $img_count[ 'groups_all' ]; ?></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-flex-container">
|
||||
<div class="litespeed-icon-vertical-middle">
|
||||
<?php echo GUI::pie( $img_finished_percentage, 70, true ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<div class="litespeed-dashboard-stats">
|
||||
<h3><?php echo __('Images Requested','litespeed-cache'); ?></h3>
|
||||
<p>
|
||||
<strong><?php echo ( $img_count[ 'imgs_gathered' ] - $img_count[ 'img.' . Img_Optm::STATUS_RAW ]); ?></strong>
|
||||
<span class="litespeed-desc">of <?php echo $img_count[ 'imgs_gathered' ]; ?></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="litespeed-postbox-double-col">
|
||||
<?php if ( ! empty( $img_count[ 'group.' . Img_Optm::STATUS_REQUESTED ] ) ) : ?>
|
||||
<p class="litespeed-success">
|
||||
<?php echo __('Images requested', 'litespeed-cache'); ?>:
|
||||
<code>
|
||||
<?php echo Admin_Display::print_plural( $img_count[ 'group.' . Img_Optm::STATUS_REQUESTED ] ); ?>
|
||||
(<?php echo Admin_Display::print_plural( $img_count[ 'img.' . Img_Optm::STATUS_REQUESTED ], 'image' ); ?>)
|
||||
</code>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $img_count[ 'group.' . Img_Optm::STATUS_NOTIFIED ] ) ) : ?>
|
||||
<p class="litespeed-success">
|
||||
<?php echo __('Images notified to pull', 'litespeed-cache'); ?>:
|
||||
<code>
|
||||
<?php echo Admin_Display::print_plural( $img_count[ 'group.' . Img_Optm::STATUS_NOTIFIED ] ); ?>
|
||||
(<?php echo Admin_Display::print_plural( $img_count[ 'img.' . Img_Optm::STATUS_NOTIFIED ], 'image' ); ?>)
|
||||
</code>
|
||||
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<p>
|
||||
<?php echo __( 'Last Request', 'litespeed-cache' ); ?>: <code><?php echo ! empty( $optm_summary[ 'last_requested' ] ) ? Utility::readable_time( $optm_summary[ 'last_requested' ] ) : '-'; ?></code>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Last Pull', 'litespeed-cache' ); ?>: <code><?php echo ! empty( $optm_summary[ 'last_pull' ] ) ? Utility::readable_time( $optm_summary[ 'last_pull' ] ) : '-'; ?></code>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
$cache_list = array(
|
||||
Base::O_IMG_OPTM_AUTO => Lang::title( Base::O_IMG_OPTM_AUTO ),
|
||||
Base::O_IMG_OPTM_CRON => Lang::title( Base::O_IMG_OPTM_CRON ),
|
||||
);
|
||||
foreach ( $cache_list as $id => $title ) :
|
||||
?>
|
||||
<p>
|
||||
<?php if ( $this->conf( $id ) ) : ?>
|
||||
<span class="litespeed-label-success litespeed-label-dashboard">ON</span>
|
||||
<?php else: ?>
|
||||
<span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
|
||||
<?php endif; ?>
|
||||
<a href="<?php echo admin_url( 'admin.php?page=litespeed-img_optm#settings' ); ?>"><?php echo $title; ?></a>
|
||||
</p>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="postbox litespeed-postbox litespeed-postbox-cache">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Cache Status', 'litespeed-cache' ); ?>
|
||||
<a href="<?php echo admin_url( 'admin.php?page=litespeed-cache' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php
|
||||
$cache_list = array(
|
||||
Base::O_CACHE => __( 'Public Cache', 'litespeed-cache' ),
|
||||
Base::O_CACHE_PRIV => __( 'Private Cache', 'litespeed-cache' ),
|
||||
Base::O_OBJECT => __( 'Object Cache', 'litespeed-cache' ),
|
||||
Base::O_CACHE_BROWSER => __( 'Browser Cache', 'litespeed-cache' ),
|
||||
);
|
||||
foreach ( $cache_list as $id => $title ) :
|
||||
?>
|
||||
<p>
|
||||
<?php if ( $this->conf( $id ) ) : ?>
|
||||
<span class="litespeed-label-success litespeed-label-dashboard">ON</span>
|
||||
<?php else: ?>
|
||||
<span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
|
||||
<?php endif; ?>
|
||||
<?php echo esc_html( $title ); ?>
|
||||
</p>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ( $lscache_stats ) : ?>
|
||||
<div class="postbox litespeed-postbox litespeed-postbox-cache-stats">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Cache Stats', 'litespeed-cache' ); ?>
|
||||
</h3>
|
||||
|
||||
<?php foreach ( $lscache_stats as $title => $val ) : ?>
|
||||
<p><?php echo $title; ?>: <?php echo $val ? "<code>$val</code>" : '-'; ?></p>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="postbox litespeed-postbox litespeed-postbox-ccss">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Critical CSS', 'litespeed-cache' ); ?>
|
||||
<a href="<?php echo admin_url( 'admin.php?page=litespeed-page_optm#settings_css' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php if ( ! empty( $css_summary[ 'last_request_ccss' ] ) ) : ?>
|
||||
<p>
|
||||
<?php echo __( 'Last generated', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $css_summary[ 'last_request_ccss' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Time to execute previous request', 'litespeed-cache' ) . ': <code>' . esc_html( $css_summary[ 'last_spent_ccss' ] ) . 's</code>'; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<p>
|
||||
<?php echo __( 'Requests in queue', 'litespeed-cache' ); ?>: <code><?php echo $ccss_count ?: '-'; ?></code>
|
||||
<a href="<?php echo $ccss_count ? Utility::build_url( Router::ACTION_CSS, CSS::TYPE_GEN_CCSS ) : 'javascript:;'; ?>"
|
||||
class="button button-secondary button-small <?php if ( ! $ccss_count ) echo 'disabled'; ?>">
|
||||
<?php echo __( 'Force cron', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( ! empty( $cloud_summary[ 'last_request.ccss' ] ) ) : ?>
|
||||
<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
|
||||
<?php echo __( 'Last requested', 'litespeed-cache' ) . ': ' . Utility::readable_time( $cloud_summary[ 'last_request.ccss' ] ) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="postbox litespeed-postbox litespeed-postbox-ucss">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Unique CSS', 'litespeed-cache' ); ?>
|
||||
<a href="<?php echo admin_url( 'admin.php?page=litespeed-page_optm#settings_css' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php if ( ! empty( $css_summary[ 'last_request_ucss' ] ) ) : ?>
|
||||
<p>
|
||||
<?php echo __( 'Last generated', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $css_summary[ 'last_request_ucss' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Time to execute previous request', 'litespeed-cache' ) . ': <code>' . esc_html( $css_summary[ 'last_spent_ucss' ] ) . 's</code>'; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<p>
|
||||
<?php echo __( 'Requests in queue', 'litespeed-cache' ); ?>: <code><?php echo $ucss_count ?: '-' ?></code>
|
||||
<a href="<?php echo $ucss_count ? Utility::build_url( Router::ACTION_CSS, CSS::TYPE_GEN_UCSS ) : 'javascript:;'; ?>"
|
||||
class="button button-secondary button-small <?php if ( ! $ucss_count ) echo 'disabled'; ?>">
|
||||
<?php echo __( 'Force cron', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( ! empty( $cloud_summary[ 'last_request.ucss' ] ) ) : ?>
|
||||
<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
|
||||
<?php echo __( 'Last requested', 'litespeed-cache' ) . ': ' . Utility::readable_time( $cloud_summary[ 'last_request.ucss' ] ) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="postbox litespeed-postbox litespeed-postbox-lqip">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Low Quality Image Placeholder', 'litespeed-cache' ); ?>
|
||||
<a href="<?php echo admin_url( 'admin.php?page=litespeed-page_optm#settings_media' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
|
||||
</h3>
|
||||
|
||||
<?php if ( ! empty( $placeholder_summary[ 'last_request' ] ) ) : ?>
|
||||
<p>
|
||||
<?php echo __( 'Last generated', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $placeholder_summary[ 'last_request' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Time to execute previous request', 'litespeed-cache' ) . ': <code>' . esc_html( $placeholder_summary[ 'last_spent' ] ) . 's</code>'; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<p>
|
||||
<?php echo __( 'Requests in queue', 'litespeed-cache' ); ?>: <code><?php echo $placeholder_queue_count ?: '-' ?></code>
|
||||
<a href="<?php echo $placeholder_queue_count ? Utility::build_url( Router::ACTION_PLACEHOLDER, Placeholder::TYPE_GENERATE ) : 'javascript:;'; ?>" class="button button-secondary button-small <?php if ( ! $placeholder_queue_count ) echo 'disabled'; ?>">
|
||||
<?php echo __( 'Force cron', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( ! empty( $cloud_summary[ 'last_request.lqip' ] ) ) : ?>
|
||||
<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
|
||||
<?php echo __( 'Last requested', 'litespeed-cache' ) . ': ' . Utility::readable_time( $cloud_summary[ 'last_request.lqip' ] ) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="postbox litespeed-postbox litespeed-postbox-crawler">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Crawler Status', 'litespeed-cache' ); ?>
|
||||
<a href="<?php echo admin_url( 'admin.php?page=litespeed-crawler' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
<code><?php echo count( Crawler::cls()->list_crawlers() );?></code> <?php echo __( 'Crawler(s)', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Currently active crawler', 'litespeed-cache' ); ?>: <code><?php echo esc_html( $crawler_summary[ 'curr_crawler' ] ); ?></code>
|
||||
</p>
|
||||
|
||||
<?php if ( $crawler_summary[ 'curr_crawler_beginning_time' ] ) : ?>
|
||||
<p>
|
||||
<b><?php echo __('Current crawler started at', 'litespeed-cache'); ?>:</b>
|
||||
<?php echo Utility::readable_time( $crawler_summary[ 'curr_crawler_beginning_time' ] ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $crawler_summary[ 'last_start_time' ] ) : ?>
|
||||
<p class='litespeed-desc'>
|
||||
<b><?php echo __('Last interval', 'litespeed-cache'); ?>:</b>
|
||||
<?php echo Utility::readable_time( $crawler_summary[ 'last_start_time' ] ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $crawler_summary[ 'end_reason' ] ) : ?>
|
||||
<p class='litespeed-desc'>
|
||||
<b><?php echo __( 'Ended reason', 'litespeed-cache' ); ?>:</b>
|
||||
<?php echo esc_html( $crawler_summary[ 'end_reason' ] ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $crawler_summary[ 'last_crawled' ] ) : ?>
|
||||
<p class='litespeed-desc'>
|
||||
<?php echo sprintf(__('<b>Last crawled:</b> %d item(s)', 'litespeed-cache'), $crawler_summary[ 'last_crawled' ] ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$menu_list = array(
|
||||
'dashboard' => __( 'Dashboard', 'litespeed-cache' ),
|
||||
);
|
||||
|
||||
if ( $this->_is_network_admin ) {
|
||||
$menu_list = array(
|
||||
'network_dash' => __( 'Network Dashboard', 'litespeed-cache' ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="litespeed-h1">
|
||||
<?php echo __( 'LiteSpeed Cache Dashboard', 'litespeed-cache' ); ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo Core::VER; ?>
|
||||
</span>
|
||||
<hr class="wp-header-end">
|
||||
</div>
|
||||
|
||||
<div class="litespeed-wrap">
|
||||
<?php
|
||||
foreach ($menu_list as $tab => $val) {
|
||||
echo "<div data-litespeed-layout='$tab'>";
|
||||
require LSCWP_DIR . "tpl/dash/$tab.tpl.php";
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$cloud_summarys = array();
|
||||
$blogs = Activation::get_network_ids();
|
||||
foreach ( $blogs as $blog_id ) {
|
||||
switch_to_blog( $blog_id );
|
||||
$cloud_summarys[ home_url() ] = Cloud::get_summary();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="litespeed-dashboard">
|
||||
<?php foreach ( $cloud_summarys as $home_url => $cloud_summary ) : ?>
|
||||
|
||||
<div class="litespeed-dashboard-header">
|
||||
<h3 class="litespeed-dashboard-title">
|
||||
<?php echo __( 'Usage Statistics', 'litespeed-cache' ) . ': ' . $home_url; ?>
|
||||
</h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-dashboard-stats-wrapper">
|
||||
<?php
|
||||
$cat_list = array(
|
||||
'img_optm' => __( 'Image Optimization', 'litespeed-cache' ),
|
||||
'ccss' => __( 'CCSS', 'litespeed-cache' ),
|
||||
'cdn' => __( 'CDN Bandwidth', 'litespeed-cache' ),
|
||||
'lqip' => __( 'LQIP', 'litespeed-cache' ),
|
||||
);
|
||||
|
||||
foreach ( $cat_list as $svc => $title ) :
|
||||
$finished_percentage = 0;
|
||||
$total_used = $used = $quota = $pag_used = $pag_total = '-';
|
||||
$used = $quota = $pag_used = $pag_total = '-';
|
||||
$pag_width = 0;
|
||||
if ( ! empty( $cloud_summary[ 'usage.' . $svc ] ) ) {
|
||||
$finished_percentage = floor( $cloud_summary[ 'usage.' . $svc ][ 'used' ] * 100 / $cloud_summary[ 'usage.' . $svc ][ 'quota' ] );
|
||||
$used = $cloud_summary[ 'usage.' . $svc ][ 'used' ];
|
||||
$quota = $cloud_summary[ 'usage.' . $svc ][ 'quota' ];
|
||||
$pag_used = ! empty( $cloud_summary[ 'usage.' . $svc ][ 'pag_used' ] ) ? $cloud_summary[ 'usage.' . $svc ][ 'pag_used' ] : 0;
|
||||
$pag_bal = ! empty( $cloud_summary[ 'usage.' . $svc ][ 'pag_bal' ] ) ? $cloud_summary[ 'usage.' . $svc ][ 'pag_bal' ] : 0;
|
||||
$pag_total = $pag_used + $pag_bal;
|
||||
|
||||
if ( $pag_total ) {
|
||||
$pag_width = round( $pag_used / $pag_total * 100 ) . '%';
|
||||
}
|
||||
|
||||
if ( $svc == 'cdn' ) {
|
||||
$used = Utility::real_size( $used * 1024 * 1024 );
|
||||
$quota = Utility::real_size( $quota * 1024 * 1024 );
|
||||
$pag_used = Utility::real_size( $pag_used * 1024 * 1024 );
|
||||
$pag_total = Utility::real_size( $pag_total * 1024 * 1024 );
|
||||
}
|
||||
}
|
||||
|
||||
$percentage_bg = 'success';
|
||||
if( $finished_percentage > 95 ){
|
||||
$percentage_bg = 'danger';
|
||||
} elseif ( $finished_percentage > 85 ){
|
||||
$percentage_bg = 'warning';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="postbox litespeed-postbox">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title"><?php echo $title; ?></h3>
|
||||
|
||||
<div class="litespeed-flex-container">
|
||||
<div class="litespeed-icon-vertical-middle litespeed-pie-<?php echo $percentage_bg;?>">
|
||||
<?php echo GUI::pie( $finished_percentage, 60, false ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<div class="litespeed-dashboard-stats">
|
||||
<h3><?php echo ( $svc == 'img_optm' ? __('Fast Queue Usage','litespeed-cache') : __( 'Usage', 'litespeed-cache' ) ); ?></h3>
|
||||
<p>
|
||||
<strong><?php echo esc_html( $used ); ?></strong>
|
||||
<?php if( $used != $quota ) { ?>
|
||||
<span class="litespeed-desc"> of <?php echo esc_html( $quota ); ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ( $pag_total > 0 ) { ?>
|
||||
<p class="litespeed-dashboard-stats-payg" data-balloon-pos="up" aria-label="<?php echo __('Pay as You Go','litespeed-cache'); ?>">
|
||||
<?php echo __('PAYG Balance','litespeed-cache'); ?>: <strong><?php echo esc_html( $pag_bal ); ?></strong>
|
||||
<button class="litespeed-info-button" data-balloon-pos="up" aria-label="<?php echo __('This Month Usage','litespeed-cache'); ?>: <?php echo esc_html( $pag_used );?>">
|
||||
<span class="dashicons dashicons-info"></span>
|
||||
<span class="screen-reader-text"><?php echo __( 'Pay as You Go Usage Statistics', 'litespeed-cache' );?></span>
|
||||
</button>
|
||||
</p>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( $svc == 'img_optm' ) { ?>
|
||||
<p class="litespeed-dashboard-stats-total">
|
||||
<?php echo __('Total Usage','litespeed-cache'); ?>: <strong><?php echo esc_html( $total_used ); ?> / ∞</strong>
|
||||
<button class="litespeed-info-button" data-balloon-pos="up" aria-label="<?php echo __('Total images optimized in this month','litespeed-cache'); ?>">
|
||||
<span class="dashicons dashicons-info"></span>
|
||||
</button>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</div>
|
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$menu_list = array(
|
||||
'manage' => __( 'Manage', 'litespeed-cache' ),
|
||||
);
|
||||
|
||||
if ( ! $this->_is_network_admin ) {
|
||||
$menu_list[ 'settings' ] = __( 'DB Optimization Settings', 'litespeed-cache' );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="litespeed-h1">
|
||||
<?php echo __( 'LiteSpeed Cache Database Optimization', 'litespeed-cache' ); ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo Core::VER; ?>
|
||||
</span>
|
||||
<hr class="wp-header-end">
|
||||
</div>
|
||||
|
||||
<div class="litespeed-wrap">
|
||||
<h2 class="litespeed-header nav-tab-wrapper">
|
||||
<?php
|
||||
$i = 1;
|
||||
foreach ($menu_list as $tab => $val){
|
||||
$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
|
||||
echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
|
||||
$i ++;
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<div class="litespeed-body">
|
||||
<?php
|
||||
|
||||
// include all tpl for faster UE
|
||||
foreach ($menu_list as $tab => $val) {
|
||||
echo "<div data-litespeed-layout='$tab'>";
|
||||
require LSCWP_DIR . "tpl/db_optm/$tab.tpl.php";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$_panels = array(
|
||||
'all' => array(
|
||||
'title' => __( 'Clean All', 'litespeed-cache' ),
|
||||
'desc' => '',
|
||||
),
|
||||
'revision' => array(
|
||||
'title' => __( 'Post Revisions', 'litespeed-cache' ),
|
||||
'desc' => __( 'Clean all post revisions', 'litespeed-cache' ),
|
||||
),
|
||||
'auto_draft' => array(
|
||||
'title' => __( 'Auto Drafts', 'litespeed-cache' ),
|
||||
'desc' => __( 'Clean all auto saved drafts', 'litespeed-cache' ),
|
||||
),
|
||||
'trash_post' => array(
|
||||
'title' => __( 'Trashed Posts', 'litespeed-cache' ),
|
||||
'desc' => __( 'Clean all trashed posts and pages', 'litespeed-cache' ),
|
||||
),
|
||||
'spam_comment' => array(
|
||||
'title' => __( 'Spam Comments', 'litespeed-cache' ),
|
||||
'desc' => __( 'Clean all spam comments', 'litespeed-cache' ),
|
||||
),
|
||||
'trash_comment' => array(
|
||||
'title' => __( 'Trashed Comments', 'litespeed-cache' ),
|
||||
'desc' => __( 'Clean all trashed comments', 'litespeed-cache' ),
|
||||
),
|
||||
'trackback-pingback' => array(
|
||||
'title' => __( 'Trackbacks/Pingbacks', 'litespeed-cache' ),
|
||||
'desc' => __( 'Clean all trackbacks and pingbacks', 'litespeed-cache' ),
|
||||
),
|
||||
'expired_transient' => array(
|
||||
'title' => __( 'Expired Transients', 'litespeed-cache' ),
|
||||
'desc' => __( 'Clean expired transient options', 'litespeed-cache' ),
|
||||
),
|
||||
'all_transients' => array(
|
||||
'title' => __( 'All Transients', 'litespeed-cache' ),
|
||||
'desc' => __( 'Clean all transient options', 'litespeed-cache' ),
|
||||
),
|
||||
'optimize_tables' => array(
|
||||
'title' => __( 'Optimize Tables', 'litespeed-cache' ),
|
||||
'desc' => __( 'Optimize all tables in your database', 'litespeed-cache' ),
|
||||
),
|
||||
);
|
||||
|
||||
$rev_max = $this->conf( Base::O_DB_OPTM_REVISIONS_MAX );
|
||||
$rev_age = $this->conf( Base::O_DB_OPTM_REVISIONS_AGE );
|
||||
if ( $rev_max || $rev_age ) {
|
||||
$_panels[ 'revision' ][ 'desc' ] = sprintf( __( 'Clean revisions older than %1$s day(s), excluding %2$s latest revisions', 'litespeed-cache' ), '<strong>' . $rev_age . '</strong>' , '<strong>' . $rev_max . '</strong>' );
|
||||
}
|
||||
|
||||
$total = 0;
|
||||
foreach ( $_panels as $tag => $v ) {
|
||||
if ( $tag != 'all' ) {
|
||||
$_panels[ $tag ][ 'count' ] = $this->cls( 'DB_Optm' )->db_count( $tag );
|
||||
if ( ! in_array( $tag, array( 'optimize_tables' ) ) ) {
|
||||
$total += $_panels[ $tag ][ 'count' ];
|
||||
}
|
||||
}
|
||||
$_panels[ $tag ][ 'link' ] = Utility::build_url( Router::ACTION_DB_OPTM, $tag );
|
||||
}
|
||||
|
||||
$_panels[ 'all' ][ 'count' ] = $total;
|
||||
|
||||
$autoload_summary = DB_Optm::cls()->autoload_summary();
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __('Database Optimizer', 'litespeed-cache'); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/database/' ); ?>
|
||||
</h3>
|
||||
|
||||
<div class="litespeed-panel-wrapper litespeed-cards-wrapper">
|
||||
|
||||
<?php foreach ( $_panels as $tag => $v ): ?>
|
||||
|
||||
<a href="<?php echo $v[ 'link' ]; ?>" class="litespeed-panel postbox">
|
||||
<section class="litespeed-panel-wrapper-icon">
|
||||
<span class="litespeed-panel-icon-<?php echo $tag; ?>"></span>
|
||||
</section>
|
||||
<section class="litespeed-panel-content">
|
||||
<div class="litespeed-h3">
|
||||
<?php echo $v[ 'title' ]; ?>
|
||||
<span class="litespeed-panel-counter<?php if ( $v[ 'count' ] > 0 ) echo '-red'; ?>">(<?php echo $v[ 'count' ]; ?><?php echo DB_Optm::hide_more() ? '+' : ''; ?>)</span>
|
||||
</div>
|
||||
<span class="litespeed-panel-para"><?php echo $v[ 'desc' ]; ?></span>
|
||||
</section>
|
||||
<section class="litespeed-panel-wrapper-top-right">
|
||||
<span class="litespeed-panel-top-right-icon<?php echo $v[ 'count' ] > 0 ? '-cross' : '-tick'; ?>"></span>
|
||||
</section>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<h3 class="litespeed-title"><?php echo __( 'Database Table Engine Converter', 'litespeed-cache' ); ?></h3>
|
||||
|
||||
<div class="litespeed-panel-wrapper">
|
||||
|
||||
<table class="wp-list-table widefat striped">
|
||||
<thead><tr >
|
||||
<th scope="col">#</th>
|
||||
<th scope="col"><?php echo __( 'Table', 'litespeed-cache' ); ?></th>
|
||||
<th scope="col"><?php echo __( 'Engine', 'litespeed-cache' ); ?></th>
|
||||
<th scope="col"><?php echo __( 'Tool', 'litespeed-cache' ); ?></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$list = DB_Optm::cls()->list_myisam();
|
||||
if ( $list ) :
|
||||
foreach ( $list as $k => $v ) :
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $k + 1; ?></td>
|
||||
<td><?php echo $v->TABLE_NAME; ?></td>
|
||||
<td><?php echo $v->ENGINE; ?></td>
|
||||
<td>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_DB_OPTM, DB_Optm::TYPE_CONV_TB, false, false, array( 'tb' => $v->TABLE_NAME ) ); ?>">
|
||||
<?php echo __( 'Convert to InnoDB', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else : ?>
|
||||
<tr>
|
||||
<td colspan="4" class="litespeed-success litespeed-text-center">
|
||||
<?php echo __( 'We are good. No table uses MyISAM engine.', 'litespeed-cache' ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<style type="text/css">
|
||||
.litespeed-body .field-col {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.litespeed-body .field-col:first-child{
|
||||
margin-left:0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h3 class="litespeed-title"><?php echo __( 'Database Summary', 'litespeed-cache' ); ?></h3>
|
||||
<div>
|
||||
<div class="field-col">
|
||||
<p>
|
||||
Autoload size: <strong><?php echo Utility::real_size( $autoload_summary->autoload_size ); ?></strong></p>
|
||||
<p>Autoload entries: <strong><?php echo $autoload_summary->autload_entries; ?></strong></p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="field-col">
|
||||
<p>Autoload top list:</p>
|
||||
<table class="wp-list-table widefat striped litespeed-width-auto litespeed-table-compact">
|
||||
<thead><tr >
|
||||
<th scope="col">#</th>
|
||||
<th scope="col"><?php echo __('Option Name', 'litespeed-cache'); ?></th>
|
||||
<th scope="col"><?php echo __('Size', 'litespeed-cache'); ?></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ( $autoload_summary->autoload_toplist as $k => $v ) : ?>
|
||||
<tr>
|
||||
<td><?php echo $k + 1; ?></td>
|
||||
<td><?php echo $v->option_name; ?></td>
|
||||
<td><?php echo $v->option_value_length; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$this->form_action();
|
||||
?>
|
||||
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'DB Optimization Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/database/#db-optimization-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DB_OPTM_REVISIONS_MAX; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify the number of most recent revisions to keep when cleaning revisions.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_validate_ttl( $id, 1, 100, true ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DB_OPTM_REVISIONS_AGE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short' ); ?> <?php echo __( 'Day(s)', 'litespeed-cache' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Revisions newer than this many days will be kept when cleaning revisions.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_validate_ttl( $id, 1, 600, true ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
|
||||
$this->form_end();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -0,0 +1,6 @@
|
||||
<?php defined( 'WPINC' ) || exit ; ?>
|
||||
<?php
|
||||
|
||||
\LiteSpeed\ESI::cls()->load_esi_block() ;
|
||||
|
||||
|
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
// $widget, $return, $instance
|
||||
|
||||
$options = ! empty( $instance[ Base::OPTION_NAME ] ) ? $instance[ Base::OPTION_NAME ] : array() ;
|
||||
|
||||
if ( empty( $options ) ) {
|
||||
$options = array(
|
||||
ESI::WIDGET_O_ESIENABLE => Base::VAL_OFF,
|
||||
ESI::WIDGET_O_TTL => '28800'
|
||||
) ;
|
||||
|
||||
add_filter('litespeed_widget_default_options', 'LiteSpeed\ESI::widget_default_options', 10, 2) ;
|
||||
|
||||
$options = apply_filters( 'litespeed_widget_default_options', $options, $widget ) ;
|
||||
}
|
||||
|
||||
if ( empty( $options ) ) {
|
||||
$esi = Base::VAL_OFF ;
|
||||
$ttl = '28800' ;
|
||||
}
|
||||
else {
|
||||
$esi = $options[ ESI::WIDGET_O_ESIENABLE ] ;
|
||||
$ttl = $options[ ESI::WIDGET_O_TTL ] ;
|
||||
}
|
||||
|
||||
$display = Admin_Display::cls() ;
|
||||
|
||||
?>
|
||||
<div class="litespeed-widget-setting">
|
||||
|
||||
<h4>LiteSpeed Cache:</h4>
|
||||
|
||||
<b><?php echo __( 'Enable ESI', 'litespeed-cache' ) ; ?>:</b>
|
||||
|
||||
<div class="litespeed-inline">
|
||||
<div class="litespeed-switch litespeed-mini">
|
||||
<?php
|
||||
|
||||
$id = ESI::WIDGET_O_ESIENABLE ;
|
||||
$name = $widget->get_field_name( $id ) ;
|
||||
|
||||
$cache_status_list = array(
|
||||
array( Base::VAL_ON, __( 'Public', 'litespeed-cache' ) ),
|
||||
array( Base::VAL_ON2, __( 'Private', 'litespeed-cache' ) ),
|
||||
array( Base::VAL_OFF, __( 'Disable', 'litespeed-cache' ) ),
|
||||
) ;
|
||||
|
||||
foreach ( $cache_status_list as $v ) {
|
||||
list( $v, $txt ) = $v ;
|
||||
$id_attr = $widget->get_field_id( $id ) . '_' . $v ;
|
||||
$checked = $esi === $v ? 'checked' : '' ;
|
||||
echo "<input type='radio' autocomplete='off' name='$name' id='$id_attr' value='$v' $checked /> <label for='$id_attr'>$txt</label>" ;
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br /><br />
|
||||
|
||||
<b><?php echo __( 'Widget Cache TTL:', 'litespeed-cache' ) ; ?></b>
|
||||
|
||||
<?php
|
||||
$id = ESI::WIDGET_O_TTL ;
|
||||
$name = $widget->get_field_name( $id ) ;
|
||||
echo "<input type='text' class='regular-text litespeed-reset' name='$name' value='$ttl' size='7' />" ;
|
||||
?>
|
||||
<?php echo __( 'seconds', 'litespeed-cache' ) ; ?>
|
||||
|
||||
<p class="install-help">
|
||||
<?php echo __( 'Recommended value: 28800 seconds (8 hours).', 'litespeed-cache' ) ; ?>
|
||||
<?php echo __( 'A TTL of 0 indicates do not cache.', 'litespeed-cache' ) ; ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<br />
|
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$menu_list = array(
|
||||
'settings' => __( 'General Settings', 'litespeed-cache' ),
|
||||
'settings_tuning' => __( 'Tuning', 'litespeed-cache' ),
|
||||
);
|
||||
|
||||
if ( $this->_is_network_admin ) {
|
||||
$menu_list = array(
|
||||
'network_settings' => __( 'General Settings', 'litespeed-cache' ),
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="litespeed-h1">
|
||||
<?php echo __( 'LiteSpeed Cache General Settings', 'litespeed-cache' ); ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo Core::VER; ?>
|
||||
</span>
|
||||
<hr class="wp-header-end">
|
||||
</div>
|
||||
|
||||
<div class="litespeed-wrap">
|
||||
<h2 class="litespeed-header nav-tab-wrapper">
|
||||
<?php
|
||||
$i = 1;
|
||||
foreach ($menu_list as $tab => $val){
|
||||
$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
|
||||
echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
|
||||
$i ++;
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<div class="litespeed-body">
|
||||
<?php
|
||||
$this->form_action();
|
||||
|
||||
// include all tpl for faster UE
|
||||
foreach ($menu_list as $tab => $val) {
|
||||
echo "<div data-litespeed-layout='$tab'>";
|
||||
require LSCWP_DIR . "tpl/general/$tab.tpl.php";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
$this->form_end();
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'General Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/' ); ?>
|
||||
</h3>
|
||||
|
||||
<?php
|
||||
$this->form_action( Router::ACTION_SAVE_SETTINGS_NETWORK );
|
||||
?>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<?php require LSCWP_DIR . 'tpl/general/settings_inc.auto_upgrade.tpl.php'; ?>
|
||||
|
||||
<tr>
|
||||
<th><?php echo __('Use Primary Site Configuration', 'litespeed-cache'); ?></th>
|
||||
<td>
|
||||
<?php $this->build_switch( Base::NETWORK_O_USE_PRIMARY ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __("Check this option to use the primary site's configuration for all subsites.", 'litespeed-cache'); ?>
|
||||
<?php echo __('This will disable the settings page on all subsites.', 'litespeed-cache'); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php require LSCWP_DIR . 'tpl/general/settings_inc.guest.tpl.php'; ?>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
$this->form_end( true );
|
@@ -0,0 +1,228 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$__cloud = Cloud::cls();
|
||||
|
||||
// This will drop QS param `qc_res` and `domain_hash` also
|
||||
$__cloud->update_is_linked_status();
|
||||
|
||||
$cloud_summary = Cloud::get_summary();
|
||||
|
||||
$can_token = $__cloud->can_token();
|
||||
|
||||
$is_requesting = ! empty( $cloud_summary[ 'token_ts' ] ) && ( empty( $cloud_summary[ 'apikey_ts' ] ) || $cloud_summary[ 'token_ts' ] > $cloud_summary[ 'apikey_ts' ] );
|
||||
|
||||
$apply_btn_txt = __( 'Request Domain Key', 'litespeed-cache' );
|
||||
if ( $this->conf( Base::O_API_KEY ) ) {
|
||||
$apply_btn_txt = __( 'Refresh Domain Key', 'litespeed-cache' );
|
||||
if ( $is_requesting ) {
|
||||
$apply_btn_txt = __( 'Waiting for Refresh', 'litespeed-cache' );
|
||||
}
|
||||
}
|
||||
elseif ( $is_requesting ) {
|
||||
$apply_btn_txt = __( 'Waiting for Approval', 'litespeed-cache' );
|
||||
}
|
||||
|
||||
$apply_ts_txt = '';
|
||||
if ( ! empty( $cloud_summary[ 'token_ts' ] ) ) {
|
||||
$apply_ts_txt .= ' ' . __( 'Requested', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $cloud_summary[ 'token_ts' ] ) . '</code>';
|
||||
}
|
||||
if ( ! empty( $cloud_summary[ 'apikey_ts' ] ) ) {
|
||||
$apply_ts_txt .= ' ' . __( 'Approved', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $cloud_summary[ 'apikey_ts' ] ) . '</code>';
|
||||
}
|
||||
if ( ! $can_token ) {
|
||||
$next_available_req = $cloud_summary[ 'token_ts' ] + Cloud::EXPIRATION_TOKEN - time();
|
||||
$apply_ts_txt .= ' ' . sprintf( __( 'Next available request time: <code>After %s</code>', 'litespeed-cache' ), Utility::readable_time( $next_available_req, 0, true ) );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'General Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<?php if ( ! $this->_is_multisite ) : ?>
|
||||
<?php require LSCWP_DIR . 'tpl/general/settings_inc.auto_upgrade.tpl.php'; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_API_KEY; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php if ( ! $is_requesting || $can_token ) : ?>
|
||||
<?php $this->build_input( $id ); ?>
|
||||
<?php else: ?>
|
||||
<?php $this->build_input( $id, null, null, 'text', true ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $can_token ) : ?>
|
||||
<?php Doc::learn_more( Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_GEN_KEY ), $apply_btn_txt, true, 'button litespeed-btn-success' ); ?>
|
||||
<?php else: ?>
|
||||
<?php Doc::learn_more( 'javascript:;', $apply_btn_txt, true, 'button disabled' ); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ( $apply_ts_txt ) : ?>
|
||||
<span class="litespeed-desc"><?php echo $apply_ts_txt; ?></span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $cloud_summary[ 'is_linked' ] ) ) : ?>
|
||||
<?php Doc::learn_more( Cloud::CLOUD_SERVER_DASH, __( 'Visit My Dashboard on QUIC.cloud', 'litespeed-cache' ), false, 'button litespeed-btn-success litespeed-right' ); ?>
|
||||
<?php elseif ( $__cloud->can_link_qc() ) : ?>
|
||||
<?php Doc::learn_more( Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_LINK ), __( 'Link to QUIC.cloud', 'litespeed-cache' ), true, 'button litespeed-btn-warning litespeed-right' ); ?>
|
||||
<?php else: ?>
|
||||
<?php Doc::learn_more( 'javascript:;', __( 'Link to QUIC.cloud', 'litespeed-cache' ), true, 'button disabled litespeed-btn-warning litespeed-right' ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $is_requesting && $can_token ) : ?>
|
||||
<div class="litespeed-callout notice notice-error inline">
|
||||
<h4><?php echo __( 'Notice', 'litespeed-cache' ); ?>:</h4>
|
||||
<p><?php echo sprintf( __( 'There was a problem with retrieving your Domain Key. Please click the %s button to retry.', 'litespeed-cache' ), '<code>' . $apply_btn_txt . '</code>' ); ?></p>
|
||||
<p><?php echo __( 'There are two reasons why we might not be able to communicate with your domain:', 'litespeed-cache' ); ?>:</p>
|
||||
<p>1) <?php echo sprintf( __( 'The POST callback to %s failed.', 'litespeed-cache' ), '<code>' . home_url() . '/' . ( function_exists( 'rest_get_url_prefix' ) ? rest_get_url_prefix() : apply_filters( 'rest_url_prefix', 'wp-json' ) ) . '/litespeed/v1/token</code>' ); ?> </p>
|
||||
<p>2) <?php echo sprintf( __( 'Our %s was not allowlisted.', 'litespeed-cache' ), __( 'Current Online Server IPs', 'litespeed-cache' ) ); ?></p>
|
||||
<p><?php echo __( 'Please verify that your other plugins are not blocking REST API calls, allowlist our server IPs, or contact your server admin for assistance.', 'litespeed-cache' ); ?>:</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $is_requesting ) : ?>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4><?php echo __( 'Notice', 'litespeed-cache' ); ?>:</h4>
|
||||
<p><?php echo __( 'Request submitted. Please wait, then refresh the page to see approval notification.', 'litespeed-cache' ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->conf( Base::O_API_KEY ) ) : ?>
|
||||
<div class="litespeed-callout notice notice-error inline">
|
||||
<h4><?php echo __( 'Warning', 'litespeed-cache' ); ?>:</h4>
|
||||
<p><?php echo sprintf( __( 'You must have %1$s first before linking to QUIC.cloud.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_API_KEY ) . '</code>' ) . ' See <a href="https://quic.cloud/terms/">Terms</a>.'; ?></p>
|
||||
</div>
|
||||
<?php elseif ( empty( $cloud_summary[ 'is_linked' ] ) ) : ?>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4><?php echo __( 'Notice', 'litespeed-cache' ); ?>:</h4>
|
||||
<p><?php echo sprintf( __( 'You must click the %s button if you wish to associate this site with a QUIC.cloud account.', 'litespeed-cache' ), '<code>' . __( 'Link to QUIC.cloud', 'litespeed-cache' ) . '</code>' ); ?></p>
|
||||
<p><?php Doc::learn_more( 'https://www.quic.cloud/faq/#do-i-need-to-register-on-quic-cloud-to-use-the-online-services', __( 'Benefits of linking to a QUIC.cloud account', 'litespeed-cache' ) ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'A Domain Key is required for QUIC.cloud online services.', 'litespeed-cache' ); ?>
|
||||
<br /><?php Doc::notice_ips(); ?>
|
||||
<div class="litespeed-callout notice notice-success inline">
|
||||
<h4><?php echo __( 'Current Cloud Nodes in Service','litespeed-cache' ); ?>
|
||||
<a class="litespeed-right" href="<?php echo Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_CLEAR_CLOUD ); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo __( 'Click to clear all nodes for further redetection.', 'litespeed-cache' ); ?>' data-litespeed-cfm="<?php echo __( 'Are you sure you want to clear all cloud nodes?', 'litespeed-cache' ); ?>"><i class='litespeed-quic-icon'></i></a>
|
||||
</h4>
|
||||
<p>
|
||||
<?php
|
||||
$has_service = false;
|
||||
foreach ( Cloud::$SERVICES as $svc ) {
|
||||
if ( isset( $cloud_summary[ 'server.' . $svc ] ) ) {
|
||||
$has_service = true;
|
||||
echo '<p><b>Service:</b> <code>' . $svc . '</code> <b>Node:</b> <code>' . $cloud_summary[ 'server.' . $svc ] . '</code> <b>Connected Date:</b> <code>' . Utility::readable_time( $cloud_summary[ 'server_date.' . $svc ] ) . '</code></p>';
|
||||
}
|
||||
}
|
||||
if ( ! $has_service ) {
|
||||
echo __( 'No cloud services currently in use', 'litespeed-cache' );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if ( ! $this->_is_multisite ) : ?>
|
||||
<?php require LSCWP_DIR . 'tpl/general/settings_inc.guest.tpl.php'; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_GUEST_OPTM; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'This option enables maximum optimization for Guest Mode visitors.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/#guest-optimization', __( 'Please read all warnings before enabling this option.', 'litespeed-cache' ), false, 'litespeed-warning' ); ?>
|
||||
|
||||
<?php
|
||||
$typeList = array();
|
||||
if ( $this->conf( Base::O_GUEST ) && ! $this->conf( Base::O_OPTM_UCSS ) ) {
|
||||
$typeList[] = 'UCSS';
|
||||
}
|
||||
if ( $this->conf( Base::O_GUEST ) && ! $this->conf( Base::O_OPTM_CSS_ASYNC ) ) {
|
||||
$typeList[] = 'CCSS';
|
||||
}
|
||||
if ( ! empty( $typeList ) ) {
|
||||
$theType = implode( '/', $typeList );
|
||||
echo '<br />';
|
||||
echo '<font class="litespeed-info">';
|
||||
echo '⚠️ ' . sprintf( __( 'Your %1s quota on %2s will still be in use.', 'litespeed-cache' ), $theType, 'QUIC.cloud' );
|
||||
echo '</font>';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( ! $this->conf( Base::O_GUEST ) ) : ?>
|
||||
<br /><font class="litespeed-warning litespeed-left10">
|
||||
⚠️ <?php echo __( 'Notice', 'litespeed-cache' ); ?>: <?php echo sprintf( __( 'This option only works when turning %s on.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_GUEST ) . '</code>' ); ?>
|
||||
</font>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->conf( Base::O_CACHE_MOBILE ) ) : ?>
|
||||
<br /><font class="litespeed-danger litespeed-left10">
|
||||
⚠️ <?php echo __( 'Notice', 'litespeed-cache' ); ?>: <?php echo sprintf( __( 'You need to turn %s on to get maximum result.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_CACHE_MOBILE ) . '</code>' ); ?>
|
||||
</font>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->conf( Base::O_IMG_OPTM_WEBP ) ) : ?>
|
||||
<br /><font class="litespeed-danger litespeed-left10">
|
||||
⚠️ <?php echo __( 'Notice', 'litespeed-cache' ); ?>: <?php echo sprintf( __( 'You need to turn %s on and finish all WebP generation to get maximum result.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_IMG_OPTM_WEBP ) . '</code>' ); ?>
|
||||
</font>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->conf( Base::O_IMG_OPTM_WEBP_REPLACE ) ) : ?>
|
||||
<br /><font class="litespeed-danger litespeed-left10">
|
||||
⚠️ <?php echo __( 'Notice', 'litespeed-cache' ); ?>: <?php echo sprintf( __( 'You need to turn %s on to get maximum result.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_IMG_OPTM_WEBP_REPLACE ) . '</code>' ); ?>
|
||||
</font>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_SERVER_IP; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input($id); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Enter this site\'s IP address to allow cloud services directly call IP instead of domain name. This eliminates the overhead of DNS and CDN lookups.', 'litespeed-cache' ); ?>
|
||||
<br /><?php echo __('Your server IP', 'litespeed-cache'); ?>: <code id='litespeed_server_ip'>-</code> <a href="javascript:;" class="button button-link" id="litespeed_get_ip"><?php echo __('Check my public IP from', 'litespeed-cache'); ?> DoAPI.us</a>
|
||||
⚠️ <?php echo __( 'Notice', 'litespeed-cache' ); ?>: <?php echo __( 'the auto-detected IP may not be accurate if you have an additional outgoing IP set, or you have multiple IPs configured on your server.', 'litespeed-cache' ); ?>
|
||||
<br /><?php echo __( 'Please make sure this IP is the correct one for visiting your site.', 'litespeed-cache' ); ?>
|
||||
|
||||
<?php $this->_validate_ip( $id ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_NEWS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Turn this option ON to show latest news automatically, including hotfixes, new releases, available beta versions, and promotions.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<!-- build_setting_auto_upgrade -->
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_AUTO_UPGRADE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Turn this option ON to have LiteSpeed Cache updated automatically, whenever a new version is released. If OFF, update manually as usual.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$guest_update_url = parse_url( LSWCP_PLUGIN_URL . GUI::PHP_GUEST, PHP_URL_PATH );
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_GUEST; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Guest Mode provides an always cacheable landing page for an automated guest\'s first time visit, and then attempts to update cache varies via AJAX.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This option can help to correct the cache vary for certain advanced mobile or tablet visitors.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/#guest-mode' ); ?>
|
||||
<br /><?php Doc::notice_htaccess(); ?>
|
||||
<br /><?php Doc::crawler_affected(); ?>
|
||||
</div>
|
||||
<?php if ( $this->conf( $id ) ) : ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Guest Mode testing result', 'litespeed-cache' ); ?>:
|
||||
<font id='litespeed_gm_status'><?php echo __( 'Testing', 'litespeed-cache' ); ?>...</font>
|
||||
</div>
|
||||
<script>
|
||||
(function ($) {
|
||||
jQuery(document).ready(function () {
|
||||
$.post( '<?php echo $guest_update_url; ?>', function(data){
|
||||
if ( data == '[]' || $data == '{"reload":"yes"}' ) {
|
||||
$('#litespeed_gm_status').html('<font class="litespeed-success"><?php echo __( 'Guest Mode passed testing.', 'litespeed-cache' ); ?></font>');
|
||||
}
|
||||
else {
|
||||
$('#litespeed_gm_status').html('<font class="litespeed-danger"><?php echo __( 'Guest Mode failed to test.', 'litespeed-cache' ); ?></font>');
|
||||
}
|
||||
}).fail( function(){
|
||||
$('#litespeed_gm_status').html('<font class="litespeed-danger"><?php echo __( 'Guest Mode failed to test.', 'litespeed-cache' ); ?></font>');
|
||||
})
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
?>
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'Tuning Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/#tuning-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_GUEST_UAS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $id, 30 ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Listed User Agents will be considered as Guest Mode visitors.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_GUEST_IPS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $id, 50 ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Listed IPs will be considered as Guest Mode visitors.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$menu_list = array(
|
||||
'summary' => __( 'Image Optimization Summary', 'litespeed-cache' ),
|
||||
'settings' => __( 'Image Optimization Settings', 'litespeed-cache' ),
|
||||
) ;
|
||||
|
||||
|
||||
if ( $this->_is_network_admin ) {
|
||||
$menu_list = array(
|
||||
'network_settings' => __( 'Image Optimization Settings', 'litespeed-cache' ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="litespeed-h1">
|
||||
<?php echo __( 'LiteSpeed Cache Image Optimization', 'litespeed-cache' ) ; ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo Core::VER ; ?>
|
||||
</span>
|
||||
<hr class="wp-header-end">
|
||||
</div>
|
||||
|
||||
<div class="litespeed-wrap">
|
||||
<h2 class="litespeed-header nav-tab-wrapper">
|
||||
<?php
|
||||
$i = 1 ;
|
||||
foreach ($menu_list as $tab => $val){
|
||||
$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '' ;
|
||||
echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>" ;
|
||||
$i ++ ;
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<div class="litespeed-body">
|
||||
<?php
|
||||
|
||||
// include all tpl for faster UE
|
||||
foreach ($menu_list as $tab => $val) {
|
||||
echo "<div data-litespeed-layout='$tab'>" ;
|
||||
require LSCWP_DIR . "tpl/img_optm/$tab.tpl.php" ;
|
||||
echo "</div>" ;
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$this->form_action( Router::ACTION_SAVE_SETTINGS_NETWORK );
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'Image Optimization Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/imageopt/#image-optimization-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<?php require LSCWP_DIR . 'tpl/img_optm/settings.media_webp.tpl.php'; ?>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
$this->form_end( true );
|
||||
|
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_WEBP_REPLACE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Significantly improve load time by replacing images with their optimized %s versions.', 'litespeed-cache' ), '.webp' ); ?>
|
||||
<br /><?php Doc::notice_htaccess(); ?>
|
||||
<br /><?php Doc::crawler_affected(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$this->form_action();
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'Image Optimization Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/imageopt/#image-optimization-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_AUTO; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Automatically request optimization via cron job.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_CRON; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Disabling this will stop the cron job responsible for pulling optimized images back from QUIC.cloud Image Server.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_ORI; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Optimize images and save backups of the originals in the same folder.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_RM_BKUP; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Automatically remove the original image backups after fetching optimized images.', 'litespeed-cache' ); ?>
|
||||
|
||||
<br /><font class="litespeed-danger">
|
||||
🚨
|
||||
<?php echo __( 'This is irreversible.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache' ); ?>
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_LOSSLESS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Optimize images using lossless compression.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This can improve quality but may result in larger images than lossy compression will.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_EXIF; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Preserve EXIF data (copyright, GPS, comments, keywords, etc) when optimizing.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This will increase the size of optimized files.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_WEBP; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Request WebP versions of original images when doing optimization.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
if ( ! is_multisite() ) :
|
||||
// webp
|
||||
require LSCWP_DIR . 'tpl/img_optm/settings.media_webp.tpl.php';
|
||||
|
||||
endif;
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_WEBP_ATTR; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $id, 40 ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify which element attributes will be replaced with WebP.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'Only attributes listed here will be replaced.', 'litespeed-cache' ); ?>
|
||||
<br /><?php echo sprintf( __( 'Use the format %1$s or %2$s (element is optional).', 'litespeed-cache' ), '<code>element.attribute</code>', '<code>.attribute</code>' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_WEBP_REPLACE_SRCSET; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Enable replacement of WebP in %s elements that were generated outside of WordPress logic.', 'litespeed-cache' ), '<code>srcset</code>' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/imageopt/#webp-for-extra-srcset' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_IMG_OPTM_JPG_QUALITY; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('The image compression quality setting of WordPress out of 100.', 'litespeed-cache'); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 0, 100 ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
|
||||
$this->form_end();
|
||||
|
||||
|
||||
|
@@ -0,0 +1,384 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$closest_server = Cloud::get_summary( 'server.' . Cloud::SVC_IMG_OPTM );
|
||||
$usage_cloud = Cloud::get_summary( 'usage.' . Cloud::SVC_IMG_OPTM );
|
||||
$allowance = Cloud::cls()->allowance( Cloud::SVC_IMG_OPTM );
|
||||
|
||||
$__img_optm = Img_Optm::cls();
|
||||
|
||||
$wet_limit = $__img_optm->wet_limit();
|
||||
$img_count = $__img_optm->img_count();
|
||||
$need_gather = $__img_optm->need_gather();
|
||||
|
||||
$optm_summary = Img_Optm::get_summary();
|
||||
|
||||
list( $last_run, $is_running ) = $__img_optm->cron_running( false );
|
||||
|
||||
if ( ! empty( $img_count[ 'groups_all' ] ) ) {
|
||||
$gathered_percentage = 100 - floor( $img_count[ 'groups_not_gathered' ] * 100 / $img_count[ 'groups_all' ] );
|
||||
if ( $gathered_percentage == 100 && $img_count[ 'groups_not_gathered' ] ) {
|
||||
$gathered_percentage = 99;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$gathered_percentage = 0;
|
||||
}
|
||||
|
||||
if ( ! empty( $img_count[ 'imgs_gathered' ] ) ) {
|
||||
$finished_percentage = 100 - floor( $img_count[ 'img.' . Img_Optm::STATUS_RAW ] * 100 / $img_count[ 'imgs_gathered' ] );
|
||||
if ( $finished_percentage == 100 && $img_count[ 'img.' . Img_Optm::STATUS_RAW ] ) {
|
||||
$finished_percentage = 99;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$finished_percentage = 0;
|
||||
}
|
||||
|
||||
$unfinished_num = 0;
|
||||
if ( ! empty( $img_count[ 'img.' . Img_Optm::STATUS_REQUESTED ] ) ) {
|
||||
$unfinished_num += $img_count[ 'img.' . Img_Optm::STATUS_REQUESTED ];
|
||||
}
|
||||
if ( ! empty( $img_count[ 'img.' . Img_Optm::STATUS_NOTIFIED ] ) ) {
|
||||
$unfinished_num += $img_count[ 'img.' . Img_Optm::STATUS_NOTIFIED ];
|
||||
}
|
||||
if ( ! empty( $img_count[ 'img.' . Img_Optm::STATUS_ERR_FETCH ] ) ) {
|
||||
$unfinished_num += $img_count[ 'img.' . Img_Optm::STATUS_ERR_FETCH ];
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="litespeed-flex-container litespeed-column-with-boxes">
|
||||
<div class="litespeed-width-7-10 litespeed-image-optim-summary-wrapper">
|
||||
<div class="litespeed-image-optim-summary">
|
||||
|
||||
<h3>
|
||||
<?php if ( $closest_server ) : ?>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array( 'svc' => Cloud::SVC_IMG_OPTM ) ); ?>" class="litespeed-info-button" data-balloon-pos="right" data-balloon-break aria-label="<?php echo sprintf( __( 'Current closest Cloud server is %s. Click to redetect.', 'litespeed-cache' ), $closest_server ); ?>" data-litespeed-cfm="<?php echo __( 'Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache' ); ?>"><span class="litespeed-quic-icon"></span></a>
|
||||
<?php else : ?>
|
||||
<span class="litespeed-quic-icon"></span>
|
||||
<?php endif; ?>
|
||||
<?php echo __('Optimize images with our QUIC.cloud server', 'litespeed-cache' );?>
|
||||
<a href="https://docs.litespeedtech.com/lscache/lscwp/imageopt/#image-optimization-summary-tab" target="_blank" class="litespeed-right litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache'); ?></a>
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
<?php echo sprintf( __( 'You can request a maximum of %s images at once.', 'litespeed-cache' ), '<strong>' . intval( $allowance ) . '</strong>' ); ?>
|
||||
</p>
|
||||
|
||||
<?php if ( $wet_limit ) : ?>
|
||||
<p class="litespeed-desc">
|
||||
<?php echo __( 'To make sure our server can communicate with your server without any issues and everything works fine, for the few first requests the number of images allowed in a single request is limited.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'Current limit is', 'litespeed-cache' ) . ': <strong>' . $wet_limit . '</strong>'; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="litespeed-img-optim-actions">
|
||||
<a data-litespeed-onlyonce class="button button-primary"
|
||||
<?php if ( ! empty( $img_count[ 'groups_not_gathered' ] ) || ! empty( $img_count[ 'img.' . Img_Optm::STATUS_RAW ] ) ) : ?>
|
||||
href="<?php echo Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_NEW_REQ ); ?>"
|
||||
<?php else : ?>
|
||||
href='javascript:;' disabled
|
||||
<?php endif; ?>
|
||||
>
|
||||
<span class="dashicons dashicons-images-alt2"></span> <?php echo $need_gather ? __( 'Gather Image Data', 'litespeed-cache' ) : __( 'Send Optimization Request', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
|
||||
<a data-litespeed-onlyonce class="button button-secondary" data-balloon-length="large" data-balloon-pos="right" aria-label="<?php echo __( 'Only press the button if the pull cron job is disabled.', 'litespeed-cache' ); ?> <?php echo __( 'Images will be pulled automatically if the cron job is running.', 'litespeed-cache' ); ?>"
|
||||
<?php if ( ! empty( $img_count[ 'img.' . Img_Optm::STATUS_NOTIFIED ] ) && ! $is_running ) : ?>
|
||||
href="<?php echo Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_PULL ); ?>"
|
||||
<?php else : ?>
|
||||
href='javascript:;' disabled
|
||||
<?php endif; ?>
|
||||
>
|
||||
<?php echo __( 'Pull Images', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="litespeed-title-section">
|
||||
<?php echo __( 'Optimization Status', 'litespeed-cache' ); ?>
|
||||
<?php if ( ! empty( $img_count[ 'group.' . Img_Optm::STATUS_RAW ] ) ) : ?>
|
||||
<a href="https://docs.litespeedtech.com/lscache/lscwp/imageopt/#optimization-summary" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache'); ?></a>
|
||||
<?php endif; ?>
|
||||
</h3>
|
||||
|
||||
<div class="litespeed-light-code">
|
||||
|
||||
<?php if ( ! empty( $img_count[ 'group.' . Img_Optm::STATUS_REQUESTED ] ) ) : ?>
|
||||
<p class="litespeed-success">
|
||||
<?php echo Lang::img_status( Img_Optm::STATUS_REQUESTED ); ?>:
|
||||
<code>
|
||||
<?php echo Admin_Display::print_plural( $img_count[ 'group.' . Img_Optm::STATUS_REQUESTED ] ); ?>
|
||||
(<?php echo Admin_Display::print_plural( $img_count[ 'img.' . Img_Optm::STATUS_REQUESTED ], 'image' ); ?>)
|
||||
</code>
|
||||
</p>
|
||||
<p class="litespeed-desc">
|
||||
<?php echo __( 'After the QUIC.cloud Image Optimization server finishes optimization, it will notify your site to pull the optimized images.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This process is automatic.', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $img_count[ 'group.' . Img_Optm::STATUS_NOTIFIED ] ) ) : ?>
|
||||
<p class="litespeed-success">
|
||||
<?php echo Lang::img_status( Img_Optm::STATUS_NOTIFIED ); ?>:
|
||||
<code>
|
||||
<?php echo Admin_Display::print_plural( $img_count[ 'group.' . Img_Optm::STATUS_NOTIFIED ] ); ?>
|
||||
(<?php echo Admin_Display::print_plural( $img_count[ 'img.' . Img_Optm::STATUS_NOTIFIED ], 'image' ); ?>)
|
||||
</code>
|
||||
|
||||
</p>
|
||||
<?php if ( $last_run ) : ?>
|
||||
<p class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Last pull initiated by cron at %s.', 'litespeed-cache' ), '<code>' . Utility::readable_time( $last_run ) . '</code>' ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $img_count[ 'group.' . Img_Optm::STATUS_PULLED ] ) ) : ?>
|
||||
<p class="litespeed-success">
|
||||
<?php echo Lang::img_status( Img_Optm::STATUS_PULLED ); ?>:
|
||||
<code>
|
||||
<?php echo Admin_Display::print_plural( $img_count[ 'group.' . Img_Optm::STATUS_PULLED ] ); ?>
|
||||
(<?php echo Admin_Display::print_plural( $img_count[ 'img.' . Img_Optm::STATUS_PULLED ], 'image' ); ?>)
|
||||
</code>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="litespeed-silence">
|
||||
<?php
|
||||
$list = array(
|
||||
Img_Optm::STATUS_ERR_FETCH,
|
||||
Img_Optm::STATUS_ERR_404,
|
||||
Img_Optm::STATUS_ERR_OPTM,
|
||||
Img_Optm::STATUS_ERR,
|
||||
Img_Optm::STATUS_MISS,
|
||||
Img_Optm::STATUS_DUPLICATED,
|
||||
Img_Optm::STATUS_XMETA,
|
||||
);
|
||||
?>
|
||||
<?php foreach ( $list as $v ): ?>
|
||||
<?php if ( empty( $img_count[ 'group.' . $v ] ) ) continue; ?>
|
||||
<p>
|
||||
<?php echo Lang::img_status( $v ); ?>:
|
||||
<code>
|
||||
<?php echo Admin_Display::print_plural( $img_count[ 'group.' . $v ] ); ?>
|
||||
(<?php echo Admin_Display::print_plural( $img_count[ 'img.' . $v ], 'image' ); ?>)
|
||||
</code>
|
||||
</p>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<p><?php echo sprintf(
|
||||
'<a href="%1$s" class="button button-secondary" data-balloon-pos="right" aria-label="%2$s" %3$s><span class="dashicons dashicons-editor-removeformatting"></span> %4$s</a>',
|
||||
($unfinished_num ? Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_CLEAN ) : 'javascript:;'),
|
||||
__( 'Remove all previous unfinished image optimization requests.', 'litespeed-cache' ),
|
||||
($unfinished_num ? '' : ' disabled'),
|
||||
__( 'Clean Up Unfinished Data', 'litespeed-cache' ) . ( $unfinished_num ? ': ' . Admin_Display::print_plural( $unfinished_num, 'image' ) : '')
|
||||
);
|
||||
?></p>
|
||||
|
||||
<h3 class="litespeed-title-section">
|
||||
<?php echo __( 'Storage Optimization', 'litespeed-cache' ); ?>
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
<?php echo __( 'A backup of each image is saved before it is optimized.', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
|
||||
|
||||
<?php if ( ! empty( $optm_summary[ 'bk_summary' ] ) ) : ?>
|
||||
<div class="">
|
||||
<p>
|
||||
<?php echo __( 'Last calculated', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $optm_summary[ 'bk_summary' ][ 'date' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<?php if ( $optm_summary[ 'bk_summary' ][ 'count' ] ) : ?>
|
||||
<p>
|
||||
<?php echo __( 'Files', 'litespeed-cache' ) . ': <code>' . intval( $optm_summary[ 'bk_summary' ][ 'count' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Total', 'litespeed-cache' ) . ': <code>' . Utility::real_size( $optm_summary[ 'bk_summary' ][ 'sum' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div>
|
||||
|
||||
<a class="button button-secondary" data-balloon-pos="up" aria-label="<?php echo __( 'Calculate Original Image Storage', 'litespeed-cache' ); ?>"
|
||||
<?php if ( $finished_percentage > 0 ) : ?>
|
||||
href="<?php echo Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_CALC_BKUP ); ?>"
|
||||
<?php else : ?>
|
||||
href='javascript:;' disabled
|
||||
<?php endif; ?>
|
||||
>
|
||||
<span class="dashicons dashicons-update"></span> <?php echo __( 'Calculate Backups Disk Space', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4><?php echo __( 'Image Thumbnail Group Sizes', 'litespeed-cache' ); ?></h4>
|
||||
<div class="litespeed-desc litespeed-left20">
|
||||
<?php foreach ( Media::cls()->get_image_sizes() as $title => $size ) {
|
||||
echo "<div>$title ( " . ( $size[ 'width' ] ? $size[ 'width' ] . 'px' : '*' ) . ' x ' . ( $size[ 'height' ] ? $size[ 'height' ] . 'px' : '*' ) . ' )</div>';
|
||||
}; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<hr class="litespeed-hr-with-space">
|
||||
<div>
|
||||
<h4><?php echo __( 'Delete all backups of the original images', 'litespeed-cache' ); ?></h4>
|
||||
<div class="notice notice-error litespeed-callout-bg inline">
|
||||
<p>
|
||||
🚨 <?php echo __( 'This is irreversible.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php if ( ! empty( $optm_summary[ 'rmbk_summary' ] ) ) : ?>
|
||||
<div class="">
|
||||
<p>
|
||||
<?php echo __( 'Last ran', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $optm_summary[ 'rmbk_summary' ][ 'date' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Files', 'litespeed-cache' ) . ': <code>' . $optm_summary[ 'rmbk_summary' ][ 'count' ] . '</code>'; ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Saved', 'litespeed-cache' ) . ': <code>' . Utility::real_size( $optm_summary[ 'rmbk_summary' ][ 'sum' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="litespeed-image-optim-summary-footer"><a href="<?php echo Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_RM_BKUP ); ?>" data-litespeed-cfm="<?php echo __( 'Are you sure you want to remove all image backups?', 'litespeed-cache' ); ?>" class="litespeed-link-with-icon litespeed-danger">
|
||||
<span class="dashicons dashicons-trash"></span><?php echo __( 'Remove Original Image Backups', 'litespeed-cache' ); ?>
|
||||
</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-width-3-10">
|
||||
<div class="postbox litespeed-postbox litespeed-postbox-imgopt-info">
|
||||
<div class="inside">
|
||||
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Image Information', 'litespeed-cache' ); ?>
|
||||
</h3>
|
||||
|
||||
<div class="litespeed-flex-container">
|
||||
<div class="litespeed-icon-vertical-middle">
|
||||
<?php echo GUI::pie( $gathered_percentage, 70, true ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
<?php echo __( 'Images total', 'litespeed-cache'); ?>:
|
||||
|
||||
<code><?php echo Admin_Display::print_plural( $img_count[ 'groups_all' ] ); ?></code>
|
||||
|
||||
<a href="https://docs.litespeedtech.com/lscache/lscwp/imageopt/#what-is-an-image-group" target="_blank" class="litespeed-desc litespeed-help-btn-icon" data-balloon-pos="up" aria-label="<?php echo __( 'What is a group?', 'litespeed-cache'); ?>">
|
||||
<span class="dashicons dashicons-editor-help"></span>
|
||||
<span class="screen-reader-text"><?php echo __( 'What is an image group?', 'litespeed-cache' );?></span>
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<?php if ( ! empty( $img_count[ 'groups_not_gathered' ] ) ) : ?>
|
||||
<?php echo __('Images not yet gathered', 'litespeed-cache'); ?>:
|
||||
<code><?php echo Admin_Display::print_plural( $img_count[ 'groups_not_gathered' ] ); ?></code>
|
||||
<?php else : ?>
|
||||
<font class="litespeed-congratulate"><?php echo __('Congratulations, all gathered!', 'litespeed-cache'); ?></font>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-flex-container">
|
||||
<div class="litespeed-icon-vertical-middle">
|
||||
<?php echo GUI::pie( $finished_percentage, 70, true ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
<?php echo __( 'Images total', 'litespeed-cache'); ?>:
|
||||
|
||||
<code><?php echo Admin_Display::print_plural( $img_count[ 'imgs_gathered' ], 'image' ); ?></code>
|
||||
|
||||
<a href="https://docs.litespeedtech.com/lscache/lscwp/imageopt/#what-is-an-image-group" target="_blank" class="litespeed-desc litespeed-help-btn-icon" data-balloon-pos="up" aria-label="<?php echo __( 'What is a group?', 'litespeed-cache'); ?>">
|
||||
<span class="dashicons dashicons-editor-help"></span>
|
||||
<span class="screen-reader-text"><?php echo __( 'What is an image group?', 'litespeed-cache' );?></span>
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<?php if ( ! empty( $img_count[ 'img.' . Img_Optm::STATUS_RAW ] ) ) : ?>
|
||||
<?php echo __('Images not yet requested', 'litespeed-cache'); ?>:
|
||||
<code><?php echo Admin_Display::print_plural( $img_count[ 'img.' . Img_Optm::STATUS_RAW ], 'image' ); ?></code>
|
||||
<?php else : ?>
|
||||
<font class="litespeed-congratulate"><?php echo __('Congratulations, all requested!', 'litespeed-cache'); ?></font>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_RESCAN ); ?>" class="" data-balloon-pos="up" data-balloon-length="large" aria-label="<?php echo __( 'Scan for any new unoptimized image thumbnail sizes and resend necessary image optimization requests.', 'litespeed-cache' ); ?>">
|
||||
<?php echo __( 'Rescan New Thumbnails', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="postbox litespeed-postbox">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Optimization Summary', 'litespeed-cache' ); ?>
|
||||
</h3>
|
||||
<p>
|
||||
<?php echo __( 'Total Reduction', 'litespeed-cache' ); ?>: <code><?php echo isset( $optm_summary[ 'reduced' ] ) ? Utility::real_size( $optm_summary[ 'reduced' ] ) : '-'; ?></code>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Images Pulled', 'litespeed-cache' ); ?>: <code><?php echo isset( $optm_summary[ 'img_taken' ] ) ? $optm_summary[ 'img_taken' ] : '-'; ?></code>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Last Request', 'litespeed-cache' ); ?>: <code><?php echo isset( $optm_summary[ 'last_requested' ] ) ? Utility::readable_time( $optm_summary[ 'last_requested' ] ) : '-'; ?></code>
|
||||
</p>
|
||||
</div>
|
||||
<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact litespeed-desc">
|
||||
<?php echo sprintf( __( 'Results can be checked in <a %s>Media Library</a>.', 'litespeed-cache' ), 'href="upload.php?mode=list"' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="postbox litespeed-postbox">
|
||||
<div class="inside">
|
||||
<h3 class="litespeed-title"><?php echo __('Optimization Tools', 'litespeed-cache'); ?></h3>
|
||||
|
||||
<p>
|
||||
<?php echo __( 'You can quickly switch between using original (unoptimized versions) and optimized image files. It will affect all images on your website, both regular and webp versions if available.', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
|
||||
<div class="litespeed-links-group">
|
||||
<span>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_BATCH_SWITCH_ORI ); ?>" class="litespeed-link-with-icon" data-balloon-pos="up" aria-label="<?php echo __( 'Use original images (unoptimized) on your site', 'litespeed-cache' ); ?>">
|
||||
<span class="dashicons dashicons-undo"></span><?php echo __( 'Use Original Files', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</span><span>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_BATCH_SWITCH_OPTM ); ?>" class="litespeed-link-with-icon litespeed-icon-right" data-balloon-pos="up" aria-label="<?php echo __( 'Switch back to using optimized images on your site', 'litespeed-cache' ); ?>">
|
||||
<?php echo __( 'Use Optimized Files', 'litespeed-cache' ); ?><span class="dashicons dashicons-redo"></span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
|
||||
|
||||
<p><a href="<?php echo Utility::build_url( Router::ACTION_IMG_OPTM, Img_Optm::TYPE_DESTROY ); ?>" class="litespeed-link-with-icon litespeed-danger" data-litespeed-cfm="<?php echo __( 'Are you sure to destroy all optimized images?', 'litespeed-cache' ); ?>" >
|
||||
<span class="dashicons dashicons-dismiss"></span><?php echo __( 'Destroy All Optimization Data', 'litespeed-cache' ); ?>
|
||||
</a></p>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Remove all previous image optimization requests/results, revert completed optimizations, and delete all optimization files.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
// ✮✮✮✮✮
|
||||
$stars = '<span class="wporg-ratings rating-stars"><span class="dashicons dashicons-star-filled" style="color:#ffb900 !important;"></span><span class="dashicons dashicons-star-filled" style="color:#ffb900 !important;"></span><span class="dashicons dashicons-star-filled" style="color:#ffb900 !important;"></span><span class="dashicons dashicons-star-filled" style="color:#ffb900 !important;"></span><span class="dashicons dashicons-star-filled" style="color:#ffb900 !important;"></span></span>';
|
||||
$rate_us = '<a href="https://wordpress.org/support/plugin/litespeed-cache/reviews/?filter=5#new-post" rel="noopener noreferer" target="_blank">'
|
||||
. sprintf( __( 'Rate %s on %s', 'litespeed-cache' ), '<strong>' . __( 'LiteSpeed Cache', 'litespeed-cache' ) . $stars . '</strong>', 'WordPress.org' )
|
||||
. '</a>' ;
|
||||
|
||||
$wiki = '<a href="https://docs.litespeedtech.com/lscache/lscwp/overview/" target="_blank">' . __( 'Read LiteSpeed Documentation', 'litespeed-cache' ) . '</a>' ;
|
||||
|
||||
$forum = '<a href="https://wordpress.org/support/plugin/litespeed-cache" target="_blank">' . __( 'Visit LSCWP support forum', 'litespeed-cache' ) . '</a>' ;
|
||||
|
||||
$community = '<a href="https://litespeedtech.com/slack" target="_blank">' . __( 'Join LiteSpeed Slack community', 'litespeed-cache' ) . '</a>' ;
|
||||
|
||||
// Change the footer text
|
||||
if ( ! is_multisite() || is_network_admin() ) {
|
||||
$footer_text = $rate_us . ' | ' . $wiki . ' | ' . $forum . ' | ' . $community ;
|
||||
}
|
||||
else {
|
||||
$footer_text = $wiki . ' | ' . $forum . ' | ' . $community ;
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$api_key = $this->conf( Base::O_API_KEY ) ;
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( ! $api_key ) : ?>
|
||||
<p class="litespeed-desc">
|
||||
<?php echo __( 'This will also generate an API key from LiteSpeed\'s Server.', 'litespeed-cache' ) ; ?>
|
||||
</p>
|
||||
<?php endif ; ?>
|
||||
|
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$reasons = array() ;
|
||||
|
||||
if ( ! defined( 'LITESPEED_ALLOWED' ) ) {
|
||||
if ( defined( 'LITESPEED_SERVER_TYPE' ) && LITESPEED_SERVER_TYPE == 'NONE' ) {
|
||||
$reasons[] = array(
|
||||
'title' => __( 'To use the caching functions you must have a LiteSpeed web server or be using QUIC.cloud CDN.', 'litespeed-cache' ),
|
||||
'link' => 'https://docs.litespeedtech.com/lscache/lscwp/faq/#why-do-the-cache-features-require-a-litespeed-server',
|
||||
) ;
|
||||
} else {
|
||||
$reasons[] = array(
|
||||
'title' => __( 'Please enable the LSCache Module at the server level, or ask your hosting provider.', 'litespeed-cache' ),
|
||||
'link' => 'https://docs.litespeedtech.com/lscache/lscwp/overview/#prerequisites',
|
||||
) ;
|
||||
}
|
||||
}
|
||||
elseif ( ! defined( 'LITESPEED_ON' ) ) {
|
||||
$reasons[] = array(
|
||||
'title' => __( 'Please enable LiteSpeed Cache in the plugin settings.', 'litespeed-cache' ) ,
|
||||
'link' => 'https://docs.litespeedtech.com/lscache/lscwp/cache/#enable-cache',
|
||||
) ;
|
||||
}
|
||||
|
||||
if ( $reasons ) :
|
||||
?>
|
||||
<div class="litespeed-callout notice notice-error inline">
|
||||
|
||||
<h4><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?></h4>
|
||||
|
||||
<p>
|
||||
<?php echo __( 'LSCache caching functions on this page are currently unavailable!', 'litespeed-cache' ) ; ?>
|
||||
</p>
|
||||
|
||||
<ul class="litespeed-list">
|
||||
<?php foreach ( $reasons as $v ) : ?>
|
||||
<li>
|
||||
<?php echo esc_html( $v[ 'title' ] ); ?>
|
||||
|
||||
<a href="<?php echo $v[ 'link' ] ; ?>" target="_blank" class="litespeed-learn-more"><?php echo __( 'Learn More', 'litespeed-cache' ) ; ?></a>
|
||||
</li>
|
||||
<?php endforeach ; ?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<?php endif ;
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
if ( ! is_multisite() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( get_current_blog_id() === BLOG_ID_CURRENT_SITE ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! $this->network_conf( Base::NETWORK_O_USE_PRIMARY ) ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div class="litespeed-callout notice notice-error inline">
|
||||
<h4><?php echo __( 'WARNING', 'litespeed-cache' ); ?></h4>
|
||||
<p>
|
||||
<?php echo __('The network admin selected use primary site configs for all subsites.', 'litespeed-cache'); ?>
|
||||
<?php echo __('The following options are selected, but are not editable in this settings page.', 'litespeed-cache'); ?>
|
||||
</p>
|
||||
</div>
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$err = __( 'Disable All Features', 'litespeed-cache' ) ;
|
||||
|
||||
// other plugin left cache expired rules in .htaccess which will cause conflicts
|
||||
echo Admin_Display::build_notice( Admin_Display::NOTICE_RED, $err ) ;
|
||||
|
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$msg = __( 'LiteSpeed cache plugin upgraded. Please refresh the page to complete the configuration data upgrade.', 'litespeed-cache' );
|
||||
|
||||
echo self::build_notice( self::NOTICE_BLUE, $msg );
|
||||
|
@@ -0,0 +1,3 @@
|
||||
|
||||
</div>
|
||||
|
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo LSWCP_PLUGIN_URL ; ?>assets/css/litespeed.css" />
|
||||
|
||||
<div class="litespeed litespeed-modal">
|
||||
|
||||
<?php if ( $_progress ) : ?>
|
||||
<div class="litespeed-progress">
|
||||
<div class="litespeed-progress-bar" role="progressbar" style="width: <?php echo $_progress ; ?>%" aria-valuenow="<?php echo $_progress ; ?>" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<?php endif ; ?>
|
||||
|
||||
<div class="litespeed-wrap">
|
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$buf = '<h3>'. __('LiteSpeed Cache plugin is installed!', 'litespeed-cache'). '</h3>' . ' '
|
||||
. __('This message indicates that the plugin was installed by the server admin.', 'litespeed-cache') . ' '
|
||||
. __('The LiteSpeed Cache plugin is used to cache pages - a simple way to improve the performance of the site.', 'litespeed-cache') . ' '
|
||||
. __('However, there is no way of knowing all the possible customizations that were implemented.', 'litespeed-cache') . ' '
|
||||
. __('For that reason, please test the site to make sure everything still functions properly.', 'litespeed-cache')
|
||||
. '<br /><br />'
|
||||
. __('Examples of test cases include:', 'litespeed-cache')
|
||||
. '<ul>'
|
||||
. '<li>' . __('Visit the site while logged out.', 'litespeed-cache') . '</li>'
|
||||
. '<li>' . __('Create a post, make sure the front page is accurate.', 'litespeed-cache') . '</li>'
|
||||
. '</ul>'
|
||||
. sprintf(__('If there are any questions, the team is always happy to answer any questions on the <a %s>support forum</a>.', 'litespeed-cache'),
|
||||
'href="https://wordpress.org/support/plugin/litespeed-cache" rel="noopener noreferrer" target="_blank"')
|
||||
. '<br />'
|
||||
. __('If you would rather not move at litespeed, you can deactivate this plugin.', 'litespeed-cache');
|
||||
|
||||
self::add_notice(self::NOTICE_BLUE . ' lscwp-whm-notice', $buf);
|
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$err = __('NOTICE: Database login cookie did not match your login cookie.', 'litespeed-cache') . ' '
|
||||
. __('If the login cookie was recently changed in the settings, please log out and back in.', 'litespeed-cache') . ' '
|
||||
. sprintf(__('If not, please verify the setting in the <a href="%1$s">Advanced tab</a>.', 'litespeed-cache'),
|
||||
admin_url('admin.php?page=litespeed-cache#advanced'));
|
||||
|
||||
if (LITESPEED_SERVER_TYPE === 'LITESPEED_SERVER_OLS') {
|
||||
$err .= ' ' . __('If using OpenLiteSpeed, the server must be restarted once for the changes to take effect.', 'litespeed-cache');
|
||||
}
|
||||
|
||||
self::add_notice(self::NOTICE_YELLOW, $err);
|
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
|
||||
$err = sprintf( __( 'Unexpected cache rule %2$s found in %1$s file. This rule may cause visitors to see old versions of pages due to the browser caching HTML pages. If you are sure that HTML pages are not being browser cached, this message can be dismissed. (<a %3$s>Learn More</a>)', 'litespeed-cache' ),
|
||||
'.htaccess',
|
||||
'`ExpiresDefault`',
|
||||
'href="https://docs.litespeedtech.com/lscache/lscwp/troubleshoot/#browser-displays-stale-content" target="_blank"'
|
||||
);
|
||||
|
||||
// other plugin left cache expired rules in .htaccess which will cause conflicts
|
||||
echo self::build_notice( self::NOTICE_YELLOW . ' lscwp-notice-ruleconflict', $err ) ;
|
||||
|
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$menu_list = array(
|
||||
'settings_css' => __( 'CSS Settings', 'litespeed-cache' ),
|
||||
'settings_js' => __( 'JS Settings', 'litespeed-cache' ),
|
||||
'settings_html' => __( 'HTML Settings', 'litespeed-cache' ),
|
||||
'settings_media' => __( 'Media Settings', 'litespeed-cache' ),
|
||||
'settings_media_exc' => __( 'Media Excludes', 'litespeed-cache' ),
|
||||
'settings_localization' => __( 'Localization', 'litespeed-cache' ),
|
||||
'settings_tuning' => __( 'Tuning', 'litespeed-cache' ),
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="litespeed-h1">
|
||||
<?php echo __( 'LiteSpeed Cache Page Optimization', 'litespeed-cache' ) ; ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo Core::VER ; ?>
|
||||
</span>
|
||||
<hr class="wp-header-end">
|
||||
</div>
|
||||
|
||||
<div class="litespeed-wrap">
|
||||
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4><?php echo __( 'NOTICE', 'litespeed-cache' ) ; ?></h4>
|
||||
<p><?php echo __( 'Please test thoroughly when enabling any option in this list. After changing Minify/Combine settings, please do a Purge All action.', 'litespeed-cache' ) ; ?></p>
|
||||
</div>
|
||||
|
||||
<h2 class="litespeed-header nav-tab-wrapper">
|
||||
<?php
|
||||
$i = 1 ;
|
||||
foreach ($menu_list as $tab => $val){
|
||||
$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '' ;
|
||||
echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>" ;
|
||||
$i ++ ;
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<div class="litespeed-body">
|
||||
<?php
|
||||
$this->form_action() ;
|
||||
|
||||
// include all tpl for faster UE
|
||||
foreach ($menu_list as $tab => $val) {
|
||||
echo "<div data-litespeed-layout='$tab'>" ;
|
||||
require LSCWP_DIR . "tpl/page_optm/$tab.tpl.php" ;
|
||||
echo "</div>" ;
|
||||
}
|
||||
|
||||
$this->form_end() ;
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
@@ -0,0 +1,275 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
// CSS::cls()->test_url( '' );
|
||||
// exit;
|
||||
|
||||
$css_summary = CSS::get_summary();
|
||||
$closest_server = Cloud::get_summary( 'server.' . Cloud::SVC_CCSS );
|
||||
|
||||
$ccss_queue = $this->load_queue( 'ccss' );
|
||||
$ucss_queue = $this->load_queue( 'ucss' );
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'CSS Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_CSS_MIN; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Minify CSS files and inline CSS code.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_CSS_COMB; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Combine CSS files and inline CSS code.', 'litespeed-cache' ); ?>
|
||||
<a href="https://docs.litespeedtech.com/lscache/lscwp/ts-optimize/" target="_blank"><?php echo __( 'How to Fix Problems Caused by CSS/JS Optimization.', 'litespeed-cache' ); ?></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_OPTM_UCSS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php if ( ! $this->conf( Base::O_API_KEY ) ) : ?>
|
||||
<div class="litespeed-callout notice notice-error inline">
|
||||
<h4><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?></h4>
|
||||
<?php echo Error::msg( 'lack_of_api_key' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo __( 'Use QUIC.cloud online service to generate unique CSS.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This will drop the unused CSS on each page from the combined file.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#generate-ucss' ); ?>
|
||||
<br /><?php echo __( 'Automatic generation of unique CSS is in the background via a cron-based queue.', 'litespeed-cache' ); ?>
|
||||
<br /><font class="litespeed-success">API: <?php echo sprintf( __( 'Filter %s available for UCSS per page type generation.', 'litespeed-cache' ), "<code>add_filter( 'litespeed_ucss_per_pagetype', '__return_true' );</code>" ); ?></font>
|
||||
|
||||
<?php if ( $this->conf( Base::O_OPTM_UCSS ) && ! $this->conf( Base::O_OPTM_CSS_COMB ) ) : ?>
|
||||
<br /><font class="litespeed-warning">
|
||||
<?php echo sprintf( __( 'This option is bypassed because %1$s option is %2$s.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_OPTM_CSS_COMB ) . '</code>', '<code>' . __( 'OFF', 'litespeed-cache' ) . '</code>' ); ?>
|
||||
</font>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc litespeed-left20">
|
||||
<?php if ( $css_summary ) : ?>
|
||||
<?php if ( ! empty( $css_summary[ 'last_request_ucss' ] ) ) : ?>
|
||||
<p>
|
||||
<?php echo __( 'Last generated', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $css_summary[ 'last_request_ucss' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Last requested cost', 'litespeed-cache' ) . ': <code>' . $css_summary[ 'last_spent_ucss' ] . 's</code>'; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $closest_server ) : ?>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array( 'svc' => Cloud::SVC_CCSS ) ); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo sprintf( __( 'Current closest Cloud server is %s. Click to redetect.', 'litespeed-cache' ), $closest_server ); ?>' data-litespeed-cfm="<?php echo __( 'Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache' ) ; ?>"><i class='litespeed-quic-icon'></i></a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $ucss_queue ) ) : ?>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4>
|
||||
<?php echo sprintf( __( 'URL list in %s queue waiting for cron', 'litespeed-cache' ), 'UCSS' ); ?> ( <?php echo count( $ucss_queue ); ?> )
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CSS, CSS::TYPE_CLEAR_Q_UCSS ); ?>" class="button litespeed-btn-warning litespeed-right">Clear</a>
|
||||
</h4>
|
||||
<p>
|
||||
<?php $i=0; foreach ( $ucss_queue as $k => $v ) : ?>
|
||||
<?php if ( $i++ > 20 ) : ?>
|
||||
<?php echo '...'; ?>
|
||||
<?php break; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ( ! is_array( $v ) ) continue; ?>
|
||||
<?php if ( ! empty( $v[ '_status' ] ) ) : ?><span class="litespeed-success"><?php endif; ?>
|
||||
<?php echo esc_html( $v[ 'url' ] ); ?>
|
||||
<?php if ( ! empty( $v[ '_status' ] ) ) : ?></span><?php endif; ?>
|
||||
<?php if ( $pos = strpos( $k, ' ' ) ) echo ' (' . __( 'Vary Group', 'litespeed-cache' ) . ':' . substr( $k, 0, $pos ) . ')'; ?>
|
||||
<?php if ( $v[ 'is_mobile' ] ) echo ' <span data-balloon-pos="up" aria-label="mobile">📱</span>'; ?>
|
||||
<?php if ( ! empty( $v[ 'is_webp' ] ) ) echo ' WebP'; ?>
|
||||
<br />
|
||||
<?php endforeach; ?>
|
||||
</p>
|
||||
</div>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CSS, CSS::TYPE_GEN_UCSS ); ?>" class="button litespeed-btn-success">
|
||||
<?php echo sprintf( __( 'Run %s Queue Manually', 'litespeed-cache' ), 'UCSS' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_OPTM_UCSS_INLINE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Inline UCSS to reduce the extra CSS file loading. This option will not be automatically turned on for %1$s pages. To use it on %1$s pages, please set it to ON.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_GUEST ) . '</code>' ); ?>
|
||||
<br /><font class="litespeed-info">
|
||||
<?php echo sprintf( __( 'This option will automatically bypass %s option.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_OPTM_CSS_ASYNC ) . '</code>' ); ?>
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_CSS_COMB_EXT_INL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Include external CSS and inline CSS in combined file when %1$s is also enabled. This option helps maintain the priorities of CSS, which should minimize potential errors caused by CSS Combine.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_OPTM_CSS_COMB ) . '</code>' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_CSS_ASYNC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php if ( ! $this->conf( Base::O_API_KEY ) ) : ?>
|
||||
<div class="litespeed-callout notice notice-error inline">
|
||||
<h4><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?></h4>
|
||||
<?php echo Error::msg( 'lack_of_api_key' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo __( 'Optimize CSS delivery.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ); ?><br />
|
||||
<?php echo __( 'Use QUIC.cloud online service to generate critical CSS and load remaining CSS asynchronously.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-css-asynchronously' ); ?><br />
|
||||
<?php echo __( 'Automatic generation of critical CSS is in the background via a cron-based queue.', 'litespeed-cache' ); ?><br />
|
||||
<?php echo sprintf( __( 'When this option is turned %s, it will also load Google Fonts asynchronously.', 'litespeed-cache' ), '<code>' . __( 'ON', 'litespeed-cache' ) . '</code>' ); ?>
|
||||
<br /><font class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'Elements with attribute %s in HTML code will be excluded.', 'litespeed-cache' ), '<code>data-no-async="1"</code>' ); ?>
|
||||
</font>
|
||||
|
||||
<?php if ( $this->conf( Base::O_OPTM_CSS_ASYNC ) && $this->conf( Base::O_OPTM_CSS_COMB ) && $this->conf( Base::O_OPTM_UCSS ) && $this->conf( Base::O_OPTM_UCSS_INLINE ) ) : ?>
|
||||
<br /><font class="litespeed-warning">
|
||||
<?php echo sprintf( __( 'This option is bypassed due to %s option.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_OPTM_UCSS_INLINE ) . '</code>' ); ?>
|
||||
</font>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc litespeed-left20">
|
||||
<?php if ( $css_summary ) : ?>
|
||||
<?php if ( ! empty( $css_summary[ 'last_request_ccss' ] ) ) : ?>
|
||||
<p>
|
||||
<?php echo __( 'Last generated', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $css_summary[ 'last_request_ccss' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo __( 'Last requested cost', 'litespeed-cache' ) . ': <code>' . $css_summary[ 'last_spent_ccss' ] . 's</code>'; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $closest_server ) : ?>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array( 'svc' => Cloud::SVC_CCSS ) ); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo sprintf( __( 'Current closest Cloud server is %s. Click to redetect.', 'litespeed-cache' ), $closest_server ); ?>' data-litespeed-cfm="<?php echo __( 'Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache' ) ; ?>"><i class='litespeed-quic-icon'></i></a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $ccss_queue ) ) : ?>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4>
|
||||
<?php echo sprintf( __( 'URL list in %s queue waiting for cron', 'litespeed-cache' ), 'CCSS' ); ?> ( <?php echo count( $ccss_queue ); ?> )
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CSS, CSS::TYPE_CLEAR_Q_CCSS ); ?>" class="button litespeed-btn-warning litespeed-right">Clear</a>
|
||||
</h4>
|
||||
<p>
|
||||
<?php $i=0; foreach ( $ccss_queue as $k => $v ) : ?>
|
||||
<?php if ( $i++ > 20 ) : ?>
|
||||
<?php echo '...'; ?>
|
||||
<?php break; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ( ! is_array( $v ) ) continue; ?>
|
||||
<?php if ( ! empty( $v[ '_status' ] ) ) : ?><span class="litespeed-success"><?php endif; ?>
|
||||
<?php echo esc_html( $v[ 'url' ] ); ?>
|
||||
<?php if ( ! empty( $v[ '_status' ] ) ) : ?></span><?php endif; ?>
|
||||
<?php if ( $pos = strpos( $k, ' ' ) ) echo ' (' . __( 'Vary Group', 'litespeed-cache' ) . ':' . substr( $k, 0, $pos ) . ')'; ?>
|
||||
<?php if ( $v[ 'is_mobile' ] ) echo ' <span data-balloon-pos="up" aria-label="mobile">📱</span>'; ?>
|
||||
<?php if ( ! empty( $v[ 'is_webp' ] ) ) echo ' WebP'; ?>
|
||||
<br />
|
||||
<?php endforeach; ?>
|
||||
</p>
|
||||
</div>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CSS, CSS::TYPE_GEN_CCSS ); ?>" class="button litespeed-btn-success">
|
||||
<?php echo sprintf( __( 'Run %s Queue Manually', 'litespeed-cache' ), 'CCSS' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_OPTM_CCSS_PER_URL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Disable this option to generate CCSS per Post Type instead of per page. This can save significant CCSS quota, however it may result in incorrect CSS styling if your site uses a page builder.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_OPTM_CSS_ASYNC_INLINE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'This will inline the asynchronous CSS library to avoid render blocking.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_CSS_FONT_DISPLAY; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id, array( __( 'Default', 'litespeed-cache' ), 'Swap' ) ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Set this to append %1$s to all %2$s rules before caching CSS to specify how fonts should be displayed while being downloaded.', 'litespeed-cache' ), '<code>font-display</code>', '<code>@font-face</code>' ); ?>
|
||||
<br /><?php echo sprintf( __( '%s is recommended.', 'litespeed-cache' ), '<code>' . __( 'Swap', 'litespeed-cache' ) . '</code>' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'HTML Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#html-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_HTML_MIN; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Minify HTML content.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_DNS_PREFETCH; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Prefetching DNS can reduce latency for visitors.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'For example', 'litespeed-cache' ); ?>: <code>//www.example.com</code>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#dns-prefetch' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_DNS_PREFETCH_CTRL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Automatically enable DNS prefetching for all URLs in the document, including images, CSS, JavaScript, and so forth.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This can improve the page loading speed.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_HTML_LAZY; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Delay rendering off-screen HTML elements by its selector.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#html-lazyload-selectors' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_QS_RM; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Remove query strings from internal static resources.', 'litespeed-cache' ); ?>
|
||||
<br /><font class="litespeed-warning">
|
||||
⚠️
|
||||
<?php echo __( 'Google reCAPTCHA will be bypassed automatically.', 'litespeed-cache' ); ?>
|
||||
</font>
|
||||
<br /><font class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'Append query string %s to the resources to bypass this action.', 'litespeed-cache' ), '<code>&_litespeed_rm_qs=0</code>' ); ?>
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_GGFONTS_ASYNC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Use Web Font Loader library to load Google Fonts asynchronously while leaving other CSS intact.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This will also add a preconnect to Google Fonts to establish a connection earlier.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-google-fonts-asynchronously' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_GGFONTS_RM; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Prevent Google Fonts from loading on all pages.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_EMOJI_RM; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Stop loading WordPress.org emoji. Browser default emoji will be displayed instead.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_NOSCRIPT_RM; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'This option will remove all %s tags from HTML.', 'litespeed-cache' ), '<code><noscript></code>' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#remove-noscript-tags' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'JS Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#js-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_JS_MIN; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Minify JS files and inline JS codes.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_JS_COMB; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Combine all local JS files into a single file.', 'litespeed-cache' ); ?>
|
||||
<a href="https://docs.litespeedtech.com/lscache/lscwp/ts-optimize/" target="_blank"><?php echo __( 'How to Fix Problems Caused by CSS/JS Optimization.', 'litespeed-cache' ); ?></a>
|
||||
<br /><font class="litespeed-danger">
|
||||
🚨 <?php echo __( 'This option may result in a JS error or layout issue on frontend pages with certain themes/plugins.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'JS error can be found from the developer console of browser by right clicking and choosing Inspect.', 'litespeed-cache' ); ?>
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_JS_COMB_EXT_INL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Include external JS and inline JS in combined file when %1$s is also enabled. This option helps maintain the priorities of JS execution, which should minimize potential errors caused by JS Combine.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_OPTM_JS_COMB ) . '</code>' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_JS_DEFER; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id, array( __( 'OFF', 'litespeed-cache' ), __( 'Deferred', 'litespeed-cache' ), __( 'Delayed', 'litespeed-cache' ) ) ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Deferring until page is parsed or delaying till interaction can help reduce resource contention and improve performance causing a lower FID (Core Web Vitals metric).', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#load-js-deferred' ); ?><br />
|
||||
<?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://web.dev/fid/#what-is-fid' ); ?>
|
||||
<br /><font class="litespeed-danger">
|
||||
🚨 <?php echo __( 'This option may result in a JS error or layout issue on frontend pages with certain themes/plugins.', 'litespeed-cache' ); ?>
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$last_generated = Avatar::get_summary();
|
||||
$avatar_queue = Avatar::cls()->queue_count();
|
||||
?>
|
||||
|
||||
<?php if ( $this->cls( 'Avatar' )->need_db() && ! $this->cls( 'Data' )->tb_exist( 'avatar' ) ) : ?>
|
||||
<div class="litespeed-callout notice notice-error inline">
|
||||
<h4><?php echo __( 'WARNING', 'litespeed-cache' ); ?></h4>
|
||||
<p><?php echo sprintf( __( 'Failed to create Avatar table. Please follow <a %s>Table Creation guidance from LiteSpeed Wiki</a> to finish setup.', 'litespeed-cache' ), 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:installation" target="_blank"' ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'Localization Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#localization-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DISCUSS_AVATAR_CACHE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Store Gravatar locally.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'Accelerates the speed by caching Gravatar (Globally Recognized Avatars).', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_DISCUSS_AVATAR_CRON; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Refresh Gravatar cache by cron.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $last_generated ) : ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php if ( ! empty( $last_generated[ 'last_request' ] ) ) : ?>
|
||||
<p>
|
||||
<?php echo __( 'Last ran', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $last_generated[ 'last_request' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php if ( $avatar_queue ) : ?>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4>
|
||||
<?php echo __( 'Avatar list in queue waiting for update','litespeed-cache' ); ?>:
|
||||
<?php echo $avatar_queue; ?>
|
||||
</h4>
|
||||
</div>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_AVATAR, Avatar::TYPE_GENERATE ); ?>" class="button litespeed-btn-success">
|
||||
<?php echo __( 'Run Queue Manually', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_DISCUSS_AVATAR_CACHE_TTL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id ); ?> <?php $this->readable_seconds(); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify how long, in seconds, Gravatar files are cached.', 'litespeed-cache' ); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 3600 ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_LOCALIZE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Localize external resources.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#localize' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="litespeed-padding-left">
|
||||
<?php $id = Base::O_OPTM_LOCALIZE_DOMAINS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $id, true ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Resources listed here will be copied and replaced with local URLs.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'HTTPS sources only.', 'litespeed-cache' ); ?>
|
||||
|
||||
<?php Doc::one_per_line(); ?>
|
||||
|
||||
<br /><?php echo sprintf( __( 'Comments are supported. Start a line with a %s to turn it into a comment line.', 'litespeed-cache' ), '<code>#</code>' ); ?>
|
||||
|
||||
<br /><?php echo __( 'Non-`.js` file extensions will be ignored.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'Example', 'litespeed-cache' ); ?>: <code>https://www.example.com/one.js</code>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#localization-files' ); ?>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
@@ -0,0 +1,234 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$placeholder_summary = Placeholder::get_summary();
|
||||
|
||||
$closest_server = Cloud::get_summary( 'server.' . Cloud::SVC_LQIP );
|
||||
|
||||
$lqip_queue = $this->load_queue( 'lqip' );
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'Media Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#media-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_LAZY; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Load images only when they enter the viewport.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This can improve page loading time by reducing initial HTTP requests.', 'litespeed-cache' ); ?>
|
||||
<br /><font class="litespeed-success">
|
||||
💡
|
||||
<a href="https://docs.litespeedtech.com/lscache/lscwp/pageopt/#lazy-load-images" target="_blank"><?php echo __('Adding Style to Your Lazy-Loaded Images', 'litespeed-cache'); ?></a>
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_LAZY_PLACEHOLDER; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-long' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify a base64 image to be used as a simple placeholder while images finish loading.', 'litespeed-cache' ); ?>
|
||||
<br /><?php echo sprintf( __( 'This can be predefined in %2$s as well using constant %1$s, with this setting taking priority.', 'litespeed-cache' ), '<code>LITESPEED_PLACEHOLDER</code>', '<code>wp-config.php</code>' ); ?>
|
||||
<br /><?php echo sprintf( __( 'By default a gray image placeholder %s will be used.', 'litespeed-cache' ), '<code>data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=</code>' ); ?>
|
||||
<br /><?php echo sprintf( __( 'For example, %s can be used for a transparent placeholder.', 'litespeed-cache' ), '<code>data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7</code>' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_PLACEHOLDER_RESP; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Responsive image placeholders can help to reduce layout reshuffle when images are loaded.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This will generate the placeholder with same dimensions as the image if it has the width and height attributes.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_PLACEHOLDER_RESP_SVG; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-long' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify an SVG to be used as a placeholder when generating locally.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'It will be converted to a base64 SVG placeholder on-the-fly.', 'litespeed-cache' ); ?>
|
||||
<br /><?php echo sprintf( __( 'Variables %s will be replaced with the corresponding image properties.', 'litespeed-cache' ), '<code>{width} {height}</code>' ); ?>
|
||||
<br /><?php echo sprintf( __( 'Variables %s will be replaced with the configured background color.', 'litespeed-cache' ), '<code>{color}</code>' ); ?>
|
||||
<br /><?php $this->recommended( $id ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_PLACEHOLDER_RESP_COLOR; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, null, null, 'color' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify the responsive placeholder SVG color.', 'litespeed-cache' ); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_LQIP; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Use QUIC.cloud LQIP (Low Quality Image Placeholder) generator service for responsive image previews while loading.', 'litespeed-cache' ); ?>
|
||||
<br /><?php echo __( 'Keep this off to use plain color placeholders.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#lqip-cloud-generator' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_LQIP_QUAL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify the quality when generating LQIP.', 'litespeed-cache' ); ?>
|
||||
<br /><?php echo __( 'Larger number will generate higher resolution quality placeholder, but will result in larger files which will increase page size and consume more points.', 'litespeed-cache' ); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 1, 20 ); ?>
|
||||
<br />💡 <?php echo sprintf(__('Changes to this setting do not apply to already-generated LQIPs. To regenerate existing LQIPs, please %s first from the admin bar menu.', 'litespeed-cache'), '<code>' . __( 'Purge All', 'litespeed-cache' ) . ' - ' . __( 'LQIP Cache', 'litespeed-cache' ) . '</code>'); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_LQIP_MIN_W; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short' ); ?> x
|
||||
<?php $this->build_input( Base::O_MEDIA_LQIP_MIN_H, 'litespeed-input-short' ); ?>
|
||||
<?php echo __( 'pixels', 'litespeed-cache' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'LQIP requests will not be sent for images where both width and height are smaller than these dimensions.', 'litespeed-cache' ); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 10, 800 ); ?>
|
||||
<?php $this->_validate_ttl( Base::O_MEDIA_LQIP_MIN_H, 10, 800 ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_PLACEHOLDER_RESP_ASYNC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Automatically generate LQIP in the background via a cron-based queue.', 'litespeed-cache' ); ?>
|
||||
<?php echo sprintf(
|
||||
__( 'If set to %1$s, before the placeholder is localized, the %2$s configuration will be used.', 'litespeed-cache' ),
|
||||
'<code>' . __('ON', 'litespeed-cache') . '</code>',
|
||||
'<code>' . Lang::title( Base::O_MEDIA_PLACEHOLDER_RESP_SVG ) . '</code>'
|
||||
); ?>
|
||||
<?php echo sprintf( __( 'If set to %s this is done in the foreground, which may slow down page load.', 'litespeed-cache' ), '<code>' . __('OFF', 'litespeed-cache') . '</code>' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#generate-lqip-in-background' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php if ( $placeholder_summary ) : ?>
|
||||
<?php if ( ! empty( $placeholder_summary[ 'last_request' ] ) ) : ?>
|
||||
<p>
|
||||
<?php echo __( 'Last generated', 'litespeed-cache' ) . ': <code>' . Utility::readable_time( $placeholder_summary[ 'last_request' ] ) . '</code>'; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $closest_server ) : ?>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_CLOUD, Cloud::TYPE_REDETECT_CLOUD, false, null, array( 'svc' => Cloud::SVC_LQIP ) ); ?>" data-balloon-pos="up" data-balloon-break aria-label='<?php echo sprintf( __( 'Current closest Cloud server is %s. Click to redetect.', 'litespeed-cache' ), $closest_server ); ?>' data-litespeed-cfm="<?php echo __( 'Are you sure you want to redetect the closest cloud server for this service?', 'litespeed-cache' ) ; ?>"><i class='litespeed-quic-icon'></i></a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! empty( $lqip_queue ) ) : ?>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4>
|
||||
<?php echo __( 'Size list in queue waiting for cron','litespeed-cache' ); ?> ( <?php echo count( $lqip_queue ); ?> )
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_PLACEHOLDER, Placeholder::TYPE_CLEAR_Q ); ?>" class="button litespeed-btn-warning litespeed-right">Clear</a>
|
||||
</h4>
|
||||
<p>
|
||||
<?php $i=0; foreach ( $lqip_queue as $k => $v ) : ?>
|
||||
<?php if ( $i++ > 20 ) : ?>
|
||||
<?php echo '...'; ?>
|
||||
<?php break; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo $v; ?>
|
||||
<br />
|
||||
<?php endforeach; ?>
|
||||
</p>
|
||||
</div>
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_PLACEHOLDER, Placeholder::TYPE_GENERATE ); ?>" class="button litespeed-btn-success">
|
||||
<?php echo __( 'Run Queue Manually', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_IFRAME_LAZY; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Load iframes only when they enter the viewport.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'This can improve page loading time by reducing initial HTTP requests.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_ADD_MISSING_SIZES; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Set an explicit width and height on image elements to reduce layout shifts and improve CLS (a Core Web Vitals metric).', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://web.dev/optimize-cls/#images-without-dimensions' ); ?>
|
||||
<br /><?php echo sprintf( __( 'Note: this option only works when %1$s is %2$s.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_MEDIA_LAZY ) . '</code>', '<code>' . __( 'ON', 'litespeed-cache' ) . '</code>' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'Media Excludes', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#media-excludes-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_LAZY_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Listed images will not be lazy loaded.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::full_or_partial_url(); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
<br /><?php echo __( 'Useful for above-the-fold images causing CLS (a Core Web Vitals metric).', 'litespeed-cache' ); ?>
|
||||
<br /><font class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_media_lazy_img_excludes</code>' ); ?>
|
||||
<?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-lazy="1"</code>' ); ?>
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_LAZY_CLS_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="litespeed-textarea-recommended">
|
||||
<div>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Images containing these class names will not be lazy loaded.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::full_or_partial_url( true ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_LAZY_PARENT_CLS_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Images having these parent class names will not be lazy loaded.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_IFRAME_LAZY_CLS_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Iframes containing these class names will not be lazy loaded.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::full_or_partial_url( true ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_IFRAME_LAZY_PARENT_CLS_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Iframes having these parent class names will not be lazy loaded.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_LAZY_URI_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Prevent any lazy load of listed pages.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_uri_usage_example(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MEDIA_LQIP_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'These images will not generate LQIP.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::full_or_partial_url(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
@@ -0,0 +1,239 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
global $wp_roles;
|
||||
if ( !isset( $wp_roles ) ) {
|
||||
$wp_roles = new \WP_Roles();
|
||||
}
|
||||
|
||||
$roles = array();
|
||||
foreach ( $wp_roles->roles as $k => $v ) {
|
||||
$roles[ $k ] = $v[ 'name' ];
|
||||
}
|
||||
ksort( $roles );
|
||||
|
||||
?>
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( 'Tuning Settings', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#tuning-settings-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_CSS_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Listed CSS files or inline CSS code will not be minified/combined.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::full_or_partial_url(); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
<br /><font class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_optimize_css_excludes</code>' ); ?>
|
||||
<?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-optimize="1"</code>' ); ?>
|
||||
<br /><?php echo __( 'Predefined list will also be combined w/ the above settings', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/css_excludes.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/css_excludes.txt</a>
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_JS_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Listed JS files or inline JS code will not be minified/combined.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::full_or_partial_url(); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
<br /><font class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_optimize_js_excludes</code>' ); ?>
|
||||
<?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-optimize="1"</code>' ); ?>
|
||||
<br /><?php echo __( 'Predefined list will also be combined w/ the above settings', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/js_excludes.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/js_excludes.txt</a>
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_UCSS_WHITELIST; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'List the CSS selector that its style should be always contained in UCSS.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#ucss-whitelist', __( 'How to choose an UCSS allowlist selector?', 'litespeed-cache' ) ); ?>
|
||||
<br /><?php echo sprintf( __( 'Wildcard %s supported.', 'litespeed-cache' ), '<code>*</code>' ); ?>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4><?php echo __( 'Note', 'litespeed-cache' ); ?></h4>
|
||||
<p>
|
||||
<?php echo __( 'The selector must exist in the CSS. Parent classes in the HTML will not work.', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<font class="litespeed-success">
|
||||
<?php echo __( 'Predefined list will also be combined w/ the above settings', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/ucss_whitelist.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/ucss_whitelist.txt</a>
|
||||
</font>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_UCSS_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Listed URI will not generate UCSS.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::full_or_partial_url(); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
<br /><span class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_ucss_exc</code>' ); ?>
|
||||
</span>
|
||||
<br /><font class="litespeed-success">API: <?php echo sprintf( __( 'Use %1$s to generate one single UCSS for the pages which page type is %2$s while other page types still per URL.', 'litespeed-cache' ), "<code>add_filter( 'litespeed_ucss_per_pagetype', function(){return get_post_type() == 'page';} );</code>", '<code>page</code>' ); ?></font>
|
||||
<br /><font class="litespeed-success">API: <?php echo sprintf( __( 'Use %1$s to bypass UCSS for the pages which page type is %2$s.', 'litespeed-cache' ), "<code>add_action( 'litespeed_optm', function(){get_post_type() == 'page' && do_action( 'litespeed_conf_force', 'optm-ucss', false );});</code>", '<code>page</code>' ); ?></font>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_CCSS_SEP_POSTTYPE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __('List post types where each item of that type should have its own CCSS generated.', 'litespeed-cache'); ?>
|
||||
<?php echo sprintf( __( 'For example, if every Page on the site has different formatting, enter %s in the box. Separate critical CSS files will be stored for every Page on the site.', 'litespeed-cache' ), '<code>page</code>' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#separate-ccss-cache-post-types_1' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_CCSS_SEP_URI; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Separate critical CSS files will be generated for paths containing these strings.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_uri_usage_example(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_CCSS_CON; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Specify critical CSS rules for above-the-fold content when enabling %s.', 'litespeed-cache' ), __( 'Load CSS Asynchronously', 'litespeed-cache' ) ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_JS_DEFER_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Listed JS files or inline JS code will not be deferred.', 'litespeed-cache' ); ?>
|
||||
<?php Doc::full_or_partial_url(); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
<br /><span class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_optm_js_defer_exc</code>' ); ?>
|
||||
<?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-defer="1"</code>' ); ?>
|
||||
<br /><?php echo __( 'Predefined list will also be combined w/ the above settings', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/js_defer_excludes.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/js_defer_excludes.txt</a>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_GM_JS_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Listed JS files or inline JS code will not be optimized by %s.', 'litespeed-cache' ), '<code>' . Lang::title( Base::O_GUEST ) . '</code>' ); ?>
|
||||
<?php Doc::full_or_partial_url(); ?>
|
||||
<?php Doc::one_per_line(); ?>
|
||||
<br /><span class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'Filter %s is supported.', 'litespeed-cache' ), '<code>litespeed_optm_gm_js_exc</code>' ); ?>
|
||||
<?php echo sprintf( __( 'Elements with attribute %s in html code will be excluded.', 'litespeed-cache' ), '<code>data-no-defer="1"</code>' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Prevent any optimization of listed pages.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_uri_usage_example(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_GUEST_ONLY; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Only optimize pages for guest (not logged in) visitors. If turned this OFF, CSS/JS/CCSS files will be doubled by each user group.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_OPTM_EXC_ROLES; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Selected roles will be excluded from all optimizations.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
<div class="litespeed-tick-list">
|
||||
<?php foreach ( $roles as $role => $title ): ?>
|
||||
<?php $this->build_checkbox( $id . '[]', $title, $this->cls( 'Conf' )->in_optm_exc_roles( $role ), $role ); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
// Existing public version list
|
||||
$v_list = array(
|
||||
'4.4.7',
|
||||
'4.4.5',
|
||||
'4.4.4',
|
||||
'4.4.3',
|
||||
'4.4.2',
|
||||
'4.4.1',
|
||||
'4.3',
|
||||
'4.2',
|
||||
'4.1',
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->form_action( Router::ACTION_DEBUG2, Debug2::TYPE_BETA_TEST ); ?>
|
||||
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __( 'Try GitHub Version', 'litespeed-cache' ); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#beta-test-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<div class="litespeed-desc"><?php echo __( '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 echo __( 'Example', 'litespeed-cache' ); ?>: <code>https://github.com/litespeedtech/lscache_wp/commit/e9cb446dfb66d133264d3ebec0535aaed5c932c0</code></div>
|
||||
|
||||
<input type="text" name="<?php echo Debug2::BETA_TEST_URL; ?>" class="litespeed-input-long" id='litespeed-beta-test'>
|
||||
|
||||
<p><a href="javascript:;" class="button litespeed-btn-success" onclick="document.getElementById('litespeed-beta-test').value='dev';"><?php echo __( '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 echo __( '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 echo __( 'Use latest WordPress release version', 'litespeed-cache' ); ?></a> <code><?php echo Debug2::BETA_TEST_URL_WP; ?></code> <?php echo __( 'OR', 'litespeed-cache' ) ?> <code>latest</code></p>
|
||||
|
||||
<p>
|
||||
<?php foreach ( $v_list as $v ) : ?>
|
||||
|
||||
<a href="javascript:;" class="button litespeed-btn-success" onclick="document.getElementById('litespeed-beta-test').value='<?php echo $v; ?>';"><?php echo $v; ?></a>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<a href="javascript:;" class="button litespeed-btn-danger" onclick="document.getElementById('litespeed-beta-test').value='3.6.4';">3.6.4</a>
|
||||
<span class="litespeed-danger">
|
||||
🚨 <?php echo __( 'Downgrade not recommended. May cause fatal error due to refactored code.', 'litespeed-cache' ); ?>
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<div class="litespeed-desc"><?php echo sprintf( __( 'Press the %s button to use the most recent GitHub commit. Master is for release candidate & Dev is for experimental testing.', 'litespeed-cache' ), '<code>' . __( 'Use latest GitHub Dev/Master commit', 'litespeed-cache' ) . '</code>' ); ?></div>
|
||||
<div class="litespeed-desc"><?php echo sprintf( __( 'Press the %s button to stop beta testing and go back to the current release from the WordPress Plugin Directory.', 'litespeed-cache' ), '<code>' . __( 'Use latest WordPress release version', 'litespeed-cache' ) . '</code>' ); ?></div>
|
||||
|
||||
|
||||
|
||||
<p class="litespeed-danger">
|
||||
🚨 <?php echo sprintf( __( '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 echo __('Upgrade', 'litespeed-cache'); ?></button>
|
||||
</form>
|
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$content = null;
|
||||
try {
|
||||
$content = Htaccess::cls()->htaccess_read();
|
||||
} catch( \Exception $e ) {
|
||||
echo '<div class="notice notice-error is-dismissible"><p>'. $e->getMessage() . '</p></div>';
|
||||
}
|
||||
|
||||
$htaccess_path = Htaccess::get_frontend_htaccess();
|
||||
|
||||
// Check if there is `ExpiresDefault` in .htaccess
|
||||
if ( defined( 'LITESPEED_ON' ) ) {
|
||||
if ( $content && stripos( $content, "\nExpiresDefault" ) !== false ) {
|
||||
$is_dismissed = GUI::get_option( self::DB_DISMISS_MSG );
|
||||
if ( $is_dismissed !== self::RULECONFLICT_DISMISSED ) {
|
||||
// Need to add a notice for browser cache compatibility
|
||||
if ( $is_dismissed !== self::RULECONFLICT_ON ) {
|
||||
GUI::update_option( self::DB_DISMISS_MSG, self::RULECONFLICT_ON );
|
||||
}
|
||||
require_once LSCWP_DIR . 'tpl/inc/show_rule_conflict.php';
|
||||
}
|
||||
}
|
||||
// don't dismiss the msg automatically
|
||||
// elseif ( $is_dismissed === Cache_Admin_Display::RULECONFLICT_ON ) {
|
||||
// update_option( self::DISMISS_MSG, Cache_Admin_Display::RULECONFLICT_DISMISSED );
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __('LiteSpeed Cache View .htaccess', 'litespeed-cache'); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#edit-htaccess-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '.htaccess Path', 'litespeed-cache' ); ?>
|
||||
</h3>
|
||||
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo __( 'Frontend .htaccess Path', 'litespeed-cache' ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<code><?php echo $htaccess_path; ?></code>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Default path is', 'litespeed-cache' ); ?>: <code><?php echo Htaccess::get_frontend_htaccess( true ); ?></code>
|
||||
<br /><font class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'PHP Constant %s is supported.', 'litespeed-cache' ), '<code>LITESPEED_CFG_HTACCESS</code>' ); ?>
|
||||
<?php echo sprintf( __( '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 echo __( 'Backend .htaccess Path', 'litespeed-cache' ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php echo Htaccess::get_backend_htaccess(); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Default path is', 'litespeed-cache' ); ?>: <code><?php echo Htaccess::get_backend_htaccess( true ); ?></code>
|
||||
<br /><font class="litespeed-success">
|
||||
<?php echo __( 'API', 'litespeed-cache' ); ?>:
|
||||
<?php echo sprintf( __( 'PHP Constant %s is supported.', 'litespeed-cache' ), '<code>LITESPEED_CFG_HTACCESS_BACKEND</code>' ); ?>
|
||||
<?php echo sprintf( __( '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( $content !== null ) : ?>
|
||||
|
||||
<h3 class="litespeed-title"><?php echo sprintf(__('Current %s Contents', 'litespeed-cache'), '.htaccess'); ?></h3>
|
||||
|
||||
<h4><?php echo $htaccess_path; ?></h4>
|
||||
|
||||
<textarea readonly wrap="off" rows="50" class="large-text"><?php echo esc_textarea($content); ?></textarea>
|
||||
|
||||
<?php endif; ?>
|
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$menu_list = array(
|
||||
'purge' => __( 'Purge', 'litespeed-cache' ),
|
||||
);
|
||||
|
||||
if ( ! $this->_is_network_admin ) {
|
||||
$menu_list[ 'import_export' ] = __( 'Import / Export', 'litespeed-cache' );
|
||||
}
|
||||
|
||||
if ( ! $this->_is_multisite || $this->_is_network_admin ) {
|
||||
$menu_list[ 'edit_htaccess' ] = __( 'View .htaccess', 'litespeed-cache' );
|
||||
}
|
||||
|
||||
if ( ! $this->_is_network_admin ) {
|
||||
$menu_list[ 'heartbeat' ] = __( 'Heartbeat', 'litespeed-cache' ); // todo: will add this to network level later
|
||||
$menu_list[ 'report' ] = __( 'Report', 'litespeed-cache' );
|
||||
}
|
||||
|
||||
if ( ! $this->_is_multisite || $this->_is_network_admin ) {
|
||||
$menu_list[ 'settings-debug' ] = __( 'Debug Settings', 'litespeed-cache' );
|
||||
$menu_list[ 'log_viewer' ] = __( 'Log View', 'litespeed-cache' );
|
||||
$menu_list[ 'beta_test' ] = __( 'Beta Test', 'litespeed-cache' );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="litespeed-h1">
|
||||
<?php echo __( 'LiteSpeed Cache Toolbox', 'litespeed-cache' ); ?>
|
||||
</h1>
|
||||
<span class="litespeed-desc">
|
||||
v<?php echo Core::VER; ?>
|
||||
</span>
|
||||
<hr class="wp-header-end">
|
||||
</div>
|
||||
|
||||
<div class="litespeed-wrap">
|
||||
<h2 class="litespeed-header nav-tab-wrapper">
|
||||
<?php
|
||||
$i = 1;
|
||||
foreach ($menu_list as $tab => $val){
|
||||
$accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '';
|
||||
echo "<a class='litespeed-tab nav-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
|
||||
$i ++;
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<div class="litespeed-body">
|
||||
<?php
|
||||
|
||||
// include all tpl for faster UE
|
||||
foreach ($menu_list as $tab => $val) {
|
||||
echo "<div data-litespeed-layout='$tab'>";
|
||||
require LSCWP_DIR . "tpl/toolbox/$tab.tpl.php";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$this->form_action();
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __( '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 echo __( 'NOTICE:', 'litespeed-cache' ); ?></h4>
|
||||
<p><?php echo __( 'Disable WordPress interval heartbeat to reduce server load.', 'litespeed-cache' ); ?>
|
||||
<span class="litespeed-warning">
|
||||
🚨
|
||||
<?php echo __( '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 $id = Base::O_MISC_HEARTBEAT_FRONT; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
|
||||
<?php echo __( 'Turn ON to control heartbeat on frontend.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MISC_HEARTBEAT_FRONT_TTL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short'); ?> <?php $this->readable_seconds(); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Specify the %s heartbeat interval in seconds.', 'litespeed-cache' ), 'frontend' ); ?>
|
||||
<?php echo sprintf( __( 'WordPress valid interval is %s seconds.', 'litespeed-cache' ), '<code>15</code> - <code>120</code>' ); ?><br />
|
||||
<?php echo sprintf( __( 'Set to %1$s to forbid heartbeat on %2$s.', 'litespeed-cache' ), '<code>0</code>', 'frontend' ); ?><br />
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 15, 120, true ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MISC_HEARTBEAT_BACK; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Turn ON to control heartbeat on backend.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MISC_HEARTBEAT_BACK_TTL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short'); ?> <?php $this->readable_seconds(); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Specify the %s heartbeat interval in seconds.', 'litespeed-cache' ), 'backend' ); ?>
|
||||
<?php echo sprintf( __( 'WordPress valid interval is %s seconds', 'litespeed-cache' ), '<code>15</code> ~ <code>120</code>' ); ?><br />
|
||||
<?php echo sprintf( __( 'Set to %1$s to forbid heartbeat on %2$s.', 'litespeed-cache' ), '<code>0</code>', 'backend' ); ?><br />
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 15, 120, true ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MISC_HEARTBEAT_EDITOR; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Turn ON to control heartbeat in backend editor.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_MISC_HEARTBEAT_EDITOR_TTL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short'); ?> <?php $this->readable_seconds(); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo sprintf( __( 'Specify the %s heartbeat interval in seconds.', 'litespeed-cache' ), 'backend editor' ); ?>
|
||||
<?php echo sprintf( __( 'WordPress valid interval is %s seconds', 'litespeed-cache' ), '<code>15</code> ~ <code>120</code>' ); ?><br />
|
||||
<?php echo sprintf( __( 'Set to %1$s to forbid heartbeat on %2$s.', 'litespeed-cache' ), '<code>0</code>', 'frontend' ); ?><br />
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 15, 120, true ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<?php $this->form_end(); ?>
|
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$summary = Import::get_summary();
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __('Export Settings', 'litespeed-cache'); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#importexport-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<div><a href="<?php echo Utility::build_url( Router::ACTION_IMPORT, Import::TYPE_EXPORT ); ?>" class="button button-primary">
|
||||
<?php echo __( 'Export', 'litespeed-cache' ); ?>
|
||||
</a></div>
|
||||
|
||||
<?php if ( ! empty( $summary[ 'export_file' ] ) ) : ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Last exported', 'litespeed-cache' ); ?>: <code><?php echo $summary[ 'export_file' ]; ?></code> <?php echo Utility::readable_time( $summary[ 'export_time' ]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'This will export all current LiteSpeed Cache settings and save them as a file.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
|
||||
<h3 class="litespeed-title"><?php echo __('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(__('Import', 'litespeed-cache'), 'button button-primary', 'litespeed-submit'); ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php if ( ! empty( $summary[ 'import_file' ] ) ) : ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Last imported', 'litespeed-cache' ); ?>: <code><?php echo $summary[ 'import_file' ]; ?></code> <?php echo Utility::readable_time( $summary[ 'import_time' ]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'This will import settings from a file and override all current LiteSpeed Cache settings.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
|
||||
<h3 class="litespeed-title"><?php echo __('Reset All Settings', 'litespeed-cache'); ?></h3>
|
||||
<div><p>🚨 <?php echo __( 'This will reset all settings to default settings.', 'litespeed-cache' ); ?></p>
|
||||
</div>
|
||||
<div><a href="<?php echo Utility::build_url( Router::ACTION_IMPORT, Import::TYPE_RESET ); ?>" data-litespeed-cfm="<?php echo __( 'Are you sure you want to reset all settings back to the default settings?', 'litespeed-cache' ); ?>" class="button litespeed-btn-danger-bg">
|
||||
<?php echo __( 'Reset Settings', 'litespeed-cache' ); ?>
|
||||
</a></div>
|
||||
|
||||
|
||||
|
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
?>
|
||||
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __('Debug Log', 'litespeed-cache'); ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#log-view-tab' ); ?>
|
||||
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG ); ?>" class="button button-primary" litespeed-accesskey='D'>
|
||||
<?php echo __( 'Clear Log', 'litespeed-cache' ); ?>
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
|
||||
<?php
|
||||
$file = LSCWP_CONTENT_DIR . '/debug.log';
|
||||
$lines = File::count_lines( $file );
|
||||
$start = $lines > 1000 ? $lines - 1000 : 0;
|
||||
$logs = File::read( $file, $start );
|
||||
$logs = $logs ? implode( "\n", $logs ) : '';
|
||||
|
||||
echo nl2br( htmlspecialchars( $logs ) );
|
||||
?>
|
||||
|
||||
|
||||
<a href="<?php echo Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG ); ?>" class="button button-primary">
|
||||
<?php echo __( 'Clear Log', 'litespeed-cache' ); ?>
|
||||
</a>
|
@@ -0,0 +1,261 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$_panels = array(
|
||||
array(
|
||||
'title' => __( 'Purge Front Page', 'litespeed-cache' ),
|
||||
'desc' => __( 'This will Purge Front Page only', 'litespeed-cache' ),
|
||||
'icon' => 'purge-front',
|
||||
'append_url' => Purge::TYPE_PURGE_FRONTPAGE,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Purge Pages', 'litespeed-cache' ),
|
||||
'desc' => __( 'This will Purge Pages only', 'litespeed-cache' ),
|
||||
'icon' => 'purge-pages',
|
||||
'append_url' => Purge::TYPE_PURGE_PAGES,
|
||||
),
|
||||
array(
|
||||
'title' => sprintf( __( 'Purge %s Error', 'litespeed-cache' ), '403' ),
|
||||
'desc' => sprintf( __( 'Purge %s error pages', 'litespeed-cache' ), '403' ),
|
||||
'icon' => 'purge-403',
|
||||
'append_url' => Purge::TYPE_PURGE_ERROR . '403',
|
||||
),
|
||||
array(
|
||||
'title' => sprintf( __( 'Purge %s Error', 'litespeed-cache' ), '404' ),
|
||||
'desc' => sprintf( __( 'Purge %s error pages', 'litespeed-cache' ), '404' ),
|
||||
'icon' => 'purge-404',
|
||||
'append_url' => Purge::TYPE_PURGE_ERROR . '404',
|
||||
),
|
||||
array(
|
||||
'title' => sprintf( __( 'Purge %s Error', 'litespeed-cache' ), '500' ),
|
||||
'desc' => sprintf( __( 'Purge %s error pages', 'litespeed-cache' ), '500' ),
|
||||
'icon' => 'purge-500',
|
||||
'append_url' => Purge::TYPE_PURGE_ERROR . '500',
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Purge All', 'litespeed-cache' ) . ' - LSCache',
|
||||
'desc' => __( 'Purge the LiteSpeed cache entries created by this plugin', 'litespeed-cache' ),
|
||||
'icon' => 'purge-all',
|
||||
'append_url' => Purge::TYPE_PURGE_ALL_LSCACHE,
|
||||
),
|
||||
array(
|
||||
'title' => __( 'Purge All', 'litespeed-cache' ) . ' - ' . __( 'CSS/JS Cache', 'litespeed-cache' ),
|
||||
'desc' => __( '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' => __( 'Purge All', 'litespeed-cache' ) . ' - ' . __( 'Object Cache', 'litespeed-cache' ),
|
||||
'desc' => __( 'Purge all the object caches', 'litespeed-cache' ),
|
||||
'icon' => 'purge-object',
|
||||
'append_url' => Purge::TYPE_PURGE_ALL_OBJECT,
|
||||
) ;
|
||||
}
|
||||
|
||||
if ( Router::opcache_enabled() ) {
|
||||
$_panels[] = array(
|
||||
'title' => __( 'Purge All', 'litespeed-cache' ) . ' - ' . __( 'Opcode Cache', 'litespeed-cache' ),
|
||||
'desc' => __( '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' => __( 'Purge All', 'litespeed-cache' ) . ' - ' . __( 'Critical CSS', 'litespeed-cache' ),
|
||||
'desc' => __( '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' => __( 'Purge All', 'litespeed-cache' ) . ' - ' . __( 'Unique CSS', 'litespeed-cache' ),
|
||||
'desc' => __( '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' => __( 'Purge All', 'litespeed-cache' ) . ' - ' . __( 'Localized Resources', 'litespeed-cache' ),
|
||||
'desc' => __( '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' => __( 'Purge All', 'litespeed-cache' ) . ' - ' . __( 'LQIP Cache', 'litespeed-cache' ),
|
||||
'desc' => __( '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( 'avatar' ) ) {
|
||||
$_panels[] = array(
|
||||
'title' => __( 'Purge All', 'litespeed-cache' ) . ' - ' . __( 'Gravatar Cache', 'litespeed-cache' ),
|
||||
'desc' => __( 'This will delete all cached Gravatar files', 'litespeed-cache' ),
|
||||
'icon' => 'purge-cssjs',
|
||||
'append_url' => Purge::TYPE_PURGE_ALL_AVATAR,
|
||||
) ;
|
||||
}
|
||||
|
||||
|
||||
$_panels[] = array(
|
||||
'title' => __( 'Purge All', 'litespeed-cache' ),
|
||||
'desc' => __( 'Purge the cache entries created by this plugin except for Critical 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' => __( 'Empty Entire Cache', 'litespeed-cache' ),
|
||||
'desc' => __( 'Clears all cache entries related to this site, <i>including other web applications</i>.', 'litespeed-cache' ) . ' <b>' .
|
||||
__('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 include_once LSCWP_DIR . "tpl/inc/check_cache_disabled.php" ; ?>
|
||||
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __('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 $v ): ?>
|
||||
<?php $tag = ! empty( $v[ 'tag' ] ) ? $v[ 'tag' ] : Router::ACTION_PURGE ; ?>
|
||||
<?php $append_url = ! empty( $v[ 'append_url' ] ) ? $v[ 'append_url' ] : false ; ?>
|
||||
|
||||
<?php if ( ! empty( $v[ 'newline' ] ) ) : ?>
|
||||
<div class='litespeed-col-br'></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<a class="litespeed-panel postbox"
|
||||
href="<?php echo Utility::build_url( $tag, $append_url ) ; ?>"
|
||||
<?php if ( ! empty( $v[ 'cfm' ] ) ) echo 'data-litespeed-cfm="' . $v[ 'cfm' ] . '"' ; ?>
|
||||
>
|
||||
<section class="litespeed-panel-wrapper-icon">
|
||||
<span class="litespeed-panel-icon-<?php echo $v[ 'icon' ] ; ?>"></span>
|
||||
</section>
|
||||
<section class="litespeed-panel-content">
|
||||
<div class="litespeed-h3 <?php if ( ! empty( $v[ 'title_cls' ] ) ) echo $v[ 'title_cls' ] ; ?>">
|
||||
<?php echo $v[ 'title' ] ; ?>
|
||||
</div>
|
||||
<span class="litespeed-panel-para"><?php echo $v[ 'desc' ] ; ?></span>
|
||||
</section>
|
||||
</a>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if (!is_multisite() || !is_network_admin()): ?>
|
||||
|
||||
<h3 class="litespeed-title"><?php echo __('Purge By...', 'litespeed-cache'); ?></h3>
|
||||
<p class="litespeed-description">
|
||||
<?php echo __('Select below for "Purge by" options.', 'litespeed-cache'); ?>
|
||||
<?php Doc::one_per_line() ; ?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
$purgeby_option = false;
|
||||
$_option_field = Admin_Display::PURGEBYOPT_SELECT;
|
||||
if(!empty($_REQUEST[$_option_field])){
|
||||
$purgeby_option = $_REQUEST[$_option_field];
|
||||
}
|
||||
if( !in_array($purgeby_option, array(
|
||||
Admin_Display::PURGEBY_CAT,
|
||||
Admin_Display::PURGEBY_PID,
|
||||
Admin_Display::PURGEBY_TAG,
|
||||
Admin_Display::PURGEBY_URL,
|
||||
)) ) {
|
||||
$purgeby_option = Admin_Display::PURGEBY_CAT;
|
||||
}
|
||||
?>
|
||||
|
||||
<?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 $_option_field; ?>" id="purgeby_option_category"
|
||||
value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
|
||||
/>
|
||||
<label for="purgeby_option_category"><?php echo __('Category', 'litespeed-cache'); ?></label>
|
||||
|
||||
<?php $val = Admin_Display::PURGEBY_PID;?>
|
||||
<input type="radio" autocomplete="off" name="<?php echo $_option_field; ?>" id="purgeby_option_postid"
|
||||
value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
|
||||
/>
|
||||
<label for="purgeby_option_postid"><?php echo __('Post ID', 'litespeed-cache'); ?></label>
|
||||
|
||||
<?php $val = Admin_Display::PURGEBY_TAG;?>
|
||||
<input type="radio" autocomplete="off" name="<?php echo $_option_field; ?>" id="purgeby_option_tag"
|
||||
value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
|
||||
/>
|
||||
<label for="purgeby_option_tag"><?php echo __('Tag', 'litespeed-cache'); ?></label>
|
||||
|
||||
<?php $val = Admin_Display::PURGEBY_URL;?>
|
||||
<input type="radio" autocomplete="off" name="<?php echo $_option_field; ?>" id="purgeby_option_url"
|
||||
value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
|
||||
/>
|
||||
<label for="purgeby_option_url"><?php echo __('URL', 'litespeed-cache'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="litespeed-cache-purgeby-text litespeed-desc">
|
||||
<div class="<?php if($purgeby_option != Admin_Display::PURGEBY_CAT) echo 'litespeed-hide'; ?>"
|
||||
data-purgeby="<?php echo Admin_Display::PURGEBY_CAT; ?>">
|
||||
<?php echo sprintf(__('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="<?php if($purgeby_option != Admin_Display::PURGEBY_PID) echo 'litespeed-hide'; ?>"
|
||||
data-purgeby="<?php echo Admin_Display::PURGEBY_PID; ?>">
|
||||
<?php echo __("Purge pages by post ID.", "litespeed-cache"); ?>
|
||||
</div>
|
||||
<div class="<?php if($purgeby_option != Admin_Display::PURGEBY_TAG) echo 'litespeed-hide'; ?>"
|
||||
data-purgeby="<?php echo Admin_Display::PURGEBY_TAG; ?>">
|
||||
<?php echo sprintf(__('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="<?php if($purgeby_option != Admin_Display::PURGEBY_URL) echo 'litespeed-hide'; ?>"
|
||||
data-purgeby="<?php echo Admin_Display::PURGEBY_URL; ?>">
|
||||
<?php echo __('Purge pages by relative or full URL.', 'litespeed-cache'); ?>
|
||||
<?php echo sprintf(__('e.g. Use %s or %s.', 'litespeed-cache'),
|
||||
'<code>/2016/02/24/hello-world/</code>',
|
||||
'<code>http://www.myexamplesite.com/2016/02/24/hello-world/</code>'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<textarea name="<?php echo Admin_Display::PURGEBYOPT_LIST; ?>" rows="5" class="litespeed-textarea"></textarea>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<button type="submit" class="button button-primary"><?php echo __('Purge List', 'litespeed-cache'); ?></button>
|
||||
</p>
|
||||
</form>
|
||||
<?php endif; ?>
|
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
namespace LiteSpeed ;
|
||||
defined( 'WPINC' ) || exit ;
|
||||
|
||||
$_report = Report::cls() ;
|
||||
$report = $_report->generate_environment_report();
|
||||
|
||||
$env_ref = Report::get_summary() ;
|
||||
|
||||
// Detect password less plugin
|
||||
$link = '';
|
||||
$has_pswdless_plugin = false;
|
||||
if ( function_exists( 'dologin_gen_link' ) ) {
|
||||
$has_pswdless_plugin = true;
|
||||
if ( ! empty( $_GET[ 'dologin_gen_link' ] ) ) {
|
||||
unset( $_GET[ 'dologin_gen_link' ] );
|
||||
$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' ) );
|
||||
?>
|
||||
|
||||
<?php if ( ! $has_pswdless_plugin ) : ?>
|
||||
<div class="litespeed-callout notice notice-warning inline">
|
||||
<h4><?php echo __( 'NOTICE:', 'litespeed-cache' ); ?></h4>
|
||||
<p>
|
||||
<?php echo sprintf( __( '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 $install_link; ?>" class="button litespeed-btn litespeed-right20"><?php echo __( 'Install DoLogin Security', 'litespeed-cache' ); ?></a>
|
||||
<a href="plugin-install.php?s=dologin+security&tab=search&type=term" target="_blank"><?php echo __( 'Go to plugins list', 'litespeed-cache' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<h3 class="litespeed-title">
|
||||
<?php echo __('LiteSpeed Report', 'litespeed-cache') ; ?>
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#report-tab' ); ?>
|
||||
</h3>
|
||||
|
||||
<p><?php echo __('Report number', 'litespeed-cache') ; ?>: <b><?php echo ! empty( $env_ref[ 'num' ] ) ? $env_ref[ 'num' ] : '-' ; ?></b></p>
|
||||
<p><?php echo __('Report date', 'litespeed-cache') ; ?>: <b><?php echo ! empty( $env_ref[ 'dateline' ] ) ? date( 'm/d/Y H:i:s', $env_ref[ 'dateline' ] ) : '-' ; ?></b></p>
|
||||
|
||||
<p class="litespeed-desc">
|
||||
<?php echo __( 'The environment report contains detailed information about the WordPress configuration.', 'litespeed-cache' ); ?>
|
||||
<br />
|
||||
<?php echo __('If you run into any issues, please refer to the report number in your support message.', 'litespeed-cache'); ?>
|
||||
</p>
|
||||
|
||||
<form action="<?php echo Utility::build_url( Router::ACTION_REPORT, Report::TYPE_SEND_REPORT ); ?>" method="post" class="litespeed-relative">
|
||||
<table class="wp-list-table striped litespeed-table"><tbody>
|
||||
<tr>
|
||||
<th><?php echo __( 'System Information', 'litespeed-cache' ) ; ?></th>
|
||||
<td>
|
||||
<textarea id="litespeed-report" rows="20" cols="100" readonly><?php echo $report; ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo __( 'Passwordless Link', 'litespeed-cache' ) ; ?></th>
|
||||
<td>
|
||||
<input type="text" class="litespeed-regular-text" id="litespeed-report-link" name="link" value="<?php echo $link; ?>" style="width:500px;" />
|
||||
<?php if ( $has_pswdless_plugin ) : ?>
|
||||
<a href="<?php echo admin_url( 'admin.php?page=litespeed-toolbox&dologin_gen_link=1' ); ?>" class="button button-secondary"><?php echo __( 'Generate Link for Current User', 'litespeed-cache' ) ; ?></a>
|
||||
<?php else: ?>
|
||||
<button type="button" class="button button-secondary" disabled><?php echo __( 'Generate Link for Current User', 'litespeed-cache' ) ; ?></button>
|
||||
<?php endif; ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( '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 ( $link ) : ?>
|
||||
<br /><strong>🚨 <?php echo __('Please do NOT share the above passwordless link with anyone.', 'litespeed-cache'); ?></strong>
|
||||
<strong><?php echo sprintf( __('Generated links may be managed under <a %s>Settings</a>.', 'litespeed-cache'), 'href="' . menu_page_url( 'dologin', 0 ) . '"' ); ?></strong>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo __( 'Notes', 'litespeed-cache' ) ; ?></th>
|
||||
<td>
|
||||
<textarea name="notes" rows="10" cols="100"></textarea>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Optional', 'litespeed-cache' ); ?>:
|
||||
<?php echo __( '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 __( 'Send to LiteSpeed', 'litespeed-cache' ) ; ?></button>
|
||||
<button class="button button-primary litespeed-float-submit" type="submit"><?php echo __( 'Send to LiteSpeed', 'litespeed-cache' ) ; ?></button>
|
||||
|
||||
<p class="litespeed-top30 litespeed-left10 litespeed-desc">
|
||||
<?php echo __( 'Send this report to LiteSpeed. Refer to this report number when posting in the WordPress support forum.', 'litespeed-cache' ) ; ?>
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<?php include_once LSCWP_DIR . "tpl/inc/api_key.php" ; ?>
|
||||
|
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
namespace LiteSpeed;
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$this->form_action( $this->_is_network_admin ? Router::ACTION_SAVE_SETTINGS_NETWORK : false );
|
||||
?>
|
||||
|
||||
|
||||
<h3 class="litespeed-title-short">
|
||||
<?php echo __('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 $id = Base::O_DEBUG_DISABLE_ALL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'This will disable LSCache and all optimization features for debug purpose.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DEBUG; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id, array( __( 'OFF', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ), __( 'Admin IP Only', 'litespeed-cache' ) ) ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Outputs to WordPress debug log.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'To prevent filling up the disk, this setting should be OFF when everything is working.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'The Admin IP option will only output log messages on requests from admin IPs.', 'litespeed-cache' ); ?>
|
||||
<?php echo sprintf( __( 'The logs will be output to %s.', 'litespeed-cache' ), '<code>wp-content/debug.log</code>' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DEBUG_IPS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id, 50 ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Allows listed IPs (one per line) to perform certain actions from their browsers.', 'litespeed-cache' ); ?>
|
||||
<?php echo __( 'Your IP', 'litespeed-cache' ); ?>: <code><?php echo Router::get_ip(); ?></code>
|
||||
<?php $this->_validate_ip( $id ); ?>
|
||||
<br />
|
||||
<?php Doc::learn_more(
|
||||
'https://docs.litespeedtech.com/lscache/lscwp/admin/#admin-ip-commands',
|
||||
__( 'More information about the available commands can be found here.', 'litespeed-cache' )
|
||||
); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DEBUG_LEVEL; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id, array( __( 'Basic', 'litespeed-cache' ), __( 'Advanced', 'litespeed-cache' ) ) ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Advanced level will log more details.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DEBUG_FILESIZE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_input( $id, 'litespeed-input-short' ); ?> <?php echo __( 'MB', 'litespeed-cache' ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Specify the maximum size of the log file.', 'litespeed-cache' ); ?>
|
||||
<?php $this->recommended( $id ); ?>
|
||||
<?php $this->_validate_ttl( $id, 3, 3000 ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DEBUG_COOKIE; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Log requested cookie values.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DEBUG_COLLAPS_QS; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_switch( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Shorten query strings in the debug log to improve readability.', 'litespeed-cache' ); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DEBUG_INC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Only log listed pages.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_uri_usage_example(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<?php $id = Base::O_DEBUG_EXC; ?>
|
||||
<?php $this->title( $id ); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php $this->build_textarea( $id ); ?>
|
||||
<div class="litespeed-desc">
|
||||
<?php echo __( 'Prevent any debug log of listed pages.', 'litespeed-cache' ); ?>
|
||||
<?php $this->_uri_usage_example(); ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
|
||||
$this->form_end();
|
||||
|
Reference in New Issue
Block a user