#58175 closed defect (bug) (fixed)
Remove unused 'usermeta' global cache group
Reported by: | SergeyBiryukov | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Cache API | Keywords: | good-first-bug has-patch has-unit-tests needs-testing needs-testing-info commit |
Focuses: | Cc: |
Description
The usermeta
cache group was introduced in [3011], but was never actually used in core.
The user_meta
group is used instead, see [15482], [16562], and [54940].
To avoid confusion, I think the former should be removed from wp_cache_add_global_groups()
calls in:
wp-includes/load.php
wp-includes/ms-blogs.php
tests/phpunit/includes/abstract-testcase.php
See [40347] / #38725 for a precedent of removing another unused cache group.
Change History (7)
This ticket was mentioned in PR #4366 on WordPress/wordpress-develop by @ignatggeorgiev.
17 months ago
#1
- Keywords has-patch has-unit-tests added; needs-patch removed
#3
@
16 months ago
- Keywords needs-testing needs-testing-info added
I am adding needs-testing
and needs-testing-info
because from my point of view, proper testing looks a bit tricky for the good-first-bug
.
#5
@
15 months ago
Test Report
Testing the absence of something is quite challenging, so I validated the following:
usermeta
is not used by WP Core Object Cacheuser_meta
is used by WP Core's Object Cache
Method
- Add xdebug conditional break points to
wp_cache_add()
,wp_cache_add_multiple()
,wp_cache_replace()
andwp_cache_set()
- For test run one, the condition is
$group === 'usermeta'
- For test run two, the condition is
$group === 'user_meta'
For each test, I clicked on all admin pages, and the following front-end pages:
- home
- singular post
- author
- term archive
Environment
- OS: macOS 12.6.6
- Web Server: nginx/1.18.0
- PHP: 7.4.33
- WordPress: 6.3-alpha-55505-src
- Browser: Firefox 114
- Theme: Twenty Twenty-Two
- Active Plugins: none
Actual Results
- ✅ No breakpoints hit for the
usermeta
condition - ✅ All pages hit breakpoints for the
user_meta
condition
I agree with Jonny above, this is ready for commit.
#6
@
15 months ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 55940:
@SergeyBiryukov commented on PR #4366:
15 months ago
#7
Thanks for the PR! Merged in r55940.
Removing unused 'usermeta' global cache group, as it was never acutally used in core, instead the 'user_meta' group is used instead.
Trac ticket: https://core.trac.wordpress.org/ticket/58175