-
-
Notifications
You must be signed in to change notification settings - Fork 522
DB/DirectDatabaseQuery: allow for more caching functions #2654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB/DirectDatabaseQuery: allow for more caching functions #2654
Conversation
While updating the pluggable function list for WP 6.9, I noticed there are now more cache functions in WP. Based on the docs: * [`wp_cache_get_multiple()`](https://developer.wordpress.org/reference/functions/wp_cache_get_multiple/) was added in WP 5.5.0. * [`wp_cache_get_multiple_salted()`](https://developer.wordpress.org/reference/functions/wp_cache_get_multiple_salted/) was added in WP 6.9.0. * [`wp_cache_get_salted()`](https://developer.wordpress.org/reference/functions/wp_cache_get_salted/) was added in WP 6.9.0. * [`wp_cache_add_multiple()`](https://developer.wordpress.org/reference/functions/wp_cache_add_multiple/) was added in WP 6.0.0. * [`wp_cache_set_multiple()`](https://developer.wordpress.org/reference/functions/wp_cache_set_multiple/) was added in WP 6.0.0. * [`wp_cache_set_multiple_salted()`](https://developer.wordpress.org/reference/functions/wp_cache_set_multiple_salted/) was added in WP 6.9.0. * [`wp_cache_set_salted()`](https://developer.wordpress.org/reference/functions/wp_cache_set_salted/) was added in WP 6.9.0. * [`wp_cache_delete_multiple()`](https://developer.wordpress.org/reference/functions/wp_cache_delete_multiple/) was added in WP 6.0.0. * [`wp_cache_flush_group()`](https://developer.wordpress.org/reference/functions/wp_cache_flush_group/) was added in WP 6.1.0. * [`wp_cache_flush_runtime()`](https://developer.wordpress.org/reference/functions/wp_cache_flush_runtime/) was added in WP 6.0.0. This commit adds these functions to the appropriate lists for the sniff to take into account. Includes tests.
rodrigoprimo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! This PR looks good to me.
I have a non-blocking question. I wonder why you added tests covering 6 of the 10 new functions? Is there a reason not to include (or update an existing test) to ensure that wp_cache_get_salted(), wp_cache_set_salted(), wp_cache_set_multiple(), and wp_cache_flush_runtime() are covered as well?
Cause those tests wouldn't necessarily add any value. The sniff logic is not touched and already 100% covered. Aside from that, I also didn't want to spend more time than necessary on this and documentation for some of these functions is currently not available on developer.wordpress.org, so figuring out the params etc would need digging into the WP Core source for no added value to our tests. |
|
As this has been reviewed in time for the 3.3.0 release, I've added it to the milestone and will merge the PR. |
Description
While updating the pluggable function list for WP 6.9, I noticed there are now more cache functions in WP.
Based on the docs:
wp_cache_get_multiple()was added in WP 5.5.0.wp_cache_get_multiple_salted()was added in WP 6.9.0.wp_cache_get_salted()was added in WP 6.9.0.wp_cache_add_multiple()was added in WP 6.0.0.wp_cache_set_multiple()was added in WP 6.0.0.wp_cache_set_multiple_salted()was added in WP 6.9.0.wp_cache_set_salted()was added in WP 6.9.0.wp_cache_delete_multiple()was added in WP 6.0.0.wp_cache_flush_group()was added in WP 6.1.0.wp_cache_flush_runtime()was added in WP 6.0.0.This commit adds these functions to the appropriate lists for the sniff to take into account.
Includes tests.
Suggested changelog entry
WordPress.DB.DirectDatabaseQuerynow recognizes more caching functions, like thewp_cache_*_multiple()functions as added in WordPress 6.0 and thewp_cache_*_salted()functions as added in WordPress 6.9.