| @@ -34,8 +34,15 @@ | ||
| 34 | 34 | */ |
| 35 | 35 | public $slug = 'wdf-setup-wizard'; |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | + * The old key for the remind later in Onboarding. This is from V5.x. We can delete it in the future versions. | |
| 39 | + * | |
| 40 | + * @var string | |
| 41 | + */ | |
| 42 | + public const REMINDER_KEY = 'wp_defender_onboard_antibot_reminder'; | |
| 43 | + | |
| 44 | + /** | |
| 38 | 45 | * Initializes the model and service, registers routes, and sets up scheduled events if the model is active. |
| 39 | 46 | */ |
| 40 | 47 | public function __construct() { |
| 41 | 48 | $this->register_routes(); |
| @@ -108,9 +115,9 @@ | ||
| 108 | 115 | } |
| 109 | 116 | |
| 110 | 117 | switch ( $step ) { |
| 111 | 118 | case 'local-firewall': |
| 112 | - $saved['local_firewall'] = ! empty( $data['local_firewall'] ); | |
| 119 | + $saved['local_firewall'] = isset( $data['local_firewall'] ); | |
| 113 | 120 | break; |
| 114 | 121 | case 'hardening': |
| 115 | 122 | $hardening = isset( $data['hardening'] ) && is_array( $data['hardening'] ) |
| 116 | 123 | ? $data['hardening'] |
| @@ -201,9 +208,9 @@ | ||
| 201 | 208 | $security_key->cron_unschedule(); |
| 202 | 209 | } |
| 203 | 210 | |
| 204 | 211 | // Activate all other selected hardening tweaks. |
| 205 | - if ( ! empty( $resolved_slugs ) ) { | |
| 212 | + if ( is_array( $resolved_slugs ) && array() !== $resolved_slugs ) { | |
| 206 | 213 | $security_tweaks = wd_di()->get( Security_Tweaks::class ); |
| 207 | 214 | $security_tweaks->security_tweaks_auto_action( $resolved_slugs, 'resolve' ); |
| 208 | 215 | } |
| 209 | 216 | } |
| @@ -309,8 +316,11 @@ | ||
| 309 | 316 | */ |
| 310 | 317 | public function remove_settings() { |
| 311 | 318 | delete_site_option( 'wd_onboarding_data' ); |
| 312 | 319 | self::clear_resume_notice_option(); |
| 320 | + // From V5.x. We can delete it in the future versions. | |
| 321 | + delete_site_option( self::REMINDER_KEY ); | |
| 322 | + delete_site_option( 'wp_defender_onboarding_step' ); | |
| 313 | 323 | } |
| 314 | 324 | |
| 315 | 325 | /** |
| 316 | 326 | * Remove all data. |