Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/litespee.../tpl/general
File: settings.tpl.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* LiteSpeed Cache General Settings
[2] Fix | Delete
*
[3] Fix | Delete
* Manages general settings for LiteSpeed Cache, including Guest Mode optimization, server IP, and news settings.
[4] Fix | Delete
*
[5] Fix | Delete
* @package LiteSpeed
[6] Fix | Delete
* @since 1.0.0
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
namespace LiteSpeed;
[10] Fix | Delete
[11] Fix | Delete
defined( 'WPINC' ) || exit;
[12] Fix | Delete
[13] Fix | Delete
$cloud_instance = Cloud::cls();
[14] Fix | Delete
$cloud_summary = Cloud::get_summary();
[15] Fix | Delete
[16] Fix | Delete
$ajax_url_get_ip = function_exists('get_rest_url') ? get_rest_url(null, 'litespeed/v1/tool/check_ip') : '/';
[17] Fix | Delete
[18] Fix | Delete
$this->form_action();
[19] Fix | Delete
?>
[20] Fix | Delete
[21] Fix | Delete
<h3 class="litespeed-title-short">
[22] Fix | Delete
<?php esc_html_e( 'General Settings', 'litespeed-cache' ); ?>
[23] Fix | Delete
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/' ); ?>
[24] Fix | Delete
</h3>
[25] Fix | Delete
[26] Fix | Delete
<table class="wp-list-table striped litespeed-table">
[27] Fix | Delete
<tbody>
[28] Fix | Delete
<?php if ( ! $this->_is_multisite ) : ?>
[29] Fix | Delete
<?php require LSCWP_DIR . 'tpl/general/settings_inc.auto_upgrade.tpl.php'; ?>
[30] Fix | Delete
<?php endif; ?>
[31] Fix | Delete
[32] Fix | Delete
<?php if ( ! $this->_is_multisite ) : ?>
[33] Fix | Delete
<?php require LSCWP_DIR . 'tpl/general/settings_inc.guest.tpl.php'; ?>
[34] Fix | Delete
<?php endif; ?>
[35] Fix | Delete
[36] Fix | Delete
<tr>
[37] Fix | Delete
<th>
[38] Fix | Delete
<?php $option_id = Base::O_GUEST_OPTM; ?>
[39] Fix | Delete
<?php $this->title( $option_id ); ?>
[40] Fix | Delete
</th>
[41] Fix | Delete
<td>
[42] Fix | Delete
<?php $this->build_switch( $option_id ); ?>
[43] Fix | Delete
<div class="litespeed-desc">
[44] Fix | Delete
<span class="litespeed-danger litespeed-text-bold">
[45] Fix | Delete
🚨
[46] Fix | Delete
<?php esc_html_e( 'This option enables maximum optimization for Guest Mode visitors.', 'litespeed-cache' ); ?>
[47] Fix | Delete
<?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/general/#guest-optimization', esc_html__( 'Please read all warnings before enabling this option.', 'litespeed-cache' ), false, 'litespeed-danger' ); ?>
[48] Fix | Delete
</span>
[49] Fix | Delete
[50] Fix | Delete
<?php
[51] Fix | Delete
$type_list = array();
[52] Fix | Delete
if ( $this->conf( Base::O_GUEST ) && ! $this->conf( Base::O_OPTM_UCSS ) ) {
[53] Fix | Delete
$type_list[] = 'UCSS';
[54] Fix | Delete
}
[55] Fix | Delete
if ( $this->conf( Base::O_GUEST ) && ! $this->conf( Base::O_OPTM_CSS_ASYNC ) ) {
[56] Fix | Delete
$type_list[] = 'CCSS';
[57] Fix | Delete
}
[58] Fix | Delete
if ( ! empty( $type_list ) ) {
[59] Fix | Delete
$the_type = implode( '/', $type_list );
[60] Fix | Delete
echo '<br />';
[61] Fix | Delete
echo '<font class="litespeed-info">';
[62] Fix | Delete
echo '⚠️ ' . sprintf( esc_html__( 'Your %1$s quota on %2$s will still be in use.', 'litespeed-cache' ), esc_html( $the_type ), 'QUIC.cloud' );
[63] Fix | Delete
echo '</font>';
[64] Fix | Delete
}
[65] Fix | Delete
?>
[66] Fix | Delete
[67] Fix | Delete
<?php if ( ! $this->conf( Base::O_GUEST ) ) : ?>
[68] Fix | Delete
<br />
[69] Fix | Delete
<font class="litespeed-warning litespeed-left10">
[70] Fix | Delete
⚠️ <?php esc_html_e( 'Notice', 'litespeed-cache' ); ?>: <?php printf( esc_html__( '%s must be turned ON for this setting to work.', 'litespeed-cache' ), '<code>' . esc_html( Lang::title( Base::O_GUEST ) ) . '</code>' ); ?>
[71] Fix | Delete
</font>
[72] Fix | Delete
<?php endif; ?>
[73] Fix | Delete
[74] Fix | Delete
<?php if ( ! $this->conf( Base::O_CACHE_MOBILE ) ) : ?>
[75] Fix | Delete
<br />
[76] Fix | Delete
<font class="litespeed-primary litespeed-left10">
[77] Fix | Delete
⚠️ <?php esc_html_e( 'Notice', 'litespeed-cache' ); ?>: <?php printf( esc_html__( 'You need to turn %s on to get maximum result.', 'litespeed-cache' ), '<code>' . esc_html( Lang::title( Base::O_CACHE_MOBILE ) ) . '</code>' ); ?>
[78] Fix | Delete
</font>
[79] Fix | Delete
<?php endif; ?>
[80] Fix | Delete
[81] Fix | Delete
<?php if ( ! $this->conf( Base::O_IMG_OPTM_WEBP ) ) : ?>
[82] Fix | Delete
<br />
[83] Fix | Delete
<font class="litespeed-primary litespeed-left10">
[84] Fix | Delete
⚠️ <?php esc_html_e( 'Notice', 'litespeed-cache' ); ?>: <?php printf( esc_html__( 'You need to turn %s on and finish all WebP generation to get maximum result.', 'litespeed-cache' ), '<code>' . esc_html( Lang::title( Base::O_IMG_OPTM_WEBP ) ) . '</code>' ); ?>
[85] Fix | Delete
</font>
[86] Fix | Delete
<?php endif; ?>
[87] Fix | Delete
</div>
[88] Fix | Delete
</td>
[89] Fix | Delete
</tr>
[90] Fix | Delete
[91] Fix | Delete
<tr>
[92] Fix | Delete
<th>
[93] Fix | Delete
<?php $option_id = Base::O_SERVER_IP; ?>
[94] Fix | Delete
<?php $this->title( $option_id ); ?>
[95] Fix | Delete
</th>
[96] Fix | Delete
<td>
[97] Fix | Delete
<?php $this->build_input( $option_id ); ?>
[98] Fix | Delete
<div class="litespeed-desc">
[99] Fix | Delete
<?php esc_html_e( "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' ); ?>
[100] Fix | Delete
<br /><?php esc_html_e( 'Your server IP', 'litespeed-cache' ); ?>: <code id='litespeed_server_ip'>-</code> <a href="javascript:;" class="button button-link" id="litespeed_get_ip"><?php esc_html_e( 'Check my public IP from', 'litespeed-cache' ); ?> CyberPanel.sh</a>
[101] Fix | Delete
⚠️ <?php esc_html_e( 'Notice', 'litespeed-cache' ); ?>: <?php esc_html_e( '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' ); ?>
[102] Fix | Delete
<br /><?php esc_html_e( 'Please make sure this IP is the correct one for visiting your site.', 'litespeed-cache' ); ?>
[103] Fix | Delete
[104] Fix | Delete
<?php $this->_validate_ip( $option_id ); ?>
[105] Fix | Delete
</div>
[106] Fix | Delete
</td>
[107] Fix | Delete
</tr>
[108] Fix | Delete
[109] Fix | Delete
<tr>
[110] Fix | Delete
<th>
[111] Fix | Delete
<?php $option_id = Base::O_NEWS; ?>
[112] Fix | Delete
<?php $this->title( $option_id ); ?>
[113] Fix | Delete
</th>
[114] Fix | Delete
<td>
[115] Fix | Delete
<?php $this->build_switch( $option_id ); ?>
[116] Fix | Delete
<div class="litespeed-desc">
[117] Fix | Delete
<?php esc_html_e( 'Turn this option ON to show latest news automatically, including hotfixes, new releases, available beta versions, and promotions.', 'litespeed-cache' ); ?>
[118] Fix | Delete
</div>
[119] Fix | Delete
</td>
[120] Fix | Delete
</tr>
[121] Fix | Delete
[122] Fix | Delete
</tbody>
[123] Fix | Delete
</table>
[124] Fix | Delete
[125] Fix | Delete
<?php $this->form_end(); ?>
[126] Fix | Delete
[127] Fix | Delete
<script>
[128] Fix | Delete
(function ($) {
[129] Fix | Delete
jQuery(document).ready(function () {
[130] Fix | Delete
/**
[131] Fix | Delete
* Get server IP
[132] Fix | Delete
* @since 3.0
[133] Fix | Delete
*/
[134] Fix | Delete
$('#litespeed_get_ip').on('click', function (e) {
[135] Fix | Delete
console.log('[litespeed] get server IP');
[136] Fix | Delete
$.ajax({
[137] Fix | Delete
url: '<?php echo $ajax_url_get_ip; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>',
[138] Fix | Delete
dataType: 'json',
[139] Fix | Delete
beforeSend: function (xhr) {
[140] Fix | Delete
xhr.setRequestHeader('X-WP-Nonce', '<?php echo esc_js(wp_create_nonce('wp_rest')); ?>');
[141] Fix | Delete
$('#litespeed_server_ip').html('Detecting...');
[142] Fix | Delete
},
[143] Fix | Delete
success: function (data) {
[144] Fix | Delete
$('#litespeed_server_ip').html('Done');
[145] Fix | Delete
console.log('[litespeed] get server IP response: ' + data);
[146] Fix | Delete
$('#litespeed_server_ip').html(data);
[147] Fix | Delete
},
[148] Fix | Delete
error: function (xhr, error) {
[149] Fix | Delete
console.log('[litespeed] get server IP error', error);
[150] Fix | Delete
$('#litespeed_server_ip').html('Failed to detect IP');
[151] Fix | Delete
},
[152] Fix | Delete
complete: function (xhr, status) {
[153] Fix | Delete
console.log('[litespeed] AJAX complete', status, xhr);
[154] Fix | Delete
},
[155] Fix | Delete
});
[156] Fix | Delete
});
[157] Fix | Delete
});
[158] Fix | Delete
})(jQuery);
[159] Fix | Delete
</script>
[160] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function