Initial commit: Atomaste website
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Admin Footer
|
||||
*
|
||||
* Customizes the admin footer text for LiteSpeed Cache with links to rate, documentation, support forum, and community.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
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 noreferrer" target="_blank">' . sprintf( esc_html__( 'Rate %1$s on %2$s', 'litespeed-cache' ), '<strong>' . esc_html__( 'LiteSpeed Cache', 'litespeed-cache' ) . $stars . '</strong>', 'WordPress.org' ) . '</a>';
|
||||
|
||||
$wiki = '<a href="https://docs.litespeedtech.com/lscache/lscwp/" target="_blank">' . esc_html__( 'Read LiteSpeed Documentation', 'litespeed-cache' ) . '</a>';
|
||||
|
||||
$forum = '<a href="https://wordpress.org/support/plugin/litespeed-cache" target="_blank">' . esc_html__( 'Visit LSCWP support forum', 'litespeed-cache' ) . '</a>';
|
||||
|
||||
$community = '<a href="https://litespeedtech.com/slack" target="_blank">' . esc_html__( '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,51 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Warning Notice
|
||||
*
|
||||
* Displays warnings if LiteSpeed Cache functionality is unavailable due to server or plugin configuration issues.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$reasons = array();
|
||||
|
||||
if ( ! defined( 'LITESPEED_ALLOWED' ) ) {
|
||||
if ( defined( 'LITESPEED_SERVER_TYPE' ) && LITESPEED_SERVER_TYPE === 'NONE' ) {
|
||||
$reasons[] = array(
|
||||
'title' => esc_html__( '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' => esc_html__( 'Please enable the LSCache Module at the server level, or ask your hosting provider.', 'litespeed-cache' ),
|
||||
'link' => 'https://docs.litespeedtech.com/lscache/lscwp/#server-level-prerequisites',
|
||||
);
|
||||
}
|
||||
} elseif ( ! defined( 'LITESPEED_ON' ) ) {
|
||||
$reasons[] = array(
|
||||
'title' => esc_html__( '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 esc_html_e( 'WARNING', 'litespeed-cache' ); ?></h4>
|
||||
<p>
|
||||
<?php esc_html_e( 'LSCache caching functions on this page are currently unavailable!', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
<ul class="litespeed-list">
|
||||
<?php foreach ( $reasons as $reason ) : ?>
|
||||
<li>
|
||||
<?php echo esc_html( $reason['title'] ); ?>
|
||||
<a href="<?php echo esc_url( $reason['link'] ); ?>" target="_blank" class="litespeed-learn-more"><?php esc_html_e( 'Learn More', 'litespeed-cache' ); ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Network Primary Site Configuration Warning
|
||||
*
|
||||
* Displays a warning notice on subsite admin pages when the network admin has enforced primary site configurations.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
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 esc_html_e( 'WARNING', 'litespeed-cache' ); ?></h4>
|
||||
<p>
|
||||
<?php esc_html_e( 'The network admin selected use primary site configs for all subsites.', 'litespeed-cache' ); ?>
|
||||
<?php esc_html_e( 'The following options are selected, but are not editable in this settings page.', 'litespeed-cache' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Upgrade Notice
|
||||
*
|
||||
* Displays a notice informing the user that the LiteSpeed Cache plugin has been upgraded and a page refresh is needed to complete the configuration data upgrade.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$message = esc_html__( 'LiteSpeed cache plugin upgraded. Please refresh the page to complete the configuration data upgrade.', 'litespeed-cache' );
|
||||
|
||||
echo wp_kses_post( self::build_notice( self::NOTICE_BLUE, $message ) );
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Post Meta Settings
|
||||
*
|
||||
* Renders the post meta settings interface for LiteSpeed Cache, allowing configuration of post-specific options.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
wp_nonce_field( self::POST_NONCE_ACTION, Router::NONCE );
|
||||
|
||||
$pid = get_the_ID();
|
||||
|
||||
foreach ( $this->_postmeta_settings as $key => $label ) {
|
||||
$existing_val = get_post_meta( $pid, $key, true );
|
||||
|
||||
if ( in_array( $key, array( 'litespeed_vpi_list', 'litespeed_vpi_list_mobile' ), true ) ) {
|
||||
if ( is_array( $existing_val ) ) {
|
||||
$existing_val = implode( PHP_EOL, $existing_val );
|
||||
}
|
||||
?>
|
||||
<div style="margin-bottom:10px;">
|
||||
<label for="<?php echo esc_attr( Str::trim_quotes( $key ) ); ?>"><?php echo esc_html( $label ); ?></label>
|
||||
<textarea style="width:100%" rows="5" id="<?php echo esc_attr( Str::trim_quotes( $key ) ); ?>" name="<?php echo esc_attr( Str::trim_quotes( $key ) ); ?>"><?php echo esc_textarea( $existing_val ); ?></textarea>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div style="display:flex;margin-bottom:10px;align-items: center;gap: 2ch;justify-content: space-between;">
|
||||
<label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $label ); ?></label>
|
||||
<input class="litespeed-tiny-toggle" id="<?php echo esc_attr( Str::trim_quotes( $key ) ); ?>" name="<?php echo esc_attr( Str::trim_quotes( $key ) ); ?>" type="checkbox" value="1" <?php echo $existing_val ? 'checked' : ''; ?> />
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div style="text-align:right;">
|
||||
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/metabox/' ); ?>
|
||||
</div>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Deactivation Modal
|
||||
*
|
||||
* Renders the deactivation modal interface for LiteSpeed Cache, allowing users to send reason of deactivation.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 7.3
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
// Modal data
|
||||
$_title = esc_html__('Deactivate LiteSpeed Cache', 'litespeed');
|
||||
$_id = 'litespeed-modal-deactivate';
|
||||
|
||||
$reasons = array(
|
||||
array(
|
||||
'value' => 'Temporary',
|
||||
'text' => esc_html__('The deactivation is temporary', 'litespeed-cache'),
|
||||
'id' => 'temp',
|
||||
'selected' => true,
|
||||
),
|
||||
array(
|
||||
'value' => 'Performance worse',
|
||||
'text' => esc_html__('Site performance is worse', 'litespeed-cache'),
|
||||
'id' => 'performance',
|
||||
),
|
||||
array(
|
||||
'value' => 'Plugin complicated',
|
||||
'text' => esc_html__('Plugin is too complicated', 'litespeed-cache'),
|
||||
'id' => 'complicated',
|
||||
),
|
||||
array(
|
||||
'value' => 'Other',
|
||||
'text' => esc_html__('Other', 'litespeed-cache'),
|
||||
'id' => 'other',
|
||||
),
|
||||
);
|
||||
?>
|
||||
<div style="display: none">
|
||||
<div id="litespeed-deactivation" class="iziModal">
|
||||
<div id="litespeed-modal-deactivate">
|
||||
<form id="litespeed-deactivation-form" method="post">
|
||||
<p><?php esc_attr_e('Why are you deactivating the plugin?', 'litespeed-cache'); ?></p>
|
||||
<div class="deactivate-reason-wrapper">
|
||||
<?php foreach ($reasons as $reason) : ?>
|
||||
<label for="litespeed-deactivate-reason-<?php esc_attr_e( $reason['id'] ); ?>">
|
||||
<input type="radio" id="litespeed-deactivate-reason-<?php esc_attr_e( $reason['id'] ); ?>" value="<?php esc_attr_e( $reason['value'] ); ?>"
|
||||
<?php isset($reason['selected']) && $reason['selected'] ? ' checked="checked"' : ''; ?> name="litespeed-reason" />
|
||||
<?php esc_html_e( $reason['text'] ); ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="deactivate-clear-settings-wrapper">
|
||||
<i style="font-size: 0.9em;">
|
||||
<?php
|
||||
esc_html_e('On uninstall, all plugin settings will be deleted.', 'litespeed-cache');
|
||||
?>
|
||||
</i>
|
||||
<br />
|
||||
<i style="font-size: 0.9em;">
|
||||
|
||||
<?php
|
||||
printf(
|
||||
esc_html__('If you have used Image Optimization, please %sDestroy All Optimization Data%s first. NOTE: this does not remove your optimized images.', 'litespeed-cache'),
|
||||
'<a href="admin.php?page=litespeed-img_optm#litespeed-imageopt-destroy" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</i>
|
||||
</div>
|
||||
<div class="deactivate-actions">
|
||||
<input type="submit" id="litespeed-deactivation-form-submit" class="button button-primary" value="<?php esc_attr_e('Deactivate', 'litespeed-cache'); ?>" title="<?php esc_attr_e('Deactivate plugin', 'litespeed-cache'); ?>" />
|
||||
<input type="button" id="litespeed-deactivation-form-cancel" class="button litespeed-btn-warning" value="<?php esc_attr_e('Cancel', 'litespeed-cache'); ?>" title="<?php esc_attr_e('Close popup', 'litespeed-cache'); ?>" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function ($) {
|
||||
'use strict';
|
||||
jQuery(document).ready(function () {
|
||||
var lscId = '<?php echo home_url(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>';
|
||||
var modalesc_attr_element = $('#litespeed-deactivation');
|
||||
var deactivateesc_attr_element = $('#deactivate-litespeed-cache');
|
||||
|
||||
if (deactivateesc_attr_element.length > 0 && modalesc_attr_element.length > 0) {
|
||||
// Variables
|
||||
var modal_formElement = $('#litespeed-deactivation-form');
|
||||
|
||||
deactivateesc_attr_element.on('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
modal_formElement.attr('action', decodeURI($(this).attr('href')));
|
||||
modalesc_attr_element.iziModal({
|
||||
radius: '.5rem',
|
||||
width: 550,
|
||||
autoOpen: true,
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('submit', '#litespeed-deactivation-form', function (e) {
|
||||
e.preventDefault();
|
||||
$('#litespeed-deactivation-form-submit').attr('disabled', true);
|
||||
var container = $('#litespeed-deactivation-form');
|
||||
|
||||
// Save selected data
|
||||
var data = {
|
||||
id: lscId,
|
||||
siteLink: window.location.hostname,
|
||||
reason: $(container).find('[name=litespeed-reason]:checked').val()
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: 'https://wpapi.quic.cloud/survey',
|
||||
dataType: 'json',
|
||||
method: 'POST',
|
||||
cache: false,
|
||||
data: data,
|
||||
success: function (data) {
|
||||
console.log('QC data sent.');
|
||||
},
|
||||
error: function (xhr, error) {
|
||||
console.log('Error sending data to QC.');
|
||||
},
|
||||
});
|
||||
|
||||
$('#litespeed-deactivation-form')[0].submit();
|
||||
});
|
||||
$(document).on('click', '#litespeed-deactivation-form-cancel', function (e) {
|
||||
modalesc_attr_element.iziModal('close');
|
||||
});
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Installation Notice
|
||||
*
|
||||
* Displays a notice informing users that the LiteSpeed Cache plugin was installed by the server admin.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined( 'WPINC' ) || exit;
|
||||
|
||||
$buf = sprintf(
|
||||
'<h3>%s</h3>
|
||||
<p>%s</p>
|
||||
<p>%s</p>
|
||||
<p>%s</p>
|
||||
<p>%s</p>
|
||||
<p>%s</p>
|
||||
<ul>
|
||||
<li>%s</li>
|
||||
<li>%s</li>
|
||||
</ul>',
|
||||
esc_html__( 'LiteSpeed Cache plugin is installed!', 'litespeed-cache' ),
|
||||
esc_html__( 'This message indicates that the plugin was installed by the server admin.', 'litespeed-cache' ),
|
||||
esc_html__( 'The LiteSpeed Cache plugin is used to cache pages - a simple way to improve the performance of the site.', 'litespeed-cache' ),
|
||||
esc_html__( 'However, there is no way of knowing all the possible customizations that were implemented.', 'litespeed-cache' ),
|
||||
esc_html__( 'For that reason, please test the site to make sure everything still functions properly.', 'litespeed-cache' ),
|
||||
esc_html__( 'Examples of test cases include:', 'litespeed-cache' ),
|
||||
esc_html__( 'Visit the site while logged out.', 'litespeed-cache' ),
|
||||
esc_html__( 'Create a post, make sure the front page is accurate.', 'litespeed-cache' )
|
||||
);
|
||||
$buf .= sprintf(
|
||||
/* translators: %s: Link tags */
|
||||
esc_html__( 'If there are any questions, the team is always happy to answer any questions on the %ssupport forum%s.', 'litespeed-cache' ),
|
||||
'<a href="https://wordpress.org/support/plugin/litespeed-cache" rel="noopener noreferrer" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
$buf .= '<p>' . esc_html__( 'If you would rather not move at litespeed, you can deactivate this plugin.', 'litespeed-cache' ) . '</p>';
|
||||
|
||||
self::add_notice( self::NOTICE_BLUE . ' lscwp-whm-notice', $buf );
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Database Login Cookie Notice
|
||||
*
|
||||
* Displays a notice about mismatched login cookies for LiteSpeed Cache.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined('WPINC') || exit();
|
||||
|
||||
$err =
|
||||
esc_html__('NOTICE: Database login cookie did not match your login cookie.', 'litespeed-cache') .
|
||||
' ' .
|
||||
esc_html__('If the login cookie was recently changed in the settings, please log out and back in.', 'litespeed-cache') .
|
||||
' ' .
|
||||
sprintf(
|
||||
esc_html__('If not, please verify the setting in the %sAdvanced tab%s.', 'litespeed-cache'),
|
||||
"<a href='" . esc_url(admin_url('admin.php?page=litespeed-cache#advanced')) . '">',
|
||||
'</a>'
|
||||
);
|
||||
|
||||
if (LITESPEED_SERVER_TYPE === 'LITESPEED_SERVER_OLS') {
|
||||
$err .= ' ' . esc_html__('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,27 @@
|
||||
<?php
|
||||
/**
|
||||
* LiteSpeed Cache Unexpected Cache Rule Notice
|
||||
*
|
||||
* Displays a warning notice about conflicting cache rules in .htaccess that may cause stale content.
|
||||
*
|
||||
* @package LiteSpeed
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
namespace LiteSpeed;
|
||||
|
||||
defined('WPINC') || exit();
|
||||
|
||||
$err = sprintf(
|
||||
esc_html__(
|
||||
'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. (%3$sLearn More%4$s)',
|
||||
'litespeed-cache'
|
||||
),
|
||||
'.htaccess',
|
||||
'<code>ExpiresDefault</code>',
|
||||
'<a href="https://docs.litespeedtech.com/lscache/lscwp/troubleshoot/#browser-displays-stale-content" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
|
||||
// Other plugin left cache expired rules in .htaccess which will cause conflicts
|
||||
echo wp_kses_post( self::build_notice(self::NOTICE_YELLOW . ' lscwp-notice-ruleconflict', $err) );
|
||||
Reference in New Issue
Block a user