PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.3
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.3
28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 19.1 All 128 releases
wordpress-seo / admin / statistics / class-statistics-integration.php

class-statistics-integration.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.3, at admin/statistics/class-statistics-integration.php

37 lines 743 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WPSEO plugin file.
4 *
5 * @package WPSEO\Admin\Statistics
6 */
7
8 /**
9 * Class WPSEO_Statistic_Integration.
10 */
11 class WPSEO_Statistic_Integration implements WPSEO_WordPress_Integration {
12
13 /**
14 * Adds hooks to clear the cache.
15 *
16 * @return void
17 */
18 public function register_hooks() {
19 add_action( 'wp_insert_post', [ $this, 'clear_cache' ] );
20 add_action( 'delete_post', [ $this, 'clear_cache' ] );
21 }
22
23 /**
24 * Clears the dashboard widget items cache.
25 *
26 * @return void
27 */
28 public function clear_cache() {
29 // Bail if this is a multisite installation and the site has been switched.
30 if ( is_multisite() && ms_is_switched() ) {
31 return;
32 }
33
34 delete_transient( WPSEO_Statistics_Service::CACHE_TRANSIENT_KEY );
35 }
36 }
37