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 +345 -147 5.3.1 → 6.3.0 View file →
@@ -8,8 +8,9 @@
8 8 namespace WP_Defender\Component;
9 9
10 10 use Calotes\Base\Component;
11 11 use WP_Defender\Model\Setting\Security_Tweaks;
12 +use WP_Defender\Traits\Defender_Bootstrap;
12 13
13 14 /**
14 15 * Handles the functionality related to user ratings and notifications.
15 16 *
@@ -16,8 +17,10 @@
16 17 * @since 4.4.0
17 18 */
18 19 class Rate extends Component {
19 20
21 + use Defender_Bootstrap;
22 +
20 23 /**
21 24 * URL for leaving a new review on WordPress.org.
22 25 *
23 26 * @var string
@@ -28,9 +31,9 @@
28 31 * Number of completed scans required to trigger a rating prompt.
29 32 *
30 33 * @var int
31 34 */
32 - public const NUMBER_COMPLETED_SCANS = 25;
35 + public const NUMBER_COMPLETED_SCANS = 3;
33 36
34 37 /**
35 38 * Number of fixed scan issues required to trigger a rating prompt.
36 39 *
@@ -38,8 +41,22 @@
38 41 */
39 42 public const NUMBER_FIXED_SCANS = 5;
40 43
41 44 /**
45 + * Number of UA lockouts required to trigger a rating prompt.
46 + *
47 + * @var int
48 + */
49 + public const NUMBER_UA_LOCKOUTS = 25;
50 +
51 + /**
52 + * Number of IP lockouts required to trigger a rating prompt.
53 + *
54 + * @var int
55 + */
56 + public const NUMBER_IP_LOCKOUTS = 25;
57 +
58 + /**
42 59 * Option name for tracking the number of completed scans.
43 60 *
44 61 * @var string
45 62 */
@@ -73,29 +90,27 @@
73 90 */
74 91 public const SLUG_FREE_INSTALL_DATE = 'defender_free_install_date';
75 92
76 93 /**
77 - * Label for the rate button.
94 + * Option name for storing the date of the postponed notice. This is global for all rating notices.
78 95 *
79 96 * @var string
80 97 */
81 - public $button_rate;
98 + public const SLUG_POSTPONED_NOTICE_DATE = 'defender_postponed_notice_date';
82 99
83 100 /**
84 - * Label for the later button.
101 + * Option name for tracking the number of UA lockouts.
85 102 *
86 103 * @var string
87 104 */
88 - public $button_later;
105 + public const SLUG_UA_LOCKOUTS = 'defender_counter_ua_lockouts';
89 106
90 107 /**
91 - * Initializes the class by setting button labels and registering actions.
108 + * Option name for tracking the number of IP lockouts.
109 + *
110 + * @var string
92 111 */
93 - public function __construct() {
94 - $this->button_rate = esc_html__( 'Rate Defender', 'defender-security' );
95 - $this->button_later = esc_html__( 'Maybe later', 'defender-security' );
96 - add_action( 'wp_ajax_defender_dismiss_notification', array( $this, 'dismiss_notice' ) );
97 - }
112 + public const SLUG_IP_LOCKOUTS = 'defender_counter_ip_lockouts';
98 113
99 114 /**
100 115 * Retrieves the count of scans from the database.
101 116 *
@@ -103,14 +118,39 @@
103 118 *
104 119 * @return int The count of scans.
105 120 */
106 121 protected static function get_count_scans( $slug ): int {
107 - $scan_count = get_site_option( $slug, false );
122 + return (int) get_site_option( $slug, 0 );
123 + }
108 124
109 - return empty( $scan_count ) ? 0 : (int) $scan_count;
125 + /**
126 + * Get a button label to rate.
127 + *
128 + * @return string
129 + */
130 + public static function get_rate_button_title(): string {
131 + return esc_html__( 'Rate Defender', 'defender-security' );
110 132 }
111 133
112 134 /**
135 + * Get a button label to postpone.
136 + *
137 + * @return string
138 + */
139 + public static function get_postpone_button_title(): string {
140 + return esc_html__( 'Remind me later', 'defender-security' );
141 + }
142 +
143 + /**
144 + * Get a button label to dismiss.
145 + *
146 + * @return string
147 + */
148 + public static function get_dismiss_button_title(): string {
149 + return esc_html__( 'I already did', 'defender-security' );
150 + }
151 +
152 + /**
113 153 * Count completed scans.
114 154 */
115 155 public static function run_counter_of_completed_scans(): void {
116 156 $scan_count = self::get_count_scans( self::SLUG_COMPLETED_SCANS );
@@ -129,192 +169,350 @@
129 169 }
130 170 }
131 171
132 172 /**
133 - * Display specific Scan notice.
173 + * Count UA lockouts.
174 + */
175 + public static function run_counter_of_ua_lockouts(): void {
176 + $lockout_count = self::get_count_scans( self::SLUG_UA_LOCKOUTS );
177 + if ( $lockout_count < self::NUMBER_UA_LOCKOUTS ) {
178 + update_site_option( self::SLUG_UA_LOCKOUTS, ++$lockout_count );
179 + }
180 + }
181 +
182 + /**
183 + * Count IP lockouts.
184 + */
185 + public static function run_counter_of_ip_lockouts(): void {
186 + $lockout_count = self::get_count_scans( self::SLUG_IP_LOCKOUTS );
187 + if ( $lockout_count < self::NUMBER_IP_LOCKOUTS ) {
188 + update_site_option( self::SLUG_IP_LOCKOUTS, ++$lockout_count );
189 + }
190 + }
191 +
192 + /**
193 + * Get notice by given slug.
134 194 *
135 - * @return array
195 + * @param string $notice_slug Notice slug.
196 + *
197 + * @return string
136 198 */
137 - public static function what_scan_notice_display(): array {
138 - if ( self::get_count_scans( self::SLUG_COMPLETED_SCANS ) >= self::NUMBER_COMPLETED_SCANS ) {
139 - return array(
140 - 'slug' => 'completed_scans',
141 - 'text' => sprintf(
142 - /* translators: %d - Number of completed scans. */
199 + public static function get_notice_by_slug( string $notice_slug ): string {
200 + switch ( $notice_slug ) {
201 + case 'completed_scans':
202 + default:
203 + $text = '<p class="notice-header">' . sprintf(
204 + /* translators: %d - Number of completed scans. */
205 + esc_html__( 'Nice work — %d scans completed!', 'defender-security' ),
206 + self::NUMBER_COMPLETED_SCANS
207 + );
208 + $text .= '</p><p class="notice-body">';
209 + $text .= esc_html__(
210 + 'Your site’s files have been thoroughly scanned for file modifications and outdated plugins. Defender’s here to keep your site safe — could you share your experience with others on WordPress.org?',
211 + 'defender-security'
212 + );
213 + $text .= '</p>';
214 + break;
215 +
216 + case 'fixed_scans':
217 + $text = '<p class="notice-body">' . sprintf(
218 + /* translators: %d - Number of fixed scans. */
143 219 esc_html__(
144 - 'You`ve completed %d malware scans - that`s a lot of scans! We are happy to be a part of helping you secure your site and we would appreciate it if you dropped us a rating on wp.org to help us spread the word and boost our motivation.',
220 + 'You`ve successfully resolved %d malware scan issues! We are happy to be a part of helping you secure your site, and we would appreciate it if you dropped us a rating on wp.org to help us spread the word and boost our motivation.',
145 221 'defender-security'
146 222 ),
147 - self::NUMBER_COMPLETED_SCANS
148 - ),
149 - );
150 - } elseif ( self::get_count_scans( self::SLUG_FIXED_SCAN_ISSUES ) >= self::NUMBER_FIXED_SCANS ) {
151 - return array(
152 - 'slug' => 'fixed_scans',
153 - 'text' => sprintf(
154 - /* translators: %d - Number of completed scans. */
223 + self::NUMBER_FIXED_SCANS
224 + );
225 + $text .= '</p>';
226 + break;
227 +
228 + case 'resolved_tweaks':
229 + $tweak_arr = wd_di()->get( Security_Tweaks::class )->get_tweak_types();
230 + $total_tweaks = $tweak_arr['count_fixed'] + $tweak_arr['count_ignored'] + $tweak_arr['count_issues'];
231 + $text = '<p class="notice-body">' . sprintf(
232 + /* translators: %d - Total number. */
155 233 esc_html__(
156 - 'You`ve successfully resolved %d malware scan issues! We are happy to be a part of helping you secure your site, and we would appreciate it if you dropped us a rating on wp.org to help us spread the word and boost our motivation.',
234 + 'You`ve resolved all %d security recommendations - that`s impressive! We are happy to be a part of helping you secure your site, and we would appreciate it if you dropped us a rating on wp.org to help us spread the word and boost our motivation.',
157 235 'defender-security'
158 236 ),
159 - self::NUMBER_FIXED_SCANS
160 - ),
161 - );
237 + $total_tweaks
238 + );
239 + $text .= '</p>';
240 + break;
241 +
242 + case 'ua_lockouts':
243 + $text = '<p class="notice-header">' . sprintf(
244 + /* translators: %d - Number of UA lockouts. */
245 + esc_html__( 'Defender has blocked %d malicious bots!', 'defender-security' ),
246 + self::NUMBER_UA_LOCKOUTS
247 + );
248 + $text .= '</p><p class="notice-body">';
249 + $text .= sprintf(
250 + /* translators: %d - Number of UA lockouts. */
251 + esc_html__(
252 + 'That’s %1$d fake crawlers and bad bots stopped from accessing your site. Defender’s User Agent lockouts keep unwanted traffic away so your site stays safe. If Defender’s helped protect your site, please share your experience with a review on WordPress.org.',
253 + 'defender-security'
254 + ),
255 + self::NUMBER_UA_LOCKOUTS
256 + );
257 + $text .= '</p>';
258 + break;
259 +
260 + case 'ip_lockouts':
261 + $text = '<p class="notice-header">' . sprintf(
262 + /* translators: %d - Number of IP lockouts. */
263 + esc_html__( 'Defender has blocked %d suspicious IPs!', 'defender-security' ),
264 + self::NUMBER_IP_LOCKOUTS
265 + );
266 + $text .= '</p><p class="notice-body">';
267 + $text .= sprintf(
268 + /* translators: %d - Number of IP lockouts. */
269 + esc_html__(
270 + 'That’s %1$d potential threats stopped before they could harm your site. Defender’s Firewall is keeping the bad guys and bots out so you can stay focused on running your site. If you’ve found Defender helpful, please share your experience with a review on WordPress.org.',
271 + 'defender-security'
272 + ),
273 + self::NUMBER_IP_LOCKOUTS
274 + );
275 + $text .= '</p>';
276 + break;
277 +
278 + case '7_days_installed':
279 + $text = '<p class="notice-header">' . esc_html__(
280 + 'Enjoying Defender? We’d love to hear your feedback!',
281 + 'defender-security'
282 + );
283 + $text .= '</p><p class="notice-body">';
284 + $text .= esc_html__(
285 + 'You’ve been using Defender for over a week now, and we’d love to hear about your experience! We’ve spent countless hours developing it for you, and your feedback is important to us. We’d really appreciate your rating.',
286 + 'defender-security'
287 + );
288 + $text .= '</p>';
289 + break;
162 290 }
163 291
164 - return array(
165 - 'slug' => '',
166 - 'text' => '',
167 - );
292 + return $text;
168 293 }
169 294
170 295 /**
171 - * Remove data of all prompts.
296 + * Get label by given slug. No need to translate a returned text.
297 + *
298 + * @param string $notice_slug Notice slug.
299 + *
300 + * @return string
172 301 */
173 - public static function clean_up(): void {
174 - delete_site_option( self::SLUG_COMPLETED_SCANS );
175 - delete_site_option( self::SLUG_FIXED_SCAN_ISSUES );
176 - delete_site_option( self::SLUG_FREE_INSTALL_DATE );
177 - delete_site_option( self::SLUG_FOR_BUTTON_RATE );
178 - delete_site_option( self::SLUG_FOR_BUTTON_THANKS );
302 + public static function get_label_by_slug( string $notice_slug ): string {
303 + switch ( $notice_slug ) {
304 + case 'completed_scans':
305 + $text = '3 Malware Scan Completed';
306 + break;
307 + case 'fixed_scans':
308 + $text = '5 Malware Issues Fixed';
309 + break;
310 + case 'resolved_tweaks':
311 + $text = 'Recommendation Resolved';
312 + break;
313 + case 'ua_lockouts':
314 + $text = '25 User Agent Lockout';
315 + break;
316 + case 'ip_lockouts':
317 + $text = '25 IP Lockout';
318 + break;
319 + case '7_days_installed':
320 + $text = '7 Days installed';
321 + break;
322 + default:
323 + $text = '';
324 + break;
325 + }
326 + return $text;
179 327 }
180 328
181 329 /**
330 + * Get label of the current page.
331 + *
332 + * @return string
333 + */
334 + public static function get_current_page_label(): string {
335 + switch ( defender_get_current_page() ) {
336 + case 'wp-defender':
337 + $text = 'Dashboard';
338 + break;
339 + case 'wdf-hardener':
340 + $text = 'Recommendations';
341 + break;
342 + case 'wdf-scan':
343 + $text = 'Malware Scan';
344 + break;
345 + case 'wdf-logging':
346 + $text = 'Audit Log';
347 + break;
348 + case 'wdf-ip-lockout':
349 + $text = 'Firewall';
350 + break;
351 + case 'wdf-2fa':
352 + $text = '2FA';
353 + break;
354 + case 'wdf-advanced-tools':
355 + $text = 'Tools';
356 + break;
357 + case 'wdf-notification':
358 + $text = 'Notifications';
359 + break;
360 + case 'wdf-setting':
361 + $text = 'Settings';
362 + break;
363 + default:
364 + $text = '';
365 + break;
366 + }
367 +
368 + return $text;
369 + }
370 +
371 + /**
182 372 * Reset counter of all prompts.
183 373 */
184 374 public static function reset_counters(): void {
185 375 update_site_option( self::SLUG_COMPLETED_SCANS, 0 );
186 376 update_site_option( self::SLUG_FIXED_SCAN_ISSUES, 0 );
377 + update_site_option( self::SLUG_UA_LOCKOUTS, 0 );
378 + update_site_option( self::SLUG_IP_LOCKOUTS, 0 );
187 379 }
188 380
189 381 /**
190 - * Initializing actions.
382 + * Is the rating notice displayed? The priority list of prompts:
383 + * 1) completed malware scans,
384 + * 2) fixed scans,
385 + * 3) resolved tweaks,
386 + * 4) UA lockouts,
387 + * 5) IP lockouts,
388 + * 6) default one after 7 days installed.
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.
391 + *
392 + * @return array
191 393 */
192 - public function init(): void {
193 - if ( is_defender_page() ) {
194 - $is_multisite = is_multisite();
195 - if ( ! $is_multisite ) {
196 - add_action( 'admin_notices', array( $this, 'show_notice_general_request' ) );
197 - } elseif ( $is_multisite && is_main_site() ) {
198 - add_action( 'network_admin_notices', array( $this, 'show_notice_general_request' ) );
394 + public static function is_achievement_displayed(): array {
395 + $res = array(
396 + 'is_displayed' => true,
397 + 'slug' => '',
398 + );
399 + if ( self::was_rate_request() ) {
400 + $res['is_displayed'] = false;
401 +
402 + return $res;
403 + }
404 + if ( ! self::is_required_page() ) {
405 + $res['is_displayed'] = false;
406 +
407 + return $res;
408 + }
409 +
410 + // No needed to translate slugs.
411 + if ( self::get_count_scans( self::SLUG_COMPLETED_SCANS ) >= self::NUMBER_COMPLETED_SCANS ) {
412 + $res['slug'] = 'completed_scans';
413 + } elseif ( self::get_count_scans( self::SLUG_FIXED_SCAN_ISSUES ) >= self::NUMBER_FIXED_SCANS ) {
414 + $res['slug'] = 'fixed_scans';
415 + } else {
416 + $tweak_arr = wd_di()->get( Security_Tweaks::class )->get_tweak_types();
417 + $total_tweaks = $tweak_arr['count_fixed'] + $tweak_arr['count_ignored'] + $tweak_arr['count_issues'];
418 + if ( $tweak_arr['count_fixed'] === $total_tweaks && $total_tweaks > 0 ) {
419 + $res['slug'] = 'resolved_tweaks';
420 + } elseif ( self::get_count_scans( self::SLUG_UA_LOCKOUTS ) >= self::NUMBER_UA_LOCKOUTS ) {
421 + $res['slug'] = 'ua_lockouts';
422 + } elseif ( self::get_count_scans( self::SLUG_IP_LOCKOUTS ) >= self::NUMBER_IP_LOCKOUTS ) {
423 + $res['slug'] = 'ip_lockouts';
424 + } elseif ( self::was_postponed_request() ) {
425 + $res['is_displayed'] = false;
426 +
427 + return $res;
199 428 }
200 429 }
430 + // If the conditions are met, display the notice about plugin achievements.
431 + if ( $res['is_displayed'] && '' !== $res['slug'] ) {
432 + return $res;
433 + }
434 + // If no, display the default one.
435 + $res['slug'] = '7_days_installed';
436 +
437 + return $res;
201 438 }
202 439
203 440 /**
204 - * Have there already been clicks on the Rate notices?
441 + * Display the rating notice on the Issues page if all malware scans are resolved.
205 442 *
443 + * @param int $count_scan_issues Count of Scan issues.
444 + *
206 445 * @return bool
446 + * @since 6.0
207 447 */
208 - public static function was_rate_request(): bool {
209 - if ( get_site_option( self::SLUG_FOR_BUTTON_RATE, apply_filters( 'wd_display_rating', false ) ) ) {
210 - return true;
448 + public static function is_displayed_in_redesigned_version( int $count_scan_issues ): bool {
449 + if ( self::was_rate_request() ) {
450 + return false;
211 451 }
212 - if ( get_site_option( self::SLUG_FOR_BUTTON_THANKS, apply_filters( 'wd_dismiss_rating', false ) ) ) {
213 - return true;
452 + // Check by required page.
453 + if ( 'wdf-scan' !== defender_get_current_page() ) {
454 + return false;
214 455 }
456 + if ( self::was_postponed_request() ) {
457 + return false;
458 + }
215 459
216 - return false;
460 + return 0 === $count_scan_issues;
217 461 }
218 462
219 463 /**
220 - * Show the general rating notice after countless hours developing.
464 + * Have there already been clicks on the Rate or Dismiss buttons?
465 + *
466 + * @return bool
221 467 */
222 - public function show_notice_general_request() {
223 - if ( self::was_rate_request() ) {
224 - return;
468 + private static function was_rate_request(): bool {
469 + $display_rating = apply_filters( 'wd_display_rating', false );
470 + $display_rating = is_bool( $display_rating ) ? $display_rating : (bool) $display_rating;
471 + // Avoid case with '1'.
472 + if ( true === (bool) get_site_option( self::SLUG_FOR_BUTTON_RATE, $display_rating ) ) {
473 + return true;
225 474 }
226 - // Return if the condition is met on the Scan page.
227 - if (
228 - 'wdf-scan' === defender_get_current_page()
229 - && (
230 - self::get_count_scans( self::SLUG_COMPLETED_SCANS ) >= self::NUMBER_COMPLETED_SCANS
231 - || self::get_count_scans( self::SLUG_FIXED_SCAN_ISSUES ) >= self::NUMBER_FIXED_SCANS
232 - )
233 - ) {
234 - return;
235 - }
236 - // Return if the condition is met on the Tweaks page.
237 - $tweak_arr = wd_di()->get( Security_Tweaks::class )->get_tweak_types();
238 - $total_tweaks = $tweak_arr['count_fixed'] + $tweak_arr['count_ignored'] + $tweak_arr['count_issues'];
239 - if (
240 - 'wdf-hardener' === defender_get_current_page()
241 - && $tweak_arr['count_fixed'] === $total_tweaks
242 - ) {
243 - return;
244 - }
245 475
246 - // Check by the installation date.
247 - $install_date = (int) get_site_option( self::SLUG_FREE_INSTALL_DATE, false );
248 - if ( $install_date && time() > strtotime( '+7 days', $install_date ) ) { ?>
249 - <div id="defender-free-usage-notice" class="defender-rating-notice notice notice-info"
250 - data-nonce="<?php echo esc_attr( wp_create_nonce( 'defender_dismiss_notification' ) ); ?>">
251 -
252 - <p style="color: #72777C; line-height: 22px;">
253 - <?php
254 - esc_html_e(
255 - 'We\'ve spent countless hours developing Defender and making it free for you to use. We would really appreciate it if you dropped us a quick rating!',
256 - 'defender-security'
257 - );
258 - ?>
259 - </p>
260 -
261 - <p>
262 - <button type="button" class="button button-primary button-large"
263 - data-prop="defender_rating_success"><?php echo esc_html( $this->button_rate ); ?></button>
264 - <a href="#" class="dismiss"
265 - style="margin-left: 11px; color: #555; line-height: 16px; font-weight: 500; text-decoration: none;"
266 - data-prop="defender_days_rating_later_dismiss"><?php echo esc_html( $this->button_later ); ?></a>
267 - </p>
268 - </div>
269 - <?php
476 + $dismiss_rating = apply_filters( 'wd_dismiss_rating', false );
477 + $dismiss_rating = is_bool( $dismiss_rating ) ? $dismiss_rating : (bool) $dismiss_rating;
478 + // Avoid case with '1'.
479 + if ( true === (bool) get_site_option( self::SLUG_FOR_BUTTON_THANKS, $dismiss_rating ) ) {
480 + return true;
270 481 }
271 - ?>
272 482
273 - <script type="text/javascript">
274 - jQuery('.defender-rating-notice a, .defender-rating-notice button').on('click', function (e) {
275 - e.preventDefault();
483 + return false;
484 + }
276 485
277 - var $notice = jQuery(e.currentTarget).closest('.defender-rating-notice'),
278 - prop = jQuery(this).data('prop'),
279 - ajaxUrl = '<?php echo esc_url_raw( admin_url( 'admin-ajax.php' ) ); ?>';
486 + /**
487 + * Have there already been click to postpone the notice?
488 + *
489 + * @return bool
490 + */
491 + private static function was_postponed_request(): bool {
492 + $postponed_date = (int) get_site_option( self::SLUG_POSTPONED_NOTICE_DATE, 0 );
280 493
281 - if ('defender_rating_success' === prop) {
282 - window.open('<?php echo esc_url_raw( self::URL_PLUGIN_NEW_REVIEW_VCS ); ?>', '_blank');
283 - }
284 -
285 - jQuery.post(
286 - ajaxUrl,
287 - {
288 - action: 'defender_dismiss_notification',
289 - prop: prop,
290 - _ajax_nonce: $notice.data('nonce')
291 - }
292 - ).always(function () {
293 - $notice.hide();
294 - });
295 - });
296 - </script>
297 - <?php
494 + return time() <= strtotime( '+7 days', $postponed_date );
298 495 }
299 496
300 497 /**
301 - * Dismiss notice.
498 + * Is this required page? Excluded pages: WAF, Free Plugins, Onboard.
499 + *
500 + * @return bool
302 501 */
303 - public function dismiss_notice() {
304 - if ( ! current_user_can( 'manage_options' ) || ! check_ajax_referer( 'defender_dismiss_notification' ) ) {
305 - wp_send_json_error(
306 - array( 'message' => esc_html__( 'Invalid request, you are not allowed to do that action.', 'defender-security' ) )
307 - );
308 - }
502 + protected static function is_required_page(): bool {
503 + $arr = array(
504 + 'wdf-hardener',
505 + 'wdf-scan',
506 + 'wdf-logging',
507 + 'wdf-ip-lockout',
508 + 'wdf-2fa',
509 + 'wdf-advanced-tools',
510 + 'wdf-notification',
511 + 'wdf-setting',
512 + // Dashboard and Setup Wizard have the same page slug.
513 + 'wp-defender',
514 + );
309 515
310 - $notification_name = defender_get_data_from_request( 'prop', 'p' );
311 - if ( false === $notification_name ) {
312 - wp_send_json_error(
313 - array( 'message' => esc_html__( 'Invalid request, allowed data not provided.', 'defender-security' ) )
314 - );
315 - }
316 - update_site_option( $notification_name, true );
317 -
318 - wp_send_json_success();
516 + return in_array( defender_get_current_page(), $arr, true );
319 517 }
320 518 }