FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add `perflab_disable_object_cache_dropin` filter by tillkruss · Pull Request #629 · WordPress/performance · GitHub

Add perflab_disable_object_cache_dropin filter - #629

Merged
mukeshpanchal27 merged 7 commits into
trunkfrom
fix-628
Jan 31, 2023
Merged

Add perflab_disable_object_cache_dropin filter#629
mukeshpanchal27 merged 7 commits into
trunkfrom
fix-628

Conversation

tillkruss commented Jan 24, 2023
edited
Loading

Copy link
Copy Markdown
Member

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

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.

tillkruss added [Type] Enhancement A suggestion for improvement of an existing feature [Focus] Measurement labels Jan 24, 2023
tillkruss added this to the 2.0.0 milestone Jan 24, 2023
tillkruss changed the title Update load.php Add object cache drop-in filter Jan 24, 2023
tillkruss changed the title Add object cache drop-in filter Add server timing drop-in filter Jan 24, 2023

felixarntz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@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' ) );
	}

Comment thread load.php Outdated
Comment thread load.php Outdated
tillkruss and others added 4 commits January 27, 2023 10:03
Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>

felixarntz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks @tillkruss!

felixarntz changed the title Add server timing drop-in filter Add perflab_disable_object_cache_dropin filter Jan 27, 2023
Comment thread load.php

mukeshpanchal27 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks @tillkruss, LGTM!

mukeshpanchal27 merged commit af20ea6 into trunk Jan 31, 2023
mukeshpanchal27 deleted the fix-628 branch January 31, 2023 09:25
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

Labels

[Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable Server Timing via filter

4 participants


Back | FazBrowse Home | New Git URL