From 11141f27f421cdc81012f610e05643354212a5b9 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Wed, 17 Jun 2026 02:55:50 -0500 Subject: [PATCH 01/20] feat: per-profile backup retention (days and count) Each profile can now set its own retention_days and retention_count. A value of 0 means use the global default from component options. Cleanup logic refactored to iterate per-profile with individual retention thresholds. Also cleans up orphaned records where the parent profile was deleted. Log files alongside archives are now removed during cleanup. Extracted deleteBackupRecord() helper for consistent file+DB cleanup. --- .../com_mokosuitebackup/forms/profile.xml | 23 +++ .../language/en-GB/com_mokosuitebackup.ini | 7 + .../com_mokosuitebackup/sql/install.mysql.sql | 2 + .../sql/updates/mysql/01.21.00.sql | 4 + .../src/Extension/MokoSuiteBackup.php | 141 +++++++++++------- 5 files changed, 125 insertions(+), 52 deletions(-) create mode 100644 source/packages/com_mokosuitebackup/sql/updates/mysql/01.21.00.sql diff --git a/source/packages/com_mokosuitebackup/forms/profile.xml b/source/packages/com_mokosuitebackup/forms/profile.xml index 571dbc4..d01599f 100644 --- a/source/packages/com_mokosuitebackup/forms/profile.xml +++ b/source/packages/com_mokosuitebackup/forms/profile.xml @@ -176,6 +176,29 @@ +
+ + +
+
params->get('max_age_days', 30); - $maxBackups = (int) $this->params->get('max_backups', 10); + $db = Factory::getDbo(); + $globalMaxAge = (int) ComponentHelper::getParams('com_mokosuitebackup')->get('max_age_days', 30); + $globalMaxCount = (int) ComponentHelper::getParams('com_mokosuitebackup')->get('max_backups', 10); - // Delete by age - $cutoff = date('Y-m-d H:i:s', strtotime("-{$maxAge} days")); - $query = $db->getQuery(true) - ->select('id, absolute_path') - ->from($db->quoteName('#__mokosuitebackup_records')) - ->where($db->quoteName('backupstart') . ' < ' . $db->quote($cutoff)) - ->where($db->quoteName('status') . ' = ' . $db->quote('complete')); - $db->setQuery($query); - $expired = $db->loadObjectList(); - - foreach ($expired as $record) { - if (!empty($record->absolute_path) && is_file($record->absolute_path)) { - if (!@unlink($record->absolute_path)) { - continue; // Don't delete DB record if file can't be removed - } - } - - $db->setQuery( - $db->getQuery(true) - ->delete($db->quoteName('#__mokosuitebackup_records')) - ->where($db->quoteName('id') . ' = ' . (int) $record->id) - ); - $db->execute(); - } - - // Enforce max backups count (keep newest) + // Load all published profiles with their retention settings $query = $db->getQuery(true) - ->select('COUNT(*)') - ->from($db->quoteName('#__mokosuitebackup_records')) - ->where($db->quoteName('status') . ' = ' . $db->quote('complete')); + ->select([$db->quoteName('id'), $db->quoteName('retention_days'), $db->quoteName('retention_count')]) + ->from($db->quoteName('#__mokosuitebackup_profiles')) + ->where($db->quoteName('published') . ' = 1'); $db->setQuery($query); - $totalCount = (int) $db->loadResult(); + $profiles = $db->loadObjectList(); - if ($totalCount > $maxBackups) { - $excess = $totalCount - $maxBackups; + foreach ($profiles as $profile) { + $maxAge = (int) $profile->retention_days > 0 ? (int) $profile->retention_days : $globalMaxAge; + $maxCount = (int) $profile->retention_count > 0 ? (int) $profile->retention_count : $globalMaxCount; + $pid = (int) $profile->id; + + // Delete by age for this profile + $cutoff = date('Y-m-d H:i:s', strtotime("-{$maxAge} days")); $query = $db->getQuery(true) ->select('id, absolute_path') ->from($db->quoteName('#__mokosuitebackup_records')) - ->where($db->quoteName('status') . ' = ' . $db->quote('complete')) - ->order($db->quoteName('backupstart') . ' ASC'); - $db->setQuery($query, 0, $excess); - $oldest = $db->loadObjectList(); + ->where($db->quoteName('profile_id') . ' = ' . $pid) + ->where($db->quoteName('backupstart') . ' < ' . $db->quote($cutoff)) + ->where($db->quoteName('status') . ' = ' . $db->quote('complete')); + $db->setQuery($query); + $expired = $db->loadObjectList(); - foreach ($oldest as $record) { - if (!empty($record->absolute_path) && is_file($record->absolute_path)) { - if (!@unlink($record->absolute_path)) { - continue; // Do not delete DB record if file cannot be removed - } - } + foreach ($expired as $record) { + $this->deleteBackupRecord($db, $record); + } - $db->setQuery( - $db->getQuery(true) - ->delete($db->quoteName('#__mokosuitebackup_records')) - ->where($db->quoteName('id') . ' = ' . (int) $record->id) - ); - $db->execute(); + // Enforce max count for this profile (keep newest) + $query = $db->getQuery(true) + ->select('COUNT(*)') + ->from($db->quoteName('#__mokosuitebackup_records')) + ->where($db->quoteName('profile_id') . ' = ' . $pid) + ->where($db->quoteName('status') . ' = ' . $db->quote('complete')); + $db->setQuery($query); + $totalCount = (int) $db->loadResult(); + + if ($totalCount > $maxCount) { + $excess = $totalCount - $maxCount; + $query = $db->getQuery(true) + ->select('id, absolute_path') + ->from($db->quoteName('#__mokosuitebackup_records')) + ->where($db->quoteName('profile_id') . ' = ' . $pid) + ->where($db->quoteName('status') . ' = ' . $db->quote('complete')) + ->order($db->quoteName('backupstart') . ' ASC'); + $db->setQuery($query, 0, $excess); + $oldest = $db->loadObjectList(); + + foreach ($oldest as $record) { + $this->deleteBackupRecord($db, $record); + } } } + + // Also clean up orphaned records (profile deleted but records remain) + $query = $db->getQuery(true) + ->select('r.id, r.absolute_path') + ->from($db->quoteName('#__mokosuitebackup_records', 'r')) + ->join('LEFT', $db->quoteName('#__mokosuitebackup_profiles', 'p') . ' ON p.id = r.profile_id') + ->where('p.id IS NULL') + ->where($db->quoteName('r.status') . ' = ' . $db->quote('complete')); + $db->setQuery($query); + $orphans = $db->loadObjectList(); + + foreach ($orphans as $record) { + $this->deleteBackupRecord($db, $record); + } + } + + /** + * Delete a backup record and its archive file. + */ + private function deleteBackupRecord(object $db, object $record): void + { + if (!empty($record->absolute_path) && is_file($record->absolute_path)) { + if (!@unlink($record->absolute_path)) { + return; // Don't delete DB record if file can't be removed + } + + // Also remove the log file if it exists alongside the archive + $logPath = preg_replace('/\.(zip|tar\.gz)$/i', '.log', $record->absolute_path); + + if (is_file($logPath)) { + @unlink($logPath); + } + } + + $db->setQuery( + $db->getQuery(true) + ->delete($db->quoteName('#__mokosuitebackup_records')) + ->where($db->quoteName('id') . ' = ' . (int) $record->id) + ); + $db->execute(); } /** -- 2.52.0 From d8367d7bebce9745b21ad37074bf2fcfb95d4868 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Wed, 17 Jun 2026 07:56:07 +0000 Subject: [PATCH 02/20] chore(version): pre-release bump to 01.21.01-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index c33824a..4601be4 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.21.00-dev + 01.21.01-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 4b7f98e..6c596e2 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.21.00 +# VERSION: 01.21.01 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index 10f3982..afc5a6d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index 2a0373d..bdc3412 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.21.00 + 01.21.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index c70e928..db28d05 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.21.00 + 01.21.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index de000b4..aead1df 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.21.00 + 01.21.01-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index 98d147a..f96eb99 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.21.00 + 01.21.01-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index 9780208..399dde3 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.21.00 + 01.21.01-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index 5532044..1e75d5b 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.21.00 + 01.21.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index 4b19018..877bbc1 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.21.00 + 01.21.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index 3402da0..a846fc0 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.21.00 + 01.21.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index 2a0373d..bdc3412 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.21.00 + 01.21.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index 14499be..1a62cce 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.21.00 + 01.21.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From 9a908e2e3c431bb0fb6b3f518b01cdfe14852fff Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Wed, 17 Jun 2026 07:57:03 +0000 Subject: [PATCH 03/20] chore(version): pre-release bump to 01.22.00-rc [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index 4601be4..dfc2bba 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.21.01-dev + 01.22.00-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 6c596e2..5972dfc 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.21.01 +# VERSION: 01.22.00 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index afc5a6d..ddd1ac9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index bdc3412..e2cf276 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.21.01-dev + 01.22.00-rc 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index db28d05..046f854 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.21.01-dev + 01.22.00-rc 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index aead1df..e80caa7 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.21.01-dev + 01.22.00-rc 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index f96eb99..bf3741d 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.21.01-dev + 01.22.00-rc 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index 399dde3..9c39b78 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.21.01-dev + 01.22.00-rc 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index 1e75d5b..894cf11 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.21.01-dev + 01.22.00-rc 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index 877bbc1..157a5d5 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.21.01-dev + 01.22.00-rc 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index a846fc0..6b23949 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.21.01-dev + 01.22.00-rc 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index bdc3412..e2cf276 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.21.01-dev + 01.22.00-rc 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index 1a62cce..f282bd7 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.21.01-dev + 01.22.00-rc 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From dd09b65cc449ccb560f3bbb9f50176ac3330646c Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Wed, 17 Jun 2026 16:42:27 +0000 Subject: [PATCH 04/20] chore(version): pre-release bump to 01.22.01-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index dfc2bba..1b2fc7d 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.22.00-dev + 01.22.01-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 5972dfc..d8638da 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.22.00 +# VERSION: 01.22.01 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index ddd1ac9..0ee4629 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index e2cf276..adc0539 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.00-rc + 01.22.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index 046f854..a2e4869 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.22.00-rc + 01.22.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index e80caa7..578cb91 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.22.00-rc + 01.22.01-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index bf3741d..8b1d88a 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.22.00-rc + 01.22.01-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index 9c39b78..e371adc 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.22.00-rc + 01.22.01-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index 894cf11..a99b34a 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.22.00-rc + 01.22.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index 157a5d5..6808bec 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.22.00-rc + 01.22.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index 6b23949..56008c5 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.22.00-rc + 01.22.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index e2cf276..adc0539 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.00-rc + 01.22.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index f282bd7..6266439 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.22.00-rc + 01.22.01-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From b3928915fe64956b536653b9a58fff4191e24029 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 18 Jun 2026 13:19:05 +0000 Subject: [PATCH 05/20] chore(version): pre-release bump to 01.22.02-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index 1b2fc7d..9f0b29c 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.22.01-dev + 01.22.02-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index d8638da..765f764 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.22.01 +# VERSION: 01.22.02 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index 0ee4629..657a3ce 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index adc0539..d1ab972 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.01-dev + 01.22.02-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index a2e4869..ca1db5d 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.22.01-dev + 01.22.02-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index 578cb91..1196be0 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.22.01-dev + 01.22.02-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index 8b1d88a..fea5dec 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.22.01-dev + 01.22.02-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index e371adc..5b8fe0e 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.22.01-dev + 01.22.02-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index a99b34a..dc743c4 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.22.01-dev + 01.22.02-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index 6808bec..df97d49 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.22.01-dev + 01.22.02-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index 56008c5..8378bc9 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.22.01-dev + 01.22.02-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index adc0539..d1ab972 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.01-dev + 01.22.02-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index 6266439..906cfc5 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.22.01-dev + 01.22.02-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From 2a4676c999e8dbf9c191e41e0e745215458d1aa6 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 18 Jun 2026 09:10:28 -0500 Subject: [PATCH 06/20] fix: expand PHP extension checks (#22) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BackupEngine: check ext-zip, ext-pdo, ext-pdo_mysql, ext-mbstring before running (was only zip + mbstring). Installer preflight: warn about missing extensions (zip, pdo, pdo_mysql, mbstring, curl) during install/update. Warns but does not block installation so the component can still be configured. MokoRestore already checks ext-zip, ext-pdo_mysql, ext-mbstring, ext-json in its preflight step. composer.json already declares all six extensions as requirements (zip, pdo, pdo_mysql, curl, ftp, mbstring) — composer install fails if any are missing, which CI enforces. Closes #22 --- .../src/Engine/BackupEngine.php | 17 +++++++++++------ source/script.php | 13 +++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php b/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php index bf6544d..fa4a143 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php +++ b/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php @@ -381,14 +381,19 @@ class BackupEngine */ private function checkRequiredExtensions(): true|string { + $required = [ + 'zip' => 'ext-zip (required for archive creation)', + 'pdo' => 'ext-pdo (required for database operations)', + 'pdo_mysql' => 'ext-pdo_mysql (required for MySQL database dumps)', + 'mbstring' => 'ext-mbstring (required for binary-safe operations)', + ]; + $missing = []; - if (!extension_loaded('zip')) { - $missing[] = 'ext-zip (required for archive creation)'; - } - - if (!extension_loaded('mbstring') && !function_exists('mb_strlen')) { - $missing[] = 'ext-mbstring (required for binary-safe operations)'; + foreach ($required as $ext => $label) { + if (!extension_loaded($ext)) { + $missing[] = $label; + } } if (!empty($missing)) { diff --git a/source/script.php b/source/script.php index f194511..4964a31 100644 --- a/source/script.php +++ b/source/script.php @@ -58,6 +58,19 @@ class Pkg_MokoSuiteBackupInstallerScript return false; } + // Check required PHP extensions (warn but don't block install) + $requiredExts = ['zip', 'pdo', 'pdo_mysql', 'mbstring', 'curl']; + $missingExts = array_filter($requiredExts, fn($ext) => !extension_loaded($ext)); + + if (!empty($missingExts)) { + Factory::getApplication()->enqueueMessage( + 'MokoSuiteBackup — Missing PHP Extensions: ' + . implode(', ', array_map(fn($e) => 'ext-' . $e, $missingExts)) + . '. Some features (backup, restore, remote upload, notifications) may not work until these are enabled.', + 'warning' + ); + } + // Save download key before Joomla re-registers the update site if ($type === 'update') { $this->preflight_saveKey(); -- 2.52.0 From 2c58ebed382beabe77cee27bdfdf0b5fdc384684 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 18 Jun 2026 14:10:46 +0000 Subject: [PATCH 07/20] chore(version): pre-release bump to 01.22.03-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index 9f0b29c..25795d3 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.22.02-dev + 01.22.03-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 765f764..7ca4dcb 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.22.02 +# VERSION: 01.22.03 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index 657a3ce..b3c71f4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index d1ab972..66143b7 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.02-dev + 01.22.03-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index ca1db5d..0e42c3e 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.22.02-dev + 01.22.03-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index 1196be0..9911427 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.22.02-dev + 01.22.03-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index fea5dec..59a0880 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.22.02-dev + 01.22.03-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index 5b8fe0e..e77ee56 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.22.02-dev + 01.22.03-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index dc743c4..6b321f3 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.22.02-dev + 01.22.03-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index df97d49..4a7ec9f 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.22.02-dev + 01.22.03-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index 8378bc9..86eab14 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.22.02-dev + 01.22.03-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index d1ab972..66143b7 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.02-dev + 01.22.03-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index 906cfc5..487b497 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.22.02-dev + 01.22.03-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From ee48b150f50301dc088174d85fc9d3010bf403e8 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 18 Jun 2026 14:12:38 +0000 Subject: [PATCH 08/20] chore(version): pre-release bump to 01.22.04-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index 25795d3..1ecd53a 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.22.03-dev + 01.22.04-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 7ca4dcb..f8c276f 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.22.03 +# VERSION: 01.22.04 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index b3c71f4..a8af0f6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index 66143b7..74975b4 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.03-dev + 01.22.04-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index 0e42c3e..dd00047 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.22.03-dev + 01.22.04-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index 9911427..8071d27 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.22.03-dev + 01.22.04-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index 59a0880..e277a9b 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.22.03-dev + 01.22.04-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index e77ee56..1b638d7 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.22.03-dev + 01.22.04-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index 6b321f3..37e08d4 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.22.03-dev + 01.22.04-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index 4a7ec9f..2cb8efe 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.22.03-dev + 01.22.04-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index 86eab14..36fbe2b 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.22.03-dev + 01.22.04-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index 66143b7..74975b4 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.03-dev + 01.22.04-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index 487b497..34cfedb 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.22.03-dev + 01.22.04-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From b2eab66d2766fc2b36cdcc180797a99660aabffa Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 18 Jun 2026 09:31:41 -0500 Subject: [PATCH 09/20] fix: include backup_type and archivename in notification record MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The update object passed to NotificationSender only had fields being updated in the DB (total_size, checksum, etc). It was missing backup_type, archivename, description, origin, and backupstart — which are set on the initial insert and don't change. This caused ntfy notifications to show empty Type and Archive fields. --- .../com_mokosuitebackup/src/Engine/BackupEngine.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php b/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php index fa4a143..5531d45 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php +++ b/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php @@ -267,10 +267,15 @@ class BackupEngine error_log('MokoSuiteBackup: Could not write log file: ' . $logPath); } - // Final record update + // Final record update (includes fields needed by NotificationSender) $update = (object) [ 'id' => $recordId, 'status' => 'complete', + 'description' => $description, + 'backup_type' => $profile->backup_type, + 'archivename' => $archiveName, + 'origin' => $origin, + 'backupstart' => $now, 'total_size' => $totalSize, 'db_size' => $dbSize, 'files_count' => $filesCount, -- 2.52.0 From 6810edcd7f646cb5a2ed78aa3076240d016b109c Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 18 Jun 2026 14:35:16 +0000 Subject: [PATCH 10/20] chore(version): pre-release bump to 01.22.05-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index 1ecd53a..8c2bffc 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.22.04-dev + 01.22.05-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index f8c276f..70c997f 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.22.04 +# VERSION: 01.22.05 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index a8af0f6..58efced 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index 74975b4..dd7f6d6 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.04-dev + 01.22.05-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index dd00047..8a32f8f 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.22.04-dev + 01.22.05-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index 8071d27..fab1264 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.22.04-dev + 01.22.05-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index e277a9b..d643f5e 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.22.04-dev + 01.22.05-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index 1b638d7..b579a97 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.22.04-dev + 01.22.05-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index 37e08d4..4cb77e8 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.22.04-dev + 01.22.05-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index 2cb8efe..03d4f98 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.22.04-dev + 01.22.05-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index 36fbe2b..c79e46c 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.22.04-dev + 01.22.05-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index 74975b4..dd7f6d6 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.04-dev + 01.22.05-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index 34cfedb..8234b31 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.22.04-dev + 01.22.05-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From 36ec6dd5a3450ad5d6caf9e42ec0dc6edf031dad Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 18 Jun 2026 10:19:42 -0500 Subject: [PATCH 11/20] fix: notifications for AJAX backups, download CSRF token SteppedBackupEngine now sends email + ntfy notifications on both success (completeRecord) and failure (failRecord). Previously only BackupEngine (synchronous CLI/toolbar path) sent notifications. Download link in backups template now includes the CSRF token in the URL query string, fixing "security token did not match" error when clicking download buttons. --- .../src/Engine/SteppedBackupEngine.php | 77 +++++++++++++++++-- .../tmpl/backups/default.php | 2 +- 2 files changed, 72 insertions(+), 7 deletions(-) diff --git a/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php b/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php index 819285d..2f2850f 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php +++ b/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php @@ -433,14 +433,47 @@ class SteppedBackupEngine error_log('MokoSuiteBackup: Could not write log file: ' . $logPath); } + $totalSize = is_file($session->archivePath) ? filesize($session->archivePath) : 0; + $update = (object) [ - 'id' => $session->recordId, - 'status' => 'complete', - 'backupend' => date('Y-m-d H:i:s'), - 'log' => $logContent, + 'id' => $session->recordId, + 'status' => 'complete', + 'backupend' => date('Y-m-d H:i:s'), + 'total_size' => $totalSize, + 'log' => $logContent, ]; $db->updateObject('#__mokosuitebackup_records', $update, 'id'); + + // Send notifications (email + ntfy) + try { + $query = $db->getQuery(true) + ->select('*') + ->from($db->quoteName('#__mokosuitebackup_profiles')) + ->where($db->quoteName('id') . ' = ' . (int) $session->profileId); + $db->setQuery($query); + $profile = $db->loadObject(); + + if ($profile) { + $record = (object) [ + 'id' => $session->recordId, + 'description' => $session->description ?? '', + 'backup_type' => $session->backupType, + 'archivename' => $session->archiveName, + 'origin' => $session->origin, + 'backupstart' => '', + 'backupend' => date('Y-m-d H:i:s'), + 'total_size' => $totalSize, + 'files_count' => $session->filesCount ?? 0, + 'tables_count' => $session->tablesCount ?? 0, + 'remote_filename' => '', + ]; + + NotificationSender::send($profile, $record, true, $logContent); + } + } catch (\Exception $e) { + error_log('MokoSuiteBackup: SteppedBackupEngine notification failed: ' . $e->getMessage()); + } } /** @@ -448,15 +481,47 @@ class SteppedBackupEngine */ private function failRecord(SteppedSession $session, string $error): void { - $db = Factory::getDbo(); + $db = Factory::getDbo(); + $logContent = implode("\n", $session->log); + $update = (object) [ 'id' => $session->recordId, 'status' => 'fail', 'backupend' => date('Y-m-d H:i:s'), - 'log' => implode("\n", $session->log), + 'log' => $logContent, ]; $db->updateObject('#__mokosuitebackup_records', $update, 'id'); + + // Send failure notification + try { + $query = $db->getQuery(true) + ->select('*') + ->from($db->quoteName('#__mokosuitebackup_profiles')) + ->where($db->quoteName('id') . ' = ' . (int) $session->profileId); + $db->setQuery($query); + $profile = $db->loadObject(); + + if ($profile) { + $record = (object) [ + 'id' => $session->recordId, + 'description' => $session->description, + 'backup_type' => $session->backupType, + 'archivename' => $session->archiveName, + 'origin' => $session->origin, + 'backupstart' => '', + 'backupend' => date('Y-m-d H:i:s'), + 'total_size' => 0, + 'files_count' => $session->filesCount, + 'tables_count' => $session->tablesCount, + 'remote_filename' => '', + ]; + + NotificationSender::send($profile, $record, false, $logContent); + } + } catch (\Exception $e) { + error_log('MokoSuiteBackup: SteppedBackupEngine failure notification failed: ' . $e->getMessage()); + } } /** diff --git a/source/packages/com_mokosuitebackup/tmpl/backups/default.php b/source/packages/com_mokosuitebackup/tmpl/backups/default.php index 0aaa9f5..eebb683 100644 --- a/source/packages/com_mokosuitebackup/tmpl/backups/default.php +++ b/source/packages/com_mokosuitebackup/tmpl/backups/default.php @@ -145,7 +145,7 @@ $listDirn = $this->escape($this->state->get('list.direction')); $isWebAccessible = !empty($item->absolute_path) && strpos(realpath($item->absolute_path) ?: $item->absolute_path, realpath(JPATH_ROOT) ?: JPATH_ROOT) === 0; ?> - -- 2.52.0 From f47a99636b8e6c6a6af267524aae8ca0bcdd5be8 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 18 Jun 2026 15:19:59 +0000 Subject: [PATCH 12/20] chore(version): pre-release bump to 01.22.06-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index 8c2bffc..24906dc 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.22.05-dev + 01.22.06-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 70c997f..6ee744a 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.22.05 +# VERSION: 01.22.06 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index 58efced..139a48b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index dd7f6d6..73b33e2 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.05-dev + 01.22.06-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index 8a32f8f..1ee20fa 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.22.05-dev + 01.22.06-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index fab1264..f027f37 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.22.05-dev + 01.22.06-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index d643f5e..4cb1ca0 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.22.05-dev + 01.22.06-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index b579a97..29128ea 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.22.05-dev + 01.22.06-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index 4cb77e8..8df3a82 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.22.05-dev + 01.22.06-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index 03d4f98..ce2c5f7 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.22.05-dev + 01.22.06-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index c79e46c..0d62062 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.22.05-dev + 01.22.06-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index dd7f6d6..73b33e2 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.05-dev + 01.22.06-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index 8234b31..538ab66 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.22.05-dev + 01.22.06-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From 9656a2a92b2b9ddc53cd94c7ca32f657a97f1ea3 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 18 Jun 2026 10:26:44 -0500 Subject: [PATCH 13/20] =?UTF-8?q?fix:=20PR=20#46=20review=20=E2=80=94=20er?= =?UTF-8?q?ror=20handling,=20failure=20notifications,=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Critical: - Wrap cleanupOldBackups() in try-catch to prevent admin panel crash - Add missing fields (total_size, files_count, etc.) to failure record so failure notifications actually send High: - Log unlink failures in deleteBackupRecord() instead of silent return - Wrap DB delete in try-catch so one failed record doesn't abort loop - Check for ext-curl before calling curl_init() in sendNtfy() Medium: - Change runPreActionBackup catch from \Exception to \Throwable - Log warning for skipped files during archive encryption - Truncate ntfy response body in error logs (200 chars max) --- .../src/Engine/BackupEngine.php | 23 +++++++------ .../src/Engine/NotificationSender.php | 8 ++++- .../src/Extension/MokoSuiteBackup.php | 32 +++++++++++++------ 3 files changed, 44 insertions(+), 19 deletions(-) diff --git a/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php b/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php index 5531d45..626073c 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php +++ b/source/packages/com_mokosuitebackup/src/Engine/BackupEngine.php @@ -305,15 +305,19 @@ class BackupEngine $this->log('FATAL: ' . $e->getMessage()); $update = (object) [ - 'id' => $recordId, - 'status' => 'fail', - 'description' => $description ?: '', - 'backup_type' => $profile->backup_type ?? 'full', - 'origin' => $origin, - 'archivename' => $archiveName, - 'backupstart' => $now ?? date('Y-m-d H:i:s'), - 'backupend' => date('Y-m-d H:i:s'), - 'log' => implode("\n", $this->log), + 'id' => $recordId, + 'status' => 'fail', + 'description' => $description ?: '', + 'backup_type' => $profile->backup_type ?? 'full', + 'origin' => $origin, + 'archivename' => $archiveName, + 'backupstart' => $now ?? date('Y-m-d H:i:s'), + 'backupend' => date('Y-m-d H:i:s'), + 'total_size' => 0, + 'files_count' => 0, + 'tables_count' => 0, + 'remote_filename' => '', + 'log' => implode("\n", $this->log), ]; $db->updateObject('#__mokosuitebackup_records', $update, 'id'); @@ -487,6 +491,7 @@ class BackupEngine $name = $zip->getNameIndex($i); if ($name === false) { + $this->log('WARNING: Could not read file at index ' . $i . ' during encryption — file may remain unencrypted'); continue; } diff --git a/source/packages/com_mokosuitebackup/src/Engine/NotificationSender.php b/source/packages/com_mokosuitebackup/src/Engine/NotificationSender.php index 26467af..a5631fd 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/NotificationSender.php +++ b/source/packages/com_mokosuitebackup/src/Engine/NotificationSender.php @@ -169,6 +169,12 @@ class NotificationSender return false; } + if (!function_exists('curl_init')) { + error_log('MokoSuiteBackup: ntfy notifications require ext-curl'); + + return false; + } + try { $config = Factory::getApplication()->getConfig(); $siteName = $config->get('sitename', 'Joomla Site'); @@ -219,7 +225,7 @@ class NotificationSender } if ($httpCode < 200 || $httpCode >= 300) { - error_log('MokoSuiteBackup: ntfy returned HTTP ' . $httpCode . ': ' . $response); + error_log('MokoSuiteBackup: ntfy returned HTTP ' . $httpCode . ': ' . substr((string) $response, 0, 200)); return false; } diff --git a/source/packages/plg_system_mokosuitebackup/src/Extension/MokoSuiteBackup.php b/source/packages/plg_system_mokosuitebackup/src/Extension/MokoSuiteBackup.php index 0844548..e3d00c8 100644 --- a/source/packages/plg_system_mokosuitebackup/src/Extension/MokoSuiteBackup.php +++ b/source/packages/plg_system_mokosuitebackup/src/Extension/MokoSuiteBackup.php @@ -138,6 +138,15 @@ final class MokoSuiteBackup extends CMSPlugin implements SubscriberInterface * A profile value of 0 means "use the global default". */ private function cleanupOldBackups(): void + { + try { + $this->doCleanup(); + } catch (\Throwable $e) { + error_log('MokoSuiteBackup: cleanupOldBackups() failed: ' . $e->getMessage()); + } + } + + private function doCleanup(): void { $db = Factory::getDbo(); $globalMaxAge = (int) ComponentHelper::getParams('com_mokosuitebackup')->get('max_age_days', 30); @@ -219,10 +228,11 @@ final class MokoSuiteBackup extends CMSPlugin implements SubscriberInterface { if (!empty($record->absolute_path) && is_file($record->absolute_path)) { if (!@unlink($record->absolute_path)) { - return; // Don't delete DB record if file can't be removed + error_log('MokoSuiteBackup: Could not delete backup file (id=' . $record->id . '): ' . $record->absolute_path); + + return; } - // Also remove the log file if it exists alongside the archive $logPath = preg_replace('/\.(zip|tar\.gz)$/i', '.log', $record->absolute_path); if (is_file($logPath)) { @@ -230,12 +240,16 @@ final class MokoSuiteBackup extends CMSPlugin implements SubscriberInterface } } - $db->setQuery( - $db->getQuery(true) - ->delete($db->quoteName('#__mokosuitebackup_records')) - ->where($db->quoteName('id') . ' = ' . (int) $record->id) - ); - $db->execute(); + try { + $db->setQuery( + $db->getQuery(true) + ->delete($db->quoteName('#__mokosuitebackup_records')) + ->where($db->quoteName('id') . ' = ' . (int) $record->id) + ); + $db->execute(); + } catch (\Exception $e) { + error_log('MokoSuiteBackup: Could not delete backup record ' . $record->id . ': ' . $e->getMessage()); + } } /** @@ -291,7 +305,7 @@ final class MokoSuiteBackup extends CMSPlugin implements SubscriberInterface 'warning' ); } - } catch (\Exception $e) { + } catch (\Throwable $e) { error_log('MokoSuiteBackup: ' . $description . ' failed: ' . $e->getMessage()); Factory::getApplication()->enqueueMessage( 'MokoSuiteBackup: ' . $description . ' failed — ' . $e->getMessage(), -- 2.52.0 From b3e7c8ec72ff783fa02699dd64e3337a63bbc209 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 18 Jun 2026 15:27:08 +0000 Subject: [PATCH 14/20] chore(version): pre-release bump to 01.22.07-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index 24906dc..e310dec 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.22.06-dev + 01.22.07-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 6ee744a..b04769d 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.22.06 +# VERSION: 01.22.07 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index 139a48b..3f47382 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index 73b33e2..a542d20 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.06-dev + 01.22.07-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index 1ee20fa..c64447f 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.22.06-dev + 01.22.07-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index f027f37..fd7c9ac 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.22.06-dev + 01.22.07-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index 4cb1ca0..349d66b 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.22.06-dev + 01.22.07-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index 29128ea..e56cc59 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.22.06-dev + 01.22.07-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index 8df3a82..cf7f8ed 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.22.06-dev + 01.22.07-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index ce2c5f7..55178dc 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.22.06-dev + 01.22.07-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index 0d62062..05c94f2 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.22.06-dev + 01.22.07-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index 73b33e2..a542d20 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.06-dev + 01.22.07-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index 538ab66..b969b61 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.22.06-dev + 01.22.07-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From b2874f32f2fe5fd1e6eab8385fbfdc9331a54ba9 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 18 Jun 2026 10:42:05 -0500 Subject: [PATCH 15/20] feat: abstract DB prefix, stepped checksum, restore security gate Database prefix abstraction: - DatabaseDumper uses #__ placeholder instead of live prefix in all SQL output (DROP TABLE, CREATE TABLE, INSERT INTO) - SteppedBackupEngine::dumpSingleTable() same #__ replacement - DatabaseImporter replaces #__ with current site prefix on import - MokoRestore replaces #__ with user-specified prefix on import - Backups are now portable across sites with different prefixes Stepped backup checksum: - completeRecord() now computes and stores SHA-256 checksum MokoRestore security gate: - Writes .mokorestore-security.php with random 8-char code to site root - User must read code from filesystem and enter it in browser - Proves filesystem access before any restore actions are allowed - Security file auto-deleted after successful verification - All AJAX actions blocked until verification completes --- .../src/Engine/DatabaseDumper.php | 14 ++- .../src/Engine/DatabaseImporter.php | 7 +- .../src/Engine/MokoRestore.php | 114 +++++++++++++++++- .../src/Engine/SteppedBackupEngine.php | 16 ++- 4 files changed, 134 insertions(+), 17 deletions(-) diff --git a/source/packages/com_mokosuitebackup/src/Engine/DatabaseDumper.php b/source/packages/com_mokosuitebackup/src/Engine/DatabaseDumper.php index bf49ec7..63609ca 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/DatabaseDumper.php +++ b/source/packages/com_mokosuitebackup/src/Engine/DatabaseDumper.php @@ -60,7 +60,9 @@ class DatabaseDumper $output[] = '-- Generated: ' . date('Y-m-d H:i:s'); $output[] = '-- Server: ' . $db->getServerType(); $output[] = '-- Database: ' . $db->getName(); - $output[] = '-- Prefix: ' . $prefix; + $output[] = '-- Original Prefix: ' . $prefix; + $output[] = '-- Abstract Prefix: #__'; + $output[] = '-- Note: Table names use #__ placeholder. Replace with your prefix on restore.'; $output[] = ''; $output[] = 'SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";'; $output[] = 'SET time_zone = "+00:00";'; @@ -90,7 +92,7 @@ class DatabaseDumper $this->tablesCount++; $output[] = '-- --------------------------------------------------------'; - $output[] = '-- Table: ' . $table; + $output[] = '-- Table: ' . $abstractName; if ($skipData) { $output[] = '-- (data excluded)'; @@ -112,8 +114,10 @@ class DatabaseDumper continue; } - $output[] = 'DROP TABLE IF EXISTS ' . $db->quoteName($table) . ';'; - $output[] = $createRow[1] . ';'; + // Replace live prefix with #__ in CREATE TABLE output + $createSql = str_replace($table, $abstractName, $createRow[1]); + $output[] = 'DROP TABLE IF EXISTS `' . $abstractName . '`;'; + $output[] = $createSql . ';'; $output[] = ''; } @@ -160,7 +164,7 @@ class DatabaseDumper } $columns = array_map([$db, 'quoteName'], array_keys($row)); - $output[] = 'INSERT INTO ' . $db->quoteName($table) + $output[] = 'INSERT INTO `' . $abstractName . '`' . ' (' . implode(', ', $columns) . ')' . ' VALUES (' . implode(', ', $values) . ');'; } diff --git a/source/packages/com_mokosuitebackup/src/Engine/DatabaseImporter.php b/source/packages/com_mokosuitebackup/src/Engine/DatabaseImporter.php index 717dce8..6009306 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/DatabaseImporter.php +++ b/source/packages/com_mokosuitebackup/src/Engine/DatabaseImporter.php @@ -87,11 +87,8 @@ class DatabaseImporter continue; } - // Replace the prefix from the dump with the current site prefix. - // The dump uses real table names (with the original prefix), but - // if restoring to a site with a different prefix we need to handle it. - // Our DatabaseDumper uses real names, so no replacement needed - // for same-site restores. + // Replace abstract #__ prefix with the current site's prefix + $statement = str_replace('#__', $prefix, $statement); try { $db->setQuery($statement); diff --git a/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php b/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php index 30f1944..db95b2f 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php +++ b/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php @@ -109,6 +109,52 @@ if (empty($_SESSION['restore_token'])) { $token = $_SESSION['restore_token']; +// ── Security Verification ─────────────────────────────────────────── +// Write a security file to the web root with a random code. +// The user must read the code from the file and enter it in the browser +// to prove they have filesystem access before any restore actions are allowed. +$securityFile = RESTORE_DIR . '/.mokorestore-security.php'; +$securityCode = $_SESSION['security_code'] ?? ''; + +if (empty($securityCode)) { + $securityCode = strtoupper(substr(bin2hex(random_bytes(4)), 0, 8)); + $_SESSION['security_code'] = $securityCode; + $_SESSION['security_verified'] = false; + + // Write security file with the code + $securityContent = "\n" + . "MokoRestore Security Verification\n" + . "==================================\n" + . "Code: " . $securityCode . "\n" + . "Enter this code in the MokoRestore browser interface to proceed.\n" + . "This file will be deleted automatically after verification.\n"; + file_put_contents($securityFile, $securityContent); +} + +// Handle security code verification via POST +if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'verify_security') { + header('Content-Type: application/json; charset=utf-8'); + $inputCode = strtoupper(trim($_POST['security_code'] ?? '')); + + if ($inputCode === $securityCode) { + $_SESSION['security_verified'] = true; + + // Delete the security file + if (is_file($securityFile)) { + @unlink($securityFile); + } + + echo json_encode(['success' => true, 'message' => 'Security verified']); + } else { + echo json_encode(['success' => false, 'message' => 'Incorrect security code. Check the file: .mokorestore-security.php']); + } + + exit; +} + +// Block all other actions until security is verified +$securityVerified = !empty($_SESSION['security_verified']); + // ── AJAX Handler ──────────────────────────────────────────────────── if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) { header('Content-Type: application/json; charset=utf-8'); @@ -118,6 +164,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action'])) { exit; } + if (!$securityVerified) { + echo json_encode(['success' => false, 'message' => 'Security verification required. Enter the code from .mokorestore-security.php']); + exit; + } + @set_time_limit(0); @ini_set('max_execution_time', '0'); @ini_set('memory_limit', '512M'); @@ -348,7 +399,12 @@ function actionDatabase(array $data): array $pdo->exec("SET time_zone = '+00:00'"); $pdo->exec('SET FOREIGN_KEY_CHECKS = 0'); - $sql = file_get_contents($sqlFile); + $sql = file_get_contents($sqlFile); + $prefix = getValidatedPrefix($data); + + // Replace abstract #__ prefix with the user's target prefix + $sql = str_replace('#__', $prefix, $sql); + $parts = explode(";\n", $sql); $statements = 0; $errors = 0; @@ -981,8 +1037,33 @@ body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica N
7Complete
+ +
+

