Skip to content

Commit 7a706d4

Browse files
Untangling: Rename Vaultpress to Backup admin menu on WPCOM (#44181)
* Untangling: Rename Vaultpress to Backup * Update the position * Fix linting * Remove test
1 parent 7e48ed4 commit 7a706d4

File tree

6 files changed

+23
-36
lines changed

6 files changed

+23
-36
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Rename Jetpack > Vaultpress to Jetpack > Backup admin menu for WPCOM sites
4+
5+

projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-menu/wpcom-admin-menu.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ function wpcom_add_untangled_jetpack_menu() {
211211
$domain = wp_parse_url( home_url(), PHP_URL_HOST );
212212

213213
wpcom_hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'calypso-scanner' ) ) );
214+
wpcom_hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'calypso-backups' ) ) );
214215

215216
Jetpack_Admin_UI_Admin::add_menu(
216217
esc_attr__( 'Scan', 'jetpack-mu-wpcom' ),
@@ -223,6 +224,18 @@ function wpcom_add_untangled_jetpack_menu() {
223224
null,
224225
5
225226
);
227+
228+
Jetpack_Admin_UI_Admin::add_menu(
229+
esc_attr__( 'Backup', 'jetpack-mu-wpcom' ),
230+
__( 'Backup', 'jetpack-mu-wpcom' ),
231+
'manage_options',
232+
'https://wordpress.com/backup/' . $domain,
233+
/**
234+
* Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
235+
*/
236+
null,
237+
4
238+
);
226239
}
227240

228241
add_action( 'admin_menu', 'wpcom_add_untangled_jetpack_menu', 999 );
@@ -251,12 +264,10 @@ function wpcom_add_jetpack_submenu() {
251264
// Hide submenu items that link to Jetpack Cloud.
252265
wpcom_hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'cloud-activity-log-wp-menu', array( 'site' => $blog_id ) ) ) );
253266
wpcom_hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'cloud-scan-history-wp-menu' ) ) );
254-
wpcom_hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'calypso-backups' ) ) );
255267
wpcom_hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'jetpack-menu-jetpack-manage-subscribers', array( 'site' => $blog_id ) ) ) );
256268

257269
$domain = wp_parse_url( home_url(), PHP_URL_HOST );
258270
$activity_log_url = 'https://wordpress.com/activity-log/' . $domain;
259-
$vaultpress_url = 'https://wordpress.com/backup/' . $domain;
260271
$monetize_url = 'https://wordpress.com/earn/' . $domain;
261272
$subscribers_url = 'https://wordpress.com/subscribers/' . $domain;
262273
$newsletter_url = 'https://wordpress.com/settings/newsletter/' . $domain;
@@ -272,15 +283,6 @@ function wpcom_add_jetpack_submenu() {
272283
null // @phan-suppress-current-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
273284
);
274285

275-
add_submenu_page(
276-
'jetpack',
277-
__( 'VaultPress', 'jetpack-mu-wpcom' ),
278-
__( 'VaultPress', 'jetpack-mu-wpcom' ),
279-
'manage_options',
280-
$vaultpress_url,
281-
null // @phan-suppress-current-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
282-
);
283-
284286
add_submenu_page(
285287
'jetpack',
286288
__( 'Monetize', 'jetpack-mu-wpcom' ),
@@ -335,7 +337,6 @@ function wpcom_add_jetpack_submenu() {
335337
'my-jetpack',
336338
'stats',
337339
$activity_log_url,
338-
$vaultpress_url,
339340
'akismet-key-config',
340341
'jetpack-search',
341342
$monetize_url,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: changed
3+
Comment: Rename Jetpack > Vaultpress to Jetpack > Backup admin menu for WPCOM sites
4+
5+

projects/packages/masterbar/src/admin-menu/class-admin-menu.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Automattic\Jetpack\Admin_UI\Admin_Menu as Jetpack_Admin_UI_Admin;
1111
use Automattic\Jetpack\Assets;
1212
use Automattic\Jetpack\Assets\Logo;
13-
use Automattic\Jetpack\Redirect;
1413

1514
require_once __DIR__ . '/class-base-admin-menu.php';
1615

@@ -413,18 +412,6 @@ public function register_nav_unification_jetpack_menus() {
413412
null,
414413
2
415414
);
416-
417-
Jetpack_Admin_UI_Admin::add_menu(
418-
esc_attr__( 'Backup', 'jetpack-masterbar' ),
419-
__( 'Backup', 'jetpack-masterbar' ),
420-
'manage_options',
421-
'https://wordpress.com/backup/' . $this->domain,
422-
/**
423-
* Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
424-
*/
425-
null,
426-
3
427-
);
428415
}
429416

430417
/**
@@ -448,7 +435,6 @@ public function create_jetpack_menu( $position = 50, $separator = true ) {
448435

449436
if ( self::DEFAULT_VIEW === $this->get_preferred_view( 'jetpack' ) ) {
450437
$this->hide_submenu_page( 'jetpack', 'jetpack#/settings' );
451-
$this->hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'calypso-backups' ) ) );
452438
}
453439

454440
if ( ! $is_menu_updated ) {

projects/packages/masterbar/src/admin-menu/class-atomic-admin-menu.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Automattic\Jetpack\Current_Plan as Jetpack_Plan;
1212
use Automattic\Jetpack\JITMS\JITM;
1313
use Automattic\Jetpack\Modules;
14-
use Automattic\Jetpack\Redirect;
1514
use Automattic\Jetpack\Subscribers_Dashboard\Dashboard as Subscribers_Dashboard;
1615

1716
require_once __DIR__ . '/class-admin-menu.php';
@@ -268,14 +267,6 @@ public function add_jetpack_menu() {
268267
} else {
269268
parent::add_jetpack_menu();
270269
}
271-
272-
/**
273-
* Prevent duplicate menu items that link to Jetpack Backup.
274-
* Hide the one that's shown when the standalone backup plugin is not installed, since Jetpack Backup is already included in Atomic sites.
275-
*
276-
* @see https://github.com/Automattic/jetpack/pull/33955
277-
*/
278-
$this->hide_submenu_page( 'jetpack', esc_url( Redirect::get_url( 'calypso-backups' ) ) );
279270
}
280271

281272
/**

projects/packages/masterbar/tests/php/Admin_Menu_Test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ public function test_add_jetpack_menu() {
344344
static::$admin_menu->add_jetpack_menu();
345345

346346
$this->assertSame( 'https://wordpress.com/activity-log/' . static::$domain, $submenu['jetpack'][3][2] );
347-
$this->assertSame( 'https://wordpress.com/backup/' . static::$domain, $submenu['jetpack'][4][2] );
348347
}
349348

350349
/**

0 commit comments

Comments
 (0)