PHPackages                             dxw/2fa - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. dxw/2fa

ActiveWordpress-plugin[Authentication &amp; Authorization](/categories/authentication)

dxw/2fa
=======

WordPress plugin for 2 factor authentication (TOTP and SMS)

v2.0.4(4d ago)6192[5 issues](https://github.com/dxw/2fa/issues)[3 PRs](https://github.com/dxw/2fa/pulls)MITPHPCI passing

Since Aug 25Pushed 4d ago18 watchersCompare

[ Source](https://github.com/dxw/2fa)[ Packagist](https://packagist.org/packages/dxw/2fa)[ RSS](/packages/dxw-2fa/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (7)Dependencies (16)Versions (25)Used By (0)

2fa
===

[](#2fa)

WordPress plugin for 2 factor authentication (TOTP and SMS)

Installation
------------

[](#installation)

At the moment this plugin must be installed on a multisite installation.

To enable SMS authentication add these constants to your wp-config.php:

```
define('TWILIO_ACCOUNT_SID', 'AC...');
define('TWILIO_AUTH_TOKEN', '...');
define('TWILIO_NUMBER', '...');

```

You can find those [here](https://www.twilio.com/user/account/voice-sms-mms/getting-started).

To disable 2FA options from being selectable, add constants as follows:

- `2FA_SMS_DISABLED` to disable SMS (for example if no Twilio account is setup)
- `2FA_SMART_DEVICE_DISABLED` to disable smartphone or tablet option

Usage
-----

[](#usage)

Super admins can decide which users must use 2FA. Users cannot opt to start using 2FA if it has not been enabled for their account.

Super admins can do this in two ways - setting an option on the user's profile to "enabled", or by checking the checkbox in the list of sites which forces all users of a site to use 2FA.

Users will then be forced to setup 2FA the next time they log in (it will not interrupt a user who is already logged in).

They have the option of using TOTP (apps like Google Authenticator) or SMS. And they can configure up to 2 devices (controlled by a constant).

Admins can also set the number of days users can skip requests for their second factor when logging in.

wp-cli command
--------------

[](#wp-cli-command)

```
% wp 2fa fails
% wp 2fa user alice
% wp 2fa reset bob

```

Tests
-----

[](#tests)

Unit tests and linter:

```
% composer install
% vendor/bin/peridot spec
% vendor/bin/php-cs-fixer fix --dry-run -v --diff

```

Integration tests:

```
% tests/run-with-docker.sh

```

Licence
-------

[](#licence)

MIT

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance83

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 62.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~101 days

Recently: every ~135 days

Total

10

Last Release

4d ago

Major Versions

v1.0.4 → v2.0.02024-11-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/370665?v=4)[Rob Skilling](/maintainers/RobjS)[@RobjS](https://github.com/RobjS)

![](https://avatars.githubusercontent.com/u/1659723?v=4)[jkeasley](/maintainers/jkeasley)[@jkeasley](https://github.com/jkeasley)

![](https://avatars.githubusercontent.com/u/4721596?v=4)[Matthew Passmore](/maintainers/matpassmore)[@matpassmore](https://github.com/matpassmore)

![](https://avatars.githubusercontent.com/u/71827088?v=4)[Serena Piccioni](/maintainers/serena-piccioni)[@serena-piccioni](https://github.com/serena-piccioni)

---

Top Contributors

[![mallorydxw](https://avatars.githubusercontent.com/u/2256130?v=4)](https://github.com/mallorydxw "mallorydxw (195 commits)")[![RobjS](https://avatars.githubusercontent.com/u/370665?v=4)](https://github.com/RobjS "RobjS (43 commits)")[![snim2](https://avatars.githubusercontent.com/u/97674?v=4)](https://github.com/snim2 "snim2 (28 commits)")[![brent-dxw](https://avatars.githubusercontent.com/u/78494056?v=4)](https://github.com/brent-dxw "brent-dxw (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (15 commits)")[![leedxw](https://avatars.githubusercontent.com/u/14332273?v=4)](https://github.com/leedxw "leedxw (8 commits)")[![patdel0](https://avatars.githubusercontent.com/u/53922624?v=4)](https://github.com/patdel0 "patdel0 (4 commits)")[![leeky](https://avatars.githubusercontent.com/u/3166?v=4)](https://github.com/leeky "leeky (2 commits)")[![robbiepaul](https://avatars.githubusercontent.com/u/2804149?v=4)](https://github.com/robbiepaul "robbiepaul (1 commits)")[![dxw-rails-user](https://avatars.githubusercontent.com/u/24606521?v=4)](https://github.com/dxw-rails-user "dxw-rails-user (1 commits)")

---

Tags

govpresspackagistphpwordpress-plugin

### Embed Badge

![Health badge](/badges/dxw-2fa/health.svg)

```
[![Health](https://phpackages.com/badges/dxw-2fa/health.svg)](https://phpackages.com/packages/dxw-2fa)
```

###  Alternatives

[buzz/laravel-google-captcha

Google captcha for Laravel

2071.1M2](/packages/buzz-laravel-google-captcha)[mageplaza/module-google-recaptcha

Magento 2 Google Recaptcha Extension

341.1M2](/packages/mageplaza-module-google-recaptcha)[msp/twofactorauth

Two Factor Authentication module for Magento2 - Member of MageSpecialist SecuritySuite

4462.1k2](/packages/msp-twofactorauth)[anam/captcha

reCAPTCHA and invisible reCAPTCHA for Laravel. reCAPTCHA protects your app against spam and bot.

2843.4k](/packages/anam-captcha)[victor-prdh/recaptcha-bundle

Use Google Recaptcha v2/v3 as form type with Symfony 6.4+, see v1.X for symfony 5.4

1274.8k](/packages/victor-prdh-recaptcha-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
