Bail if script helper class does not exist#837
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a defensive guard to admin notice JavaScript rendering to avoid fatal errors when ScriptHelper is unavailable during plugin upgrades.
Changes:
- Adds a
class_exists()check before usingScriptHelper. - Updates the 6.2.1 changelog with the upgrade fatal-error fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
woocommerce/class-sv-wc-admin-notice-handler.php |
Guards admin notice inline script rendering when ScriptHelper is unavailable. |
woocommerce/changelog.txt |
Documents the plugin-upgrade fatal error fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
agibson-godaddy
added a commit
that referenced
this pull request
May 18, 2026
* Fix resolved package urls * Version 6.2.1 * Bail if script helper class does not exist (#837) * Set release date --------- Co-authored-by: Ashley Gibson <agibson@godaddy.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ashley Gibson <99189195+agibson-godaddy@users.noreply.github.com>
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 protects against fatal errors in the middle of plugin upgrades, when an admin notice is visible. This is a similar issue to #826
Story: MWC-19746
Release: #836 (release PR)
Details
QA
If applicable, add specific steps for the reviewer to perform as part of their QA process prior to approving this pull request. Steps should be in a step -> success? format, like below
Setup
Before merge