-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add a mu-plugin loader that loads a specific version of a plugin if required. #561
Conversation
I tried running this in my sandbox and it works as described for the support forums. Unfortunately I run into the HTML API out of memory issues with the later version of Gutenberg on the rest of wporg. Any version 16.9.x on causes it. |
Guessing I might have done something wrong in testing this, but it broke the support forums and deactivated the Gutenberg - i manually reactivated it to fix it. What I did:
Unsure if the breakage was due to my method, or the way we attempt to override the sites' option values, as switching to non-sandbox mode didn't fix it. Error:
|
`array_splice` runs over the array in-place, and returns the extracted values, so this was setting the plugins list to just the from value.
…ugins Gutenberg shows up in both sometimes, so we should check and remove from both.
I misunderstood what was happening, this does work
I pushed a few commits to fix some things I noticed:
To test, I added a new folder I assume there should be no effects on the WordCamp network, even though it won't have a gutenberg-16.8 folder, because it does not use Blocks Everywhere. |
@adamwoodnz I don't think I've ever run into this, but you've had memory issues with your sandbox before, right? |
That's true, but this is different. This was a production issue for some sites on the day of that slack post, and reproduced by others. If it's not an issue for anyone else now then I'll investigate further once shipped. |
'doh! yeah I hadn't considered it might be site-activated in network-activated contexts, but yeah it makes sense to do it like that.
That was the intention I had - That it would only kick in if the "problem" plugin existed, and that we'd have the environment setup for the plugin elsewhere. Realistically; having a non-existent plugin in the array isn't a problem, it would just mean the plugin isn't loaded at all. Thanks @ryelle! |
A thought I had over the weekend: That would avoid future people attempting to "switch to the newer version of gutenberg" via wp-admin/plugins. |
Looks like we'll want this for the pattern directory, |
…oid the filtered array being saved and becoming un-filtered.
I've run into this as well, only on block theme sites though (ie. wordpress.org/showcase or https://developer.wordpress.org/, but not w.org/plugins) with GB 16.9~17.2. 17.3 appears to be the first version that works without running into memory exhaustion. I'm guessing that's either a fixed bug, or an incompatibility between WordPress trunk and those versions of Gutenberg. I'm going to merge this, I was going to bump the main deployed gutenberg to 17.1 as well since the interactivity changes were after that, but I'll hold off on that bump due to the above memory issues. The Interactivity PRs can then be merged, the main Gutenberg version increased, and both deployed at once. |
Certain plugins on WordPress.org require specific versions of other plugins in order to operate.
One of these plugins is Blocks Everywhere, the current version of which requires Gutenberg 16.8.
We however use Gutenberg widely on other sites, and often want to use features from the recent versions.
This mu-plugin let's us load blocks-everywhere with Gutenberg 16.8, but use Gutenberg trunk/stable on other sites.
(edit: Obviously, this needs to be combined with an additional
svn:external
to have the plugin available)