-
Notifications
You must be signed in to change notification settings - Fork 0
Multisite stranding guard [1/4]: Let a host give the library its own plugin basename #46
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
Open
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,12 @@ hands to Telemetry, Uplink or Harbor. It is required: `Config::get_container()` | |
| `Config_Exception` when none is set, and `Config::has_container()` is the probe. To replace one | ||
| of the library's own pieces, see [Extending](extending.md). | ||
|
|
||
| `Config::set_host_plugin_basename( plugin_basename( __FILE__ ) )` is optional and matters only on | ||
| multisite. It lets the library compare your plugin's activation scope against a standalone's, so it | ||
| declines to deactivate a network-active standalone when your plugin is not itself network-activated | ||
| — a deactivation that would otherwise pull the standalone from the network's other sites, where your | ||
| bundled copy never loads. Left unset, that guard stays off and deactivation behaves as it always has. | ||
|
Comment on lines
+22
to
+26
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having this be optional has me skeptical. Even if we may not officially support multisite in some cases, allowing things to potentially break because we didn't make an optional config required doesn't sit right with me. |
||
|
|
||
| Both calls belong at `plugins_loaded` priority 0, in the block that owns your container rather | ||
| than in a service provider. Priority matters twice, for unrelated reasons: | ||
|
|
||
|
|
||
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Do not document the multisite guard as active yet.
Config::set_host_plugin_basename()stores the value, but no current consumer uses it to change deactivation behavior. This text promises protection for network-active standalone plugins and incorrectly describes the setter as a no-op off a network. Describe the setting as preparation for the follow-up guard, or include that consumer in this change.Suggested wording
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of a set of stacked PRs. It is used in followup PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d4mation, thanks for the clarification. The configuration is consumed by the follow-up pull requests in this stack. The README describes the completed stacked behavior. I withdraw this finding.✏️ Learnings added
✅ Review thread resolved.
You are interacting with an AI system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai This doesn't need to be a learning. If you want to add a learning, it should be to check to see if a given PR is part of a GitHub Stack and check to see if something is consumed in a later stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d4mation, thanks for the guidance. The prior PR-specific learning is unnecessary.I cannot remove that learning here because its UUID is not available. You can delete it from the CodeRabbit learnings page.
🐇
✏️ Learnings added
You are interacting with an AI system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikolaystrikhar You may want to go into CodeRabbit's dashboard and clean up some Learnings it made for this PR stack. It looks like stacking PRs may confuse CodeRabbit 🫠
We may need to add something like this as a general Review Instruction.