| Server IP : 172.67.133.75 / Your IP : 104.23.197.161 Web Server : nginx/1.26.1 System : Linux HE9229 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/jl3_ph_com/wp-content/plugins/litespeed-cache/tpl/general/ |
Upload File : |
<?php
/**
* LiteSpeed Cache Guest Mode Setting
*
* Manages the Guest Mode setting for LiteSpeed Cache.
*
* @package LiteSpeed
* @since 1.0.0
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit;
$guest_update_url = wp_parse_url( LSWCP_PLUGIN_URL . GUI::PHP_GUEST, PHP_URL_PATH );
?>
<tr>
<th>
<?php $option_id = Base::O_GUEST; ?>
<?php $this->title( $option_id ); ?>
</th>
<td>
<?php $this->build_switch( $option_id ); ?>
<div class="litespeed-desc">
<?php esc_html_e( "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 esc_html_e( '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( $option_id ) ) : ?>
<div class="litespeed-desc">
<?php esc_html_e( 'Guest Mode testing result', 'litespeed-cache' ); ?>:
<font id='litespeed_gm_status'><?php esc_html_e( 'Testing', 'litespeed-cache' ); ?>...</font>
</div>
<div class="litespeed-desc">
<?php esc_html_e( 'Guest Mode IP/UA sync status', 'litespeed-cache' ); ?>:
<font id='litespeed_gm_sync_status'><?php esc_html_e( 'Syncing', 'litespeed-cache' ); ?>...</font>
</div>
<script>
(function ($) {
jQuery(document).ready(function () {
$.post( '<?php echo $guest_update_url; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>', function(data){
if ( data === '[]' || data === '{"reload":"yes"}' ) {
$('#litespeed_gm_status').html('<font class="litespeed-success"><?php esc_html_e( 'Guest Mode passed testing.', 'litespeed-cache' ); ?></font>');
}
else {
$('#litespeed_gm_status').html('<font class="litespeed-danger"><?php esc_html_e( 'Guest Mode failed to test.', 'litespeed-cache' ); ?></font>');
}
}).fail( function(){
$('#litespeed_gm_status').html('<font class="litespeed-danger"><?php esc_html_e( 'Guest Mode failed to test.', 'litespeed-cache' ); ?></font>');
});
// Sync Guest Mode IP/UA lists
$.ajax({
url: '<?php echo esc_url( rest_url( 'litespeed/v1/guest/sync' ) ); ?>',
dataType: 'json',
beforeSend: function(xhr) {
xhr.setRequestHeader('X-WP-Nonce', '<?php echo esc_js( wp_create_nonce( 'wp_rest' ) ); ?>');
},
success: function(data) {
if (data && data.success) {
$('#litespeed_gm_sync_status').html('<font class="litespeed-success"><?php esc_html_e( 'Synced successfully.', 'litespeed-cache' ); ?></font>');
} else {
$('#litespeed_gm_sync_status').html('<font class="litespeed-warning"><?php esc_html_e( 'Sync failed.', 'litespeed-cache' ); ?></font>');
}
},
error: function() {
$('#litespeed_gm_sync_status').html('<font class="litespeed-warning"><?php esc_html_e( 'Sync failed.', 'litespeed-cache' ); ?></font>');
}
});
});
})(jQuery);
</script>
<?php endif; ?>
</td>
</tr>