SG Optimizer - Version 5.4.4

Version Description

Download this release

Release Info

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

Code changes from version 5.4.3 to 5.4.4

core/Activator/Activator.php CHANGED
@@ -4,6 +4,7 @@ namespace SiteGround_Optimizer\Activator;
4
  use SiteGround_Optimizer\Helper\Helper;
5
  use SiteGround_Optimizer\Memcache\Memcache;
6
  use SiteGround_Optimizer\Options\Options;
 
7
 
8
  class Activator {
9
  /**
@@ -20,6 +21,9 @@ class Activator {
20
  }
21
 
22
  $this->maybe_create_memcache_dropin();
 
 
 
23
  }
24
 
25
  /**
4
  use SiteGround_Optimizer\Helper\Helper;
5
  use SiteGround_Optimizer\Memcache\Memcache;
6
  use SiteGround_Optimizer\Options\Options;
7
+ use SiteGround_Optimizer\Install_Service\Install_Service;
8
 
9
  class Activator {
10
  /**
21
  }
22
 
23
  $this->maybe_create_memcache_dropin();
24
+
25
+ $install_service = new Install_Service();
26
+ $install_service->install();
27
  }
28
 
29
  /**
core/Front_End_Optimization/Front_End_Optimization.php CHANGED
@@ -351,6 +351,8 @@ class Front_End_Optimization {
351
  // Get the global varialbes.
352
  global $wp_styles;
353
  global $wp_scripts;
 
 
354
 
355
  $wp_scripts->queue[] = 'wc-jilt';
356
 
351
  // Get the global varialbes.
352
  global $wp_styles;
353
  global $wp_scripts;
354
+ // Remove the jet popup action to prevent fatal errros.
355
+ remove_all_actions( 'elementor/editor/after_enqueue_styles', 10 );
356
 
357
  $wp_scripts->queue[] = 'wc-jilt';
358
 
core/Helper/Helper.php CHANGED
@@ -24,7 +24,6 @@ class Helper {
24
  public function __construct() {
25
  // Load the plugin textdomain.
26
  add_action( 'after_setup_theme', array( $this, 'load_textdomain' ), 9999 );
27
- add_action( 'init', array( new Install_Service(), 'install' ) );
28
  add_action( 'plugins_loaded', array( $this, 'is_plugin_installed' ) );
29
  add_action( 'init', array( $this, 'hide_warnings_in_rest_api' ) );
30
  add_filter( 'xmlrpc_login_error', array( $this, 'filter_xmlrpc_login_error' ), 10, 2 );
@@ -41,6 +40,7 @@ class Helper {
41
  * @since 5.0.0
42
  */
43
  public function run() {
 
44
  // Initialize dashboard page.
45
  new Admin();
46
 
24
  public function __construct() {
25
  // Load the plugin textdomain.
26
  add_action( 'after_setup_theme', array( $this, 'load_textdomain' ), 9999 );
 
27
  add_action( 'plugins_loaded', array( $this, 'is_plugin_installed' ) );
28
  add_action( 'init', array( $this, 'hide_warnings_in_rest_api' ) );
29
  add_filter( 'xmlrpc_login_error', array( $this, 'filter_xmlrpc_login_error' ), 10, 2 );
40
  * @since 5.0.0
41
  */
42
  public function run() {
43
+ new Install_Service();
44
  // Initialize dashboard page.
45
  new Admin();
46
 
core/Images_Optimizer/Images_Optimizer.php CHANGED
@@ -63,7 +63,6 @@ class Images_Optimizer {
63
  // Fork the process in background.
64
  $args = array(
65
  'timeout' => 0.01,
66
- 'blocking' => false,
67
  'cookies' => $_COOKIE,
68
  'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
69
  );
63
  // Fork the process in background.
64
  $args = array(
65
  'timeout' => 0.01,
 
66
  'cookies' => $_COOKIE,
67
  'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
68
  );
core/Install_Service/Install_Service.php CHANGED
@@ -29,6 +29,33 @@ use SiteGround_Optimizer\Supercacher\Supercacher;
29
  */
30
  class Install_Service {
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  /**
33
  * Loop thought all versions and install the updates.
34
  *
@@ -38,8 +65,7 @@ class Install_Service {
38
  */
39
  public function install() {
40
  // Use a transient to avoid concurrent installation calls.
41
- if ( false === get_transient( '_siteground_optimizer_installing' ) ) {
42
-
43
  set_transient( '_siteground_optimizer_installing', true, 5 * MINUTE_IN_SECONDS );
44
 
45
  // Do the install.
@@ -57,31 +83,9 @@ class Install_Service {
57
  */
58
  private function do_install() {
59
 
60
- // Get the install services.
61
- $installs = array(
62
- new Install_5_0_0(),
63
- new Install_5_0_5(),
64
- new Install_5_0_6(),
65
- new Install_5_0_8(),
66
- new Install_5_0_9(),
67
- new Install_5_0_10(),
68
- new Install_5_0_12(),
69
- new Install_5_0_13(),
70
- new Install_5_2_0(),
71
- new Install_5_2_5(),
72
- new Install_5_3_0(),
73
- new Install_5_3_1(),
74
- new Install_5_3_2(),
75
- new Install_5_3_4(),
76
- new Install_5_3_6(),
77
- new Install_5_3_10(),
78
- new Install_5_4_0(),
79
- new Install_5_4_3(),
80
- );
81
-
82
  $version = null;
83
 
84
- foreach ( $installs as $install ) {
85
  // Get the install version.
86
  $version = $install->get_version();
87
 
@@ -109,4 +113,17 @@ class Install_Service {
109
  private function get_current_version() {
110
  return get_option( 'siteground_optimizer_version', '0.0.0' );
111
  }
112
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  */
30
  class Install_Service {
31
 
32
+ public function __construct() {
33
+ // Get the install services.
34
+ $this->installs = array(
35
+ new Install_5_0_0(),
36
+ new Install_5_0_5(),
37
+ new Install_5_0_6(),
38
+ new Install_5_0_8(),
39
+ new Install_5_0_9(),
40
+ new Install_5_0_10(),
41
+ new Install_5_0_12(),
42
+ new Install_5_0_13(),
43
+ new Install_5_2_0(),
44
+ new Install_5_2_5(),
45
+ new Install_5_3_0(),
46
+ new Install_5_3_1(),
47
+ new Install_5_3_2(),
48
+ new Install_5_3_4(),
49
+ new Install_5_3_6(),
50
+ new Install_5_3_10(),
51
+ new Install_5_4_0(),
52
+ new Install_5_4_3(),
53
+ );
54
+
55
+ add_action( 'upgrader_process_complete', array( $this, 'install' ) );
56
+
57
+ }
58
+
59
  /**
60
  * Loop thought all versions and install the updates.
61
  *
65
  */
66
  public function install() {
67
  // Use a transient to avoid concurrent installation calls.
68
+ if ( $this->install_required() && false === get_transient( '_siteground_optimizer_installing' ) ) {
 
69
  set_transient( '_siteground_optimizer_installing', true, 5 * MINUTE_IN_SECONDS );
70
 
71
  // Do the install.
83
  */
84
  private function do_install() {
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  $version = null;
87
 
88
+ foreach ( $this->installs as $install ) {
89
  // Get the install version.
90
  $version = $install->get_version();
91
 
113
  private function get_current_version() {
114
  return get_option( 'siteground_optimizer_version', '0.0.0' );
115
  }
116
+
117
+ private function install_required() {
118
+ foreach ( $this->installs as $install ) {
119
+ // Get the install version.
120
+ $version = $install->get_version();
121
+
122
+ if ( version_compare( $version, $this->get_current_version(), '>' ) ) {
123
+ return true;
124
+ }
125
+ }
126
+
127
+ return false;
128
+ }
129
+ }
core/Rest/Rest.php CHANGED
@@ -176,6 +176,7 @@ class Rest {
176
  'permission_callback' => array( $this, 'check_permissions' ),
177
  )
178
  );
 
179
  }
180
 
181
  /**
176
  'permission_callback' => array( $this, 'check_permissions' ),
177
  )
178
  );
179
+
180
  }
181
 
182
  /**
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Hristo Sg, siteground, sstoqnov
3
  Tags: nginx, caching, speed, memcache, memcached, performance, siteground, nginx, supercacher
4
  Requires at least: 4.7
5
  Requires PHP: 5.5
6
- Tested up to: 5.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -171,6 +171,10 @@ Our plugin uses a cookie in order to function properly. It does not store person
171
 
172
  == Changelog ==
173
 
 
 
 
 
174
  = Version 5.4.3 =
175
  * Added Lazy loading functionality for iframes
176
  * Added Lazy loading functionality for videos
3
  Tags: nginx, caching, speed, memcache, memcached, performance, siteground, nginx, supercacher
4
  Requires at least: 4.7
5
  Requires PHP: 5.5
6
+ Tested up to: 5.4.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
171
 
172
  == Changelog ==
173
 
174
+ = Version 5.4.4 =
175
+ * Improved transients handling
176
+ * Added Jet Popup support
177
+
178
  = Version 5.4.3 =
179
  * Added Lazy loading functionality for iframes
180
  * Added Lazy loading functionality for videos
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.4.3
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.4.3' );
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.4.4
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.4.4' );
35
  }
36
 
37
  // Define slug constant.