22: Redirect only where a standalone really did go away - #36
Open
nikolaystrikhar wants to merge 1 commit into
Open
22: Redirect only where a standalone really did go away#36nikolaystrikhar wants to merge 1 commit into
nikolaystrikhar wants to merge 1 commit into
Conversation
The DEACTIVATE branch returned true the moment deactivate() returned, and resolve_all() reads that as licence to redirect and exit. Nothing re-asked whether the standalone was actually gone. Where it is not -- a site filtering option_active_plugins, a rebound Deactivator_Interface that no-ops, a rebound Checker_Interface meaning something else by active -- every admin GET deactivates, redirects to itself and repeats until the browser gives up, with the whole of wp-admin out of reach. The merge notice explaining it is never drawn either, because each of those requests exits before all_admin_notices. Asking the detector again costs one call on a branch that is already the expensive one, and the answer is the only thing the redirect was ever entitled to act on.
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.
What:
Conflict\Resolver'sDEACTIVATEbranch re-asksConflict\Detectorafter deactivating, so theplugins_loadedpriority 5 step only reports success — and only redirects — when the standalone is genuinely gone.Usage:
Why this way:
Deactivating is not the same event as being deactivated. The branch returned
truethe momentdeactivate()returned. Three realistic sites disagree with that: one filteringoption_active_plugins, one that reboundDeactivator_Interfaceto something that no-ops, one whose reboundChecker_Interfacemeans by "active" somethingdeactivate_plugins()never touches.The redirect is what made it unrecoverable. Every admin GET resolved, redirected to itself and repeated until the browser gave up, and because each request exits before
all_admin_noticesthe notice explaining it was never drawn. Suppressing the redirect leaves the notice to render on a page that actually loads.The detector is already a constructor argument, so the second ask adds no dependency and stays inside the per-sub-plugin
try.