Skip to content
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

Remove object-cache.php hack #533

Closed
wants to merge 14 commits into from
Closed

Conversation

swissspidy
Copy link
Member

Found out in #518 that this object-cache.php drop-in prevents other plugins from adding custom checks that can then be run via CLI.

From what I can see,object-cache.php is used as a "hook" to short-circuit regular WordPress loading order and manually execute the PCP CLI command before WordPress has fully loaded. That also means before any plugins have actually loaded...

This "hack" appears to be used so we can perform runtime checks for a plugin without the plugin having to be active on the site. If we can simply make this a requirement for the plugin to be active, then we can simplify this a lot.

I do lack full context though on why this was implemented this way, so appreciate any feedback.


Related:

@swissspidy
Copy link
Member Author

@joemcgill @mukeshpanchal27 Do you perhaps more context on this whole early initialization thing with this object-cache.php drop-in? We could save ourselves some headaches by removing that...

@mukeshpanchal27
Copy link
Member

@swissspidy I found #42, where it was introduced and discussed why it was added. Hope this helps to get more context.

@JJJ
Copy link

JJJ commented Jul 22, 2024

Due to the nature of how Plugin Check needs to work, only other way to load super early would be to require a stub from inside of wp-config.php, and do all the same work on either the mu_plugins_loaded or shutdown hooks, and that seems overly fragile & yucky considering Plugin Check is a core utility.

WordPress Core should just add support for a new drop-in: wp-content/plugin-check.php.

Plugin Check is the type of library that drop-in plugins are designed to accommodate; intentionally forked loading paths. Every existing drop-in overrides a low-level API or traps a related low-level problem, and it is an easy argument to make that Plugin Check has similarly low-level requirements.

Naming it something like I suggested above would also set the expectation to everyone that its usage is reserved, and if that file already exists it had better be compatible with Plugin Check, the same way all db.php drop-ins must extend wpdb.

@swissspidy
Copy link
Member Author

I like the wp-content/plugin-check.php suggestion, but... do we really need to load super early? 🤔 That's what I am trying to understand better.

@ernilambar
Copy link
Member

This issue came here also. #543 😟

@swissspidy
Copy link
Member Author

Closing for now, can be revisited later

@swissspidy swissspidy closed this Aug 21, 2024
@swissspidy swissspidy deleted the try/remove-object-cache-hack branch August 21, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants