From 6858dfeb0c343cfda4f1dc0f4d23b7ca5a6f4206 Mon Sep 17 00:00:00 2001 From: Ashley Gibson Date: Mon, 18 May 2026 13:29:07 +0100 Subject: [PATCH] Bail if script helper class does not exist --- woocommerce/changelog.txt | 1 + woocommerce/class-sv-wc-admin-notice-handler.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/woocommerce/changelog.txt b/woocommerce/changelog.txt index 3d7b4af50..db9446c8c 100644 --- a/woocommerce/changelog.txt +++ b/woocommerce/changelog.txt @@ -1,6 +1,7 @@ *** SkyVerge WooCommerce Plugin Framework Changelog *** 2026.nn.nn - version 6.2.1 +* Fix - Protect against `ScriptHelper` fatal errors on plugin upgrades 2026.04.16 - version 6.2.0 * New - Added REST API support to Abilities for automatic route registration diff --git a/woocommerce/class-sv-wc-admin-notice-handler.php b/woocommerce/class-sv-wc-admin-notice-handler.php index 95e23cc3f..3410c2e0f 100644 --- a/woocommerce/class-sv-wc-admin-notice-handler.php +++ b/woocommerce/class-sv-wc-admin-notice-handler.php @@ -252,6 +252,11 @@ public function render_admin_notice_js() { return; } + // Bail if the script helper class does not exist. This can occur in the middle of plugin upgrades. + if (! class_exists(ScriptHelper::class)) { + return; + } + $plugin_slug = $this->get_plugin()->get_id_dasherized(); self::$admin_notice_js_rendered = true;