summaryrefslogtreecommitdiff
blob: 5e8c325a43b89ffc7d720c63d005e32be30da0df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<?php
/**
 * A compatibility shim for the sync actions class.
 *
 * @package automattic/jetpack-compat
 */

use Automattic\Jetpack\Sync\Actions;

/**
 * Class Jetpack_Sync_Actions
 *
 * @deprecated Use Automattic\Jetpack\Sync\Actions
 */
class Jetpack_Sync_Actions extends Automattic\Jetpack\Sync\Actions {

	/**
	 * Initializes the class.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::init
	 */
	public static function init() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::init();
	}

	/**
	 * Adds a shutdown sender callback.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::add_sender_shutdown
	 */
	public static function add_sender_shutdown() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::add_sender_shutdown();
	}

	/**
	 * Returns false or true based on whether this class should initialize the sender
	 * in current circumstances.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::should_initialize_sender
	 *
	 * @return Boolean should the object initialize sender?
	 */
	public static function should_initialize_sender() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::should_initialize_sender();
	}

	/**
	 * Returns false or true based on whether sync is allowed.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::sync_allowed
	 *
	 * @return Boolean is sync allowed?
	 */
	public static function sync_allowed() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::sync_allowed();
	}

	/**
	 * Returns false or true based on whether sync via cron is allowed.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::sync_via_cron_allowed
	 *
	 * @return Boolean is sync via cron allowed?
	 */
	public static function sync_via_cron_allowed() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::sync_via_cron_allowed();
	}

	/**
	 * Filters a boolean value that determines whether blacklisted posts should be prevented
	 * from being publicized.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::prevent_publicize_blacklisted_posts
	 *
	 * @param Boolean $should_publicize initial setting value.
	 * @param WP_Post $post the post object.
	 * @return Boolean whether to prevent publicizing.
	 */
	public static function prevent_publicize_blacklisted_posts( $should_publicize, $post ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::prevent_publicize_blacklisted_posts( $should_publicize, $post );
	}

	/**
	 * Set the importing flag to true.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::set_is_importing_true
	 */
	public static function set_is_importing_true() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::set_is_importing_true();
	}

	/**
	 * Send the sync data.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::send_data
	 *
	 * @param Mixed   $data the sync data.
	 * @param String  $codec_name the codec slug.
	 * @param Integer $sent_timestamp the current server timestamp.
	 * @param Integer $queue_id the queue identifier.
	 * @param Integer $checkout_duration time spent retrieving items.
	 * @param Integer $preprocess_duration Time spent converting items into data.
	 * @return WP_Response the response object.
	 */
	public static function send_data( $data, $codec_name, $sent_timestamp, $queue_id, $checkout_duration, $preprocess_duration ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::send_data( $data, $codec_name, $sent_timestamp, $queue_id, $checkout_duration, $preprocess_duration );
	}

	/**
	 * Commence initial sync.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::do_initial_sync
	 */
	public static function do_initial_sync() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::do_initial_sync();
	}

	/**
	 * Commence full sync.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::do_full_sync
	 *
	 * @param Array $modules the modules list.
	 * @return Boolean whether the sync was initialized.
	 */
	public static function do_full_sync( $modules = null ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::do_full_sync( $modules );
	}

	/**
	 * Schedule cron sessions.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::jetpack_cron_schedule
	 *
	 * @param Array $schedules the schedules to add.
	 */
	public static function jetpack_cron_schedule( $schedules ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::jetpack_cron_schedule( $schedules );
	}

	/**
	 * Commence cron sync.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::do_cron_sync
	 */
	public static function do_cron_sync() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::do_cron_sync();
	}

	/**
	 * Commence cron full sync.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::do_cron_full_sync
	 */
	public static function do_cron_full_sync() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::do_cron_full_sync();
	}

	/**
	 * Commence cron sync of a specific type of object.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::do_cron_sync_by_type
	 *
	 * @param Array $type the type of object to sync.
	 */
	public static function do_cron_sync_by_type( $type ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::do_cron_sync_by_type();
	}

	/**
	 * Initalize the listener of the object.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::initialize_listener
	 */
	public static function initialize_listener() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::initialize_listener();
	}

	/**
	 * Initalize the sender of the object.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::initialize_sender
	 */
	public static function initialize_sender() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::initialize_sender();
	}

	/**
	 * Initalize the woocommerce listeners.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::initialize_woocommerce
	 */
	public static function initialize_woocommerce() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::initialize_woocommerce();
	}

	/**
	 * Add the woocommerce sync module.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::add_woocommerce_sync_module
	 *
	 * @param Array $sync_modules an array of modules.
	 */
	public static function add_woocommerce_sync_module( $sync_modules ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::add_woocommerce_sync_module( $sync_modules );
	}

	/**
	 * Initalize the WP Super Cache listener.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::initialize_wp_super_cache
	 */
	public static function initialize_wp_super_cache() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::initialize_wp_super_cache();
	}

	/**
	 * Add the WP Super Cache sync module.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::add_wp_super_cache_sync_module
	 *
	 * @param Array $sync_modules the list to be amended.
	 */
	public static function add_wp_super_cache_sync_module( $sync_modules ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::add_wp_super_cache_sync_module( $sync_modules );
	}

	/**
	 * Sanitizes the filtered sync cron schedule.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::sanitize_filtered_sync_cron_schedule
	 *
	 * @param String $schedule the cron schedule to sanitize.
	 * @return String sanitized cron schedule.
	 */
	public static function sanitize_filtered_sync_cron_schedule( $schedule ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::sanitize_filtered_sync_cron_schedule( $schedule );
	}

	/**
	 * Returns the time offset for a the start schedule.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::get_start_time_offset
	 *
	 * @param String $schedule the schedule string.
	 * @param String $hook hook slug.
	 * @return Integer start time offset.
	 */
	public static function get_start_time_offset( $schedule = '', $hook = '' ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::get_start_time_offset( $schedule, $hook );
	}

	/**
	 * If needed, schedule a cron sync.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::maybe_schedule_sync_cron
	 *
	 * @param String $schedule the schedule string.
	 * @param String $hook hook slug.
	 */
	public static function maybe_schedule_sync_cron( $schedule, $hook ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::maybe_schedule_sync_cron( $schedule, $hook );
	}

	/**
	 * Clears cron jobs scheduled for sync.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::clear_sync_cron_jobs
	 */
	public static function clear_sync_cron_jobs() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::clear_sync_cron_jobs();
	}

	/**
	 * Initialize cron jobs for sync.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::init_sync_cron_jobs
	 */
	public static function init_sync_cron_jobs() {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::init_sync_cron_jobs();
	}

	/**
	 * Cleans up schedules on plugin upgrade.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::cleanup_on_upgrade
	 *
	 * @param String $new_version the new version.
	 * @param String $old_version the old version.
	 */
	public static function cleanup_on_upgrade( $new_version = null, $old_version = null ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::cleanup_on_upgrade( $new_version, $old_version );
	}

	/**
	 * Clears cron jobs scheduled for sync.
	 *
	 * @deprecated Automattic\Jetpack\Sync\Actions::get_sync_status
	 *
	 * @param Array $fields sync fields to get status of.
	 */
	public static function get_sync_status( $fields = null ) {
		_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Sync\Actions' );

		return Actions::get_sync_status( $fields );
	}
}