Skip to content

Commit

Permalink
Minileven: add options back as they still exist on sites
Browse files Browse the repository at this point in the history
This is a follow-up to #14714.
After removing those options, we started seeing errors like this one on sites:
PHP Warning: Invalid Jetpack option name: wp_mobile_excerpt

Since these Jetpack options are still valid options even if the feature is gone, let's keep them around.
  • Loading branch information
jeherve committed Feb 21, 2020
1 parent ce86eb8 commit 523f4ed
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 134 deletions.
3 changes: 3 additions & 0 deletions packages/options/legacy/class-jetpack-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ public static function get_all_wp_options() {
'disabled_likes',
'disabled_reblogs',
'jetpack_comments_likes_enabled',
'wp_mobile_excerpt',
'wp_mobile_featured_images',
'wp_mobile_app_promos',
'stats_options',
'stats_dashboard_widget',
'safecss_preview_rev',
Expand Down
3 changes: 3 additions & 0 deletions packages/sync/src/class-defaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ class Defaults {
'gravatar_disable_hovercards',
'infinite_scroll',
'infinite_scroll_google_analytics',
'wp_mobile_excerpt',
'wp_mobile_featured_images',
'wp_mobile_app_promos',
'monitor_receive_notifications',
'post_by_email_address',
'jetpack_mailchimp',
Expand Down
276 changes: 142 additions & 134 deletions tests/php/sync/test_class.jetpack-sync-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,140 +60,148 @@ public function test_sync_default_options() {
$this->setSyncClientDefaults();
// check that these values exists in the whitelist options
$options = array(
'stylesheet' => 'test',
'blogname' => 'test',
'blogdescription' => 'banana',
'blog_charset' => 'stuffs',
'permalink_structure' => '%postname%',
'category_base' => 'orange',
'tag_base' => 'apple',
'comment_moderation' => true,
'default_comment_status' => 'kiwi',
'thread_comments' => 0,
'thread_comments_depth' => 2,
'social_notifications_like' => 'test',
'page_on_front' => false,
'rss_use_excerpt' => false,
'subscription_options' => 'pineapple',
'stb_enabled' => true,
'stc_enabled' => false,
'comment_registration' => 'pineapple',
'show_avatars' => 'pineapple',
'avatar_default' => 'pineapple',
'avatar_rating' => 'pineapple',
'highlander_comment_form_prompt' => 'pineapple',
'jetpack_comment_form_color_scheme' => 'pineapple',
'stats_options' => 'pineapple',
'gmt_offset' => 1,
'timezone_string' => 'America/Anchorage',
'jetpack_sync_non_public_post_stati' => 'pineapple',
'jetpack_options' => array( 'food' => 'pineapple' ),
'site_icon' => '1',
'default_post_format' => 'pineapple',
'default_category' => 0,
'large_size_w' => 1000,
'large_size_h' => 2000,
'thumbnail_size_w' => 1000,
'thumbnail_size_h' => 9999,
'medium_size_w' => 200,
'medium_size_h' => 200,
'thumbnail_crop' => 'pineapple',
'image_default_link_type' => 'pineapple',
'site_logo' => 1,
'sharing-options' => 'pineapple',
'sharing-services' => 'pineapple',
'post_count' => 'pineapple',
'default_ping_status' => 'pineapple',
'sticky_posts' => 'pineapple',
'blog_public' => 0,
'default_pingback_flag' => 'pineapple',
'require_name_email' => 'pineapple',
'close_comments_for_old_posts' => 'pineapple',
'close_comments_days_old' => 99,
'page_comments' => 'pineapple',
'comments_per_page' => 99,
'default_comments_page' => 'pineapple',
'comment_order' => 'pineapple',
'comments_notify' => 'pineapple',
'moderation_notify' => 'pineapple',
'social_notifications_reblog' => 'pineapple',
'social_notifications_subscribe' => 'pineapple',
'comment_whitelist' => 'pineapple',
'comment_max_links' => 99,
'moderation_keys' => 'pineapple',
'jetpack_wga' => 'pineapple',
'disabled_likes' => 'pineapple',
'disabled_reblogs' => 'pineapple',
'jetpack_comment_likes_enabled' => 'pineapple',
'twitter_via' => 'pineapple',
'jetpack-twitter-cards-site-tag' => 'pineapple',
'wpcom_publish_posts_with_markdown' => 'pineapple',
'wpcom_publish_comments_with_markdown' => 'pineapple',
'jetpack_activated' => 'pineapple',
'jetpack_allowed_xsite_search_ids' => array( 99 ),
'jetpack_available_modules' => 'pineapple',
'jetpack_autoupdate_plugins' => 'pineapple',
'jetpack_autoupdate_plugins_translations' => 'pineapple',
'jetpack_autoupdate_themes' => 'pineapple',
'jetpack_autoupdate_themes_translations' => 'pineapple',
'jetpack_autoupdate_core' => 'pineapple',
'jetpack_autoupdate_translations' => 'pineapple',
'carousel_background_color' => 'pineapple',
'carousel_display_exif' => 'pineapple',
'jetpack_portfolio' => 'pineapple',
'jetpack_portfolio_posts_per_page' => 'pineapple',
'jetpack_testimonial' => 'pineapple',
'jetpack_testimonial_posts_per_page' => 'pineapple',
'tiled_galleries' => 'pineapple',
'gravatar_disable_hovercards' => 'pineapple',
'infinite_scroll' => 'pineapple',
'infinite_scroll_google_analytics' => 'pineapple',
'monitor_receive_notifications' => 'pineapple',
'post_by_email_address' => 'pineapple',
'jetpack_mailchimp' => '{}',
'jetpack_protect_key' => 'pineapple',
'jetpack_protect_global_whitelist' => 'pineapple',
'jetpack_sso_require_two_step' => '1',
'jetpack_sso_match_by_email' => '1',
'jetpack_relatedposts' => 'pineapple',
'verification_services_codes' => 'pineapple',
'users_can_register' => '1',
'active_plugins' => array( 'pineapple' ),
'uninstall_plugins' => 'banana',
'advanced_seo_front_page_description' => 'banana', // Jetpack_SEO_Utils::FRONT_PAGE_META_OPTION
'advanced_seo_title_formats' => array( 'posts' => array( 'type' => 'string', 'value' => 'test' ) ), // Jetpack_SEO_Titles::TITLE_FORMATS_OPTION
'jetpack_api_cache_enabled' => '1',
'sidebars_widgets' => array( 'array_version' => 3 ),
'start_of_week' => '0',
'blacklist_keys' => '',
'posts_per_page' => '1',
'posts_per_rss' => '1',
'show_on_front' => '0',
'ping_sites' => false,
'uploads_use_yearmonth_folders' => '0',
'date_format' => '0',
'time_format' => '0',
'admin_email' => 'banana@example.org',
'new_admin_email' => 'banana@example.net',
'default_email_category' => '2',
'default_role' => 'contributor',
'page_for_posts' => '2',
'mailserver_url' => 'pineapple.example.com',
'mailserver_login' => '',
'mailserver_pass' => '',
'mailserver_port' => 1,
'wp_page_for_privacy_policy' => false,
'enable_header_ad' => '1',
'wordads_second_belowpost' => '1',
'wordads_display_front_page' => '1',
'wordads_display_post' => '1',
'wordads_display_page' => '1',
'wordads_display_archive' => '1',
'wordads_custom_adstxt' => 'pineapple',
'site_user_type' => wp_json_encode( array( 1 => 'pineapple' ) ),
'site_segment' => 'pineapple',
'site_vertical' => 'pineapple',
'jetpack_excluded_extensions' => 'pineapple',
'stylesheet' => 'test',
'blogname' => 'test',
'blogdescription' => 'banana',
'blog_charset' => 'stuffs',
'permalink_structure' => '%postname%',
'category_base' => 'orange',
'tag_base' => 'apple',
'comment_moderation' => true,
'default_comment_status' => 'kiwi',
'thread_comments' => 0,
'thread_comments_depth' => 2,
'social_notifications_like' => 'test',
'page_on_front' => false,
'rss_use_excerpt' => false,
'subscription_options' => 'pineapple',
'stb_enabled' => true,
'stc_enabled' => false,
'comment_registration' => 'pineapple',
'show_avatars' => 'pineapple',
'avatar_default' => 'pineapple',
'avatar_rating' => 'pineapple',
'highlander_comment_form_prompt' => 'pineapple',
'jetpack_comment_form_color_scheme' => 'pineapple',
'stats_options' => 'pineapple',
'gmt_offset' => 1,
'timezone_string' => 'America/Anchorage',
'jetpack_sync_non_public_post_stati' => 'pineapple',
'jetpack_options' => array( 'food' => 'pineapple' ),
'site_icon' => '1',
'default_post_format' => 'pineapple',
'default_category' => 0,
'large_size_w' => 1000,
'large_size_h' => 2000,
'thumbnail_size_w' => 1000,
'thumbnail_size_h' => 9999,
'medium_size_w' => 200,
'medium_size_h' => 200,
'thumbnail_crop' => 'pineapple',
'image_default_link_type' => 'pineapple',
'site_logo' => 1,
'sharing-options' => 'pineapple',
'sharing-services' => 'pineapple',
'post_count' => 'pineapple',
'default_ping_status' => 'pineapple',
'sticky_posts' => 'pineapple',
'blog_public' => 0,
'default_pingback_flag' => 'pineapple',
'require_name_email' => 'pineapple',
'close_comments_for_old_posts' => 'pineapple',
'close_comments_days_old' => 99,
'page_comments' => 'pineapple',
'comments_per_page' => 99,
'default_comments_page' => 'pineapple',
'comment_order' => 'pineapple',
'comments_notify' => 'pineapple',
'moderation_notify' => 'pineapple',
'social_notifications_reblog' => 'pineapple',
'social_notifications_subscribe' => 'pineapple',
'comment_whitelist' => 'pineapple',
'comment_max_links' => 99,
'moderation_keys' => 'pineapple',
'jetpack_wga' => 'pineapple',
'disabled_likes' => 'pineapple',
'disabled_reblogs' => 'pineapple',
'jetpack_comment_likes_enabled' => 'pineapple',
'twitter_via' => 'pineapple',
'jetpack-twitter-cards-site-tag' => 'pineapple',
'wpcom_publish_posts_with_markdown' => 'pineapple',
'wpcom_publish_comments_with_markdown' => 'pineapple',
'jetpack_activated' => 'pineapple',
'jetpack_allowed_xsite_search_ids' => array( 99 ),
'jetpack_available_modules' => 'pineapple',
'jetpack_autoupdate_plugins' => 'pineapple',
'jetpack_autoupdate_plugins_translations' => 'pineapple',
'jetpack_autoupdate_themes' => 'pineapple',
'jetpack_autoupdate_themes_translations' => 'pineapple',
'jetpack_autoupdate_core' => 'pineapple',
'jetpack_autoupdate_translations' => 'pineapple',
'carousel_background_color' => 'pineapple',
'carousel_display_exif' => 'pineapple',
'jetpack_portfolio' => 'pineapple',
'jetpack_portfolio_posts_per_page' => 'pineapple',
'jetpack_testimonial' => 'pineapple',
'jetpack_testimonial_posts_per_page' => 'pineapple',
'tiled_galleries' => 'pineapple',
'gravatar_disable_hovercards' => 'pineapple',
'infinite_scroll' => 'pineapple',
'infinite_scroll_google_analytics' => 'pineapple',
'wp_mobile_excerpt' => 'pineapple',
'wp_mobile_featured_images' => 'pineapple',
'wp_mobile_app_promos' => 'pineapple',
'monitor_receive_notifications' => 'pineapple',
'post_by_email_address' => 'pineapple',
'jetpack_mailchimp' => '{}',
'jetpack_protect_key' => 'pineapple',
'jetpack_protect_global_whitelist' => 'pineapple',
'jetpack_sso_require_two_step' => '1',
'jetpack_sso_match_by_email' => '1',
'jetpack_relatedposts' => 'pineapple',
'verification_services_codes' => 'pineapple',
'users_can_register' => '1',
'active_plugins' => array( 'pineapple' ),
'uninstall_plugins' => 'banana',
'advanced_seo_front_page_description' => 'banana', // Jetpack_SEO_Utils::FRONT_PAGE_META_OPTION.
'advanced_seo_title_formats' => array(
'posts' => array(
'type' => 'string',
'value' => 'test',
),
), // Jetpack_SEO_Titles::TITLE_FORMATS_OPTION.
'jetpack_api_cache_enabled' => '1',
'sidebars_widgets' => array( 'array_version' => 3 ),
'start_of_week' => '0',
'blacklist_keys' => '',
'posts_per_page' => '1',
'posts_per_rss' => '1',
'show_on_front' => '0',
'ping_sites' => false,
'uploads_use_yearmonth_folders' => '0',
'date_format' => '0',
'time_format' => '0',
'admin_email' => 'banana@example.org',
'new_admin_email' => 'banana@example.net',
'default_email_category' => '2',
'default_role' => 'contributor',
'page_for_posts' => '2',
'mailserver_url' => 'pineapple.example.com',
'mailserver_login' => '',
'mailserver_pass' => '',
'mailserver_port' => 1,
'wp_page_for_privacy_policy' => false,
'enable_header_ad' => '1',
'wordads_second_belowpost' => '1',
'wordads_display_front_page' => '1',
'wordads_display_post' => '1',
'wordads_display_page' => '1',
'wordads_display_archive' => '1',
'wordads_custom_adstxt' => 'pineapple',
'site_user_type' => wp_json_encode( array( 1 => 'pineapple' ) ),
'site_segment' => 'pineapple',
'site_vertical' => 'pineapple',
'jetpack_excluded_extensions' => 'pineapple',
'jetpack-memberships-connected-account-id' => '340',
);

Expand Down

0 comments on commit 523f4ed

Please sign in to comment.