Opened 13 years ago
Closed 13 years ago
#19664 closed defect (bug) (duplicate)
wp_dashboard_recent_comments() has very bad performance with lots of spam
Reported by: | joehoyle | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.3 |
Component: | Comments | Keywords: | |
Focuses: | Cc: |
Description
The way wp_dashboard_recent_comments()
loops the comments is very inefficient. This is because it gets comments 50 at a time, fills the recent commnts array, and fetches another 50 if the array was not filled (due to comments being spam etc), fetches another 50.. and so on.
I recently had an issue with a site that had 5000 spam comments _in front_ of any approved comments, this took about 20+ seconds to load the dashboard. The fix it seems is simple: specify the approves status in the mysql query instead - not sure why this was never done.
I have attached a patch for this.
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
#14222