wordpress-develop icon indicating copy to clipboard operation
wordpress-develop copied to clipboard

wp_dashboard_recent_comments function: avoid unnecessary SQL query

Open kalessil opened this issue 5 days ago • 2 comments

Tune wp_dashboard_recent_comments performance:

  • further reduce the number of count calls (related to the history of changes in this function)
  • harden while-loop condition to avoid SQLs when the last query fetched less than what was aimed (next query fetches nothing)

Trac ticket: https://core.trac.wordpress.org/ticket/64506


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

kalessil avatar Jan 15 '26 08:01 kalessil