LiteSpeed Cache - Version 3.5.0.1

Version Description

  • Sep 29 2020 =
  • CSS Fixed print media query issue when having CSS Combine. (@paddy-duncan)
Download this release

Release Info

Developer LiteSpeedTech
Plugin Icon 128x128 LiteSpeed Cache
Version 3.5.0.1
Comparing to
See all releases

Code changes from version 3.5 to 3.5.0.1

Files changed (3) hide show
  1. litespeed-cache.php +2 -2
  2. readme.txt +4 -1
  3. src/optimize.cls.php +9 -4
litespeed-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: LiteSpeed Cache
4
  * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
5
  * Description: High-performance page caching and site optimization from LiteSpeed
6
- * Version: 3.5
7
  * Author: LiteSpeed Technologies
8
  * Author URI: https://www.litespeedtech.com
9
  * License: GPLv3
@@ -33,7 +33,7 @@ if ( class_exists( 'LiteSpeed\Core' ) || defined( 'LSCWP_DIR' ) ) {
33
  return;
34
  }
35
 
36
- ! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '3.5' );
37
 
38
  ! defined( 'LSCWP_CONTENT_DIR' ) && define( 'LSCWP_CONTENT_DIR', WP_CONTENT_DIR ) ;
39
  ! defined( 'LSCWP_DIR' ) && define( 'LSCWP_DIR', __DIR__ . '/' ) ;// Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
3
  * Plugin Name: LiteSpeed Cache
4
  * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
5
  * Description: High-performance page caching and site optimization from LiteSpeed
6
+ * Version: 3.5.0.1
7
  * Author: LiteSpeed Technologies
8
  * Author URI: https://www.litespeedtech.com
9
  * License: GPLv3
33
  return;
34
  }
35
 
36
+ ! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '3.5.0.1' );
37
 
38
  ! defined( 'LSCWP_CONTENT_DIR' ) && define( 'LSCWP_CONTENT_DIR', WP_CONTENT_DIR ) ;
39
  ! defined( 'LSCWP_DIR' ) && define( 'LSCWP_DIR', __DIR__ . '/' ) ;// Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: LiteSpeedTech
3
  Tags: caching, optimize, performance, pagespeed, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 5.5.1
6
- Stable tag: 3.5
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -245,6 +245,9 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
245
 
246
  == Changelog ==
247
 
 
 
 
248
  = 3.5 - Sep 29 2020 =
249
  * **Page Optimize** Refactored CSS/JS optimization.
250
  * **Page Optimize** CSS and JS Combine now each save to a single file without memory usage issues.
3
  Tags: caching, optimize, performance, pagespeed, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 5.5.1
6
+ Stable tag: 3.5.0.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
245
 
246
  == Changelog ==
247
 
248
+ = 3.5.0.1 - Sep 29 2020 =
249
+ * 🔥🐞**CSS** Fixed print media query issue when having CSS Combine. (@paddy-duncan)
250
+
251
  = 3.5 - Sep 29 2020 =
252
  * **Page Optimize** Refactored CSS/JS optimization.
253
  * **Page Optimize** CSS and JS Combine now each save to a single file without memory usage issues.
src/optimize.cls.php CHANGED
@@ -875,7 +875,8 @@ class Optimize extends Base {
875
  // $items = $dom->find( 'link' );
876
 
877
  $content = preg_replace( array( '#<!--.*-->#sU', '#<script([^>]*)>.*</script>#isU' ), '', $this->content );
878
- preg_match_all( '#<link ([^>]+)/?>|<style[^>]*>([^<]+)</style>#isU', $content, $matches, PREG_SET_ORDER );
 
879
  foreach ( $matches as $match ) {
880
  // to avoid multiple replacement
881
  if ( in_array( $match[ 0 ], $html_list ) ) {
@@ -890,7 +891,6 @@ class Optimize extends Base {
890
  $this_src_arr = array();
891
  if ( strpos( $match[ 0 ], '<link' ) === 0 ) {
892
  $attrs = Utility::parse_attr( $match[ 1 ] );
893
-
894
  if ( empty( $attrs[ 'rel' ] ) || $attrs[ 'rel' ] !== 'stylesheet' ) {
895
  continue;
896
  }
@@ -942,8 +942,13 @@ class Optimize extends Base {
942
  $this_src_arr[ 'src' ] = $attrs[ 'href' ];
943
  }
944
  else { // Inline style
945
- $this_src_arr[ 'inl' ] = true;
946
- $this_src_arr[ 'src' ] = $match[ 2 ];
 
 
 
 
 
947
  }
948
 
949
  $src_list[] = $this_src_arr;
875
  // $items = $dom->find( 'link' );
876
 
877
  $content = preg_replace( array( '#<!--.*-->#sU', '#<script([^>]*)>.*</script>#isU' ), '', $this->content );
878
+ preg_match_all( '#<link ([^>]+)/?>|<style([^>]*)>([^<]+)</style>#isU', $content, $matches, PREG_SET_ORDER );
879
+
880
  foreach ( $matches as $match ) {
881
  // to avoid multiple replacement
882
  if ( in_array( $match[ 0 ], $html_list ) ) {
891
  $this_src_arr = array();
892
  if ( strpos( $match[ 0 ], '<link' ) === 0 ) {
893
  $attrs = Utility::parse_attr( $match[ 1 ] );
 
894
  if ( empty( $attrs[ 'rel' ] ) || $attrs[ 'rel' ] !== 'stylesheet' ) {
895
  continue;
896
  }
942
  $this_src_arr[ 'src' ] = $attrs[ 'href' ];
943
  }
944
  else { // Inline style
945
+ $attrs = Utility::parse_attr( $match[ 2 ] );
946
+
947
+ if ( ! empty( $attrs[ 'media' ] ) && $attrs[ 'media' ] !== 'all' ) {
948
+ $this_src_arr[ 'media' ] = $attrs[ 'media' ];
949
+ }
950
+ $this_src_arr[ 'inl' ] = true;
951
+ $this_src_arr[ 'src' ] = $match[ 3 ];
952
  }
953
 
954
  $src_list[] = $this_src_arr;