PluginProbe
WebberZone Top 10 — Popular Posts / 4.5.1
WebberZone Top 10 — Popular Posts v4.5.1
4.5.1 4.5.0 4.4.3 4.4.2 4.4.1 4.4.0 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 1.6.1 All 117 releases
← All changes | includes/admin/class-cron.php +10 -0 4.4.34.5.1 View file →
@@ -51,8 +51,11 @@
51 51 */
52 52 public function __construct() {
53 53 Hook_Registry::add_action( 'tptn_cron_hook', array( $this, 'run_cron' ) );
54 54 Hook_Registry::add_action( 'tptn_aggregation_cron_hook', array( $this, 'run_aggregation' ) );
55 + Hook_Registry::add_action( 'tptn_count_updated', array( Dashboard_Widgets::class, 'clear_network_dashboard_cache' ) );
56 + Hook_Registry::add_action( 'tptn_delete_counts', array( Dashboard_Widgets::class, 'clear_network_dashboard_cache' ) );
57 + Hook_Registry::add_action( 'tptn_set_count', array( Dashboard_Widgets::class, 'clear_network_dashboard_cache' ) );
55 58 Hook_Registry::add_action( 'admin_init', array( $this, 'check_aggregation_cron' ) );
56 59 Hook_Registry::add_action( 'admin_notices', array( $this, 'aggregation_cron_missing_notice' ) );
57 60 Hook_Registry::add_action( 'cron_reschedule_event_error', array( $this, 'log_reschedule_error' ), 10, 2 );
58 61 Hook_Registry::add_action( 'cron_unschedule_event_error', array( $this, 'log_unschedule_error' ), 10, 2 );
@@ -65,8 +68,13 @@
65 68 */
66 69 public function run_cron() {
67 70 global $wpdb;
68 71
72 + $table_statuses = Database::get_table_installation_status( true );
73 + if ( in_array( false, $table_statuses, true ) ) {
74 + return;
75 + }
76 +
69 77 $delete_from = TOP_TEN_STORE_DATA;
70 78
71 79 /**
72 80 * Override maintenance day range.
@@ -112,8 +120,10 @@
112 120 do {
113 121 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
114 122 $deleted_log = $wpdb->query( $wpdb->prepare( "DELETE FROM {$log_table} WHERE visited_at < %s LIMIT 1000", $from_date_log ) );
115 123 } while ( $deleted_log > 0 && microtime( true ) < $deadline_log );
124 +
125 + Dashboard_Widgets::clear_network_dashboard_cache();
116 126 }
117 127
118 128 /**
119 129 * Function to enable run or actions.