PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | src/component/class-rate.php +35 -11 5.9.0 → 6.3.0 View file →
@@ -201,9 +201,9 @@
201 201 case 'completed_scans':
202 202 default:
203 203 $text = '<p class="notice-header">' . sprintf(
204 204 /* translators: %d - Number of completed scans. */
205 - esc_html__( '🎉 Nice work — %d scans completed!', 'defender-security' ),
205 + esc_html__( 'Nice work — %d scans completed!', 'defender-security' ),
206 206 self::NUMBER_COMPLETED_SCANS
207 207 );
208 208 $text .= '</p><p class="notice-body">';
209 209 $text .= esc_html__(
@@ -241,9 +241,9 @@
241 241
242 242 case 'ua_lockouts':
243 243 $text = '<p class="notice-header">' . sprintf(
244 244 /* translators: %d - Number of UA lockouts. */
245 - esc_html__( '🤖 Defender has blocked %d malicious bots!', 'defender-security' ),
245 + esc_html__( 'Defender has blocked %d malicious bots!', 'defender-security' ),
246 246 self::NUMBER_UA_LOCKOUTS
247 247 );
248 248 $text .= '</p><p class="notice-body">';
249 249 $text .= sprintf(
@@ -259,9 +259,9 @@
259 259
260 260 case 'ip_lockouts':
261 261 $text = '<p class="notice-header">' . sprintf(
262 262 /* translators: %d - Number of IP lockouts. */
263 - esc_html__( '🚫 Defender has blocked %d suspicious IPs!', 'defender-security' ),
263 + esc_html__( 'Defender has blocked %d suspicious IPs!', 'defender-security' ),
264 264 self::NUMBER_IP_LOCKOUTS
265 265 );
266 266 $text .= '</p><p class="notice-body">';
267 267 $text .= sprintf(
@@ -386,8 +386,9 @@
386 386 * 4) UA lockouts,
387 387 * 5) IP lockouts,
388 388 * 6) default one after 7 days installed.
389 389 * Note: items #1-5 are without waiting for 7 days.
390 + * No uses in v6.0 but it'll will be implemented in the future.
390 391 *
391 392 * @return array
392 393 */
393 394 public static function is_achievement_displayed(): array {
@@ -413,9 +414,9 @@
413 414 $res['slug'] = 'fixed_scans';
414 415 } else {
415 416 $tweak_arr = wd_di()->get( Security_Tweaks::class )->get_tweak_types();
416 417 $total_tweaks = $tweak_arr['count_fixed'] + $tweak_arr['count_ignored'] + $tweak_arr['count_issues'];
417 - if ( $tweak_arr['count_fixed'] === $total_tweaks ) {
418 + if ( $tweak_arr['count_fixed'] === $total_tweaks && $total_tweaks > 0 ) {
418 419 $res['slug'] = 'resolved_tweaks';
419 420 } elseif ( self::get_count_scans( self::SLUG_UA_LOCKOUTS ) >= self::NUMBER_UA_LOCKOUTS ) {
420 421 $res['slug'] = 'ua_lockouts';
421 422 } elseif ( self::get_count_scans( self::SLUG_IP_LOCKOUTS ) >= self::NUMBER_IP_LOCKOUTS ) {
@@ -436,8 +437,31 @@
436 437 return $res;
437 438 }
438 439
439 440 /**
441 + * Display the rating notice on the Issues page if all malware scans are resolved.
442 + *
443 + * @param int $count_scan_issues Count of Scan issues.
444 + *
445 + * @return bool
446 + * @since 6.0
447 + */
448 + public static function is_displayed_in_redesigned_version( int $count_scan_issues ): bool {
449 + if ( self::was_rate_request() ) {
450 + return false;
451 + }
452 + // Check by required page.
453 + if ( 'wdf-scan' !== defender_get_current_page() ) {
454 + return false;
455 + }
456 + if ( self::was_postponed_request() ) {
457 + return false;
458 + }
459 +
460 + return 0 === $count_scan_issues;
461 + }
462 +
463 + /**
440 464 * Have there already been clicks on the Rate or Dismiss buttons?
441 465 *
442 466 * @return bool
443 467 */
@@ -443,15 +467,17 @@
443 467 */
444 468 private static function was_rate_request(): bool {
445 469 $display_rating = apply_filters( 'wd_display_rating', false );
446 470 $display_rating = is_bool( $display_rating ) ? $display_rating : (bool) $display_rating;
447 - if ( true === get_site_option( self::SLUG_FOR_BUTTON_RATE, $display_rating ) ) {
471 + // Avoid case with '1'.
472 + if ( true === (bool) get_site_option( self::SLUG_FOR_BUTTON_RATE, $display_rating ) ) {
448 473 return true;
449 474 }
450 475
451 476 $dismiss_rating = apply_filters( 'wd_dismiss_rating', false );
452 477 $dismiss_rating = is_bool( $dismiss_rating ) ? $dismiss_rating : (bool) $dismiss_rating;
453 - if ( true === get_site_option( self::SLUG_FOR_BUTTON_THANKS, $dismiss_rating ) ) {
478 + // Avoid case with '1'.
479 + if ( true === (bool) get_site_option( self::SLUG_FOR_BUTTON_THANKS, $dismiss_rating ) ) {
454 480 return true;
455 481 }
456 482
457 483 return false;
@@ -473,9 +499,9 @@
473 499 *
474 500 * @return bool
475 501 */
476 502 protected static function is_required_page(): bool {
477 - $arr = array(
503 + $arr = array(
478 504 'wdf-hardener',
479 505 'wdf-scan',
480 506 'wdf-logging',
481 507 'wdf-ip-lockout',
@@ -482,13 +508,11 @@
482 508 'wdf-2fa',
483 509 'wdf-advanced-tools',
484 510 'wdf-notification',
485 511 'wdf-setting',
512 + // Dashboard and Setup Wizard have the same page slug.
513 + 'wp-defender',
486 514 );
487 - $_this = new self();
488 - if ( ! $_this->is_onboarding() ) {
489 - $arr[] = 'wp-defender';
490 - }
491 515
492 516 return in_array( defender_get_current_page(), $arr, true );
493 517 }
494 518 }