cloudcatch/user-roles-table
最新稳定版本:1.1.1
Composer 安装命令:
composer require 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.
README 文档
README
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
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
To ensure the plugin works as expected, you can run the included unit tests. Follow the steps below:
Prerequisites
- Make sure you have Docker installed and running on your machine (required for
wp-env). - Ensure you have Composer installed to manage PHP dependencies.
Steps to Run Tests
- Start the WordPress Environment:
Use
wp-envto spin up a local WordPress environment:wp-env start
- Install Dependencies:
If you haven't already, install the Composer dependencies:
composer install
- Run the Tests:
Execute the Composer test script to run the unit tests:
composer test
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2024-12-02