SG Optimizer - Version 5.7.18

Version Description

Download this release

Release Info

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

Code changes from version 5.7.17 to 5.7.18

core/Supercacher/Supercacher.php CHANGED
@@ -164,6 +164,17 @@ class Supercacher {
164
  return $this->purge_cache_request( get_home_url( null, '/' ), false );
165
  }
166
 
 
 
 
 
 
 
 
 
 
 
 
167
  /**
168
  * Perform a delete request.
169
  *
164
  return $this->purge_cache_request( get_home_url( null, '/' ), false );
165
  }
166
 
167
+ /**
168
+ * Purge rest api cache.
169
+ *
170
+ * @since 5.7.18
171
+ *
172
+ * @return bool True on success, false on failure.
173
+ */
174
+ public function purge_rest_cache() {
175
+ return $this->purge_cache_request( get_rest_url() );
176
+ }
177
+
178
  /**
179
  * Perform a delete request.
180
  *
core/Supercacher/Supercacher_Comments.php CHANGED
@@ -35,6 +35,9 @@ class Supercacher_Comments extends Supercacher_Posts {
35
 
36
  // Purge the post cache.
37
  $this->purge_post_cache( $comment_post_id );
 
 
 
38
  }
39
 
40
  }
35
 
36
  // Purge the post cache.
37
  $this->purge_post_cache( $comment_post_id );
38
+
39
+ // Purge the rest api cache.
40
+ $this->purge_rest_cache();
41
  }
42
 
43
  }
core/Supercacher/Supercacher_Posts.php CHANGED
@@ -27,6 +27,9 @@ class Supercacher_Posts extends Supercacher {
27
  * @return bool True on success, false on failure.
28
  */
29
  public function purge_post_cache( $post_id ) {
 
 
 
30
  // Purge the post cache.
31
  return $this->purge_cache_request( get_permalink( $post_id ) );
32
  }
27
  * @return bool True on success, false on failure.
28
  */
29
  public function purge_post_cache( $post_id ) {
30
+ // Purge the rest api cache.
31
+ $this->purge_rest_cache();
32
+
33
  // Purge the post cache.
34
  return $this->purge_cache_request( get_permalink( $post_id ) );
35
  }
core/Supercacher/Supercacher_Terms.php CHANGED
@@ -67,6 +67,9 @@ class Supercacher_Terms extends Supercacher {
67
  * @param int $term_id The term id.
68
  */
69
  public function purge_term_and_index_cache( $term_id ) {
 
 
 
70
  // Purge the term cache.
71
  $this->purge_term_cache( $term_id );
72
 
67
  * @param int $term_id The term id.
68
  */
69
  public function purge_term_and_index_cache( $term_id ) {
70
+ // Purge the rest api cache.
71
+ $this->purge_rest_cache();
72
+
73
  // Purge the term cache.
74
  $this->purge_term_cache( $term_id );
75
 
readme.txt CHANGED
@@ -217,6 +217,9 @@ Our plugin uses a cookie in order to function properly. It does not store person
217
 
218
  == Changelog ==
219
 
 
 
 
220
  = Version 5.7.17 =
221
  * Improved WordPress 5.7 support
222
 
217
 
218
  == Changelog ==
219
 
220
+ = Version 5.7.18 =
221
+ * Improved REST API cache invalidation
222
+
223
  = Version 5.7.17 =
224
  * Improved WordPress 5.7 support
225
 
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.7.17
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.7.17' );
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.7.18
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.7.18' );
35
  }
36
 
37
  // Define slug constant.