PluginProbe ʕ •ᴥ•ʔ
Aruba HiSpeed Cache / 2.0.13
Aruba HiSpeed Cache v2.0.13
3.0.15 3.0.14 3.0.13 1.2.4 1.2.5 1.2.6 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.17 2.0.18 2.0.19 2.0.20 2.0.21 2.0.22 2.0.23 2.0.24 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3
aruba-hispeed-cache / src / Events / AHSC_Deferer.php
aruba-hispeed-cache / src / Events Last commit date
AHSC_Comments.php 2 years ago AHSC_Deferer.php 2 years ago AHSC_Plugins.php 2 years ago AHSC_PostType.php 2 years ago AHSC_Terms.php 2 years ago AHSC_Themes.php 2 years ago
AHSC_Deferer.php
42 lines
1 <?php
2
3 if ( ( function_exists( 'wp_doing_ajax' ) && wp_doing_ajax() || defined('DOING_AJAX') && DOING_AJAX) ||
4 (defined('REST_REQUEST') && REST_REQUEST) || true === wp_is_json_request() ||
5 (isset( $_SERVER['REQUEST_URI'] ) && strpos( sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ), trailingslashit( rest_get_url_prefix() ) ) !== false) ) {
6
7 add_action( 'init', 'ahsc_deferred_purge' , 200, 0 );
8 }
9
10 /**
11 * Fires after a post type has been updated, and the term cache has been cleaned.
12 *
13 * @see https://developer.wordpress.org/reference/hooks/post_updated/
14 * or
15 * @see https://github.com/WordPress/WordPress/blob/master/wp-includes/post.php
16 *
17 * param int $post_ID Post ID.
18 * param WP_Post $post_after Post object following the update.
19 * param WP_Post $post_before Post object before the update.
20 *
21 * @return void
22 */
23 function ahsc_deferred_purge() {
24 $cleaner =new \ArubaSPA\HiSpeedCache\Purger\WpPurger();
25 $cleaner->setPurger( AHSC_PURGER );
26 /**
27 * I check whether the cleaning transient is present in case. I remove it and clear the entire proxy cache.
28 */
29 $do_purge = ahsc_has_transient( 'ahsc_do_purge_deferred' );
30 if ( $do_purge ) {
31 /**
32 * I clear the entire proxy cache.
33 */
34 if(class_exists('ArubaSPA\HiSpeedCache\Debug\Logger')){
35 // Logger.
36 AHSC_log( __NAMESPACE__ . '::' . __FUNCTION__, 'debug' );
37 // Logger.
38 }
39 $cleaner->purgeAll();
40 ahsc_delete_transient( 'ahsc_do_purge_deferred' );
41 }
42 }