1 | <?php |
||
6 | class Jetpack_Heartbeat { |
||
7 | |||
8 | /** |
||
9 | * Holds the singleton instance of this class |
||
10 | * |
||
11 | * @since 2.3.3 |
||
12 | * @var Jetpack_Heartbeat |
||
13 | */ |
||
14 | private static $instance = false; |
||
15 | |||
16 | /** |
||
17 | * Holds the singleton instance of the proxied class |
||
18 | * |
||
19 | * @since 8.9.0 |
||
20 | * @var Automattic\Jetpack\Heartbeat |
||
21 | */ |
||
22 | private static $proxied_instance = false; |
||
23 | |||
24 | /** |
||
25 | * Singleton |
||
26 | * |
||
27 | * @since 2.3.3 |
||
28 | * @static |
||
29 | * @return Jetpack_Heartbeat |
||
30 | */ |
||
31 | public static function init() { |
||
39 | |||
40 | /** |
||
41 | * Constructor for singleton |
||
42 | * |
||
43 | * @since 2.3.3 |
||
44 | * @return Jetpack_Heartbeat |
||
|
|||
45 | */ |
||
46 | private function __construct() { |
||
49 | |||
50 | /** |
||
51 | * Method that gets executed on the wp-cron call |
||
52 | * |
||
53 | * @deprecated since 8.9.0 |
||
54 | * @see Automattic\Jetpack\Heartbeat::cron_exec() |
||
55 | * |
||
56 | * @since 2.3.3 |
||
57 | * @global string $wp_version |
||
58 | */ |
||
59 | public function cron_exec() { |
||
64 | |||
65 | /** |
||
66 | * Generates heartbeat stats data. |
||
67 | * |
||
68 | * @param string $prefix Prefix to add before stats identifier. |
||
69 | * |
||
70 | * @return array The stats array. |
||
71 | */ |
||
72 | public static function generate_stats_array( $prefix = '' ) { |
||
124 | |||
125 | /** |
||
126 | * Registers jetpack.getHeartbeatData xmlrpc method |
||
127 | * |
||
128 | * @deprecated since 8.9.0 |
||
129 | * @see Automattic\Jetpack\Heartbeat::jetpack_xmlrpc_methods() |
||
130 | * |
||
131 | * @param array $methods The list of methods to be filtered. |
||
132 | * @return array $methods |
||
133 | */ |
||
134 | public static function jetpack_xmlrpc_methods( $methods ) { |
||
138 | |||
139 | /** |
||
140 | * Handles the response for the jetpack.getHeartbeatData xmlrpc method |
||
141 | * |
||
142 | * @deprecated since 8.9.0 |
||
143 | * @see Automattic\Jetpack\Heartbeat::xmlrpc_data_response() |
||
144 | * |
||
145 | * @param array $params The parameters received in the request. |
||
146 | * @return array $params all the stats that hearbeat handles. |
||
147 | */ |
||
148 | public static function xmlrpc_data_response( $params = array() ) { |
||
152 | |||
153 | /** |
||
154 | * Clear scheduled events |
||
155 | * |
||
156 | * @deprecated since 8.9.0 |
||
157 | * @see Automattic\Jetpack\Heartbeat::deactivate() |
||
158 | * |
||
159 | * @return void |
||
160 | */ |
||
161 | public function deactivate() { |
||
166 | |||
167 | /** |
||
168 | * Add Jetpack Stats array to Heartbeat if Jetpack is connected |
||
169 | * |
||
170 | * @since 8.9.0 |
||
171 | * |
||
172 | * @param array $stats Jetpack Heartbeat stats. |
||
173 | * @return array $stats |
||
174 | */ |
||
175 | public function add_stats_to_heartbeat( $stats ) { |
||
185 | |||
186 | } |
||
187 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.