Add perflab_disable_object_cache_dropin filter#629
Merged
mukeshpanchal27 merged 7 commits intotrunkfrom Jan 31, 2023
Merged
Conversation
felixarntz
reviewed
Jan 24, 2023
Member
felixarntz
left a comment
There was a problem hiding this comment.
@tillkruss Two minor points of feedback here, also can you please add a test covering the filter?
E.g. like this:
public function test_perflab_maybe_set_object_cache_dropin_disabled_via_filter() {
global $wp_filesystem;
$this->set_up_mock_filesystem();
// Ensure PL object-cache.php drop-in is not present and constant is not set.
$this->assertFalse( $wp_filesystem->exists( WP_CONTENT_DIR . '/object-cache.php' ) );
$this->assertFalse( PERFLAB_OBJECT_CACHE_DROPIN_VERSION );
// Add filter to disable drop-in.
add_filter( 'perflab_disable_object_cache_dropin', '__return_true' );
// Run function to place drop-in and ensure it still doesn't exist afterwards.
perflab_maybe_set_object_cache_dropin();
$this->assertFalse( $wp_filesystem->exists( WP_CONTENT_DIR . '/object-cache.php' ) );
}Co-authored-by: Felix Arntz <[email protected]>
Co-authored-by: Felix Arntz <[email protected]>
perflab_disable_object_cache_dropin filter
peterwilsoncc
approved these changes
Jan 31, 2023
mukeshpanchal27
approved these changes
Jan 31, 2023
Member
mukeshpanchal27
left a comment
There was a problem hiding this comment.
Thanks @tillkruss, LGTM!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #628 and #629.
Relevant technical choices
Using a filter is easy for other plugin to use, while the existing constant would need to be set in the
wp-config.phpwhich isn't easily controlled by a plugin.Checklist
[Focus]orInfrastructurelabel.[Type]label.no milestonelabel.