|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* A compatibility shim for the sync actions class. |
|
4
|
|
|
* |
|
5
|
|
|
* @package jetpack-compat |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
use Automattic\Jetpack\Sync\Actions; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class Jetpack_Sync_Actions |
|
12
|
|
|
* |
|
13
|
|
|
* @deprecated Use Automattic\Jetpack\Sync\Actions |
|
14
|
|
|
*/ |
|
15
|
|
|
class Jetpack_Sync_Actions extends Automattic\Jetpack\Sync\Actions { |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Initializes the class. |
|
19
|
|
|
* |
|
20
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::init |
|
21
|
|
|
*/ |
|
22
|
|
|
public static function init() { |
|
23
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
24
|
|
|
|
|
25
|
|
|
return Actions::init(); |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* Adds a shutdown sender callback. |
|
30
|
|
|
* |
|
31
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::add_sender_shutdown |
|
32
|
|
|
*/ |
|
33
|
|
|
public static function add_sender_shutdown() { |
|
34
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
35
|
|
|
|
|
36
|
|
|
return Actions::add_sender_shutdown(); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* Returns false or true based on whether this class should initialize the sender |
|
41
|
|
|
* in current circumstances. |
|
42
|
|
|
* |
|
43
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::should_initialize_sender |
|
44
|
|
|
* |
|
45
|
|
|
* @return Boolean should the object initialize sender? |
|
46
|
|
|
*/ |
|
47
|
|
|
public static function should_initialize_sender() { |
|
48
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
49
|
|
|
|
|
50
|
|
|
return Actions::should_initialize_sender(); |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Returns false or true based on whether sync is allowed. |
|
55
|
|
|
* |
|
56
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::sync_allowed |
|
57
|
|
|
* |
|
58
|
|
|
* @return Boolean is sync allowed? |
|
59
|
|
|
*/ |
|
60
|
|
|
public static function sync_allowed() { |
|
61
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
62
|
|
|
|
|
63
|
|
|
return Actions::sync_allowed(); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* Returns false or true based on whether sync via cron is allowed. |
|
68
|
|
|
* |
|
69
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::sync_via_cron_allowed |
|
70
|
|
|
* |
|
71
|
|
|
* @return Boolean is sync via cron allowed? |
|
72
|
|
|
*/ |
|
73
|
|
|
public static function sync_via_cron_allowed() { |
|
74
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
75
|
|
|
|
|
76
|
|
|
return Actions::sync_via_cron_allowed(); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* Filters a boolean value that determines whether blacklisted posts should be prevented |
|
81
|
|
|
* from being publicized. |
|
82
|
|
|
* |
|
83
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::prevent_publicize_blacklisted_posts |
|
84
|
|
|
* |
|
85
|
|
|
* @param Boolean $should_publicize initial setting value. |
|
86
|
|
|
* @param WP_Post $post the post object. |
|
87
|
|
|
* @return Boolean whether to prevent publicizing. |
|
88
|
|
|
*/ |
|
89
|
|
|
public static function prevent_publicize_blacklisted_posts( $should_publicize, $post ) { |
|
90
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
91
|
|
|
|
|
92
|
|
|
return Actions::prevent_publicize_blacklisted_posts( $should_publicize, $post ); |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* Set the importing flag to true. |
|
97
|
|
|
* |
|
98
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::set_is_importing_true |
|
99
|
|
|
*/ |
|
100
|
|
|
public static function set_is_importing_true() { |
|
101
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
102
|
|
|
|
|
103
|
|
|
return Actions::set_is_importing_true(); |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* Send the sync data. |
|
108
|
|
|
* |
|
109
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::send_data |
|
110
|
|
|
* |
|
111
|
|
|
* @param Mixed $data the sync data. |
|
112
|
|
|
* @param String $codec_name the codec slug. |
|
113
|
|
|
* @param Integer $sent_timestamp the current server timestamp. |
|
114
|
|
|
* @param Integer $queue_id the queue identifier. |
|
115
|
|
|
* @param Integer $checkout_duration time spent retrieving items. |
|
116
|
|
|
* @param Integer $preprocess_duration Time spent converting items into data. |
|
117
|
|
|
* @return WP_Response the response object. |
|
118
|
|
|
*/ |
|
119
|
|
|
public static function send_data( $data, $codec_name, $sent_timestamp, $queue_id, $checkout_duration, $preprocess_duration ) { |
|
120
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
121
|
|
|
|
|
122
|
|
|
return Actions::send_data( $data, $codec_name, $sent_timestamp, $queue_id, $checkout_duration, $preprocess_duration ); |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
/** |
|
126
|
|
|
* Commence initial sync. |
|
127
|
|
|
* |
|
128
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::do_initial_sync |
|
129
|
|
|
*/ |
|
130
|
|
|
public static function do_initial_sync() { |
|
131
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
132
|
|
|
|
|
133
|
|
|
return Actions::do_initial_sync(); |
|
134
|
|
|
} |
|
135
|
|
|
|
|
136
|
|
|
/** |
|
137
|
|
|
* Commence full sync. |
|
138
|
|
|
* |
|
139
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::do_full_sync |
|
140
|
|
|
* |
|
141
|
|
|
* @param Array $modules the modules list. |
|
|
|
|
|
|
142
|
|
|
* @return Boolean whether the sync was initialized. |
|
143
|
|
|
*/ |
|
144
|
|
|
public static function do_full_sync( $modules = null ) { |
|
145
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
146
|
|
|
|
|
147
|
|
|
return Actions::do_full_sync( $modules ); |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
/** |
|
151
|
|
|
* Schedule cron sessions. |
|
152
|
|
|
* |
|
153
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::jetpack_cron_schedule |
|
154
|
|
|
* |
|
155
|
|
|
* @param Array $schedules the schedules to add. |
|
156
|
|
|
*/ |
|
157
|
|
|
public static function jetpack_cron_schedule( $schedules ) { |
|
158
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
159
|
|
|
|
|
160
|
|
|
return Actions::jetpack_cron_schedule( $schedules ); |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
/** |
|
164
|
|
|
* Commence cron sync. |
|
165
|
|
|
* |
|
166
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::do_cron_sync |
|
167
|
|
|
*/ |
|
168
|
|
|
public static function do_cron_sync() { |
|
169
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
170
|
|
|
|
|
171
|
|
|
return Actions::do_cron_sync(); |
|
172
|
|
|
} |
|
173
|
|
|
|
|
174
|
|
|
/** |
|
175
|
|
|
* Commence cron full sync. |
|
176
|
|
|
* |
|
177
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::do_cron_full_sync |
|
178
|
|
|
*/ |
|
179
|
|
|
public static function do_cron_full_sync() { |
|
180
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
181
|
|
|
|
|
182
|
|
|
return Actions::do_cron_full_sync(); |
|
183
|
|
|
} |
|
184
|
|
|
|
|
185
|
|
|
/** |
|
186
|
|
|
* Commence cron sync of a specific type of object. |
|
187
|
|
|
* |
|
188
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::do_cron_sync_by_type |
|
189
|
|
|
* |
|
190
|
|
|
* @param Array $type the type of object to sync. |
|
191
|
|
|
*/ |
|
192
|
|
|
public static function do_cron_sync_by_type( $type ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
193
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
194
|
|
|
|
|
195
|
|
|
return Actions::do_cron_sync_by_type(); |
|
|
|
|
|
|
196
|
|
|
} |
|
197
|
|
|
|
|
198
|
|
|
/** |
|
199
|
|
|
* Initalize the listener of the object. |
|
200
|
|
|
* |
|
201
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::initialize_listener |
|
202
|
|
|
*/ |
|
203
|
|
|
public static function initialize_listener() { |
|
204
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
205
|
|
|
|
|
206
|
|
|
return Actions::initialize_listener(); |
|
207
|
|
|
} |
|
208
|
|
|
|
|
209
|
|
|
/** |
|
210
|
|
|
* Initalize the sender of the object. |
|
211
|
|
|
* |
|
212
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::initialize_sender |
|
213
|
|
|
*/ |
|
214
|
|
|
public static function initialize_sender() { |
|
215
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
216
|
|
|
|
|
217
|
|
|
return Actions::initialize_sender(); |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* Initalize the woocommerce listeners. |
|
222
|
|
|
* |
|
223
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::initialize_woocommerce |
|
224
|
|
|
*/ |
|
225
|
|
|
public static function initialize_woocommerce() { |
|
226
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
227
|
|
|
|
|
228
|
|
|
return Actions::initialize_woocommerce(); |
|
229
|
|
|
} |
|
230
|
|
|
|
|
231
|
|
|
/** |
|
232
|
|
|
* Add the woocommerce sync module. |
|
233
|
|
|
* |
|
234
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::add_woocommerce_sync_module |
|
235
|
|
|
* |
|
236
|
|
|
* @param Array $sync_modules an array of modules. |
|
237
|
|
|
*/ |
|
238
|
|
|
public static function add_woocommerce_sync_module( $sync_modules ) { |
|
239
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
240
|
|
|
|
|
241
|
|
|
return Actions::add_woocommerce_sync_module( $sync_modules ); |
|
242
|
|
|
} |
|
243
|
|
|
|
|
244
|
|
|
/** |
|
245
|
|
|
* Initalize the WP Super Cache listener. |
|
246
|
|
|
* |
|
247
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::initialize_wp_super_cache |
|
248
|
|
|
*/ |
|
249
|
|
|
public static function initialize_wp_super_cache() { |
|
250
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
251
|
|
|
|
|
252
|
|
|
return Actions::initialize_wp_super_cache(); |
|
253
|
|
|
} |
|
254
|
|
|
|
|
255
|
|
|
/** |
|
256
|
|
|
* Add the WP Super Cache sync module. |
|
257
|
|
|
* |
|
258
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::add_wp_super_cache_sync_module |
|
259
|
|
|
* |
|
260
|
|
|
* @param Array $sync_modules the list to be amended. |
|
261
|
|
|
*/ |
|
262
|
|
|
public static function add_wp_super_cache_sync_module( $sync_modules ) { |
|
263
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
264
|
|
|
|
|
265
|
|
|
return Actions::add_wp_super_cache_sync_module( $sync_modules ); |
|
266
|
|
|
} |
|
267
|
|
|
|
|
268
|
|
|
/** |
|
269
|
|
|
* Sanitizes the filtered sync cron schedule. |
|
270
|
|
|
* |
|
271
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::sanitize_filtered_sync_cron_schedule |
|
272
|
|
|
* |
|
273
|
|
|
* @param String $schedule the cron schedule to sanitize. |
|
274
|
|
|
* @return String sanitized cron schedule. |
|
275
|
|
|
*/ |
|
276
|
|
|
public static function sanitize_filtered_sync_cron_schedule( $schedule ) { |
|
277
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
278
|
|
|
|
|
279
|
|
|
return Actions::sanitize_filtered_sync_cron_schedule( $schedule ); |
|
280
|
|
|
} |
|
281
|
|
|
|
|
282
|
|
|
/** |
|
283
|
|
|
* Returns the time offset for a the start schedule. |
|
284
|
|
|
* |
|
285
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::get_start_time_offset |
|
286
|
|
|
* |
|
287
|
|
|
* @param String $schedule the schedule string. |
|
288
|
|
|
* @param String $hook hook slug. |
|
289
|
|
|
* @return Integer start time offset. |
|
290
|
|
|
*/ |
|
291
|
|
|
public static function get_start_time_offset( $schedule = '', $hook = '' ) { |
|
292
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
293
|
|
|
|
|
294
|
|
|
return Actions::get_start_time_offset( $schedule, $hook ); |
|
295
|
|
|
} |
|
296
|
|
|
|
|
297
|
|
|
/** |
|
298
|
|
|
* If needed, schedule a cron sync. |
|
299
|
|
|
* |
|
300
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::maybe_schedule_sync_cron |
|
301
|
|
|
* |
|
302
|
|
|
* @param String $schedule the schedule string. |
|
303
|
|
|
* @param String $hook hook slug. |
|
304
|
|
|
*/ |
|
305
|
|
|
public static function maybe_schedule_sync_cron( $schedule, $hook ) { |
|
306
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
307
|
|
|
|
|
308
|
|
|
return Actions::maybe_schedule_sync_cron( $schedule, $hook ); |
|
309
|
|
|
} |
|
310
|
|
|
|
|
311
|
|
|
/** |
|
312
|
|
|
* Clears cron jobs scheduled for sync. |
|
313
|
|
|
* |
|
314
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::clear_sync_cron_jobs |
|
315
|
|
|
*/ |
|
316
|
|
|
public static function clear_sync_cron_jobs() { |
|
317
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
318
|
|
|
|
|
319
|
|
|
return Actions::clear_sync_cron_jobs(); |
|
320
|
|
|
} |
|
321
|
|
|
|
|
322
|
|
|
/** |
|
323
|
|
|
* Initialize cron jobs for sync. |
|
324
|
|
|
* |
|
325
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::init_sync_cron_jobs |
|
326
|
|
|
*/ |
|
327
|
|
|
public static function init_sync_cron_jobs() { |
|
328
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
329
|
|
|
|
|
330
|
|
|
return Actions::init_sync_cron_jobs(); |
|
331
|
|
|
} |
|
332
|
|
|
|
|
333
|
|
|
/** |
|
334
|
|
|
* Cleans up schedules on plugin upgrade. |
|
335
|
|
|
* |
|
336
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::cleanup_on_upgrade |
|
337
|
|
|
* |
|
338
|
|
|
* @param String $new_version the new version. |
|
|
|
|
|
|
339
|
|
|
* @param String $old_version the old version. |
|
|
|
|
|
|
340
|
|
|
*/ |
|
341
|
|
|
public static function cleanup_on_upgrade( $new_version = null, $old_version = null ) { |
|
342
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
343
|
|
|
|
|
344
|
|
|
return Actions::cleanup_on_upgrade( $new_version, $old_version ); |
|
345
|
|
|
} |
|
346
|
|
|
|
|
347
|
|
|
/** |
|
348
|
|
|
* Clears cron jobs scheduled for sync. |
|
349
|
|
|
* |
|
350
|
|
|
* @deprecated \Automattic\Jetpack\Sync\Actions::get_sync_status |
|
351
|
|
|
* |
|
352
|
|
|
* @param Array $fields sync fields to get status of. |
|
|
|
|
|
|
353
|
|
|
*/ |
|
354
|
|
|
public static function get_sync_status( $fields = null ) { |
|
355
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' ); |
|
356
|
|
|
|
|
357
|
|
|
return Actions::get_sync_status( $fields ); |
|
|
|
|
|
|
358
|
|
|
} |
|
359
|
|
|
} |
|
360
|
|
|
|
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.