Supports interval-minutes, interval-hours, interval-days, and
cron-expression rule types. Shows banner, media, countdown, and
baseline snapshot status in the plugin config info card.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DreamHost server timezone is America/Los_Angeles, so PHP was interpreting
the UTC datetime as Pacific time, causing the display to be hours off.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Snapshot now triggers via onContentAfterSave when the task is saved
with take_snapshot_on_save=1, instead of waiting for the next execution.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Demo mode is now controlled entirely through the Joomla Scheduled Task:
- Create a "MokoWaaS Demo Reset" task to enable demo mode
- Task form has: snapshot toggle, media toggle, banner settings
- System plugin reads banner config from the task params
- Plugin config shows task status card with link to manage it
- Removed demo_mode_enabled, schedule, and one-shot toggles from plugin
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Full database restore overwrites #__extensions and #__scheduler_tasks
with snapshot data, losing the current plugin registrations. After
restore, re-enables all MokoWaaS extensions, re-registers the task
plugin if missing, and re-enables the update server.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NextResetField now queries #__scheduler_tasks.next_execution directly
instead of using a stored param. Also shows last execution time.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When demo mode is turned on and saved, automatically creates a Joomla
Scheduler task for the demo reset using the configured cron schedule.
When demo mode is turned off, removes the scheduled task.
No manual task creation needed — just enable demo mode and save.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaced selective table snapshot with full mysqldump/restore. This
ensures the site returns to an exact known state without the risk of
breaking the installation by restoring stale #__extensions or #__assets.
Uses mysqldump CLI when available, falls back to PHP-based dump.
Removed SnapshotTables field and table selection config — the entire
database is now captured and restored as one unit.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove extra [] from select name (caused nested array storage)
- Flatten nested arrays when reading back broken saved values
- NextResetField shows "Demo mode is off" when disabled
- Clear demo_next_reset param when demo mode is turned off
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HTMLHelper::_('select.optgroup') does not exist in Joomla 6. Replaced
with a plain HTML multi-select built manually with <optgroup> tags.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- SnapshotTablesField now renders as a multi-select <select> with
optgroups (Content, Users, Menus, Modules, Assets, Other) instead
of individual checkboxes
- NextResetField displays the next reset as a formatted datetime in
the site's configured timezone with a relative badge (in X hours)
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- SnapshotTablesField: custom checkbox field that queries DB for all
tables, groups by type (content/users/menus/modules), pre-selects
important tables by default
- Media snapshots now support multiple directories (images, media)
with individual ZIPs per directory and legacy fallback
- Backward compatible with old boolean and textarea param formats
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Countdown now calculates next reset on the fly from cron schedule if
demo_next_reset is empty or in the past, instead of only on save
- Added 5min, 15min, 30min presets to the schedule dropdown for testing
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New CopyableTokenField renders a readonly monospace input with a Copy
button, matching Joomla's native API token UX in user profiles.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Joomla requires a <filename plugin="mokowaasdemo"> in the files block
to populate the element field in #__extensions. Without it, the DB
INSERT fails with "Field 'element' doesn't have a default value".
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cron-related comments contained */ in examples like "*/5" and "*/N"
which PHP interprets as closing the block comment, causing syntax errors.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The string "*/N" inside a docblock contains */ which PHP interprets as
the end of the block comment, making "N" an unexpected identifier.
Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>