← All changes
|
jetpack_vendor/automattic/jetpack-sync/src/class-defaults.php
+143
-48
13.6.2
→
16.3-a.7
View file →
| @@ -77,21 +77,23 @@ | ||
| 77 | 77 | 'jetpack_autoupdate_translations', |
| 78 | 78 | 'jetpack_available_modules', |
| 79 | 79 | 'jetpack_comment_form_color_scheme', |
| 80 | 80 | 'jetpack_comment_likes_enabled', |
| 81 | - 'jetpack_connection_active_plugins', | |
| 82 | 81 | 'jetpack_excluded_extensions', |
| 82 | + 'jetpack_holiday_snow_enabled', | |
| 83 | 83 | 'jetpack_mailchimp', |
| 84 | 84 | 'jetpack_options', |
| 85 | 85 | 'jetpack_portfolio', |
| 86 | 86 | 'jetpack_portfolio_posts_per_page', |
| 87 | + 'jetpack_premium_analytics_enabled', | |
| 87 | 88 | 'jetpack_protect_global_whitelist', |
| 88 | 89 | 'jetpack_protect_key', |
| 89 | 90 | 'jetpack_publicize_options', |
| 90 | 91 | 'jetpack_relatedposts', |
| 92 | + 'jetpack_social_message_template', | |
| 91 | 93 | 'jetpack_social_notes_config', |
| 92 | 94 | 'jetpack_social_settings', |
| 93 | - 'jetpack_social_autoconvert_images', | |
| 95 | + 'jetpack_social_utm_settings', | |
| 94 | 96 | 'jetpack_sso_match_by_email', |
| 95 | 97 | 'jetpack_sso_require_two_step', |
| 96 | 98 | 'jetpack_sync_non_blocking', // is non-blocking Jetpack Sync flow enabled. |
| 97 | 99 | 'jetpack_sync_non_public_post_stati', |
| @@ -165,8 +167,11 @@ | ||
| 165 | 167 | 'uninstall_plugins', |
| 166 | 168 | 'uploads_use_yearmonth_folders', |
| 167 | 169 | 'users_can_register', |
| 168 | 170 | 'verification_services_codes', |
| 171 | + 'videopress_auto_subtitles_disabled', | |
| 172 | + 'videopress_player_preload_disabled', | |
| 173 | + 'videopress_playlist_index', | |
| 169 | 174 | 'videopress_private_enabled_for_site', |
| 170 | 175 | 'wordads_ccpa_enabled', |
| 171 | 176 | 'wordads_ccpa_privacy_policy_url', |
| 172 | 177 | 'wordads_cmp_enabled', |
| @@ -182,10 +187,14 @@ | ||
| 182 | 187 | 'wp_mobile_app_promos', |
| 183 | 188 | 'wp_mobile_excerpt', |
| 184 | 189 | 'wp_mobile_featured_images', |
| 185 | 190 | 'wp_page_for_privacy_policy', |
| 191 | + 'wpcom_ai_launchpad_completed', | |
| 192 | + 'wpcom_ai_launchpad_dismissed', | |
| 193 | + 'wpcom_ai_launchpad_enabled', | |
| 186 | 194 | 'wpcom_ai_site_prompt', |
| 187 | 195 | 'wpcom_classic_early_release', |
| 196 | + 'wpcom_newsletter_send_default', | |
| 188 | 197 | 'wpcom_featured_image_in_email', |
| 189 | 198 | 'jetpack_gravatar_in_email', |
| 190 | 199 | 'jetpack_author_in_email', |
| 191 | 200 | 'jetpack_post_date_in_email', |
| @@ -203,11 +212,18 @@ | ||
| 203 | 212 | 'jetpack_subscriptions_reply_to', |
| 204 | 213 | 'jetpack_subscriptions_from_name', |
| 205 | 214 | 'jetpack_verbum_subscription_modal', |
| 206 | 215 | 'jetpack_blocks_disabled', |
| 207 | - 'jetpack_package_versions', | |
| 208 | 216 | 'jetpack_newsletters_publishing_default_frequency', |
| 209 | 217 | 'jetpack_scheduled_plugins_update', |
| 218 | + 'jetpack_waf_automatic_rules', | |
| 219 | + 'jetpack_waf_ip_allow_list', | |
| 220 | + 'jetpack_waf_ip_allow_list_enabled', | |
| 221 | + 'jetpack_waf_ip_block_list', | |
| 222 | + 'jetpack_waf_ip_block_list_enabled', | |
| 223 | + 'jetpack_waf_share_data', | |
| 224 | + 'jetpack_waf_share_debug_data', | |
| 225 | + 'jetpack_waf_automatic_rules_last_updated_timestamp', | |
| 210 | 226 | ); |
| 211 | 227 | |
| 212 | 228 | /** |
| 213 | 229 | * Return options whitelist filtered. |
| @@ -316,39 +332,44 @@ | ||
| 316 | 332 | * |
| 317 | 333 | * @var array Default whitelist of callables. |
| 318 | 334 | */ |
| 319 | 335 | public static $default_callable_whitelist = array( |
| 320 | - 'get_loaded_extensions' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_loaded_extensions' ), | |
| 321 | - 'get_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins' ), | |
| 322 | - 'get_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_themes' ), | |
| 323 | - 'get_plugins_action_links' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins_action_links' ), | |
| 324 | - 'has_file_system_write_access' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'file_system_write_access' ), | |
| 325 | - 'home_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'home_url' ), | |
| 326 | - 'hosting_provider' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_hosting_provider' ), | |
| 327 | - 'is_fse_theme' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_is_fse_theme' ), | |
| 328 | - 'is_main_network' => array( __CLASS__, 'is_multi_network' ), | |
| 329 | - 'is_multi_site' => 'is_multisite', | |
| 330 | - 'is_version_controlled' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'is_version_controlled' ), | |
| 331 | - 'locale' => 'get_locale', | |
| 332 | - 'main_network_site' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'main_network_site_url' ), | |
| 333 | - 'main_network_site_wpcom_id' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'main_network_site_wpcom_id' ), | |
| 334 | - 'paused_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_plugins' ), | |
| 335 | - 'paused_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_themes' ), | |
| 336 | - 'post_type_features' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_post_type_features' ), | |
| 337 | - 'post_types' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_post_types' ), | |
| 338 | - 'rest_api_allowed_post_types' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'rest_api_allowed_post_types' ), | |
| 339 | - 'rest_api_allowed_public_metadata' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'rest_api_allowed_public_metadata' ), | |
| 340 | - 'roles' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'roles' ), | |
| 341 | - 'shortcodes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_shortcodes' ), | |
| 342 | - 'site_icon_url' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'site_icon_url' ), | |
| 343 | - 'site_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'site_url' ), | |
| 344 | - 'taxonomies' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_taxonomies' ), | |
| 345 | - 'theme_support' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_theme_support' ), | |
| 346 | - 'timezone' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_timezone' ), | |
| 347 | - 'wp_get_environment_type' => 'wp_get_environment_type', | |
| 348 | - 'wp_max_upload_size' => 'wp_max_upload_size', | |
| 349 | - 'wp_version' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'wp_version' ), | |
| 350 | - 'active_modules' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_active_modules' ), | |
| 336 | + 'get_loaded_extensions' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_loaded_extensions' ), | |
| 337 | + 'get_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins' ), | |
| 338 | + 'get_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_themes' ), | |
| 339 | + 'get_plugins_action_links' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_plugins_action_links' ), | |
| 340 | + 'has_file_system_write_access' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'file_system_write_access' ), | |
| 341 | + 'home_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'home_url' ), | |
| 342 | + 'hosting_provider' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_hosting_provider' ), | |
| 343 | + 'is_fse_theme' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_is_fse_theme' ), | |
| 344 | + 'is_main_network' => array( __CLASS__, 'is_multi_network' ), | |
| 345 | + 'is_multi_site' => 'is_multisite', | |
| 346 | + 'is_version_controlled' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'is_version_controlled' ), | |
| 347 | + 'locale' => 'get_locale', | |
| 348 | + 'main_network_site' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'main_network_site_url' ), | |
| 349 | + 'main_network_site_wpcom_id' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'main_network_site_wpcom_id' ), | |
| 350 | + 'paused_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_plugins' ), | |
| 351 | + 'paused_themes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_paused_themes' ), | |
| 352 | + 'post_type_features' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_post_type_features' ), | |
| 353 | + 'post_types' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_post_types' ), | |
| 354 | + 'rest_api_allowed_post_types' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'rest_api_allowed_post_types' ), | |
| 355 | + 'rest_api_allowed_public_metadata' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'rest_api_allowed_public_metadata' ), | |
| 356 | + 'roles' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'roles' ), | |
| 357 | + 'shortcodes' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_shortcodes' ), | |
| 358 | + 'site_icon_url' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'site_icon_url' ), | |
| 359 | + 'site_url' => array( 'Automattic\\Jetpack\\Connection\\Urls', 'site_url' ), | |
| 360 | + 'taxonomies' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_taxonomies' ), | |
| 361 | + 'theme_support' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_theme_support' ), | |
| 362 | + 'timezone' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_timezone' ), | |
| 363 | + 'wp_get_environment_type' => 'wp_get_environment_type', | |
| 364 | + 'wp_max_upload_size' => 'wp_max_upload_size', | |
| 365 | + 'wp_version' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'wp_version' ), | |
| 366 | + 'active_modules' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_active_modules' ), | |
| 367 | + 'jetpack_connection_active_plugins' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_jetpack_connection_active_plugins' ), | |
| 368 | + 'jetpack_package_versions' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_jetpack_package_versions' ), | |
| 369 | + 'jetpack_sync_active_modules' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_jetpack_sync_active_modules' ), | |
| 370 | + // Carries the `blog_public` value, but reports -1 when the site is private. | |
| 371 | + 'jetpack_site_visibility' => array( 'Automattic\\Jetpack\\Sync\\Functions', 'get_site_visibility' ), | |
| 351 | 372 | ); |
| 352 | 373 | |
| 353 | 374 | /** |
| 354 | 375 | * Array of post type attributes synced. |
| @@ -450,10 +471,16 @@ | ||
| 450 | 471 | 'wp_automatic', |
| 451 | 472 | 'wp_log', // WP Logging Plugin. |
| 452 | 473 | 'wpephpcompat_jobs', |
| 453 | 474 | 'wprss_feed_item', |
| 454 | - 'memberships_coupon', | |
| 455 | - 'memberships_gift', | |
| 475 | + 'tribe-ea-record', // The Events Calendar Plugin - Store Event Aggregator record information. | |
| 476 | + 'wphb_minify_group', // Hummingbird Plugin - Used internally to keep data about assets minification. | |
| 477 | + 'bigcommerce_task', // BigCommerce Plugin - Store import queue. | |
| 478 | + 'secupress_log_err404', // SecuPress Plugin - Log 404 pages | |
| 479 | + 'iw_omnibus_price_log', // Omnibus Plugin - Log price changes. | |
| 480 | + 'od_url_metrics', // Optimization Detective - Log URL metrics. | |
| 481 | + 'ap_outbox', // ActivityPub Outbox; only used for broadcasting ActivityPub activity to followers. | |
| 482 | + 'shop_order_placehold', // WooCommerce placeholder - Used to maintain compatibility and references when switching between WP Posts-based order storage and the newer HPOS tables. | |
| 456 | 483 | ); |
| 457 | 484 | |
| 458 | 485 | /** |
| 459 | 486 | * Taxonomies that we're not syncing by default. |
| @@ -754,13 +781,17 @@ | ||
| 754 | 781 | '_wp_attachment_image_alt', |
| 755 | 782 | '_wp_attachment_is_custom_background', |
| 756 | 783 | '_wp_attachment_is_custom_header', |
| 757 | 784 | '_wp_attachment_metadata', |
| 785 | + '_wp_old_date', | |
| 758 | 786 | '_wp_page_template', |
| 759 | 787 | '_wp_trash_meta_comments_status', |
| 760 | 788 | '_wpas_feature_enabled', |
| 789 | + '_wpas_connection_overrides', | |
| 790 | + '_wpas_customize_per_network', | |
| 761 | 791 | '_wpas_mess', |
| 762 | 792 | '_wpas_options', |
| 793 | + '_jetpack_social_image_focal_point', // Publicize_Base::ATTACHMENT_IMAGE_FOCAL_POINT. | |
| 763 | 794 | 'advanced_seo_description', // Jetpack_SEO_Posts::DESCRIPTION_META_KEY. |
| 764 | 795 | 'content_width', |
| 765 | 796 | 'custom_css_add', |
| 766 | 797 | 'custom_css_preprocessor', |
| @@ -772,8 +803,9 @@ | ||
| 772 | 803 | 'switch_like_status', |
| 773 | 804 | 'videopress_guid', |
| 774 | 805 | 'vimeo_poster_image', |
| 775 | 806 | '_jetpack_blogging_prompt_key', |
| 807 | + 'footnotes', // Core footnotes block | |
| 776 | 808 | ); |
| 777 | 809 | |
| 778 | 810 | /** |
| 779 | 811 | * Get the post meta key whitelist. |
| @@ -803,8 +835,12 @@ | ||
| 803 | 835 | 'hc_avatar', |
| 804 | 836 | 'hc_foreign_user_id', |
| 805 | 837 | 'hc_post_as', |
| 806 | 838 | 'hc_wpcom_id_sig', |
| 839 | + 'jetpack_comment_identity_avatar', | |
| 840 | + 'jetpack_comment_identity_id', | |
| 841 | + 'jetpack_comment_identity_provider', | |
| 842 | + 'protocol', | |
| 807 | 843 | ); |
| 808 | 844 | |
| 809 | 845 | /** |
| 810 | 846 | * Get the comment meta whitelist. |
| @@ -825,8 +861,34 @@ | ||
| 825 | 861 | return apply_filters( 'jetpack_sync_comment_meta_whitelist', self::$comment_meta_whitelist ); |
| 826 | 862 | } |
| 827 | 863 | |
| 828 | 864 | /** |
| 865 | + * Comment types whitelist. | |
| 866 | + * | |
| 867 | + * @var array Comment types that are synced. | |
| 868 | + */ | |
| 869 | + public static $comment_types_whitelist = array( '', 'comment', 'trackback', 'pingback', 'review', 'note' ); | |
| 870 | + | |
| 871 | + /** | |
| 872 | + * Get the comment types whitelist. | |
| 873 | + * | |
| 874 | + * @return array | |
| 875 | + */ | |
| 876 | + public static function get_comment_types_whitelist() { | |
| 877 | + /** | |
| 878 | + * Comment types present in this list will be synced to WordPress.com. | |
| 879 | + * | |
| 880 | + * @module sync | |
| 881 | + * | |
| 882 | + * @since 1.6.3 | |
| 883 | + * @since-jetpack 7.6.0 | |
| 884 | + * | |
| 885 | + * @param array A list of comment types. | |
| 886 | + */ | |
| 887 | + return apply_filters( 'jetpack_sync_whitelisted_comment_types', self::$comment_types_whitelist ); | |
| 888 | + } | |
| 889 | + | |
| 890 | + /** | |
| 829 | 891 | * Default theme support whitelist. |
| 830 | 892 | * |
| 831 | 893 | * @todo move this to server? - these are theme support values |
| 832 | 894 | * that should be synced as jetpack_current_theme_supports_foo option values |
| @@ -1169,8 +1231,15 @@ | ||
| 1169 | 1231 | */ |
| 1170 | 1232 | public static $default_comment_meta_whitelist = array(); |
| 1171 | 1233 | |
| 1172 | 1234 | /** |
| 1235 | + * Default for sync actions blacklist. | |
| 1236 | + * | |
| 1237 | + * @var array Empty array. | |
| 1238 | + */ | |
| 1239 | + public static $default_sync_actions_blacklist = array(); | |
| 1240 | + | |
| 1241 | + /** | |
| 1173 | 1242 | * Default for disabling sync across the site. |
| 1174 | 1243 | * |
| 1175 | 1244 | * @var int Bool-ish. Default to 0. |
| 1176 | 1245 | */ |
| @@ -1280,46 +1349,63 @@ | ||
| 1280 | 1349 | * |
| 1281 | 1350 | * @var array list of module names. |
| 1282 | 1351 | */ |
| 1283 | 1352 | public static $default_full_sync_config = array( |
| 1284 | - 'comments' => 1, | |
| 1285 | 1353 | 'constants' => 1, |
| 1286 | 1354 | 'functions' => 1, |
| 1287 | 1355 | 'options' => 1, |
| 1288 | - 'posts' => 1, | |
| 1289 | - 'term_relationships' => 1, | |
| 1290 | 1356 | 'terms' => 1, |
| 1291 | 1357 | 'themes' => 1, |
| 1358 | + 'users' => 1, | |
| 1359 | + 'posts' => 1, | |
| 1360 | + 'comments' => 1, | |
| 1292 | 1361 | 'updates' => 1, |
| 1293 | - 'users' => 1, | |
| 1362 | + 'term_relationships' => 1, | |
| 1294 | 1363 | ); |
| 1295 | 1364 | |
| 1296 | 1365 | /** |
| 1366 | + * Default Full Sync limits for one module. | |
| 1367 | + * | |
| 1368 | + * @var array list of limits. | |
| 1369 | + */ | |
| 1370 | + public static $default_full_sync_limits_per_module = array( | |
| 1371 | + 'chunk_size' => 100, | |
| 1372 | + 'max_chunks' => 10, | |
| 1373 | + ); | |
| 1374 | + /** | |
| 1297 | 1375 | * Default Full Sync max objects to send on a single request. |
| 1298 | 1376 | * |
| 1299 | 1377 | * @var array list of module => max. |
| 1300 | 1378 | */ |
| 1301 | 1379 | public static $default_full_sync_limits = array( |
| 1302 | - 'comments' => array( | |
| 1380 | + 'comments' => array( | |
| 1303 | 1381 | 'chunk_size' => 100, |
| 1304 | 1382 | 'max_chunks' => 10, |
| 1305 | 1383 | ), |
| 1306 | - 'posts' => array( | |
| 1307 | - 'chunk_size' => 100, | |
| 1384 | + 'posts' => array( | |
| 1385 | + 'chunk_size' => 500, | |
| 1308 | 1386 | 'max_chunks' => 1, |
| 1309 | 1387 | ), |
| 1310 | - 'term_relationships' => array( | |
| 1388 | + 'term_relationships' => array( | |
| 1311 | 1389 | 'chunk_size' => 1000, |
| 1312 | 1390 | 'max_chunks' => 10, |
| 1313 | 1391 | ), |
| 1314 | - 'terms' => array( | |
| 1392 | + 'terms' => array( | |
| 1315 | 1393 | 'chunk_size' => 1000, |
| 1316 | 1394 | 'max_chunks' => 10, |
| 1317 | 1395 | ), |
| 1318 | - 'users' => array( | |
| 1396 | + 'users' => array( | |
| 1319 | 1397 | 'chunk_size' => 100, |
| 1320 | 1398 | 'max_chunks' => 10, |
| 1321 | 1399 | ), |
| 1400 | + 'woocommerce' => array( | |
| 1401 | + 'chunk_size' => 100, | |
| 1402 | + 'max_chunks' => 10, | |
| 1403 | + ), | |
| 1404 | + 'woocommerce_hpos_orders' => array( | |
| 1405 | + 'chunk_size' => 100, | |
| 1406 | + 'max_chunks' => 10, | |
| 1407 | + ), | |
| 1322 | 1408 | ); |
| 1323 | 1409 | |
| 1324 | 1410 | /** |
| 1325 | 1411 | * Default for enabling dedicated Sync flow. |
| @@ -1337,8 +1423,17 @@ | ||
| 1337 | 1423 | |
| 1338 | 1424 | /** |
| 1339 | 1425 | * Default for enabling wpcom rest api for Sync. |
| 1340 | 1426 | * |
| 1341 | - * @var int Bool-ish. Default 0. | |
| 1427 | + * @var int Bool-ish. Default 1. | |
| 1342 | 1428 | */ |
| 1343 | - public static $default_wpcom_rest_api_enabled = 0; | |
| 1429 | + public static $default_wpcom_rest_api_enabled = 1; | |
| 1430 | + | |
| 1431 | + /** | |
| 1432 | + * A list of 'jetpack_options' specific keys we want to ignore. | |
| 1433 | + * | |
| 1434 | + * @var array | |
| 1435 | + */ | |
| 1436 | + public static $jetpack_options_blacklist = array( | |
| 1437 | + 'last_heartbeat', | |
| 1438 | + ); | |
| 1344 | 1439 | } |