[wp-trac] [WordPress Trac] #58368: WordPress dashboard is very slow when there are many comments (and the database isn't great)

WordPress Trac noreply at wordpress.org
Wed May 24 18:07:08 UTC 2023


#58368: WordPress dashboard is very slow when there are many comments (and the
database isn't great)
--------------------------+--------------------------
 Reporter:  Guss77        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.3
Component:  Comments      |     Version:  6.2.2
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |     Focuses:  performance
--------------------------+--------------------------

Comment (by Guss77):

 Replying to [comment:14 westonruter]:
 > Aside: @Guss77 another option for you would be to add a
 `wp_count_comments` filter in [https://github.com/WordPress/wordpress-
 develop/blob/d51ee6ce097fb288aca9da1f95899fc3d77c0fa4/src/wp-
 includes/comment.php#L1433-L1436 that same function]. This would allow you
 to short-circuit the expensive query, and you could use the query that
 lacks the `ORDER BY`.

 My current solution is to apply the patch manually to the installation of
 WordPress that I use - which will cause it to be undone when if the next
 version is released without addressing this issue.

 Hopefully, that will not be the case, but if so I will have to implement
 the filter function - though that solution will have to make a manual SQL
 query that mimics `WP_Comment_Query->get_comment_ids()` and will be
 vulnerable to bitrot due to future WordPress core changes - so, not a
 great solution.

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


More information about the wp-trac mailing list