[wp-trac] [WordPress Trac] #55958: Checking if _admin_notice_post_locked should be called can slow down the post editing
WordPress Trac
noreply at wordpress.org
Fri Jun 10 10:18:57 UTC 2022
#55958: Checking if _admin_notice_post_locked should be called can slow down the
post editing
------------------------------+-----------------------------
Reporter: berislav.grgicak | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: trunk
Severity: normal | Keywords:
Focuses: |
------------------------------+-----------------------------
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
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55958>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list