| @@ -45,10 +45,8 @@ | ||
| 45 | 45 | 'scan' => ! isset( $old_data['scan'] ) || ! is_array( $old_data['scan'] ) ? array() : $this->update_scan( $old_data['scan'] ), |
| 46 | 46 | 'iplockout' => ! isset( $old_data['iplockout'] ) || ! is_array( $old_data['iplockout'] ) |
| 47 | 47 | ? array() |
| 48 | 48 | : $this->update_ip_lockout( $old_data['iplockout'] ), |
| 49 | - // Empty data if Audit module is disabled. | |
| 50 | - 'audit' => ! isset( $old_data['audit'] ) || ! is_array( $old_data['audit'] ) ? array() : $this->update_audit( $old_data['audit'] ), | |
| 51 | 49 | 'two_factor' => ! isset( $old_data['two_factor'] ) || ! is_array( $old_data['two_factor'] ) |
| 52 | 50 | ? array() |
| 53 | 51 | : $this->update_two_factor( $old_data['two_factor'] ), |
| 54 | 52 | // Checks for empty values Mask Login and Security Headers inside methods. |
| @@ -230,10 +228,10 @@ | ||
| 230 | 228 | 'email_subject_error' => $old_data['email_subject_error'] ?? '', |
| 231 | 229 | 'email_content_issue_found' => $old_data['email_has_issue'] ?? '', |
| 232 | 230 | 'email_content_issue_not_found' => $old_data['email_all_ok'] ?? '', |
| 233 | 231 | 'email_content_error' => $old_data['email_content_error'] ?? '', |
| 234 | - // since 2.7.0. | |
| 235 | - 'scheduled_scanning' => false, | |
| 232 | + // Since 5.9.0. | |
| 233 | + 'check_abandoned_plugin' => true, | |
| 236 | 234 | ); |
| 237 | 235 | |
| 238 | 236 | $scan['report_subscribers'] = ! isset( $old_data['recipients'] ) || ! is_array( $old_data['recipients'] ) || array() === $old_data['recipients'] |
| 239 | 237 | ? array() |
| @@ -430,17 +428,20 @@ | ||
| 430 | 428 | * |
| 431 | 429 | * @return array |
| 432 | 430 | */ |
| 433 | 431 | public function update_two_factor( array $old_data ): array { |
| 432 | + $user_roles = $old_data['user_roles'] ?? array(); | |
| 433 | + $force_auth_roles = $old_data['force_auth_roles'] ?? array(); | |
| 434 | + $force_auth_roles = array_values( array_intersect( $force_auth_roles, $user_roles ) ); | |
| 434 | 435 | |
| 435 | 436 | return array( |
| 436 | - 'enabled' => $old_data['enabled'], | |
| 437 | - 'lost_phone' => $old_data['lost_phone'], | |
| 438 | - 'force_auth' => $old_data['force_auth'], | |
| 439 | - 'force_auth_mess' => $old_data['force_auth_mess'], | |
| 440 | - 'user_roles' => $old_data['user_roles'], | |
| 441 | - 'force_auth_roles' => $old_data['force_auth_roles'], | |
| 442 | - 'custom_graphic' => $old_data['custom_graphic'], | |
| 437 | + 'enabled' => $old_data['enabled'] ?? false, | |
| 438 | + 'lost_phone' => $old_data['lost_phone'] ?? true, | |
| 439 | + 'force_auth' => $old_data['force_auth'] ?? false, | |
| 440 | + 'force_auth_mess' => $old_data['force_auth_mess'] ?? '', | |
| 441 | + 'user_roles' => $user_roles, | |
| 442 | + 'force_auth_roles' => $force_auth_roles, | |
| 443 | + 'custom_graphic' => $old_data['custom_graphic'] ?? false, | |
| 443 | 444 | 'custom_graphic_type' => $old_data['custom_graphic_type'] ?? Two_Fa::CUSTOM_GRAPHIC_TYPE_UPLOAD, |
| 444 | 445 | 'custom_graphic_url' => $old_data['custom_graphic_url'] ?? '', |
| 445 | 446 | 'custom_graphic_link' => $old_data['custom_graphic_link'] ?? '', |
| 446 | 447 | 'email_subject' => $old_data['email_subject'] ?? '', |
| @@ -445,9 +446,10 @@ | ||
| 445 | 446 | 'custom_graphic_link' => $old_data['custom_graphic_link'] ?? '', |
| 446 | 447 | 'email_subject' => $old_data['email_subject'] ?? '', |
| 447 | 448 | 'email_sender' => $old_data['email_sender'] ?? '', |
| 448 | 449 | 'email_body' => $old_data['email_body'] ?? '', |
| 449 | - 'app_title' => '', | |
| 450 | + 'app_title' => $old_data['app_title'] ?? '', | |
| 451 | + 'detect_woo' => $old_data['detect_woo'] ?? false, | |
| 450 | 452 | ); |
| 451 | 453 | } |
| 452 | 454 | |
| 453 | 455 | /** |