Completed
Push — fix/14559-block-style ( 31537f...285323 )
by Gary
06:50
created

compat/legacy/class-jetpack-sync-actions.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * A compatibility shim for the sync actions class.
4
 *
5
 * @package automattic/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
	 * @param Integer $queue_size The current size of the sync queue.
0 ignored issues
show
Should the type for parameter $queue_size not be integer|null?

This check looks for @param annotations 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.

Loading history...
118
	 *
119
	 * @return WP_Response the response object.
120
	 */
121
	public static function send_data( $data, $codec_name, $sent_timestamp, $queue_id, $checkout_duration, $preprocess_duration, $queue_size = null ) {
122
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
123
124
		return Actions::send_data( $data, $codec_name, $sent_timestamp, $queue_id, $checkout_duration, $preprocess_duration, $queue_size );
125
	}
126
127
	/**
128
	 * Commence initial sync.
129
	 *
130
	 * @deprecated Automattic\Jetpack\Sync\Actions::do_initial_sync
131
	 */
132
	public static function do_initial_sync() {
133
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
134
135
		return Actions::do_initial_sync();
136
	}
137
138
	/**
139
	 * Commence full sync.
140
	 *
141
	 * @deprecated Automattic\Jetpack\Sync\Actions::do_full_sync
142
	 *
143
	 * @param Array $modules the modules list.
144
	 * @return Boolean whether the sync was initialized.
145
	 */
146
	public static function do_full_sync( $modules = null ) {
147
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
148
149
		return Actions::do_full_sync( $modules );
150
	}
151
152
	/**
153
	 * Schedule cron sessions.
154
	 *
155
	 * @deprecated Automattic\Jetpack\Sync\Actions::jetpack_cron_schedule
156
	 *
157
	 * @param Array $schedules the schedules to add.
158
	 */
159
	public static function jetpack_cron_schedule( $schedules ) {
160
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
161
162
		return Actions::jetpack_cron_schedule( $schedules );
163
	}
164
165
	/**
166
	 * Commence cron sync.
167
	 *
168
	 * @deprecated Automattic\Jetpack\Sync\Actions::do_cron_sync
169
	 */
170
	public static function do_cron_sync() {
171
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
172
173
		return Actions::do_cron_sync();
174
	}
175
176
	/**
177
	 * Commence cron full sync.
178
	 *
179
	 * @deprecated Automattic\Jetpack\Sync\Actions::do_cron_full_sync
180
	 */
181
	public static function do_cron_full_sync() {
182
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
183
184
		return Actions::do_cron_full_sync();
185
	}
186
187
	/**
188
	 * Commence cron sync of a specific type of object.
189
	 *
190
	 * @deprecated Automattic\Jetpack\Sync\Actions::do_cron_sync_by_type
191
	 *
192
	 * @param Array $type the type of object to sync.
193
	 */
194
	public static function do_cron_sync_by_type( $type ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
195
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
196
197
		return Actions::do_cron_sync_by_type();
198
	}
199
200
	/**
201
	 * Initalize the listener of the object.
202
	 *
203
	 * @deprecated Automattic\Jetpack\Sync\Actions::initialize_listener
204
	 */
205
	public static function initialize_listener() {
206
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
207
208
		return Actions::initialize_listener();
209
	}
210
211
	/**
212
	 * Initalize the sender of the object.
213
	 *
214
	 * @deprecated Automattic\Jetpack\Sync\Actions::initialize_sender
215
	 */
216
	public static function initialize_sender() {
217
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
218
219
		return Actions::initialize_sender();
220
	}
221
222
	/**
223
	 * Initalize the woocommerce listeners.
224
	 *
225
	 * @deprecated Automattic\Jetpack\Sync\Actions::initialize_woocommerce
226
	 */
227
	public static function initialize_woocommerce() {
228
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
229
230
		return Actions::initialize_woocommerce();
231
	}
232
233
	/**
234
	 * Add the woocommerce sync module.
235
	 *
236
	 * @deprecated Automattic\Jetpack\Sync\Actions::add_woocommerce_sync_module
237
	 *
238
	 * @param Array $sync_modules an array of modules.
239
	 */
