PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.5
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.5
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
← All changes | modules/scan/class-admin-sidebar-link.php +17 -34 13.8.3 → 16.3-a.5 View file →
@@ -67,16 +67,20 @@
67 67 if ( ! $this->should_show_link() ) {
68 68 return;
69 69 }
70 70
71 + $position = defined( Admin_Menu::class . '::POSITION_EXTERNAL' ) ? Admin_Menu::POSITION_EXTERNAL : 100;
72 +
71 73 if ( $this->should_show_scan() ) {
72 74 Admin_Menu::add_menu(
73 - __( 'Scan', 'jetpack' ),
74 - __( 'Scan', 'jetpack' ) . ' <span class="dashicons dashicons-external"></span>',
75 + /** "Scan" is a product name, do not translate. */
76 + 'Scan',
77 + 'Scan <span aria-hidden="true">↗</span>',
75 78 'manage_options',
76 79 esc_url( Redirect::get_url( 'cloud-scan-history-wp-menu' ) ),
77 80 null,
78 - $this->get_link_offset()
81 + $position,
82 + array( 'key' => 'jetpack-scan-cloud' )
79 83 );
80 84 }
81 85
82 86 // Add scan item which shows history page only. This is mutally exclusive from the scan item above and is only shown for Atomic sitse.
@@ -81,52 +85,31 @@
81 85
82 86 // Add scan item which shows history page only. This is mutally exclusive from the scan item above and is only shown for Atomic sitse.
83 87 if ( $this->should_show_scan_history_only() ) {
84 88 Admin_Menu::add_menu(
85 - __( 'Scan', 'jetpack' ),
86 - __( 'Scan', 'jetpack' ) . ' <span class="dashicons dashicons-external"></span>',
89 + /** "Scan" is a product name, do not translate. */
90 + 'Scan',
91 + 'Scan <span aria-hidden="true">↗</span>',
87 92 'manage_options',
88 93 esc_url( Redirect::get_url( 'cloud-scan-history-wp-menu' ) ),
89 94 null,
90 - $this->get_link_offset()
95 + $position,
96 + array( 'key' => 'jetpack-scan-cloud' )
91 97 );
92 98 }
93 99
94 100 if ( $this->should_show_backup() ) {
95 101 Admin_Menu::add_menu(
96 - __( 'VaultPress', 'jetpack' ),
97 - __( 'VaultPress', 'jetpack' ) . ' <span class="dashicons dashicons-external"></span>',
102 + /** "VaultPress Backup" is a product name, do not translate. */
103 + 'VaultPress Backup',
104 + 'VaultPress Backup <span aria-hidden="true">↗</span>',
98 105 'manage_options',
99 106 esc_url( Redirect::get_url( 'calypso-backups' ) ),
100 107 null,
101 - $this->get_link_offset()
108 + $position,
109 + array( 'key' => 'jetpack-backup-cloud' )
102 110 );
103 111 }
104 - }
105 -
106 - /**
107 - * We create a menu offset by counting all the pages that have a jetpack_admin_page set as the capability.
108 - *
109 - * This makes it so that the highlight of the pages works as expected. When you click on the Setting or Dashboard.
110 - *
111 - * @return int Menu offset.
112 - */
113 - private function get_link_offset() {
114 - global $submenu;
115 - $offset = 9;
116 -
117 - if ( ! array_key_exists( 'jetpack', $submenu ) ) {
118 - return $offset;
119 - }
120 -
121 - foreach ( $submenu['jetpack'] as $link ) {
122 - if ( 'jetpack_admin_page' !== $link[1] ) {
123 - break;
124 - }
125 - ++$offset;
126 - }
127 -
128 - return $offset;
129 112 }
130 113
131 114 /**
132 115 * Refreshes the state cache via API call. Called via cron.