feat(plugin): v01.00.00 — Joomla 6, generic offline page access #20

Closed
jmiller-moko wants to merge 28 commits from dev/01.00.00 into main
jmiller-moko commented 2026-03-26 17:23:48 +00:00 (Migrated from github.com)

Closes #27

Summary

  • Joomla 6 native — requires PHP 8.3+, uses DI container (DatabaseInterface), getApplication(), SubscriberInterface, no legacy APIs
  • Generic menu item support — removed hardcoded TOS article/menu creation; admin selects any existing menu item via dropdown to keep accessible during offline mode
  • Added services/provider.php — the missing DI container registration that prevented the plugin from showing in Joomla after install
  • MokoStandards CI sync — repo_health, release, version_branch, validate workflows; composer.json, phpstan, phpcs, dependabot

What changed

Area Before After
Joomla version 4.x / 5.x 6.x only
PHP version 7.4+ 8.3+
Plugin loading Legacy mokojoomtos.php + namespaced services/provider.phpExtension/MokoJoomTOS.php only
Database access Factory::getDbo() Factory::getContainer()->get(DatabaseInterface::class)
App access $this->app $this->getApplication()
Install behavior Created TOS article + Legal menu + menu item Enables plugin only; admin picks any menu item
Plugin name "System - Offline Terms of Service" "System - Offline Page Access"

Files changed (31 files, +2498 / -794)

New files:

  • src/services/provider.php — DI container service provider
  • .github/workflows/ — 4 CI workflows from MokoStandards
  • composer.json, phpstan.neon, phpcs.xml, .moko-standards.yml, .github/dependabot.yml

