Title: KHALAF Mobile Authenticator &amp; 2FA
Author: Ahmed Khalaf
Published: <strong>December 2, 2026</strong>
Last modified: December 2, 2026

---

Search plugins

![](https://ps.w.org/khalaf-mobile-authenticator-2fa/assets/banner-772x250.png?rev
=3840743)

![](https://ps.w.org/khalaf-mobile-authenticator-2fa/assets/icon-256x256.png?rev
=3840743)

# KHALAF Mobile Authenticator & 2FA

 By [Ahmed Khalaf](https://profiles.wordpress.org/khalaf22/)

[Download](https://downloads.wordpress.org/plugin/khalaf-mobile-authenticator-2fa.1.0.0.zip)

 * [Details](https://wordpress.org/plugins/khalaf-mobile-authenticator-2fa/#description)
 * [Reviews](https://wordpress.org/plugins/khalaf-mobile-authenticator-2fa/#reviews)
 *  [Installation](https://wordpress.org/plugins/khalaf-mobile-authenticator-2fa/#installation)
 * [Development](https://wordpress.org/plugins/khalaf-mobile-authenticator-2fa/#developers)

 [Support](https://wordpress.org/support/plugin/khalaf-mobile-authenticator-2fa/)

## Description

**KHALAF Mobile Authenticator & 2FA** adds Two-Factor Authentication (2FA) to your
WordPress website without subscriptions or third-party cloud dependencies.

Protect your admin dashboard and user accounts against brute-force attacks, credential
stuffing, and password leaks using standard Time-Based One-Time Passwords (TOTP)
and Email OTP fallback.

### Key Features

 * **Universal Mobile Authenticator Compatibility**: Works with Google Authenticator,
   Microsoft Authenticator, 2FAS, Authy, and any standard RFC 6238 TOTP authenticator
   app on iOS and Android.
 * **Email OTP Verification Fallback**: Request a temporary, one-time 6-digit login
   verification code sent to your registered account email address.
 * **Privacy & Local QR Generation**: QR codes are generated directly in your browser
   using local client-side scripts. Your 2FA secrets are never sent to external 
   APIs or remote servers.
 * **Brute-Force & Rate Limiting Defense**: Automatic lockout after consecutive 
   failed verification attempts with a live countdown timer.
 * **Hashed Emergency Backup Codes**: Generates 8 single-use recovery codes stored
   as WordPress password hashes. Download as `.txt` or send them to your email during
   setup.
 * **Role-Based 2FA Enforcement**: Require 2FA for all Administrators or specific
   user roles (Editor, Author, Shop Manager, etc.).
 * **Admin Setup Enforcement**: Enforced users are restricted to the 2FA setup screen
   until they configure their 2FA credentials.
 * **Application Passwords Shield**: Automatically disables core application passwords
   for 2FA-protected accounts when enabled in settings.
 * **Lightweight Architecture**: No custom database tables created. Uses standard
   WordPress options, transients, and user meta.

### How the Email OTP Fallback Works

When logging in, users can click “Send Code to Email”. The plugin generates a cryptographically
random 6-digit code, stores it as an expiring hash transient (5-minute validity),
and emails it to the user. A 60-second cooldown prevents repeated email requests.
The same login input accepts the code.

### Third-Party Libraries

 * **QRCode.js** (`assets/js/qrcode.min.js`, full unminified source included at `
   assets/js/qrcode.js`) — Client-side QR code generator, licensed under the MIT
   License (https://github.com/davidshimjs/qrcodejs).

## Screenshots

[⌊Setup screen with local QR code generation, manual entry key, and authenticator
app links.⌉⌊Setup screen with local QR code generation, manual entry key, and authenticator
app links.⌉[

Setup screen with local QR code generation, manual entry key, and authenticator 
app links.

[⌊Login screen with 2FA verification step and Email OTP fallback button.⌉⌊Login 
screen with 2FA verification step and Email OTP fallback button.⌉[

Login screen with 2FA verification step and Email OTP fallback button.

[⌊Brute-force protection lockout card with interactive countdown timer.⌉⌊Brute-force
protection lockout card with interactive countdown timer.⌉[

Brute-force protection lockout card with interactive countdown timer.

[⌊Comprehensive settings hub: policy enforcement, role selection, rate limiting,
and backup codes management.⌉⌊Comprehensive settings hub: policy enforcement, role
selection, rate limiting, and backup codes management.⌉[

Comprehensive settings hub: policy enforcement, role selection, rate limiting, and
backup codes management.

## Installation

 1. Upload the plugin files to the `/wp-content/plugins/khalaf-mobile-authenticator-
    2fa` directory, or install directly through the WordPress plugins screen.
 2. Activate the plugin through the **Plugins** screen in WordPress.
 3. Navigate to **KHALAF 2FA  My 2FA Security** (or your User Profile) to scan your
    QR code with your mobile authenticator app.
 4. Enter the 6-digit code from your mobile app and click **Verify & Enable**.
 5. Save your 8 emergency backup codes.

## FAQ

### Which mobile authenticator apps are supported?

Any application supporting the standard RFC 6238 TOTP protocol is supported, including:
*
Google Authenticator (Android / iOS) * Microsoft Authenticator (Android / iOS) *
2FAS Authenticator (Open Source, Android / iOS) * Twilio Authy * Bitwarden / 1Password/
Apple Keychain

### What happens if I lose my phone?

You have two immediate recovery methods:
 1. **Email OTP Fallback**: Click “Send
Code to Email” on the login screen to receive a single-use 6-digit code. 2. **Emergency
Backup Codes**: Enter any of the 8 recovery codes generated when you set up 2FA.

### What if the Primary Administrator loses both their phone and backup codes?

For security, other administrators cannot disable 2FA on the Primary Administrator’s
account from the WordPress dashboard. In that situation, the Primary Administrator
can still log in using **Email OTP Fallback** (if enabled) or recover access directly
via the database by deleting the `_two_fa_khalaf_enabled` user meta row for their
user ID.

### Are QR codes generated through Google Charts or any external service?

No. For maximum privacy and security, QR codes are generated 100% locally in your
browser using client-side JavaScript. Your secret key never leaves your server.

### Can administrators enforce 2FA for specific user roles?

Yes. In the **KHALAF 2FA  Settings** panel, administrators can enforce two-factor
authentication on all administrators or any specific user roles (e.g., Shop Manager,
Editor).

### Does this plugin slow down my site?

The plugin has zero external dependencies, makes no external HTTP requests, and 
loads assets only on the login screen and dedicated 2FA administration screens.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“KHALAF Mobile Authenticator & 2FA” is open source software. The following people
have contributed to this plugin.

Contributors

 *   [ Ahmed Khalaf ](https://profiles.wordpress.org/khalaf22/)

[Translate “KHALAF Mobile Authenticator & 2FA” into your language.](https://translate.wordpress.org/projects/wp-plugins/khalaf-mobile-authenticator-2fa)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/khalaf-mobile-authenticator-2fa/),
check out the [SVN repository](https://plugins.svn.wordpress.org/khalaf-mobile-authenticator-2fa/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/khalaf-mobile-authenticator-2fa/)
by [RSS](https://plugins.trac.wordpress.org/log/khalaf-mobile-authenticator-2fa/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * Initial public release.
 * Added TOTP authentication for all standard mobile authenticator apps.
 * Added Email OTP verification fallback with cooldown rate limiting.
 * Added hashed emergency backup codes.
 * Added brute-force lockout protection with live countdown timer.
 * Added role-based 2FA enforcement and administrative settings hub.

## Meta

 *  Version **1.0.0**
 *  Last updated **13 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 5.8 or higher **
 *  Tested up to **7.1.5**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [2FA](https://wordpress.org/plugins/tags/2fa/)[Authenticator](https://wordpress.org/plugins/tags/authenticator/)
   [security](https://wordpress.org/plugins/tags/security/)[totp](https://wordpress.org/plugins/tags/totp/)
   [two factor authentication](https://wordpress.org/plugins/tags/two-factor-authentication/)
 *  [Advanced View](https://wordpress.org/plugins/khalaf-mobile-authenticator-2fa/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/khalaf-mobile-authenticator-2fa/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/khalaf-mobile-authenticator-2fa/reviews/)

## Contributors

 *   [ Ahmed Khalaf ](https://profiles.wordpress.org/khalaf22/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/khalaf-mobile-authenticator-2fa/)