Plugin Directory

Changeset 3336822


Ignore:
Timestamp:
07/30/2025 07:05:03 PM (5 months ago)
Author:
LiteSpeedTech
Message:

Release v7.3.0.1

Location:
litespeed-cache
Files:
336 added
5 edited

Legend:

Unmodified
Added
Removed
  • litespeed-cache/trunk/litespeed-cache.php

    r3333851 r3336822  
    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:           7.3
     7 * Version:           7.3.0.1
    88 * Author:            LiteSpeed Technologies
    99 * Author URI:        https://www.litespeedtech.com
     
    3333if (defined('LSCWP_V')) return;
    3434
    35 !defined('LSCWP_V') && define('LSCWP_V', '7.3');
     35!defined('LSCWP_V') && define('LSCWP_V', '7.3.0.1');
    3636
    3737!defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR);
  • litespeed-cache/trunk/readme.txt

    r3333851 r3336822  
    55Requires PHP: 7.2
    66Tested up to: 6.8
    7 Stable tag: 7.3
     7Stable tag: 7.3.0.1
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl.html
     
    257257
    258258== Changelog ==
     259
     260= 7.3.0.1 - Jul 30 2025 =
     261* **Page Optimize** Fixed the page score impact caused by CSS placeholder. (wpconvert, Sean Thompson)
     262* **Page Optimize** Fixed wrong prefetch/preload injection when a page contains other `<title>` tags. (idatahuy)
     263* **Crawler** Bypassed port test if no server IP set. (kptk, serkanix, Guillermo)
    259264
    260265= 7.3 - Jul 24 2025 =
  • litespeed-cache/trunk/src/crawler.cls.php

    r3333851 r3336822  
    674674    private function _test_port() {
    675675        if (!$this->_server_ip) {
     676            if (empty($this->_crawlers[$this->_summary['curr_crawler']]['uid'])) {
     677                self::debug('Bypass test port as Server IP is not set');
     678                return true;
     679            }
    676680            self::debug('❌ Server IP not set');
    677681            return false;
     
    885889
    886890    /**
     891     * If need to resolve DNS or not
     892     *
     893     * @since 7.3.0.1
     894     */
     895    private function _should_force_resolve_dns() {
     896        if ($this->_server_ip) {
     897            return true;
     898        }
     899        if (!empty($this->_crawler_conf['cookies']) && !empty($this->_crawler_conf['cookies']['litespeed_hash'])) {
     900            return true;
     901        }
     902        return false;
     903    }
     904
     905    /**
    887906     * Send multi curl requests
    888907     * If res=B, bypass request and won't return
     
    919938
    920939            // IP resolve
    921             if ((!empty($this->_crawler_conf['cookies']) && !empty($this->_crawler_conf['cookies']['litespeed_hash'])) || $this->_server_ip) {
     940            if ($this->_should_force_resolve_dns()) {
    922941                $parsed_url = parse_url($url);
    923942                // self::debug('Crawl role simulator, required to use localhost for resolve');
     
    11421161            if (!empty($parsed_url['host'])) {
    11431162                $dom                                   = $parsed_url['host'];
    1144                 $port                                  = defined('LITESPEED_CRAWLER_LOCAL_PORT') ? LITESPEED_CRAWLER_LOCAL_PORT : '443';
     1163                $port                                  = defined('LITESPEED_CRAWLER_LOCAL_PORT') ? LITESPEED_CRAWLER_LOCAL_PORT : '443'; // TODO: need to test port?
    11451164                $resolved                              = $dom . ':' . $port . ':' . $this->_server_ip;
    11461165                $options[CURLOPT_RESOLVE]              = array( $resolved );
  • litespeed-cache/trunk/src/optimize.cls.php

    r3333851 r3336822  
    1919
    2020    const ITEM_TIMESTAMP_PURGE_CSS = 'timestamp_purge_css';
     21
     22    const DUMMY_CSS_REGEX = "#<link rel='stylesheet' id='litespeed-cache-dummy-css' href='.+assets/css/litespeed-dummy\.css[?\w.=-]*'[ \w='/]*>#isU";
    2123
    2224    private $content;
     
    221223     */
    222224    public function finalize( $content ) {
     225        $content = $this->_finalize($content);
     226        // Fallback to replace dummy css placeholder
     227        if (false !== preg_match(self::DUMMY_CSS_REGEX, $content)) {
     228            self::debug('Fallback to drop dummy CSS');
     229            $content = preg_replace( self::DUMMY_CSS_REGEX, '', $content );
     230        }
     231        return $content;
     232    }
     233    private function _finalize( $content ) {
    223234        if (defined('LITESPEED_NO_PAGEOPTM')) {
    224235            self::debug2('bypass: NO_PAGEOPTM const');
     
    474485                self::debug('Put early optm data to be after <meta charset>');
    475486                $this->content = preg_replace('#<meta charset([^>]*)>#isU', '<meta charset$1>' . $this->html_head_early, $this->content, 1);
    476             }
    477             // Fallback: try to be before <title>
    478             elseif (false !== strpos($this->content, '<title>')) {
    479                 self::debug('Put early optm data to be before <title>');
    480                 $this->content = str_replace('<title>', $this->html_head_early . '<title>', $this->content);
    481487            } else {
    482488                self::debug('Put early optm data to be right after <head>');
     
    490496            } else {
    491497                // Put header content to dummy css position
    492                 $dummy_css = "<link rel='stylesheet' id='litespeed-cache-dummy-css' href='" . LSWCP_PLUGIN_URL . "assets/css/litespeed-dummy.css' media='all' />";
    493                 if (strpos($this->content, $dummy_css) !== false) {
     498                if (false !== preg_match(self::DUMMY_CSS_REGEX, $this->content)) {
    494499                    self::debug('Put optm data to dummy css location');
    495                     $this->content = str_replace( $dummy_css, $this->html_head, $this->content );
    496                 }
    497                 // Fallback: try to be after <title>
    498                 elseif (strpos($this->content, '</title>') !== false) {
    499                     self::debug('Put optm data to be after <title>');
    500                     $this->content = str_replace('</title>', '</title>' . $this->html_head, $this->content);
     500                    $this->content = preg_replace( self::DUMMY_CSS_REGEX, $this->html_head, $this->content );
    501501                }
    502502                // Fallback: try to be after charset
  • litespeed-cache/trunk/tpl/toolbox/beta_test.tpl.php

    r3333851 r3336822  
    1515// List of available public versions
    1616$v_list = array(
     17    '7.3.0.1',
    1718    '7.3',
    1819    '7.2',
Note: See TracChangeset for help on using the changeset viewer.