Version Description
- May 7 2018 =
- [IMPROVEMENT] Improved compatibility with themes using the same js_min library. (#129093 @Darren)
- [BUGFIX] Fixed a bug when checking image path for dynamic files. (@miladk)
- [INTEGRATION] Compatibility with Universal Star Rating. (@miladk)
Download this release
Release Info
Developer | LiteSpeedTech |
Plugin | LiteSpeed Cache |
Version | 2.2.4 |
Comparing to | |
See all releases |
Code changes from version 2.2.3 to 2.2.4
- inc/img_optm.class.php +2 -0
- inc/litespeed-cache.class.php +1 -1
- inc/litespeed.autoload.php +6 -1
- inc/media.class.php +1 -1
- inc/optimizer.class.php +4 -14
- inc/utility.class.php +9 -1
- includes/litespeed-cache-utility.class.php +9 -1
- includes/litespeed-cache.class.php +1 -1
- includes/litespeed.autoload.php +6 -1
- languages/litespeed-cache.pot +11 -11
- lib/css_min.class.php +1 -1
- lib/css_min.colors.class.php +1 -1
- lib/{url_rewritter.class.php → css_min.url_rewritter.class.php} +11 -16
- lib/css_min.utils.class.php +1 -1
- lib/html_min.class.php +3 -0
- lib/js_min.class.php +5 -1
- litespeed-cache.php +1 -1
- readme.txt +7 -2
inc/img_optm.class.php
CHANGED
@@ -1011,6 +1011,8 @@ class LiteSpeed_Cache_Img_Optm
|
|
1011 |
*/
|
1012 |
public function check_img()
|
1013 |
{
|
|
|
|
|
1014 |
$pid = $_POST[ 'data' ] ;
|
1015 |
|
1016 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Check image [ID] ' . $pid ) ;
|
1011 |
*/
|
1012 |
public function check_img()
|
1013 |
{
|
1014 |
+
global $wpdb ;
|
1015 |
+
|
1016 |
$pid = $_POST[ 'data' ] ;
|
1017 |
|
1018 |
LiteSpeed_Cache_Log::debug( '[Img_Optm] Check image [ID] ' . $pid ) ;
|
inc/litespeed-cache.class.php
CHANGED
@@ -19,7 +19,7 @@ class LiteSpeed_Cache
|
|
19 |
private static $_instance ;
|
20 |
|
21 |
const PLUGIN_NAME = 'litespeed-cache' ;
|
22 |
-
const PLUGIN_VERSION = '2.2.
|
23 |
|
24 |
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
|
25 |
|
19 |
private static $_instance ;
|
20 |
|
21 |
const PLUGIN_NAME = 'litespeed-cache' ;
|
22 |
+
const PLUGIN_VERSION = '2.2.4' ;
|
23 |
|
24 |
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
|
25 |
|
inc/litespeed.autoload.php
CHANGED
@@ -63,7 +63,12 @@ if ( !function_exists('_litespeed_autoload') ) {
|
|
63 |
|
64 |
'LiteSpeed_Cache_Tags' => 'includes/deprecated-litespeed-cache-tags.class.php',
|
65 |
|
66 |
-
'Minify_HTML'
|
|
|
|
|
|
|
|
|
|
|
67 |
);
|
68 |
if( array_key_exists($cls, $class2fileArr) && file_exists(LSCWP_DIR . $class2fileArr[$cls]) ) {
|
69 |
require_once LSCWP_DIR . $class2fileArr[$cls];
|
63 |
|
64 |
'LiteSpeed_Cache_Tags' => 'includes/deprecated-litespeed-cache-tags.class.php',
|
65 |
|
66 |
+
'LiteSpeed_3rd_Lib\Minify_HTML' => 'lib/html_min.class.php',
|
67 |
+
'LiteSpeed_3rd_Lib\css_min\Minifier' => 'lib/css_min.class.php',
|
68 |
+
'LiteSpeed_3rd_Lib\css_min\Colors' => 'lib/css_min.colors.class.php',
|
69 |
+
'LiteSpeed_3rd_Lib\css_min\Utils' => 'lib/css_min.utils.class.php',
|
70 |
+
'LiteSpeed_3rd_Lib\css_min\UriRewriter' => 'lib/css_min.url_rewritter.class.php',
|
71 |
+
'LiteSpeed_3rd_Lib\js_min\JSMin' => 'lib/js_min.class.php',
|
72 |
);
|
73 |
if( array_key_exists($cls, $class2fileArr) && file_exists(LSCWP_DIR . $class2fileArr[$cls]) ) {
|
74 |
require_once LSCWP_DIR . $class2fileArr[$cls];
|
inc/media.class.php
CHANGED
@@ -648,7 +648,7 @@ class LiteSpeed_Cache_Media
|
|
648 |
|
649 |
if ( LiteSpeed_Cache_Utility::is_internal_file( $url ) ) {
|
650 |
// check if has webp file
|
651 |
-
if ( LiteSpeed_Cache_Utility::is_internal_file( $url
|
652 |
$url .= '.webp' ;
|
653 |
}
|
654 |
else {
|
648 |
|
649 |
if ( LiteSpeed_Cache_Utility::is_internal_file( $url ) ) {
|
650 |
// check if has webp file
|
651 |
+
if ( LiteSpeed_Cache_Utility::is_internal_file( $url, 'webp' ) ) {
|
652 |
$url .= '.webp' ;
|
653 |
}
|
654 |
else {
|
inc/optimizer.class.php
CHANGED
@@ -8,16 +8,6 @@
|
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
11 |
-
require_once LSCWP_DIR . 'lib/js_min.class.php' ;
|
12 |
-
require_once LSCWP_DIR . 'lib/css_min.class.php' ;
|
13 |
-
require_once LSCWP_DIR . 'lib/css_min.colors.class.php' ;
|
14 |
-
require_once LSCWP_DIR . 'lib/css_min.utils.class.php' ;
|
15 |
-
require_once LSCWP_DIR . 'lib/url_rewritter.class.php' ;
|
16 |
-
|
17 |
-
use tubalmartin\CssMin\Minifier as CSSmin;
|
18 |
-
use tubalmartin\CssMin\Colors as Colors;
|
19 |
-
use tubalmartin\CssMin\Utils as Utils;
|
20 |
-
|
21 |
|
22 |
class LiteSpeed_Cache_Optimizer
|
23 |
{
|
@@ -57,7 +47,7 @@ class LiteSpeed_Cache_Optimizer
|
|
57 |
* @since 2.2.3
|
58 |
*/
|
59 |
try {
|
60 |
-
$obj = new Minify_HTML( $content, $options ) ;
|
61 |
$content_final = $obj->process() ;
|
62 |
$content_final .= "\n" . '<!-- Page optimized by LiteSpeed Cache @' . date('Y-m-d H:i:s') . ' -->' ;
|
63 |
return $content_final ;
|
@@ -161,7 +151,7 @@ class LiteSpeed_Cache_Optimizer
|
|
161 |
$data = self::minify_css( $data ) ;
|
162 |
}
|
163 |
|
164 |
-
$data =
|
165 |
|
166 |
$con[] = $data ;
|
167 |
}
|
@@ -203,7 +193,7 @@ class LiteSpeed_Cache_Optimizer
|
|
203 |
public static function minify_css( $data )
|
204 |
{
|
205 |
try {
|
206 |
-
$obj = new
|
207 |
return $obj->run( $data ) ;
|
208 |
|
209 |
} catch ( Exception $e ) {
|
@@ -233,7 +223,7 @@ class LiteSpeed_Cache_Optimizer
|
|
233 |
}
|
234 |
|
235 |
try {
|
236 |
-
$data = JSMin::minify( $data ) ;
|
237 |
return $data ;
|
238 |
} catch ( Exception $e ) {
|
239 |
LiteSpeed_Cache_Log::debug( '******[Optmer] minify_js failed: ' . $e->getMessage() ) ;
|
8 |
* @subpackage LiteSpeed_Cache/inc
|
9 |
* @author LiteSpeed Technologies <info@litespeedtech.com>
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
class LiteSpeed_Cache_Optimizer
|
13 |
{
|
47 |
* @since 2.2.3
|
48 |
*/
|
49 |
try {
|
50 |
+
$obj = new LiteSpeed_3rd_Lib\Minify_HTML( $content, $options ) ;
|
51 |
$content_final = $obj->process() ;
|
52 |
$content_final .= "\n" . '<!-- Page optimized by LiteSpeed Cache @' . date('Y-m-d H:i:s') . ' -->' ;
|
53 |
return $content_final ;
|
151 |
$data = self::minify_css( $data ) ;
|
152 |
}
|
153 |
|
154 |
+
$data = LiteSpeed_3rd_Lib\css_min\UriRewriter::rewrite( $data, dirname( $real_path ) ) ;
|
155 |
|
156 |
$con[] = $data ;
|
157 |
}
|
193 |
public static function minify_css( $data )
|
194 |
{
|
195 |
try {
|
196 |
+
$obj = new LiteSpeed_3rd_Lib\css_min\Minifier() ;
|
197 |
return $obj->run( $data ) ;
|
198 |
|
199 |
} catch ( Exception $e ) {
|
223 |
}
|
224 |
|
225 |
try {
|
226 |
+
$data = LiteSpeed_3rd_Lib\js_min\JSMin::minify( $data ) ;
|
227 |
return $data ;
|
228 |
} catch ( Exception $e ) {
|
229 |
LiteSpeed_Cache_Log::debug( '******[Optmer] minify_js failed: ' . $e->getMessage() ) ;
|
inc/utility.class.php
CHANGED
@@ -430,7 +430,7 @@ class LiteSpeed_Cache_Utility
|
|
430 |
* @access public
|
431 |
* @return string|bool The real path of file OR false
|
432 |
*/
|
433 |
-
public static function is_internal_file( $url )
|
434 |
{
|
435 |
$url_parsed = parse_url( $url ) ;
|
436 |
if ( isset( $url_parsed[ 'host' ] ) && ! self::internal( $url_parsed[ 'host' ] ) ) {
|
@@ -482,6 +482,14 @@ class LiteSpeed_Cache_Utility
|
|
482 |
$file_path_ori = LiteSpeed_Cache_Router::frontend_path() . '/' . $url_parsed[ 'path' ] ;
|
483 |
}
|
484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
/**
|
486 |
* Added this filter for those plugins which overwrite the filepath
|
487 |
* @see #101091 plugin `Hide My WordPress`
|
430 |
* @access public
|
431 |
* @return string|bool The real path of file OR false
|
432 |
*/
|
433 |
+
public static function is_internal_file( $url, $addition_postfix = false )
|
434 |
{
|
435 |
$url_parsed = parse_url( $url ) ;
|
436 |
if ( isset( $url_parsed[ 'host' ] ) && ! self::internal( $url_parsed[ 'host' ] ) ) {
|
482 |
$file_path_ori = LiteSpeed_Cache_Router::frontend_path() . '/' . $url_parsed[ 'path' ] ;
|
483 |
}
|
484 |
|
485 |
+
/**
|
486 |
+
* Added new file postfix to be check if passed in
|
487 |
+
* @since 2.2.4
|
488 |
+
*/
|
489 |
+
if ( $addition_postfix ) {
|
490 |
+
$file_path_ori .= '.' . $addition_postfix ;
|
491 |
+
}
|
492 |
+
|
493 |
/**
|
494 |
* Added this filter for those plugins which overwrite the filepath
|
495 |
* @see #101091 plugin `Hide My WordPress`
|
includes/litespeed-cache-utility.class.php
CHANGED
@@ -430,7 +430,7 @@ class LiteSpeed_Cache_Utility
|
|
430 |
* @access public
|
431 |
* @return string|bool The real path of file OR false
|
432 |
*/
|
433 |
-
public static function is_internal_file( $url )
|
434 |
{
|
435 |
$url_parsed = parse_url( $url ) ;
|
436 |
if ( isset( $url_parsed[ 'host' ] ) && ! self::internal( $url_parsed[ 'host' ] ) ) {
|
@@ -482,6 +482,14 @@ class LiteSpeed_Cache_Utility
|
|
482 |
$file_path_ori = LiteSpeed_Cache_Router::frontend_path() . '/' . $url_parsed[ 'path' ] ;
|
483 |
}
|
484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
/**
|
486 |
* Added this filter for those plugins which overwrite the filepath
|
487 |
* @see #101091 plugin `Hide My WordPress`
|
430 |
* @access public
|
431 |
* @return string|bool The real path of file OR false
|
432 |
*/
|
433 |
+
public static function is_internal_file( $url, $addition_postfix = false )
|
434 |
{
|
435 |
$url_parsed = parse_url( $url ) ;
|
436 |
if ( isset( $url_parsed[ 'host' ] ) && ! self::internal( $url_parsed[ 'host' ] ) ) {
|
482 |
$file_path_ori = LiteSpeed_Cache_Router::frontend_path() . '/' . $url_parsed[ 'path' ] ;
|
483 |
}
|
484 |
|
485 |
+
/**
|
486 |
+
* Added new file postfix to be check if passed in
|
487 |
+
* @since 2.2.4
|
488 |
+
*/
|
489 |
+
if ( $addition_postfix ) {
|
490 |
+
$file_path_ori .= '.' . $addition_postfix ;
|
491 |
+
}
|
492 |
+
|
493 |
/**
|
494 |
* Added this filter for those plugins which overwrite the filepath
|
495 |
* @see #101091 plugin `Hide My WordPress`
|
includes/litespeed-cache.class.php
CHANGED
@@ -19,7 +19,7 @@ class LiteSpeed_Cache
|
|
19 |
private static $_instance ;
|
20 |
|
21 |
const PLUGIN_NAME = 'litespeed-cache' ;
|
22 |
-
const PLUGIN_VERSION = '2.2.
|
23 |
|
24 |
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
|
25 |
|
19 |
private static $_instance ;
|
20 |
|
21 |
const PLUGIN_NAME = 'litespeed-cache' ;
|
22 |
+
const PLUGIN_VERSION = '2.2.4' ;
|
23 |
|
24 |
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
|
25 |
|
includes/litespeed.autoload.php
CHANGED
@@ -63,7 +63,12 @@ if ( !function_exists('_litespeed_autoload') ) {
|
|
63 |
|
64 |
'LiteSpeed_Cache_Tags' => 'includes/deprecated-litespeed-cache-tags.class.php',
|
65 |
|
66 |
-
'Minify_HTML'
|
|
|
|
|
|
|
|
|
|
|
67 |
);
|
68 |
if( array_key_exists($cls, $class2fileArr) && file_exists(LSCWP_DIR . $class2fileArr[$cls]) ) {
|
69 |
require_once LSCWP_DIR . $class2fileArr[$cls];
|
63 |
|
64 |
'LiteSpeed_Cache_Tags' => 'includes/deprecated-litespeed-cache-tags.class.php',
|
65 |
|
66 |
+
'LiteSpeed_3rd_Lib\Minify_HTML' => 'lib/html_min.class.php',
|
67 |
+
'LiteSpeed_3rd_Lib\css_min\Minifier' => 'lib/css_min.class.php',
|
68 |
+
'LiteSpeed_3rd_Lib\css_min\Colors' => 'lib/css_min.colors.class.php',
|
69 |
+
'LiteSpeed_3rd_Lib\css_min\Utils' => 'lib/css_min.utils.class.php',
|
70 |
+
'LiteSpeed_3rd_Lib\css_min\UriRewriter' => 'lib/css_min.url_rewritter.class.php',
|
71 |
+
'LiteSpeed_3rd_Lib\js_min\JSMin' => 'lib/js_min.class.php',
|
72 |
);
|
73 |
if( array_key_exists($cls, $class2fileArr) && file_exists(LSCWP_DIR . $class2fileArr[$cls]) ) {
|
74 |
require_once LSCWP_DIR . $class2fileArr[$cls];
|
languages/litespeed-cache.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the LiteSpeed Cache package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: LiteSpeed Cache 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
|
7 |
-
"POT-Creation-Date: 2018-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -1047,7 +1047,7 @@ msgstr ""
|
|
1047 |
msgid "Rate %s on %s"
|
1048 |
msgstr ""
|
1049 |
|
1050 |
-
#. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 2.2.
|
1051 |
#. Plugin Name of the plugin/theme
|
1052 |
#: admin/tpl/inc/admin_footer.php:6 inc/gui.class.php:348
|
1053 |
#: includes/litespeed-cache-gui.class.php:348
|
@@ -3768,8 +3768,8 @@ msgstr ""
|
|
3768 |
msgid "Communicated with LiteSpeed Image Optimization Server successfully."
|
3769 |
msgstr ""
|
3770 |
|
3771 |
-
#: inc/img_optm.class.php:138 inc/img_optm.class.php:
|
3772 |
-
#: inc/img_optm.class.php:
|
3773 |
msgid "No image found."
|
3774 |
msgstr ""
|
3775 |
|
@@ -3797,29 +3797,29 @@ msgstr ""
|
|
3797 |
msgid "Failed to parse data from LiteSpeed IAPI server: %s"
|
3798 |
msgstr ""
|
3799 |
|
3800 |
-
#: inc/img_optm.class.php:
|
3801 |
msgid "Destroy unfinished data successfully."
|
3802 |
msgstr ""
|
3803 |
|
3804 |
-
#: inc/img_optm.class.php:
|
3805 |
msgid ""
|
3806 |
"Pushed %1$s groups with %2$s images to LiteSpeed optimization server, "
|
3807 |
"accepted %3$s groups with %4$s images."
|
3808 |
msgstr ""
|
3809 |
|
3810 |
-
#: inc/img_optm.class.php:
|
3811 |
msgid "Disabled WebP file successfully."
|
3812 |
msgstr ""
|
3813 |
|
3814 |
-
#: inc/img_optm.class.php:
|
3815 |
msgid "Enabled WebP file successfully."
|
3816 |
msgstr ""
|
3817 |
|
3818 |
-
#: inc/img_optm.class.php:
|
3819 |
msgid "Restored original file successfully."
|
3820 |
msgstr ""
|
3821 |
|
3822 |
-
#: inc/img_optm.class.php:
|
3823 |
msgid "Switched to optimized file successfully."
|
3824 |
msgstr ""
|
3825 |
|
2 |
# This file is distributed under the same license as the LiteSpeed Cache package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: LiteSpeed Cache 2.2.4\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
|
7 |
+
"POT-Creation-Date: 2018-05-07 15:45:38+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
1047 |
msgid "Rate %s on %s"
|
1048 |
msgstr ""
|
1049 |
|
1050 |
+
#. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 2.2.4) #-#-#-#-#
|
1051 |
#. Plugin Name of the plugin/theme
|
1052 |
#: admin/tpl/inc/admin_footer.php:6 inc/gui.class.php:348
|
1053 |
#: includes/litespeed-cache-gui.class.php:348
|
3768 |
msgid "Communicated with LiteSpeed Image Optimization Server successfully."
|
3769 |
msgstr ""
|
3770 |
|
3771 |
+
#: inc/img_optm.class.php:138 inc/img_optm.class.php:1235
|
3772 |
+
#: inc/img_optm.class.php:1300
|
3773 |
msgid "No image found."
|
3774 |
msgstr ""
|
3775 |
|
3797 |
msgid "Failed to parse data from LiteSpeed IAPI server: %s"
|
3798 |
msgstr ""
|
3799 |
|
3800 |
+
#: inc/img_optm.class.php:1125
|
3801 |
msgid "Destroy unfinished data successfully."
|
3802 |
msgstr ""
|
3803 |
|
3804 |
+
#: inc/img_optm.class.php:1338
|
3805 |
msgid ""
|
3806 |
"Pushed %1$s groups with %2$s images to LiteSpeed optimization server, "
|
3807 |
"accepted %3$s groups with %4$s images."
|
3808 |
msgstr ""
|
3809 |
|
3810 |
+
#: inc/img_optm.class.php:1566
|
3811 |
msgid "Disabled WebP file successfully."
|
3812 |
msgstr ""
|
3813 |
|
3814 |
+
#: inc/img_optm.class.php:1572
|
3815 |
msgid "Enabled WebP file successfully."
|
3816 |
msgstr ""
|
3817 |
|
3818 |
+
#: inc/img_optm.class.php:1588
|
3819 |
msgid "Restored original file successfully."
|
3820 |
msgstr ""
|
3821 |
|
3822 |
+
#: inc/img_optm.class.php:1595
|
3823 |
msgid "Switched to optimized file successfully."
|
3824 |
msgstr ""
|
3825 |
|
lib/css_min.class.php
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
* by Yahoo! Inc. under the BSD (revised) open source license.
|
21 |
*/
|
22 |
|
23 |
-
namespace
|
24 |
|
25 |
class Minifier
|
26 |
{
|
20 |
* by Yahoo! Inc. under the BSD (revised) open source license.
|
21 |
*/
|
22 |
|
23 |
+
namespace LiteSpeed_3rd_Lib\css_min ;
|
24 |
|
25 |
class Minifier
|
26 |
{
|
lib/css_min.colors.class.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace
|
4 |
|
5 |
class Colors
|
6 |
{
|
1 |
<?php
|
2 |
|
3 |
+
namespace LiteSpeed_3rd_Lib\css_min ;
|
4 |
|
5 |
class Colors
|
6 |
{
|
lib/{url_rewritter.class.php → css_min.url_rewritter.class.php}
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Class
|
4 |
* @package Minify
|
5 |
*/
|
6 |
|
@@ -10,7 +10,10 @@
|
|
10 |
* @package Minify
|
11 |
* @author Stephen Clay <steve@mrclay.org>
|
12 |
*/
|
13 |
-
|
|
|
|
|
|
|
14 |
{
|
15 |
|
16 |
/**
|
@@ -71,10 +74,10 @@ class Minify_CSS_UriRewriter
|
|
71 |
|
72 |
// rewrite
|
73 |
$pattern = '/@import\\s+([\'"])(.*?)[\'"]/';
|
74 |
-
$css = preg_replace_callback($pattern, array(
|
75 |
|
76 |
$pattern = '/url\\(\\s*([\'"](.*?)[\'"]|[^\\)\\s]+)\\s*\\)/';
|
77 |
-
$css = preg_replace_callback($pattern, array(
|
78 |
|
79 |
$css = self::_unOwlify($css);
|
80 |
|
@@ -100,10 +103,10 @@ class Minify_CSS_UriRewriter
|
|
100 |
|
101 |
// append
|
102 |
$pattern = '/@import\\s+([\'"])(.*?)[\'"]/';
|
103 |
-
$css = preg_replace_callback($pattern, array(
|
104 |
|
105 |
$pattern = '/url\\(\\s*([\'"](.*?)[\'"]|[^\\)\\s]+)\\s*\\)/';
|
106 |
-
$css = preg_replace_callback($pattern, array(
|
107 |
|
108 |
$css = self::_unOwlify($css);
|
109 |
|
@@ -116,7 +119,7 @@ class Minify_CSS_UriRewriter
|
|
116 |
* Get a root relative URI from a file relative URI
|
117 |
*
|
118 |
* <code>
|
119 |
-
*
|
120 |
* '../img/hello.gif'
|
121 |
* , '/home/user/www/css' // path of CSS file
|
122 |
* , '/home/user/www' // doc root
|
@@ -124,7 +127,7 @@ class Minify_CSS_UriRewriter
|
|
124 |
* // returns '/img/hello.gif'
|
125 |
*
|
126 |
* // example where static files are stored in a symlinked directory
|
127 |
-
*
|
128 |
* 'hello.gif'
|
129 |
* , '/var/staticFiles/theme'
|
130 |
* , '/home/user/www'
|
@@ -202,14 +205,6 @@ class Minify_CSS_UriRewriter
|
|
202 |
return $uri;
|
203 |
}
|
204 |
|
205 |
-
/**
|
206 |
-
* Defines which class to call as part of callbacks, change this
|
207 |
-
* if you extend Minify_CSS_UriRewriter
|
208 |
-
*
|
209 |
-
* @var string
|
210 |
-
*/
|
211 |
-
protected static $className = 'Minify_CSS_UriRewriter';
|
212 |
-
|
213 |
/**
|
214 |
* Get realpath with any trailing slash removed. If realpath() fails,
|
215 |
* just remove the trailing slash.
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Class UriRewriter
|
4 |
* @package Minify
|
5 |
*/
|
6 |
|
10 |
* @package Minify
|
11 |
* @author Stephen Clay <steve@mrclay.org>
|
12 |
*/
|
13 |
+
|
14 |
+
namespace LiteSpeed_3rd_Lib\css_min ;
|
15 |
+
|
16 |
+
class UriRewriter
|
17 |
{
|
18 |
|
19 |
/**
|
74 |
|
75 |
// rewrite
|
76 |
$pattern = '/@import\\s+([\'"])(.*?)[\'"]/';
|
77 |
+
$css = preg_replace_callback($pattern, array('LiteSpeed_3rd_Lib\css_min\UriRewriter', '_processUriCB'), $css);
|
78 |
|
79 |
$pattern = '/url\\(\\s*([\'"](.*?)[\'"]|[^\\)\\s]+)\\s*\\)/';
|
80 |
+
$css = preg_replace_callback($pattern, array('LiteSpeed_3rd_Lib\css_min\UriRewriter', '_processUriCB'), $css);
|
81 |
|
82 |
$css = self::_unOwlify($css);
|
83 |
|
103 |
|
104 |
// append
|
105 |
$pattern = '/@import\\s+([\'"])(.*?)[\'"]/';
|
106 |
+
$css = preg_replace_callback($pattern, array('LiteSpeed_3rd_Lib\css_min\UriRewriter', '_processUriCB'), $css);
|
107 |
|
108 |
$pattern = '/url\\(\\s*([\'"](.*?)[\'"]|[^\\)\\s]+)\\s*\\)/';
|
109 |
+
$css = preg_replace_callback($pattern, array('LiteSpeed_3rd_Lib\css_min\UriRewriter', '_processUriCB'), $css);
|
110 |
|
111 |
$css = self::_unOwlify($css);
|
112 |
|
119 |
* Get a root relative URI from a file relative URI
|
120 |
*
|
121 |
* <code>
|
122 |
+
* UriRewriter::rewriteRelative(
|
123 |
* '../img/hello.gif'
|
124 |
* , '/home/user/www/css' // path of CSS file
|
125 |
* , '/home/user/www' // doc root
|
127 |
* // returns '/img/hello.gif'
|
128 |
*
|
129 |
* // example where static files are stored in a symlinked directory
|
130 |
+
* UriRewriter::rewriteRelative(
|
131 |
* 'hello.gif'
|
132 |
* , '/var/staticFiles/theme'
|
133 |
* , '/home/user/www'
|
205 |
return $uri;
|
206 |
}
|
207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
/**
|
209 |
* Get realpath with any trailing slash removed. If realpath() fails,
|
210 |
* just remove the trailing slash.
|
lib/css_min.utils.class.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace
|
4 |
|
5 |
class Utils
|
6 |
{
|
1 |
<?php
|
2 |
|
3 |
+
namespace LiteSpeed_3rd_Lib\css_min ;
|
4 |
|
5 |
class Utils
|
6 |
{
|
lib/html_min.class.php
CHANGED
@@ -16,6 +16,9 @@
|
|
16 |
* @package Minify
|
17 |
* @author Stephen Clay <steve@mrclay.org>
|
18 |
*/
|
|
|
|
|
|
|
19 |
class Minify_HTML
|
20 |
{
|
21 |
/**
|
16 |
* @package Minify
|
17 |
* @author Stephen Clay <steve@mrclay.org>
|
18 |
*/
|
19 |
+
|
20 |
+
namespace LiteSpeed_3rd_Lib ;
|
21 |
+
|
22 |
class Minify_HTML
|
23 |
{
|
24 |
/**
|
lib/js_min.class.php
CHANGED
@@ -54,7 +54,11 @@
|
|
54 |
* @license http://opensource.org/licenses/mit-license.php MIT License
|
55 |
* @link http://code.google.com/p/jsmin-php/
|
56 |
*/
|
57 |
-
|
|
|
|
|
|
|
|
|
58 |
const ORD_LF = 10;
|
59 |
const ORD_SPACE = 32;
|
60 |
const ACTION_KEEP_A = 1;
|
54 |
* @license http://opensource.org/licenses/mit-license.php MIT License
|
55 |
* @link http://code.google.com/p/jsmin-php/
|
56 |
*/
|
57 |
+
|
58 |
+
namespace LiteSpeed_3rd_Lib\js_min ;
|
59 |
+
|
60 |
+
class JSMin
|
61 |
+
{
|
62 |
const ORD_LF = 10;
|
63 |
const ORD_SPACE = 32;
|
64 |
const ACTION_KEEP_A = 1;
|
litespeed-cache.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: LiteSpeed Cache
|
16 |
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
|
17 |
* Description: WordPress plugin to connect to LSCache on LiteSpeed Web Server.
|
18 |
-
* Version: 2.2.
|
19 |
* Author: LiteSpeed Technologies
|
20 |
* Author URI: https://www.litespeedtech.com
|
21 |
* License: GPLv3
|
15 |
* Plugin Name: LiteSpeed Cache
|
16 |
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
|
17 |
* Description: WordPress plugin to connect to LSCache on LiteSpeed Web Server.
|
18 |
+
* Version: 2.2.4
|
19 |
* Author: LiteSpeed Technologies
|
20 |
* Author URI: https://www.litespeedtech.com
|
21 |
* License: GPLv3
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: LiteSpeedTech
|
|
3 |
Tags: cache, wp-cache, litespeed, super cache, http2, total cache, optimize, object cache, redis, memcached, lazy load, database cleaner
|
4 |
Requires at least: 4.0
|
5 |
Tested up to: 4.9.5
|
6 |
-
Stable tag: 2.2.
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl.html
|
9 |
|
@@ -257,6 +257,11 @@ Click on the `Advanced View` link at the top of the page, and several more tabs
|
|
257 |
|
258 |
== Changelog ==
|
259 |
|
|
|
|
|
|
|
|
|
|
|
260 |
= 2.2.3 - Apr 27 2018 =
|
261 |
* [NEW FEATURE] WebP For Extra srcset setting in Media tab. (@vengen)
|
262 |
* [REFACTOR] Removed redundant LS consts.
|
@@ -267,7 +272,7 @@ Click on the `Advanced View` link at the top of the page, and several more tabs
|
|
267 |
* [UPDATE] Detached crawler from LSCache LITESPEED_ON status.
|
268 |
* [API] Improved ESI API to honor the cache control in ESI wrapper.
|
269 |
* [API] Added LITESPEED_PURGE_SILENT const to bypass the notification when purging
|
270 |
-
* [INTEGRATION] Fixed issue with nonce expiration when using ESI API. (@Dan
|
271 |
* [INTEGRATION] Improved compatibility with Ninja Forms by bypassing non-javascript JS from inline JS minify.
|
272 |
* [INTEGRATION] Added a hook for plugins that change the CSS/JS path e.g. Hide My WordPress.
|
273 |
|
3 |
Tags: cache, wp-cache, litespeed, super cache, http2, total cache, optimize, object cache, redis, memcached, lazy load, database cleaner
|
4 |
Requires at least: 4.0
|
5 |
Tested up to: 4.9.5
|
6 |
+
Stable tag: 2.2.4
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl.html
|
9 |
|
257 |
|
258 |
== Changelog ==
|
259 |
|
260 |
+
= 2.2.4 - May 7 2018 =
|
261 |
+
* [IMPROVEMENT] Improved compatibility with themes using the same js_min library. (#129093 @Darren)
|
262 |
+
* [BUGFIX] Fixed a bug when checking image path for dynamic files. (@miladk)
|
263 |
+
* [INTEGRATION] Compatibility with Universal Star Rating. (@miladk)
|
264 |
+
|
265 |
= 2.2.3 - Apr 27 2018 =
|
266 |
* [NEW FEATURE] WebP For Extra srcset setting in Media tab. (@vengen)
|
267 |
* [REFACTOR] Removed redundant LS consts.
|
272 |
* [UPDATE] Detached crawler from LSCache LITESPEED_ON status.
|
273 |
* [API] Improved ESI API to honor the cache control in ESI wrapper.
|
274 |
* [API] Added LITESPEED_PURGE_SILENT const to bypass the notification when purging
|
275 |
+
* [INTEGRATION] Fixed issue with nonce expiration when using ESI API. (#923505 @Dan)
|
276 |
* [INTEGRATION] Improved compatibility with Ninja Forms by bypassing non-javascript JS from inline JS minify.
|
277 |
* [INTEGRATION] Added a hook for plugins that change the CSS/JS path e.g. Hide My WordPress.
|
278 |
|