diff --git a/.mokogitea/manifest.xml b/.mokogitea/manifest.xml index 6ffb4cd..950f4f8 100644 --- a/.mokogitea/manifest.xml +++ b/.mokogitea/manifest.xml @@ -9,7 +9,7 @@ Package - MokoWaaS MokoConsulting White-label identity, security hardening, and tenant restriction layer for WaaS-managed Joomla environments - 02.27.00 + 02.26.09 GNU General Public License v3 diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 4cba78d..d1a04e4 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: moko-platform.Automation -# VERSION: 02.27.00 +# VERSION: 02.26.09 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a02f67..2a24b85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,14 +14,12 @@ INGROUP: MokoWaaS.Documentation REPO: https://github.com/mokoconsulting-tech/mokowaas PATH: ./CHANGELOG.md - VERSION: 02.27.00 + VERSION: 02.26.09 BRIEF: Version history using `Keep a Changelog` --> # Changelog ## [Unreleased] - -## [02.27.00] --- 2026-05-31 ### Added - API endpoint `POST /api/index.php/v1/mokowaas/install` — install extensions from a remote ZIP URL - Demo Mode with configurable warning banner on frontend when enabled @@ -51,3 +49,30 @@ All notable changes to the MokoWaaS plugin will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [02.17.00] --- 2026-05-28 + +### Changed +- Migrated all workflow and template paths from `.github/` to `.mokogitea/` +- Template source paths updated: `templates/gitea/` to `templates/mokogitea/` +- HCL definition files removed -- Template repos are now the canonical source + +### Added +- `branch-cleanup.yml`: auto-delete merged feature branches after PR merge +- `plg_webservices_perfectpublisher`: REST API for Perfect Publisher (com_autotweet) — channels, posts, requests, rules, feeds, and stats + +### Planned +- License/subscription check +- System email template branding (DB approach) + +### Added +- Trusted IPs: configurable repeatable rows of IP addresses, CIDR ranges, and wildcards that bypass admin session timeout +- Supports exact IPs (192.168.1.100), CIDR (10.0.0.0/24), and wildcards (192.168.1.*) +- Each entry has a label and enabled toggle for easy management +- Current IP display above trusted IPs table so admins can easily add their own IP + +### Fixed +- Trusted IP session bypass: moved from `onAfterInitialise` to `boot()` so Joomla's session lifetime is extended before the session handler validates it (was too late, Joomla expired the session first) +- updates.xml: removed stale pre-release entries pointing to non-existent dev artifacts, legacy plugin update entry that caused stable sites to attempt dev downloads +- Removed duplicate `` from inner plugin manifest — only the package-level manifest should register the update server +- Auto-cleanup of stale plugin-level update site entries on install/update (cleans `#__update_sites` and `#__update_sites_extensions`) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 57cd744..fe3afec 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -14,7 +14,7 @@ DEFGROUP: Joomla.Plugin INGROUP: MokoWaaS.Documentation REPO: https://github.com/mokoconsulting-tech/mokowaas - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: ./CODE_OF_CONDUCT.md BRIEF: Reference + packaging repo for Moko Consulting Developer GPT Other Default --> diff --git a/GOVERNANCE.md b/GOVERNANCE.md index e878bc8..26f5fe6 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -19,7 +19,7 @@ DEFGROUP: mokoconsulting-tech.MokoWaaSBrand INGROUP: MokoStandards.Governance REPO: https://github.com/mokoconsulting-tech/MokoWaaSBrand - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /GOVERNANCE.md BRIEF: Project governance rules, roles, and decision process for MokoWaaSBrand --> diff --git a/LICENSE.md b/LICENSE.md index bbefeb1..2eb29c5 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -15,7 +15,7 @@ INGROUP: MokoWaaS.Documentation REPO: https://github.com/mokoconsulting-tech/mokowaas PATH: ./LICENSE.md - VERSION: 02.27.00 + VERSION: 02.26.09 BRIEF: Project license (GPL-3.0-or-later) --> GNU GENERAL PUBLIC LICENSE diff --git a/README.md b/README.md index cc2330b..f3b8911 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ DEFGROUP: Joomla.Plugin INGROUP: MokoWaaS REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /README.md BRIEF: MokoWaaS platform plugin for Joomla --> diff --git a/SECURITY.md b/SECURITY.md index e1f2438..3ccb7e5 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -23,7 +23,7 @@ DEFGROUP: [PROJECT_NAME] INGROUP: [PROJECT_NAME].Documentation REPO: [REPOSITORY_URL] PATH: /SECURITY.md -VERSION: 02.27.00 +VERSION: 02.26.09 BRIEF: Security vulnerability reporting and handling policy --> diff --git a/docs/guides/build-guide.md b/docs/guides/build-guide.md index 248b64d..3ac76a6 100644 --- a/docs/guides/build-guide.md +++ b/docs/guides/build-guide.md @@ -11,13 +11,13 @@ INGROUP: MokoWaaS.Build REPO: https://github.com/mokoconsulting-tech/mokowaas FILE: build-guide.md - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /docs/guides/ BRIEF: Build and packaging guide for the MokoWaaS system plugin NOTE: Defines environment setup, repository layout, packaging rules, and release preparation --> -# MokoWaaS Build Guide (VERSION: 02.27.00) +# MokoWaaS Build Guide (VERSION: 02.26.09) ## 1. Purpose diff --git a/docs/guides/configuration-guide.md b/docs/guides/configuration-guide.md index 503bcae..54d67bf 100644 --- a/docs/guides/configuration-guide.md +++ b/docs/guides/configuration-guide.md @@ -10,13 +10,13 @@ DEFGROUP: Joomla.Plugin INGROUP: MokoWaaS.Guides REPO: https://github.com/mokoconsulting-tech/mokowaas - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /docs/guides/configuration-guide.md BRIEF: Configuration guide for the MokoWaaS system plugin NOTE: Defines plugin parameters, expected behaviors, and recommended defaults --> -# MokoWaaS Configuration Guide (VERSION: 02.27.00) +# MokoWaaS Configuration Guide (VERSION: 02.26.09) ## 1. Objective diff --git a/docs/guides/installation-guide.md b/docs/guides/installation-guide.md index bc5687b..e1e78c3 100644 --- a/docs/guides/installation-guide.md +++ b/docs/guides/installation-guide.md @@ -10,13 +10,13 @@ DEFGROUP: Joomla.Plugin INGROUP: MokoWaaS.Guides REPO: https://github.com/mokoconsulting-tech/mokowaas - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /docs/guides/installation-guide.md BRIEF: Installation guide for the MokoWaaS system plugin NOTE: First document in the guide set --> -# MokoWaaS Installation Guide (VERSION: 02.27.00) +# MokoWaaS Installation Guide (VERSION: 02.26.09) ## Introduction diff --git a/docs/guides/operations-guide.md b/docs/guides/operations-guide.md index 97b8413..038f0c1 100644 --- a/docs/guides/operations-guide.md +++ b/docs/guides/operations-guide.md @@ -10,13 +10,13 @@ DEFGROUP: Joomla.Plugin INGROUP: MokoWaaS.Guides REPO: https://github.com/mokoconsulting-tech/mokowaas - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /docs/guides/operations-guide.md BRIEF: Operational guide for administering and managing the MokoWaaS system plugin NOTE: Defines lifecycle, responsibilities, and operational behaviors --> -# MokoWaaS Operations Guide (VERSION: 02.27.00) +# MokoWaaS Operations Guide (VERSION: 02.26.09) ## Introduction diff --git a/docs/guides/rollback-and-recovery-guide.md b/docs/guides/rollback-and-recovery-guide.md index deaebae..aa8af89 100644 --- a/docs/guides/rollback-and-recovery-guide.md +++ b/docs/guides/rollback-and-recovery-guide.md @@ -10,13 +10,13 @@ DEFGROUP: Joomla.Plugin INGROUP: MokoWaaS.Guides REPO: https://github.com/mokoconsulting-tech/mokowaas - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /docs/guides/rollback-and-recovery-guide.md BRIEF: Rollback and recovery guide for restoring stable operation after plugin related incidents NOTE: Completes the core guide set for WaaS plugin governance --> -# MokoWaaS Rollback and Recovery Guide (VERSION: 02.27.00) +# MokoWaaS Rollback and Recovery Guide (VERSION: 02.26.09) ## Introduction diff --git a/docs/guides/testing-guide.md b/docs/guides/testing-guide.md index 55f3eeb..088fb3e 100644 --- a/docs/guides/testing-guide.md +++ b/docs/guides/testing-guide.md @@ -7,13 +7,13 @@ DEFGROUP: Joomla.Plugin INGROUP: MokoWaaS.Guides REPO: https://github.com/mokoconsulting-tech/mokowaas - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /docs/guides/testing-guide.md BRIEF: Testing guide for MokoWaaS v02.01.08 NOTE: Covers manual test procedures for language overrides, install/uninstall, and configuration --> -# MokoWaaS Testing Guide (VERSION: 02.27.00) +# MokoWaaS Testing Guide (VERSION: 02.26.09) ## 1. Prerequisites diff --git a/docs/guides/troubleshooting-guide.md b/docs/guides/troubleshooting-guide.md index d377cde..0280506 100644 --- a/docs/guides/troubleshooting-guide.md +++ b/docs/guides/troubleshooting-guide.md @@ -10,13 +10,13 @@ DEFGROUP: Joomla.Plugin INGROUP: MokoWaaS.Guides REPO: https://github.com/mokoconsulting-tech/mokowaas - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /docs/guides/troubleshooting-guide.md BRIEF: Troubleshooting guide for diagnosing and resolving issues related to the MokoWaaS plugin NOTE: Designed for administrators and WaaS operations teams --> -# MokoWaaS Troubleshooting Guide (VERSION: 02.27.00) +# MokoWaaS Troubleshooting Guide (VERSION: 02.26.09) ## Introduction diff --git a/docs/guides/upgrade-and-versioning-guide.md b/docs/guides/upgrade-and-versioning-guide.md index f39d786..57333cf 100644 --- a/docs/guides/upgrade-and-versioning-guide.md +++ b/docs/guides/upgrade-and-versioning-guide.md @@ -10,13 +10,13 @@ DEFGROUP: Joomla.Plugin INGROUP: MokoWaaS.Guides REPO: https://github.com/mokoconsulting-tech/mokowaas - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /docs/guides/upgrade-and-versioning-guide.md BRIEF: Guide for updating, versioning, and maintaining the MokoWaaS plugin NOTE: Defines release flow, version rules, and upgrade validation --> -# MokoWaaS Upgrade and Versioning Guide (VERSION: 02.27.00) +# MokoWaaS Upgrade and Versioning Guide (VERSION: 02.26.09) ## Introduction diff --git a/docs/index.md b/docs/index.md index f5480db..d828e5c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,13 +10,13 @@ DEFGROUP: Joomla.Plugin INGROUP: MokoWaaS.Documentation REPO: https://github.com/mokoconsulting-tech/mokowaas - VERSION: 02.27.00 + VERSION: 02.26.09 PATH: /docs/index.md BRIEF: Master index of all documentation for the MokoWaaS plugin NOTE: Automatically maintained index for all guide canvases --> -# MokoWaaS Documentation Index (VERSION: 02.27.00) +# MokoWaaS Documentation Index (VERSION: 02.26.09) ## Introduction diff --git a/docs/plugin-basic.md b/docs/plugin-basic.md index 9365850..629c011 100644 --- a/docs/plugin-basic.md +++ b/docs/plugin-basic.md @@ -11,12 +11,12 @@ INGROUP: MokoWaaS REPO: https://github.com/mokoconsulting-tech/mokowaas PATH: /docs/plugin-basic.md - VERSION: 02.27.00 + VERSION: 02.26.09 BRIEF: Baseline documentation for the MokoWaaS system plugin NOTE: Foundational reference for internal and external stakeholders --> -# MokoWaaS Plugin Overview (VERSION: 02.27.00) +# MokoWaaS Plugin Overview (VERSION: 02.26.09) ## Introduction diff --git a/docs/update-server.md b/docs/update-server.md index a4c6be4..88e7327 100644 --- a/docs/update-server.md +++ b/docs/update-server.md @@ -10,7 +10,7 @@ DEFGROUP: MokoWaaS.Documentation INGROUP: MokoStandards.Templates REPO: https://github.com/mokoconsulting-tech/MokoWaaS PATH: /docs/update-server.md -VERSION: 02.27.00 +VERSION: 02.26.09 BRIEF: How this extension's Joomla update server file (update.xml) is managed --> diff --git a/src/packages/com_mokowaas/mokowaas.xml b/src/packages/com_mokowaas/mokowaas.xml index eaa616c..81f8801 100644 --- a/src/packages/com_mokowaas/mokowaas.xml +++ b/src/packages/com_mokowaas/mokowaas.xml @@ -7,7 +7,7 @@ GPL-3.0-or-later hello@mokoconsulting.tech https://mokoconsulting.tech - 02.27.00 + 02.26.09-dev Minimal API-only component for MokoWaaS. Provides REST endpoints for site health, cache, updates, and backups. Moko\Component\MokoWaaS\Api diff --git a/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php b/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php index 0a12fc4..d3b0c6c 100644 --- a/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php +++ b/src/packages/plg_system_mokowaas/Extension/MokoWaaS.php @@ -22,7 +22,7 @@ * DEFGROUP: Joomla.Plugin * INGROUP: MokoWaaS * REPO: https://github.com/mokoconsulting-tech/mokowaas - * VERSION: 02.27.00 + * VERSION: 02.26.09 * PATH: /src/Extension/MokoWaaS.php * NOTE: Handles Joomla system events for rebranding functionality */ @@ -908,7 +908,7 @@ class MokoWaaS extends CMSPlugin implements BootableExtensionInterface $result = $service->createSnapshot($baseline); $app->enqueueMessage( - sprintf('Demo snapshot "%s" created (%d tables).', $baseline, $result['tables']), + sprintf('Demo snapshot created (%.1f MB database, media=%s).', $result['dump_size_mb'] ?? 0, ($result['has_media'] ?? false) ? 'yes' : 'no'), 'message' ); } @@ -935,7 +935,7 @@ class MokoWaaS extends CMSPlugin implements BootableExtensionInterface $result = $service->restoreSnapshot($baseline); $app->enqueueMessage( - sprintf('Site restored to baseline "%s" (%d tables).', $baseline, $result['restored_tables']), + sprintf('Site restored to baseline (media=%s).', ($result['media_restored'] ?? false) ? 'yes' : 'no'), 'message' ); } diff --git a/src/packages/plg_system_mokowaas/Field/AllowedIpsField.php b/src/packages/plg_system_mokowaas/Field/AllowedIpsField.php index 9cdeb0d..1f1b2e1 100644 --- a/src/packages/plg_system_mokowaas/Field/AllowedIpsField.php +++ b/src/packages/plg_system_mokowaas/Field/AllowedIpsField.php @@ -7,7 +7,7 @@ * FILE INFORMATION * DEFGROUP: Joomla.Plugin * INGROUP: MokoWaaS - * VERSION: 02.27.00 + * VERSION: 02.26.09 * PATH: /src/Field/AllowedIpsField.php * BRIEF: Custom form field that displays the current IP whitelist */ diff --git a/src/packages/plg_system_mokowaas/Field/CopyableTokenField.php b/src/packages/plg_system_mokowaas/Field/CopyableTokenField.php index 6bd9bdb..7cd6767 100644 --- a/src/packages/plg_system_mokowaas/Field/CopyableTokenField.php +++ b/src/packages/plg_system_mokowaas/Field/CopyableTokenField.php @@ -8,7 +8,7 @@ * FILE INFORMATION * DEFGROUP: Joomla.Plugin * INGROUP: MokoWaaS - * VERSION: 02.27.00 + * VERSION: 02.26.09 * PATH: /src/Field/CopyableTokenField.php * BRIEF: Read-only token field with a copy-to-clipboard button */ diff --git a/src/packages/plg_system_mokowaas/Field/CurrentIpField.php b/src/packages/plg_system_mokowaas/Field/CurrentIpField.php index f8ab64d..f464e11 100644 --- a/src/packages/plg_system_mokowaas/Field/CurrentIpField.php +++ b/src/packages/plg_system_mokowaas/Field/CurrentIpField.php @@ -7,7 +7,7 @@ * FILE INFORMATION * DEFGROUP: Joomla.Plugin * INGROUP: MokoWaaS - * VERSION: 02.27.00 + * VERSION: 02.26.09 * PATH: /src/Field/CurrentIpField.php * BRIEF: Read-only field that displays the current user's IP address */ diff --git a/src/packages/plg_system_mokowaas/Field/NextResetField.php b/src/packages/plg_system_mokowaas/Field/NextResetField.php index 09a8dff..556bb53 100644 --- a/src/packages/plg_system_mokowaas/Field/NextResetField.php +++ b/src/packages/plg_system_mokowaas/Field/NextResetField.php @@ -8,9 +8,9 @@ * FILE INFORMATION * DEFGROUP: Joomla.Plugin * INGROUP: MokoWaaS - * VERSION: 02.27.00 + * VERSION: 02.26.09 * PATH: /src/Field/NextResetField.php - * BRIEF: Read-only field that displays the next scheduled reset in the site timezone + * BRIEF: Read-only field showing next reset time from Joomla scheduled task */ namespace Moko\Plugin\System\MokoWaaS\Field; @@ -21,10 +21,10 @@ use Joomla\CMS\Factory; use Joomla\CMS\Form\FormField; /** - * Displays the next scheduled demo reset as a formatted datetime - * in the Joomla site timezone with a relative "in X hours" suffix. + * Pulls the next execution time directly from the Joomla scheduled task + * (#__scheduler_tasks) and displays it formatted in the site timezone. * - * @since 02.26.00 + * @since 02.29.00 */ class NextResetField extends FormField { @@ -32,7 +32,7 @@ class NextResetField extends FormField protected function getInput() { - // Check if demo mode is enabled via the form data + // Check if demo mode is enabled $demoEnabled = false; if ($this->form) @@ -46,19 +46,50 @@ class NextResetField extends FormField . ''; } - if (empty($this->value)) + // Query the actual next_execution from the scheduled task + try { - return '
No reset scheduled — save the plugin config to calculate.
'; + $db = Factory::getDbo(); + $query = $db->getQuery(true) + ->select([ + $db->quoteName('next_execution'), + $db->quoteName('last_execution'), + $db->quoteName('state'), + ]) + ->from($db->quoteName('#__scheduler_tasks')) + ->where($db->quoteName('type') . ' = ' . $db->quote('mokowaas.demo.reset')); + + $db->setQuery($query); + $task = $db->loadAssoc(); + } + catch (\Throwable $e) + { + $task = null; } - $utcTimestamp = strtotime($this->value); - - if ($utcTimestamp === false || $utcTimestamp <= 0) + if (!$task) { - return '
Invalid timestamp stored.
'; + return '
No scheduled task found — save to create one automatically.
' + . ''; + } + + if ((int) $task['state'] !== 1) + { + return '
Scheduled task is disabled.
' + . ''; + } + + $nextExec = $task['next_execution']; + $lastExec = $task['last_execution']; + + if (empty($nextExec) || $nextExec === '0000-00-00 00:00:00') + { + return '
Waiting for first run...
' + . ''; } // Convert to site timezone + $utcTimestamp = strtotime($nextExec); $siteTimezone = Factory::getApplication()->get('offset', 'UTC'); try @@ -69,39 +100,57 @@ class NextResetField extends FormField } catch (\Throwable $e) { - $formatted = gmdate('Y-m-d H:i:s', $utcTimestamp) . ' UTC'; + $formatted = $nextExec . ' UTC'; } - // Calculate relative time - $diff = $utcTimestamp - time(); + // Relative time + $diff = $utcTimestamp - time(); $relative = ''; if ($diff <= 0) { - $relative = 'overdue — save to recalculate'; + $relative = 'overdue'; } elseif ($diff < 3600) { $mins = (int) ceil($diff / 60); - $relative = 'in ' . $mins . ' minute' . ($mins !== 1 ? 's' : '') . ''; + $relative = 'in ' . $mins . ' min'; } elseif ($diff < 86400) { $hours = round($diff / 3600, 1); - $relative = 'in ' . $hours . ' hour' . ($hours != 1 ? 's' : '') . ''; + $relative = 'in ' . $hours . 'h'; } else { $days = round($diff / 86400, 1); - $relative = 'in ' . $days . ' day' . ($days != 1 ? 's' : '') . ''; + $relative = 'in ' . $days . 'd'; } - return '
' + // Last run info + $lastInfo = ''; + + if (!empty($lastExec) && $lastExec !== '0000-00-00 00:00:00') + { + try + { + $lastDt = new \DateTime($lastExec); + $lastDt->setTimezone(new \DateTimeZone($siteTimezone)); + $lastInfo = 'Last run: ' . $lastDt->format('M j, g:i A') . ''; + } + catch (\Throwable $e) + { + // skip + } + } + + return '
' . '' . ' ' . htmlspecialchars($formatted) . ' ' . $relative - . '' + . $lastInfo + . '' . '
'; } } diff --git a/src/packages/plg_system_mokowaas/Field/SnapshotTablesField.php b/src/packages/plg_system_mokowaas/Field/SnapshotTablesField.php index 29b1a59..b97cee4 100644 --- a/src/packages/plg_system_mokowaas/Field/SnapshotTablesField.php +++ b/src/packages/plg_system_mokowaas/Field/SnapshotTablesField.php @@ -8,7 +8,7 @@ * FILE INFORMATION * DEFGROUP: Joomla.Plugin * INGROUP: MokoWaaS - * VERSION: 02.27.00 + * VERSION: 02.26.09 * PATH: /src/Field/SnapshotTablesField.php * BRIEF: Multi-select list field that loads DB tables with sensible defaults */ diff --git a/src/packages/plg_system_mokowaas/Service/ContentSyncReceiver.php b/src/packages/plg_system_mokowaas/Service/ContentSyncReceiver.php index 45f6547..1de08b1 100644 --- a/src/packages/plg_system_mokowaas/Service/ContentSyncReceiver.php +++ b/src/packages/plg_system_mokowaas/Service/ContentSyncReceiver.php @@ -10,7 +10,7 @@ * INGROUP: MokoWaaS * REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS * PATH: /src/packages/plg_system_mokowaas/Service/ContentSyncReceiver.php - * VERSION: 02.27.00 + * VERSION: 02.26.09 * BRIEF: Receiver-side content sync — applies incoming payload to local DB */ diff --git a/src/packages/plg_system_mokowaas/Service/ContentSyncService.php b/src/packages/plg_system_mokowaas/Service/ContentSyncService.php index 6e7e93c..56a9948 100644 --- a/src/packages/plg_system_mokowaas/Service/ContentSyncService.php +++ b/src/packages/plg_system_mokowaas/Service/ContentSyncService.php @@ -10,7 +10,7 @@ * INGROUP: MokoWaaS * REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS * PATH: /src/packages/plg_system_mokowaas/Service/ContentSyncService.php - * VERSION: 02.27.00 + * VERSION: 02.26.09 * BRIEF: Sender-side content sync — builds payload and pushes to remote sites */ diff --git a/src/packages/plg_system_mokowaas/Service/DemoResetService.php b/src/packages/plg_system_mokowaas/Service/DemoResetService.php index 3fde0b4..60bf40d 100644 --- a/src/packages/plg_system_mokowaas/Service/DemoResetService.php +++ b/src/packages/plg_system_mokowaas/Service/DemoResetService.php @@ -10,7 +10,7 @@ * INGROUP: MokoWaaS * REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS * PATH: /src/packages/plg_system_mokowaas/Service/DemoResetService.php - * VERSION: 02.27.00 + * VERSION: 02.26.09 * BRIEF: Full database snapshot/restore service for demo site reset */ @@ -299,6 +299,10 @@ class DemoResetService } } + // After full DB restore, re-ensure the task plugin and scheduled task + // exist — the restore overwrote #__extensions and #__scheduler_tasks + $this->reRegisterAfterRestore(); + Log::add( sprintf('Demo site reset to baseline "%s" (full DB, media=%s)', $name, $mediaRestored ? 'yes' : 'no'), Log::WARNING, @@ -537,6 +541,95 @@ class DemoResetService * * @since 02.21.00 */ + private function reRegisterAfterRestore(): void + { + try + { + $db = Factory::getDbo(); + $prefix = $db->getPrefix(); + + // Re-enable all MokoWaaS extensions (may have been overwritten by old snapshot) + $elements = [ + $db->quote('pkg_mokowaas'), + $db->quote('mokowaas'), + $db->quote('com_mokowaas'), + $db->quote('mokowaasdemo'), + $db->quote('perfectpublisher'), + ]; + + $db->setQuery( + $db->getQuery(true) + ->update($db->quoteName('#__extensions')) + ->set($db->quoteName('enabled') . ' = 1') + ->set($db->quoteName('protected') . ' = 1') + ->set($db->quoteName('locked') . ' = 0') + ->where($db->quoteName('element') . ' IN (' . implode(',', $elements) . ')') + ); + $db->execute(); + + // If the task plugin isn't registered, add it + $db->setQuery( + $db->getQuery(true) + ->select('COUNT(*)') + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('element') . ' = ' . $db->quote('mokowaasdemo')) + ->where($db->quoteName('type') . ' = ' . $db->quote('plugin')) + ); + + if ((int) $db->loadResult() === 0) + { + $obj = (object) [ + 'name' => 'Task - MokoWaaS Demo Reset', + 'type' => 'plugin', + 'element' => 'mokowaasdemo', + 'folder' => 'task', + 'client_id' => 0, + 'enabled' => 1, + 'protected' => 1, + 'locked' => 0, + 'access' => 1, + 'params' => '{}', + ]; + $db->insertObject('#__extensions', $obj); + } + + // Ensure the scheduled task exists and is enabled + $db->setQuery( + $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__scheduler_tasks')) + ->where($db->quoteName('type') . ' = ' . $db->quote('mokowaas.demo.reset')) + ); + $taskId = (int) $db->loadResult(); + + if ($taskId > 0) + { + // Re-enable and update next_execution to now so it stays active + $db->setQuery( + $db->getQuery(true) + ->update($db->quoteName('#__scheduler_tasks')) + ->set($db->quoteName('state') . ' = 1') + ->where($db->quoteName('id') . ' = ' . $taskId) + ); + $db->execute(); + } + + // Re-enable the update server + $db->setQuery( + $db->getQuery(true) + ->update($db->quoteName('#__update_sites')) + ->set($db->quoteName('enabled') . ' = 1') + ->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoWaaS%') + . ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoWaaS%') . ')') + ); + $db->execute(); + } + catch (\Throwable $e) + { + // Best effort — don't let registration failure break the restore + } + } + private function ensureSnapshotDir(): void { if (!is_dir($this->snapshotDir)) diff --git a/src/packages/plg_system_mokowaas/mokowaas.xml b/src/packages/plg_system_mokowaas/mokowaas.xml index 900de19..2af10e1 100644 --- a/src/packages/plg_system_mokowaas/mokowaas.xml +++ b/src/packages/plg_system_mokowaas/mokowaas.xml @@ -30,7 +30,7 @@ GNU General Public License version 3 or later; see LICENSE.md hello@mokoconsulting.tech https://mokoconsulting.tech - 02.27.00 + 02.26.09-dev This plugin rebrands the Joomla system interface with MokoWaaS identity. It applies language overrides and ensures consistent branding across the platform. Moko\Plugin\System\MokoWaaS script.php diff --git a/src/packages/plg_system_mokowaas/script.php b/src/packages/plg_system_mokowaas/script.php index 484d734..0d8306f 100644 --- a/src/packages/plg_system_mokowaas/script.php +++ b/src/packages/plg_system_mokowaas/script.php @@ -22,7 +22,7 @@ * DEFGROUP: Joomla.Plugin * INGROUP: MokoWaaS * REPO: https://github.com/mokoconsulting-tech/mokowaas - * VERSION: 02.27.00 + * VERSION: 02.26.09 * PATH: /src/script.php * BRIEF: Installation script for MokoWaaS plugin * NOTE: Handles installation, update, and uninstallation tasks including language override deployment diff --git a/src/packages/plg_system_mokowaas/services/provider.php b/src/packages/plg_system_mokowaas/services/provider.php index fc4e9fc..d76177a 100644 --- a/src/packages/plg_system_mokowaas/services/provider.php +++ b/src/packages/plg_system_mokowaas/services/provider.php @@ -22,7 +22,7 @@ * DEFGROUP: Joomla.Plugin * INGROUP: MokoWaaS * REPO: https://github.com/mokoconsulting-tech/mokowaas - * VERSION: 02.27.00 + * VERSION: 02.26.09 * PATH: /src/services/provider.php * BRIEF: Service provider for dependency injection in Joomla 5.x * NOTE: Registers the plugin with Joomla's DI container diff --git a/src/packages/plg_task_mokowaasdemo/mokowaasdemo.xml b/src/packages/plg_task_mokowaasdemo/mokowaasdemo.xml index a82b764..073d3f1 100644 --- a/src/packages/plg_task_mokowaasdemo/mokowaasdemo.xml +++ b/src/packages/plg_task_mokowaasdemo/mokowaasdemo.xml @@ -12,7 +12,7 @@ GNU General Public License version 3 or later; see LICENSE hello@mokoconsulting.tech https://mokoconsulting.tech - 02.27.00 + 02.26.09-dev PLG_TASK_MOKOWAASDEMO_DESC Moko\Plugin\Task\MokoWaaSDemo diff --git a/src/packages/plg_webservices_mokowaas/mokowaas.xml b/src/packages/plg_webservices_mokowaas/mokowaas.xml index 6bfa5db..6191c99 100644 --- a/src/packages/plg_webservices_mokowaas/mokowaas.xml +++ b/src/packages/plg_webservices_mokowaas/mokowaas.xml @@ -7,7 +7,7 @@ GPL-3.0-or-later hello@mokoconsulting.tech https://mokoconsulting.tech - 02.27.00 + 02.26.09-dev Joomla Web Services API routes for MokoWaaS site management — health checks, cache, updates, backups, and site info. Moko\Plugin\WebServices\MokoWaaS diff --git a/src/packages/plg_webservices_perfectpublisher/perfectpublisher.xml b/src/packages/plg_webservices_perfectpublisher/perfectpublisher.xml index 8039a97..d8cd47d 100644 --- a/src/packages/plg_webservices_perfectpublisher/perfectpublisher.xml +++ b/src/packages/plg_webservices_perfectpublisher/perfectpublisher.xml @@ -7,7 +7,7 @@ GPL-3.0-or-later hello@mokoconsulting.tech https://mokoconsulting.tech - 02.27.00 + 02.26.09-dev Joomla Web Services API routes for Perfect Publisher (com_autotweet) — channels, posts, requests, rules, and feeds. Moko\Plugin\WebServices\PerfectPublisher diff --git a/src/packages/plg_webservices_perfectpublisher/services/provider.php b/src/packages/plg_webservices_perfectpublisher/services/provider.php index 16d5291..2edd34d 100644 --- a/src/packages/plg_webservices_perfectpublisher/services/provider.php +++ b/src/packages/plg_webservices_perfectpublisher/services/provider.php @@ -8,7 +8,7 @@ * INGROUP: MokoWaaS * REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS * PATH: /src/packages/plg_webservices_perfectpublisher/services/provider.php - * VERSION: 02.27.00 + * VERSION: 02.26.09 * BRIEF: DI service provider for Perfect Publisher Web Services plugin */ diff --git a/src/packages/plg_webservices_perfectpublisher/src/Extension/PerfectPublisherApi.php b/src/packages/plg_webservices_perfectpublisher/src/Extension/PerfectPublisherApi.php index 8b8e2d1..776169b 100644 --- a/src/packages/plg_webservices_perfectpublisher/src/Extension/PerfectPublisherApi.php +++ b/src/packages/plg_webservices_perfectpublisher/src/Extension/PerfectPublisherApi.php @@ -8,7 +8,7 @@ * INGROUP: MokoWaaS * REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS * PATH: /src/packages/plg_webservices_perfectpublisher/src/Extension/PerfectPublisherApi.php - * VERSION: 02.27.00 + * VERSION: 02.26.09 * BRIEF: Web Services API plugin for Perfect Publisher (com_autotweet) */ diff --git a/src/pkg_mokowaas.xml b/src/pkg_mokowaas.xml index 96a5574..09d8c37 100644 --- a/src/pkg_mokowaas.xml +++ b/src/pkg_mokowaas.xml @@ -2,7 +2,7 @@ Package - MokoWaaS mokowaas - 02.27.00 + 02.26.09-dev 2026-05-23 Moko Consulting hello@mokoconsulting.tech