' ); $desc = sprintf( /* translators: %s: plugin version */ __( "To harden your site's security and facilitate the login process, Defender %s enables you to set up biometric 2FA. It allows your users to authenticate their logins using Touch ID, Face ID, or FIDO-certified authentication devices.", 'wpdef' ), self::FEATURE_VERSION ); return array( 'show_welcome_modal' => $this->display_last_modal( self::FEATURE_SLUG ), 'welcome_modal' => array( 'title' => $title, 'desc' => $desc, 'banner_1x' => defender_asset_url( '/assets/img/modal/welcome-modal.png' ), 'banner_2x' => defender_asset_url( '/assets/img/modal/welcome-modal@2x.png' ), 'banner_alt' => __( 'Modal for Biometric authentication', 'wpdef' ), 'button_title' => __( 'Got it', 'wpdef' ), // Additional information. 'additional_text' => $this->additional_text(), ), ); } /** * Display modal with the latest changes if: * plugin settings have been reset before -> this is not fresh install, * Whitelabel > Documentation, Tutorials and What’s New Modal > checked Show tab OR Whitelabel is disabled. * * @param string $key * * @return bool */ protected function display_last_modal( $key ) { $info = defender_white_label_status(); return (bool) get_site_option( 'wd_nofresh_install' ) && (bool) get_site_option( $key ) && ! $info['hide_doc_link']; } public function upgrade_site_options() { $db_version = get_site_option( 'wd_db_version' ); $feature_slugs = array( // Important slugs to display Onboarding, e.g. after the click on Reset settings. array( 'slug' => 'wp_defender_shown_activator', 'vers' => '2.4.0', ), array( 'slug' => 'wp_defender_is_free_activated', 'vers' => '2.4.0', ), // The latest feature. array( 'slug' => 'wd_show_feature_auth_methods', 'vers' => '2.8.0', ), // The current feature. array( 'slug' => self::FEATURE_SLUG, 'vers' => self::FEATURE_VERSION, ), ); foreach ( $feature_slugs as $feature ) { if ( version_compare( $db_version, $feature['vers'], '==' ) ) { // The current feature update_site_option( $feature['slug'], true ); } else { // and old one. delete_site_option( $feature['slug'] ); } } } /** * Get additional text. * * @return string */ private function additional_text() { $text = '