Removed files:

  • src/mokojoomtos.php — legacy non-namespaced entry point (J6 doesn't support it)
  • src/plugins/system/mokojoomtos/mokojoomtos.xml — legacy nested structure

Major rewrites:

  • src/script.php — stripped from 420 lines to 160 (removed article/menu creation)
  • src/src/Extension/MokoJoomTOS.php — J6 API modernization
  • src/src/Field/MenuslugField.php — J6 database access
  • All language files — generic "Offline Page Access" wording

Test plan

  • Build ZIP from src/ and install in Joomla 6.x
  • Verify plugin appears in Extensions > Plugins as "System - Offline Page Access"
  • Verify plugin config shows dropdown of all published menu items
  • Select a menu item, set site offline, navigate to that slug — verify page loads
  • Verify page renders in component-only view (no template chrome)
  • Change selected menu item, verify new slug works and old one doesn't
  • Test with no menu item selected — verify plugin does nothing when offline
  • Test clean uninstall

🤖 Generated with Claude Code

Closes #27 ## Summary - **Joomla 6 native** — requires PHP 8.3+, uses DI container (`DatabaseInterface`), `getApplication()`, `SubscriberInterface`, no legacy APIs - **Generic menu item support** — removed hardcoded TOS article/menu creation; admin selects any existing menu item via dropdown to keep accessible during offline mode - **Added `services/provider.php`** — the missing DI container registration that prevented the plugin from showing in Joomla after install - **MokoStandards CI sync** — repo_health, release, version_branch, validate workflows; composer.json, phpstan, phpcs, dependabot ## What changed | Area | Before | After | |------|--------|-------| | Joomla version | 4.x / 5.x | 6.x only | | PHP version | 7.4+ | 8.3+ | | Plugin loading | Legacy `mokojoomtos.php` + namespaced | `services/provider.php` → `Extension/MokoJoomTOS.php` only | | Database access | `Factory::getDbo()` | `Factory::getContainer()->get(DatabaseInterface::class)` | | App access | `$this->app` | `$this->getApplication()` | | Install behavior | Created TOS article + Legal menu + menu item | Enables plugin only; admin picks any menu item | | Plugin name | "System - Offline Terms of Service" | "System - Offline Page Access" | ## Files changed (31 files, +2498 / -794) **New files:** - `src/services/provider.php` — DI container service provider - `.github/workflows/` — 4 CI workflows from MokoStandards - `composer.json`, `phpstan.neon`, `phpcs.xml`, `.moko-standards.yml`, `.github/dependabot.yml` **Removed files:** - `src/mokojoomtos.php` — legacy non-namespaced entry point (J6 doesn't support it) - `src/plugins/system/mokojoomtos/mokojoomtos.xml` — legacy nested structure **Major rewrites:** - `src/script.php` — stripped from 420 lines to 160 (removed article/menu creation) - `src/src/Extension/MokoJoomTOS.php` — J6 API modernization - `src/src/Field/MenuslugField.php` — J6 database access - All language files — generic "Offline Page Access" wording ## Test plan - [ ] Build ZIP from `src/` and install in Joomla 6.x - [ ] Verify plugin appears in Extensions > Plugins as "System - Offline Page Access" - [ ] Verify plugin config shows dropdown of all published menu items - [ ] Select a menu item, set site offline, navigate to that slug — verify page loads - [ ] Verify page renders in component-only view (no template chrome) - [ ] Change selected menu item, verify new slug works and old one doesn't - [ ] Test with no menu item selected — verify plugin does nothing when offline - [ ] Test clean uninstall 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-advanced-security[bot] (Migrated from github.com) reviewed 2026-03-26 17:24:42 +00:00
@@ -0,0 +59,4 @@
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
github-advanced-security[bot] (Migrated from github.com) commented 2026-03-26 17:24:41 +00:00

Unpinned tag for a non-immutable Action in workflow

Unpinned 3rd party Action 'Create Release' step Uses Step uses 'shivammathur/setup-php' with ref 'v2', not a pinned commit hash

Show more details

## Unpinned tag for a non-immutable Action in workflow Unpinned 3rd party Action 'Create Release' step [Uses Step](1) uses 'shivammathur/setup-php' with ref 'v2', not a pinned commit hash [Show more details](https://github.com/mokoconsulting-tech/MokoJoomTOS/security/code-scanning/2)
@@ -0,0 +175,4 @@
fi
- name: Create Release
uses: softprops/action-gh-release@v1
github-advanced-security[bot] (Migrated from github.com) commented 2026-03-26 17:24:41 +00:00

Unpinned tag for a non-immutable Action in workflow

Unpinned 3rd party Action 'Create Release' step Uses Step uses 'softprops/action-gh-release' with ref 'v1', not a pinned commit hash

Show more details

## Unpinned tag for a non-immutable Action in workflow Unpinned 3rd party Action 'Create Release' step [Uses Step](1) uses 'softprops/action-gh-release' with ref 'v1', not a pinned commit hash [Show more details](https://github.com/mokoconsulting-tech/MokoJoomTOS/security/code-scanning/4)
@@ -0,0 +27,4 @@
ref: main
- name: Setup PHP
uses: shivammathur/setup-php@v2
github-advanced-security[bot] (Migrated from github.com) commented 2026-03-26 17:24:42 +00:00

Unpinned tag for a non-immutable Action in workflow

Unpinned 3rd party Action 'Validate Joomla Project' step Uses Step uses 'shivammathur/setup-php' with ref 'v2', not a pinned commit hash

Show more details

## Unpinned tag for a non-immutable Action in workflow Unpinned 3rd party Action 'Validate Joomla Project' step [Uses Step](1) uses 'shivammathur/setup-php' with ref 'v2', not a pinned commit hash [Show more details](https://github.com/mokoconsulting-tech/MokoJoomTOS/security/code-scanning/3)
@@ -0,0 +159,4 @@
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
github-advanced-security[bot] (Migrated from github.com) commented 2026-03-26 17:24:42 +00:00

Workflow does not contain permissions

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}

Show more details

## Workflow does not contain permissions Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}} [Show more details](https://github.com/mokoconsulting-tech/MokoJoomTOS/security/code-scanning/1)
@@ -0,0 +570,4 @@
- name: Create Pull Request for version branch
if: ${{ env.REPORT_ONLY != 'true' && github.event.inputs.commit_changes != 'false' }}
uses: peter-evans/create-pull-request@v7
github-advanced-security[bot] (Migrated from github.com) commented 2026-03-26 17:24:42 +00:00

Unpinned tag for a non-immutable Action in workflow

Unpinned 3rd party Action 'Create version branch and bump versions' step Uses Step uses 'peter-evans/create-pull-request' with ref 'v7', not a pinned commit hash

Show more details

## Unpinned tag for a non-immutable Action in workflow Unpinned 3rd party Action 'Create version branch and bump versions' step [Uses Step](1) uses 'peter-evans/create-pull-request' with ref 'v7', not a pinned commit hash [Show more details](https://github.com/mokoconsulting-tech/MokoJoomTOS/security/code-scanning/5)

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomTOS#20