Skip to content
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

Enhancement: protect GiveWP upgrading #7737

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

JasonTheAdams
Copy link
Contributor

@JasonTheAdams JasonTheAdams commented Feb 14, 2025

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

  1. Install this on a site
  2. Manually drop the Version in give.php to an older version so it thinks it can upgrade
  3. Go to includes/actions.php on line 239 and add: throw new Exception('boom');
  4. Try upgrading GiveWP

Pre-review Checklist

  • Relevant @unreleased tags included in DocBlocks
  • Self Review of code and UX completed

@JasonTheAdams JasonTheAdams self-assigned this Feb 14, 2025
@JasonTheAdams
Copy link
Contributor Author

This doesn't protect 3rd party plugins from being able to upgrade if there's an issue, but at the very least we can provide a hot fix for GiveWP to resolve the issue that is upgradable.

Copy link
Contributor

@jonwaldstein jonwaldstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good in theory, but was not able to confirm if it works. Might want to check with QA & support as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants