#57568 closed enhancement (fixed)
Improve caching in `wp_get_global_styles_svg_filters`
Reported by: | spacedmonkey | Owned by: | flixos90 |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | 5.9.1 |
Component: | Editor | Keywords: | has-patch |
Focuses: | performance | Cc: |
Description
Follow on from #56910 ( and [55148])
From #56910
Originally this ticket also covered the wp_get_global_styles_svg_filters function which is subject to a similar change, but since that is a separate effort it makes sense to break it out in a separate ticket.
Change the wp_get_global_styles_svg_filters
function to use object caching over transients. This brings the code inline with wp_get_global_stylesheet
.
Change History (19)
This ticket was mentioned in PR #3926 on WordPress/wordpress-develop by @spacedmonkey.
23 months ago
#1
- Keywords has-patch added
#3
@
23 months ago
My recommendation would be to ship this in Gutenberg first, like any other change. Merge back in core when tested with real users. I see you started at https://github.com/WordPress/gutenberg/pull/47460
#5
@
23 months ago
@oandregal Generally I would agree with you, however I think this change is of rather trivial nature after the other similar changes we have already established to be functional.
WordPress core releases are far less frequent than Gutenberg releases, and if we have to wait for this to first be implemented in Gutenberg and then released and backported, we would probably miss the 6.2 release.
Given the other similar change [55148] included, I think for this one it would be reasonable to include in 6.2 and then backport to Gutenberg (or even work on both at a similar time).
@spacedmonkey I see the current milestone of this ticket is "Future Release" though, so in that case it would be pointless to do it in WordPress first IMO. Will change it to 6.2 now, but let's keep discussing. If we punt it to a "Future Release", we might as well do it in Gutenberg first.
FWIW, the pull request is almost ready from my perspective, so technically nothing is preventing this from landing in 6.2.
#8
follow-up:
↓ 9
@
23 months ago
@flixos90 Fair enough. While I'm not super stoked of shortcircuiting the process just because we can, I do see this is an edge case (because the function has been just removed from Gutenberg). Let's try this one in core first.
@spacedmonkey can you provide some manual testing instructions to make sure we cover all the cases?
#9
in reply to:
↑ 8
@
23 months ago
Replying to oandregal:
@flixos90 Fair enough. While I'm not super stoked of shortcircuiting the process just because we can, I do see this is an edge case (because the function has been just removed from Gutenberg). Let's try this one in core first.
This is an edge case.
@spacedmonkey can you provide some manual testing instructions to make sure we cover all the cases?
This is just an extension of #56910 for constituency. There is no functional change here, so not much to test. Run some profiles if you got that.
@spacedmonkey commented on PR #3926:
23 months ago
#10
Ready for review
@hellofromTonya commented on PR #3926:
23 months ago
#11
Good work @spacedmonkey. The changes are using the same code patterns in https://core.trac.wordpress.org/changeset/55148 ✅
What about unit tests?
@hellofromTonya commented on PR #3926:
23 months ago
#12
Note: This PR will need to be tested in the WP Admin area per the testing instructions here to ensure there is no fatal error from not having wp_cache_*()
functions available when load-styles.php
runs.
@spacedmonkey commented on PR #3926:
23 months ago
#13
Good work @spacedmonkey. The changes are using the same code patterns in https://core.trac.wordpress.org/changeset/55148 white_check_mark
What about unit tests?
Added a unit test. Sadly there are no unit tests for this function currently in core :(
@flixos90 commented on PR #3926:
23 months ago
#14
@spacedmonkey @hellofromtonya I tested this in WP Admin with CONCATENATE_SCRIPTS
enabled, load-styles.php
is working fine as expected.
I gave it a secondary check also looking through the code paths: With this change there is no risk of breaking load-styles.php
, since the function is only called in wp_global_styles_render_svg_filters()
, and that function is only called in 2 specific places unrelated to load-styles.php
.
So this should be good for commit
IMO.
@flixos90 commented on PR #3926:
23 months ago
#16
Committed in https://core.trac.wordpress.org/changeset/55185. @oandregal This should be straightforward to backport to Gutenberg.
@oandregal commented on PR #3926:
22 months ago
#17
Committed in https://core.trac.wordpress.org/changeset/55185. @oandregal This should be straightforward to backport to Gutenberg.
My understanding is that we don't do this, otherwise, it should have been done in Gutenberg _first_, correct?
Also: if the change was to be backported to Gutenberg, I'd recommend the author of the core change to create the pull request in Gutenberg, otherwise we'd run into human bottlenecks fast :)
Trac ticket: https://core.trac.wordpress.org/ticket/57568