v2.6.0: Content backup/git versioning, plugin type system, docs update
New features: - ContentBackup class with ZIP backup/restore and git versioning - Admin backup & restore page (content-backup.twig) with git init/commit/log/restore - Plugin type system: system (blue) vs content (green) with visual badges - PluginAPIInterface + AdminPluginAPI for plugin architecture - Essential plugin flag (cannot edit/deactivate/delete) Improvements: - Consolidated enabled_plugins config (removed plugins.enabled) - Removed Analytics/Logging toggles from admin config page - Fixed Dashboard plugin Twig comments rendered as text - Updated 20 guide files (NL+EN): configuratie, plugins, plugin-development, core-classes, theme-json, layouts, scss-styling, admin-beheerder, nieuw-thema, architectuur - Improved accessibility test script (grep -E, min/max checks) Cleanup: - Removed unused classes: ARIAComponents, AccessibilityManager, ContentSecurityPolicy, etc. - Removed vendor packages: mustache/mustache, php-mqtt/client - Removed old templates: logs.twig, statistics.twig (now plugins) - Moved language files to language/ directory Tests: - Pentest: 30/30 passed, 0 vulnerabilities - WCAG 2.1 AA: 25/25 passed, 100% compliance
This commit is contained in:
@@ -18,15 +18,14 @@ codepress/
|
||||
│ │ ├── class/
|
||||
│ │ │ ├── CodePressCMS.php # Hoofd CMS class
|
||||
│ │ │ ├── ThemeManager.php # Thema-resolver + Twig render + SCSS compile
|
||||
│ │ │ ├── Logger.php # Logging systeem
|
||||
│ │ │ └── SimpleTemplate.php # Legacy Mustache-style engine (niet meer gebruikt)
|
||||
│ │ │ └── Logger.php # Logging systeem
|
||||
│ │ ├── plugin/
|
||||
│ │ │ ├── PluginManager.php # Plugin loader
|
||||
│ │ │ └── CMSAPI.php # API voor plugins
|
||||
│ │ ├── config.php # Config loader (leest config.json)
|
||||
│ │ └── index.php # Bootstrap (autoloader, requires)
|
||||
│ ├── lang/ # Taalbestanden (nl.php, en.php)
|
||||
│ └── router.php # PHP dev server router (serveert ook /themes/)
|
||||
├── language/ # Taalbestanden (nl/, en/, de/ — elk met site.php + admin.php)
|
||||
├── themes/ # Dynamische thema's (volledig zelfstandig)
|
||||
│ ├── default/ # Standaard thema
|
||||
│ │ ├── theme.json # { title, default_layout, layout→.twig mapping, kleuren }
|
||||
@@ -34,33 +33,24 @@ codepress/
|
||||
│ │ ├── full_content.twig # Layout: volledige breedte
|
||||
│ │ ├── left_sidebar.twig # Layout: sidebar links
|
||||
│ │ ├── right_sidebar.twig # Layout: sidebar rechts
|
||||
│ │ ├── custom1.twig # Layout: custom
|
||||
│ │ ├── custom1.twig # Layout: custom
|
||||
│ │ ├── guide.twig # Layout: handleiding
|
||||
│ │ ├── partials/ # header.twig, navigation.twig, footer.twig
|
||||
│ │ ├── css/theme.scss # SCSS bron (runtime gecompileerd)
|
||||
│ │ └── js/theme.js # Thema JavaScript
|
||||
│ │ ├── assets/scss/theme.scss # SCSS bron (runtime gecompileerd)
|
||||
│ │ └── assets/js/ # app.js, bootstrap.bundle.min.js
|
||||
│ ├── demo/ # Demo thema (zelfde structuur, andere look)
|
||||
│ └── test/ # Test thema
|
||||
├── admin/ # Admin paneel
|
||||
│ ├── config/
|
||||
│ │ ├── app.php # Admin app configuratie
|
||||
│ │ └── admin.json # Gebruikers & security (file-based)
|
||||
│ │ ├── admin.json # Gebruikers & security (file-based, gitignored)
|
||||
│ │ └── admin.json.example # Voorbeeld met placeholder-wachtwoord
|
||||
│ ├── src/
|
||||
│ │ └── AdminAuth.php # Authenticatie (sessies, bcrypt, CSRF, lockout)
|
||||
│ ├── templates/
|
||||
│ │ ├── login.php # Login pagina
|
||||
│ │ ├── layout.php # Admin layout met sidebar
|
||||
│ │ └── pages/
|
||||
│ │ ├── dashboard.php
|
||||
│ │ ├── content.php
|
||||
│ │ ├── content-edit.php
|
||||
│ │ ├── content-new.php
|
||||
│ │ ├── content-dir-form.php
|
||||
│ │ ├── config.php
|
||||
│ │ ├── plugins.php
|
||||
│ │ ├── plugin-config.php
|
||||
│ │ ├── theme.php
|
||||
│ │ └── users.php
|
||||
│ └── storage/logs/ # Admin logs
|
||||
│ ├── theme/default/views/ # Twig templates
|
||||
│ │ ├── login.twig # Login pagina
|
||||
│ │ ├── layouts/admin.twig # Admin layout met sidebar
|
||||
│ │ └── pages/ # dashboard, content, content-edit, config, plugins, theme, users, statistics, logs, security, update, guide, media, etc.
|
||||
│ └── storage/logs/ # Admin logs (gedeeld met front-end)
|
||||
├── cli/ # CLI scripts & tests
|
||||
│ └── test/
|
||||
│ ├── accessibility.sh # WCAG 2.1 AA test suite
|
||||
@@ -69,7 +59,7 @@ codepress/
|
||||
│ └── pentest/ # Penetratietesten
|
||||
├── plugins/ # CMS plugins
|
||||
│ ├── HTMLBlock/
|
||||
│ └── MQTTTracker/
|
||||
│ └── Navigation/
|
||||
├── public/ # Web root
|
||||
│ ├── assets/css/js/
|
||||
│ ├── index.php # Website entry point
|
||||
@@ -92,7 +82,7 @@ codepress/
|
||||
- Admin entry point + routing: `public/admin.php`
|
||||
- Admin authenticatie: `admin/src/AdminAuth.php`
|
||||
- **Content**: Stored in `content/`. Supports `.md` (Markdown), `.php` (Dynamic), `.html` (Static).
|
||||
- **Templating**: Twig templates in `themes/<naam>/`. `ThemeManager` rendert via Twig en compileert `css/theme.scss` runtime naar `public/themes/<naam>/theme.css`. Layout gekozen via frontmatter `layout:` key; onbekende layouts vallen terug op `default_layout` in `theme.json`.
|
||||
- **Templating**: Twig templates in `themes/<naam>/`. `ThemeManager` rendert via Twig en compileert `assets/scss/theme.scss` runtime naar `public/themes/<naam>/theme.css`. Layout gekozen via frontmatter `layout:` key; onbekende layouts vallen terug op `default_layout` in `theme.json`.
|
||||
- **Navigation**: Auto-generated from directory structure. Folders require an index file to be clickable in breadcrumbs.
|
||||
- **Security**:
|
||||
- Always use `htmlspecialchars()` for outputting user/content data
|
||||
@@ -104,9 +94,9 @@ codepress/
|
||||
## Admin Console
|
||||
- **File-based**: Geen database. Gebruikers opgeslagen in `admin/config/admin.json`
|
||||
- **Routing**: Via `?route=` parameter in `public/admin.php`
|
||||
- **Routes**: `login`, `logout`, `dashboard`, `content`, `content-edit`, `content-new`, `content-delete`, `config`, `plugins`, `plugins-new`, `plugins-edit`, `plugins-config`, `plugins-toggle`, `plugins-delete`, `users`
|
||||
- **Routes**: `login`, `logout`, `dashboard`, `content`, `content-edit`, `content-new`, `content-delete`, `content-dir-create`, `content-dir-rename`, `content-dir-delete`, `content-move`, `config`, `plugins`, `plugins-new`, `plugins-edit`, `plugins-config`, `plugins-toggle`, `plugins-delete`, `theme`, `theme-new`, `users`, `security`, `statistics`, `logs`, `guide`, `media`, `update`
|
||||
- **Auth**: Session-based. `AdminAuth` class handelt login, logout, CSRF, brute-force lockout af
|
||||
- **Templates**: Pure PHP templates in `admin/templates/pages/`. Layout in `layout.php`
|
||||
- **Templates**: Twig templates in `admin/theme/default/views/`. Layout in `layouts/admin.twig`
|
||||
|
||||
## Important: Title vs File/Directory Name Logic
|
||||
- **CRITICAL**: When user asks for "title" corrections, they usually mean **FILE/DIRECTORY NAME WITHOUT LANGUAGE PREFIX AND EXTENSIONS**, not the HTML title from content!
|
||||
@@ -121,5 +111,5 @@ codepress/
|
||||
## Bekende aandachtspunten
|
||||
- LSP errors over "Undefined function" in PHP files zijn vals-positief (standaard PHP functies worden niet herkend door de LSP). Negeer deze.
|
||||
- Zie `TODO.md` voor alle openstaande verbeteringen en nieuwe features.
|
||||
- `vendor/` map bevat Composer dependencies (CommonMark, Twig, scssphp, Mustache). Niet handmatig wijzigen.
|
||||
- `vendor/` map bevat Composer dependencies (CommonMark, Twig, scssphp, GeoIP2). Niet handmatig wijzigen.
|
||||
- `admin/config/admin.json` bevat wachtwoord-hashes. Niet committen met echte productie-wachtwoorden.
|
||||
|
||||
Reference in New Issue
Block a user