240
	public static function add_woocommerce_sync_module( $sync_modules ) {
241
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
242
243
		return Actions::add_woocommerce_sync_module( $sync_modules );
244
	}
245
246
	/**
247
	 * Initalize the WP Super Cache listener.
248
	 *
249
	 * @deprecated Automattic\Jetpack\Sync\Actions::initialize_wp_super_cache
250
	 */
251
	public static function initialize_wp_super_cache() {
252
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
253
254
		return Actions::initialize_wp_super_cache();
255
	}
256
257
	/**
258
	 * Add the WP Super Cache sync module.
259
	 *
260
	 * @deprecated Automattic\Jetpack\Sync\Actions::add_wp_super_cache_sync_module
261
	 *
262
	 * @param Array $sync_modules the list to be amended.
263
	 */
264
	public static function add_wp_super_cache_sync_module( $sync_modules ) {
265
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
266
267
		return Actions::add_wp_super_cache_sync_module( $sync_modules );
268
	}
269
270
	/**
271
	 * Sanitizes the filtered sync cron schedule.
272
	 *
273
	 * @deprecated Automattic\Jetpack\Sync\Actions::sanitize_filtered_sync_cron_schedule
274
	 *
275
	 * @param String $schedule the cron schedule to sanitize.
276
	 * @return String sanitized cron schedule.
277
	 */
278
	public static function sanitize_filtered_sync_cron_schedule( $schedule ) {
279
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
280
281
		return Actions::sanitize_filtered_sync_cron_schedule( $schedule );
282
	}
283
284
	/**
285
	 * Returns the time offset for a the start schedule.
286
	 *
287
	 * @deprecated Automattic\Jetpack\Sync\Actions::get_start_time_offset
288
	 *
289
	 * @param String $schedule the schedule string.
290
	 * @param String $hook hook slug.
291
	 * @return Integer start time offset.
292
	 */
293
	public static function get_start_time_offset( $schedule = '', $hook = '' ) {
294
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
295
296
		return Actions::get_start_time_offset( $schedule, $hook );
297
	}
298
299
	/**
300
	 * If needed, schedule a cron sync.
301
	 *
302
	 * @deprecated Automattic\Jetpack\Sync\Actions::maybe_schedule_sync_cron
303
	 *
304
	 * @param String $schedule the schedule string.
305
	 * @param String $hook hook slug.
306
	 */
307
	public static function maybe_schedule_sync_cron( $schedule, $hook ) {
308
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
309
310
		return Actions::maybe_schedule_sync_cron( $schedule, $hook );
311
	}
312
313
	/**
314
	 * Clears cron jobs scheduled for sync.
315
	 *
316
	 * @deprecated Automattic\Jetpack\Sync\Actions::clear_sync_cron_jobs
317
	 */
318
	public static function clear_sync_cron_jobs() {
319
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
320
321
		return Actions::clear_sync_cron_jobs();
322
	}
323
324
	/**
325
	 * Initialize cron jobs for sync.
326
	 *
327
	 * @deprecated Automattic\Jetpack\Sync\Actions::init_sync_cron_jobs
328
	 */
329
	public static function init_sync_cron_jobs() {
330
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
331
332
		return Actions::init_sync_cron_jobs();
333
	}
334
335
	/**
336
	 * Cleans up schedules on plugin upgrade.
337
	 *
338
	 * @deprecated Automattic\Jetpack\Sync\Actions::cleanup_on_upgrade
339
	 *
340
	 * @param String $new_version the new version.
341
	 * @param String $old_version the old version.
342
	 */
343
	public static function cleanup_on_upgrade( $new_version = null, $old_version = null ) {
344
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
345
346
		return Actions::cleanup_on_upgrade( $new_version, $old_version );
347
	}
348
349
	/**
350
	 * Clears cron jobs scheduled for sync.
351
	 *
352
	 * @deprecated Automattic\Jetpack\Sync\Actions::get_sync_status
353
	 *
354
	 * @param Array $fields sync fields to get status of.
355
	 */
356
	public static function get_sync_status( $fields = null ) {
357
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );
358
359
		return Actions::get_sync_status( $fields );
360
	}
361
}
362