Make WordPress Core

Opened 2 years ago

Closed 18 months ago

#57055 closed enhancement (fixed)

Allow posts query in wp_dashboard_recent_posts() to be cached

Reported by: ocean90's profile ocean90 Owned by: ocean90's profile ocean90
Milestone: 6.3 Priority: normal
Severity: normal Version: 3.8
Component: Query Keywords: good-first-bug has-patch commit
Focuses: administration, performance Cc:

Description

In wp_dashboard_recent_posts(), cache_results is set to false which means the WP_Query can't benefit of the performance changes in 6.1. I couldn't find a reason why this specific query shouldn't be cached.

The widget was added in [26144] as dashboard_show_published_posts() and renamed to wp_dashboard_recent_posts() in [26690]. cache_results was set in https://github.com/davemart-in/WordPress-3.8-Dashboard/pull/9/files before the merge.

Attachments (1)

57055.diff (533 bytes) - added by benjgrolleau 2 years ago.

Download all attachments as: .zip

Change History (6)

@benjgrolleau
2 years ago

#1 @benjgrolleau
2 years ago

  • Keywords has-patch added; needs-patch removed

Hey @ocean90 ,
Here is the very small patch.

Hope this is well.
Have a good day,
Benj

#2 @spacedmonkey
20 months ago

  • Keywords commit added
  • Milestone changed from Future Release to 6.3
  • Version set to 3.8

This patch looks good to commit to me.

#3 @spacedmonkey
20 months ago

  • Owner set to ocean90
  • Status changed from new to assigned

Assigning to @ocean90 to commit.

#5 @ocean90
18 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 55895:

Query: Allow queries by wp_dashboard_recent_posts() to be cached.

Set the cache_results argument to true for WP_Query to ensure the posts queries on the dashboard can also be cached.

Props benjgrolleau.
Fixes #57055.

Note: See TracTickets for help on using tickets.