[wp-trac] [WordPress Trac] #39242: Add caching to count_user_posts()

WordPress Trac noreply at wordpress.org
Wed Feb 12 21:48:22 UTC 2025


#39242: Add caching to count_user_posts()
-------------------------------------------------+-------------------------
 Reporter:  johnjamesjacoby                      |       Owner:
                                                 |  spacedmonkey
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.8
Component:  Users                                |     Version:  3.0
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-testing has-unit-    |     Focuses:  rest-api,
  tests commit                                   |  performance
-------------------------------------------------+-------------------------
Changes (by spacedmonkey):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"59817" 59817]:
 {{{
 #!CommitTicketReference repository="" revision="59817"
 Users: Add caching to count_user_posts function

 Introduced caching for the `count_user_posts` function to reduce redundant
 database queries. This ensures better performance by storing and reusing
 query results when possible. Additionally, sanitized and sorted the
 `$post_type` array to avoid invalid queries.

 Props spacedmonkey, peterwilsoncc, mamaduka, flixos90, johnjamesjacoby,
 swissspidy, dilip2615, johnregan3, wpgurudev, desrosj, milindmore22,
 Krstarica, dilipom13.
 Fixes #39242.
 }}}

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


More information about the wp-trac mailing list