Code Duplication    Length = 11-17 lines in 2 locations

modules/masterbar/admin-menu/class-admin-menu.php 2 locations

@@ 147-157 (lines=11) @@
144
	/**
145
	 * Adds Upgrades menu.
146
	 */
147
	public function add_upgrades_menu() {
148
		remove_menu_page( 'paid-upgrades.php' );
149
150
		$menu_slug = 'https://wordpress.com/plans/' . $this->domain;
151
152
		add_menu_page( __( 'Upgrades', 'jetpack' ), __( 'Upgrades', 'jetpack' ), 'manage_options', $menu_slug, null, 'dashicons-cart', 4 );
153
		add_submenu_page( $menu_slug, __( 'Plans', 'jetpack' ), __( 'Plans', 'jetpack' ), 'manage_options', $menu_slug, null, 5 );
154
		add_submenu_page( $menu_slug, __( 'Purchases', 'jetpack' ), __( 'Purchases', 'jetpack' ), 'manage_options', 'https://wordpress.com/purchases/subscriptions/' . $this->domain, null, 15 );
155
156
		$this->migrate_submenus( 'paid-upgrades.php', $menu_slug );
157
	}
158
159
	/**
160
	 * Adds Posts menu.
@@ 371-387 (lines=17) @@
368
	 *
369
	 * @param bool $calypso Optional. Whether links should point to Calypso or wp-admin. Default true (Calypso).
370
	 */
371
	public function add_options_menu( $calypso = true ) {
372
		if ( ! $calypso ) {
373
			return;
374
		}
375
376
		$options_slug = 'https://wordpress.com/settings/general/' . $this->domain;
377
378
		remove_menu_page( 'options-general.php' );
379
		remove_submenu_page( 'options-general.php', 'options-general.php' );
380
		remove_submenu_page( 'options-general.php', 'options-discussion.php' );
381
		remove_submenu_page( 'options-general.php', 'options-writing.php' );
382
383
		add_menu_page( esc_attr__( 'Settings', 'jetpack' ), __( 'Settings', 'jetpack' ), 'manage_options', $options_slug, null, 'dashicons-admin-settings', 80 );
384
		add_submenu_page( $options_slug, esc_attr__( 'General', 'jetpack' ), __( 'General', 'jetpack' ), 'manage_options', $options_slug, null, 10 );
385
386
		$this->migrate_submenus( 'options-general.php', $options_slug );
387
	}
388
389
	/**
390
	 * Migrates submenu items from wp-admin menu slugs to Calypso menu slugs.