PluginProbe
Statify / 1.4.1
Statify v1.4.1
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 / statify.class.php

statify.class.php in Statify 1.4.1, at inc/statify.class.php

153 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 /* Quit */
5 defined('ABSPATH') OR exit;
6
7
8 /**
9 * Statify
10 *
11 * @since 0.1.0
12 */
13
14 class Statify
15 {
16
17
18 /**
19 * Plugin options
20 *
21 * @since 1.4.0
22 */
23
24 public static $_options;
25
26
27 /**
28 * Class self initialize
29 *
30 * @since 0.1.0
31 * @change 0.1.0
32 */
33
34 public static function instance()
35 {
36 new self();
37 }
38
39
40 /**
41 * Class constructor
42 *
43 * @since 0.1.0
44 * @change 1.4.0
45 */
46
47 public function __construct()
48 {
49 /* Skip me! */
50 if ( (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) OR (defined('DOING_AJAX') && DOING_AJAX) ) {
51 return;
52 }
53
54 /* Table init */
55 Statify_Table::init();
56
57 /* Plugin options */
58 self::$_options = wp_parse_args(
59 get_option('statify'),
60 array(
61 'days' => 14,
62 'limit' => 3,
63 'today' => 0,
64 'snippet' => 0
65 )
66 );
67
68 /* XMLRPC */
69 if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) {
70 add_filter(
71 'xmlrpc_methods',
72 array(
73 'Statify_XMLRPC',
74 'xmlrpc_methods'
75 )
76 );
77
78 /* Cron */
79 } else if ( defined('DOING_CRON') && DOING_CRON ) {
80 add_action(
81 'statify_cleanup',
82 array(
83 'Statify_Cron',
84 'cleanup_data'
85 )
86 );
87
88 /* Backend */
89 } else if ( is_admin() ) {
90 add_action(
91 'wpmu_new_blog',
92 array(
93 'Statify_Install',
94 'init'
95 )
96 );
97 add_action(
98 'delete_blog',
99 array(
100 'Statify_Uninstall',
101 'init'
102 )
103 );
104 add_action(
105 'wp_dashboard_setup',
106 array(
107 'Statify_Dashboard',
108 'init'
109 )
110 );
111 add_filter(
112 'plugin_row_meta',
113 array(
114 'Statify_Backend',
115 'add_meta_link'
116 ),
117 10,
118 2
119 );
120 add_filter(
121 'plugin_action_links_' .STATIFY_BASE,
122 array(
123 'Statify_Backend',
124 'add_action_link'
125 )
126 );
127
128 /* Frontend */
129 } else {
130 add_action(
131 'template_redirect',
132 array(
133 'Statify_Frontend',
134 'track_visit'
135 )
136 );
137 add_filter(
138 'query_vars',
139 array(
140 'Statify_Frontend',
141 'query_vars'
142 )
143 );
144 add_action(
145 'wp_footer',
146 array(
147 'Statify_Frontend',
148 'wp_footer'
149 )
150 );
151 }
152 }
153 }