PluginProbe ʕ •ᴥ•ʔ
Aruba HiSpeed Cache / 3.0.15
Aruba HiSpeed Cache v3.0.15
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 5 months ago AHSC_Deferer.php 5 months ago AHSC_Plugins.php 5 months ago AHSC_PostType.php 3 days ago AHSC_Terms.php 3 days ago AHSC_Themes.php 5 months ago
AHSC_Deferer.php
44 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5 if ( ( function_exists( 'wp_doing_ajax' ) && wp_doing_ajax() || defined('DOING_AJAX') && DOING_AJAX) ||
6 (defined('REST_REQUEST') && REST_REQUEST) || true === wp_is_json_request() ||
7 (isset( $_SERVER['REQUEST_URI'] ) && strpos( sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ), trailingslashit( rest_get_url_prefix() ) ) !== false) ) {
8
9 add_action( 'init', 'ahsc_deferred_purge' , 200, 0 );
10 }
11
12 /**
13 * Fires after a post type has been updated, and the term cache has been cleaned.
14 *
15 * @see https://developer.wordpress.org/reference/hooks/post_updated/
16 * or
17 * @see https://github.com/WordPress/WordPress/blob/master/wp-includes/post.php
18 *
19 * param int $post_ID Post ID.
20 * param WP_Post $post_after Post object following the update.
21 * param WP_Post $post_before Post object before the update.
22 *
23 * @return void
24 */
25 function ahsc_deferred_purge() {
26 $cleaner =new \ArubaSPA\HiSpeedCache\Purger\WpPurger();
27 $cleaner->setPurger( AHSC_PURGER );
28 /**
29 * I check whether the cleaning transient is present in case. I remove it and clear the entire proxy cache.
30 */
31 $do_purge = ahsc_has_transient( 'ahsc_do_purge_deferred' );
32 if ( $do_purge ) {
33 /**
34 * I clear the entire proxy cache.
35 */
36 if(class_exists('ArubaSPA\HiSpeedCache\Debug\Logger')){
37 // Logger.
38 AHSC_log( __NAMESPACE__ . '::' . __FUNCTION__, 'debug' );
39 // Logger.
40 }
41 $cleaner->purgeAll();
42 ahsc_delete_transient( 'ahsc_do_purge_deferred' );
43 }
44 }