diff --git a/admin/templates/layout.php b/admin/templates/layout.php
index 00fb4f7..ce787fb 100644
--- a/admin/templates/layout.php
+++ b/admin/templates/layout.php
@@ -22,6 +22,7 @@ $layoutSidebarColor = $layoutThemeConfig['header_color'] ?? '#0a369d';
.admin-sidebar .nav-link:hover { color: #fff; background-color: rgba(255,255,255,0.1); }
.admin-sidebar .nav-link.active { color: #fff; background-color: rgba(255,255,255,0.2); border-left: 3px solid #fff; }
.admin-sidebar .nav-link i { width: 24px; text-align: center; margin-right: 0.5rem; }
+ .admin-sidebar .nav-section { color: rgba(255,255,255,0.4); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 1rem 1.25rem 0.3rem 1.25rem; }
.admin-main { margin-left: 240px; padding: 2rem; }
.admin-brand { color: #fff; padding: 1.25rem; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.15); }
.admin-brand i { margin-right: 0.5rem; }
@@ -45,37 +46,50 @@ $layoutSidebarColor = $layoutThemeConfig['header_color'] ?? '#0a369d';
CodePress Admin
+ - Algemeen
-
Dashboard
+
+ - Content
-
Content
- -
-
- Thema
-
-
+ - Instellingen
-
Configuratie
+ -
+
+ Thema
+
+
-
Beveiliging
+
+ - Gegevens
-
Statistieken
+ -
+
+ Logs
+
+
+
+ - Systeem
-
Plugins
@@ -86,22 +100,21 @@ $layoutSidebarColor = $layoutThemeConfig['header_color'] ?? '#0a369d';
Gebruikers
- -
-
- Handleiding
-
-
- -
-
- Logs
-
-
-
Update
- -
+
+
- Help
+ -
+
+ Handleiding
+
+
+
+ - Links
+ -
Website bekijken
diff --git a/guide/en.codepress.md b/guide/en.codepress.md
index bf4e4e1..333426d 100644
--- a/guide/en.codepress.md
+++ b/guide/en.codepress.md
@@ -3,22 +3,36 @@
## Table of Contents
- [Overview](#overview)
-- [Features](#features)
- [Installation](#installation)
- [Project Structure](#project-structure)
-- [Configuration](#configuration)
-- [Content Structure](#content-structure)
-- [Admin Console](#admin-console)
-- [Logging & Request Log](#logging--request-log)
-- [Templates](#templates)
-- [URL Structure](#url-structure)
-- [SEO Optimization](#seo-optimization)
-- [Plugin System](#plugin-system)
-- [Content API](#content-api-for-php-content-files)
-- [Analytics & Tracking](#analytics--tracking)
-- [Frequently Asked Questions](#frequently-asked-questions)
-- [Troubleshooting](#troubleshooting)
-- [Security](#security)
+
+- [Content](#content)
+ - [Content Structure](#content-structure)
+ - [Content API (for PHP content files)](#content-api-for-php-content-files)
+
+- [Settings](#settings)
+ - [Configuration](#configuration)
+ - [Themes](#themes)
+ - [Security](#security)
+
+- [Data](#data)
+ - [Statistics & Analytics](#statistics--analytics)
+ - [Logging](#logging)
+
+- [System](#system)
+ - [Plugin System](#plugin-system)
+ - [User Management](#user-management)
+ - [Update](#update)
+
+- [Guide (in Admin)](#guide-in-admin)
+
+- [Other](#other)
+ - [Templates](#templates)
+ - [URL Structure](#url-structure)
+ - [SEO Optimization](#seo-optimization)
+ - [Frequently Asked Questions](#frequently-asked-questions)
+ - [Troubleshooting](#troubleshooting)
+
- [Version](#version)
- [Support](#support)
- [License](#license)
@@ -27,72 +41,6 @@
CodePress CMS is a lightweight, file-based content management system built with PHP (>=8.0). Works without a database.
-## Features
-
-### Navigation
-- Tab-style navigation with Bootstrap 5 styling
-- Dropdown menus for folders and sub-folders
-- Home button with icon
-- Automatic menu generation based on directory structure
-- Responsive design
-- Breadcrumb navigation with sidebar toggle
-- Active state marking
-- **Sidebar toggle** - Button placed left of HOME in the breadcrumb to open/close the sidebar. The icon changes between open and closed state. The choice is preserved during the session
-
-### Content Types
-- **Markdown (.md)** - CommonMark support via `league/commonmark`
-- **PHP (.php)** - Dynamic content with **Content API** (`$api` variable)
-- **HTML (.html)** - Static HTML pages
-- **Directory listings** - Automatic directory overviews
-- **Language-specific content** - `en.` and `nl.` prefixes
-
-### Search Functionality
-- Full-text search through all content
-- Results with snippets and highlighting
-- Direct navigation to found pages
-- SEO-friendly search results
-- Search URL: `?search=query`
-
-### Configuration
-- **Settings form** in admin panel via `/admin/config`
-- Dynamic homepage setting via dropdown (auto, newest modified page, or manual selection)
-- SEO settings (description, keywords)
-- Author information with links
-- Theme configuration via `themes/` directory
-- Language settings
-- Feature toggles (auto_link_pages, search_enabled, breadcrumbs_enabled)
-
-### Layout & Design
-- Flexbox layout for responsive structure
-- Fixed header with logo and search
-- Breadcrumb navigation
-- Fixed footer with file info and links
-- Bootstrap 5 styling
-- Mustache templates (`cms/templates/`)
-- Semantic HTML5 structure
-- **Dynamic layouts** with YAML frontmatter
-- **Sidebar support** with plugin integration and toggle function via breadcrumb
-- **Theme support** via `themes/` directory with theme.json per theme
-
-### Admin Console
-- Built-in admin panel at `/admin`
-- **Dashboard** with statistics (pages, directories, plugins) and quick actions
-- **Content management** - Browse files, upload, create, edit, rename, move and delete
-- **CodeMirror editor** with toolbar (bold, italic, heading, link, image, list, media insert)
-- **Media browser modal** in the editor for selecting images/files
-- **Directory management** - Create, rename and delete directories (empty only)
-- **Configuration editor** - Settings form for site configuration (title, homepage, language, SEO, author, features)
-- **Theme management** - Create, activate, edit (colors, background) and delete themes
-- **Plugin management** - Overview, create, edit, configure, enable/disable and delete
-- **Media management** - Upload and delete media files in `content/-assets/`
-- **User management** - Add, remove users, change passwords
-- **Guide** - Built-in documentation with API reference
-- **Logging** - Activity log and request log with IP, page, domain; view and download via `/admin/logs`
-- **Bot & AI blocking** - Automatic 403 for known bots and AI crawlers
-- Session-based authentication with bcrypt hashing
-- CSRF protection, brute-force lockout (5 attempts, 15 min)
-- Default login: `admin` / `admin` (change immediately after installation)
-
## Installation
1. Upload files to web server
@@ -111,7 +59,12 @@ codepress/
│ │ ├── class/
│ │ │ ├── CodePressCMS.php # Main CMS class (content, navigation, search)
│ │ │ ├── Logger.php # Structured logging system
-│ │ │ └── SimpleTemplate.php # Mustache-style template engine
+│ │ │ ├── SimpleTemplate.php # Mustache-style template engine
+│ │ │ ├── Analytics.php # Visitor statistics
+│ │ │ ├── BotGuard.php # Bot/AI/scraper detection
+│ │ │ ├── GeoIP.php # Country lookup by IP
+│ │ │ ├── Cache.php # File-based caching
+│ │ │ └── RateLimiter.php # Per-IP rate limiting
│ │ ├── plugin/
│ │ │ ├── PluginManager.php # Plugin loader and manager
│ │ │ └── CMSAPI.php # API for plugin developers
@@ -120,7 +73,6 @@ codepress/
│ ├── lang/ # Language files
│ │ ├── nl.php # Dutch translations
│ │ └── en.php # English translations
-│ ├── logs/ # CMS logs
│ ├── templates/ # Mustache templates
│ │ ├── layout.mustache # Main layout (CSS, structure)
│ │ ├── assets/ # Header, navigation, footer partials
@@ -144,14 +96,18 @@ codepress/
│ │ ├── content-new.php # Create new content
│ │ ├── content-dir-form.php # Create/edit directory
│ │ ├── content-move-form.php # Move content
-│ │ ├── config.php # Configuration editor (JSON)
+│ │ ├── config.php # Configuration editor
+│ │ ├── security.php # Security settings
+│ │ ├── statistics.php # Statistics dashboard
│ │ ├── plugins.php # Plugin overview
│ │ ├── plugins-edit.php # Plugin PHP source code editor
│ │ ├── plugins-new.php # Create new plugin
│ │ ├── plugin-config.php # Plugin configuration editor
-│ │ ├── theme.php # Theme management (create, activate, edit)
-│ │ ├── media.php # Media management (upload, delete)
-│ │ └── users.php # User management
+│ │ ├── theme.php # Theme management
+│ │ ├── users.php # User management
+│ │ ├── logs.php # Log viewer
+│ │ ├── update.php # System update
+│ │ └── guide.php # Guide
│ └── storage/logs/ # Admin logs
├── cli/ # CLI scripts & tests
├── content/ # Content files
@@ -160,8 +116,7 @@ codepress/
│ └── ... # Other content
├── plugins/ # CMS plugins
│ ├── HTMLBlock/ # Custom HTML blocks in sidebar
-│ ├── MQTTTracker/ # Real-time analytics and tracking
-│ └── test/ # Test plugin
+│ └── MQTTTracker/ # Real-time analytics and tracking
├── public/ # Web root
│ ├── index.php # Website entry point (media serving + CMS)
│ ├── admin.php # Admin entry point + routing
@@ -174,28 +129,173 @@ codepress/
├── themes/ # Theme definitions
│ ├── default/ # Default theme
│ │ └── theme.json # Colors, heights, background
-│ └── test/ # Test theme
-│ └── theme.json
+│ └── ... # Other themes
├── config.json # Site configuration
-├── version.php # Version information (1.6.0)
+├── version.php # Version information
└── vendor/ # Composer dependencies
```
-## Configuration
+---
-### Basic Configuration
+## Content
-The site configuration is managed via the **admin panel** at `/admin/config`. Here you'll find a settings form with the following sections:
+### Content Structure
+
+#### File Structure
+
+```
+content/
+├── folder1/
+│ ├── subfolder1/
+│ │ ├── nl.page1.md
+│ │ └── en.page1.md
+│ └── page3.html
+├── folder2/
+│ └── page4.md
+├── index.md
+└── -assets/
+ ├── image.jpg
+ └── document.pdf
+```
+
+#### File Naming
+- Use lowercase filenames
+- No spaces - use `-` or `_`
+- Logical extensions - `.md`, `.php`, `.html`
+- Unique names - no duplicates
+- Language prefixes - `nl.file.md` and `en.file.md`
+
+#### Media Files
+
+Media files (images, PDFs, video, audio) can be placed in any `content/` subdirectory and are served via:
+
+- **`/-media/path/file.jpg`** - Media from any content subdirectory
+- **`/-assets/file.jpg`** - Backward compatibility (old URLs)
+- Uploads via the admin panel go to `content/-assets/`
+
+### Content API (for PHP content files)
+
+PHP content files (`.php` in the `content/` directory) have access to an `$api` variable with the following methods:
+
+#### Getting pages
+
+```php
+// Get all pages with titles
+$pages = $api->getAllPages();
+// Result: ['index' => 'Home', 'about' => 'About Us', ...]
+
+// Get a specific page's content
+$page = $api->getPage('about');
+// $page['title'], $page['content'], $page['path'], $page['layout'], $page['metadata']
+
+// Check if a page exists
+if ($api->pageExists('contact')) {
+ // ...
+}
+```
+
+#### Navigation
+
+```php
+// Get menu structure
+$menu = $api->getMenu();
+// Nested array with 'title', 'path', 'url', 'children'
+```
+
+#### Configuration
+
+```php
+// Get config value (dot notation)
+$title = $api->getConfig('site_title');
+$lang = $api->getConfig('language.default');
+$seoDesc = $api->getConfig('seo.description', 'Default description');
+```
+
+#### Current page
+
+```php
+// Current page title
+$pageTitle = $api->getCurrentPageTitle();
+
+// Current page path
+$pagePath = $api->getCurrentPagePath();
+
+// Check if this is the homepage
+if ($api->isHomepage()) {
+ echo 'Welcome!';
+}
+```
+
+#### URLs and language
+
+```php
+// Build URL for a page
+$url = $api->buildUrl('about', 'en');
+
+// Current language
+$lang = $api->getCurrentLanguage();
+
+// Available languages
+$languages = $api->getAvailableLanguages();
+
+// Site title
+$title = $api->getSiteTitle();
+```
+
+#### Translations and search
+
+```php
+// Get translation
+$label = $api->t('home');
+
+// Search results (if searching)
+if ($api->isSearching()) {
+ $results = $api->getSearchResults();
+}
+```
+
+#### Example PHP content file
+
+```php
+---
+title: Page Overview
+layout: content
+---
+
All Pages
+
+```
+
+---
+
+## Settings
+
+### Configuration
+
+The site configuration is managed via the **admin panel** at `/admin/config`. The form includes:
- **General settings** - Site title and homepage (dropdown with available pages)
- **Language** - Default language and available languages
- **SEO** - Meta description and keywords
- **Author** - Name and website
- **Features** - Auto-link pages, search, breadcrumbs, show version
+- **IP Exclusions** - Exclude IP addresses from statistics and security checks
-The configuration is stored in `config.json`. You can also edit this file manually for advanced options like `active_theme`, `content_dir` and `templates_dir`.
+The configuration is stored in `config.json`. You can also edit this file manually for advanced options.
-### Example `config.json`
+#### IP Exclusions
+
+Under **Configuration** in the admin panel, the "IP Exclusions" field lets you specify IP addresses that will be:
+
+- Excluded from visitor statistics
+- Skipped during all security checks (bot detection, rate limiting, IP blocklist)
+
+This is useful for your own IP address or internal monitoring tools.
+
+#### Example `config.json`
```json
{
@@ -220,11 +320,25 @@ The configuration is stored in `config.json`. You can also edit this file manual
"auto_link_pages": true,
"search_enabled": true,
"breadcrumbs_enabled": true
+ },
+ "analytics": {
+ "enabled": true,
+ "excluded_ips": ["127.0.0.1", "::1"]
+ },
+ "security": {
+ "block_ai_bots": true,
+ "block_scrapers": true,
+ "block_empty_user_agent": true,
+ "rate_limit_enabled": true
}
}
```
-### Theme Configuration (`themes//theme.json`)
+### Themes
+
+Themes are managed via the admin panel at `/admin/theme`. You can create, activate, adjust colors, upload background images, and delete themes.
+
+#### Theme Configuration (`themes//theme.json`)
```json
{
@@ -242,232 +356,82 @@ The configuration is stored in `config.json`. You can also edit this file manual
}
```
-Themes can be managed via the admin panel: create, activate, adjust colors, upload background image and delete.
+#### How to create a new theme
-## Content Structure
+1. Go to `/admin/theme`
+2. Enter a name and click "Create"
+3. Adjust colors, heights and background
+4. Activate the theme
-### File Structure
+### Security
-```
-content/
-├── folder1/
-│ ├── subfolder1/
-│ │ ├── nl.page1.md
-│ │ └── en.page1.md
-│ └── page3.html
-├── folder2/
-│ └── page4.md
-├── index.md
-└── -assets/
- ├── image.jpg
- └── document.pdf
-```
+Security settings are managed via `/admin/security`. Includes:
-### File Naming
-- Use lowercase filenames
-- No spaces - use `-` or `_`
-- Logical extensions - `.md`, `.php`, `.html`
-- Unique names - no duplicates
-- Language prefixes - `nl.file.md` and `en.file.md`
-
-### Media Files
-
-Media files (images, PDFs, video, audio) can be placed in any `content/` subdirectory and are served via:
-
-- **`/-media/path/file.jpg`** - Media from any content subdirectory
-- **`/-assets/file.jpg`** - Backward compatibility (old URLs)
-- Uploads via the admin panel go to `content/-assets/`
-
-## Admin Console
-
-### Access
-
-- **URL**: `/admin`
-- **Default login**: `admin` / `admin`
-
-### Routes
-
-| Route | Description |
-|---|---|
-| `login` | Login page |
-| `logout` | Logout |
-| `dashboard` | Dashboard with statistics |
-| `content` | Content overview (browse, upload) |
-| `content-edit` | Edit content (CodeMirror editor) |
-| `content-new` | Create new content |
-| `content-delete` | Delete content |
-| `content-move` | Move content to another directory |
-| `content-dir-form` | Create or edit directory |
-| `content-dir-rename` | Rename directory |
-| `content-dir-create` | Create directory (POST) |
-| `content-dir-delete` | Delete directory (empty only) |
-| `config` | Configuration form (title, homepage, language, SEO, author, features) |
-| `security` | Security settings (bot/AI blocking, rate limiting, IP block/allowlist) |
-| `statistics` | Visitor statistics with world map, countries, pages and GeoIP settings |
-| `update` | One-click system update via Git pull |
-| `theme` | Theme management |
-| `plugins` | Plugin overview |
-| `plugins-new` | Create new plugin |
-| `plugins-edit` | Edit plugin PHP source code |
-| `plugins-config` | Edit plugin configuration |
-| `plugins-toggle` | Enable/disable plugin |
-| `plugins-delete` | Delete plugin |
-| `media` | Media management (upload, delete) |
-| `media-list` | JSON list of all media (for editor modal) |
-| `users` | User management |
-| `guide` | Guide / documentation |
-| `logs` | Log viewer (activity + requests) |
-
-### Editor Features
-
-The content editor (`content-edit`, `content-new`) includes:
-
-- **CodeMirror** syntax highlighting for Markdown/PHP/HTML
-- **Toolbar** with buttons for: bold, italic, heading, link, image, list, media insert
-- **Media browser modal** - Open via the "Media" button to select images/files
-- **Inline filename rename** - Inline filename input with extension badge
-- **Layout selector** - Choose from available layouts
-- **Plugin per-page visibility** - Select which plugins to show on this page
-- **Upload and "Create" buttons** are disabled until input is provided
-- **"Cancel" button** (instead of "Back") for unsaved changes
-
-### Logging & Request Log
-
-The admin console maintains two logs:
-
-- **Activity log** (`admin/storage/logs/admin.log`) — admin actions like creating, editing, deleting pages, enabling/disabling plugins, changing configuration.
-- **Request log** (`admin/storage/logs/requests.log`) — every page view on the website, including IP, page, domain, language, user agent, and referrer.
-
-Both logs can be viewed and downloaded via **`/admin/logs`** or the sidebar "Logs" link. The dashboard shows the last 20 entries of each log. Click "View all →" for the full list, where you can also download or clear.
-
-### Bot & AI Blocking
+#### Bot, AI & Scraper Blocking
Incoming requests are checked against known bot and AI crawler patterns via the User-Agent header. Detected bots receive a **403 Forbidden** response.
-Blocked categories:
-
| Category | Examples |
|---|---|
| AI Crawlers | GPTBot, ChatGPT-User, Claude-Web, ClaudeBot, Google-Extended, CCBot, PerplexityBot |
| Search Engines | Googlebot, Bingbot, BingPreview, DuckDuckBot, YandexBot, Baiduspider |
| Scrapers | HTTrack, Scrapy, PhantomJS |
-## Templates
+#### Rate Limiting
-### Template Variables
+Prevents IPs from overloading the site. Returns HTTP 429 on exceedance.
-#### Site Info
-- `site_title` - Website title
-- `author_name` - Author name
-- `author_website` - Author website
-- `author_git` - Git repository link
+#### IP Lists
-#### Page Info
-- `page_title` - Page title
-- `content` - Content (HTML)
-- `file_info` - File information
-- `is_homepage` - Boolean: is this the homepage?
+- **IP Whitelist** - IPs on the whitelist are never blocked
+- **IP Blocklist** - IPs on the blocklist always receive a 403 Forbidden
-#### Navigation
-- `menu` - Navigation menu
-- `breadcrumb` - Breadcrumb navigation
-- `homepage` - Homepage link
+#### Dynamic robots.txt
-#### Theme (from theme.json)
-- `header_color` - Header background color
-- `header_font_color` - Header text color
-- `header_height` - Header height in pixels
-- `navigation_color` - Navigation background color
-- `navigation_font_color` - Navigation text color
-- `nav_height` - Navigation height in pixels
-- `sidebar_background` - Sidebar background color
-- `sidebar_border` - Sidebar border color
-- `background_image_css` - CSS for background image
-- `background_image_opacity` - Overlay opacity
+The system automatically generates a `robots.txt` based on your security settings, available at `/robots.txt`.
-#### Language
-- `current_lang` - Current language (en/nl)
-- `current_lang_upper` - Current language (EN/NL)
-- `t_*` - Translated strings
-
-### Layout Options
-
-Use YAML frontmatter to select layout:
-
-```yaml
---
-title: My Page
-layout: sidebar-content
-plugins: HTMLBlock
+
+## Data
+
+### Statistics & Analytics
+
+The statistics dashboard is available at `/admin/statistics` and provides:
+
+- **KPI cards** - Page views, unique visitors, human/bot ratio, blocked requests
+- **World map** - Visual representation of visitors per country with color intensity
+- **Countries list** - Top 25 countries with percentage
+- **Most viewed pages** - Top 25 pages
+- **Daily chart** - Bar chart of visitors per day
+- **Referring sites** - Top 15 referrers
+
+#### Periods and export
+
+Filter by 7, 30, 90 days or all time. Export data as CSV or JSON.
+
+#### GeoIP
+
+Country detection via three sources:
+- **Local (DB-IP Lite)** - Offline, privacy-friendly, auto-updated
+- **MaxMind database (.mmdb)** - Custom MMDB file
+- **External API** - Custom API URL and key
+
+### Logging
+
+The admin console maintains two logs, viewable at `/admin/logs`:
+
+- **Activity log** (`admin/storage/logs/admin.log`) — admin actions like creating, editing, deleting pages, enabling/disabling plugins, changing configuration.
+- **Request log** (`admin/storage/logs/requests.log`) — every page view on the website, including IP, page, domain, language, user agent, and referrer.
+
+The dashboard shows the last 20 entries of each log. Click "View all →" for the full list, where you can also download or clear.
+
---
-```
-### Available Layouts
+## System
-- `sidebar-content` - Sidebar left, content right (default)
-- `content` - Content only (full width)
-- `sidebar` - Sidebar only
-- `content-sidebar` - Content left, sidebar right
-- `content-sidebar-reverse` - Content right, sidebar left
+### Plugin System
-### Meta Data
-
-```yaml
----
-title: Page Title
-layout: content-sidebar
-description: Page description
-author: Author Name
-date: 2025-11-26
-plugins: HTMLBlock, MQTTTracker
----
-```
-
-## URL Structure
-
-### Frontend Page URLs
-- **Home**: `/` or `/en/`
-- **Page**: `/en/folder/page`
-- **Search**: `?search=query` (via search form)
-- **Guide**: `/en/guide`
-- **Language switch**: `/nl` or `/en`
-
-### Media URLs
-- **Media**: `/-media/path/to/file.jpg` (from any content subdirectory)
-- **Assets**: `/-assets/file.jpg` (from content/-assets/, backward compatible)
-
-### Admin URLs
-- **Admin**: `/admin`
-- **Dashboard**: `/admin/dashboard`
-- **Edit content**: `/admin/content-edit?file=page.md`
-- **New content**: `/admin/content-new?dir=folder`
-- **Edit theme**: `/admin/theme?edit=themename`
-
-## SEO Optimization
-
-### Meta Tags
-
-The CMS automatically adds meta tags:
-```html
-
-
-
-
-```
-
-### Security Headers
-
-```http
-X-Content-Type-Options: nosniff
-X-Frame-Options: SAMEORIGIN
-X-XSS-Protection: 1; mode=block
-Referrer-Policy: strict-origin-when-cross-origin
-Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; ...
-```
-
-## Plugin System
-
-### Plugin Structure
+#### Plugin Structure
```
plugins/
@@ -479,13 +443,9 @@ plugins/
│ ├── MQTTTracker.php
│ ├── config.json
│ └── README.md
-└── test/
- ├── test.php
- ├── config.json
- └── README.md
```
-### Plugin Development
+#### Plugin Development
- **API access** via `CMSAPI` class - gives access to CMS configuration, templates, menu
- **Sidebar content** with `getSidebarContent()` - returns HTML for sidebar
@@ -494,7 +454,7 @@ plugins/
- **viewable** field in config.json determines if plugin is visible in sidebar
- **Per-page visibility** - via the editor plugin selector per page
-### Plugin Boilerplate
+#### Plugin Boilerplate
```php
getAllPages();
-// Result: ['index' => 'Home', 'about' => 'About Us', ...]
+### Update
-// Get a specific page's content
-$page = $api->getPage('about');
-// $page['title'], $page['content'], $page['path'], $page['layout'], $page['metadata']
+Via `/admin/update` the system can be updated in one click via Git pull. The page shows the current version and git branch, and executes `git pull origin ` on confirmation.
-// Check if a page exists
-if ($api->pageExists('contact')) {
- // ...
-}
-```
-
-### Navigation
-
-```php
-// Get menu structure
-$menu = $api->getMenu();
-// Nested array with 'title', 'path', 'url', 'children'
-```
-
-### Configuration
-
-```php
-// Get config value (dot notation)
-$title = $api->getConfig('site_title');
-$lang = $api->getConfig('language.default');
-$seoDesc = $api->getConfig('seo.description', 'Default description');
-```
-
-### Current page
-
-```php
-// Current page title
-$pageTitle = $api->getCurrentPageTitle();
-
-// Current page path
-$pagePath = $api->getCurrentPagePath();
-
-// Check if this is the homepage
-if ($api->isHomepage()) {
- echo 'Welcome!';
-}
-```
-
-### URLs and language
-
-```php
-// Build URL for a page
-$url = $api->buildUrl('about', 'en');
-
-// Current language
-$lang = $api->getCurrentLanguage();
-
-// Available languages
-$languages = $api->getAvailableLanguages();
-
-// Site title
-$title = $api->getSiteTitle();
-```
-
-### Translations and search
-
-```php
-// Get translation
-$label = $api->t('home');
-
-// Search results (if searching)
-if ($api->isSearching()) {
- $results = $api->getSearchResults();
-}
-```
-
-### Example PHP content file
-
-```php
---
-title: Page Overview
-layout: content
+
+## Guide (in Admin)
+
+This guide is also built into the admin panel via `/admin/guide`, with support for Dutch and English.
+
+---
+
+## Other
+
+### Templates
+
+#### Template Variables
+
+**Site Info** - `site_title`, `author_name`, `author_website`, `author_git`
+
+**Page Info** - `page_title`, `content`, `file_info`, `is_homepage`
+
+**Navigation** - `menu`, `breadcrumb`, `homepage`
+
+**Theme (from theme.json)** - `header_color`, `header_font_color`, `header_height`, `navigation_color`, `navigation_font_color`, `nav_height`, `sidebar_background`, `sidebar_border`, `background_image_css`, `background_image_opacity`
+
+**Language** - `current_lang`, `current_lang_upper`, `t_*` (translated strings)
+
+#### Layout Options
+
+Use YAML frontmatter to select layout:
+
+```yaml
+---
+title: My Page
+layout: sidebar-content
+plugins: HTMLBlock
---
-All Pages
-
```
-## Analytics & Tracking
+#### Available Layouts
-### MQTT Tracker
+- `sidebar-content` - Sidebar left, content right (default)
+- `content` - Content only (full width)
+- `sidebar` - Sidebar only
+- `content-sidebar` - Content left, sidebar right
+- `content-sidebar-reverse` - Content right, sidebar left
-- Real-time page tracking via MQTT broker
-- Session management
-- Business Intelligence data
-- Privacy aware (GDPR compliant)
-- MQTT integration for dashboards
-- Optional: visitor tracking, page views, performance metrics, user flows
+#### Meta Data
-## Frequently Asked Questions
+```yaml
+---
+title: Page Title
+layout: content-sidebar
+description: Page description
+author: Author Name
+date: 2025-11-26
+plugins: HTMLBlock, MQTTTracker
+---
+```
-### How do I set the homepage?
+### URL Structure
+
+#### Frontend Page URLs
+- **Home**: `/` or `/en/`
+- **Page**: `/en/folder/page`
+- **Search**: `?search=query` (via search form)
+
+#### Media URLs
+- **Media**: `/-media/path/to/file.jpg` (from any content subdirectory)
+- **Assets**: `/-assets/file.jpg` (from content/-assets/, backward compatible)
+
+#### Admin URLs
+- **Admin**: `/admin`
+- **Dashboard**: `/admin/dashboard`
+- **Content**: `/admin/content`
+- **Configuration**: `/admin/config`
+- **Security**: `/admin/security`
+- **Statistics**: `/admin/statistics`
+- **Theme**: `/admin/theme`
+- **Plugins**: `/admin/plugins`
+- **Users**: `/admin/users`
+- **Logs**: `/admin/logs`
+- **Update**: `/admin/update`
+- **Guide**: `/admin/guide`
+
+### SEO Optimization
+
+#### Meta Tags
+
+The CMS automatically adds meta tags:
+```html
+
+
+
+
+```
+
+#### Security Headers
+
+```http
+X-Content-Type-Options: nosniff
+X-Frame-Options: SAMEORIGIN
+X-XSS-Protection: 1; mode=block
+Referrer-Policy: strict-origin-when-cross-origin
+Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; ...
+```
+
+### Frequently Asked Questions
+
+#### How do I set the homepage?
1. Go to **Configuration** in the admin panel (`/admin/config`)
2. Select the desired page in the **Default/homepage** dropdown
3. Click **Save configuration**
-### How does navigation work?
+#### How does navigation work?
- **Directories** become dropdown menus
- **Files** become direct links
- **Sub-directories** become nested dropdowns
- Only files without a language prefix show in the menu
-### How do I add new content?
+#### How do I add new content?
1. Via the admin panel: `/admin/content-new`
2. Or upload files to the `content/` directory
3. Organize in logical directories
4. Use correct filenames and extensions
-### How do I move a file or directory?
+#### How do I move a file or directory?
1. Go to `/admin/content`
2. Click "Move" next to the item
3. Select the target directory
4. Confirm the move
-### How do I create a new theme?
+#### How do I exclude my own IP from statistics?
-1. Go to `/admin/theme`
-2. Enter a name and click "Create"
-3. Adjust colors, heights and background
-4. Activate the theme
+1. Go to **Configuration** in the admin panel (`/admin/config`)
+2. Scroll to the "IP Exclusions" field
+3. Enter your IP address (one per line)
+4. Click **Save configuration**
-## Troubleshooting
+### Troubleshooting
-### Page not found (404)
+#### Page not found (404)
1. Check filename and path
2. Check file extension (.md, .php, .html)
3. Check file permissions
4. Check if the file has the correct language prefix (`nl.` or `en.`)
-### Navigation not updated
+#### Navigation not updated
1. Reload the page
2. Check content directory structure
3. Check filenames (no spaces)
4. Files with language prefix only show in the correct language mode
-### Admin panel not accessible
+#### Admin panel not accessible
1. Check if the session is still valid
2. On lockout: wait 15 minutes or clear lockout data in `admin/config/admin.json`
3. Check CSRF token (reload the page)
-## Security
-
-- **CSRF protection** via tokens on all admin forms
-- **Brute-force lockout** after 5 failed attempts (15 minute block)
-- **Bcrypt password hashing** for user passwords
-- **Path traversal prevention** via `realpath()` and prefix check
-- **Direct content access** blocked (403 Forbidden)
-- **Security headers** for all pages
-- **PHP execution** in content directory blocked
-- **File upload restrictions** on allowed extensions
-
## Version
-Current version: **1.6.0** (codename: "Enhanced")
-Release date: 2026-07-14
+Current version: **1.9.1**
+Release date: 2026-07-29
## Support
diff --git a/guide/nl.codepress.md b/guide/nl.codepress.md
index f4ec5bc..23f839c 100644
--- a/guide/nl.codepress.md
+++ b/guide/nl.codepress.md
@@ -3,22 +3,36 @@
## Inhoudsopgave
- [Overzicht](#overzicht)
-- [Functies](#functies)
- [Installatie](#installatie)
- [Projectstructuur](#projectstructuur)
-- [Configuratie](#configuratie)
-- [Content Structuur](#content-structuur)
-- [Admin Console](#admin-console)
-- [Logging & Request Log](#logging--request-log)
-- [Templates](#templates)
-- [URL Structuur](#url-structuur)
-- [SEO Optimalisatie](#seo-optimalisatie)
-- [Plugin Systeem](#plugin-systeem)
-- [Content API](#content-api-voor-php-content-bestanden)
-- [Analytics & Tracking](#analytics--tracking)
-- [Veelgestelde Vragen](#veelgestelde-vragen)
-- [Troubleshooting](#troubleshooting)
-- [Beveiliging](#beveiliging)
+
+- [Content](#content)
+ - [Content Structuur](#content-structuur)
+ - [Content API (voor PHP content)](#content-api-voor-php-content-bestanden)
+
+- [Instellingen](#instellingen)
+ - [Configuratie](#configuratie)
+ - [Thema's](#themas)
+ - [Beveiliging](#beveiliging)
+
+- [Gegevens](#gegevens)
+ - [Statistieken & Analytics](#statistieken--analytics)
+ - [Logging](#logging)
+
+- [Systeem](#systeem)
+ - [Plugin Systeem](#plugin-systeem)
+ - [Gebruikersbeheer](#gebruikersbeheer)
+ - [Update](#update)
+
+- [Handleiding](#handleiding-in-admin)
+
+- [Overig](#overig)
+ - [Templates](#templates)
+ - [URL Structuur](#url-structuur)
+ - [SEO Optimalisatie](#seo-optimalisatie)
+ - [Veelgestelde Vragen](#veelgestelde-vragen)
+ - [Troubleshooting](#troubleshooting)
+
- [Versie](#versie)
- [Ondersteuning](#ondersteuning)
- [Licentie](#licentie)
@@ -27,76 +41,6 @@
CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd met PHP (>=8.0). Werkt zonder database.
-## Functies
-
-### Navigatie
-- Tab-style navigatie met Bootstrap 5 styling
-- Dropdown menus voor mappen en sub-mappen
-- Home knop met icoon
-- Automatische menu generatie op basis van directory structuur
-- Responsive design
-- Breadcrumb navigatie met sidebar toggle
-- Active state marking
-- **Sidebar toggle** - Knop links van HOME in de breadcrumb om de sidebar te openen/sluiten. Het icoon wisselt tussen open en gesloten status. De keuze blijft behouden tijdens de sessie
-
-### Content Types
-- **Markdown (.md)** - CommonMark ondersteuning via `league/commonmark`
-- **PHP (.php)** - Dynamische content met **Content API** (`$api` variabele)
-- **HTML (.html)** - Statische HTML pagina's
-- **Directory listings** - Automatische directory overzichten
-- **Language-specific content** - `nl.` en `en.` prefix
-
-### Zoekfunctionaliteit
-- Volledige tekst zoek door alle content
-- Resultaten met snippets en highlighting
-- Directe navigatie naar gevonden pagina's
-- SEO-vriendelijke zoekresultaten
-- Search URL: `?search=zoekterm`
-
-### Configuratie
-- **Instellingenformulier** in admin paneel via `/admin/config`
-- Dynamische homepage instelling via dropdown (auto, nieuwste gewijzigde pagina, of handmatig)
-- SEO instellingen (description, keywords)
-- Author informatie met links
-- Thema configuratie via `themes/` directory
-- Language settings
-- Feature toggles (auto_link_pages, search_enabled, breadcrumbs_enabled)
-
-### Layout & Design
-- Flexbox layout voor responsive structuur
-- Fixed header met logo en zoekfunctie
-- Breadcrumb navigatie
-- Fixed footer met file info en links
-- Bootstrap 5 styling
-- Mustache templates (`cms/templates/`)
-- Semantic HTML5 structuur
-- **Dynamic layouts** met YAML frontmatter
-- **Sidebar support** met plugin integratie en toggle functie via breadcrumb
-- **Thema ondersteuning** via `themes/` map met theme.json per thema
-
-### Admin Console
-- Ingebouwd admin paneel op `/admin`
-- **Dashboard** met statistieken (aantal pagina's, mappen, plugins) en snelle acties
-- **Content beheer** - Bestanden browsen, uploaden, aanmaken, bewerken, hernoemen, verplaatsen en verwijderen
-- **CodeMirror editor** met toolbar (vet, cursief, kop, link, afbeelding, lijst, media invoegen)
-- **Media browser modal** in de editor voor het selecteren van afbeeldingen/bestanden
-- **Map beheer** - Mappen aanmaken, hernoemen en verwijderen (alleen lege mappen)
-- **Configuratie editor** - Instellingenformulier voor site configuratie (titel, startpagina, taal, SEO, auteur, features)
-- **Thema beheer** - Thema's aanmaken, activeren, bewerken (kleuren, achtergrond) en verwijderen
-- **Plugin beheer** - Overzicht, aanmaken, bewerken, configureren, in-/uitschakelen en verwijderen
-- **Media beheer** - Uploaden en verwijderen van mediabestanden in `content/-assets/`
-- **Gebruikersbeheer** - Gebruikers toevoegen, verwijderen, wachtwoorden wijzigen
-- **Handleiding** - Ingebouwde documentatie met API referentie
-- **Systeem Update** - Eenvoudig de site bijwerken via `/admin/update` met één klik via Git pull
-- **Git-safe Configuratie** - `config.json` en `admin/config/admin.json` worden automatisch gegenereerd als ze niet bestaan en zijn uitgesloten van Git, waardoor wachtwoorden en instellingen behouden blijven bij updates
-- **Bot & AI blokkering** - Instelbare blokkering van AI-crawlers, scrapers, lege user-agents en zoekmachines via `/admin/security`, met rate limiting per IP en IP block/allowlist
-- **Bezoekersstatistieken** - Wereldkaart met bezoekers per land, unieke bezoekers, meest gelezen pagina's, verwijzende sites en een dagelijkse grafiek via `/admin/statistics`
-- **GeoIP** - Landbepaling via een lokale DB-IP Lite database (offline, privacy-vriendelijk), of een eigen MaxMind `.mmdb` bestand of externe API
-- **Bot & AI blokkering** - Automatische 403 voor bekende bots en AI-crawlers
-- Session-based authenticatie met bcrypt hashing
-- CSRF-bescherming, brute-force lockout (5 pogingen, 15 min)
-- Standaard login: `admin` / `admin` (wijzig direct na installatie)
-
## Installatie
1. Upload bestanden naar webserver
@@ -115,7 +59,12 @@ codepress/
│ │ ├── class/
│ │ │ ├── CodePressCMS.php # Hoofd CMS class (content, navigatie, search)
│ │ │ ├── Logger.php # Gestructureerd logging systeem
-│ │ │ └── SimpleTemplate.php # Mustache-style template engine
+│ │ │ ├── SimpleTemplate.php # Mustache-style template engine
+│ │ │ ├── Analytics.php # Bezoekersstatistieken
+│ │ │ ├── BotGuard.php # Bot/AI/scraper detectie
+│ │ │ ├── GeoIP.php # Landbepaling op basis van IP
+│ │ │ ├── Cache.php # File-based caching
+│ │ │ └── RateLimiter.php # Snelheidsbeperking per IP
│ │ ├── plugin/
│ │ │ ├── PluginManager.php # Plugin lader en beheer
│ │ │ └── CMSAPI.php # API voor plugin developers
@@ -124,7 +73,6 @@ codepress/
│ ├── lang/ # Taalbestanden
│ │ ├── nl.php # Nederlandse vertalingen
│ │ └── en.php # Engelse vertalingen
-│ ├── logs/ # CMS logs
│ ├── templates/ # Mustache templates
│ │ ├── layout.mustache # Hoofd layout (CSS, structuur)
│ │ ├── assets/ # Header, navigation, footer partials
@@ -148,14 +96,18 @@ codepress/
│ │ ├── content-new.php # Nieuwe content aanmaken
│ │ ├── content-dir-form.php # Map aanmaken/bewerken
│ │ ├── content-move-form.php # Content verplaatsen
-│ │ ├── config.php # Configuratie editor (JSON)
+│ │ ├── config.php # Configuratie editor
+│ │ ├── security.php # Beveiligingsinstellingen
+│ │ ├── statistics.php # Statistieken dashboard
│ │ ├── plugins.php # Plugin overzicht
│ │ ├── plugins-edit.php # Plugin PHP broncode editor
│ │ ├── plugins-new.php # Nieuwe plugin aanmaken
│ │ ├── plugin-config.php # Plugin configuratie editor
-│ │ ├── theme.php # Thema beheer (aanmaken, activeren, bewerken)
-│ │ ├── media.php # Media beheer (uploaden, verwijderen)
-│ │ └── users.php # Gebruikersbeheer
+│ │ ├── theme.php # Thema beheer
+│ │ ├── users.php # Gebruikersbeheer
+│ │ ├── logs.php # Log viewer
+│ │ ├── update.php # Systeem update
+│ │ └── guide.php # Handleiding
│ └── storage/logs/ # Admin logs
├── cli/ # CLI scripts & tests
├── content/ # Content bestanden
@@ -164,8 +116,7 @@ codepress/
│ └── ... # Overige content
├── plugins/ # CMS plugins
│ ├── HTMLBlock/ # Custom HTML blokken in sidebar
-│ ├── MQTTTracker/ # Real-time analytics en tracking
-│ └── test/ # Test plugin
+│ └── MQTTTracker/ # Real-time analytics en tracking
├── public/ # Web root
│ ├── index.php # Website entry point (media serving + CMS)
│ ├── admin.php # Admin entry point + routing
@@ -178,28 +129,174 @@ codepress/
├── themes/ # Thema definities
│ ├── default/ # Standaard thema
│ │ └── theme.json # Kleuren, hoogtes, achtergrond
-│ └── test/ # Test thema
-│ └── theme.json
+│ └── ... # Andere thema's
├── config.json # Site configuratie
-├── version.php # Versie informatie (1.6.0)
+├── version.php # Versie informatie
└── vendor/ # Composer dependencies
```
-## Configuratie
+---
-### Basis Configuratie
+## Content
-De site configuratie wordt beheerd via het **admin paneel** op `/admin/config`. Hier vind je een instellingenformulier met de volgende secties:
+### Content Structuur
+
+#### Bestandsstructuur
+
+```
+content/
+├── map1/
+│ ├── submap1/
+│ │ ├── nl.pagina1.md
+│ │ └── en.pagina1.md
+│ └── pagina3.html
+├── map2/
+│ └── pagina4.md
+├── index.md
+└── -assets/
+ ├── afbeelding.jpg
+ └── document.pdf
+```
+
+#### Bestandsnamen
+
+- Gebruik lowercase bestandsnamen
+- Geen spaties - gebruik `-` of `_`
+- Logische extensies - `.md`, `.php`, `.html`
+- Unieke namen - geen duplicaten
+- Language prefixes - `nl.bestand.md` en `en.bestand.md`
+
+#### Media Bestanden
+
+Media bestanden (afbeeldingen, PDFs, video, audio) kunnen in elke `content/` subdirectory worden geplaatst en worden geserveerd via:
+
+- **`/-media/pad/bestand.jpg`** - Media uit elke content subdirectory
+- **`/-assets/bestand.jpg`** - Backward compatibility (oude URLs)
+- Uploads via het admin paneel gaan naar `content/-assets/`
+
+### Content API (voor PHP content bestanden)
+
+PHP content bestanden (`.php` in de `content/` map) hebben toegang tot een `$api` variabele met de volgende methodes:
+
+#### Pagina's opvragen
+
+```php
+// Alle pagina's met titels ophalen
+$pages = $api->getAllPages();
+// Resultaat: ['index' => 'Home', 'over-ons' => 'Over ons', ...]
+
+// specifieke pagina inhoud ophalen
+$page = $api->getPage('over-ons');
+// $page['title'], $page['content'], $page['path'], $page['layout'], $page['metadata']
+
+// Controleren of een pagina bestaat
+if ($api->pageExists('contact')) {
+ // ...
+}
+```
+
+#### Navigatie
+
+```php
+// Menu structuur ophalen
+$menu = $api->getMenu();
+// Bevat geneste array met 'title', 'path', 'url', 'children'
+```
+
+#### Configuratie
+
+```php
+// Configuratie waarde opvragen (punt-notatie)
+$title = $api->getConfig('site_title');
+$lang = $api->getConfig('language.default');
+$seoDesc = $api->getConfig('seo.description', 'Standaard beschrijving');
+```
+
+#### Huidige pagina
+
+```php
+// Huidige pagina titel
+$pageTitle = $api->getCurrentPageTitle();
+
+// Huidige pagina pad
+$pagePath = $api->getCurrentPagePath();
+
+// Check of dit de homepage is
+if ($api->isHomepage()) {
+ echo 'Welkom!';
+}
+```
+
+#### URLs en taal
+
+```php
+// URL bouwen voor een pagina
+$url = $api->buildUrl('over-ons', 'nl');
+
+// Huidige taal
+$lang = $api->getCurrentLanguage();
+
+// Beschikbare talen
+$languages = $api->getAvailableLanguages();
+
+// Site titel
+$title = $api->getSiteTitle();
+```
+
+#### Vertalingen en zoeken
+
+```php
+// Vertaling ophalen
+$label = $api->t('home');
+
+// Zoekresultaten (als er gezocht wordt)
+if ($api->isSearching()) {
+ $results = $api->getSearchResults();
+}
+```
+
+#### Voorbeeld PHP content bestand
+
+```php
+---
+title: Pagina Overzicht
+layout: content
+---
+Alle Pagina's
+
+```
+
+---
+
+## Instellingen
+
+### Configuratie
+
+De site configuratie wordt beheerd via het **admin paneel** op `/admin/config`. Het formulier bevat de volgende secties:
- **Algemene instellingen** - Site titel en startpagina (dropdown met beschikbare pagina's)
- **Taal** - Standaard taal en beschikbare talen
- **SEO** - Meta beschrijving en keywords
- **Auteur** - Naam en website
- **Features** - Auto-link pagina's, zoekfunctie, breadcrumbs, versie tonen
+- **IP Uitsluitingen** - IP-adressen uitsluiten van statistieken en beveiligingscontroles
-De configuratie wordt opgeslagen in `config.json`. Je kunt dit bestand ook handmatig bewerken voor geavanceerde opties zoals `active_theme`, `content_dir` en `templates_dir`.
+De configuratie wordt opgeslagen in `config.json`. Je kunt dit bestand ook handmatig bewerken voor geavanceerde opties.
-### Voorbeeld `config.json`
+#### IP Uitsluitingen
+
+Onder **Configuratie** in het admin paneel vind je het veld "IP-adressen uitsluiten". IP's die hier worden ingevuld worden:
+
+- Niet opgenomen in de bezoekersstatistieken
+- Overgeslagen bij alle beveiligingscontroles (bot-detectie, rate limiting, IP blocklist)
+
+Dit is handig voor je eigen IP-adres of dat van interne monitoring tools.
+
+#### Voorbeeld `config.json`
```json
{
@@ -224,11 +321,25 @@ De configuratie wordt opgeslagen in `config.json`. Je kunt dit bestand ook handm
"auto_link_pages": true,
"search_enabled": true,
"breadcrumbs_enabled": true
+ },
+ "analytics": {
+ "enabled": true,
+ "excluded_ips": ["127.0.0.1", "::1"]
+ },
+ "security": {
+ "block_ai_bots": true,
+ "block_scrapers": true,
+ "block_empty_user_agent": true,
+ "rate_limit_enabled": true
}
}
```
-### Thema Configuratie (`themes//theme.json`)
+### Thema's
+
+Thema's worden beheerd via het admin paneel op `/admin/theme`. Je kunt thema's aanmaken, activeren, kleuren aanpassen, achtergrondafbeeldingen uploaden en verwijderen.
+
+#### Thema Configuratie (`themes//theme.json`)
```json
{
@@ -246,110 +357,20 @@ De configuratie wordt opgeslagen in `config.json`. Je kunt dit bestand ook handm
}
```
-Thema's kunnen worden beheerd via het admin paneel: aanmaken, activeren, kleuren aanpassen, achtergrondafbeelding uploaden en verwijderen.
+#### Een nieuw thema maken
-## Content Structuur
+1. Ga naar `/admin/theme`
+2. Voer een naam in en klik "Aanmaken"
+3. Pas kleuren, hoogtes en achtergrond aan
+4. Activeer het thema
-### Bestandsstructuur
+### Beveiliging
-```
-content/
-├── map1/
-│ ├── submap1/
-│ │ ├── nl.pagina1.md
-│ │ └── en.pagina1.md
-│ └── pagina3.html
-├── map2/
-│ └── pagina4.md
-├── index.md
-└── -assets/
- ├── afbeelding.jpg
- └── document.pdf
-```
+Beveiligingsinstellingen worden beheerd via `/admin/security`. Hier vind je:
-### Bestandsnamen
+#### Bot, AI & Scraper Blokkering
-- Gebruik lowercase bestandsnamen
-- Geen spaties - gebruik `-` of `_`
-- Logische extensies - `.md`, `.php`, `.html`
-- Unieke namen - geen duplicaten
-- Language prefixes - `nl.bestand.md` en `en.bestand.md`
-
-### Media Bestanden
-
-Media bestanden (afbeeldingen, PDFs, video, audio) kunnen in elke `content/` subdirectory worden geplaatst en worden geserveerd via:
-
-- **`/-media/pad/bestand.jpg`** - Media uit elke content subdirectory
-- **`/-assets/bestand.jpg`** - Backward compatibility (oude URLs)
-- Uploads via het admin paneel gaan naar `content/-assets/`
-
-## Admin Console
-
-### Toegang
-
-- **URL**: `/admin`
-- **Standaard login**: `admin` / `admin`
-
-### Routes
-
-| Route | Beschrijving |
-|---|---|
-| `login` | Inlogpagina |
-| `logout` | Uitloggen |
-| `dashboard` | Dashboard met statistieken |
-| `content` | Content overzicht (browsen, uploaden) |
-| `content-edit` | Content bewerken (CodeMirror editor) |
-| `content-new` | Nieuwe content aanmaken |
-| `content-delete` | Content verwijderen |
-| `content-move` | Content verplaatsen naar andere map |
-| `content-dir-form` | Map aanmaken of bewerken |
-| `content-dir-rename` | Map hernoemen |
-| `content-dir-create` | Map aanmaken (POST) |
-| `content-dir-delete` | Map verwijderen (alleen leeg) |
-| `config` | Configuratieformulier (titel, startpagina, taal, SEO, auteur, features) |
-| `security` | Beveiligingsinstellingen (bot/AI blokkering, rate limiting, IP block/allowlist) |
-| `statistics` | Bezoekersstatistieken met wereldkaart, landen, pagina's en GeoIP-instellingen |
-| `theme` | Thema beheer |
-| `plugins` | Plugin overzicht |
-| `plugins-new` | Nieuwe plugin aanmaken |
-| `plugins-edit` | Plugin PHP broncode bewerken |
-| `plugins-config` | Plugin configuratie bewerken |
-| `plugins-toggle` | Plugin in-/uitschakelen |
-| `plugins-delete` | Plugin verwijderen |
-| `media` | Media beheer (uploaden, verwijderen) |
-| `media-list` | JSON lijst van alle media (voor editor modal) |
-| `users` | Gebruikersbeheer |
-| `guide` | Handleiding (deze documentatie) |
-| `logs` | Log viewer (activiteiten + requests) |
-| `update` | Systeem update via Git pull (één-klik update) |
-
-### Editor Functionaliteit
-
-De content editor (`content-edit`, `content-new`) bevat:
-
-- **CodeMirror** syntax highlighting voor Markdown/PHP/HTML
-- **Toolbar** met knoppen voor: vet, cursief, kop, link, afbeelding, lijst, media invoegen
-- **Media browser modal** - Open via de "Media" knop om afbeeldingen/bestanden te selecteren
-- **Bestandsnaam hernoemen** - Inline filename input met extensie badge
-- **Layout selector** - Kies uit beschikbare layouts
-- **Plugin per-page zichtbaarheid** - Selecteer welke plugins op deze pagina tonen
-- **Upload en "Aanmaken" knoppen** zijn disabled totdat er input is
-- **"Annuleren" knop** (i.p.v. "Terug") bij ongewijzigde wijzigingen
-
-### Logging & Request Log
-
-De admin console houdt twee logs bij:
-
-- **Activiteiten log** (`admin/storage/logs/admin.log`) — admin acties zoals pagina's aanmaken, bewerken, verwijderen, plugin in/uitschakelen, configuratie wijzigen.
-- **Requests log** (`admin/storage/logs/requests.log`) — elke pageview op de website, met IP, pagina, domein, taal, user-agent en referrer.
-
-Beide logs zijn te bekijken en te downloaden via **`/admin/logs`** of via de sidebar link "Logs". Het dashboard toont de laatste 20 entries van elk log. Klik "Bekijk alle →" voor de volledige lijst, waar je ook kunt downloaden of wissen.
-
-### Bot & AI Blokkering
-
-Bij binnenkomende requests detecteert het systeem bekende bots en AI-crawlers op basis van de User-Agent header. Gedetecteerde bots krijgen een **403 Forbidden** en worden niet aan de CMS doorgegeven.
-
-Geblokkeerde categorieën:
+Bij binnenkomende requests detecteert het systeem bekende bots en AI-crawlers op basis van de User-Agent header. Gedetecteerde bots krijgen een **403 Forbidden**.
| Categorie | Voorbeelden |
|---|---|
@@ -357,122 +378,61 @@ Geblokkeerde categorieën:
| Search Engines | Googlebot, Bingbot, BingPreview, DuckDuckBot, YandexBot, Baiduspider |
| Scrapers | HTTrack, Scrapy, PhantomJS |
-## Templates
+#### Snelheidsbeperking (Rate Limiting)
-### Template Variabelen
+Voorkomt dat IP's de site overbelasten. Bij overschrijding wordt HTTP 429 geretourneerd.
-#### Site Info
-- `site_title` - Website titel
-- `author_name` - Auteur naam
-- `author_website` - Auteur website
-- `author_git` - Git repository link
+#### IP Lijsten
-#### Page Info
-- `page_title` - Pagina titel
-- `content` - Content (HTML)
-- `file_info` - Bestandsinformatie
-- `is_homepage` - Boolean: is dit de homepage?
+- **IP Whitelist** - IP's op de whitelist worden nooit geblokkeerd
+- **IP Blocklist** - IP's op de blocklist krijgen altijd een 403 Forbidden
-#### Navigation
-- `menu` - Navigatie menu
-- `breadcrumb` - Breadcrumb navigatie
-- `homepage` - Homepage link
+#### Dynamische robots.txt
-#### Theme (uit theme.json)
-- `header_color` - Header achtergrondkleur
-- `header_font_color` - Header tekstkleur
-- `header_height` - Header hoogte in pixels
-- `navigation_color` - Navigatie achtergrondkleur
-- `navigation_font_color` - Navigatie tekstkleur
-- `nav_height` - Navigatie hoogte in pixels
-- `sidebar_background` - Sidebar achtergrondkleur
-- `sidebar_border` - Sidebar randkleur
-- `background_image_css` - CSS voor achtergrondafbeelding
-- `background_image_opacity` - Dekking van de overlay
+Het systeem genereert automatisch een `robots.txt` op basis van je beveiligingsinstellingen, beschikbaar op `/robots.txt`.
-#### Language
-- `current_lang` - Huidige taal (nl/en)
-- `current_lang_upper` - Huidige taal (NL/EN)
-- `t_*` - Vertaalde strings
-
-### Layout Opties
-
-Gebruik YAML frontmatter om layout te selecteren:
-
-```yaml
---
-title: Mijn Pagina
-layout: sidebar-content
-plugins: HTMLBlock
+
+## Gegevens
+
+### Statistieken & Analytics
+
+Het statistieken dashboard is beschikbaar op `/admin/statistics` en biedt:
+
+- **KPI-kaarten** - Paginaweergaven, unieke bezoekers, mens/bot verhouding, geblokkeerde verzoeken
+- **Wereldkaart** - Visuele weergave van bezoekers per land met kleurintensiteit
+- **Landenlijst** - Top 25 landen met percentage
+- **Meest gelezen pagina's** - Top 25 pagina's
+- **Dagelijkse grafiek** - Staafdiagram van bezoekers per dag
+- **Verwijzende sites** - Top 15 referrers
+
+#### Periodes en export
+
+Filter op 7, 30, 90 dagen of alles. Exporteer data als CSV of JSON.
+
+#### GeoIP
+
+Landbepaling kan via drie bronnen:
+- **Lokaal (DB-IP Lite)** - Offline, privacy-vriendelijk, automatisch bijgewerkt
+- **MaxMind database (.mmdb)** - Eigen MMDB bestand
+- **Externe API** - Eigen API URL en sleutel
+
+### Logging
+
+De admin console houdt twee logs bij, te bekijken via `/admin/logs`:
+
+- **Activiteiten log** (`admin/storage/logs/admin.log`) — admin acties zoals pagina's aanmaken, bewerken, verwijderen, plugin in/uitschakelen, configuratie wijzigen.
+- **Requests log** (`admin/storage/logs/requests.log`) — elke pageview op de website, met IP, pagina, domein, taal, user-agent en referrer.
+
+Het dashboard toont de laatste 20 entries van elk log. Klik "Bekijk alle →" voor de volledige lijst, waar je ook kunt downloaden of wissen.
+
---
-```
-### Beschikbare Layouts
+## Systeem
-- `sidebar-content` - Sidebar links, content rechts (standaard)
-- `content` - Alleen content (volle breedte)
-- `sidebar` - Alleen sidebar
-- `content-sidebar` - Content links, sidebar rechts
-- `content-sidebar-reverse` - Content rechts, sidebar links
+### Plugin Systeem
-### Meta Data
-
-```yaml
----
-title: Pagina Titel
-layout: content-sidebar
-description: Pagina beschrijving
-author: Auteur Naam
-date: 2025-11-26
-plugins: HTMLBlock, MQTTTracker
----
-```
-
-## URL Structuur
-
-### Frontend Pagina URLs
-- **Home**: `/` of `/nl/`
-- **Pagina**: `/nl/map/pagina`
-- **Zoeken**: `?search=zoekterm` (via zoekformulier)
-- **Handleiding**: `/nl/guide`
-- **Taal wisselen**: `/nl` of `/en`
-
-### Media URLs
-- **Media**: `/-media/pad/naar/bestand.jpg` (uit elke content subdirectory)
-- **Assets**: `/-assets/bestand.jpg` (uit content/-assets/, backward compatible)
-
-### Admin URLs
-- **Admin**: `/admin`
-- **Dashboard**: `/admin/dashboard`
-- **Content bewerken**: `/admin/content-edit?file=pagina.md`
-- **Content nieuw**: `/admin/content-new?dir=map`
-- **Thema bewerken**: `/admin/theme?edit=themanaam`
-
-## SEO Optimalisatie
-
-### Meta Tags
-
-De CMS voegt automatisch meta tags toe:
-```html
-
-
-
-
-```
-
-### Security Headers
-
-```http
-X-Content-Type-Options: nosniff
-X-Frame-Options: SAMEORIGIN
-X-XSS-Protection: 1; mode=block
-Referrer-Policy: strict-origin-when-cross-origin
-Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; ...
-```
-
-## Plugin Systeem
-
-### Plugin Structuur
+#### Plugin Structuur
```
plugins/
@@ -484,13 +444,9 @@ plugins/
│ ├── MQTTTracker.php
│ ├── config.json
│ └── README.md
-└── test/
- ├── test.php
- ├── config.json
- └── README.md
```
-### Plugin Ontwikkeling
+#### Plugin Ontwikkeling
- **API toegang** via `CMSAPI` class - geeft toegang tot CMS configuratie, templates, menu
- **Sidebar content** met `getSidebarContent()` - retourneert HTML voor sidebar
@@ -499,7 +455,7 @@ plugins/
- **viewable** veld in config.json bepaalt of plugin zichtbaar is in sidebar
- **Per-page zichtbaarheid** - via de editor plugin selector per pagina
-### Plugin Boilerplate
+#### Plugin Boilerplate
```php
getAllPages();
-// Resultaat: ['index' => 'Home', 'over-ons' => 'Over ons', ...]
+### Update
-// specifieke pagina inhoud ophalen
-$page = $api->getPage('over-ons');
-// $page['title'], $page['content'], $page['path'], $page['layout'], $page['metadata']
+Via `/admin/update` kan het systeem in één klik worden bijgewerkt via Git pull. De pagina toont de huidige versie en git branch, en voert na bevestiging `git pull origin ` uit.
-// Controleren of een pagina bestaat
-if ($api->pageExists('contact')) {
- // ...
-}
-```
-
-### Navigatie
-
-```php
-// Menu structuur ophalen
-$menu = $api->getMenu();
-// Bevat geneste array met 'title', 'path', 'url', 'children'
-```
-
-### Configuratie
-
-```php
-// Configuratie waarde opvragen (punt-notatie)
-$title = $api->getConfig('site_title');
-$lang = $api->getConfig('language.default');
-$seoDesc = $api->getConfig('seo.description', 'Standaard beschrijving');
-```
-
-### Huidige pagina
-
-```php
-// Huidige pagina titel
-$pageTitle = $api->getCurrentPageTitle();
-
-// Huidige pagina pad
-$pagePath = $api->getCurrentPagePath();
-
-// Check of dit de homepage is
-if ($api->isHomepage()) {
- echo 'Welkom!';
-}
-```
-
-### URLs en taal
-
-```php
-// URL bouwen voor een pagina
-$url = $api->buildUrl('over-ons', 'nl');
-
-// Huidige taal
-$lang = $api->getCurrentLanguage();
-
-// Beschikbare talen
-$languages = $api->getAvailableLanguages();
-
-// Site titel
-$title = $api->getSiteTitle();
-```
-
-### Vertalingen en zoeken
-
-```php
-// Vertaling ophalen
-$label = $api->t('home');
-
-// Zoekresultaten (als er gezocht wordt)
-if ($api->isSearching()) {
- $results = $api->getSearchResults();
-}
-```
-
-### Voorbeeld PHP content bestand
-
-```php
---
-title: Pagina Overzicht
-layout: content
+
+## Handleiding (in Admin)
+
+Deze handleiding is ook ingebouwd in het admin paneel via `/admin/guide`, met ondersteuning voor Nederlands en Engels.
+
+---
+
+## Overig
+
+### Templates
+
+#### Template Variabelen
+
+**Site Info** - `site_title`, `author_name`, `author_website`, `author_git`
+
+**Page Info** - `page_title`, `content`, `file_info`, `is_homepage`
+
+**Navigation** - `menu`, `breadcrumb`, `homepage`
+
+**Theme (uit theme.json)** - `header_color`, `header_font_color`, `header_height`, `navigation_color`, `navigation_font_color`, `nav_height`, `sidebar_background`, `sidebar_border`, `background_image_css`, `background_image_opacity`
+
+**Language** - `current_lang`, `current_lang_upper`, `t_*` (vertaalde strings)
+
+#### Layout Opties
+
+Gebruik YAML frontmatter om layout te selecteren:
+
+```yaml
+---
+title: Mijn Pagina
+layout: sidebar-content
+plugins: HTMLBlock
---
-Alle Pagina's
-
```
-## Analytics & Tracking
+#### Beschikbare Layouts
-### MQTT Tracker
+- `sidebar-content` - Sidebar links, content rechts (standaard)
+- `content` - Alleen content (volle breedte)
+- `sidebar` - Alleen sidebar
+- `content-sidebar` - Content links, sidebar rechts
+- `content-sidebar-reverse` - Content rechts, sidebar links
-- Real-time page tracking via MQTT broker
-- Session management
-- Business Intelligence data
-- Privacy aware (GDPR compliant)
-- MQTT integration voor dashboards
-- Optioneel: visitor tracking, page views, performance metrics, user flows
+#### Meta Data
-## Veelgestelde Vragen
+```yaml
+---
+title: Pagina Titel
+layout: content-sidebar
+description: Pagina beschrijving
+author: Auteur Naam
+date: 2025-11-26
+plugins: HTMLBlock, MQTTTracker
+---
+```
-### Hoe stel ik de homepage in?
+### URL Structuur
+
+#### Frontend Pagina URLs
+- **Home**: `/` of `/nl/`
+- **Pagina**: `/nl/map/pagina`
+- **Zoeken**: `?search=zoekterm` (via zoekformulier)
+
+#### Media URLs
+- **Media**: `/-media/pad/naar/bestand.jpg` (uit elke content subdirectory)
+- **Assets**: `/-assets/bestand.jpg` (uit content/-assets/, backward compatible)
+
+#### Admin URLs
+- **Admin**: `/admin`
+- **Dashboard**: `/admin/dashboard`
+- **Content**: `/admin/content`
+- **Configuratie**: `/admin/config`
+- **Beveiliging**: `/admin/security`
+- **Statistieken**: `/admin/statistics`
+- **Thema**: `/admin/theme`
+- **Plugins**: `/admin/plugins`
+- **Gebruikers**: `/admin/users`
+- **Logs**: `/admin/logs`
+- **Update**: `/admin/update`
+- **Handleiding**: `/admin/guide`
+
+### SEO Optimalisatie
+
+#### Meta Tags
+
+De CMS voegt automatisch meta tags toe:
+```html
+
+
+
+
+```
+
+#### Security Headers
+
+```http
+X-Content-Type-Options: nosniff
+X-Frame-Options: SAMEORIGIN
+X-XSS-Protection: 1; mode=block
+Referrer-Policy: strict-origin-when-cross-origin
+Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; ...
+```
+
+### Veelgestelde Vragen
+
+#### Hoe stel ik de homepage in?
1. Ga naar **Configuratie** in het admin paneel (`/admin/config`)
2. Selecteer de gewenste pagina in het **Standaard/startpagina** dropdown
-3. Klik op **Configuratie opslaan
+3. Klik op **Configuratie opslaan**
-### Hoe werkt de navigatie?
+#### Hoe werkt de navigatie?
- **Mappen** worden dropdown menus
- **Bestanden** worden directe links
- **Sub-mappen** worden geneste dropdowns
- Alleen bestanden zonder taalprefix tonen in het menu
-### Hoe voeg ik nieuwe content toe?
+#### Hoe voeg ik nieuwe content toe?
1. Via het admin paneel: `/admin/content-new`
2. Of upload bestanden naar de `content/` map
3. Organiseer in logische mappen
4. Gebruik juiste bestandsnamen en extensies
-### Hoe verplaats ik een bestand of map?
+#### Hoe verplaats ik een bestand of map?
1. Ga naar `/admin/content`
2. Klik op "Verplaatsen" naast het item
3. Selecteer de doelmap
4. Bevestig de verplaatsing
-### Hoe maak ik een nieuw thema?
+#### Hoe sluit ik mijn eigen IP uit van statistieken?
-1. Ga naar `/admin/theme`
-2. Voer een naam in en klik "Aanmaken"
-3. Pas kleuren, hoogtes en achtergrond aan
-4. Activeer het thema
+1. Ga naar **Configuratie** in het admin paneel (`/admin/config`)
+2. Scroll naar het veld "IP-adressen uitsluiten"
+3. Voer je IP-adres in (één per regel)
+4. Klik op **Configuratie opslaan**
-## Troubleshooting
+### Troubleshooting
-### Pagina niet gevonden (404)
+#### Pagina niet gevonden (404)
1. Controleer bestandsnaam en pad
2. Controleer bestandsextensie (.md, .php, .html)
3. Controleer permissies van bestanden
4. Controleer of het bestand de juiste taalprefix heeft (`nl.` of `en.`)
-### Navigatie niet bijgewerkt
+#### Navigatie niet bijgewerkt
1. Herlaad de pagina
2. Controleer content map structuur
3. Controleer bestandsnamen (geen spaties)
4. Bestanden met taalprefix worden alleen getoond in de juiste taalmodus
-### Admin paneel niet toegankelijk
+#### Admin paneel niet toegankelijk
1. Controleer of de sessie nog geldig is
2. Bij lockout: wacht 15 minuten of wis `admin/config/admin.json` lockout data
3. Controleer CSRF token (herlaad de pagina)
-## Beveiliging
-
-- **CSRF-bescherming** via tokens op alle admin formulieren
-- **Brute-force lockout** na 5 mislukte pogingen (15 minuten blokkade)
-- **Bcrypt password hashing** voor gebruikerswachtwoorden
-- **Path traversal preventie** via `realpath()` en prefix-controle
-- **Directe content toegang** geblokkeerd (403 Forbidden)
-- **Security headers** voor alle pagina's
-- **PHP uitvoering** in content directory geblokkeerd
-- **Bestandsupload restricties** op toegestane extensies
-
## Versie
-Huidige versie: **1.6.0** (codenaam: "Enhanced")
-Releasedatum: 2026-07-14
+Huidige versie: **1.9.1**
+Release datum: 2026-07-29
## Ondersteuning
diff --git a/version.php b/version.php
index 22b31ac..1e4cc04 100644
--- a/version.php
+++ b/version.php
@@ -6,12 +6,20 @@
*/
return [
- 'version' => '1.9.1',
+ 'version' => '1.9.2',
'release_date' => '2026-07-29',
'codename' => 'Atlas',
'status' => 'stable',
'changelog' => [
+ '1.9.2' => [
+ 'date' => '2026-07-29',
+ 'changes' => [
+ 'Admin sidebar restructured into logical groups: Algemeen, Content, Instellingen, Gegevens, Systeem, Help, Links',
+ 'IP uitsluitingen toegevoegd aan configuratie: IP's niet meetellen in statistieken en overslaan bij beveiligingscontroles',
+ 'Guide (NL/EN) volledig herschreven metzelfde logische indeling als sidebar',
+ ]
+ ],
'1.9.1' => [
'date' => '2026-07-29',
'changes' => [