Skip to content
WordPress.org
  • Showcase
  • Plugins
  • Themes
  • Hosting
  • News
    • Learn WordPress
    • Documentation
    • Education
    • Forums
    • Developers
    • Blocks
    • Patterns
    • Photos
    • Openverse β†—οΈŽ
    • WordPress.tv β†—οΈŽ
    • About WordPress
    • Make WordPress
    • Events
    • Five for the Future
    • Enterprise
    • Gutenberg β†—οΈŽ
    • Job Board β†—οΈŽ
  • Merch β†—οΈŽ
  • Get WordPress
Get WordPress
WordPress.org

Plugin Directory

Muzzamil Two-Step Login Security

  • Submit a plugin
  • My favorites
  • Log in
  • Submit a plugin
  • My favorites
  • Log in

Muzzamil Two-Step Login Security

By Muzzamil Ahmed Khan
Download
  • Details
  • Reviews
  • Installation
  • Development
Support

Description

Muzzamil Two-Step Login Security adds strong, reliable two-factor authentication (2FA) to WordPress. It works per-account and per-user β€” each person chooses when to opt in, and nothing is forced site-wide without configuration.

There are two ways to set it up:

Option 1 β€” Automatic Setup (Recommended)
Connect your Google, Microsoft, or Facebook account in one click. The site administrator configures the OAuth app once in the settings; users never see any Client IDs or technical fields. After authorizing, users verify a quick re-login with a single dedicated button, and two-step protection is active immediately.

Option 2 β€” Manual Setup (Authenticator App)
Scan a QR code with Google Authenticator, Microsoft Authenticator, Authy, or any TOTP-compatible app, then confirm with a six-digit code. Backup one-time recovery codes are generated at setup.

Key features:

  • πŸ”’ AES-256-GCM encrypted secret storage, keyed to the site’s WordPress auth salt
  • πŸ“± Works with Google Authenticator, Microsoft Authenticator, Authy, and all TOTP apps
  • ☁️ One-click social sign-in 2FA with Google, Microsoft, or Facebook
  • πŸ”‘ One-time recovery codes (stored as keyed hashes β€” never in plain text)
  • 🚦 Rate limiting on failed verification attempts with replay prevention
  • πŸ›‘οΈ PKCE + browser-bound state cookies for all OAuth flows (Google, Microsoft)
  • πŸ“΅ QR codes are generated locally in the browser β€” no external servers contacted for TOTP
  • ⚑ Activation redirect: taken straight to the setup page the moment you activate
  • 🌐 Translation-ready with full Text Domain support

External services

This plugin provides optional social authentication and two-step verification using third-party OAuth 2.0 identity providers. The plugin communicates with these external services exclusively when a site user explicitly clicks to connect an account or sign in with that provider. No background telemetry or unsolicited requests are made.

The external services used are:

  1. Google Identity Platform (Google OAuth 2.0)

    • Purpose: Enables users to authenticate their WordPress account using their Google identity as a two-step verification method.
    • Endpoints accessed:
      • https://accounts.google.com/o/oauth2/v2/auth (User consent and authorization)
      • https://oauth2.googleapis.com/token (Authorization code exchange for tokens)
      • https://openidconnect.googleapis.com/v1/userinfo (Retrieval of unique Google user ID)
    • Data sent and when: Transmitted only when a user explicitly clicks “Sign in with Google” or “Set up with Google”. The user is directed to Google to authenticate; after consent, an authorization code is sent to obtain the account’s unique identifier.
    • Terms of Service: Google Terms of Service
    • Privacy Policy: Google Privacy Policy
  2. Microsoft Identity Platform (OAuth 2.0)

    • Purpose: Enables users to authenticate their WordPress account using their Microsoft identity as a two-step verification method.
    • Endpoints accessed:
      • https://login.microsoftonline.com/common/oauth2/v2.0/authorize (User consent and authorization)
      • https://login.microsoftonline.com/common/oauth2/v2.0/token (Authorization code exchange for tokens)
    • Data sent and when: Transmitted only when a user explicitly clicks “Sign in with Microsoft” or “Set up with Microsoft”. The authorization code is exchanged with Microsoft to retrieve the user’s unique Microsoft identifier.
    • Terms of Service: Microsoft Services Agreement
    • Privacy Policy: Microsoft Privacy Statement
  3. Meta / Facebook Login (OAuth 2.0)

    • Purpose: Enables users to authenticate their WordPress account using their Facebook identity as a two-step verification method.
    • Endpoints accessed:
      • https://www.facebook.com/v26.0/dialog/oauth (User consent and authorization)
      • https://graph.facebook.com/v26.0/oauth/access_token (Authorization code exchange for access token)
      • https://graph.facebook.com/v26.0/me?fields=id (Retrieval of unique Facebook user ID)
    • Data sent and when: Transmitted only when a user explicitly clicks “Sign in with Facebook” or “Set up with Facebook”. The authorization code is exchanged with Meta Graph API to verify the identity and retrieve the user’s account identifier.
    • Terms of Service: Meta Terms of Service
    • Privacy Policy: Meta Privacy Policy

Privacy Policy

