: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
use WordfenceLS\Crypto\Model_JWT;
use WordfenceLS\Crypto\Model_Symmetric;
use WordfenceLS\Text\Model_HTML;
use WordfenceLS\View\Model_Tab;
use WordfenceLS\View\Model_Title;
class Controller_WordfenceLS {
const VERSION_KEY = 'wordfence_ls_version';
const USERS_PER_PAGE = 25;
const SHORTCODE_2FA_MANAGEMENT = 'wordfence_2fa_management';
const WOOCOMMERCE_ENDPOINT = 'wordfence-2fa';
private $management_assets_registered = false;
private $management_assets_enqueued = false;
private $use_core_font_awesome_styles = null;
* Returns the singleton Controller_Wordfence2FA.
* @return Controller_WordfenceLS
public static function shared() {
$_shared = new Controller_WordfenceLS();
Controller_AJAX::shared()->init();
Controller_Users::shared()->init();
Controller_Time::shared()->init();
Controller_Permissions::shared()->init();
protected function _init_actions() {
register_activation_hook(WORDFENCE_LS_FCPATH, array($this, '_install_plugin'));
register_deactivation_hook(WORDFENCE_LS_FCPATH, array($this, '_uninstall_plugin'));
$versionInOptions = ((is_multisite() && function_exists('get_network_option')) ? get_network_option(null, self::VERSION_KEY, false) : get_option(self::VERSION_KEY, false));
if (!$versionInOptions || version_compare(WORDFENCE_LS_VERSION, $versionInOptions, '>')) { //Either there is no version in options or the version in options is greater and we need to run the upgrade
if (!Controller_Settings::shared()->get_bool(Controller_Settings::OPTION_ALLOW_XML_RPC)) {
add_filter('xmlrpc_enabled', array($this, '_block_xml_rpc'));
add_action('admin_init', array($this, '_admin_init'));
add_action('login_enqueue_scripts', array($this, '_login_enqueue_scripts'));
add_filter('authenticate', array($this, '_authenticate'), 25, 3);
add_action('set_logged_in_cookie', array($this, '_set_logged_in_cookie'), 25, 4);
add_action('wp_login', array($this, '_record_login'), 999, 1);
add_action('register_post', array($this, '_register_post'), 25, 3);
add_filter('wp_login_errors', array($this, '_wp_login_errors'), 25, 3);
if ($this->is_woocommerce_integration_enabled()) {
$this->init_woocommerce_actions();
add_action('user_new_form', array($this, '_user_new_form'));
add_action('user_register', array($this, '_user_register'));
$useSubmenu = WORDFENCE_LS_FROM_CORE;
if (is_multisite() && !is_network_admin()) {
add_action('admin_menu', array($this, '_admin_menu'), $useSubmenu ? 55 : 10);
add_action('network_admin_menu', array($this, '_admin_menu'), $useSubmenu ? 55 : 10);
add_action('admin_enqueue_scripts', array($this, '_admin_enqueue_scripts'));
add_action('show_user_profile', array($this, '_edit_user_profile'), 0); //We can't add it to the password section directly -- priority 0 is as close as we can get
add_action('edit_user_profile', array($this, '_edit_user_profile'), 0);
add_action('init', array($this, '_wordpress_init'));
if ($this->is_shortcode_enabled())
add_action('wp_enqueue_scripts', array($this, '_handle_shortcode_prerequisites'));
Controller_Permissions::_init_actions();
public function _wordpress_init() {
if (!WORDFENCE_LS_FROM_CORE)
load_plugin_textdomain('wordfence-login-security', false, WORDFENCE_LS_PATH . 'languages');
if ($this->is_shortcode_enabled())
add_shortcode(self::SHORTCODE_2FA_MANAGEMENT, array($this, '_handle_user_2fa_management_shortcode'));
private function init_woocommerce_actions() {
add_action('woocommerce_before_customer_login_form', array($this, '_woocommerce_login_enqueue_scripts'));
add_action('woocommerce_before_checkout_form', array($this, '_woocommerce_checkout_login_enqueue_scripts'));
add_action('wp_loaded', array($this, '_handle_woocommerce_registration'), 10, 0); //Woocommerce uses priority 20
if ($this->is_woocommerce_account_integration_enabled()) {
add_filter('woocommerce_account_menu_items', array($this, '_woocommerce_account_menu_items'));
add_filter('woocommerce_account_wordfence-2fa_endpoint', array($this, '_woocommerce_account_menu_content'));
add_filter('woocommerce_get_query_vars', array($this, '_woocommerce_get_query_vars'));
add_action('wp_enqueue_scripts', array($this, '_woocommerce_account_enqueue_assets'));
public function _admin_init() {
if (WORDFENCE_LS_FROM_CORE) {
\wfModuleController::shared()->addOptionIndex('wfls-option-enable-2fa-roles', __('Login Security: Enable 2FA for these roles', 'wordfence'));
\wfModuleController::shared()->addOptionIndex('wfls-option-allow-remember', __('Login Security: Allow remembering device for 30 days', 'wordfence'));
\wfModuleController::shared()->addOptionIndex('wfls-option-require-2fa-xml-rpc', __('Login Security: Require 2FA for XML-RPC call authentication', 'wordfence'));
\wfModuleController::shared()->addOptionIndex('wfls-option-disable-xml-rpc', __('Login Security: Disable XML-RPC authentication', 'wordfence'));
\wfModuleController::shared()->addOptionIndex('wfls-option-whitelist-2fa', __('Login Security: Allowlisted IP addresses that bypass 2FA and reCAPTCHA', 'wordfence'));
\wfModuleController::shared()->addOptionIndex('wfls-option-enable-captcha', __('Login Security: Enable reCAPTCHA on the login and user registration pages', 'wordfence'));
$title = __('Login Security Options', 'wordfence');
$description = __('Login Security options are available on the Login Security options page', 'wordfence');
$url = esc_url(network_admin_url('admin.php?page=WFLS#top#settings'));
$link = __('Login Security Options', 'wordfence');;
\wfModuleController::shared()->addOptionBlock(<<<END
<div class="wf-col-xs-12">
<div class="wf-block wf-always-active" data-persistence-key="">
<div class="wf-block-header">
<div class="wf-block-header-content">
<div class="wf-block-title">
<strong>{$title}</strong>
<div class="wf-block-content">
<ul class="wf-block-list">
<ul class="wf-flex-horizontal wf-flex-vertical-xs wf-flex-full-width wf-add-top wf-add-bottom">
<li class="wf-right wf-left-xs wf-padding-add-top-xs-small">
<a href="{$url}" class="wf-btn wf-btn-primary wf-btn-callout-subtle" id="wf-login-security-options">{$link}</a>
<input type="hidden" id="wfls-option-enable-2fa-roles">
<input type="hidden" id="wfls-option-allow-remember">
<input type="hidden" id="wfls-option-require-2fa-xml-rpc">
<input type="hidden" id="wfls-option-disable-xml-rpc">
<input type="hidden" id="wfls-option-whitelist-2fa">
<input type="hidden" id="wfls-option-enable-captcha">
</div> <!-- end ls options -->
if (Controller_Permissions::shared()->can_manage_settings()) {
if ((is_plugin_active('jetpack/jetpack.php') || (is_multisite() && is_plugin_active_for_network('jetpack/jetpack.php'))) && !Controller_Settings::shared()->get_bool(Controller_Settings::OPTION_ALLOW_XML_RPC)) {
add_action('network_admin_notices', array($this, '_jetpack_xml_rpc_notice'));
add_action('admin_notices', array($this, '_jetpack_xml_rpc_notice'));
if (Controller_Settings::shared()->get_bool(Controller_Settings::OPTION_CAPTCHA_TEST_MODE) && Controller_CAPTCHA::shared()->enabled()) {
add_action('network_admin_notices', array($this, '_recaptcha_test_notice'));
add_action('admin_notices', array($this, '_recaptcha_test_notice'));
if ($this->has_woocommerce() && !Controller_Settings::shared()->get_bool(Controller_Settings::OPTION_ENABLE_WOOCOMMERCE_INTEGRATION)) {
if (!Controller_Notices::shared()->is_persistent_notice_dismissed(get_current_user_id(), Controller_Notices::PERSISTENT_NOTICE_WOOCOMMERCE_INTEGRATION)) {
Controller_Notices::shared()->register_persistent_notice(Controller_Notices::PERSISTENT_NOTICE_WOOCOMMERCE_INTEGRATION);
add_action(is_multisite() ? 'network_admin_notices' : 'admin_notices', array($this, '_woocommerce_integration_notice'));
public function _jetpack_xml_rpc_notice() {
echo '<div class="notice notice-warning"><p>' . wp_kses(sprintf(__('XML-RPC authentication is disabled. Jetpack is currently active and requires XML-RPC authentication to work correctly. <a href="%s">Manage Settings</a>', 'wordfence'), esc_url(network_admin_url('admin.php?page=WFLS#top#settings'))), array('a'=>array('href'=>array()))) . '</p></div>';
public function _recaptcha_test_notice() {
echo '<div class="notice notice-warning"><p>' . wp_kses(sprintf(__('reCAPTCHA test mode is enabled. While enabled, login and registration requests will be checked for their score but will not be blocked if the score is below the minimum score. <a href="%s">Manage Settings</a>', 'wordfence'), esc_url(network_admin_url('admin.php?page=WFLS#top#settings'))), array('a'=>array('href'=>array()))) . '</p></div>';
public function _woocommerce_integration_notice() {
<div id="<?php echo esc_attr(Controller_Notices::PERSISTENT_NOTICE_WOOCOMMERCE_INTEGRATION) ?>" class="notice notice-warning is-dismissible wfls-persistent-notice">
<?php esc_html_e('WooCommerce appears to be installed, but the Wordfence Login Security WooCommerce integration is not currently enabled. Without this feature, WooCommerce forms will not support all functionality provided by Wordfence Login Security, including CAPTCHA for the login page and user registration.', 'wordfence'); ?>
<a href="<?php echo esc_attr(esc_url(network_admin_url('admin.php?page=WFLS#top#settings'))) ?>"><?php esc_html_e('Manage Settings', 'wordfence') ?></a>
* Installation/Uninstallation
public function _install_plugin() {
public function _uninstall_plugin() {
Controller_Time::shared()->uninstall();
Controller_Permissions::shared()->uninstall();
foreach (array(self::VERSION_KEY) as $opt) {
if (is_multisite() && function_exists('delete_network_option')) {
delete_network_option(null, $opt);
if (Controller_Settings::shared()->get_bool(Controller_Settings::OPTION_DELETE_ON_DEACTIVATION)) {
Controller_DB::shared()->uninstall();
$this->purge_rewrite_rules();
protected function _install() {
static $_runInstallCalled = false;
if ($_runInstallCalled) { return; }
$_runInstallCalled = true;
if (function_exists('ignore_user_abort')) {
@ignore_user_abort(true);
if (!defined('DONOTCACHEDB')) { define('DONOTCACHEDB', true); }
$previousVersion = ((is_multisite() && function_exists('get_network_option')) ? get_network_option(null, self::VERSION_KEY, '0.0.0') : get_option(self::VERSION_KEY, '0.0.0'));
if (is_multisite() && function_exists('update_network_option')) {
update_network_option(null, self::VERSION_KEY, WORDFENCE_LS_VERSION); //In case we have a fatal error we don't want to keep running install.
update_option(self::VERSION_KEY, WORDFENCE_LS_VERSION); //In case we have a fatal error we don't want to keep running install.
Controller_DB::shared()->install();
Controller_Settings::shared()->set_defaults();
if (\WordfenceLS\Controller_Time::time() > Controller_Settings::shared()->get_int(Controller_Settings::OPTION_LAST_SECRET_REFRESH) + 180 * 86400) {
Model_Crypto::refresh_secrets();
Controller_Time::shared()->install();
Controller_Permissions::shared()->install();
$this->purge_rewrite_rules();
private function purge_rewrite_rules() {
// This is usually done internally in WP_Rewrite::flush_rules, but is followed there by WP_Rewrite::wp_rewrite_rules which repopulates it. This should cause it to be repopulated on the next request.
update_option('rewrite_rules', '');
* In most cases, this will be done internally by WooCommerce since we are using the woocommerce_get_query_vars filter, but when toggling the option on our settings page we must still do this manually
private function register_rewrite_endpoints() {
add_rewrite_endpoint(self::WOOCOMMERCE_ENDPOINT, $this->is_woocommerce_account_integration_enabled() ? EP_PAGES : EP_NONE);
public function refresh_rewrite_rules() {
$this->register_rewrite_endpoints();
public function _block_xml_rpc() {
* Fires just prior to blocking an XML-RPC request. After firing this action hook the XML-RPC request is blocked.
* @param int $source The source code of the block.
do_action('wfls_xml_rpc_blocked', 2);
private function has_woocommerce() {
return class_exists('woocommerce');
private function is_woocommerce_integration_enabled() {
return Controller_Settings::shared()->get_bool(Controller_Settings::OPTION_ENABLE_WOOCOMMERCE_INTEGRATION);
private function is_woocommerce_account_integration_enabled() {
return $this->is_woocommerce_integration_enabled() && Controller_Settings::shared()->get_bool(Controller_Settings::OPTION_ENABLE_WOOCOMMERCE_ACCOUNT_INTEGRATION);
private function is_shortcode_enabled() {
return Controller_Settings::shared()->get_bool(Controller_Settings::OPTION_ENABLE_SHORTCODE);
public function _woocommerce_login_enqueue_scripts() {
wp_enqueue_style('dashicons');
$this->_login_enqueue_scripts();
public function _woocommerce_checkout_login_enqueue_scripts() {
* This is the same check used in WooCommerce to determine whether or not to display the checkout login form
* @see templates/checkout/form-login.php in WooCommerce
if ( is_user_logged_in() || 'no' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ) {
$this->_woocommerce_login_enqueue_scripts();
public function _login_enqueue_scripts() {
$useCAPTCHA = Controller_CAPTCHA::shared()->enabled();
wp_enqueue_script('wordfence-ls-recaptcha', 'https://www.google.com/recaptcha/api.js?render=' . urlencode(Controller_Settings::shared()->get(Controller_Settings::OPTION_RECAPTCHA_SITE_KEY)));
if ($useCAPTCHA || Controller_Users::shared()->any_2fa_active()) {
$this->validate_email_verification_token(null, $verification);
Model_Script::create('wordfence-ls-login', Model_Asset::js('login.js'), array('jquery'), WORDFENCE_LS_VERSION)
->withTranslations(array(
'Message to Support' => __('Message to Support', 'wordfence'),
'Send' => __('Send', 'wordfence'),
'An error was encountered while trying to send the message. Please try again.' => __('An error was encountered while trying to send the message. Please try again.', 'wordfence'),
'<strong>ERROR</strong>: An error was encountered while trying to send the message. Please try again.' => wp_kses(__('<strong>ERROR</strong>: An error was encountered while trying to send the message. Please try again.', 'wordfence'), array('strong' => array())),
'Login failed with status code 403. Please contact the site administrator.' => __('Login failed with status code 403. Please contact the site administrator.', 'wordfence'),
'<strong>ERROR</strong>: Login failed with status code 403. Please contact the site administrator.' => wp_kses(__('<strong>ERROR</strong>: Login failed with status code 403. Please contact the site administrator.', 'wordfence'), array('strong' => array())),
'Login failed with status code 503. Please contact the site administrator.' => __('Login failed with status code 503. Please contact the site administrator.', 'wordfence'),
'<strong>ERROR</strong>: Login failed with status code 503. Please contact the site administrator.' => wp_kses(__('<strong>ERROR</strong>: Login failed with status code 503. Please contact the site administrator.', 'wordfence'), array('strong' => array())),
'Wordfence 2FA Code' => __('Wordfence 2FA Code', 'wordfence'),
'Remember for 30 days' => __('Remember for 30 days', 'wordfence'),
'Log In' => __('Log In', 'wordfence'),
'<strong>ERROR</strong>: An error was encountered while trying to authenticate. Please try again.' => wp_kses(__('<strong>ERROR</strong>: An error was encountered while trying to authenticate. Please try again.', 'wordfence'), array('strong' => array())),
'The Wordfence 2FA Code can be found within the authenticator app you used when first activating two-factor authentication. You may also use one of your recovery codes.' => __('The Wordfence 2FA Code can be found within the authenticator app you used when first activating two-factor authentication. You may also use one of your recovery codes.', 'wordfence')
->setTranslationObjectName('WFLS_LOGIN_TRANSLATIONS')
wp_enqueue_style('wordfence-ls-login', Model_Asset::css('login.css'), array(), WORDFENCE_LS_VERSION);
wp_localize_script('wordfence-ls-login', 'WFLSVars', array(
'ajaxurl' => Utility_URL::relative_admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('wp-ajax'),
'recaptchasitekey' => Controller_Settings::shared()->get(Controller_Settings::OPTION_RECAPTCHA_SITE_KEY),
'useCAPTCHA' => $useCAPTCHA,
'allowremember' => Controller_Settings::shared()->get_bool(Controller_Settings::OPTION_REMEMBER_DEVICE_ENABLED),
'verification' => $verification,
private function get_2fa_management_script_data() {
'ajaxurl' => Utility_URL::relative_admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('wp-ajax'),
'modalTemplate' => Model_View::create('common/modal-prompt', array('title' => '${title}', 'message' => '${message}', 'primaryButton' => array('id' => 'wfls-generic-modal-close', 'label' => __('Close', 'wordfence'), 'link' => '#')))->render(),
'modalNoButtonsTemplate' => Model_View::create('common/modal-prompt', array('title' => '${title}', 'message' => '${message}'))->render(),
'tokenInvalidTemplate' => Model_View::create('common/modal-prompt', array('title' => '${title}', 'message' => '${message}', 'primaryButton' => array('id' => 'wfls-token-invalid-modal-reload', 'label' => __('Reload', 'wordfence'), 'link' => '#')))->render(),
'modalHTMLTemplate' => Model_View::create('common/modal-prompt', array('title' => '${title}', 'message' => '{{html message}}', 'primaryButton' => array('id' => 'wfls-generic-modal-close', 'label' => __('Close', 'wordfence'), 'link' => '#')))->render()
public function should_use_core_font_awesome_styles() {
if ($this->use_core_font_awesome_styles === null) {
$this->use_core_font_awesome_styles = wp_style_is('wordfence-font-awesome-style');
return $this->use_core_font_awesome_styles;
private function get_2fa_management_assets($embedded = false) {
Model_Script::create('wordfence-ls-jquery.qrcode', Model_Asset::js('jquery.qrcode.min.js'), array('jquery'), WORDFENCE_LS_VERSION),
Model_Script::create('wordfence-ls-jquery.tmpl', Model_Asset::js('jquery.tmpl.min.js'), array('jquery'), WORDFENCE_LS_VERSION),
Model_Script::create('wordfence-ls-jquery.colorbox', Model_Asset::js('jquery.colorbox.min.js'), array('jquery'), WORDFENCE_LS_VERSION)
if (Controller_Permissions::shared()->can_manage_settings()) {
$assets[] = Model_Style::create('wordfence-ls-jquery-ui-css', Model_Asset::css('jquery-ui.min.css'), array(), WORDFENCE_LS_VERSION);
$assets[] = Model_Style::create('wordfence-ls-jquery-ui-css.structure', Model_Asset::css('jquery-ui.structure.min.css'), array(), WORDFENCE_LS_VERSION);
$assets[] = Model_Style::create('wordfence-ls-jquery-ui-css.theme', Model_Asset::css('jquery-ui.theme.min.css'), array(), WORDFENCE_LS_VERSION);
$assets[] = Model_Script::create('wordfence-ls-admin', Model_Asset::js('admin.js'), array('jquery'), WORDFENCE_LS_VERSION)
->withTranslation('You have unsaved changes to your options. If you leave this page, those changes will be lost.', __('You have unsaved changes to your options. If you leave this page, those changes will be lost.', 'wordfence'))
->setTranslationObjectName('WFLS_ADMIN_TRANSLATIONS');
Model_Script::create('chart-js', Model_Asset::js('chart.umd.js'), array('jquery'), '4.2.1')->setRegistered(),
Model_Script::create('wordfence-select2-js', Model_Asset::js('wfselect2.min.js'), array('jquery'), WORDFENCE_LS_VERSION)->setRegistered(),
Model_Style::create('wordfence-select2-css', Model_Asset::css('wfselect2.min.css'), array(), WORDFENCE_LS_VERSION)->setRegistered()
if (!WORDFENCE_LS_FROM_CORE && !$this->management_assets_registered) {
foreach ($registered as $asset)
$this->management_assets_registered = true;
$assets = array_merge($assets, $registered);
$assets[] = Model_Style::create('wordfence-ls-admin', Model_Asset::css('admin.css'), array(), WORDFENCE_LS_VERSION);
$assets[] = Model_Style::create('wordfence-ls-colorbox', Model_Asset::css('colorbox.css'), array(), WORDFENCE_LS_VERSION);
$assets[] = Model_Style::create('wordfence-ls-ionicons', Model_Asset::css('ionicons.css'), array(), WORDFENCE_LS_VERSION);
$assets[] = Model_Style::create('dashicons');
$assets[] = Model_Style::create('wordfence-ls-embedded', Model_Asset::css('embedded.css'), array(), WORDFENCE_LS_VERSION);
if (!$this->should_use_core_font_awesome_styles()) {
$assets[] = Model_Style::create('wordfence-ls-font-awesome', Model_Asset::css('font-awesome.css'), array(), WORDFENCE_LS_VERSION);
private function enqueue_2fa_management_assets($embedded = false) {
if ($this->management_assets_enqueued)
foreach ($this->get_2fa_management_assets($embedded) as $asset)
foreach ($this->get_2fa_management_script_data() as $key => $data)
wp_localize_script('wordfence-ls-admin', $key, $data);
$this->management_assets_enqueued = true;
public function _admin_enqueue_scripts($hookSuffix) {
if (isset($_GET['page']) && $_GET['page'] == 'WFLS') {
$this->enqueue_2fa_management_assets();
wp_enqueue_style('wordfence-ls-admin-global', Model_Asset::css('admin-global.css'), array(), WORDFENCE_LS_VERSION);
if (Controller_Notices::shared()->has_notice(wp_get_current_user()) || in_array($hookSuffix, array('user-edit.php', 'user-new.php', 'profile.php'))) {
wp_enqueue_script('wordfence-ls-admin-global', Model_Asset::js('admin-global.js'), array('jquery'), WORDFENCE_LS_VERSION);
wp_localize_script('wordfence-ls-admin-global', 'GWFLSVars', array(
'ajaxurl' => admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('wp-ajax'),
public function _edit_user_profile($user) {
if ($user->ID == get_current_user_id() || !current_user_can(Controller_Permissions::CAP_ACTIVATE_2FA_OTHERS)) {
$manageURL = admin_url('admin.php?page=WFLS');
$manageURL = admin_url('admin.php?page=WFLS&user=' . ((int) $user->ID));
if (is_multisite() && is_super_admin()) {
if ($user->ID == get_current_user_id()) {
$manageURL = network_admin_url('admin.php?page=WFLS');
$manageURL = network_admin_url('admin.php?page=WFLS&user=' . ((int) $user->ID));
$userAllowed2fa = Controller_Users::shared()->can_activate_2fa($user);
$viewerIsUser = $user->ID == get_current_user_id();
$viewerCanManage2fa = current_user_can(Controller_Permissions::CAP_ACTIVATE_2FA_OTHERS);
$requires2fa = Controller_Users::shared()->requires_2fa($user, $inGracePeriod, $requiredAt);
$has2fa = Controller_Users::shared()->has_2fa_active($user);
$lockedOut = $requires2fa && !$has2fa;
$hasGracePeriod = Controller_Settings::shared()->get_user_2fa_grace_period() > 0;
if ($userAllowed2fa && ($viewerIsUser || $viewerCanManage2fa)):
<h2 id="wfls-user-settings"><?php esc_html_e('Wordfence Login Security', 'wordfence'); ?></h2>
<table class="form-table">
<th><label for="wordfence-ls-btn"><?php esc_html_e('2FA Status', 'wordfence'); ?></label></th>
<?php if ($userAllowed2fa): ?>
<strong><?php echo $lockedOut ? esc_html__('Locked Out', 'wordfence') : ($has2fa ? esc_html__('Active', 'wordfence') : esc_html__('Inactive', 'wordfence')); ?>:</strong>
($viewerIsUser ? esc_html__('Two-factor authentication is required for your account, but has not been configured.', 'wordfence') : esc_html__('Two-factor authentication is required for this account, but has not been configured.', 'wordfence'))
: ($has2fa ? esc_html__('Wordfence 2FA is active.', 'wordfence') : esc_html__('Wordfence 2FA is inactive.', 'wordfence')); ?>
<a href="<?php echo Controller_Support::esc_supportURL(Controller_Support::ITEM_MODULE_LOGIN_SECURITY_2FA); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Learn More', 'wordfence'); ?></a>
<?php if (!$has2fa && $inGracePeriod): ?>
<p><strong><?php echo sprintf($viewerIsUser ?
esc_html__('Two-factor authentication must be activated for your account prior to %s to avoid losing access.', 'wordfence')
: esc_html__('Two-factor authentication must be activated for this account prior to %s.', 'wordfence')
, Controller_Time::format_local_time('F j, Y g:i A', $requiredAt)) ?></strong></p>