Completed
Push — update/sync-mailserver ( d6221f )
by
unknown
11:32
created

Jetpack_Sync_Defaults::get_options_contentless()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
require_once( JETPACK__PLUGIN_DIR . 'modules/sso/class.jetpack-sso-helpers.php' );
3
4
/**
5
 * Just some defaults that we share with the server
6
 */
7
class Jetpack_Sync_Defaults {
8
9
	static $default_options_whitelist = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_options_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
10
		'stylesheet',
11
		'blogname',
12
		'blogdescription',
13
		'blog_charset',
14
		'permalink_structure',
15
		'category_base',
16
		'tag_base',
17
		'sidebars_widgets',
18
		'comment_moderation',
19
		'default_comment_status',
20
		'page_on_front',
21
		'rss_use_excerpt',
22
		'subscription_options',
23
		'stb_enabled',
24
		'stc_enabled',
25
		'comment_registration',
26
		'show_avatars',
27
		'avatar_default',
28
		'avatar_rating',
29
		'highlander_comment_form_prompt',
30
		'jetpack_comment_form_color_scheme',
31
		'stats_options',
32
		'gmt_offset',
33
		'timezone_string',
34
		'jetpack_sync_non_public_post_stati',
35
		'jetpack_options',
36
		'site_icon', // (int) - ID of core's Site Icon attachment ID
37
		'default_post_format',
38
		'default_category',
39
		'large_size_w',
40
		'large_size_h',
41
		'thumbnail_size_w',
42
		'thumbnail_size_h',
43
		'medium_size_w',
44
		'medium_size_h',
45
		'thumbnail_crop',
46
		'image_default_link_type',
47
		'site_logo',
48
		'sharing-options',
49
		'sharing-services',
50
		'post_count',
51
		'default_ping_status',
52
		'sticky_posts',
53
		'blog_public',
54
		'default_pingback_flag',
55
		'require_name_email',
56
		'close_comments_for_old_posts',
57
		'close_comments_days_old',
58
		'thread_comments',
59
		'thread_comments_depth',
60
		'page_comments',
61
		'comments_per_page',
62
		'default_comments_page',
63
		'comment_order',
64
		'comments_notify',
65
		'moderation_notify',
66
		'social_notifications_like',
67
		'social_notifications_reblog',
68
		'social_notifications_subscribe',
69
		'comment_whitelist',
70
		'comment_max_links',
71
		'moderation_keys',
72
		'jetpack_wga',
73
		'disabled_likes',
74
		'disabled_reblogs',
75
		'jetpack_comment_likes_enabled',
76
		'twitter_via',
77
		'jetpack-twitter-cards-site-tag',
78
		'wpcom_publish_posts_with_markdown',
79
		'wpcom_publish_comments_with_markdown',
80
		'jetpack_activated',
81
		'jetpack_available_modules',
82
		'jetpack_autoupdate_plugins',
83
		'jetpack_autoupdate_plugins_translations',
84
		'jetpack_autoupdate_themes',
85
		'jetpack_autoupdate_themes_translations',
86
		'jetpack_autoupdate_core',
87
		'jetpack_autoupdate_translations',
88
		'carousel_background_color',
89
		'carousel_display_exif',
90
		'jetpack_portfolio',
91
		'jetpack_portfolio_posts_per_page',
92
		'jetpack_testimonial',
93
		'jetpack_testimonial_posts_per_page',
94
		'tiled_galleries',
95
		'gravatar_disable_hovercards',
96
		'infinite_scroll',
97
		'infinite_scroll_google_analytics',
98
		'wp_mobile_excerpt',
99
		'wp_mobile_featured_images',
100
		'wp_mobile_app_promos',
101
		'monitor_receive_notifications',
102
		'post_by_email_address',
103
		'jetpack_protect_key',
104
		'jetpack_protect_global_whitelist',
105
		'jetpack_sso_require_two_step',
106
		'jetpack_relatedposts',
107
		'verification_services_codes',
108
		'users_can_register',
109
		'active_plugins',
110
		'uninstall_plugins',
111
		'advanced_seo_front_page_description', // Jetpack_SEO_Utils::FRONT_PAGE_META_OPTION
112
		'advanced_seo_title_formats', // Jetpack_SEO_Titles::TITLE_FORMATS_OPTION
113
		'jetpack_api_cache_enabled',
114
		'start_of_week',
115
		'blacklist_keys',
116
		'posts_per_page',
117
		'posts_per_rss',
118
		'show_on_front',
119
		'ping_sites',
120
		'uploads_use_yearmonth_folders',
121
		'date_format',
122
		'time_format',
123
		'mailserver_url',
124
		'mailserver_login', // Not syncing contents, only the option name
125
		'mailserver_pass', // Not syncing contents, only the option name
126
		'mailserver_port',
127
	);
