PHPackages                             danielgelling/twofactor - 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. danielgelling/twofactor

AbandonedArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

danielgelling/twofactor
=======================

This plugin provides a Two Factor Authentication interface for logging into the wp-admin

v1.0.1(10y ago)13MITPHPPHP 5.5.\*

Since Feb 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/danielgelling/TwoFactorAuth)[ Packagist](https://packagist.org/packages/danielgelling/twofactor)[ RSS](/packages/danielgelling-twofactor/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

Two Factor Authentication Wordpress Admin Plugin
================================================

[](#two-factor-authentication-wordpress-admin-plugin)

[![Total Downloads](https://camo.githubusercontent.com/fa058ec9e4232bb221e3489d1614e4e1210c3a843034ecc6865b94dc38705b32/68747470733a2f2f706f7365722e707567782e6f72672f64616e69656c67656c6c696e672f74776f666163746f722f642f746f74616c2e737667)](https://packagist.org/packages/danielgelling/twofactor)[![Latest Stable Version](https://camo.githubusercontent.com/c4d914ebcbdb0e788c6832de53fa321a87e09316de66c00ab4ee0b05e498360e/68747470733a2f2f706f7365722e707567782e6f72672f64616e69656c67656c6c696e672f74776f666163746f722f762f737461626c652e737667)](https://packagist.org/packages/danielgelling/twofactor)[![Latest Unstable Version](https://camo.githubusercontent.com/91d01e1fe0b07f94d4d2248d975a9718c5cd53af264827556ae14a97c54400f1/68747470733a2f2f706f7365722e707567782e6f72672f64616e69656c67656c6c696e672f74776f666163746f722f762f756e737461626c652e737667)](https://packagist.org/packages/danielgelling/twofactor)[![License](https://camo.githubusercontent.com/4310b2845269e0d797b465858034125ab24c220dc56de760e26f6d40fa51072c/68747470733a2f2f706f7365722e707567782e6f72672f64616e69656c67656c6c696e672f74776f666163746f722f6c6963656e73652e737667)](https://packagist.org/packages/danielgelling/twofactor)

TwoFactorAuth is a Wordpress plugin that will add an extra layer of security to your Wordpress installation. It sends a text message via the MessageBird API when someone tries to login to the Wordpress Admin.

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

[](#installation)

### Via composer

[](#via-composer)

Installating the TwoFactorAuth plugin is a breeze with [composer](https://getcomposer.org/). You can get composer at .

```
composer require danielgelling/twofactor:^1.0

```

### Via Github

[](#via-github)

Installing the TwoFactorAuth plugin via Github can either be done by cloning the repository into the `wp-content/plugins` directory or downloading a zip file from the repo page.

```
$ cd /path/to/project/wp-content/plugins
$ git clone https://github.com/danielgelling/twofactorauth.git --branch noob --single-branch twofactorauth

```

Or unzip the zipped plugin file into the plugins directory.

Configuration
-------------

[](#configuration)

### Turning on the lights

[](#turning-on-the-lights)

First we'll need to add the plugins configuration file to wp-config.php. We can do this by adding the following:

```
/*
|--------------------------------------------------------------------------
| Two Factor Authentication Configuration
|--------------------------------------------------------------------------
|
| Here we require the configuration file for the twofactorauth plugin.
|
*/

require_once dirname(__FILE__) . '/wp-content/plugins/twofactorauth/config.php';

```

Then we need to copy the example config file by executing the following command in the shell (assuming we are in the wp-content/plugins/twofactorauth directory):

```
$ cp config.example.php config.php

```

Having done this, we can add our [MessageBird](https://www.messagebird.com) API key, the amount of days after which we want to prompt the user to authenticate himself by a text message (so how long an auth\_code will be valid) we do this in days and the database table we want to use to store our auth\_codes):

```
define('MESSAGEBIRD_API_KEY', 'live_S0m3Rand0MapiKeY');
define('TWO_FACTOR_EXPIRES_IN', 30);
define('TWO_FACTOR_AUTH_TABLE', 'two_factor_logins');

```

Then we want to define the sender and the content of the text message:

```
define('CODE_TEXT_MESSAGE_SENDER', 'Your company\'s name');
define('CODE_TEXT_MESSAGE_CONTENT', 'Your code is: ');

```

Least but not last, we need to define our invalid code error message:

```
define('CODE_INVALID_MESSAGE', 'Invalid code');
define(
    'CODE_INVALID_MESSAGE_DESCRIPTION',
    'You provided an invalid authentication code.'
);

```

Activating the plugin
---------------------

[](#activating-the-plugin)

The last thing we need to do is activate the plugin in the wp-admin. This will be the last time you sign in without Two Factor Authentication, at least for the amount of days you specify to prompt for a new authentication.

So, the only thing we need to do now is click activate and our Wordpress Admin is more secure. Awesome!

[![](https://camo.githubusercontent.com/0f9e71d386b972cd0bcb7561757809ade2198c4ded96550eca208e66ca384efc/68747470733a2f2f692e696d6775722e636f6d2f4e4a593447627a2e706e67)](https://camo.githubusercontent.com/0f9e71d386b972cd0bcb7561757809ade2198c4ded96550eca208e66ca384efc/68747470733a2f2f692e696d6775722e636f6d2f4e4a593447627a2e706e67)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

3790d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6146135?v=4)[Daniel Gelling](/maintainers/danielgelling)[@danielgelling](https://github.com/danielgelling)

---

Top Contributors

[![danielgelling](https://avatars.githubusercontent.com/u/6146135?v=4)](https://github.com/danielgelling "danielgelling (9 commits)")

### Embed Badge

![Health badge](/badges/danielgelling-twofactor/health.svg)

```
[![Health](https://phpackages.com/badges/danielgelling-twofactor/health.svg)](https://phpackages.com/packages/danielgelling-twofactor)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k98.0M1.3k](/packages/spatie-laravel-permission)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2013.2k](/packages/alajusticia-laravel-logins)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6783.6k5](/packages/hasinhayder-tyro)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1542.1k4](/packages/masterix21-laravel-licensing)[outerweb/image-library

Store and link files to your models

1113.8k3](/packages/outerweb-image-library)

PHPackages © 2026

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