PluginProbe
Statify / 1.6.3
Statify v1.6.3
2.0.2 2.0.1 trunk 0.7 0.8 0.9 1.0 1.2.8 1.3.0 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 All 32 releases
statify / inc / class-statify-cron.php

class-statify-cron.php in Statify 1.6.3, at inc/class-statify-cron.php

46 lines 731 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Statify: Statify_Cron class
4 *
5 * This file contains the derived class for the plugin's cron features.
6 *
7 * @package Statify
8 * @since 1.4.0
9 */
10
11 // Quit if accessed outside WP context.
12 defined( 'ABSPATH' ) || exit;
13
14 /**
15 * Statify_Cron
16 *
17 * @since 1.4.0
18 */
19 class Statify_Cron extends Statify {
20
21 /**
22 * Cleanup obsolete DB values
23 *
24 * @since 0.3.0
25 * @version 1.4.0
26 */
27 public static function cleanup_data() {
28
29 // Global.
30 global $wpdb;
31
32 // Remove items.
33 $wpdb->query(
34 $wpdb->prepare(
35 "DELETE FROM `$wpdb->statify` WHERE created <= SUBDATE(CURDATE(), %d)",
36 (int) self::$_options['days']
37 )
38 );
39
40 // Optimize DB.
41 $wpdb->query(
42 "OPTIMIZE TABLE `$wpdb->statify`"
43 );
44 }
45 }
46