Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minileven: add options back as they still exist on sites #14756

Merged
merged 4 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions class.jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,18 +435,27 @@ function plugin_upgrade() {
update_option( 'wpcom_publish_posts_with_markdown', true );
}

// Minileven deprecation. 8.3.0.
if ( get_option( 'wp_mobile_custom_css' ) ) {
delete_option( 'wp_mobile_custom_css' );
}
if ( Jetpack_Options::get_option( 'wp_mobile_excerpt' ) ) {
Jetpack_Options::delete_option( 'wp_mobile_excerpt' );
}
if ( Jetpack_Options::get_option( 'wp_mobile_featured_images' ) ) {
Jetpack_Options::delete_option( 'wp_mobile_featured_images' );
}
if ( Jetpack_Options::get_option( 'wp_mobile_app_promos' ) ) {
Jetpack_Options::delete_option( 'wp_mobile_app_promos' );
/*
* Minileven deprecation. 8.3.0.
* Only delete options if not using
* the replacement standalone Minileven plugin.
*/
if (
! self::is_plugin_active( 'minileven-master/minileven.php' )
&& ! self::is_plugin_active( 'minileven/minileven.php' )
) {
if ( get_option( 'wp_mobile_custom_css' ) ) {
delete_option( 'wp_mobile_custom_css' );
}
if ( get_option( 'wp_mobile_excerpt' ) ) {
delete_option( 'wp_mobile_excerpt' );
}
if ( get_option( 'wp_mobile_featured_images' ) ) {
delete_option( 'wp_mobile_featured_images' );
}
if ( get_option( 'wp_mobile_app_promos' ) ) {
delete_option( 'wp_mobile_app_promos' );
}
}

if ( did_action( 'wp_loaded' ) ) {
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