Muzzamil Two-Step Login Security prioritizes user privacy:

  • Local TOTP Authentication: TOTP secrets, keys, and recovery hashes are stored strictly in your local WordPress database using AES-256-GCM encryption. QR codes are generated locally inside the browser. No data is sent to external servers for TOTP functionality.
  • Optional OAuth Verification: When a user chooses to sign in or link their Google, Microsoft, or Facebook account, the plugin communicates directly with that provider solely to authenticate the user and obtain their unique provider subject identifier. Tokens are not retained after authentication.
  • Brute-Force Rate Limiting: Verification attempts and timestamps are tracked locally in user metadata to prevent brute-force attacks and are never shared.
  • Zero Tracking: The plugin does not collect tracking data, analytics, cookies for marketing, or telemetry.

Support

Found a bug or need help? Please use the WordPress.org support forum for this plugin.

Developer: Muzzamil Ahmed Khan
Website: https://muzzamilahmedkhan.site/contact-me
Email: muzzamil.wpdev@gmail.com
LinkedIn: https://www.linkedin.com/in/muzzamil-ahmed-khan/

Installation

  1. Upload the muzzamil-two-step-login-security folder to /wp-content/plugins/, or install directly from the WordPress Plugin Directory.
  2. Activate Muzzamil Two-Step Login Security. You will be automatically redirected to the settings screen.
  3. Choose your preferred setup method:

Automatic Setup (Google / Microsoft / Facebook)

  • As an administrator, go to Muzzamil Two-Step Security > Social Login Settings to configure your OAuth app credentials once.
  • Users can then click Setup with Google (or Microsoft / Facebook) and authenticate with one click.

Manual Setup (Authenticator App)

  • Click Setup with Authenticator App (Scan QR Code).
  • Open your TOTP app, scan the QR code, and enter the six-digit code shown.
  • Save your recovery codes somewhere safe.
  1. Two-step protection is now active on your account.

FAQ

Does every user have to set up 2FA?

No. Enrollment is voluntary per account. A site administrator can choose to enroll their own account without affecting other users.

Which authenticator apps are supported?

Any app that supports standard TOTP: Google Authenticator, Microsoft Authenticator, Authy, 1Password, Bitwarden Authenticator, and similar apps.

What happens if I lose my phone?

Use one of your one-time backup recovery codes. If you lose both your authenticator and recovery codes, a site administrator can reset your two-step metadata.

Does social login replace my WordPress password?

When a user links Google, Microsoft, or Facebook as their second step, signing in via that provider verifies their identity without needing a separate TOTP code for that session. The WordPress password remains unchanged.

Is the QR code sent to an external service?

No. The QR code is generated entirely in the user’s browser using a bundled open-source library (qrcode-generator by Kazuhiko Arase, MIT license). Nothing leaves your server during setup.

Can I use `wp-config.php` constants for OAuth credentials?

Yes. Define ZFA_GOOGLE_CLIENT_ID, ZFA_GOOGLE_CLIENT_SECRET (and equivalent MICROSOFT / FACEBOOK variants) in wp-config.php and the plugin will use them automatically.

What are the OAuth redirect URIs I need to register?

The exact URI for each provider is shown on the Social Login Settings page. The format is:
https://yoursite.com/wp-admin/admin-post.php?action=muzzamil_two_step_oauth_callback&provider=google
(Replace google with microsoft or facebook as appropriate.)

Is this plugin free?

Yes, completely free and open source under the GPL-2.0-or-later license. There are no paid tiers, license gates, or paywalls.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Muzzamil Two-Step Login Security” is open source software. The following people have contributed to this plugin.

Contributors
  • Muzzamil Ahmed Khan

Translate “Muzzamil Two-Step Login Security” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.1.0

  • Rebranded to Muzzamil Two-Step Login Security with updated slug.
  • Add comprehensive External Services documentation in readme for Google, Microsoft, and Meta OAuth.
  • Enqueue all scripts and styles using official WordPress APIs.
  • Streamline administrator provider configuration workflow.
  • Maintain complete backward compatibility for AES-256-GCM encrypted credentials and TOTP enrollments.

1.0.0

  • Initial release: TOTP authenticator app support, AES-256-GCM encrypted secret storage, recovery codes, brute-force rate limiting, and OAuth 2.0 social verification.

Meta

  • Version 1.1.0
  • Last updated 3 hours ago
  • Active installations Fewer than 10
  • WordPress version 6.0 or higher
  • Tested up to 7.1.5
  • PHP version 7.4 or higher
  • Tags
    2FAauthenticationlogin securitytotptwo step
  • Advanced View

Ratings

No reviews have been submitted yet.

Your review

See all reviews

Contributors

  • Muzzamil Ahmed Khan

Support

Got something to say? Need help?

View support forum

  • About
  • News
  • Hosting
  • Privacy
  • Showcase
  • Themes
  • Plugins
  • Patterns
  • Learn
  • Documentation
  • Developers
  • WordPress.tv β†—
  • Get Involved
  • Events
  • Donate β†—
  • Merch β†—
  • WordPress.com β†—
  • Matt β†—
  • bbPress β†—
  • BuddyPress β†—
WordPress.org

The WordPress® trademark is the intellectual property of the WordPress Foundation.

  • Visit our X (formerly Twitter) account
  • Visit our Bluesky account
  • Visit our Mastodon account
  • Visit our Threads account
  • Visit our Facebook page
  • Visit our Instagram account
  • Visit our LinkedIn account
  • Visit our TikTok account
  • Visit our YouTube channel
  • Visit our Tumblr account
Code is Poetry