128
129
	public static function get_options_whitelist() {
130
		/** This filter is already documented in json-endpoints/jetpack/class.wpcom-json-api-get-option-endpoint.php */
131
		$options_whitelist = apply_filters( 'jetpack_options_whitelist', self::$default_options_whitelist );
132
		/**
133
		 * Filter the list of WordPress options that are manageable via the JSON API.
134
		 *
135
		 * @module sync
136
		 *
137
		 * @since 4.8
138
		 *
139
		 * @param array The default list of options.
140
		 */
141
		return apply_filters( 'jetpack_sync_options_whitelist', $options_whitelist );
142
	}
143
144
	// Do not sync contents for these events, only the option name
145
	static $default_options_contentless = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_options_contentless.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
146
		'mailserver_login',
147
		'mailserver_pass',
148
	);
149
150
	public static function get_options_contentless() {
151
		/**
152
		 * Filter the list of WordPress options that should be synced without content
153
		 *
154
		 * @module sync
155
		 *
156
		 * @since 6.1
157
		 *
158
		 * @param array The list of options synced without content.
159
		 */
160
		return apply_filters( 'jetpack_sync_options_contentless', self::$default_options_contentless );
161
	}
162
163
	static $default_constants_whitelist = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_constants_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
164
		'EMPTY_TRASH_DAYS',
165
		'WP_POST_REVISIONS',
166
		'AUTOMATIC_UPDATER_DISABLED',
167
		'ABSPATH',
168
		'WP_CONTENT_DIR',
169
		'FS_METHOD',
170
		'DISALLOW_FILE_EDIT',
171
		'DISALLOW_FILE_MODS',
172
		'WP_AUTO_UPDATE_CORE',
173
		'WP_HTTP_BLOCK_EXTERNAL',
174
		'WP_ACCESSIBLE_HOSTS',
175
		'JETPACK__VERSION',
176
		'IS_PRESSABLE',
177
		'DISABLE_WP_CRON',
178
		'ALTERNATE_WP_CRON',
179
		'WP_CRON_LOCK_TIMEOUT',
180
		'PHP_VERSION',
181
		'WP_MEMORY_LIMIT',
182
		'WP_MAX_MEMORY_LIMIT'
183
	);
184
185
	public static function get_constants_whitelist() {
186
		/**
187
		 * Filter the list of PHP constants that are manageable via the JSON API.
188
		 *
189
		 * @module sync
190
		 *
191
		 * @since 4.8
192
		 *
193
		 * @param array The default list of constants options.
194
		 */
195
		return apply_filters( 'jetpack_sync_constants_whitelist', self::$default_constants_whitelist );
196
	}
197
198
	static $default_callable_whitelist = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_callable_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
199
		'wp_max_upload_size'               => 'wp_max_upload_size',
200
		'is_main_network'                  => array( 'Jetpack', 'is_multi_network' ),
201
		'is_multi_site'                    => 'is_multisite',
202
		'main_network_site'                => array( 'Jetpack_Sync_Functions', 'main_network_site_url' ),
203
		'site_url'                         => array( 'Jetpack_Sync_Functions', 'site_url' ),
