[wp-trac] [WordPress Trac] #58001: Lazy load user capabilities in WP_User object

WordPress Trac noreply at wordpress.org
Thu Jan 30 21:32:26 UTC 2025


#58001: Lazy load user capabilities in WP_User object
--------------------------------------------+------------------------------
 Reporter:  spacedmonkey                    |       Owner:  flixos90
     Type:  enhancement                     |      Status:  reviewing
 Priority:  normal                          |   Milestone:  6.8
Component:  Users                           |     Version:
 Severity:  normal                          |  Resolution:
 Keywords:  has-patch has-unit-tests early  |     Focuses:  multisite,
                                            |  performance
--------------------------------------------+------------------------------

Comment (by flixos90):

 @spacedmonkey @peterwilsoncc The approach of the PR using magic methods
 looks good to me. There is some related outstanding feedback on the PR,
 but the overall approach should work.

 My other feedback was about potentially breaking up the PR in two parts,
 because right now it does two things:
 * Alter the `WP_User` class to lazy-load capability data instead of when
 the class is instantiated.
 * Add support for user metadata to `WP_Metadata_Lazyloader`.

 These things are related, but technically separate. If y'all feel good
 about keeping both in the one PR, that works for me. In that case though,
 I would prefer for someone other than me (@peterwilsoncc?) to sign off on
 the `WP_Metadata_Lazyloader` related changes. I feel confident enough in
 how `WP_User` works to review that part of the PR, but not the
 `WP_Metadata_Lazyloader` part.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58001#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list