开发者 |
OllieJones
Ollie Jones Oliver Jones |
---|---|
更新时间 | 2024年11月7日 19:37 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 6.7 |
版权: | GPL v2 or later |
版权网址: | 版权信息 |
wp plugin install index-wp-users-for-speed wp plugin activate index-wp-users-for-speed
Composer
If you configure your WordPress installation using composer, you may install this plugin into your WordPress top level configuration with this command.
composer require "wpackagist-plugin/index-wp-users-for-speed":"^1.1"
Credits
Yes. Backups are good practice. Still, this plugin makes no changes to your site or database layout. It adds a few non-autoloaded options, and adds rows to wp_usermeta. = My WordPress host offers MariaDB, not MySQL. Can I use this plugin? Yes. = I have a multi-site WordPress installation. Can I use this plugin? Yes. = I see high CPU usage (load average) on my MariaDB / MySQL database server during user index building or refresh. Is that normal? Yes. Indexing your registered users requires us to insert a row in your wp_usermeta tab;e for each of them. We do this work in batches of 5000 users to avoid locking up your MariaDB / MySQL server. Each batch takes server time. Once all index building or refresh batches are complete, your CPU usage will return to normal. = Can I use this if I have disabled WP_Cron and use an operating system cronjob instead? Yes
Plugins like Vladimir Garagulya's User Role Editor let you assign multiple roles to users. This plugin handles those users correctly.
Standard WordPress puts a wp_capabilities
row in the wp_usermeta
table for each user. Its meta_value
contains a small data structure. For example, an author has this data structure.
array("author")
In order to find all the authors WordPress must issue a database query containing a filter like this one, that starts and ends with the SQL wildcard character %
.
meta_key = 'wp_capabilities' AND meta_value LIKE '%"author"%'
Filters like that are notoriously slow: they cannot exploit any database keys, and so MySQL or MariaDB must examine that wp_usermeta
row for every user in your site.
This plugin adds rows to wp_usermeta
describing each user's role (or roles) in a way that's easier to search. To find authors, the plugin uses this much faster filter instead.
meta_key = 'wp_index_wp_users_for_speed_role_author'
It takes a while to insert these extra indexing rows into the database; that happens in the background.
Once the indexing rows are in place, you can add, delete, or change user roles without regenerating those rows: the plugin maintains them.
WordPress's trac (defect-tracking) system has this ticket # 38741.
Three reasons (maybe four):