Plugin Directory

Changeset 3146649


Ignore:
Timestamp:
09/04/2024 09:26:10 PM (15 months ago)
Author:
LiteSpeedTech
Message:

Release v6.4.1

Location:
litespeed-cache
Files:
44 edited

Legend:

Unmodified
Added
Removed
  • litespeed-cache/tags/6.4.1/data/const.default.ini

    r3146646 r3146649  
    264264debug-filesize = 3
    265265
     266; O_DEBUG_COOKIE
     267debug-cookie = false
     268
    266269; O_DEBUG_COLLAPSE_QS
    267270debug-collapse_qs = false
  • litespeed-cache/tags/6.4.1/data/const.network_default.ini

    r3146646 r3146649  
    122122debug-filesize = 3
    123123
     124; O_DEBUG_COOKIE
     125debug-cookie = false
     126
    124127; O_DEBUG_COLLAPSE_QS
    125128debug-collapse_qs = false
  • litespeed-cache/tags/6.4.1/data/esi.nonces.txt

    r3146646 r3146649  
    7272wpmenucart private
    7373
    74 # Advanced Custom Fields + Advanced Forms
    75 acf_nonce
    76 af_form_nonce
    77 af_submission_*
    78 
    7974# Woo nonce
    8075woocommerce-login
  • litespeed-cache/tags/6.4.1/litespeed-cache.php

    r3146646 r3146649  
    55 * Plugin URI:        https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
    66 * Description:       High-performance page caching and site optimization from LiteSpeed
    7  * Version:           6.5
     7 * Version:           6.4.1
    88 * Author:            LiteSpeed Technologies
    99 * Author URI:        https://www.litespeedtech.com
     
    3535}
    3636
    37 !defined('LSCWP_V') && define('LSCWP_V', '6.5');
     37!defined('LSCWP_V') && define('LSCWP_V', '6.4.1');
    3838
    3939!defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR);
  • litespeed-cache/tags/6.4.1/readme.txt

    r3146646 r3146649  
    255255== Changelog ==
    256256
    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 
    275257= 6.4.1 - Aug 19 2024 =
    276258* ❗**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  
    111111    const O_DEBUG_LEVEL = 'debug-level';
    112112    const O_DEBUG_FILESIZE = 'debug-filesize';
    113     const O_DEBUG_COOKIE = 'debug-cookie'; // For backwards compatibility, will drop after v7.0
     113    const O_DEBUG_COOKIE = 'debug-cookie';
    114114    const O_DEBUG_COLLAPSE_QS = 'debug-collapse_qs';
    115115    const O_DEBUG_COLLAPS_QS = 'debug-collapse_qs'; // For backwards compatibility, will drop after v6.5
     
    407407        self::O_DEBUG_LEVEL => false,
    408408        self::O_DEBUG_FILESIZE => 0,
     409        self::O_DEBUG_COOKIE => false,
    409410        self::O_DEBUG_COLLAPSE_QS => false,
    410411        self::O_DEBUG_INC => array(),
     
    593594        self::O_DEBUG_LEVEL => false,
    594595        self::O_DEBUG_FILESIZE => 0,
     596        self::O_DEBUG_COOKIE => false,
    595597        self::O_DEBUG_COLLAPSE_QS => false,
    596598        self::O_DEBUG_INC => array(),
  • litespeed-cache/tags/6.4.1/src/cloud.cls.php

    r3146646 r3146649  
    15481548
    15491549    /**
    1550      * Return pong for ping to check PHP function availability
    1551      * @since 6.5
    1552      */
    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     /**
    15741550     * Handle all request actions from main cls
    15751551     *
  • litespeed-cache/tags/6.4.1/src/debug2.cls.php

    r3146646 r3146649  
    3232    public function __construct()
    3333    {
    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';
    3936        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';
    4138        }
    4239
     
    5148
    5249    /**
    53      * Try moving legacy logs into /litespeed/debug/ folder
    54      *
    55      * @since 6.5
    56      */
    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 path
    74      *
    75      * @since 6.5
    76      */
    77     public function path($type)
    78     {
    79         return self::$log_path_prefix . self::FilePath($type);
    80     }
    81 
    82     /**
    83      * Generate the fixed log filename
    84      *
    85      * @since 6.5
    86      */
    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     /**
    9750     * End call of one request process
    9851     * @since 4.7
     
    10154    public static function ended()
    10255    {
    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());
    11057
    11158        $elapsed_time = number_format((microtime(true) - LSCWP_TS_0) * 1000, 2);
     
    197144        }
    198145
    199         $purge_file = self::cls()->path('purge');
     146        $purge_file = self::$log_path_prefix . '/debug.purge.log';
    200147
    201148        self::cls()->_init_request($purge_file);
     
    320267            $params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING'];
    321268        }
    322         // $params[] = 'Cookie: ' . $server['HTTP_COOKIE'];
     269        if ($this->conf(Base::O_DEBUG_COOKIE)) {
     270            $params[] = 'Cookie: ' . $server['HTTP_COOKIE'];
     271        }
    323272        if (isset($_COOKIE['_lscache_vary'])) {
    324273            $params[] = 'Cookie _lscache_vary: ' . $_COOKIE['_lscache_vary'];
     
    528477    private function _clear_log()
    529478    {
    530         $logs = array('debug', 'purge', 'crawler');
     479        $logs = array('debug', 'debug.purge', 'crawler');
    531480        foreach ($logs as $log) {
    532             File::save($this->path($log), '');
     481            File::save(self::$log_path_prefix . "/{$log}.log", '');
    533482        }
    534483    }
  • litespeed-cache/tags/6.4.1/src/esi.cls.php

    r3146646 r3146649  
    2222    private static $has_esi = false;
    2323    private static $_combine_ids = array();
     24    private $admin_rendered = false;
    2425    private $esi_args = null;
    2526    private $_esi_preserve_list = array();
     
    365366        // Add admin_bar esi
    366367        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);
    368371            remove_action('wp_footer', 'wp_admin_bar_render', 1000);
    369372            add_action('wp_footer', array($this, 'sub_admin_bar_block'), 1000);
     
    768771        global $wp_admin_bar;
    769772
     773        if ($this->admin_rendered) {
     774            return;
     775        }
     776
    770777        if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) {
    771778            return;
     
    777784        );
    778785
     786        $this->admin_rendered = true;
    779787        echo $this->sub_esi_block('admin-bar', 'adminbar', $params);
    780788    }
  • litespeed-cache/tags/6.4.1/src/htaccess.cls.php

    r3146646 r3146649  
    9494            'CacheLookup on',
    9595            'RewriteRule .* - [E=Cache-Control:no-autoflush]',
    96             'RewriteRule ' . preg_quote(LITESPEED_DATA_FOLDER) . '/debug/.*\.log$ - [F,L]',
     96            // "RewriteRule \.object-cache\.ini - [F,L]",
    9797            'RewriteRule ' . preg_quote(self::CONF_FILE) . ' - [F,L]',
    9898        );
  • litespeed-cache/tags/6.4.1/src/lang.cls.php

    r3146646 r3146649  
    270270            self::O_DEBUG_LEVEL => __('Debug Level', 'litespeed-cache'),
    271271            self::O_DEBUG_FILESIZE => __('Log File Size Limit', 'litespeed-cache'),
     272            self::O_DEBUG_COOKIE => __('Log Cookies', 'litespeed-cache'),
    272273            self::O_DEBUG_COLLAPSE_QS => __('Collapse Query Strings', 'litespeed-cache'),
    273274            self::O_DEBUG_INC => __('Debug URI Includes', 'litespeed-cache'),
  • litespeed-cache/tags/6.4.1/src/object-cache.cls.php

    r3146646 r3146649  
    11<?php
    2 
    32/**
    43 * The object cache class
     
    98 * @author      LiteSpeed Technologies <[email protected]>
    109 */
    11 
    1210namespace LiteSpeed;
    13 
    1411defined('WPINC') || exit();
    1512
     
    6259    public function __construct($cfg = false)
    6360    {
     61        $this->debug_oc('-------------');
     62        $this->debug_oc('init');
     63
    6464        if ($cfg) {
    6565            if (!is_array($cfg[Base::O_OBJECT_GLOBAL_GROUPS])) {
     
    159159        }
    160160
    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');
    167162    }
    168163
     
    348343            }
    349344            restore_error_handler();
    350         } else { // Connect to Memcached
     345        } /**
     346         * Connect to Memcached
     347         */ else {
    351348            if ($this->_cfg_persistent) {
    352349                $this->_conn = new \Memcached($this->_get_mem_id());
  • litespeed-cache/tags/6.4.1/src/optimize.cls.php

    r3146646 r3146649  
    10901090
    10911091                // 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)) {
    10931093                    Debug2::debug('[Optm] ucss_file_exc_inline hit ' . $attrs['href']);
    10941094                    // Replace this css to inline from orig html
  • litespeed-cache/tags/6.4.1/src/optimizer.cls.php

    r3146646 r3146649  
    5858            $content_final = $obj->process();
    5959            // check if content from minification is empty
    60             if ($content_final == '') {
     60            if($content_final == ''){
    6161                Debug2::debug('Failed to minify HTML: HTML minification resulted in empty HTML');
    6262                return $content;
  • litespeed-cache/tags/6.4.1/src/rest.cls.php

    r3146646 r3146649  
    7373            'permission_callback' => array($this, 'is_from_cloud'),
    7474        ));
    75         register_rest_route('litespeed/v3', '/ping', array(
    76             'methods' => 'POST',
     75        register_rest_route('litespeed/v1', '/ping', array(
     76            'methods' => 'GET',
    7777            'callback' => array($this, 'ping'),
    78             'permission_callback' => array($this, 'is_from_cloud'),
     78            'permission_callback' => '__return_true',
    7979        ));
    8080
     
    169169    public function ping()
    170170    {
    171         return $this->cls('Cloud')->ping();
     171        return Cloud::ok(array('ver' => Core::VER));
    172172    }
    173173
  • litespeed-cache/tags/6.4.1/src/router.cls.php

    r3146646 r3146649  
    604604
    605605            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))) {
    607607                    self::$_action = $action;
    608608                }
  • litespeed-cache/tags/6.4.1/thirdparty/user-switching.cls.php

    r3146646 r3146649  
    1313    public static function detect()
    1414    {
    15         if (!class_exists('user_switching')) {
     15        if (!defined('user_switching')) {
    1616            return;
    1717        }
  • litespeed-cache/tags/6.4.1/thirdparty/woocommerce.cls.php

    r3146646 r3146649  
    729729            return;
    730730        }
    731 
    732731        global $wp_widget_factory;
    733         if (!isset($wp_widget_factory->widgets['WC_Widget_Recent_Reviews'])) {
    734             return;
    735         }
    736 
    737732        $recent_reviews = $wp_widget_factory->widgets['WC_Widget_Recent_Reviews'];
    738733        if (!is_null($recent_reviews)) {
  • litespeed-cache/tags/6.4.1/tpl/toolbox/beta_test.tpl.php

    r3146646 r3146649  
    77// Existing public version list
    88$v_list = array(
    9     '6.5',
    109    '6.4.1',
    1110    '6.3.0.1',
  • litespeed-cache/tags/6.4.1/tpl/toolbox/log_viewer.tpl.php

    r3146646 r3146649  
    33namespace LiteSpeed;
    44
    5 defined('WPINC') || exit;
     5defined( 'WPINC' ) || exit;
    66
    77$logs =
     
    99        array(
    1010            'name' => 'debug',
    11             'label' => esc_html__('Debug Log', 'litespeed-cache'),
     11            'label' => esc_html__( 'Debug Log', 'litespeed-cache' ),
    1212            'accesskey' => 'A',
    1313        ),
    1414        array(
    15             'name' => 'purge',
    16             'label' => esc_html__('Purge Log', 'litespeed-cache'),
     15            'name' => 'debug.purge',
     16            'label' => esc_html__( 'Purge Log', 'litespeed-cache' ),
    1717            'accesskey' => 'B',
    1818        ),
    1919        array(
    2020            'name' => 'crawler',
    21             'label' => esc_html__('Crawler Log', 'litespeed-cache'),
     21            'label' => esc_html__( 'Crawler Log', 'litespeed-cache' ),
    2222            'accesskey' => 'C',
    2323        ),
     
    2828 * @since  4.7
    2929 */
    30 function subnav_link($item)
    31 {
     30function subnav_link( $item ) {
    3231    $class = 'button ';
    3332    $subtab = '';
    3433
    35     if (!isset($item['url'])) {
     34    if ( ! isset( $item['url'] ) ) {
    3635        $class .= 'button-secondary';
    3736        $subtab_name = "{$item['name']}_log";
    3837        $subtab = "data-litespeed-subtab='{$subtab_name}'";
    39         $url = "#{$subtab_name}";
    40     } else {
     38        $url ="#{$subtab_name}";
     39    }
     40    else {
    4141        $class .= 'button-primary';
    4242        $url = $item['url'];
     
    4444
    4545    $accesskey =
    46         isset($item['accesskey'])
     46        isset( $item['accesskey'] )
    4747        ? "litespeed-accesskey='{$item['accesskey']}'"
    4848        : '';
    49     $label = isset($item['label']) ? $item['label'] : $item['name'];
     49    $label = isset( $item['label'] ) ? $item['label'] : $item['name'];
    5050
    5151    return "<a href='{$url}' class='{$class}' {$subtab} {$accesskey}>{$label}</a>";
     
    5656 * @since  4.7
    5757 */
    58 function clear_logs_link($accesskey = null)
    59 {
     58function clear_logs_link( $accesskey = null ) {
    6059    $item =
    6160        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 ),
    6463        );
    65     if (null !== $accesskey) {
     64    if ( null !== $accesskey ) {
    6665        $item['accesskey'] = $accesskey;
    6766    }
    68     echo subnav_link($item);
     67    echo subnav_link( $item );
    6968}
    7069
     
    7271$log_views = array();
    7372
    74 foreach ($logs as $log) {
    75     $subnav_links[] = subnav_link($log);
     73foreach( $logs as $log ) {
     74    $subnav_links[] = subnav_link( $log );
    7675
    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 );
    7978    $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 ) ) : '';
    8281
    8382    $log_views[] =
    8483        "<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>'
    8988        . '</div>';
    9089}
     
    9291
    9392<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' ); ?>
    9695</h3>
    9796
    9897<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' ); ?>
    101100</div>
    102101
    103 <?php echo implode("\n", $log_views); ?>
     102<?php echo implode( "\n", $log_views ); ?>
    104103
    105104<?php
  • litespeed-cache/tags/6.4.1/tpl/toolbox/report.tpl.php

    r3146646 r3146649  
    11<?php
     2namespace LiteSpeed ;
     3defined( 'WPINC' ) || exit ;
    24
    3 namespace LiteSpeed;
    4 
    5 defined('WPINC') || exit;
    6 
    7 $_report = Report::cls();
     5$_report = Report::cls() ;
    86$report = $_report->generate_environment_report();
    97
    10 $env_ref = Report::get_summary();
     8$env_ref = Report::get_summary() ;
    119
    1210// Detect password less plugin
    1311$link = '';
    1412$has_pswdless_plugin = false;
    15 if (function_exists('dologin_gen_link')) {
     13if ( function_exists( 'dologin_gen_link' ) ) {
    1614    $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
    2521    }
    2622}
    2723
    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' ) );
    2925?>
    3026
    31 <?php if (!$has_pswdless_plugin) : ?>
     27<?php if ( ! $has_pswdless_plugin ) : ?>
    3228    <div class="litespeed-callout notice notice-warning inline">
    33         <h4><?php echo __('NOTICE:', 'litespeed-cache'); ?></h4>
     29        <h4><?php echo __( 'NOTICE:', 'litespeed-cache' ); ?></h4>
    3430        <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>' ); ?>
    3632        </p>
    3733        <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>
    4036        </p>
    4137    </div>
     
    4339
    4440<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' ); ?>
    4743</h3>
    4844
    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>
    5147
    5248<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' ); ?>
    5450    <br />
    5551    <?php echo __('If you run into any issues, please refer to the report number in your support message.', 'litespeed-cache'); ?>
    5652</p>
    5753
    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>
    9791
    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>
    10195
    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>
    10599</form>
    106100
    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  
    11<?php
     2namespace LiteSpeed;
     3defined( 'WPINC' ) || exit;
    24
    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 );
    86?>
    97
     
    1210</h3>
    1311
    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' ); ?>
    1614</a>
    1715
    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' ); ?>
    2018</a>
    2119
     
    2321<h3 class="litespeed-title-short">
    2422    <?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' ); ?>
    2624</h3>
    2725
    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>
    4239
    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>
    5855
    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>
    7875
    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>
    9188
    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>
    106103
    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>
    119116
    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>
    133129
    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>
    147143
    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>
    161157
    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>
    164173
    165174<?php
    166175
    167176$this->form_end();
     177
  • litespeed-cache/trunk/data/const.default.ini

    r3146597 r3146649  
    264264debug-filesize = 3
    265265
     266; O_DEBUG_COOKIE
     267debug-cookie = false
     268
    266269; O_DEBUG_COLLAPSE_QS
    267270debug-collapse_qs = false
  • litespeed-cache/trunk/data/const.network_default.ini

    r3146597 r3146649  
    122122debug-filesize = 3
    123123
     124; O_DEBUG_COOKIE
     125debug-cookie = false
     126
    124127; O_DEBUG_COLLAPSE_QS
    125128debug-collapse_qs = false
  • litespeed-cache/trunk/data/esi.nonces.txt

    r3146597 r3146649  
    7272wpmenucart private
    7373
    74 # Advanced Custom Fields + Advanced Forms
    75 acf_nonce
    76 af_form_nonce
    77 af_submission_*
    78 
    7974# Woo nonce
    8075woocommerce-login
  • litespeed-cache/trunk/litespeed-cache.php

    r3146597 r3146649  
    55 * Plugin URI:        https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
    66 * Description:       High-performance page caching and site optimization from LiteSpeed
    7  * Version:           6.5
     7 * Version:           6.4.1
    88 * Author:            LiteSpeed Technologies
    99 * Author URI:        https://www.litespeedtech.com
     
    3535}
    3636
    37 !defined('LSCWP_V') && define('LSCWP_V', '6.5');
     37!defined('LSCWP_V') && define('LSCWP_V', '6.4.1');
    3838
    3939!defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR);
  • litespeed-cache/trunk/readme.txt

    r3146646 r3146649  
    255255== Changelog ==
    256256
    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 
    275257= 6.4.1 - Aug 19 2024 =
    276258* ❗**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  
    111111    const O_DEBUG_LEVEL = 'debug-level';
    112112    const O_DEBUG_FILESIZE = 'debug-filesize';
    113     const O_DEBUG_COOKIE = 'debug-cookie'; // For backwards compatibility, will drop after v7.0
     113    const O_DEBUG_COOKIE = 'debug-cookie';
    114114    const O_DEBUG_COLLAPSE_QS = 'debug-collapse_qs';
    115115    const O_DEBUG_COLLAPS_QS = 'debug-collapse_qs'; // For backwards compatibility, will drop after v6.5
     
    407407        self::O_DEBUG_LEVEL => false,
    408408        self::O_DEBUG_FILESIZE => 0,
     409        self::O_DEBUG_COOKIE => false,
    409410        self::O_DEBUG_COLLAPSE_QS => false,
    410411        self::O_DEBUG_INC => array(),
     
    593594        self::O_DEBUG_LEVEL => false,
    594595        self::O_DEBUG_FILESIZE => 0,
     596        self::O_DEBUG_COOKIE => false,
    595597        self::O_DEBUG_COLLAPSE_QS => false,
    596598        self::O_DEBUG_INC => array(),
  • litespeed-cache/trunk/src/cloud.cls.php

    r3146597 r3146649  
    15481548
    15491549    /**
    1550      * Return pong for ping to check PHP function availability
    1551      * @since 6.5
    1552      */
    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     /**
    15741550     * Handle all request actions from main cls
    15751551     *
  • litespeed-cache/trunk/src/debug2.cls.php

    r3146597 r3146649  
    3232    public function __construct()
    3333    {
    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';
    3936        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';
    4138        }
    4239
     
    5148
    5249    /**
    53      * Try moving legacy logs into /litespeed/debug/ folder
    54      *
    55      * @since 6.5
    56      */
    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 path
    74      *
    75      * @since 6.5
    76      */
    77     public function path($type)
    78     {
    79         return self::$log_path_prefix . self::FilePath($type);
    80     }
    81 
    82     /**
    83      * Generate the fixed log filename
    84      *
    85      * @since 6.5
    86      */
    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     /**
    9750     * End call of one request process
    9851     * @since 4.7
     
    10154    public static function ended()
    10255    {
    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());
    11057
    11158        $elapsed_time = number_format((microtime(true) - LSCWP_TS_0) * 1000, 2);
     
    197144        }
    198145
    199         $purge_file = self::cls()->path('purge');
     146        $purge_file = self::$log_path_prefix . '/debug.purge.log';
    200147
    201148        self::cls()->_init_request($purge_file);
     
    320267            $params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING'];
    321268        }
    322         // $params[] = 'Cookie: ' . $server['HTTP_COOKIE'];
     269        if ($this->conf(Base::O_DEBUG_COOKIE)) {
     270            $params[] = 'Cookie: ' . $server['HTTP_COOKIE'];
     271        }
    323272        if (isset($_COOKIE['_lscache_vary'])) {
    324273            $params[] = 'Cookie _lscache_vary: ' . $_COOKIE['_lscache_vary'];
     
    528477    private function _clear_log()
    529478    {
    530         $logs = array('debug', 'purge', 'crawler');
     479        $logs = array('debug', 'debug.purge', 'crawler');
    531480        foreach ($logs as $log) {
    532             File::save($this->path($log), '');
     481            File::save(self::$log_path_prefix . "/{$log}.log", '');
    533482        }
    534483    }
  • litespeed-cache/trunk/src/esi.cls.php

    r3146597 r3146649  
    2222    private static $has_esi = false;
    2323    private static $_combine_ids = array();
     24    private $admin_rendered = false;
    2425    private $esi_args = null;
    2526    private $_esi_preserve_list = array();
     
    365366        // Add admin_bar esi
    366367        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);
    368371            remove_action('wp_footer', 'wp_admin_bar_render', 1000);
    369372            add_action('wp_footer', array($this, 'sub_admin_bar_block'), 1000);
     
    768771        global $wp_admin_bar;
    769772
     773        if ($this->admin_rendered) {
     774            return;
     775        }
     776
    770777        if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) {
    771778            return;
     
    777784        );
    778785
     786        $this->admin_rendered = true;
    779787        echo $this->sub_esi_block('admin-bar', 'adminbar', $params);
    780788    }
  • litespeed-cache/trunk/src/htaccess.cls.php

    r3146597 r3146649  
    9494            'CacheLookup on',
    9595            'RewriteRule .* - [E=Cache-Control:no-autoflush]',
    96             'RewriteRule ' . preg_quote(LITESPEED_DATA_FOLDER) . '/debug/.*\.log$ - [F,L]',
     96            // "RewriteRule \.object-cache\.ini - [F,L]",
    9797            'RewriteRule ' . preg_quote(self::CONF_FILE) . ' - [F,L]',
    9898        );
  • litespeed-cache/trunk/src/lang.cls.php

    r3146597 r3146649  
    270270            self::O_DEBUG_LEVEL => __('Debug Level', 'litespeed-cache'),
    271271            self::O_DEBUG_FILESIZE => __('Log File Size Limit', 'litespeed-cache'),
     272            self::O_DEBUG_COOKIE => __('Log Cookies', 'litespeed-cache'),
    272273            self::O_DEBUG_COLLAPSE_QS => __('Collapse Query Strings', 'litespeed-cache'),
    273274            self::O_DEBUG_INC => __('Debug URI Includes', 'litespeed-cache'),
  • litespeed-cache/trunk/src/object-cache.cls.php

    r3146597 r3146649  
    11<?php
    2 
    32/**
    43 * The object cache class
     
    98 * @author      LiteSpeed Technologies <[email protected]>
    109 */
    11 
    1210namespace LiteSpeed;
    13 
    1411defined('WPINC') || exit();
    1512
     
    6259    public function __construct($cfg = false)
    6360    {
     61        $this->debug_oc('-------------');
     62        $this->debug_oc('init');
     63
    6464        if ($cfg) {
    6565            if (!is_array($cfg[Base::O_OBJECT_GLOBAL_GROUPS])) {
     
    159159        }
    160160
    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');
    167162    }
    168163
     
    348343            }
    349344            restore_error_handler();
    350         } else { // Connect to Memcached
     345        } /**
     346         * Connect to Memcached
     347         */ else {
    351348            if ($this->_cfg_persistent) {
    352349                $this->_conn = new \Memcached($this->_get_mem_id());
  • litespeed-cache/trunk/src/optimize.cls.php

    r3146597 r3146649  
    10901090
    10911091                // 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)) {
    10931093                    Debug2::debug('[Optm] ucss_file_exc_inline hit ' . $attrs['href']);
    10941094                    // Replace this css to inline from orig html
  • litespeed-cache/trunk/src/optimizer.cls.php

    r3146597 r3146649  
    5858            $content_final = $obj->process();
    5959            // check if content from minification is empty
    60             if ($content_final == '') {
     60            if($content_final == ''){
    6161                Debug2::debug('Failed to minify HTML: HTML minification resulted in empty HTML');
    6262                return $content;
  • litespeed-cache/trunk/src/rest.cls.php

    r3146597 r3146649  
    7373            'permission_callback' => array($this, 'is_from_cloud'),
    7474        ));
    75         register_rest_route('litespeed/v3', '/ping', array(
    76             'methods' => 'POST',
     75        register_rest_route('litespeed/v1', '/ping', array(
     76            'methods' => 'GET',
    7777            'callback' => array($this, 'ping'),
    78             'permission_callback' => array($this, 'is_from_cloud'),
     78            'permission_callback' => '__return_true',
    7979        ));
    8080
     
    169169    public function ping()
    170170    {
    171         return $this->cls('Cloud')->ping();
     171        return Cloud::ok(array('ver' => Core::VER));
    172172    }
    173173
  • litespeed-cache/trunk/src/router.cls.php

    r3146597 r3146649  
    604604
    605605            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))) {
    607607                    self::$_action = $action;
    608608                }
  • litespeed-cache/trunk/thirdparty/user-switching.cls.php

    r3146597 r3146649  
    1313    public static function detect()
    1414    {
    15         if (!class_exists('user_switching')) {
     15        if (!defined('user_switching')) {
    1616            return;
    1717        }
  • litespeed-cache/trunk/thirdparty/woocommerce.cls.php

    r3146597 r3146649  
    729729            return;
    730730        }
    731 
    732731        global $wp_widget_factory;
    733         if (!isset($wp_widget_factory->widgets['WC_Widget_Recent_Reviews'])) {
    734             return;
    735         }
    736 
    737732        $recent_reviews = $wp_widget_factory->widgets['WC_Widget_Recent_Reviews'];
    738733        if (!is_null($recent_reviews)) {
  • litespeed-cache/trunk/tpl/toolbox/beta_test.tpl.php

    r3146597 r3146649  
    77// Existing public version list
    88$v_list = array(
    9     '6.5',
    109    '6.4.1',
    1110    '6.3.0.1',
  • litespeed-cache/trunk/tpl/toolbox/log_viewer.tpl.php

    r3146597 r3146649  
    33namespace LiteSpeed;
    44
    5 defined('WPINC') || exit;
     5defined( 'WPINC' ) || exit;
    66
    77$logs =
     
    99        array(
    1010            'name' => 'debug',
    11             'label' => esc_html__('Debug Log', 'litespeed-cache'),
     11            'label' => esc_html__( 'Debug Log', 'litespeed-cache' ),
    1212            'accesskey' => 'A',
    1313        ),
    1414        array(
    15             'name' => 'purge',
    16             'label' => esc_html__('Purge Log', 'litespeed-cache'),
     15            'name' => 'debug.purge',
     16            'label' => esc_html__( 'Purge Log', 'litespeed-cache' ),
    1717            'accesskey' => 'B',
    1818        ),
    1919        array(
    2020            'name' => 'crawler',
    21             'label' => esc_html__('Crawler Log', 'litespeed-cache'),
     21            'label' => esc_html__( 'Crawler Log', 'litespeed-cache' ),
    2222            'accesskey' => 'C',
    2323        ),
     
    2828 * @since  4.7
    2929 */
    30 function subnav_link($item)
    31 {
     30function subnav_link( $item ) {
    3231    $class = 'button ';
    3332    $subtab = '';
    3433
    35     if (!isset($item['url'])) {
     34    if ( ! isset( $item['url'] ) ) {
    3635        $class .= 'button-secondary';
    3736        $subtab_name = "{$item['name']}_log";
    3837        $subtab = "data-litespeed-subtab='{$subtab_name}'";
    39         $url = "#{$subtab_name}";
    40     } else {
     38        $url ="#{$subtab_name}";
     39    }
     40    else {
    4141        $class .= 'button-primary';
    4242        $url = $item['url'];
     
    4444
    4545    $accesskey =
    46         isset($item['accesskey'])
     46        isset( $item['accesskey'] )
    4747        ? "litespeed-accesskey='{$item['accesskey']}'"
    4848        : '';
    49     $label = isset($item['label']) ? $item['label'] : $item['name'];
     49    $label = isset( $item['label'] ) ? $item['label'] : $item['name'];
    5050
    5151    return "<a href='{$url}' class='{$class}' {$subtab} {$accesskey}>{$label}</a>";
     
    5656 * @since  4.7
    5757 */
    58 function clear_logs_link($accesskey = null)
    59 {
     58function clear_logs_link( $accesskey = null ) {
    6059    $item =
    6160        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 ),
    6463        );
    65     if (null !== $accesskey) {
     64    if ( null !== $accesskey ) {
    6665        $item['accesskey'] = $accesskey;
    6766    }
    68     echo subnav_link($item);
     67    echo subnav_link( $item );
    6968}
    7069
     
    7271$log_views = array();
    7372
    74 foreach ($logs as $log) {
    75     $subnav_links[] = subnav_link($log);
     73foreach( $logs as $log ) {
     74    $subnav_links[] = subnav_link( $log );
    7675
    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 );
    7978    $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 ) ) : '';
    8281
    8382    $log_views[] =
    8483        "<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>'
    8988        . '</div>';
    9089}
     
    9291
    9392<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' ); ?>
    9695</h3>
    9796
    9897<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' ); ?>
    101100</div>
    102101
    103 <?php echo implode("\n", $log_views); ?>
     102<?php echo implode( "\n", $log_views ); ?>
    104103
    105104<?php
  • litespeed-cache/trunk/tpl/toolbox/report.tpl.php

    r3146597 r3146649  
    11<?php
     2namespace LiteSpeed ;
     3defined( 'WPINC' ) || exit ;
    24
    3 namespace LiteSpeed;
    4 
    5 defined('WPINC') || exit;
    6 
    7 $_report = Report::cls();
     5$_report = Report::cls() ;
    86$report = $_report->generate_environment_report();
    97
    10 $env_ref = Report::get_summary();
     8$env_ref = Report::get_summary() ;
    119
    1210// Detect password less plugin
    1311$link = '';
    1412$has_pswdless_plugin = false;
    15 if (function_exists('dologin_gen_link')) {
     13if ( function_exists( 'dologin_gen_link' ) ) {
    1614    $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
    2521    }
    2622}
    2723
    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' ) );
    2925?>
    3026
    31 <?php if (!$has_pswdless_plugin) : ?>
     27<?php if ( ! $has_pswdless_plugin ) : ?>
    3228    <div class="litespeed-callout notice notice-warning inline">
    33         <h4><?php echo __('NOTICE:', 'litespeed-cache'); ?></h4>
     29        <h4><?php echo __( 'NOTICE:', 'litespeed-cache' ); ?></h4>
    3430        <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>' ); ?>
    3632        </p>
    3733        <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>
    4036        </p>
    4137    </div>
     
    4339
    4440<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' ); ?>
    4743</h3>
    4844
    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>
    5147
    5248<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' ); ?>
    5450    <br />
    5551    <?php echo __('If you run into any issues, please refer to the report number in your support message.', 'litespeed-cache'); ?>
    5652</p>
    5753
    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>
    9791
    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>
    10195
    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>
    10599</form>
    106100
    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  
    11<?php
     2namespace LiteSpeed;
     3defined( 'WPINC' ) || exit;
    24
    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 );
    86?>
    97
     
    1210</h3>
    1311
    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' ); ?>
    1614</a>
    1715
    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' ); ?>
    2018</a>
    2119
     
    2321<h3 class="litespeed-title-short">
    2422    <?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' ); ?>
    2624</h3>
    2725
    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>
    4239
    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>
    5855
    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>
    7875
    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>
    9188
    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>
    106103
    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>
    119116
    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>
    133129
    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>
    147143
    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>
    161157
    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>
    164173
    165174<?php
    166175
    167176$this->form_end();
     177
Note: See TracChangeset for help on using the changeset viewer.