From 477b87b5a44c59f561818ae4a0a3f5b070d74a6a Mon Sep 17 00:00:00 2001 From: gdh Date: Mon, 5 Jan 2026 15:35:01 +0000 Subject: [PATCH] Update 1984-hosting-support.php --- 1984-hosting-support.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/1984-hosting-support.php b/1984-hosting-support.php index 6597503..932a57a 100644 --- a/1984-hosting-support.php +++ b/1984-hosting-support.php @@ -272,18 +272,21 @@ class HostingSupport1984 { * * @return string[] */ - private function get_protected_plugins(): array { - // Always protect this plugin from deactivation/deletion. - $own = plugin_basename( __FILE__ ); - $protected = array( $own ); - - // Additionally protect Patchstack - but only while it is active. - if ( $this->is_patchstack_active() ) { - $protected[] = 'patchstack/patchstack.php'; + private function get_protected_plugins(): array { + if ( ! $this->is_patchstack_active() ) { + return array(); } - return $protected; - } + // Protect this plugin. + $own = plugin_basename( __FILE__ ); + $protected = array( $own ); + + // Also protect Patchstack. + $protected[] = 'patchstack/patchstack.php'; + + return $protected; + } + /** * Intercept admin actions attempting to deactivate or delete protected plugins and block them.