From 1583e98cea9a63814d0aabd041fec87edb6e1a4c Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 21 Jun 2026 17:26:51 -0500 Subject: [PATCH] fix(install): always re-extract plugin zips on update, pretty cpanel labels - reinstallBrokenPlugins now re-extracts ALL expected plugins on every update (removes old dir first) to ensure files stay current - Cpanel plugin labels: Core Engine, Web Firewall, Tenant Guard, Dev Tools, Offline Bypass, GeoIP Lookup, License Manager --- .../mod_mokosuiteclient_cpanel/tmpl/default.php | 11 +++++++---- source/script.php | 13 ++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/source/packages/mod_mokosuiteclient_cpanel/tmpl/default.php b/source/packages/mod_mokosuiteclient_cpanel/tmpl/default.php index e5a6f072..15ffbeb6 100644 --- a/source/packages/mod_mokosuiteclient_cpanel/tmpl/default.php +++ b/source/packages/mod_mokosuiteclient_cpanel/tmpl/default.php @@ -44,10 +44,13 @@ foreach ($plugins as $p) } $labels = [ - 'mokosuiteclient' => 'Core', - 'mokosuiteclient_firewall' => 'Firewall', - 'mokosuiteclient_tenant' => 'Tenant', - 'mokosuiteclient_devtools' => 'DevTools', + 'mokosuiteclient' => 'Core Engine', + 'mokosuiteclient_firewall' => 'Web Firewall', + 'mokosuiteclient_tenant' => 'Tenant Guard', + 'mokosuiteclient_devtools' => 'Dev Tools', + 'mokosuiteclient_offline' => 'Offline Bypass', + 'mokosuiteclient_dbip' => 'GeoIP Lookup', + 'mokosuiteclient_license' => 'License Manager', ]; $diskPct = ($disk->total_mb && $disk->total_mb > 0) diff --git a/source/script.php b/source/script.php index ec7b16a0..2bf0a795 100644 --- a/source/script.php +++ b/source/script.php @@ -699,11 +699,7 @@ class Pkg_MokosuiteclientInstallerScript { $pluginDir = JPATH_PLUGINS . '/' . $group . '/' . $element; - if (is_dir($pluginDir)) - { - continue; // Already installed correctly - } - + // Always re-extract to ensure files are up to date $zipName = 'plg_' . $group . '_' . $element . '.zip'; $zipPath = $sourceDir . '/packages/' . $zipName; @@ -720,11 +716,14 @@ class Pkg_MokosuiteclientInstallerScript continue; } + if (is_dir($pluginDir)) + { + $this->rmdirRecursive($pluginDir); + } + @mkdir($pluginDir, 0755, true); $zip->extractTo($pluginDir); $zip->close(); - - Log::add("Reinstalled {$group}/{$element} from package zip", Log::INFO, 'mokosuiteclient'); } } }