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

Remove Settings > Performance menu item #41145

Merged
merged 9 commits into from
Jan 23, 2025
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Hides the calypso based Performance menu item on wordpress.com, shows page-optimize based Performance menu item on Atomic sites.
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,11 @@ public function add_options_menu() {
add_submenu_page( 'options-general.php', esc_attr__( 'Newsletter', 'jetpack-masterbar' ), __( 'Newsletter', 'jetpack-masterbar' ), 'manage_options', 'https://wordpress.com/settings/newsletter/' . $this->domain, null, 7 );
// @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
add_submenu_page( 'options-general.php', esc_attr__( 'Podcasting', 'jetpack-masterbar' ), __( 'Podcasting', 'jetpack-masterbar' ), 'manage_options', 'https://wordpress.com/settings/podcasting/' . $this->domain, null, 8 );
// @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
add_submenu_page( 'options-general.php', esc_attr__( 'Performance', 'jetpack-masterbar' ), __( 'Performance', 'jetpack-masterbar' ), 'manage_options', 'https://wordpress.com/settings/performance/' . $this->domain, null, 9 );

if ( function_exists( 'wpcom_is_duplicate_views_experiment_enabled' ) && ! wpcom_is_duplicate_views_experiment_enabled() ) {
// @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
add_submenu_page( 'options-general.php', esc_attr__( 'Performance', 'jetpack-masterbar' ), __( 'Performance', 'jetpack-masterbar' ), 'manage_options', 'https://wordpress.com/settings/performance/' . $this->domain, null, 9 );
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,13 @@ function_exists( 'wpcom_is_duplicate_views_experiment_enabled' ) &&
11
);

// Page Optimize is active by default on all Atomic sites and registers a Settings > Performance submenu which
// would conflict with our own Settings > Performance that links to Calypso, so we hide it it since the Calypso
// performance settings already have a link to Page Optimize settings page.
$this->hide_submenu_page( 'options-general.php', 'page-optimize' );
// The calypso based Performance screen is no longer linked from wp-admin and no longer conflicts with the Page Optimize "Performance"submenu item.
if ( function_exists( 'wpcom_is_duplicate_views_experiment_enabled' ) && ! wpcom_is_duplicate_views_experiment_enabled() ) {
// Page Optimize is active by default on all Atomic sites and registers a Settings > Performance submenu which
// would conflict with our own Settings > Performance that links to Calypso, so we hide it it since the Calypso
// performance settings already have a link to Page Optimize settings page.
$this->hide_submenu_page( 'options-general.php', 'page-optimize' );
}

// Hide Settings > Performance when the interface is set to wp-admin.
// This is due to these settings are mostly also available in Jetpack > Settings, in the Performance tab.
Expand Down
Loading