SG Optimizer - Version 5.3.2

Version Description

Download this release

Release Info

Developer sstoqnov
Plugin Icon 128x128 SG Optimizer
Version 5.3.2
Comparing to
See all releases

Code changes from version 5.3.1 to 5.3.2

core/Front_End_Optimization/Front_End_Optimization.php CHANGED
@@ -354,6 +354,8 @@ class Front_End_Optimization {
354
  global $wp_styles;
355
  global $wp_scripts;
356
 
 
 
357
  ob_start();
358
  // Call the action to load the assets.
359
  do_action( 'wp' );
@@ -361,6 +363,8 @@ class Front_End_Optimization {
361
  do_action( 'elementor/editor/after_enqueue_styles' );
362
  ob_get_clean();
363
 
 
 
364
  // Build the assets data.
365
  return array(
366
  'scripts' => $this->get_assets_data( $wp_scripts ),
354
  global $wp_styles;
355
  global $wp_scripts;
356
 
357
+ $wp_scripts->queue[] = 'wc-jilt';
358
+
359
  ob_start();
360
  // Call the action to load the assets.
361
  do_action( 'wp' );
363
  do_action( 'elementor/editor/after_enqueue_styles' );
364
  ob_get_clean();
365
 
366
+ unset( $wp_scripts->queue['wc-jilt'] );
367
+
368
  // Build the assets data.
369
  return array(
370
  'scripts' => $this->get_assets_data( $wp_scripts ),
core/Images_Optimizer/Images_Optimizer.php CHANGED
@@ -297,13 +297,6 @@ class Images_Optimizer {
297
  $status
298
  );
299
 
300
- // exec(
301
- // sprintf(
302
- // 'cwebp -q 50 -lossless %1$s -o %1$s.webp 2>&1',
303
- // $filepath
304
- // )
305
- // );
306
-
307
  return $status;
308
  }
309
 
297
  $status
298
  );
299
 
 
 
 
 
 
 
 
300
  return $status;
301
  }
302
 
core/Install_Service/Install_5_3_2.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace SiteGround_Optimizer\Install_Service;
3
+
4
+ use SiteGround_Optimizer\Ssl\Ssl;
5
+ use SiteGround_Optimizer\Options\Options;
6
+ use SiteGround_Optimizer\Supercacher\Supercacher;
7
+
8
+ class Install_5_3_2 extends Install {
9
+
10
+ /**
11
+ * The default install version. Overridden by the installation packages.
12
+ *
13
+ * @since 5.3.2
14
+ *
15
+ * @access protected
16
+ *
17
+ * @var string $version The install version.
18
+ */
19
+ protected static $version = '5.3.2';
20
+
21
+ public function __construct() {
22
+ $this->ssl_service = new Ssl();
23
+ }
24
+ /**
25
+ * Run the install procedure.
26
+ *
27
+ * @since 5.3.2
28
+ */
29
+ public function install() {
30
+ if ( Options::is_enabled( 'siteground_optimizer_ssl_enabled' ) ) {
31
+ $this->ssl_service->enable();
32
+
33
+ Supercacher::purge_cache();
34
+ Supercacher::flush_memcache();
35
+ }
36
+
37
+ }
38
+
39
+ }
core/Install_Service/Install_Service.php CHANGED
@@ -14,6 +14,7 @@ use SiteGround_Optimizer\Install_Service\Install_5_2_0;
14
  use SiteGround_Optimizer\Install_Service\Install_5_2_5;
15
  use SiteGround_Optimizer\Install_Service\Install_5_3_0;
16
  use SiteGround_Optimizer\Install_Service\Install_5_3_1;
 
17
  use SiteGround_Optimizer\Supercacher\Supercacher;
18
 
19
  /**
@@ -65,6 +66,7 @@ class Install_Service {
65
  new Install_5_2_5(),
66
  new Install_5_3_0(),
67
  new Install_5_3_1(),
 
68
  );
69
 
70
  $version = null;
14
  use SiteGround_Optimizer\Install_Service\Install_5_2_5;
15
  use SiteGround_Optimizer\Install_Service\Install_5_3_0;
16
  use SiteGround_Optimizer\Install_Service\Install_5_3_1;
17
+ use SiteGround_Optimizer\Install_Service\Install_5_3_2;
18
  use SiteGround_Optimizer\Supercacher\Supercacher;
19
 
20
  /**
66
  new Install_5_2_5(),
67
  new Install_5_3_0(),
68
  new Install_5_3_1(),
69
+ new Install_5_3_2(),
70
  );
71
 
72
  $version = null;
core/Ssl/Ssl.php CHANGED
@@ -138,7 +138,7 @@ class Ssl {
138
  $parsed = parse_url( get_option( 'siteurl' ) );
139
 
140
  if ( strpos( $parsed['host'], 'www.' ) === 0 ) {
141
- $replacements['replace'] = 'www.';
142
  }
143
 
144
  $enable_from_htaccess = $this->htaccess_service->enable( 'ssl', $replacements );
138
  $parsed = parse_url( get_option( 'siteurl' ) );
139
 
140
  if ( strpos( $parsed['host'], 'www.' ) === 0 ) {
141
+ $replacements['replace'] = "RewriteCond %{HTTP_HOST} !^www\. [NC]\n RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]";
142
  }
143
 
144
  $enable_from_htaccess = $this->htaccess_service->enable( 'ssl', $replacements );
readme.txt CHANGED
@@ -169,6 +169,10 @@ Our plugin uses a cookie in order to function properly. It does not store person
169
 
170
  == Changelog ==
171
 
 
 
 
 
172
  = Version 5.3.1 =
173
  * Better SSL force to accommodate websites with WWW in the URL
174
  * Global exclusion of siteorigin-widget-icon-font-fontawesome from Combine CSS
169
 
170
  == Changelog ==
171
 
172
+ = Version 5.3.2 =
173
+ * Fixed bug with https enforce for www websites
174
+ * Improved JILT support
175
+
176
  = Version 5.3.1 =
177
  * Better SSL force to accommodate websites with WWW in the URL
178
  * Global exclusion of siteorigin-widget-icon-font-fontawesome from Combine CSS
sg-cachepress.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: SG Optimizer
11
  * Plugin URI: https://siteground.com
12
  * Description: This plugin will link your WordPress application with all the performance optimizations provided by SiteGround
13
- * Version: 5.3.1
14
  * Author: SiteGround
15
  * Author URI: https://www.siteground.com
16
  * Text Domain: sg-cachepress
@@ -31,7 +31,7 @@ if ( ! defined( 'WPINC' ) ) {
31
 
32
  // Define version constant.
33
  if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
34
- define( __NAMESPACE__ . '\VERSION', '5.3.1' );
35
  }
36
 
37
  // Define slug constant.
10
  * Plugin Name: SG Optimizer
11
  * Plugin URI: https://siteground.com
12
  * Description: This plugin will link your WordPress application with all the performance optimizations provided by SiteGround
13
+ * Version: 5.3.2
14
  * Author: SiteGround
15
  * Author URI: https://www.siteground.com
16
  * Text Domain: sg-cachepress
31
 
32
  // Define version constant.
33
  if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
34
+ define( __NAMESPACE__ . '\VERSION', '5.3.2' );
35
  }
36
 
37
  // Define slug constant.
templates/ssl.tpl CHANGED
@@ -1,7 +1,8 @@
1
  # HTTPS forced by SG-Optimizer
2
  <IfModule mod_rewrite.c>
3
- RewriteEngine On
4
- RewriteCond %{HTTPS} off
5
- RewriteRule ^(.*)$ https://{MAYBE_WWW}%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
 
6
  </IfModule>
7
  # END HTTPS
1
  # HTTPS forced by SG-Optimizer
2
  <IfModule mod_rewrite.c>
3
+ {MAYBE_WWW}
4
+ RewriteCond %{HTTP:X-Forwarded-Proto} !https
5
+ RewriteCond %{HTTPS} off
6
+ RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
7
  </IfModule>
8
  # END HTTPS