PHPackages                             cloudcatch/user-roles-table - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cloudcatch/user-roles-table

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

cloudcatch/user-roles-table
===========================

A WordPress plugin that boosts WP\_User\_Query performance by adjusting SQL queries to use a custom user roles table, reducing overhead and improving scalability.

1.1.1(1y ago)07GPL-2.0-or-laterPHPPHP &gt;=8.0

Since Dec 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/CloudCatch/user-roles-table)[ Packagist](https://packagist.org/packages/cloudcatch/user-roles-table)[ RSS](/packages/cloudcatch-user-roles-table/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (9)Versions (7)Used By (0)

User Role Tables for WP\_User\_Query
====================================

[](#user-role-tables-for-wp_user_query)

A lightweight and efficient WordPress plugin that mirrors user roles into a custom database table to optimize performance for `WP_User_Query` and `get_users()` calls. By offloading role-based queries to a dedicated table, this plugin reduces database overhead, making large-scale user management faster and more reliable.

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

[](#installation)

Install and activate the plugin. This should automatically install the database table: `wp_user_roles`.

Run the following command to copy all user role data to the new `wp_user_roles` table:

```
wp user-roles-table migrate
```

This command will extract all users roles and capabilities from `wp_postmeta`, and insert this data is a more performant schema in the `wp_user_roles` database table.

Running Unit Tests
------------------

[](#running-unit-tests)

To ensure the plugin works as expected, you can run the included unit tests. Follow the steps below:

### Prerequisites

[](#prerequisites)

- Make sure you have [Docker](https://www.docker.com/) installed and running on your machine (required for `wp-env`).
- Ensure you have [Composer](https://getcomposer.org/) installed to manage PHP dependencies.

### Steps to Run Tests

[](#steps-to-run-tests)

1. **Start the WordPress Environment:**Use `wp-env` to spin up a local WordPress environment: ```
    wp-env start
    ```
2. **Install Dependencies:**If you haven't already, install the Composer dependencies: ```
    composer install
    ```
3. **Run the Tests:**Execute the Composer test script to run the unit tests: ```
    composer test
    ```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance41

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Total

3

Last Release

521d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1517909?v=4)[David Jensen](/maintainers/dkjensen)[@dkjensen](https://github.com/dkjensen)

---

Top Contributors

[![dkjensen](https://avatars.githubusercontent.com/u/1517909?v=4)](https://github.com/dkjensen "dkjensen (11 commits)")

---

Tags

wordpressperformanceuserqueryrolescapabilities

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cloudcatch-user-roles-table/health.svg)

```
[![Health](https://phpackages.com/badges/cloudcatch-user-roles-table/health.svg)](https://phpackages.com/packages/cloudcatch-user-roles-table)
```

###  Alternatives

[league/uri-components

URI components manipulation library

31932.3M67](/packages/league-uri-components)[php-stubs/wordpress-stubs

WordPress function and class declaration stubs for static analysis.

19513.0M263](/packages/php-stubs-wordpress-stubs)[juvo/bricks-custom-query

Easy to use custom bricks query

122.0k](/packages/juvo-bricks-custom-query)[wpsitecare/carelib

A collection of helpful functions to make creating an awesome theme more enjoyable.

164.6k](/packages/wpsitecare-carelib)

PHPackages © 2026

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