Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Deactivate plugin versions below 4.1 on WordPress 5.0 #11375
Ignore the diff against
Core ticket 45123 took care of systematically deactivating Gutenberg upon upgrading to WordPress 5.0, both as a general precaution and due to the fact that core WordPress becomes the default provider of Gutenberg functionality.
By "general precaution" it is understood that, although core and plugin are expected to be compatible starting with Gutenberg 4.1, they naturally share a large surface and we want to avoid any chance of failure during a core upgrade process.
However, versions of the plugin prior to 4.1 are fundamentally incompatible with WordPress 5.0, to the point where core's procedure of deactivating the plugin happens too late to guarantee isolation, potentially causing a site to WSOD.
Thus, this PR proposes a patch for Gutenberg versions 3.6, 3.7, 3.8, 3.9 and 4.0 that deactivates itself if any version of WordPress above 4.9.8 is detected. It can do this before execution of any other code in the plugin, thus ensuring no Gutenberg code taints core's upgrade routine. With the help of @pento, patch releases will be pushed as auto-updates to existing installations.
The commit list shows an initial version that showed a deactivation notice, but in practice I found this to be useless.
How has this been tested?
Wait, so this is patching previous versions of released Gutenberg? I guess it's just for releases in the plugin repo and not node packages, etc., right?
The code here seems fine (though I'll point out I haven't tested it myself), but I'm unclear on what's being updated and how.
Conceptually though seems good.
I followed the test instructions testing the update on a zip build from this branch and Gutenberg deactivated and the update of WordPress was successful. Using the zip file from 4.0 rc available on GitHub the update of WordPress went wrong and I started getting error 500. So everything went as expected.
Exactly, this is just a small patch for