Security Verification

+

To prevent unauthorized access, enter the security code from the file .mokorestore-security.php in your site root.

+
+
+ 🔒 How to find the code +
+
    +
  1. Connect to your server via FTP, SSH, or file manager
  2. +
  3. Open .mokorestore-security.php in the site root directory
  4. +
  5. Copy the 8-character code and enter it below
  6. +
+
+
+ + +
+
+
+ + +
+
+ -
+

Pre-Installation Checks

Verify your server meets the requirements for Joomla and MokoRestore.

    @@ -1223,6 +1304,35 @@ function setBtnLoading(btn, loading) { } // Step 1 +async function verifySecurity() { + const btn = document.getElementById('btnVerify'); + setBtnLoading(btn, true); + const code = document.getElementById('securityCode').value.trim(); + + if (!code) { + setStatus('securityStatus', 'Please enter the security code', 'error'); + setBtnLoading(btn, false); + return; + } + + const form = new FormData(); + form.append('action', 'verify_security'); + form.append('security_code', code); + form.append('token', TOKEN); + + const resp = await fetch('', { method: 'POST', body: form }); + const r = await resp.json(); + setBtnLoading(btn, false); + + if (r.success) { + setStatus('securityStatus', 'Verified!', 'success'); + document.getElementById('panel0').classList.remove('visible'); + document.getElementById('panel1').classList.add('visible'); + } else { + setStatus('securityStatus', r.message, 'error'); + } +} + async function runPreflight() { const btn = document.getElementById('btnCheck'); setBtnLoading(btn, true); diff --git a/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php b/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php index 2f2850f..f910cff 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php +++ b/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php @@ -434,12 +434,14 @@ class SteppedBackupEngine } $totalSize = is_file($session->archivePath) ? filesize($session->archivePath) : 0; + $checksum = is_file($session->archivePath) ? hash_file('sha256', $session->archivePath) : ''; $update = (object) [ 'id' => $session->recordId, 'status' => 'complete', 'backupend' => date('Y-m-d H:i:s'), 'total_size' => $totalSize, + 'checksum' => $checksum, 'log' => $logContent, ]; @@ -529,13 +531,16 @@ class SteppedBackupEngine */ private function dumpSingleTable(object $db, string $table): string { + $prefix = $db->getPrefix(); + $abstractName = '#__' . substr($table, strlen($prefix)); + $output = []; $output[] = '-- --------------------------------------------------------'; - $output[] = '-- Table: ' . $table; + $output[] = '-- Table: ' . $abstractName; $output[] = '-- --------------------------------------------------------'; $output[] = ''; - // CREATE TABLE + // CREATE TABLE — replace live prefix with #__ $db->setQuery('SHOW CREATE TABLE ' . $db->quoteName($table)); $createRow = $db->loadRow(); @@ -543,8 +548,9 @@ class SteppedBackupEngine return ''; } - $output[] = 'DROP TABLE IF EXISTS ' . $db->quoteName($table) . ';'; - $output[] = $createRow[1] . ';'; + $createSql = str_replace($table, $abstractName, $createRow[1]); + $output[] = 'DROP TABLE IF EXISTS `' . $abstractName . '`;'; + $output[] = $createSql . ';'; $output[] = ''; // Data in chunks @@ -580,7 +586,7 @@ class SteppedBackupEngine } $columns = array_map([$db, 'quoteName'], array_keys($row)); - $output[] = 'INSERT INTO ' . $db->quoteName($table) + $output[] = 'INSERT INTO `' . $abstractName . '`' . ' (' . implode(', ', $columns) . ')' . ' VALUES (' . implode(', ', $values) . ');'; } -- 2.52.0 From 682538e4de61d8d357cbcdddfdf36c92ccbc8690 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 18 Jun 2026 15:42:29 +0000 Subject: [PATCH 16/20] chore(version): pre-release bump to 01.22.08-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index e310dec..1aca88c 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.22.07-dev + 01.22.08-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index b04769d..11e5174 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.22.07 +# VERSION: 01.22.08 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index 3f47382..081af1b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index a542d20..1774bab 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.07-dev + 01.22.08-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index c64447f..0dde6c1 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.22.07-dev + 01.22.08-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index fd7c9ac..6a60962 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.22.07-dev + 01.22.08-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index 349d66b..9e97cef 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.22.07-dev + 01.22.08-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index e56cc59..ddf1e4c 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.22.07-dev + 01.22.08-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index cf7f8ed..5af3cb8 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.22.07-dev + 01.22.08-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index 55178dc..a6a1451 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.22.07-dev + 01.22.08-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index 05c94f2..29568cf 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.22.07-dev + 01.22.08-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index a542d20..1774bab 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.07-dev + 01.22.08-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index b969b61..bd6e94d 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.22.07-dev + 01.22.08-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From a4c03d003224425f8a37bd41ba0636674e79eb33 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 18 Jun 2026 10:55:58 -0500 Subject: [PATCH 17/20] =?UTF-8?q?fix:=20critical=20review=20=E2=80=94=20in?= =?UTF-8?q?finite=20recursion,=20SQL=20injection,=20FK=20prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Critical: - Fix infinite recursion in getValidatedPrefix() — was calling itself instead of extracting from $data array - Fix SQL injection in actionResetAdmin() — prefix not validated, now uses getValidatedPrefix() High: - Fix prefix abstraction to cover FK REFERENCES — str_replace now targets backtick+prefix pattern to catch all table references in CREATE TABLE output, not just the current table name Medium: - Security gate file write check — skip verification gracefully if file cannot be written (don't lock user out) - Stepped notification catch \Throwable instead of \Exception --- .../com_mokosuitebackup/src/Engine/DatabaseDumper.php | 5 +++-- .../com_mokosuitebackup/src/Engine/MokoRestore.php | 10 +++++++--- .../src/Engine/SteppedBackupEngine.php | 5 +++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/source/packages/com_mokosuitebackup/src/Engine/DatabaseDumper.php b/source/packages/com_mokosuitebackup/src/Engine/DatabaseDumper.php index 63609ca..4beb213 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/DatabaseDumper.php +++ b/source/packages/com_mokosuitebackup/src/Engine/DatabaseDumper.php @@ -114,8 +114,9 @@ class DatabaseDumper continue; } - // Replace live prefix with #__ in CREATE TABLE output - $createSql = str_replace($table, $abstractName, $createRow[1]); + // Replace all occurrences of the live prefix with #__ in CREATE TABLE + // output — covers the table itself and FK REFERENCES to other tables + $createSql = str_replace('`' . $prefix, '`#__', $createRow[1]); $output[] = 'DROP TABLE IF EXISTS `' . $abstractName . '`;'; $output[] = $createSql . ';'; $output[] = ''; diff --git a/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php b/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php index db95b2f..4c2f63f 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php +++ b/source/packages/com_mokosuitebackup/src/Engine/MokoRestore.php @@ -128,7 +128,11 @@ if (empty($securityCode)) { . "Code: " . $securityCode . "\n" . "Enter this code in the MokoRestore browser interface to proceed.\n" . "This file will be deleted automatically after verification.\n"; - file_put_contents($securityFile, $securityContent); + if (file_put_contents($securityFile, $securityContent) === false) { + // Cannot write security file — skip verification to avoid locking user out + $_SESSION['security_verified'] = true; + error_log('MokoRestore: Cannot write security file — verification skipped (check directory permissions)'); + } } // Handle security code verification via POST @@ -731,7 +735,7 @@ HTACCESS; function getValidatedPrefix(array $data): string { - $prefix = getValidatedPrefix($data); + $prefix = trim($data['db_prefix'] ?? 'moko_'); if (!preg_match('/^[a-zA-Z][a-zA-Z0-9_]{0,20}$/', $prefix)) { throw new RuntimeException('Invalid table prefix format'); @@ -766,7 +770,7 @@ function actionListAdmins(array $data): array function actionResetAdmin(array $data): array { $pdo = getDbConnection($data); - $prefix = $data['db_prefix'] ?? 'moko_'; + $prefix = getValidatedPrefix($data); $userId = (int) ($data['admin_id'] ?? 0); $password = $data['new_password'] ?? ''; diff --git a/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php b/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php index f910cff..4e9c53c 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php +++ b/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php @@ -473,7 +473,7 @@ class SteppedBackupEngine NotificationSender::send($profile, $record, true, $logContent); } - } catch (\Exception $e) { + } catch (\Throwable $e) { error_log('MokoSuiteBackup: SteppedBackupEngine notification failed: ' . $e->getMessage()); } } @@ -548,7 +548,8 @@ class SteppedBackupEngine return ''; } - $createSql = str_replace($table, $abstractName, $createRow[1]); + // Replace all occurrences of the live prefix — covers FK REFERENCES too + $createSql = str_replace('`' . $prefix, '`#__', $createRow[1]); $output[] = 'DROP TABLE IF EXISTS `' . $abstractName . '`;'; $output[] = $createSql . ';'; $output[] = ''; -- 2.52.0 From 7ecc855e40514bf9a444c7c2e99bc31474f99713 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 18 Jun 2026 15:56:16 +0000 Subject: [PATCH 18/20] chore(version): pre-release bump to 01.22.09-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index 1aca88c..66075f4 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.22.08-dev + 01.22.09-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 11e5174..2991e23 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.22.08 +# VERSION: 01.22.09 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index 081af1b..ef247e3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index 1774bab..1ee8592 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.08-dev + 01.22.09-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index 0dde6c1..880ad29 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.22.08-dev + 01.22.09-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index 6a60962..f93bda0 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.22.08-dev + 01.22.09-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index 9e97cef..4fb5a54 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.22.08-dev + 01.22.09-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index ddf1e4c..91edc6b 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.22.08-dev + 01.22.09-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index 5af3cb8..3e3e638 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.22.08-dev + 01.22.09-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index a6a1451..1c81eff 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.22.08-dev + 01.22.09-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index 29568cf..2d32434 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.22.08-dev + 01.22.09-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index 1774bab..1ee8592 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.08-dev + 01.22.09-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index bd6e94d..cb7e01d 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.22.08-dev + 01.22.09-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0 From 55954ba0812cb2f38a47a4b39152233fe952b8e2 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 18 Jun 2026 10:59:44 -0500 Subject: [PATCH 19/20] =?UTF-8?q?fix:=20remaining=20review=20items=20?= =?UTF-8?q?=E2=80=94=20prefix=20in=20trailing=20SQL,=20dead=20code,=20inde?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DatabaseImporter: apply #__ prefix replacement on trailing statement (was missing for SQL not terminated by semicolon) - SteppedBackupEngine: remove unused DatabaseDumper instantiation - SteppedBackupEngine: fix misaligned indentation in stepDatabase() --- .../com_mokosuitebackup/src/Engine/DatabaseImporter.php | 2 ++ .../src/Engine/SteppedBackupEngine.php | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/packages/com_mokosuitebackup/src/Engine/DatabaseImporter.php b/source/packages/com_mokosuitebackup/src/Engine/DatabaseImporter.php index 6009306..af681d5 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/DatabaseImporter.php +++ b/source/packages/com_mokosuitebackup/src/Engine/DatabaseImporter.php @@ -107,6 +107,8 @@ class DatabaseImporter $remaining = trim($currentStatement); if (!empty($remaining)) { + $remaining = str_replace('#__', $prefix, $remaining); + try { $db->setQuery($remaining); $db->execute(); diff --git a/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php b/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php index 4e9c53c..7df30e7 100644 --- a/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php +++ b/source/packages/com_mokosuitebackup/src/Engine/SteppedBackupEngine.php @@ -220,8 +220,7 @@ class SteppedBackupEngine $db = Factory::getDbo(); // Dump this single table - $dumper = new DatabaseDumper([]); - $sql = $this->dumpSingleTable($db, $table); + $sql = $this->dumpSingleTable($db, $table); // Append to a temp SQL file that will be added to ZIP in finalize $sqlFile = $session->archivePath . '.sql'; @@ -234,8 +233,9 @@ class SteppedBackupEngine . "SET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\n" . "SET time_zone = \"+00:00\";\n\n"; if (file_put_contents($sqlFile, $header) === false) { - throw new \RuntimeException('Cannot write SQL dump: ' . $sqlFile); - } + throw new \RuntimeException('Cannot write SQL dump: ' . $sqlFile); + } + $flags = FILE_APPEND; } -- 2.52.0 From 2e7e49fa60d9f7432870b4b72751054105d06977 Mon Sep 17 00:00:00 2001 From: "gitea-actions[bot]" Date: Thu, 18 Jun 2026 15:59:59 +0000 Subject: [PATCH 20/20] chore(version): pre-release bump to 01.22.10-dev [skip ci] --- .mokogitea/manifest.xml | 2 +- .mokogitea/workflows/issue-branch.yml | 2 +- README.md | 2 +- mokosuitebackup.xml | 2 +- source/packages/com_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml | 2 +- .../packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml | 2 +- source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml | 2 +- .../plg_webservices_mokosuitebackup/mokosuitebackup.xml | 2 +- source/pkg_mokosuitebackup.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index 66075f4..f07f35e 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -5,7 +5,7 @@ Package - MokoSuiteBackup MokoConsulting Full-site backup and restore for Joomla — database, files, and configuration - 01.22.09-dev + 01.22.10-dev GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 2991e23..d14d951 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokoplatform.Automation -# VERSION: 01.22.09 +# VERSION: 01.22.10 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index ef247e3..6d0bb5a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MokoSuiteBackup - + Full-site backup and restore for Joomla — database, files, and configuration. diff --git a/mokosuitebackup.xml b/mokosuitebackup.xml index 1ee8592..627d7dd 100644 --- a/mokosuitebackup.xml +++ b/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.09-dev + 01.22.10-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/com_mokosuitebackup/mokosuitebackup.xml b/source/packages/com_mokosuitebackup/mokosuitebackup.xml index 880ad29..237540f 100644 --- a/source/packages/com_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/com_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> MokoSuiteBackup - 01.22.09-dev + 01.22.10-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml index f93bda0..fe8df48 100644 --- a/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_actionlog_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Action Log - MokoSuiteBackup - 01.22.09-dev + 01.22.10-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml index 4fb5a54..f9f2d29 100644 --- a/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_console_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Console - MokoSuiteBackup - 01.22.09-dev + 01.22.10-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml index 91edc6b..2b33be7 100644 --- a/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_content_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Content - MokoSuiteBackup - 01.22.09-dev + 01.22.10-dev 2026-06-04 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml index 3e3e638..5f66056 100644 --- a/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_quickicon_mokosuitebackup/mokosuitebackup.xml @@ -1,7 +1,7 @@ Quick Icon - MokoSuiteBackup - 01.22.09-dev + 01.22.10-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml index 1c81eff..6480eeb 100644 --- a/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_system_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> System - MokoSuiteBackup - 01.22.09-dev + 01.22.10-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml index 2d32434..37d715d 100644 --- a/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_task_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Task - MokoSuiteBackup - 01.22.09-dev + 01.22.10-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml index 1ee8592..627d7dd 100644 --- a/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml +++ b/source/packages/plg_webservices_mokosuitebackup/mokosuitebackup.xml @@ -7,7 +7,7 @@ --> Web Services - MokoSuiteBackup - 01.22.09-dev + 01.22.10-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech diff --git a/source/pkg_mokosuitebackup.xml b/source/pkg_mokosuitebackup.xml index cb7e01d..b09d253 100644 --- a/source/pkg_mokosuitebackup.xml +++ b/source/pkg_mokosuitebackup.xml @@ -8,7 +8,7 @@ Package - MokoSuiteBackup mokosuitebackup - 01.22.09-dev + 01.22.10-dev 2026-06-02 Moko Consulting hello@mokoconsulting.tech -- 2.52.0