initial commit
This commit is contained in:
@@ -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 ) ;
|
||||
|
Reference in New Issue
Block a user