| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
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' ) );
}
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks @tillkruss!
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks @tillkruss, LGTM!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.php which isn't easily controlled by a plugin.
Checklist