204
		'home_url'                         => array( 'Jetpack_Sync_Functions', 'home_url' ),
205
		'single_user_site'                 => array( 'Jetpack', 'is_single_user_site' ),
206
		'updates'                          => array( 'Jetpack', 'get_updates' ),
207
		'has_file_system_write_access'     => array( 'Jetpack_Sync_Functions', 'file_system_write_access' ),
208
		'is_version_controlled'            => array( 'Jetpack_Sync_Functions', 'is_version_controlled' ),
209
		'taxonomies'                       => array( 'Jetpack_Sync_Functions', 'get_taxonomies' ),
210
		'post_types'                       => array( 'Jetpack_Sync_Functions', 'get_post_types' ),
211
		'post_type_features'               => array( 'Jetpack_Sync_Functions', 'get_post_type_features' ),
212
		'shortcodes'                       => array( 'Jetpack_Sync_Functions', 'get_shortcodes' ),
213
		'rest_api_allowed_post_types'      => array( 'Jetpack_Sync_Functions', 'rest_api_allowed_post_types' ),
214
		'rest_api_allowed_public_metadata' => array( 'Jetpack_Sync_Functions', 'rest_api_allowed_public_metadata' ),
215
		'sso_is_two_step_required'         => array( 'Jetpack_SSO_Helpers', 'is_two_step_required' ),
216
		'sso_should_hide_login_form'       => array( 'Jetpack_SSO_Helpers', 'should_hide_login_form' ),
217
		'sso_match_by_email'               => array( 'Jetpack_SSO_Helpers', 'match_by_email' ),
218
		'sso_new_user_override'            => array( 'Jetpack_SSO_Helpers', 'new_user_override' ),
219
		'sso_bypass_default_login_form'    => array( 'Jetpack_SSO_Helpers', 'bypass_login_forward_wpcom' ),
220
		'wp_version'                       => array( 'Jetpack_Sync_Functions', 'wp_version' ),
221
		'get_plugins'                      => array( 'Jetpack_Sync_Functions', 'get_plugins' ),
222
		'get_plugins_action_links'		   => array( 'Jetpack_Sync_functions', 'get_plugins_action_links' ),
223
		'active_modules'                   => array( 'Jetpack', 'get_active_modules' ),
224
		'hosting_provider'                 => array( 'Jetpack_Sync_Functions', 'get_hosting_provider' ),
225
		'locale'                           => 'get_locale',
226
		'site_icon_url'                    => array( 'Jetpack_Sync_Functions', 'site_icon_url' ),
227
		'roles'                            =>  array( 'Jetpack_Sync_Functions', 'roles' ),
228
	);
229
230
231
	static $default_post_type_attributes = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_post_type_attributes.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
232
		'name'                => '',
233
		'label'               => '',
234
		'labels'              => array(),
235
		'description'         => '',
236
		'public'              => false,
237
		'hierarchical'        => false,
238
		'exclude_from_search' => true,
239
		'publicly_queryable'  => null,
240
		'show_ui'             => false,
241
		'show_in_menu'        => null,
242
		'show_in_nav_menus'   => null,
243
		'show_in_admin_bar'   => false,
244
		'menu_position'       => null,
245
		'menu_icon'           => null,
246
		'supports'            => array(),
247
		'capability_type'     => 'post',
248
		'capabilities'        => array(),
249
		'cap'                 => array(),
250
		'map_meta_cap'        => true,
251
		'taxonomies'          => array(),
252
		'has_archive'         => false,
253
		'rewrite'             => true,
254
		'query_var'           => true,
255
		'can_export'          => true,
256
		'delete_with_user'    => null,
257
		'show_in_rest'        => false,
258
		'rest_base'           => false,
259
		'_builtin'            => false,
260
		'_edit_link'          => 'post.php?post=%d',
261
	);
262
263
	public static function get_callable_whitelist() {
264
		/**
265
		 * Filter the list of callables that are manageable via the JSON API.
266
		 *
267
		 * @module sync
268
		 *
269
		 * @since 4.8
270
		 *
271
		 * @param array The default list of callables.
272
		 */
273
		return apply_filters( 'jetpack_sync_callable_whitelist', self::$default_callable_whitelist );
274
	}
