PHPackages                             redandblue/rnb-ajax-login - 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. redandblue/rnb-ajax-login

ActiveWordpress-plugin

redandblue/rnb-ajax-login
=========================

Plugin makes /wp-login.php AJAX accessible.

1.1.1(9y ago)5143↓100%gpl-2.0PHP

Since Oct 10Pushed 9y ago1 watchersCompare

[ Source](https://github.com/redandbluefi/ajax-login)[ Packagist](https://packagist.org/packages/redandblue/rnb-ajax-login)[ RSS](/packages/redandblue-rnb-ajax-login/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (6)Used By (0)

The plugin basically hooks up to 'login\_init', and listens to requests which have a Response-Type header set to 'json'. It also checks for `$_REQUEST['RESPONSE_TYPE']`, if for some reason you can't set the request headers.

Installing
==========

[](#installing)

The best way to install is using Composer.

`composer require redandblue/rnb-ajax-login`

Traditional methods work too.

Example
=======

[](#example)

Code sample (ES6+, production usage requires you to use a Webpack or Rollup and Babel or Bublé):

```

```

```
// ajax-login.js

import 'whatwg-fetch';

export default function(){
  const ajaxLogin = e => {
    const form = e.target;
    const data = new FormData(form);
    const headers = new Headers({
      'Response-Type': 'json'
    });

    fetch(form.action, {
      method: 'POST',
      body: data,
      headers: headers,
      credentials: 'include'
    })
    .then(response => response.json())
    .then(response => {
      if(response.type === 'success'){
        console.log(response.message);
      } else {
        console.error(response.message);
      }
    });

    e.preventDefault();
  };

  Array.from(document.querySelectorAll('[action="/wp-login.php"]')).forEach(form => {
    form.addEventListener('submit', ajaxLogin);
  });
}
```

```
// main.js
import ajaxLogin from './ajax-login.js';
ajaxLogin();
```

This allows you to AJAXify any standard WP login form. If the user has JavaScript disabled, it will gracefully fallback to the vanilla WordPress way.

Logout
======

[](#logout)

You can also log the current user out by sending a request to admin\_ajax.php?action=wp\_ajax\_logout.

The response will be similar, with either success or error in the response.type.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

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 ~6 days

Total

5

Last Release

3477d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fda724886930656c1b71e76ac5900c26df4af40a62b721bb676ddf4485de384b?d=identicon)[redandblue](/maintainers/redandblue)

---

Top Contributors

[![k1sul1](https://avatars.githubusercontent.com/u/2719615?v=4)](https://github.com/k1sul1 "k1sul1 (8 commits)")

### Embed Badge

![Health badge](/badges/redandblue-rnb-ajax-login/health.svg)

```
[![Health](https://phpackages.com/badges/redandblue-rnb-ajax-login/health.svg)](https://phpackages.com/packages/redandblue-rnb-ajax-login)
```

PHPackages © 2026

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