Enhancement: protect GiveWP upgrading #7737
Open
+8
−1
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.
Description
In light of #7735 and the fact that the licensing system broke GiveWP's ability to upgrade itself, I felt it would be a good idea to add a specific bailout to the upgrader function. It checks to see if the plugin being upgrade is GiveWP core itself. If it is, then it just immediately bails out of the add-on upgrader flow. This way if there are any licensing issues in the future we know that GiveWP can always at least be upgraded.
Affects
The add-on upgrader flow.
Testing Instructions
give.php
to an older version so it thinks it can upgradeincludes/actions.php
on line 239 and add:throw new Exception('boom');
Pre-review Checklist
@unreleased
tags included in DocBlocks