#58757 closed enhancement (fixed)
Performance issue has_content method in WP_Widget_Media_Gallery
Reported by: | spacedmonkey | Owned by: | niravsherasiya7707 |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Widgets | Keywords: | good-first-bug has-patch commit |
Focuses: | performance | Cc: |
Description
The has_content method in WP_Widget_Media_Gallery, does not prime post caches before calling get_post_type
. Call _prime_post_caches
before foreach loop would improve performance.
Change History (10)
This ticket was mentioned in PR #4819 on WordPress/wordpress-develop by nirav7707.
14 months ago
#1
- Keywords has-patch added
#3
@
14 months ago
Hello @spacedmonkey, I have a concern regarding the GitHub action "End-to-end Tests / E2E Tests with SCRIPT_DEBUG enabled/disable." I noticed that this action passes successfully on my pull request (PR), which is against my forked branch. However, when I submitted the same PR to the WordPress Trunk, it failed. I would appreciate any insights or guidance you can provide to help resolve this matter.
#4
@
14 months ago
@niravsherasiya7707 This is a known issue in trunk right now, nothing to do with your PR. Feel free to ignore.
#5
@
13 months ago
@spacedmonkey are you satisfied with this patch? How can can proceed? If nesting is the next step, we need an instruction.
#6
@
13 months ago
- Keywords changes-requested added
I have some feedback here https://github.com/WordPress/wordpress-develop/pull/4819/files#r1309009821.
Once committed, I will test and commit to core.
#8
@
12 months ago
- Keywords commit added; changes-requested removed
Thank you, @niravsherasiya7707, for updating the PR. With sufficient approvals, I am mark it for the final commit
.
Trac Ticke
_prime_post_caches( $attachments );
to cache the posts before iterate to enhance performance.