From ad3f35663e4e2b80a92166b590d3e2052b5aab91 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Tue, 23 Aug 2016 20:02:23 -0400 Subject: Update plugin jetpack to 4.2.2 --- .../jetpack/sync/class.jetpack-sync-defaults.php | 276 +++++++++++++++++++++ 1 file changed, 276 insertions(+) create mode 100644 plugins/jetpack/sync/class.jetpack-sync-defaults.php (limited to 'plugins/jetpack/sync/class.jetpack-sync-defaults.php') diff --git a/plugins/jetpack/sync/class.jetpack-sync-defaults.php b/plugins/jetpack/sync/class.jetpack-sync-defaults.php new file mode 100644 index 00000000..f08a8268 --- /dev/null +++ b/plugins/jetpack/sync/class.jetpack-sync-defaults.php @@ -0,0 +1,276 @@ + 'wp_max_upload_size', + 'is_main_network' => array( 'Jetpack', 'is_multi_network' ), + 'is_multi_site' => 'is_multisite', + 'main_network_site' => array( 'Jetpack_Sync_Functions', 'main_network_site_url' ), + 'site_url' => array( 'Jetpack_Sync_Functions', 'site_url' ), + 'home_url' => array( 'Jetpack_Sync_Functions', 'home_url' ), + 'single_user_site' => array( 'Jetpack', 'is_single_user_site' ), + 'updates' => array( 'Jetpack', 'get_updates' ), + 'has_file_system_write_access' => array( 'Jetpack_Sync_Functions', 'file_system_write_access' ), + 'is_version_controlled' => array( 'Jetpack_Sync_Functions', 'is_version_controlled' ), + 'taxonomies' => array( 'Jetpack_Sync_Functions', 'get_taxonomies' ), + 'post_types' => array( 'Jetpack_Sync_Functions', 'get_post_types' ), + 'post_type_features' => array( 'Jetpack_Sync_Functions', 'get_post_type_features' ), + 'rest_api_allowed_post_types' => array( 'Jetpack_Sync_Functions', 'rest_api_allowed_post_types' ), + 'rest_api_allowed_public_metadata' => array( 'Jetpack_Sync_Functions', 'rest_api_allowed_public_metadata' ), + 'sso_is_two_step_required' => array( 'Jetpack_SSO_Helpers', 'is_two_step_required' ), + 'sso_should_hide_login_form' => array( 'Jetpack_SSO_Helpers', 'should_hide_login_form' ), + 'sso_match_by_email' => array( 'Jetpack_SSO_Helpers', 'match_by_email' ), + 'sso_new_user_override' => array( 'Jetpack_SSO_Helpers', 'new_user_override' ), + 'sso_bypass_default_login_form' => array( 'Jetpack_SSO_Helpers', 'bypass_login_forward_wpcom' ), + 'wp_version' => array( 'Jetpack_Sync_Functions', 'wp_version' ), + 'get_plugins' => array( 'Jetpack_Sync_Functions', 'get_plugins' ), + 'active_modules' => array( 'Jetpack', 'get_active_modules' ), + ); + + static $blacklisted_post_types = array( + 'ai1ec_event', + 'snitch', + ); + + static $default_post_checksum_columns = array( + 'ID', + 'post_modified', + ); + + static $default_comment_checksum_columns = array( + 'comment_ID', + 'comment_content', + ); + + static $default_option_checksum_columns = array( + 'option_name', + 'option_value', + ); + + static $default_multisite_callable_whitelist = array( + 'network_name' => array( 'Jetpack', 'network_name' ), + 'network_allow_new_registrations' => array( 'Jetpack', 'network_allow_new_registrations' ), + 'network_add_new_users' => array( 'Jetpack', 'network_add_new_users' ), + 'network_site_upload_space' => array( 'Jetpack', 'network_site_upload_space' ), + 'network_upload_file_types' => array( 'Jetpack', 'network_upload_file_types' ), + 'network_enable_administration_menus' => array( 'Jetpack', 'network_enable_administration_menus' ), + ); + + + static $default_whitelist_meta_keys = array( + '_wp_attachment_metadata', + '_thumbnail_id', + '_wpas_mess', + '_wpas_skip_', + '_g_feedback_shortcode', + '_feedback_extra_fields', + '_feedback_akismet_values', + '_publicize_facebook_user', + '_wp_attachment_image_alt', + '_jetpack_post_thumbnail', + '_thumbnail_id', + '_wp_attachment_metadata', + '_wp_page_template', + '_publicize_twitter_user', + '_wp_trash_meta_comments_status', + ); + + static $default_blacklist_meta_keys = array( + 'post_views_count', + 'Views', + 'tve_leads_impressions', + 'views', + 'scc_share_count_crawldate', + 'wprss_last_update', + 'wprss_feed_is_updating', + 'snapFB', + 'syndication_item_hash', + 'phonenumber_spellings', + 'tmac_last_id', + 'opanda_imperessions', + 'administer_stats', + 'spec_ads_views', + 'snp_views', + 'mip_post_views_count', + 'esml_socialcount_LAST_UPDATED', + 'wprss_last_update_items', + ); + + // TODO: move this to server? - these are theme support values + // that should be synced as jetpack_current_theme_supports_foo option values + static $default_theme_support_whitelist = array( + 'post-thumbnails', + 'post-formats', + 'custom-header', + 'custom-background', + 'custom-logo', + 'menus', + 'automatic-feed-links', + 'editor-style', + 'widgets', + 'html5', + 'title-tag', + 'jetpack-social-menu', + 'jetpack-responsive-videos', + 'infinite-scroll', + 'site-logo', + ); + + static function is_whitelisted_option( $option ) { + foreach ( self::$default_options_whitelist as $whitelisted_option ) { + if ( $whitelisted_option[0] === '/' && preg_match( $whitelisted_option, $option ) ) { + return true; + } elseif ( $whitelisted_option === $option ) { + return true; + } + } + + return false; + } + + static $default_network_options_whitelist = array( + 'site_name', + 'jetpack_protect_key', + 'jetpack_protect_global_whitelist', + 'active_sitewide_plugins', + ); + static $default_taxonomy_whitelist = array(); + static $default_dequeue_max_bytes = 500000; // very conservative value, 1/2 MB + static $default_upload_max_bytes = 600000; // a little bigger than the upload limit to account for serialization + static $default_upload_max_rows = 500; + static $default_sync_wait_time = 10; // seconds, between syncs + static $default_sync_wait_threshold = 5; // only wait before next send if the current send took more than X seconds + static $default_max_queue_size = 1000; + static $default_max_queue_lag = 900; // 15 minutes + static $default_queue_max_writes_sec = 100; // 100 rows a second + static $default_post_types_blacklist = array(); + static $default_meta_blacklist = array(); + static $default_disable = 0; // completely disable sending data to wpcom + static $default_sync_callables_wait_time = MINUTE_IN_SECONDS; // seconds before sending callables again + static $default_sync_constants_wait_time = HOUR_IN_SECONDS; // seconds before sending constants again +} -- cgit v1.2.3-65-gdbad