settings->get_settings_version() >= self::TARGET_VERSION ) { return; } $this->migrate_request_gate_option(); $this->delete_obsolete_log_read_options(); wp_clear_scheduled_hook( self::OBSOLETE_LOG_READ_CRON_HOOK ); $this->settings->set_settings_version( self::TARGET_VERSION ); } /** * Move the old assistant gate option into the request-gate option. */ private function migrate_request_gate_option(): void { $current_value = get_option( SettingsRepository::OPTION_ALLOW_REQUESTS, null ); $legacy_value = get_option( SettingsRepository::OPTION_ENABLE_ASSISTANT, null ); if ( null === $legacy_value ) { return; } if ( null === $current_value ) { update_option( SettingsRepository::OPTION_ALLOW_REQUESTS, (bool) $legacy_value ? 1 : 0 ); } delete_option( SettingsRepository::OPTION_ENABLE_ASSISTANT ); } /** * Remove option state from the retired temporary log-read window model. */ private function delete_obsolete_log_read_options(): void { foreach ( self::OBSOLETE_LOG_READ_OPTION_KEYS as $option_key ) { delete_option( $option_key ); } } }