275
276
	static $blacklisted_post_types = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $blacklisted_post_types.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
277
		'ai1ec_event',
278
		'bwg_album',
279
		'bwg_gallery',
280
		'customize_changeset', // WP built-in post type for Customizer changesets
281
		'dn_wp_yt_log',
282
		'http',
283
		'idx_page',
284
		'jetpack_migration',
285
		'postman_sent_mail',
286
		'rssap-feed',
287
		'rssmi_feed_item',
288
		'secupress_log_action',
289
		'sg_optimizer_jobs',
290
		'snitch',
291
		'wpephpcompat_jobs',
292
		'wprss_feed_item',
293
		'wp_automatic',
294
		'jp_sitemap_master',
295
		'jp_sitemap',
296
		'jp_sitemap_index',
297
		'jp_img_sitemap',
298
		'jp_img_sitemap_index',
299
		'jp_vid_sitemap',
300
		'jp_vid_sitemap_index',
301
	);
302
303
	static $default_post_checksum_columns = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_post_checksum_columns.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
304
		'ID',
305
		'post_modified',
306
	);
307
308
	static $default_post_meta_checksum_columns = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_post_meta_checksum_columns.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
309
		'meta_id',
310
		'meta_value'
311
	);
312
313
	static $default_comment_checksum_columns = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_comment_checksum_columns.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
314
		'comment_ID',
315
		'comment_content',
316
	);
317
318
	static $default_comment_meta_checksum_columns = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_comment_meta_checksum_columns.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
319
		'meta_id',
320
		'meta_value'
321
	);
322
323
	static $default_option_checksum_columns = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_option_checksum_columns.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
324
		'option_name',
325
		'option_value',
326
	);
327
328
	static $default_multisite_callable_whitelist = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_multisite_callable_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
329
		'network_name'                        => array( 'Jetpack', 'network_name' ),
330
		'network_allow_new_registrations'     => array( 'Jetpack', 'network_allow_new_registrations' ),
331
		'network_add_new_users'               => array( 'Jetpack', 'network_add_new_users' ),
332
		'network_site_upload_space'           => array( 'Jetpack', 'network_site_upload_space' ),
333
		'network_upload_file_types'           => array( 'Jetpack', 'network_upload_file_types' ),
334
		'network_enable_administration_menus' => array( 'Jetpack', 'network_enable_administration_menus' ),
335
	);
336
337
	public static function get_multisite_callable_whitelist() {
338
		/**
339
		 * Filter the list of multisite callables that are manageable via the JSON API.
340
		 *
341
		 * @module sync
342
		 *
343
		 * @since 4.8
344
		 *
345
		 * @param array The default list of multisite callables.
346
		 */
347
		return apply_filters( 'jetpack_sync_multisite_callable_whitelist', self::$default_multisite_callable_whitelist );
348
	}
349
350
	static $post_meta_whitelist = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $post_meta_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
351
		'_feedback_akismet_values',
352
		'_feedback_email',
353
		'_feedback_extra_fields',
354
		'_g_feedback_shortcode',
355
		'_jetpack_post_thumbnail',
356
		'_menu_item_classes',
357
		'_menu_item_menu_item_parent',
358
		'_menu_item_object',
359
		'_menu_item_object_id',
360
		'_menu_item_orphaned',
361
		'_menu_item_type',
362
		'_menu_item_xfn',
363
		'_publicize_facebook_user',
364
		'_publicize_twitter_user',
365
		'_thumbnail_id',
366
		'_wp_attached_file',
367
		'_wp_attachment_backup_sizes',
368
		'_wp_attachment_context',
369
		'_wp_attachment_image_alt',
370
		'_wp_attachment_is_custom_background',
371
		'_wp_attachment_is_custom_header',
372
		'_wp_attachment_metadata',
