Changeset 3146649
- Timestamp:
- 09/04/2024 09:26:10 PM (15 months ago)
- Location:
- litespeed-cache
- Files:
-
- 44 edited
-
tags/6.4.1/data/const.default.ini (modified) (1 diff)
-
tags/6.4.1/data/const.network_default.ini (modified) (1 diff)
-
tags/6.4.1/data/esi.nonces.txt (modified) (1 diff)
-
tags/6.4.1/litespeed-cache.php (modified) (2 diffs)
-
tags/6.4.1/readme.txt (modified) (1 diff)
-
tags/6.4.1/src/base.cls.php (modified) (3 diffs)
-
tags/6.4.1/src/cloud.cls.php (modified) (1 diff)
-
tags/6.4.1/src/debug2.cls.php (modified) (6 diffs)
-
tags/6.4.1/src/esi.cls.php (modified) (4 diffs)
-
tags/6.4.1/src/htaccess.cls.php (modified) (1 diff)
-
tags/6.4.1/src/lang.cls.php (modified) (1 diff)
-
tags/6.4.1/src/object-cache.cls.php (modified) (5 diffs)
-
tags/6.4.1/src/optimize.cls.php (modified) (1 diff)
-
tags/6.4.1/src/optimizer.cls.php (modified) (1 diff)
-
tags/6.4.1/src/rest.cls.php (modified) (2 diffs)
-
tags/6.4.1/src/router.cls.php (modified) (1 diff)
-
tags/6.4.1/thirdparty/user-switching.cls.php (modified) (1 diff)
-
tags/6.4.1/thirdparty/woocommerce.cls.php (modified) (1 diff)
-
tags/6.4.1/tpl/toolbox/beta_test.tpl.php (modified) (1 diff)
-
tags/6.4.1/tpl/toolbox/log_viewer.tpl.php (modified) (7 diffs)
-
tags/6.4.1/tpl/toolbox/report.tpl.php (modified) (2 diffs)
-
tags/6.4.1/tpl/toolbox/settings-debug.tpl.php (modified) (3 diffs)
-
trunk/data/const.default.ini (modified) (1 diff)
-
trunk/data/const.network_default.ini (modified) (1 diff)
-
trunk/data/esi.nonces.txt (modified) (1 diff)
-
trunk/litespeed-cache.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src/base.cls.php (modified) (3 diffs)
-
trunk/src/cloud.cls.php (modified) (1 diff)
-
trunk/src/debug2.cls.php (modified) (6 diffs)
-
trunk/src/esi.cls.php (modified) (4 diffs)
-
trunk/src/htaccess.cls.php (modified) (1 diff)
-
trunk/src/lang.cls.php (modified) (1 diff)
-
trunk/src/object-cache.cls.php (modified) (5 diffs)
-
trunk/src/optimize.cls.php (modified) (1 diff)
-
trunk/src/optimizer.cls.php (modified) (1 diff)
-
trunk/src/rest.cls.php (modified) (2 diffs)
-
trunk/src/router.cls.php (modified) (1 diff)
-
trunk/thirdparty/user-switching.cls.php (modified) (1 diff)
-
trunk/thirdparty/woocommerce.cls.php (modified) (1 diff)
-
trunk/tpl/toolbox/beta_test.tpl.php (modified) (1 diff)
-
trunk/tpl/toolbox/log_viewer.tpl.php (modified) (7 diffs)
-
trunk/tpl/toolbox/report.tpl.php (modified) (2 diffs)
-
trunk/tpl/toolbox/settings-debug.tpl.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
litespeed-cache/tags/6.4.1/data/const.default.ini
r3146646 r3146649 264 264 debug-filesize = 3 265 265 266 ; O_DEBUG_COOKIE 267 debug-cookie = false 268 266 269 ; O_DEBUG_COLLAPSE_QS 267 270 debug-collapse_qs = false -
litespeed-cache/tags/6.4.1/data/const.network_default.ini
r3146646 r3146649 122 122 debug-filesize = 3 123 123 124 ; O_DEBUG_COOKIE 125 debug-cookie = false 126 124 127 ; O_DEBUG_COLLAPSE_QS 125 128 debug-collapse_qs = false -
litespeed-cache/tags/6.4.1/data/esi.nonces.txt
r3146646 r3146649 72 72 wpmenucart private 73 73 74 # Advanced Custom Fields + Advanced Forms75 acf_nonce76 af_form_nonce77 af_submission_*78 79 74 # Woo nonce 80 75 woocommerce-login -
litespeed-cache/tags/6.4.1/litespeed-cache.php
r3146646 r3146649 5 5 * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration 6 6 * Description: High-performance page caching and site optimization from LiteSpeed 7 * Version: 6. 57 * Version: 6.4.1 8 8 * Author: LiteSpeed Technologies 9 9 * Author URI: https://www.litespeedtech.com … … 35 35 } 36 36 37 !defined('LSCWP_V') && define('LSCWP_V', '6. 5');37 !defined('LSCWP_V') && define('LSCWP_V', '6.4.1'); 38 38 39 39 !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); -
litespeed-cache/tags/6.4.1/readme.txt
r3146646 r3146649 255 255 == Changelog == 256 256 257 = 6.5 - Sep 4 2024 =258 *❗**Security** This release includes several debug log improvements for improved security, as listed below. Update strongly recommended.259 * **Debug** Moved debug log to litespeed individual folder `/wp-content/litespeed/debug/`.260 * **Debug** Disallowed visits to `/litespeed/debug/` folder log files in .htaccess.261 * **Debug** Dropped const `LSCWP_DEBUG_PATH` support.262 * **Debug** Renamed `debug.purge.log` to `purge.log`.263 * **Debug** Added dummy `index.php` for debug folder.264 * **Debug** Used random string for log filenames.265 * **Debug** Removed cookies-related info. (Thanks to Rafie)266 * **Debug** Dropped `Log Cookies` option.267 * **Report** Escaped report content to protect it from potential XSS attack. (Islam R alsaid #505746)268 * **ESI** Added nonce for Advanced Custom Fields + Advanced Forms. (David Lapointe Gilbert #439)269 * **Purge** Run ACTION_PURGE_EMPTYCACHE even if cache is disabled in network admin. (Philip #453)270 * **Page Optimize** Disable UCSS exclusion when UCSS is inactived. (#640)271 * **3rd** Fixed undefined warning in WooCommerce Widgets. (Lolosan #719)272 * **3rd** Correct the integration with User Switching. (John Blackbourn #725)273 * **3rd** Fixed Admin Bar Missing issue on DIVI + Elementor frontend. (thyran/robertstaddon PR#727)274 275 257 = 6.4.1 - Aug 19 2024 = 276 258 * ❗**Security** This release patches a security issue that may affect previous LSCWP versions since v1.9. -
litespeed-cache/tags/6.4.1/src/base.cls.php
r3146646 r3146649 111 111 const O_DEBUG_LEVEL = 'debug-level'; 112 112 const O_DEBUG_FILESIZE = 'debug-filesize'; 113 const O_DEBUG_COOKIE = 'debug-cookie'; // For backwards compatibility, will drop after v7.0113 const O_DEBUG_COOKIE = 'debug-cookie'; 114 114 const O_DEBUG_COLLAPSE_QS = 'debug-collapse_qs'; 115 115 const O_DEBUG_COLLAPS_QS = 'debug-collapse_qs'; // For backwards compatibility, will drop after v6.5 … … 407 407 self::O_DEBUG_LEVEL => false, 408 408 self::O_DEBUG_FILESIZE => 0, 409 self::O_DEBUG_COOKIE => false, 409 410 self::O_DEBUG_COLLAPSE_QS => false, 410 411 self::O_DEBUG_INC => array(), … … 593 594 self::O_DEBUG_LEVEL => false, 594 595 self::O_DEBUG_FILESIZE => 0, 596 self::O_DEBUG_COOKIE => false, 595 597 self::O_DEBUG_COLLAPSE_QS => false, 596 598 self::O_DEBUG_INC => array(), -
litespeed-cache/tags/6.4.1/src/cloud.cls.php
r3146646 r3146649 1548 1548 1549 1549 /** 1550 * Return pong for ping to check PHP function availability1551 * @since 6.51552 */1553 public function ping()1554 {1555 $resp = array(1556 'v_lscwp' => Core::VER,1557 'v_php' => PHP_VERSION,1558 'v_wp' => $GLOBALS['wp_version'],1559 );1560 if (!empty($_POST['funcs'])) {1561 foreach ($_POST['funcs'] as $func) {1562 $resp[$func] = function_exists($func) ? 'y' : 'n';1563 }1564 }1565 if (!empty($_POST['classes'])) {1566 foreach ($_POST['classes'] as $cls) {1567 $resp[$cls] = class_exists($cls) ? 'y' : 'n';1568 }1569 }1570 return self::ok($resp);1571 }1572 1573 /**1574 1550 * Handle all request actions from main cls 1575 1551 * -
litespeed-cache/tags/6.4.1/src/debug2.cls.php
r3146646 r3146649 32 32 public function __construct() 33 33 { 34 self::$log_path_prefix = LITESPEED_STATIC_DIR . '/debug/'; 35 // Maybe move legacy log files 36 $this->_maybe_init_folder(); 37 38 self::$log_path = $this->path('debug'); 34 self::$log_path_prefix = defined('LSCWP_DEBUG_PATH') ? LSCWP_DEBUG_PATH : LSCWP_CONTENT_DIR; 35 self::$log_path = self::$log_path_prefix . '/debug.log'; 39 36 if (!empty($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'lscache_') === 0) { 40 self::$log_path = $this->path('crawler');37 self::$log_path = self::$log_path_prefix . '/crawler.log'; 41 38 } 42 39 … … 51 48 52 49 /** 53 * Try moving legacy logs into /litespeed/debug/ folder54 *55 * @since 6.556 */57 private function _maybe_init_folder()58 {59 if (file_exists(self::$log_path_prefix . 'index.php')) {60 return;61 }62 file::save(self::$log_path_prefix . 'index.php', '<?php // Silence is golden.', true);63 64 $logs = array('debug', 'debug.purge', 'crawler');65 foreach ($logs as $log) {66 if (file_exists(LSCWP_CONTENT_DIR . '/' . $log . '.log')) {67 rename(LSCWP_CONTENT_DIR . '/' . $log . '.log', $this->path($log));68 }69 }70 }71 72 /**73 * Generate log file path74 *75 * @since 6.576 */77 public function path($type)78 {79 return self::$log_path_prefix . self::FilePath($type);80 }81 82 /**83 * Generate the fixed log filename84 *85 * @since 6.586 */87 public static function FilePath($type)88 {89 if ($type == 'debug.purge') {90 $type = 'purge';91 }92 $rand = substr(md5(substr(AUTH_KEY, -16)), -16);93 return $type . $rand . '.log';94 }95 96 /**97 50 * End call of one request process 98 51 * @since 4.7 … … 101 54 public static function ended() 102 55 { 103 $headers = headers_list(); 104 foreach ($headers as $key => $header) { 105 if (stripos($header, 'Set-Cookie') === 0) { 106 unset($headers[$key]); 107 } 108 } 109 self::debug('Response headers', $headers); 56 self::debug('Response headers', headers_list()); 110 57 111 58 $elapsed_time = number_format((microtime(true) - LSCWP_TS_0) * 1000, 2); … … 197 144 } 198 145 199 $purge_file = self:: cls()->path('purge');146 $purge_file = self::$log_path_prefix . '/debug.purge.log'; 200 147 201 148 self::cls()->_init_request($purge_file); … … 320 267 $params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING']; 321 268 } 322 // $params[] = 'Cookie: ' . $server['HTTP_COOKIE']; 269 if ($this->conf(Base::O_DEBUG_COOKIE)) { 270 $params[] = 'Cookie: ' . $server['HTTP_COOKIE']; 271 } 323 272 if (isset($_COOKIE['_lscache_vary'])) { 324 273 $params[] = 'Cookie _lscache_vary: ' . $_COOKIE['_lscache_vary']; … … 528 477 private function _clear_log() 529 478 { 530 $logs = array('debug', ' purge', 'crawler');479 $logs = array('debug', 'debug.purge', 'crawler'); 531 480 foreach ($logs as $log) { 532 File::save( $this->path($log), '');481 File::save(self::$log_path_prefix . "/{$log}.log", ''); 533 482 } 534 483 } -
litespeed-cache/tags/6.4.1/src/esi.cls.php
r3146646 r3146649 22 22 private static $has_esi = false; 23 23 private static $_combine_ids = array(); 24 private $admin_rendered = false; 24 25 private $esi_args = null; 25 26 private $_esi_preserve_list = array(); … … 365 366 // Add admin_bar esi 366 367 if (Router::is_logged_in()) { 367 remove_action('wp_body_open', 'wp_admin_bar_render', 0); // Remove default Admin bar. Fix https://github.com/elementor/elementor/issues/25198 368 // Remove default Admin bar. Fix https://github.com/elementor/elementor/issues/25198 369 remove_action('wp_body_open', 'wp_admin_bar_render', 0); 370 add_action('wp_body_open', array($this, 'sub_admin_bar_block'), 0); 368 371 remove_action('wp_footer', 'wp_admin_bar_render', 1000); 369 372 add_action('wp_footer', array($this, 'sub_admin_bar_block'), 1000); … … 768 771 global $wp_admin_bar; 769 772 773 if ($this->admin_rendered) { 774 return; 775 } 776 770 777 if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) { 771 778 return; … … 777 784 ); 778 785 786 $this->admin_rendered = true; 779 787 echo $this->sub_esi_block('admin-bar', 'adminbar', $params); 780 788 } -
litespeed-cache/tags/6.4.1/src/htaccess.cls.php
r3146646 r3146649 94 94 'CacheLookup on', 95 95 'RewriteRule .* - [E=Cache-Control:no-autoflush]', 96 'RewriteRule ' . preg_quote(LITESPEED_DATA_FOLDER) . '/debug/.*\.log$ - [F,L]',96 // "RewriteRule \.object-cache\.ini - [F,L]", 97 97 'RewriteRule ' . preg_quote(self::CONF_FILE) . ' - [F,L]', 98 98 ); -
litespeed-cache/tags/6.4.1/src/lang.cls.php
r3146646 r3146649 270 270 self::O_DEBUG_LEVEL => __('Debug Level', 'litespeed-cache'), 271 271 self::O_DEBUG_FILESIZE => __('Log File Size Limit', 'litespeed-cache'), 272 self::O_DEBUG_COOKIE => __('Log Cookies', 'litespeed-cache'), 272 273 self::O_DEBUG_COLLAPSE_QS => __('Collapse Query Strings', 'litespeed-cache'), 273 274 self::O_DEBUG_INC => __('Debug URI Includes', 'litespeed-cache'), -
litespeed-cache/tags/6.4.1/src/object-cache.cls.php
r3146646 r3146649 1 1 <?php 2 3 2 /** 4 3 * The object cache class … … 9 8 * @author LiteSpeed Technologies <[email protected]> 10 9 */ 11 12 10 namespace LiteSpeed; 13 14 11 defined('WPINC') || exit(); 15 12 … … 62 59 public function __construct($cfg = false) 63 60 { 61 $this->debug_oc('-------------'); 62 $this->debug_oc('init'); 63 64 64 if ($cfg) { 65 65 if (!is_array($cfg[Base::O_OBJECT_GLOBAL_GROUPS])) { … … 159 159 } 160 160 161 $LITESPEED_DATA_FOLDER = defined('LITESPEED_DATA_FOLDER') ? LITESPEED_DATA_FOLDER : 'litespeed'; 162 $LSCWP_CONTENT_DIR = defined('LSCWP_CONTENT_DIR') ? LSCWP_CONTENT_DIR : WP_CONTENT_DIR; 163 $LITESPEED_STATIC_DIR = $LSCWP_CONTENT_DIR . '/' . $LITESPEED_DATA_FOLDER; 164 $log_path_prefix = $LITESPEED_STATIC_DIR . '/debug/'; 165 166 error_log(gmdate('m/d/y H:i:s') . ' - OC - ' . $text . PHP_EOL, 3, $log_path_prefix . Debug2::FilePath('debug')); 161 error_log(gmdate('m/d/y H:i:s') . ' - ' . $text . PHP_EOL, 3, WP_CONTENT_DIR . '/debug.log'); 167 162 } 168 163 … … 348 343 } 349 344 restore_error_handler(); 350 } else { // Connect to Memcached 345 } /** 346 * Connect to Memcached 347 */ else { 351 348 if ($this->_cfg_persistent) { 352 349 $this->_conn = new \Memcached($this->_get_mem_id()); -
litespeed-cache/tags/6.4.1/src/optimize.cls.php
r3146646 r3146649 1090 1090 1091 1091 // Check if need to inline this css file 1092 if ( $this->conf(self::O_OPTM_UCSS) &&Utility::str_hit_array($attrs['href'], $ucss_file_exc_inline)) {1092 if (Utility::str_hit_array($attrs['href'], $ucss_file_exc_inline)) { 1093 1093 Debug2::debug('[Optm] ucss_file_exc_inline hit ' . $attrs['href']); 1094 1094 // Replace this css to inline from orig html -
litespeed-cache/tags/6.4.1/src/optimizer.cls.php
r3146646 r3146649 58 58 $content_final = $obj->process(); 59 59 // check if content from minification is empty 60 if ($content_final == ''){60 if($content_final == ''){ 61 61 Debug2::debug('Failed to minify HTML: HTML minification resulted in empty HTML'); 62 62 return $content; -
litespeed-cache/tags/6.4.1/src/rest.cls.php
r3146646 r3146649 73 73 'permission_callback' => array($this, 'is_from_cloud'), 74 74 )); 75 register_rest_route('litespeed/v 3', '/ping', array(76 'methods' => ' POST',75 register_rest_route('litespeed/v1', '/ping', array( 76 'methods' => 'GET', 77 77 'callback' => array($this, 'ping'), 78 'permission_callback' => array($this, 'is_from_cloud'),78 'permission_callback' => '__return_true', 79 79 )); 80 80 … … 169 169 public function ping() 170 170 { 171 return $this->cls('Cloud')->ping();171 return Cloud::ok(array('ver' => Core::VER)); 172 172 } 173 173 -
litespeed-cache/tags/6.4.1/src/router.cls.php
r3146646 r3146649 604 604 605 605 case Core::ACTION_PURGE_EMPTYCACHE: // todo: moved to purge.cls type action 606 if ( (defined('LITESPEED_ON') || $_is_network_admin) && ($_can_network_option || (!$_is_multisite && $_can_option))) {606 if (defined('LITESPEED_ON') && ($_can_network_option || (!$_is_multisite && $_can_option))) { 607 607 self::$_action = $action; 608 608 } -
litespeed-cache/tags/6.4.1/thirdparty/user-switching.cls.php
r3146646 r3146649 13 13 public static function detect() 14 14 { 15 if (! class_exists('user_switching')) {15 if (!defined('user_switching')) { 16 16 return; 17 17 } -
litespeed-cache/tags/6.4.1/thirdparty/woocommerce.cls.php
r3146646 r3146649 729 729 return; 730 730 } 731 732 731 global $wp_widget_factory; 733 if (!isset($wp_widget_factory->widgets['WC_Widget_Recent_Reviews'])) {734 return;735 }736 737 732 $recent_reviews = $wp_widget_factory->widgets['WC_Widget_Recent_Reviews']; 738 733 if (!is_null($recent_reviews)) { -
litespeed-cache/tags/6.4.1/tpl/toolbox/beta_test.tpl.php
r3146646 r3146649 7 7 // Existing public version list 8 8 $v_list = array( 9 '6.5',10 9 '6.4.1', 11 10 '6.3.0.1', -
litespeed-cache/tags/6.4.1/tpl/toolbox/log_viewer.tpl.php
r3146646 r3146649 3 3 namespace LiteSpeed; 4 4 5 defined( 'WPINC') || exit;5 defined( 'WPINC' ) || exit; 6 6 7 7 $logs = … … 9 9 array( 10 10 'name' => 'debug', 11 'label' => esc_html__( 'Debug Log', 'litespeed-cache'),11 'label' => esc_html__( 'Debug Log', 'litespeed-cache' ), 12 12 'accesskey' => 'A', 13 13 ), 14 14 array( 15 'name' => ' purge',16 'label' => esc_html__( 'Purge Log', 'litespeed-cache'),15 'name' => 'debug.purge', 16 'label' => esc_html__( 'Purge Log', 'litespeed-cache' ), 17 17 'accesskey' => 'B', 18 18 ), 19 19 array( 20 20 'name' => 'crawler', 21 'label' => esc_html__( 'Crawler Log', 'litespeed-cache'),21 'label' => esc_html__( 'Crawler Log', 'litespeed-cache' ), 22 22 'accesskey' => 'C', 23 23 ), … … 28 28 * @since 4.7 29 29 */ 30 function subnav_link($item) 31 { 30 function subnav_link( $item ) { 32 31 $class = 'button '; 33 32 $subtab = ''; 34 33 35 if ( !isset($item['url'])) {34 if ( ! isset( $item['url'] ) ) { 36 35 $class .= 'button-secondary'; 37 36 $subtab_name = "{$item['name']}_log"; 38 37 $subtab = "data-litespeed-subtab='{$subtab_name}'"; 39 $url = "#{$subtab_name}"; 40 } else { 38 $url ="#{$subtab_name}"; 39 } 40 else { 41 41 $class .= 'button-primary'; 42 42 $url = $item['url']; … … 44 44 45 45 $accesskey = 46 isset( $item['accesskey'])46 isset( $item['accesskey'] ) 47 47 ? "litespeed-accesskey='{$item['accesskey']}'" 48 48 : ''; 49 $label = isset( $item['label']) ? $item['label'] : $item['name'];49 $label = isset( $item['label'] ) ? $item['label'] : $item['name']; 50 50 51 51 return "<a href='{$url}' class='{$class}' {$subtab} {$accesskey}>{$label}</a>"; … … 56 56 * @since 4.7 57 57 */ 58 function clear_logs_link($accesskey = null) 59 { 58 function clear_logs_link( $accesskey = null ) { 60 59 $item = 61 60 array( 62 'label' => esc_html__( 'Clear Logs', 'litespeed-cache'),63 'url' => Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG),61 'label' => esc_html__( 'Clear Logs', 'litespeed-cache' ), 62 'url' => Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG ), 64 63 ); 65 if ( null !== $accesskey) {64 if ( null !== $accesskey ) { 66 65 $item['accesskey'] = $accesskey; 67 66 } 68 echo subnav_link( $item);67 echo subnav_link( $item ); 69 68 } 70 69 … … 72 71 $log_views = array(); 73 72 74 foreach ($logs as $log) {75 $subnav_links[] = subnav_link( $log);73 foreach( $logs as $log ) { 74 $subnav_links[] = subnav_link( $log ); 76 75 77 $file = $this->cls('Debug2')->path($log['name']);78 $lines = File::count_lines( $file);76 $file = LSCWP_CONTENT_DIR . "/{$log['name']}.log"; 77 $lines = File::count_lines( $file ); 79 78 $start = $lines > 1000 ? $lines - 1000 : 0; 80 $lines = File::read( $file, $start);81 $lines = $lines ? trim( implode("\n", $lines)) : '';79 $lines = File::read( $file, $start ); 80 $lines = $lines ? trim( implode( "\n", $lines ) ) : ''; 82 81 83 82 $log_views[] = 84 83 "<div class='litespeed-log-view-wrapper' data-litespeed-sublayout='{$log['name']}_log'>" 85 . "<h3 class='litespeed-title'>{$log['label']}</h3>"86 . '<div class="litespeed-log-body">'87 . nl2br(htmlspecialchars($lines))88 . '</div>'84 . "<h3 class='litespeed-title'>{$log['label']}</h3>" 85 . '<div class="litespeed-log-body">' 86 . nl2br( htmlspecialchars( $lines ) ) 87 . '</div>' 89 88 . '</div>'; 90 89 } … … 92 91 93 92 <h3 class="litespeed-title"> 94 <?php esc_html_e( 'LiteSpeed Logs', 'litespeed-cache'); ?>95 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#log-view-tab'); ?>93 <?php esc_html_e( 'LiteSpeed Logs', 'litespeed-cache' ); ?> 94 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#log-view-tab' ); ?> 96 95 </h3> 97 96 98 97 <div class="litespeed-log-subnav-wrapper"> 99 <?php echo implode( "\n", $subnav_links); ?>100 <?php clear_logs_link( 'D'); ?>98 <?php echo implode( "\n", $subnav_links ); ?> 99 <?php clear_logs_link( 'D' ); ?> 101 100 </div> 102 101 103 <?php echo implode( "\n", $log_views); ?>102 <?php echo implode( "\n", $log_views ); ?> 104 103 105 104 <?php -
litespeed-cache/tags/6.4.1/tpl/toolbox/report.tpl.php
r3146646 r3146649 1 1 <?php 2 namespace LiteSpeed ; 3 defined( 'WPINC' ) || exit ; 2 4 3 namespace LiteSpeed; 4 5 defined('WPINC') || exit; 6 7 $_report = Report::cls(); 5 $_report = Report::cls() ; 8 6 $report = $_report->generate_environment_report(); 9 7 10 $env_ref = Report::get_summary() ;8 $env_ref = Report::get_summary() ; 11 9 12 10 // Detect password less plugin 13 11 $link = ''; 14 12 $has_pswdless_plugin = false; 15 if ( function_exists('dologin_gen_link')) {13 if ( function_exists( 'dologin_gen_link' ) ) { 16 14 $has_pswdless_plugin = true; 17 if (!empty($_GET['dologin_gen_link'])) { 18 unset($_GET['dologin_gen_link']); 19 $link = dologin_gen_link('Litespeed Report'); 20 ?> 21 <script> 22 window.history.pushState('remove_gen_link', document.title, window.location.href.replace('&dologin_gen_link=1', '')); 23 </script> 24 <?php 15 if ( ! empty( $_GET[ 'dologin_gen_link' ] ) ) { 16 unset( $_GET[ 'dologin_gen_link' ] ); 17 $link = dologin_gen_link( 'Litespeed Report' ); 18 ?> 19 <script>window.history.pushState( 'remove_gen_link', document.title, window.location.href.replace( '&dologin_gen_link=1', '' ) );</script> 20 <?php 25 21 } 26 22 } 27 23 28 $install_link = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_3RD, false, null, array('plugin' => 'dologin'));24 $install_link = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_3RD, false, null, array( 'plugin' => 'dologin' ) ); 29 25 ?> 30 26 31 <?php if ( !$has_pswdless_plugin) : ?>27 <?php if ( ! $has_pswdless_plugin ) : ?> 32 28 <div class="litespeed-callout notice notice-warning inline"> 33 <h4><?php echo __( 'NOTICE:', 'litespeed-cache'); ?></h4>29 <h4><?php echo __( 'NOTICE:', 'litespeed-cache' ); ?></h4> 34 30 <p> 35 <?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>'); ?>31 <?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>' ); ?> 36 32 </p> 37 33 <p> 38 <a href="<?php echo $install_link; ?>" class="button litespeed-btn litespeed-right20"><?php echo __( 'Install DoLogin Security', 'litespeed-cache'); ?></a>39 <a href="plugin-install.php?s=dologin+security&tab=search&type=term" target="_blank"><?php echo __( 'Go to plugins list', 'litespeed-cache'); ?></a>34 <a href="<?php echo $install_link; ?>" class="button litespeed-btn litespeed-right20"><?php echo __( 'Install DoLogin Security', 'litespeed-cache' ); ?></a> 35 <a href="plugin-install.php?s=dologin+security&tab=search&type=term" target="_blank"><?php echo __( 'Go to plugins list', 'litespeed-cache' ); ?></a> 40 36 </p> 41 37 </div> … … 43 39 44 40 <h3 class="litespeed-title"> 45 <?php echo __('LiteSpeed Report', 'litespeed-cache') ; ?>46 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#report-tab'); ?>41 <?php echo __('LiteSpeed Report', 'litespeed-cache') ; ?> 42 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#report-tab' ); ?> 47 43 </h3> 48 44 49 <p><?php echo __('Report number', 'litespeed-cache') ; ?>: <b><?php echo !empty($env_ref['num']) ? $env_ref['num'] : '-'; ?></b></p>50 <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>45 <p><?php echo __('Report number', 'litespeed-cache') ; ?>: <b><?php echo ! empty( $env_ref[ 'num' ] ) ? $env_ref[ 'num' ] : '-' ; ?></b></p> 46 <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> 51 47 52 48 <p class="litespeed-desc"> 53 <?php echo __( 'The environment report contains detailed information about the WordPress configuration.', 'litespeed-cache'); ?>49 <?php echo __( 'The environment report contains detailed information about the WordPress configuration.', 'litespeed-cache' ); ?> 54 50 <br /> 55 51 <?php echo __('If you run into any issues, please refer to the report number in your support message.', 'litespeed-cache'); ?> 56 52 </p> 57 53 58 <form action="<?php echo Utility::build_url(Router::ACTION_REPORT, Report::TYPE_SEND_REPORT); ?>" method="post" class="litespeed-relative"> 59 <table class="wp-list-table striped litespeed-table"> 60 <tbody> 61 <tr> 62 <th><?php echo __('System Information', 'litespeed-cache'); ?></th> 63 <td> 64 <textarea id="litespeed-report" rows="20" cols="100" readonly><?php echo esc_textarea($report); ?></textarea> 65 </td> 66 </tr> 67 <tr> 68 <th><?php echo __('Passwordless Link', 'litespeed-cache'); ?></th> 69 <td> 70 <input type="text" class="litespeed-regular-text" id="litespeed-report-link" name="link" value="<?php echo $link; ?>" style="width:500px;" /> 71 <?php if ($has_pswdless_plugin) : ?> 72 <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> 73 <?php else : ?> 74 <button type="button" class="button button-secondary" disabled><?php echo __('Generate Link for Current User', 'litespeed-cache'); ?></button> 75 <?php endif; ?> 76 <div class="litespeed-desc"> 77 <?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'); ?> 78 <?php if ($link) : ?> 79 <br /><strong>🚨 <?php echo __('Please do NOT share the above passwordless link with anyone.', 'litespeed-cache'); ?></strong> 80 <strong><?php echo sprintf(__('Generated links may be managed under <a %s>Settings</a>.', 'litespeed-cache'), 'href="' . menu_page_url('dologin', 0) . '"'); ?></strong> 81 <?php endif; ?> 82 </div> 83 </td> 84 </tr> 85 <tr> 86 <th><?php echo __('Notes', 'litespeed-cache'); ?></th> 87 <td> 88 <textarea name="notes" rows="10" cols="100"></textarea> 89 <div class="litespeed-desc"> 90 <?php echo __('Optional', 'litespeed-cache'); ?>: 91 <?php echo __('provide more information here to assist the LiteSpeed team with debugging.', 'litespeed-cache'); ?> 92 </div> 93 </td> 94 </tr> 95 </tbody> 96 </table> 54 <form action="<?php echo Utility::build_url( Router::ACTION_REPORT, Report::TYPE_SEND_REPORT ); ?>" method="post" class="litespeed-relative"> 55 <table class="wp-list-table striped litespeed-table"><tbody> 56 <tr> 57 <th><?php echo __( 'System Information', 'litespeed-cache' ) ; ?></th> 58 <td> 59 <textarea id="litespeed-report" rows="20" cols="100" readonly><?php echo $report; ?></textarea> 60 </td> 61 </tr> 62 <tr> 63 <th><?php echo __( 'Passwordless Link', 'litespeed-cache' ) ; ?></th> 64 <td> 65 <input type="text" class="litespeed-regular-text" id="litespeed-report-link" name="link" value="<?php echo $link; ?>" style="width:500px;" /> 66 <?php if ( $has_pswdless_plugin ) : ?> 67 <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> 68 <?php else: ?> 69 <button type="button" class="button button-secondary" disabled><?php echo __( 'Generate Link for Current User', 'litespeed-cache' ) ; ?></button> 70 <?php endif; ?> 71 <div class="litespeed-desc"> 72 <?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' ) ; ?> 73 <?php if ( $link ) : ?> 74 <br /><strong>🚨 <?php echo __('Please do NOT share the above passwordless link with anyone.', 'litespeed-cache'); ?></strong> 75 <strong><?php echo sprintf( __('Generated links may be managed under <a %s>Settings</a>.', 'litespeed-cache'), 'href="' . menu_page_url( 'dologin', 0 ) . '"' ); ?></strong> 76 <?php endif; ?> 77 </div> 78 </td> 79 </tr> 80 <tr> 81 <th><?php echo __( 'Notes', 'litespeed-cache' ) ; ?></th> 82 <td> 83 <textarea name="notes" rows="10" cols="100"></textarea> 84 <div class="litespeed-desc"> 85 <?php echo __( 'Optional', 'litespeed-cache' ); ?>: 86 <?php echo __( 'provide more information here to assist the LiteSpeed team with debugging.', 'litespeed-cache' ); ?> 87 </div> 88 </td> 89 </tr> 90 </tbody></table> 97 91 98 <div class='litespeed-top20'></div>99 <button class="button button-primary" type="submit"><?php echo __('Send to LiteSpeed', 'litespeed-cache'); ?></button>100 <button class="button button-primary litespeed-float-submit" type="submit"><?php echo __('Send to LiteSpeed', 'litespeed-cache'); ?></button>92 <div class='litespeed-top20'></div> 93 <button class="button button-primary" type="submit"><?php echo __( 'Send to LiteSpeed', 'litespeed-cache' ) ; ?></button> 94 <button class="button button-primary litespeed-float-submit" type="submit"><?php echo __( 'Send to LiteSpeed', 'litespeed-cache' ) ; ?></button> 101 95 102 <p class="litespeed-top30 litespeed-left10 litespeed-desc">103 <?php echo __('Send this report to LiteSpeed. Refer to this report number when posting in the WordPress support forum.', 'litespeed-cache'); ?>104 </p>96 <p class="litespeed-top30 litespeed-left10 litespeed-desc"> 97 <?php echo __( 'Send this report to LiteSpeed. Refer to this report number when posting in the WordPress support forum.', 'litespeed-cache' ) ; ?> 98 </p> 105 99 </form> 106 100 107 <?php include_once LSCWP_DIR . "tpl/inc/api_key.php"; ?> 101 <?php include_once LSCWP_DIR . "tpl/inc/api_key.php" ; ?> 102 -
litespeed-cache/tags/6.4.1/tpl/toolbox/settings-debug.tpl.php
r3146646 r3146649 1 1 <?php 2 namespace LiteSpeed; 3 defined( 'WPINC' ) || exit; 2 4 3 namespace LiteSpeed; 4 5 defined('WPINC') || exit; 6 7 $this->form_action($this->_is_network_admin ? Router::ACTION_SAVE_SETTINGS_NETWORK : false); 5 $this->form_action( $this->_is_network_admin ? Router::ACTION_SAVE_SETTINGS_NETWORK : false ); 8 6 ?> 9 7 … … 12 10 </h3> 13 11 14 <a href="<?php echo home_url( '/') . '?' . Router::ACTION . '=before_optm'; ?>" class="button button-success" target="_blank">15 <?php echo __( 'View Site Before Optimization', 'litespeed-cache'); ?>12 <a href="<?php echo home_url( '/' ) . '?' . Router::ACTION . '=before_optm'; ?>" class="button button-success" target="_blank"> 13 <?php echo __( 'View Site Before Optimization', 'litespeed-cache' ); ?> 16 14 </a> 17 15 18 <a href="<?php echo home_url( '/') . '?' . Router::ACTION . '=' . Core::ACTION_QS_NOCACHE; ?>" class="button button-success" target="_blank">19 <?php echo __( 'View Site Before Cache', 'litespeed-cache'); ?>16 <a href="<?php echo home_url( '/' ) . '?' . Router::ACTION . '=' . Core::ACTION_QS_NOCACHE; ?>" class="button button-success" target="_blank"> 17 <?php echo __( 'View Site Before Cache', 'litespeed-cache' ); ?> 20 18 </a> 21 19 … … 23 21 <h3 class="litespeed-title-short"> 24 22 <?php echo __('Debug Settings', 'litespeed-cache'); ?> 25 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#debug-settings-tab'); ?>23 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#debug-settings-tab' ); ?> 26 24 </h3> 27 25 28 <table class="wp-list-table striped litespeed-table"> 29 <tbody> 30 <tr> 31 <th> 32 <?php $id = Base::O_DEBUG_DISABLE_ALL; ?> 33 <?php $this->title($id); ?> 34 </th> 35 <td> 36 <?php $this->build_switch($id); ?> 37 <div class="litespeed-desc"> 38 <?php echo __('This will disable LSCache and all optimization features for debug purpose.', 'litespeed-cache'); ?> 39 </div> 40 </td> 41 </tr> 26 <table class="wp-list-table striped litespeed-table"><tbody> 27 <tr> 28 <th> 29 <?php $id = Base::O_DEBUG_DISABLE_ALL; ?> 30 <?php $this->title( $id ); ?> 31 </th> 32 <td> 33 <?php $this->build_switch( $id ); ?> 34 <div class="litespeed-desc"> 35 <?php echo __( 'This will disable LSCache and all optimization features for debug purpose.', 'litespeed-cache' ); ?> 36 </div> 37 </td> 38 </tr> 42 39 43 <tr>44 <th>45 <?php $id = Base::O_DEBUG; ?>46 <?php $this->title($id); ?>47 </th>48 <td>49 <?php $this->build_switch($id, array(__('OFF', 'litespeed-cache'), __('ON', 'litespeed-cache'), __('Admin IP Only', 'litespeed-cache'))); ?>50 <div class="litespeed-desc">51 <?php echo __('Outputs to WordPress debug log.', 'litespeed-cache'); ?>52 <?php echo __('To prevent filling up the disk, this setting should be OFF when everything is working.', 'litespeed-cache'); ?>53 <?php echo __('The Admin IP option will only output log messages on requests from admin IPs.', 'litespeed-cache'); ?>54 <?php echo sprintf(__('The logs will be output to %s.', 'litespeed-cache'), '<code>wp-content/debug.log</code>'); ?>55 </div>56 </td>57 </tr>40 <tr> 41 <th> 42 <?php $id = Base::O_DEBUG; ?> 43 <?php $this->title( $id ); ?> 44 </th> 45 <td> 46 <?php $this->build_switch( $id, array( __( 'OFF', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ), __( 'Admin IP Only', 'litespeed-cache' ) ) ); ?> 47 <div class="litespeed-desc"> 48 <?php echo __( 'Outputs to WordPress debug log.', 'litespeed-cache' ); ?> 49 <?php echo __( 'To prevent filling up the disk, this setting should be OFF when everything is working.', 'litespeed-cache' ); ?> 50 <?php echo __( 'The Admin IP option will only output log messages on requests from admin IPs.', 'litespeed-cache' ); ?> 51 <?php echo sprintf( __( 'The logs will be output to %s.', 'litespeed-cache' ), '<code>wp-content/debug.log</code>' ); ?> 52 </div> 53 </td> 54 </tr> 58 55 59 <tr>60 <th>61 <?php $id = Base::O_DEBUG_IPS; ?>62 <?php $this->title($id); ?>63 </th>64 <td>65 <?php $this->build_textarea($id, 50); ?>66 <div class="litespeed-desc">67 <?php echo __('Allows listed IPs (one per line) to perform certain actions from their browsers.', 'litespeed-cache'); ?>68 <?php echo __('Your IP', 'litespeed-cache'); ?>: <code><?php echo Router::get_ip(); ?></code>69 <?php $this->_validate_ip($id); ?>70 <br />71 <?php Doc::learn_more(72 'https://docs.litespeedtech.com/lscache/lscwp/admin/#admin-ip-commands',73 __('More information about the available commands can be found here.', 'litespeed-cache')74 ); ?>75 </div>76 </td>77 </tr>56 <tr> 57 <th> 58 <?php $id = Base::O_DEBUG_IPS; ?> 59 <?php $this->title( $id ); ?> 60 </th> 61 <td> 62 <?php $this->build_textarea( $id, 50 ); ?> 63 <div class="litespeed-desc"> 64 <?php echo __( 'Allows listed IPs (one per line) to perform certain actions from their browsers.', 'litespeed-cache' ); ?> 65 <?php echo __( 'Your IP', 'litespeed-cache' ); ?>: <code><?php echo Router::get_ip(); ?></code> 66 <?php $this->_validate_ip( $id ); ?> 67 <br /> 68 <?php Doc::learn_more( 69 'https://docs.litespeedtech.com/lscache/lscwp/admin/#admin-ip-commands', 70 __( 'More information about the available commands can be found here.', 'litespeed-cache' ) 71 ); ?> 72 </div> 73 </td> 74 </tr> 78 75 79 <tr>80 <th>81 <?php $id = Base::O_DEBUG_LEVEL; ?>82 <?php $this->title($id); ?>83 </th>84 <td>85 <?php $this->build_switch($id, array(__('Basic', 'litespeed-cache'), __('Advanced', 'litespeed-cache'))); ?>86 <div class="litespeed-desc">87 <?php echo __('Advanced level will log more details.', 'litespeed-cache'); ?>88 </div>89 </td>90 </tr>76 <tr> 77 <th> 78 <?php $id = Base::O_DEBUG_LEVEL; ?> 79 <?php $this->title( $id ); ?> 80 </th> 81 <td> 82 <?php $this->build_switch( $id, array( __( 'Basic', 'litespeed-cache' ), __( 'Advanced', 'litespeed-cache' ) ) ); ?> 83 <div class="litespeed-desc"> 84 <?php echo __( 'Advanced level will log more details.', 'litespeed-cache' ); ?> 85 </div> 86 </td> 87 </tr> 91 88 92 <tr>93 <th>94 <?php $id = Base::O_DEBUG_FILESIZE; ?>95 <?php $this->title($id); ?>96 </th>97 <td>98 <?php $this->build_input($id, 'litespeed-input-short'); ?> <?php echo __('MB', 'litespeed-cache'); ?>99 <div class="litespeed-desc">100 <?php echo __('Specify the maximum size of the log file.', 'litespeed-cache'); ?>101 <?php $this->recommended($id); ?>102 <?php $this->_validate_ttl($id, 3, 3000); ?>103 </div>104 </td>105 </tr>89 <tr> 90 <th> 91 <?php $id = Base::O_DEBUG_FILESIZE; ?> 92 <?php $this->title( $id ); ?> 93 </th> 94 <td> 95 <?php $this->build_input( $id, 'litespeed-input-short' ); ?> <?php echo __( 'MB', 'litespeed-cache' ); ?> 96 <div class="litespeed-desc"> 97 <?php echo __( 'Specify the maximum size of the log file.', 'litespeed-cache' ); ?> 98 <?php $this->recommended( $id ); ?> 99 <?php $this->_validate_ttl( $id, 3, 3000 ); ?> 100 </div> 101 </td> 102 </tr> 106 103 107 <tr>108 <th>109 <?php $id = Base::O_DEBUG_COLLAPSE_QS; ?>110 <?php $this->title($id); ?>111 </th>112 <td>113 <?php $this->build_switch($id); ?>114 <div class="litespeed-desc">115 <?php echo __('Shorten query strings in the debug log to improve readability.', 'litespeed-cache'); ?>116 </div>117 </td>118 </tr>104 <tr> 105 <th> 106 <?php $id = Base::O_DEBUG_COOKIE; ?> 107 <?php $this->title( $id ); ?> 108 </th> 109 <td> 110 <?php $this->build_switch( $id ); ?> 111 <div class="litespeed-desc"> 112 <?php echo __( 'Log requested cookie values.', 'litespeed-cache' ); ?> 113 </div> 114 </td> 115 </tr> 119 116 120 <tr> 121 <th> 122 <?php $id = Base::O_DEBUG_INC; ?> 123 <?php $this->title($id); ?> 124 </th> 125 <td> 126 <?php $this->build_textarea($id); ?> 127 <div class="litespeed-desc"> 128 <?php echo __('Only log listed pages.', 'litespeed-cache'); ?> 129 <?php $this->_uri_usage_example(); ?> 130 </div> 131 </td> 132 </tr> 117 <tr> 118 <th> 119 <?php $id = Base::O_DEBUG_COLLAPSE_QS; ?> 120 <?php $this->title( $id ); ?> 121 </th> 122 <td> 123 <?php $this->build_switch( $id ); ?> 124 <div class="litespeed-desc"> 125 <?php echo __( 'Shorten query strings in the debug log to improve readability.', 'litespeed-cache' ); ?> 126 </div> 127 </td> 128 </tr> 133 129 134 <tr>135 <th>136 <?php $id = Base::O_DEBUG_EXC; ?>137 <?php $this->title($id); ?>138 </th>139 <td>140 <?php $this->build_textarea($id); ?>141 <div class="litespeed-desc">142 <?php echo __('Prevent any debug log of listed pages.', 'litespeed-cache'); ?>143 <?php $this->_uri_usage_example(); ?>144 </div>145 </td>146 </tr>130 <tr> 131 <th> 132 <?php $id = Base::O_DEBUG_INC; ?> 133 <?php $this->title( $id ); ?> 134 </th> 135 <td> 136 <?php $this->build_textarea( $id ); ?> 137 <div class="litespeed-desc"> 138 <?php echo __( 'Only log listed pages.', 'litespeed-cache' ); ?> 139 <?php $this->_uri_usage_example(); ?> 140 </div> 141 </td> 142 </tr> 147 143 148 <tr>149 <th>150 <?php $id = Base::O_DEBUG_EXC_STRINGS; ?>151 <?php $this->title($id); ?>152 </th>153 <td>154 <?php $this->build_textarea($id); ?>155 <div class="litespeed-desc">156 <?php echo __('Prevent writing log entries that include listed strings.', 'litespeed-cache'); ?>157 <?php Doc::one_per_line(); ?>158 </div>159 </td>160 </tr>144 <tr> 145 <th> 146 <?php $id = Base::O_DEBUG_EXC; ?> 147 <?php $this->title( $id ); ?> 148 </th> 149 <td> 150 <?php $this->build_textarea( $id ); ?> 151 <div class="litespeed-desc"> 152 <?php echo __( 'Prevent any debug log of listed pages.', 'litespeed-cache' ); ?> 153 <?php $this->_uri_usage_example(); ?> 154 </div> 155 </td> 156 </tr> 161 157 162 </tbody> 163 </table> 158 <tr> 159 <th> 160 <?php $id = Base::O_DEBUG_EXC_STRINGS; ?> 161 <?php $this->title( $id ); ?> 162 </th> 163 <td> 164 <?php $this->build_textarea( $id ); ?> 165 <div class="litespeed-desc"> 166 <?php echo __( 'Prevent writing log entries that include listed strings.', 'litespeed-cache' ); ?> 167 <?php Doc::one_per_line(); ?> 168 </div> 169 </td> 170 </tr> 171 172 </tbody></table> 164 173 165 174 <?php 166 175 167 176 $this->form_end(); 177 -
litespeed-cache/trunk/data/const.default.ini
r3146597 r3146649 264 264 debug-filesize = 3 265 265 266 ; O_DEBUG_COOKIE 267 debug-cookie = false 268 266 269 ; O_DEBUG_COLLAPSE_QS 267 270 debug-collapse_qs = false -
litespeed-cache/trunk/data/const.network_default.ini
r3146597 r3146649 122 122 debug-filesize = 3 123 123 124 ; O_DEBUG_COOKIE 125 debug-cookie = false 126 124 127 ; O_DEBUG_COLLAPSE_QS 125 128 debug-collapse_qs = false -
litespeed-cache/trunk/data/esi.nonces.txt
r3146597 r3146649 72 72 wpmenucart private 73 73 74 # Advanced Custom Fields + Advanced Forms75 acf_nonce76 af_form_nonce77 af_submission_*78 79 74 # Woo nonce 80 75 woocommerce-login -
litespeed-cache/trunk/litespeed-cache.php
r3146597 r3146649 5 5 * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration 6 6 * Description: High-performance page caching and site optimization from LiteSpeed 7 * Version: 6. 57 * Version: 6.4.1 8 8 * Author: LiteSpeed Technologies 9 9 * Author URI: https://www.litespeedtech.com … … 35 35 } 36 36 37 !defined('LSCWP_V') && define('LSCWP_V', '6. 5');37 !defined('LSCWP_V') && define('LSCWP_V', '6.4.1'); 38 38 39 39 !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); -
litespeed-cache/trunk/readme.txt
r3146646 r3146649 255 255 == Changelog == 256 256 257 = 6.5 - Sep 4 2024 =258 *❗**Security** This release includes several debug log improvements for improved security, as listed below. Update strongly recommended.259 * **Debug** Moved debug log to litespeed individual folder `/wp-content/litespeed/debug/`.260 * **Debug** Disallowed visits to `/litespeed/debug/` folder log files in .htaccess.261 * **Debug** Dropped const `LSCWP_DEBUG_PATH` support.262 * **Debug** Renamed `debug.purge.log` to `purge.log`.263 * **Debug** Added dummy `index.php` for debug folder.264 * **Debug** Used random string for log filenames.265 * **Debug** Removed cookies-related info. (Thanks to Rafie)266 * **Debug** Dropped `Log Cookies` option.267 * **Report** Escaped report content to protect it from potential XSS attack. (Islam R alsaid #505746)268 * **ESI** Added nonce for Advanced Custom Fields + Advanced Forms. (David Lapointe Gilbert #439)269 * **Purge** Run ACTION_PURGE_EMPTYCACHE even if cache is disabled in network admin. (Philip #453)270 * **Page Optimize** Disable UCSS exclusion when UCSS is inactived. (#640)271 * **3rd** Fixed undefined warning in WooCommerce Widgets. (Lolosan #719)272 * **3rd** Correct the integration with User Switching. (John Blackbourn #725)273 * **3rd** Fixed Admin Bar Missing issue on DIVI + Elementor frontend. (thyran/robertstaddon PR#727)274 275 257 = 6.4.1 - Aug 19 2024 = 276 258 * ❗**Security** This release patches a security issue that may affect previous LSCWP versions since v1.9. -
litespeed-cache/trunk/src/base.cls.php
r3146597 r3146649 111 111 const O_DEBUG_LEVEL = 'debug-level'; 112 112 const O_DEBUG_FILESIZE = 'debug-filesize'; 113 const O_DEBUG_COOKIE = 'debug-cookie'; // For backwards compatibility, will drop after v7.0113 const O_DEBUG_COOKIE = 'debug-cookie'; 114 114 const O_DEBUG_COLLAPSE_QS = 'debug-collapse_qs'; 115 115 const O_DEBUG_COLLAPS_QS = 'debug-collapse_qs'; // For backwards compatibility, will drop after v6.5 … … 407 407 self::O_DEBUG_LEVEL => false, 408 408 self::O_DEBUG_FILESIZE => 0, 409 self::O_DEBUG_COOKIE => false, 409 410 self::O_DEBUG_COLLAPSE_QS => false, 410 411 self::O_DEBUG_INC => array(), … … 593 594 self::O_DEBUG_LEVEL => false, 594 595 self::O_DEBUG_FILESIZE => 0, 596 self::O_DEBUG_COOKIE => false, 595 597 self::O_DEBUG_COLLAPSE_QS => false, 596 598 self::O_DEBUG_INC => array(), -
litespeed-cache/trunk/src/cloud.cls.php
r3146597 r3146649 1548 1548 1549 1549 /** 1550 * Return pong for ping to check PHP function availability1551 * @since 6.51552 */1553 public function ping()1554 {1555 $resp = array(1556 'v_lscwp' => Core::VER,1557 'v_php' => PHP_VERSION,1558 'v_wp' => $GLOBALS['wp_version'],1559 );1560 if (!empty($_POST['funcs'])) {1561 foreach ($_POST['funcs'] as $func) {1562 $resp[$func] = function_exists($func) ? 'y' : 'n';1563 }1564 }1565 if (!empty($_POST['classes'])) {1566 foreach ($_POST['classes'] as $cls) {1567 $resp[$cls] = class_exists($cls) ? 'y' : 'n';1568 }1569 }1570 return self::ok($resp);1571 }1572 1573 /**1574 1550 * Handle all request actions from main cls 1575 1551 * -
litespeed-cache/trunk/src/debug2.cls.php
r3146597 r3146649 32 32 public function __construct() 33 33 { 34 self::$log_path_prefix = LITESPEED_STATIC_DIR . '/debug/'; 35 // Maybe move legacy log files 36 $this->_maybe_init_folder(); 37 38 self::$log_path = $this->path('debug'); 34 self::$log_path_prefix = defined('LSCWP_DEBUG_PATH') ? LSCWP_DEBUG_PATH : LSCWP_CONTENT_DIR; 35 self::$log_path = self::$log_path_prefix . '/debug.log'; 39 36 if (!empty($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'lscache_') === 0) { 40 self::$log_path = $this->path('crawler');37 self::$log_path = self::$log_path_prefix . '/crawler.log'; 41 38 } 42 39 … … 51 48 52 49 /** 53 * Try moving legacy logs into /litespeed/debug/ folder54 *55 * @since 6.556 */57 private function _maybe_init_folder()58 {59 if (file_exists(self::$log_path_prefix . 'index.php')) {60 return;61 }62 file::save(self::$log_path_prefix . 'index.php', '<?php // Silence is golden.', true);63 64 $logs = array('debug', 'debug.purge', 'crawler');65 foreach ($logs as $log) {66 if (file_exists(LSCWP_CONTENT_DIR . '/' . $log . '.log')) {67 rename(LSCWP_CONTENT_DIR . '/' . $log . '.log', $this->path($log));68 }69 }70 }71 72 /**73 * Generate log file path74 *75 * @since 6.576 */77 public function path($type)78 {79 return self::$log_path_prefix . self::FilePath($type);80 }81 82 /**83 * Generate the fixed log filename84 *85 * @since 6.586 */87 public static function FilePath($type)88 {89 if ($type == 'debug.purge') {90 $type = 'purge';91 }92 $rand = substr(md5(substr(AUTH_KEY, -16)), -16);93 return $type . $rand . '.log';94 }95 96 /**97 50 * End call of one request process 98 51 * @since 4.7 … … 101 54 public static function ended() 102 55 { 103 $headers = headers_list(); 104 foreach ($headers as $key => $header) { 105 if (stripos($header, 'Set-Cookie') === 0) { 106 unset($headers[$key]); 107 } 108 } 109 self::debug('Response headers', $headers); 56 self::debug('Response headers', headers_list()); 110 57 111 58 $elapsed_time = number_format((microtime(true) - LSCWP_TS_0) * 1000, 2); … … 197 144 } 198 145 199 $purge_file = self:: cls()->path('purge');146 $purge_file = self::$log_path_prefix . '/debug.purge.log'; 200 147 201 148 self::cls()->_init_request($purge_file); … … 320 267 $params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING']; 321 268 } 322 // $params[] = 'Cookie: ' . $server['HTTP_COOKIE']; 269 if ($this->conf(Base::O_DEBUG_COOKIE)) { 270 $params[] = 'Cookie: ' . $server['HTTP_COOKIE']; 271 } 323 272 if (isset($_COOKIE['_lscache_vary'])) { 324 273 $params[] = 'Cookie _lscache_vary: ' . $_COOKIE['_lscache_vary']; … … 528 477 private function _clear_log() 529 478 { 530 $logs = array('debug', ' purge', 'crawler');479 $logs = array('debug', 'debug.purge', 'crawler'); 531 480 foreach ($logs as $log) { 532 File::save( $this->path($log), '');481 File::save(self::$log_path_prefix . "/{$log}.log", ''); 533 482 } 534 483 } -
litespeed-cache/trunk/src/esi.cls.php
r3146597 r3146649 22 22 private static $has_esi = false; 23 23 private static $_combine_ids = array(); 24 private $admin_rendered = false; 24 25 private $esi_args = null; 25 26 private $_esi_preserve_list = array(); … … 365 366 // Add admin_bar esi 366 367 if (Router::is_logged_in()) { 367 remove_action('wp_body_open', 'wp_admin_bar_render', 0); // Remove default Admin bar. Fix https://github.com/elementor/elementor/issues/25198 368 // Remove default Admin bar. Fix https://github.com/elementor/elementor/issues/25198 369 remove_action('wp_body_open', 'wp_admin_bar_render', 0); 370 add_action('wp_body_open', array($this, 'sub_admin_bar_block'), 0); 368 371 remove_action('wp_footer', 'wp_admin_bar_render', 1000); 369 372 add_action('wp_footer', array($this, 'sub_admin_bar_block'), 1000); … … 768 771 global $wp_admin_bar; 769 772 773 if ($this->admin_rendered) { 774 return; 775 } 776 770 777 if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) { 771 778 return; … … 777 784 ); 778 785 786 $this->admin_rendered = true; 779 787 echo $this->sub_esi_block('admin-bar', 'adminbar', $params); 780 788 } -
litespeed-cache/trunk/src/htaccess.cls.php
r3146597 r3146649 94 94 'CacheLookup on', 95 95 'RewriteRule .* - [E=Cache-Control:no-autoflush]', 96 'RewriteRule ' . preg_quote(LITESPEED_DATA_FOLDER) . '/debug/.*\.log$ - [F,L]',96 // "RewriteRule \.object-cache\.ini - [F,L]", 97 97 'RewriteRule ' . preg_quote(self::CONF_FILE) . ' - [F,L]', 98 98 ); -
litespeed-cache/trunk/src/lang.cls.php
r3146597 r3146649 270 270 self::O_DEBUG_LEVEL => __('Debug Level', 'litespeed-cache'), 271 271 self::O_DEBUG_FILESIZE => __('Log File Size Limit', 'litespeed-cache'), 272 self::O_DEBUG_COOKIE => __('Log Cookies', 'litespeed-cache'), 272 273 self::O_DEBUG_COLLAPSE_QS => __('Collapse Query Strings', 'litespeed-cache'), 273 274 self::O_DEBUG_INC => __('Debug URI Includes', 'litespeed-cache'), -
litespeed-cache/trunk/src/object-cache.cls.php
r3146597 r3146649 1 1 <?php 2 3 2 /** 4 3 * The object cache class … … 9 8 * @author LiteSpeed Technologies <[email protected]> 10 9 */ 11 12 10 namespace LiteSpeed; 13 14 11 defined('WPINC') || exit(); 15 12 … … 62 59 public function __construct($cfg = false) 63 60 { 61 $this->debug_oc('-------------'); 62 $this->debug_oc('init'); 63 64 64 if ($cfg) { 65 65 if (!is_array($cfg[Base::O_OBJECT_GLOBAL_GROUPS])) { … … 159 159 } 160 160 161 $LITESPEED_DATA_FOLDER = defined('LITESPEED_DATA_FOLDER') ? LITESPEED_DATA_FOLDER : 'litespeed'; 162 $LSCWP_CONTENT_DIR = defined('LSCWP_CONTENT_DIR') ? LSCWP_CONTENT_DIR : WP_CONTENT_DIR; 163 $LITESPEED_STATIC_DIR = $LSCWP_CONTENT_DIR . '/' . $LITESPEED_DATA_FOLDER; 164 $log_path_prefix = $LITESPEED_STATIC_DIR . '/debug/'; 165 166 error_log(gmdate('m/d/y H:i:s') . ' - OC - ' . $text . PHP_EOL, 3, $log_path_prefix . Debug2::FilePath('debug')); 161 error_log(gmdate('m/d/y H:i:s') . ' - ' . $text . PHP_EOL, 3, WP_CONTENT_DIR . '/debug.log'); 167 162 } 168 163 … … 348 343 } 349 344 restore_error_handler(); 350 } else { // Connect to Memcached 345 } /** 346 * Connect to Memcached 347 */ else { 351 348 if ($this->_cfg_persistent) { 352 349 $this->_conn = new \Memcached($this->_get_mem_id()); -
litespeed-cache/trunk/src/optimize.cls.php
r3146597 r3146649 1090 1090 1091 1091 // Check if need to inline this css file 1092 if ( $this->conf(self::O_OPTM_UCSS) &&Utility::str_hit_array($attrs['href'], $ucss_file_exc_inline)) {1092 if (Utility::str_hit_array($attrs['href'], $ucss_file_exc_inline)) { 1093 1093 Debug2::debug('[Optm] ucss_file_exc_inline hit ' . $attrs['href']); 1094 1094 // Replace this css to inline from orig html -
litespeed-cache/trunk/src/optimizer.cls.php
r3146597 r3146649 58 58 $content_final = $obj->process(); 59 59 // check if content from minification is empty 60 if ($content_final == ''){60 if($content_final == ''){ 61 61 Debug2::debug('Failed to minify HTML: HTML minification resulted in empty HTML'); 62 62 return $content; -
litespeed-cache/trunk/src/rest.cls.php
r3146597 r3146649 73 73 'permission_callback' => array($this, 'is_from_cloud'), 74 74 )); 75 register_rest_route('litespeed/v 3', '/ping', array(76 'methods' => ' POST',75 register_rest_route('litespeed/v1', '/ping', array( 76 'methods' => 'GET', 77 77 'callback' => array($this, 'ping'), 78 'permission_callback' => array($this, 'is_from_cloud'),78 'permission_callback' => '__return_true', 79 79 )); 80 80 … … 169 169 public function ping() 170 170 { 171 return $this->cls('Cloud')->ping();171 return Cloud::ok(array('ver' => Core::VER)); 172 172 } 173 173 -
litespeed-cache/trunk/src/router.cls.php
r3146597 r3146649 604 604 605 605 case Core::ACTION_PURGE_EMPTYCACHE: // todo: moved to purge.cls type action 606 if ( (defined('LITESPEED_ON') || $_is_network_admin) && ($_can_network_option || (!$_is_multisite && $_can_option))) {606 if (defined('LITESPEED_ON') && ($_can_network_option || (!$_is_multisite && $_can_option))) { 607 607 self::$_action = $action; 608 608 } -
litespeed-cache/trunk/thirdparty/user-switching.cls.php
r3146597 r3146649 13 13 public static function detect() 14 14 { 15 if (! class_exists('user_switching')) {15 if (!defined('user_switching')) { 16 16 return; 17 17 } -
litespeed-cache/trunk/thirdparty/woocommerce.cls.php
r3146597 r3146649 729 729 return; 730 730 } 731 732 731 global $wp_widget_factory; 733 if (!isset($wp_widget_factory->widgets['WC_Widget_Recent_Reviews'])) {734 return;735 }736 737 732 $recent_reviews = $wp_widget_factory->widgets['WC_Widget_Recent_Reviews']; 738 733 if (!is_null($recent_reviews)) { -
litespeed-cache/trunk/tpl/toolbox/beta_test.tpl.php
r3146597 r3146649 7 7 // Existing public version list 8 8 $v_list = array( 9 '6.5',10 9 '6.4.1', 11 10 '6.3.0.1', -
litespeed-cache/trunk/tpl/toolbox/log_viewer.tpl.php
r3146597 r3146649 3 3 namespace LiteSpeed; 4 4 5 defined( 'WPINC') || exit;5 defined( 'WPINC' ) || exit; 6 6 7 7 $logs = … … 9 9 array( 10 10 'name' => 'debug', 11 'label' => esc_html__( 'Debug Log', 'litespeed-cache'),11 'label' => esc_html__( 'Debug Log', 'litespeed-cache' ), 12 12 'accesskey' => 'A', 13 13 ), 14 14 array( 15 'name' => ' purge',16 'label' => esc_html__( 'Purge Log', 'litespeed-cache'),15 'name' => 'debug.purge', 16 'label' => esc_html__( 'Purge Log', 'litespeed-cache' ), 17 17 'accesskey' => 'B', 18 18 ), 19 19 array( 20 20 'name' => 'crawler', 21 'label' => esc_html__( 'Crawler Log', 'litespeed-cache'),21 'label' => esc_html__( 'Crawler Log', 'litespeed-cache' ), 22 22 'accesskey' => 'C', 23 23 ), … … 28 28 * @since 4.7 29 29 */ 30 function subnav_link($item) 31 { 30 function subnav_link( $item ) { 32 31 $class = 'button '; 33 32 $subtab = ''; 34 33 35 if ( !isset($item['url'])) {34 if ( ! isset( $item['url'] ) ) { 36 35 $class .= 'button-secondary'; 37 36 $subtab_name = "{$item['name']}_log"; 38 37 $subtab = "data-litespeed-subtab='{$subtab_name}'"; 39 $url = "#{$subtab_name}"; 40 } else { 38 $url ="#{$subtab_name}"; 39 } 40 else { 41 41 $class .= 'button-primary'; 42 42 $url = $item['url']; … … 44 44 45 45 $accesskey = 46 isset( $item['accesskey'])46 isset( $item['accesskey'] ) 47 47 ? "litespeed-accesskey='{$item['accesskey']}'" 48 48 : ''; 49 $label = isset( $item['label']) ? $item['label'] : $item['name'];49 $label = isset( $item['label'] ) ? $item['label'] : $item['name']; 50 50 51 51 return "<a href='{$url}' class='{$class}' {$subtab} {$accesskey}>{$label}</a>"; … … 56 56 * @since 4.7 57 57 */ 58 function clear_logs_link($accesskey = null) 59 { 58 function clear_logs_link( $accesskey = null ) { 60 59 $item = 61 60 array( 62 'label' => esc_html__( 'Clear Logs', 'litespeed-cache'),63 'url' => Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG),61 'label' => esc_html__( 'Clear Logs', 'litespeed-cache' ), 62 'url' => Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG ), 64 63 ); 65 if ( null !== $accesskey) {64 if ( null !== $accesskey ) { 66 65 $item['accesskey'] = $accesskey; 67 66 } 68 echo subnav_link( $item);67 echo subnav_link( $item ); 69 68 } 70 69 … … 72 71 $log_views = array(); 73 72 74 foreach ($logs as $log) {75 $subnav_links[] = subnav_link( $log);73 foreach( $logs as $log ) { 74 $subnav_links[] = subnav_link( $log ); 76 75 77 $file = $this->cls('Debug2')->path($log['name']);78 $lines = File::count_lines( $file);76 $file = LSCWP_CONTENT_DIR . "/{$log['name']}.log"; 77 $lines = File::count_lines( $file ); 79 78 $start = $lines > 1000 ? $lines - 1000 : 0; 80 $lines = File::read( $file, $start);81 $lines = $lines ? trim( implode("\n", $lines)) : '';79 $lines = File::read( $file, $start ); 80 $lines = $lines ? trim( implode( "\n", $lines ) ) : ''; 82 81 83 82 $log_views[] = 84 83 "<div class='litespeed-log-view-wrapper' data-litespeed-sublayout='{$log['name']}_log'>" 85 . "<h3 class='litespeed-title'>{$log['label']}</h3>"86 . '<div class="litespeed-log-body">'87 . nl2br(htmlspecialchars($lines))88 . '</div>'84 . "<h3 class='litespeed-title'>{$log['label']}</h3>" 85 . '<div class="litespeed-log-body">' 86 . nl2br( htmlspecialchars( $lines ) ) 87 . '</div>' 89 88 . '</div>'; 90 89 } … … 92 91 93 92 <h3 class="litespeed-title"> 94 <?php esc_html_e( 'LiteSpeed Logs', 'litespeed-cache'); ?>95 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#log-view-tab'); ?>93 <?php esc_html_e( 'LiteSpeed Logs', 'litespeed-cache' ); ?> 94 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#log-view-tab' ); ?> 96 95 </h3> 97 96 98 97 <div class="litespeed-log-subnav-wrapper"> 99 <?php echo implode( "\n", $subnav_links); ?>100 <?php clear_logs_link( 'D'); ?>98 <?php echo implode( "\n", $subnav_links ); ?> 99 <?php clear_logs_link( 'D' ); ?> 101 100 </div> 102 101 103 <?php echo implode( "\n", $log_views); ?>102 <?php echo implode( "\n", $log_views ); ?> 104 103 105 104 <?php -
litespeed-cache/trunk/tpl/toolbox/report.tpl.php
r3146597 r3146649 1 1 <?php 2 namespace LiteSpeed ; 3 defined( 'WPINC' ) || exit ; 2 4 3 namespace LiteSpeed; 4 5 defined('WPINC') || exit; 6 7 $_report = Report::cls(); 5 $_report = Report::cls() ; 8 6 $report = $_report->generate_environment_report(); 9 7 10 $env_ref = Report::get_summary() ;8 $env_ref = Report::get_summary() ; 11 9 12 10 // Detect password less plugin 13 11 $link = ''; 14 12 $has_pswdless_plugin = false; 15 if ( function_exists('dologin_gen_link')) {13 if ( function_exists( 'dologin_gen_link' ) ) { 16 14 $has_pswdless_plugin = true; 17 if (!empty($_GET['dologin_gen_link'])) { 18 unset($_GET['dologin_gen_link']); 19 $link = dologin_gen_link('Litespeed Report'); 20 ?> 21 <script> 22 window.history.pushState('remove_gen_link', document.title, window.location.href.replace('&dologin_gen_link=1', '')); 23 </script> 24 <?php 15 if ( ! empty( $_GET[ 'dologin_gen_link' ] ) ) { 16 unset( $_GET[ 'dologin_gen_link' ] ); 17 $link = dologin_gen_link( 'Litespeed Report' ); 18 ?> 19 <script>window.history.pushState( 'remove_gen_link', document.title, window.location.href.replace( '&dologin_gen_link=1', '' ) );</script> 20 <?php 25 21 } 26 22 } 27 23 28 $install_link = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_3RD, false, null, array('plugin' => 'dologin'));24 $install_link = Utility::build_url( Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_3RD, false, null, array( 'plugin' => 'dologin' ) ); 29 25 ?> 30 26 31 <?php if ( !$has_pswdless_plugin) : ?>27 <?php if ( ! $has_pswdless_plugin ) : ?> 32 28 <div class="litespeed-callout notice notice-warning inline"> 33 <h4><?php echo __( 'NOTICE:', 'litespeed-cache'); ?></h4>29 <h4><?php echo __( 'NOTICE:', 'litespeed-cache' ); ?></h4> 34 30 <p> 35 <?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>'); ?>31 <?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>' ); ?> 36 32 </p> 37 33 <p> 38 <a href="<?php echo $install_link; ?>" class="button litespeed-btn litespeed-right20"><?php echo __( 'Install DoLogin Security', 'litespeed-cache'); ?></a>39 <a href="plugin-install.php?s=dologin+security&tab=search&type=term" target="_blank"><?php echo __( 'Go to plugins list', 'litespeed-cache'); ?></a>34 <a href="<?php echo $install_link; ?>" class="button litespeed-btn litespeed-right20"><?php echo __( 'Install DoLogin Security', 'litespeed-cache' ); ?></a> 35 <a href="plugin-install.php?s=dologin+security&tab=search&type=term" target="_blank"><?php echo __( 'Go to plugins list', 'litespeed-cache' ); ?></a> 40 36 </p> 41 37 </div> … … 43 39 44 40 <h3 class="litespeed-title"> 45 <?php echo __('LiteSpeed Report', 'litespeed-cache') ; ?>46 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#report-tab'); ?>41 <?php echo __('LiteSpeed Report', 'litespeed-cache') ; ?> 42 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#report-tab' ); ?> 47 43 </h3> 48 44 49 <p><?php echo __('Report number', 'litespeed-cache') ; ?>: <b><?php echo !empty($env_ref['num']) ? $env_ref['num'] : '-'; ?></b></p>50 <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>45 <p><?php echo __('Report number', 'litespeed-cache') ; ?>: <b><?php echo ! empty( $env_ref[ 'num' ] ) ? $env_ref[ 'num' ] : '-' ; ?></b></p> 46 <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> 51 47 52 48 <p class="litespeed-desc"> 53 <?php echo __( 'The environment report contains detailed information about the WordPress configuration.', 'litespeed-cache'); ?>49 <?php echo __( 'The environment report contains detailed information about the WordPress configuration.', 'litespeed-cache' ); ?> 54 50 <br /> 55 51 <?php echo __('If you run into any issues, please refer to the report number in your support message.', 'litespeed-cache'); ?> 56 52 </p> 57 53 58 <form action="<?php echo Utility::build_url(Router::ACTION_REPORT, Report::TYPE_SEND_REPORT); ?>" method="post" class="litespeed-relative"> 59 <table class="wp-list-table striped litespeed-table"> 60 <tbody> 61 <tr> 62 <th><?php echo __('System Information', 'litespeed-cache'); ?></th> 63 <td> 64 <textarea id="litespeed-report" rows="20" cols="100" readonly><?php echo esc_textarea($report); ?></textarea> 65 </td> 66 </tr> 67 <tr> 68 <th><?php echo __('Passwordless Link', 'litespeed-cache'); ?></th> 69 <td> 70 <input type="text" class="litespeed-regular-text" id="litespeed-report-link" name="link" value="<?php echo $link; ?>" style="width:500px;" /> 71 <?php if ($has_pswdless_plugin) : ?> 72 <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> 73 <?php else : ?> 74 <button type="button" class="button button-secondary" disabled><?php echo __('Generate Link for Current User', 'litespeed-cache'); ?></button> 75 <?php endif; ?> 76 <div class="litespeed-desc"> 77 <?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'); ?> 78 <?php if ($link) : ?> 79 <br /><strong>🚨 <?php echo __('Please do NOT share the above passwordless link with anyone.', 'litespeed-cache'); ?></strong> 80 <strong><?php echo sprintf(__('Generated links may be managed under <a %s>Settings</a>.', 'litespeed-cache'), 'href="' . menu_page_url('dologin', 0) . '"'); ?></strong> 81 <?php endif; ?> 82 </div> 83 </td> 84 </tr> 85 <tr> 86 <th><?php echo __('Notes', 'litespeed-cache'); ?></th> 87 <td> 88 <textarea name="notes" rows="10" cols="100"></textarea> 89 <div class="litespeed-desc"> 90 <?php echo __('Optional', 'litespeed-cache'); ?>: 91 <?php echo __('provide more information here to assist the LiteSpeed team with debugging.', 'litespeed-cache'); ?> 92 </div> 93 </td> 94 </tr> 95 </tbody> 96 </table> 54 <form action="<?php echo Utility::build_url( Router::ACTION_REPORT, Report::TYPE_SEND_REPORT ); ?>" method="post" class="litespeed-relative"> 55 <table class="wp-list-table striped litespeed-table"><tbody> 56 <tr> 57 <th><?php echo __( 'System Information', 'litespeed-cache' ) ; ?></th> 58 <td> 59 <textarea id="litespeed-report" rows="20" cols="100" readonly><?php echo $report; ?></textarea> 60 </td> 61 </tr> 62 <tr> 63 <th><?php echo __( 'Passwordless Link', 'litespeed-cache' ) ; ?></th> 64 <td> 65 <input type="text" class="litespeed-regular-text" id="litespeed-report-link" name="link" value="<?php echo $link; ?>" style="width:500px;" /> 66 <?php if ( $has_pswdless_plugin ) : ?> 67 <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> 68 <?php else: ?> 69 <button type="button" class="button button-secondary" disabled><?php echo __( 'Generate Link for Current User', 'litespeed-cache' ) ; ?></button> 70 <?php endif; ?> 71 <div class="litespeed-desc"> 72 <?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' ) ; ?> 73 <?php if ( $link ) : ?> 74 <br /><strong>🚨 <?php echo __('Please do NOT share the above passwordless link with anyone.', 'litespeed-cache'); ?></strong> 75 <strong><?php echo sprintf( __('Generated links may be managed under <a %s>Settings</a>.', 'litespeed-cache'), 'href="' . menu_page_url( 'dologin', 0 ) . '"' ); ?></strong> 76 <?php endif; ?> 77 </div> 78 </td> 79 </tr> 80 <tr> 81 <th><?php echo __( 'Notes', 'litespeed-cache' ) ; ?></th> 82 <td> 83 <textarea name="notes" rows="10" cols="100"></textarea> 84 <div class="litespeed-desc"> 85 <?php echo __( 'Optional', 'litespeed-cache' ); ?>: 86 <?php echo __( 'provide more information here to assist the LiteSpeed team with debugging.', 'litespeed-cache' ); ?> 87 </div> 88 </td> 89 </tr> 90 </tbody></table> 97 91 98 <div class='litespeed-top20'></div>99 <button class="button button-primary" type="submit"><?php echo __('Send to LiteSpeed', 'litespeed-cache'); ?></button>100 <button class="button button-primary litespeed-float-submit" type="submit"><?php echo __('Send to LiteSpeed', 'litespeed-cache'); ?></button>92 <div class='litespeed-top20'></div> 93 <button class="button button-primary" type="submit"><?php echo __( 'Send to LiteSpeed', 'litespeed-cache' ) ; ?></button> 94 <button class="button button-primary litespeed-float-submit" type="submit"><?php echo __( 'Send to LiteSpeed', 'litespeed-cache' ) ; ?></button> 101 95 102 <p class="litespeed-top30 litespeed-left10 litespeed-desc">103 <?php echo __('Send this report to LiteSpeed. Refer to this report number when posting in the WordPress support forum.', 'litespeed-cache'); ?>104 </p>96 <p class="litespeed-top30 litespeed-left10 litespeed-desc"> 97 <?php echo __( 'Send this report to LiteSpeed. Refer to this report number when posting in the WordPress support forum.', 'litespeed-cache' ) ; ?> 98 </p> 105 99 </form> 106 100 107 <?php include_once LSCWP_DIR . "tpl/inc/api_key.php"; ?> 101 <?php include_once LSCWP_DIR . "tpl/inc/api_key.php" ; ?> 102 -
litespeed-cache/trunk/tpl/toolbox/settings-debug.tpl.php
r3146597 r3146649 1 1 <?php 2 namespace LiteSpeed; 3 defined( 'WPINC' ) || exit; 2 4 3 namespace LiteSpeed; 4 5 defined('WPINC') || exit; 6 7 $this->form_action($this->_is_network_admin ? Router::ACTION_SAVE_SETTINGS_NETWORK : false); 5 $this->form_action( $this->_is_network_admin ? Router::ACTION_SAVE_SETTINGS_NETWORK : false ); 8 6 ?> 9 7 … … 12 10 </h3> 13 11 14 <a href="<?php echo home_url( '/') . '?' . Router::ACTION . '=before_optm'; ?>" class="button button-success" target="_blank">15 <?php echo __( 'View Site Before Optimization', 'litespeed-cache'); ?>12 <a href="<?php echo home_url( '/' ) . '?' . Router::ACTION . '=before_optm'; ?>" class="button button-success" target="_blank"> 13 <?php echo __( 'View Site Before Optimization', 'litespeed-cache' ); ?> 16 14 </a> 17 15 18 <a href="<?php echo home_url( '/') . '?' . Router::ACTION . '=' . Core::ACTION_QS_NOCACHE; ?>" class="button button-success" target="_blank">19 <?php echo __( 'View Site Before Cache', 'litespeed-cache'); ?>16 <a href="<?php echo home_url( '/' ) . '?' . Router::ACTION . '=' . Core::ACTION_QS_NOCACHE; ?>" class="button button-success" target="_blank"> 17 <?php echo __( 'View Site Before Cache', 'litespeed-cache' ); ?> 20 18 </a> 21 19 … … 23 21 <h3 class="litespeed-title-short"> 24 22 <?php echo __('Debug Settings', 'litespeed-cache'); ?> 25 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#debug-settings-tab'); ?>23 <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/toolbox/#debug-settings-tab' ); ?> 26 24 </h3> 27 25 28 <table class="wp-list-table striped litespeed-table"> 29 <tbody> 30 <tr> 31 <th> 32 <?php $id = Base::O_DEBUG_DISABLE_ALL; ?> 33 <?php $this->title($id); ?> 34 </th> 35 <td> 36 <?php $this->build_switch($id); ?> 37 <div class="litespeed-desc"> 38 <?php echo __('This will disable LSCache and all optimization features for debug purpose.', 'litespeed-cache'); ?> 39 </div> 40 </td> 41 </tr> 26 <table class="wp-list-table striped litespeed-table"><tbody> 27 <tr> 28 <th> 29 <?php $id = Base::O_DEBUG_DISABLE_ALL; ?> 30 <?php $this->title( $id ); ?> 31 </th> 32 <td> 33 <?php $this->build_switch( $id ); ?> 34 <div class="litespeed-desc"> 35 <?php echo __( 'This will disable LSCache and all optimization features for debug purpose.', 'litespeed-cache' ); ?> 36 </div> 37 </td> 38 </tr> 42 39 43 <tr>44 <th>45 <?php $id = Base::O_DEBUG; ?>46 <?php $this->title($id); ?>47 </th>48 <td>49 <?php $this->build_switch($id, array(__('OFF', 'litespeed-cache'), __('ON', 'litespeed-cache'), __('Admin IP Only', 'litespeed-cache'))); ?>50 <div class="litespeed-desc">51 <?php echo __('Outputs to WordPress debug log.', 'litespeed-cache'); ?>52 <?php echo __('To prevent filling up the disk, this setting should be OFF when everything is working.', 'litespeed-cache'); ?>53 <?php echo __('The Admin IP option will only output log messages on requests from admin IPs.', 'litespeed-cache'); ?>54 <?php echo sprintf(__('The logs will be output to %s.', 'litespeed-cache'), '<code>wp-content/debug.log</code>'); ?>55 </div>56 </td>57 </tr>40 <tr> 41 <th> 42 <?php $id = Base::O_DEBUG; ?> 43 <?php $this->title( $id ); ?> 44 </th> 45 <td> 46 <?php $this->build_switch( $id, array( __( 'OFF', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ), __( 'Admin IP Only', 'litespeed-cache' ) ) ); ?> 47 <div class="litespeed-desc"> 48 <?php echo __( 'Outputs to WordPress debug log.', 'litespeed-cache' ); ?> 49 <?php echo __( 'To prevent filling up the disk, this setting should be OFF when everything is working.', 'litespeed-cache' ); ?> 50 <?php echo __( 'The Admin IP option will only output log messages on requests from admin IPs.', 'litespeed-cache' ); ?> 51 <?php echo sprintf( __( 'The logs will be output to %s.', 'litespeed-cache' ), '<code>wp-content/debug.log</code>' ); ?> 52 </div> 53 </td> 54 </tr> 58 55 59 <tr>60 <th>61 <?php $id = Base::O_DEBUG_IPS; ?>62 <?php $this->title($id); ?>63 </th>64 <td>65 <?php $this->build_textarea($id, 50); ?>66 <div class="litespeed-desc">67 <?php echo __('Allows listed IPs (one per line) to perform certain actions from their browsers.', 'litespeed-cache'); ?>68 <?php echo __('Your IP', 'litespeed-cache'); ?>: <code><?php echo Router::get_ip(); ?></code>69 <?php $this->_validate_ip($id); ?>70 <br />71 <?php Doc::learn_more(72 'https://docs.litespeedtech.com/lscache/lscwp/admin/#admin-ip-commands',73 __('More information about the available commands can be found here.', 'litespeed-cache')74 ); ?>75 </div>76 </td>77 </tr>56 <tr> 57 <th> 58 <?php $id = Base::O_DEBUG_IPS; ?> 59 <?php $this->title( $id ); ?> 60 </th> 61 <td> 62 <?php $this->build_textarea( $id, 50 ); ?> 63 <div class="litespeed-desc"> 64 <?php echo __( 'Allows listed IPs (one per line) to perform certain actions from their browsers.', 'litespeed-cache' ); ?> 65 <?php echo __( 'Your IP', 'litespeed-cache' ); ?>: <code><?php echo Router::get_ip(); ?></code> 66 <?php $this->_validate_ip( $id ); ?> 67 <br /> 68 <?php Doc::learn_more( 69 'https://docs.litespeedtech.com/lscache/lscwp/admin/#admin-ip-commands', 70 __( 'More information about the available commands can be found here.', 'litespeed-cache' ) 71 ); ?> 72 </div> 73 </td> 74 </tr> 78 75 79 <tr>80 <th>81 <?php $id = Base::O_DEBUG_LEVEL; ?>82 <?php $this->title($id); ?>83 </th>84 <td>85 <?php $this->build_switch($id, array(__('Basic', 'litespeed-cache'), __('Advanced', 'litespeed-cache'))); ?>86 <div class="litespeed-desc">87 <?php echo __('Advanced level will log more details.', 'litespeed-cache'); ?>88 </div>89 </td>90 </tr>76 <tr> 77 <th> 78 <?php $id = Base::O_DEBUG_LEVEL; ?> 79 <?php $this->title( $id ); ?> 80 </th> 81 <td> 82 <?php $this->build_switch( $id, array( __( 'Basic', 'litespeed-cache' ), __( 'Advanced', 'litespeed-cache' ) ) ); ?> 83 <div class="litespeed-desc"> 84 <?php echo __( 'Advanced level will log more details.', 'litespeed-cache' ); ?> 85 </div> 86 </td> 87 </tr> 91 88 92 <tr>93 <th>94 <?php $id = Base::O_DEBUG_FILESIZE; ?>95 <?php $this->title($id); ?>96 </th>97 <td>98 <?php $this->build_input($id, 'litespeed-input-short'); ?> <?php echo __('MB', 'litespeed-cache'); ?>99 <div class="litespeed-desc">100 <?php echo __('Specify the maximum size of the log file.', 'litespeed-cache'); ?>101 <?php $this->recommended($id); ?>102 <?php $this->_validate_ttl($id, 3, 3000); ?>103 </div>104 </td>105 </tr>89 <tr> 90 <th> 91 <?php $id = Base::O_DEBUG_FILESIZE; ?> 92 <?php $this->title( $id ); ?> 93 </th> 94 <td> 95 <?php $this->build_input( $id, 'litespeed-input-short' ); ?> <?php echo __( 'MB', 'litespeed-cache' ); ?> 96 <div class="litespeed-desc"> 97 <?php echo __( 'Specify the maximum size of the log file.', 'litespeed-cache' ); ?> 98 <?php $this->recommended( $id ); ?> 99 <?php $this->_validate_ttl( $id, 3, 3000 ); ?> 100 </div> 101 </td> 102 </tr> 106 103 107 <tr>108 <th>109 <?php $id = Base::O_DEBUG_COLLAPSE_QS; ?>110 <?php $this->title($id); ?>111 </th>112 <td>113 <?php $this->build_switch($id); ?>114 <div class="litespeed-desc">115 <?php echo __('Shorten query strings in the debug log to improve readability.', 'litespeed-cache'); ?>116 </div>117 </td>118 </tr>104 <tr> 105 <th> 106 <?php $id = Base::O_DEBUG_COOKIE; ?> 107 <?php $this->title( $id ); ?> 108 </th> 109 <td> 110 <?php $this->build_switch( $id ); ?> 111 <div class="litespeed-desc"> 112 <?php echo __( 'Log requested cookie values.', 'litespeed-cache' ); ?> 113 </div> 114 </td> 115 </tr> 119 116 120 <tr> 121 <th> 122 <?php $id = Base::O_DEBUG_INC; ?> 123 <?php $this->title($id); ?> 124 </th> 125 <td> 126 <?php $this->build_textarea($id); ?> 127 <div class="litespeed-desc"> 128 <?php echo __('Only log listed pages.', 'litespeed-cache'); ?> 129 <?php $this->_uri_usage_example(); ?> 130 </div> 131 </td> 132 </tr> 117 <tr> 118 <th> 119 <?php $id = Base::O_DEBUG_COLLAPSE_QS; ?> 120 <?php $this->title( $id ); ?> 121 </th> 122 <td> 123 <?php $this->build_switch( $id ); ?> 124 <div class="litespeed-desc"> 125 <?php echo __( 'Shorten query strings in the debug log to improve readability.', 'litespeed-cache' ); ?> 126 </div> 127 </td> 128 </tr> 133 129 134 <tr>135 <th>136 <?php $id = Base::O_DEBUG_EXC; ?>137 <?php $this->title($id); ?>138 </th>139 <td>140 <?php $this->build_textarea($id); ?>141 <div class="litespeed-desc">142 <?php echo __('Prevent any debug log of listed pages.', 'litespeed-cache'); ?>143 <?php $this->_uri_usage_example(); ?>144 </div>145 </td>146 </tr>130 <tr> 131 <th> 132 <?php $id = Base::O_DEBUG_INC; ?> 133 <?php $this->title( $id ); ?> 134 </th> 135 <td> 136 <?php $this->build_textarea( $id ); ?> 137 <div class="litespeed-desc"> 138 <?php echo __( 'Only log listed pages.', 'litespeed-cache' ); ?> 139 <?php $this->_uri_usage_example(); ?> 140 </div> 141 </td> 142 </tr> 147 143 148 <tr>149 <th>150 <?php $id = Base::O_DEBUG_EXC_STRINGS; ?>151 <?php $this->title($id); ?>152 </th>153 <td>154 <?php $this->build_textarea($id); ?>155 <div class="litespeed-desc">156 <?php echo __('Prevent writing log entries that include listed strings.', 'litespeed-cache'); ?>157 <?php Doc::one_per_line(); ?>158 </div>159 </td>160 </tr>144 <tr> 145 <th> 146 <?php $id = Base::O_DEBUG_EXC; ?> 147 <?php $this->title( $id ); ?> 148 </th> 149 <td> 150 <?php $this->build_textarea( $id ); ?> 151 <div class="litespeed-desc"> 152 <?php echo __( 'Prevent any debug log of listed pages.', 'litespeed-cache' ); ?> 153 <?php $this->_uri_usage_example(); ?> 154 </div> 155 </td> 156 </tr> 161 157 162 </tbody> 163 </table> 158 <tr> 159 <th> 160 <?php $id = Base::O_DEBUG_EXC_STRINGS; ?> 161 <?php $this->title( $id ); ?> 162 </th> 163 <td> 164 <?php $this->build_textarea( $id ); ?> 165 <div class="litespeed-desc"> 166 <?php echo __( 'Prevent writing log entries that include listed strings.', 'litespeed-cache' ); ?> 167 <?php Doc::one_per_line(); ?> 168 </div> 169 </td> 170 </tr> 171 172 </tbody></table> 164 173 165 174 <?php 166 175 167 176 $this->form_end(); 177
Note: See TracChangeset
for help on using the changeset viewer.