Opened 2 years ago
Last modified 2 years ago
#55958 new enhancement
Checking if _admin_notice_post_locked should be called can slow down the post editing
Reported by: | berislav.grgicak | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Editor | Keywords: | |
Focuses: | performance | Cc: |
Description
On wp-admin/edit-form-advanced.php:28
, WordPress checks if multiple users exist to call _admin_notice_post_locked.
In some cases, plugins add additional filters to all get_users
calls to ensure that a user role doesn't have access to private data.
If these checks use meta value comparisons, it can slow post-editing on sites with large user_meta
tables.
The root cause of this issue is how WordPress stores and validates user capabilities, but the _admin_notice_post_locked
check could be optimized without fixing the root cause.
Some suggestions on how to fix this would be:
- caching the
$check_users
value - using a boolean option that is true if a site has multiple users
- adding a filter that allows manually setting
$check_users
to skip this check
Change History (2)
Note: See
TracTickets for help on using
tickets.
Hi @berislavgrgicak, welcome to Trac!
I'm just modifying the ticket's parameters to help get this some more focus and help to track down when this was introduced.
This check was introduced in WordPress 4.9.