373
		'_wp_page_template',
374
		'_wp_trash_meta_comments_status',
375
		'_wpas_mess',
376
		'content_width',
377
		'custom_css_add',
378
		'custom_css_preprocessor',
379
		'enclosure',
380
		'imagedata',
381
		'nova_price',
382
		'publicize_results',
383
		'sharing_disabled',
384
		'switch_like_status',
385
		'videopress_guid',
386
		'vimeo_poster_image',
387
		'advanced_seo_description', // Jetpack_SEO_Posts::DESCRIPTION_META_KEY
388
	);
389
390
	public static function get_post_meta_whitelist() {
391
		/**
392
		 * Filter the list of post meta data that are manageable via the JSON API.
393
		 *
394
		 * @module sync
395
		 *
396
		 * @since 4.8
397
		 *
398
		 * @param array The default list of meta data keys.
399
		 */
400
		return apply_filters( 'jetpack_sync_post_meta_whitelist', self::$post_meta_whitelist );
401
	}
402
403
	static $comment_meta_whitelist = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $comment_meta_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
404
		'hc_avatar',
405
		'hc_post_as',
406
		'hc_wpcom_id_sig',
407
		'hc_foreign_user_id'
408
	);
409
410
	public static function get_comment_meta_whitelist() {
411
		/**
412
		 * Filter the list of comment meta data that are manageable via the JSON API.
413
		 *
414
		 * @module sync
415
		 *
416
		 * @since 5.7.0
417
		 *
418
		 * @param array The default list of comment meta data keys.
419
		 */
420
		return apply_filters( 'jetpack_sync_comment_meta_whitelist', self::$comment_meta_whitelist );
421
	}
422
423
	// TODO: move this to server? - these are theme support values
0 ignored issues
show
Coding Style Best Practice introduced by
Comments for TODO tasks are often forgotten in the code; it might be better to use a dedicated issue tracker.
Loading history...
424
	// that should be synced as jetpack_current_theme_supports_foo option values
425
	static $default_theme_support_whitelist = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_theme_support_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
426
		'post-thumbnails',
427
		'post-formats',
428
		'custom-header',
429
		'custom-background',
430
		'custom-logo',
431
		'menus',
432
		'automatic-feed-links',
433
		'editor-style',
434
		'widgets',
435
		'html5',
436
		'title-tag',
437
		'jetpack-social-menu',
438
		'jetpack-responsive-videos',
439
		'infinite-scroll',
440
		'site-logo',
441
	);
442
443
	static function is_whitelisted_option( $option ) {
444
		foreach ( self::$default_options_whitelist as $whitelisted_option ) {
445
			if ( $whitelisted_option[0] === '/' && preg_match( $whitelisted_option, $option ) ) {
446
				return true;
447
			} elseif ( $whitelisted_option === $option ) {
448
				return true;
449
			}
450
		}
451
452
		return false;
453
	}
454
455
	static $default_capabilities_whitelist = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_capabilities_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
456
		'switch_themes',
457
		'edit_themes',
458
		'edit_theme_options',
459
		'install_themes',
460
		'activate_plugins',
461
		'edit_plugins',
462
		'install_plugins',
463
		'edit_users',
464
		'edit_files',
465
		'manage_options',
466
		'moderate_comments',
467
		'manage_categories',
468
		'manage_links',
469
		'upload_files',
470
		'import',
471
		'unfiltered_html',
472
		'edit_posts',
473
		'edit_others_posts',
474
		'edit_published_posts',
475
		'publish_posts',
476
		'edit_pages',
477
		'read',
478
		'publish_pages',
479
		'edit_others_pages',
480
		'edit_published_pages',
481
		'delete_pages',
482
		'delete_others_pages',
483
		'delete_published_pages',
484
		'delete_posts',
485
		'delete_others_posts',
486
		'delete_published_posts',
487
		'delete_private_posts',
488
		'edit_private_posts',
489
		'read_private_posts',
490
		'delete_private_pages',
491
		'edit_private_pages',
