Protect against Notes_Helper fatal errors during plugin updates#826
Merged
agibson-godaddy merged 1 commit intorelease/6.1.5from Apr 2, 2026
Merged
Protect against Notes_Helper fatal errors during plugin updates#826agibson-godaddy merged 1 commit intorelease/6.1.5from
agibson-godaddy merged 1 commit intorelease/6.1.5from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the framework against fatal errors triggered during plugin updates via /wp-admin/update-core.php, where versioned framework namespaces can change mid-request and cause Notes_Helper class resolution failures.
Changes:
- Guard
Notes_Helperusage during deactivation withclass_exists()to avoid upgrade-time fatals. - Widen the gateway notice creation try/catch from
\Exceptionto\Throwableand add aclass_exists()guard before callingAdmin\Notes_Helper::note_with_name_exists(). - Add a changelog entry for the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
woocommerce/Plugin/Lifecycle.php |
Adds a class_exists( Notes_Helper::class ) guard before deleting admin notes during deactivation to prevent upgrade-time fatals. |
woocommerce/payment-gateway/class-sv-wc-payment-gateway-plugin.php |
Catches \Throwable around note creation and guards note-deletion checks with class_exists() to prevent namespace-mismatch fatals during updates. |
woocommerce/changelog.txt |
Documents the fix for Notes_Helper fatal errors during plugin upgrades. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This adds some various protection measures to avoid
Notes_Helperfatal errors during plugin updates, which is when the framework namespace changes.Fixes #824
Story: MWC-19419
Release: #825 (release PR)
QA
Before merge