| @@ -8,8 +8,9 @@ | ||
| 8 | 8 | namespace Automattic\Jetpack\Scan; |
| 9 | 9 | |
| 10 | 10 | use Automattic\Jetpack\Assets; |
| 11 | 11 | use Automattic\Jetpack\Redirect; |
| 12 | +use WP_Admin_Bar; | |
| 12 | 13 | |
| 13 | 14 | /** |
| 14 | 15 | * Class Main |
| 15 | 16 | * |
| @@ -173,12 +174,13 @@ | ||
| 173 | 174 | ), |
| 174 | 175 | ); |
| 175 | 176 | |
| 176 | 177 | if ( $has_threats ) { |
| 177 | - $node['href'] = esc_url( Redirect::get_url( 'calypso-scanner' ) ); | |
| 178 | - $node['meta']['onclick'] = 'window.open( this.href ); return false;'; | |
| 179 | - $node['meta']['class'] = 'error'; | |
| 180 | - $node['title'] = sprintf( | |
| 178 | + $node['href'] = esc_url( Redirect::get_url( 'calypso-scanner' ) ); | |
| 179 | + $node['meta']['target'] = '_blank'; | |
| 180 | + $node['meta']['rel'] = 'noopener noreferrer'; | |
| 181 | + $node['meta']['class'] = 'error'; | |
| 182 | + $node['title'] = sprintf( | |
| 181 | 183 | esc_html( |
| 182 | 184 | /* translators: %s is the alert icon */ |
| 183 | 185 | _n( '%s Threat found', '%s Threats found', $this->get_threat_count(), 'jetpack' ) |
| 184 | 186 | ), |
| @@ -208,9 +210,9 @@ | ||
| 208 | 210 | if ( empty( $scan_state ) ) { |
| 209 | 211 | return null; |
| 210 | 212 | } |
| 211 | 213 | // Return true if there is at least one threat found. |
| 212 | - return (bool) isset( $scan_state->threats[0] ); | |
| 214 | + return isset( $scan_state->threats[0] ); | |
| 213 | 215 | } |
| 214 | 216 | |
| 215 | 217 | /** |
| 216 | 218 | * Returns the number of threats found or 0. |