492
		'read_private_pages',
493
		'delete_users',
494
		'create_users',
495
		'unfiltered_upload',
496
		'edit_dashboard',
497
		'customize',
498
		'delete_site',
499
		'update_plugins',
500
		'delete_plugins',
501
		'update_themes',
502
		'update_core',
503
		'list_users',
504
		'remove_users',
505
		'add_users',
506
		'promote_users',
507
		'delete_themes',
508
		'export',
509
		'edit_comment',
510
		'upload_plugins',
511
		'upload_themes',
512
	);
513
514
	public static function get_capabilities_whitelist() {
515
		/**
516
		 * Filter the list of capabilities that we care about
517
		 *
518
		 * @module sync
519
		 *
520
		 * @since 5.5.0
521
		 *
522
		 * @param array The default list of capabilities.
523
		 */
524
		return apply_filters( 'jetpack_sync_capabilities_whitelist', self::$default_capabilities_whitelist );
525
	}
526
527
	static function get_max_sync_execution_time() {
528
		$max_exec_time = intval( ini_get( 'max_execution_time' ) );
529
		if ( 0 === $max_exec_time ) {
530
			// 0 actually means "unlimited", but let's not treat it that way
531
			$max_exec_time = 60;
532
		}
533
		return floor( $max_exec_time / 3 );
534
	}
535
536
	static $default_network_options_whitelist = array(
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_network_options_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
537
		'site_name',
538
		'jetpack_protect_key',
539
		'jetpack_protect_global_whitelist',
540
		'active_sitewide_plugins',
541
	);
542
543
	static $default_taxonomy_whitelist = array();
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_taxonomy_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
544
	static $default_dequeue_max_bytes = 500000; // very conservative value, 1/2 MB
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_dequeue_max_bytes.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
545
	static $default_upload_max_bytes = 600000; // a little bigger than the upload limit to account for serialization
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_upload_max_bytes.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
546
	static $default_upload_max_rows = 500;
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_upload_max_rows.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
547
	static $default_sync_wait_time = 10; // seconds, between syncs
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_sync_wait_time.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
548
	static $default_sync_wait_threshold = 5; // only wait before next send if the current send took more than X seconds
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_sync_wait_threshold.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
549
	static $default_enqueue_wait_time = 10; // wait between attempting to continue a full sync, via requests
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_enqueue_wait_time.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
550
	static $default_max_queue_size = 1000;
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_max_queue_size.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
551
	static $default_max_queue_lag = 900; // 15 minutes
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_max_queue_lag.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
552
	static $default_queue_max_writes_sec = 100; // 100 rows a second
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_queue_max_writes_sec.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
553
	static $default_post_types_blacklist = array();
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_post_types_blacklist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
554
	static $default_post_meta_whitelist = array();
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_post_meta_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
555
	static $default_comment_meta_whitelist = array();
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_comment_meta_whitelist.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
556
	static $default_disable = 0; // completely disable sending data to wpcom
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_disable.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
557
	static $default_sync_via_cron = 1; // use cron to sync
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_sync_via_cron.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
558
	static $default_render_filtered_content = 0; // render post_filtered_content
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_render_filtered_content.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
559
	static $default_max_enqueue_full_sync = 100; // max number of items to enqueue at a time when running full sync
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_max_enqueue_full_sync.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
560
	static $default_max_queue_size_full_sync = 1000; // max number of total items in the full sync queue
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_max_queue_size_full_sync.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
561
	static $default_sync_callables_wait_time = MINUTE_IN_SECONDS; // seconds before sending callables again
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_sync_callables_wait_time.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
562
	static $default_sync_constants_wait_time = HOUR_IN_SECONDS; // seconds before sending constants again
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_sync_constants_wait_time.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
563
	static $default_sync_queue_lock_timeout = 120; // 2 minutes
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_sync_queue_lock_timeout.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
564
	static $default_cron_sync_time_limit = 30; // 30 seconds
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $default_cron_sync_time_limit.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
565
}
566