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
7.2 KiB
7.2 KiB
CodePress CMS
Een lichtgewicht, file-based content management systeem gebouwd met PHP (≥8.0).
Versie: 2.5.0 | Licentie: AGPL v3 / Commercial
✨ Features
- 📝 Multi-format Content - Markdown, PHP en HTML bestanden
- 🧭 Dynamic Navigation - Automatische menu generatie
- 🌍 Multi-language - NL/EN/DE/FR ondersteuning
- 🔍 Search - Volledige tekst zoekfunctie
- 📱 Responsive - Bootstrap 5 thema's
- 🔒 Security - 100/100 pentest score
- 🛡️ Admin Console - CodeMirror editor, media beheer, thema's, plugins
- 👥 Gebruikersrollen - Admin, Content Beheerder, BI Beheerder, Site Admin
- 📊 Analytics - Bezoekersstatistieken met GeoIP
- 🤖 BotGuard - Bot/AI bescherming
- 📈 Logging - Uitgebreid logging systeem
- 🔌 Plugin Systeem - Sidebar plugins met eigen CSS/SCSS, Twig templates
🚀 Quick Start
# Installeer dependencies
composer install
# Start server met router voor schone URLs
php -S localhost:8080 cms/router.php
Website: http://localhost:8080
Admin: http://localhost:8080/admin (login: admin / admin)
📚 Handleidingen
Zie guide/ voor uitgebreide documentatie per rol:
| Rol | Handleiding |
|---|---|
| 📝 Redacteur | Content Beheerder |
| ⚙️ Administrator | Admin Beheerder |
| 🎨 Theme bouwer | Theme Developer |
| 💻 Developer | CodePress Developer |
Elke handleiding heeft sub-onderdelen in aparte mappen met een zijbalknavigatie.
👥 Gebruikersrollen
| Rol | Permissies |
|---|---|
| Admin | Volledige toegang (alles) |
| Content Beheerder | Content beheer, handleiding |
| BI Beheerder | Statistieken, logs, handleiding |
| Site Admin | Thema, plugins, statistieken, logs, update, handleiding |
📁 Project Structuur
codepress/
├── cms/ # Core CMS engine
│ ├── core/class/ # CMS classes (CodePressCMS, ThemeManager, etc.)
│ ├── core/plugin/ # Plugin systeem (PluginManager, CMSAPI)
│ └── router.php # PHP dev server router (schone URLs)
├── language/ # Taalbestanden (nl/, en/, de/ — elk met site.php + admin.php)
├── admin/ # Admin console
│ ├── config/ # Admin configuratie (admin.json)
│ ├── src/AdminAuth.php # Authenticatie, rollen, permissies
│ ├── storage/ # Logs, cache, geoip
│ └── theme/default/ # Admin thema
│ ├── assets/ # CSS, JS, fonts, codemirror
│ ├── views/ # Twig templates (layouts, pages)
│ └── theme.json # Admin thema configuratie
├── themes/ # Website thema's
│ ├── default/ # Standaard thema
│ │ ├── theme.json # Layout mapping, kleuren
│ │ ├── base.twig # Hoofd layout
│ │ ├── *.twig # Layout templates
│ │ ├── partials/ # Header, navigation, footer
│ │ └── assets/ # SCSS, CSS, JS, img
│ └── demo/ # Demo thema
├── plugins/ # Plugins
│ ├── HTMLBlock/ # Voorbeeld sidebar plugin
│ └── Navigation/ # Essentiële navigatie plugin (beschermd)
│ ├── Navigation.php # Plugin code
│ ├── plugin.json # Plugin metadata
│ ├── assets/scss/ # Plugin SCSS bron
│ └── assets/css/ # Plugin CSS
├── content/ # Website content (.md, .php, .html)
├── public/ # Web root
│ ├── index.php # Website entry point
│ └── admin.php # Admin entry point + routing
├── guide/ # Handleidingen (nl/en)
│ ├── nl/ # Nederlandse handleidingen
│ └── en/ # Engelse handleidingen
├── cli/test/ # Test suites
├── var/ # Cache (twig)
├── config.json # Site configuratie
├── composer.json # PHP dependencies
└── version.php # Versie informatie
⚙️ Configuratie
config.json
{
"site_title": "CodePress",
"active_theme": "default",
"default_page": "auto",
"language": {
"default": "nl",
"available": ["nl", "en"]
},
"enabled_plugins": ["HTMLBlock", "Navigation"],
"features": {
"search_enabled": true,
"breadcrumbs_enabled": true
},
"security": {
"block_ai_bots": true,
"rate_limit_enabled": true
},
"analytics": { "enabled": true },
"logging": { "enabled": true }
}
🔧 Dependencies
- PHP ≥8.0 met extensies: json, mbstring
- Composer packages:
- twig/twig (templating)
- scssphp/scssphp (SCSS compilatie)
- league/commonmark (Markdown met HeadingPermalinks)
- maxmind-db/reader (GeoIP)
🔐 Security
- ✅ XSS preventie (htmlspecialchars)
- ✅ CSRF tokens (admin formulieren)
- ✅ Path traversal preventie (realpath checks)
- ✅ Secure cookies (HttpOnly, SameSite)
- ✅ Security headers (X-Frame-Options, CSP)
- ✅ Bot/AI bescherming (BotGuard)
- ✅ Rate limiting per IP
- ✅ Role-based access control (RBAC)
🔌 Plugins
Plugin structuur
plugins/MijnPlugin/
├── MijnPlugin.php # Plugin code (naam = pluginnaam)
├── plugin.json # Plugin metadata
├── assets/scss/ # Plugin SCSS bron
└── assets/css/ # Plugin CSS (na compilatie)
Essentiële plugins
De Navigation plugin is een essentiële plugin en kan niet worden gedeactiveerd, bewerkt of verwijderd. Deze plugin genereert automatisch de zijbalknavigatie voor handleidingen en content.
Plugin CSS
Plugin CSS wordt automatisch geladen na thema CSS, zodat thema's plugin styling kunnen overschrijven.
📝 Content Voorbeelden
Markdown met frontmatter
---
layout: full_content
plugins: HTMLBlock, Navigation
---
# Pagina titel
Content in Markdown formaat...
PHP content
<?php
/** @var ContentAPI $api */
$pages = $api->getAllPages();
echo "<h1>Mijn Pagina</h1>";
echo "<p>Aantal pagina's: " . count($pages) . "</p>";
🧪 Testen
# Penetration tests
cli/test/pentest/security-test.sh
# Accessibility tests (WCAG 2.1 AA)
cli/test/accessibility.sh
# Functionele tests
cli/test/functional/*.sh
📞 Ondersteuning
- Documentatie: guide/
- Issues: Git repository
- Contact: commercial@noorlander.info
📄 Licentie
Dual-licensed:
- AGPL v3 - Voor open-source projecten
- Commercial - Voor propriëtair gebruik
Zie LICENSE voor details.
CodePress CMS - Gebouwd door E.Noorlander / CodePress Development Team