Update 1984-hosting-support.php

This commit is contained in:
gdh
2026-01-05 15:35:01 +00:00
parent 454572ede2
commit 477b87b5a4

View File

@@ -273,18 +273,21 @@ class HostingSupport1984 {
* @return string[] * @return string[]
*/ */
private function get_protected_plugins(): array { private function get_protected_plugins(): array {
// Always protect this plugin from deactivation/deletion. if ( ! $this->is_patchstack_active() ) {
return array();
}
// Protect this plugin.
$own = plugin_basename( __FILE__ ); $own = plugin_basename( __FILE__ );
$protected = array( $own ); $protected = array( $own );
// Additionally protect Patchstack - but only while it is active. // Also protect Patchstack.
if ( $this->is_patchstack_active() ) {
$protected[] = 'patchstack/patchstack.php'; $protected[] = 'patchstack/patchstack.php';
}
return $protected; return $protected;
} }
/** /**
* Intercept admin actions attempting to deactivate or delete protected plugins and block them. * Intercept admin actions attempting to deactivate or delete protected plugins and block them.
*/ */