Bot Protection Plugin for Piwigo – Dokumentation - Version 2.4.2

BYB | Block You Bots „Stay human. I block the rest.“

www.blockyoubots.com

Copyright © 2025 Olaf Schneider. All rights reserved.

Vor einem Update/Upgrade von Piwigo oder BYB Bot Protection solltest du unbedingt den Ordner /_data/bot_protection/ sichern.

Beschreibung & Struktur

Dieses Plugin schützt deine gesamte Piwigo-Webseite vor unerwünschten Bots und direkten Zugriffen. Es blockiert bekannte User-Agents, verhindert Aufrufe ohne Referer und protokolliert blockierte Zugriffe.

Struktur:

root/
/_data/bot_protection/
├── archiv/
│ └── archive_index.json → Dieses Modul archiviert automatisch große Logdateien, damit dein /_data-Ordner sauber und schnell bleibt.
├── cache/
│ └── news_data.json → Ticker-Cache
├── config/
│ └── settings.json → Benutzereinstellungen (update-sicher; Ticker, all_requests, emergency_off, usw.)
├── .htaccess → Schutzdatei: verhindert direkten Webzugriff auf diese Daten
├── blocked_bots.txt → Liste blockierter User-Agents (Blacklist)
├── blocked_folders.txt → Liste blockierter Ordnerpfade
├── blocked_ips.txt → Manuell blockierte IP-Adressen
├── bot_limits.json → Zugriffslimits pro Bot und Tag (whitelistete Bots)
├── bot_log.txt → Logdatei für blockierte Zugriffe
├── bot_stats.json → Statistik blockierter Bots (nach User-Agent)
├── bp_archive.json → Archivdatei: gespeicherte Statistik-Snapshots (Besucher, Totals, usw.)
├── bp_archive_bots.json → Archivdatei: gespeicherte Bot-Snapshots/Statistiken (Bots, Limits, usw.)
├── exploit_block_log.txt → Logdatei für Exploit-/Parameter-Blocking
├── exploit_stats.json → Statistik für Exploit-Erkennungen
├── flood_bans.json → Aktive Sperren durch Flutschutz
├── flood_map.json → Verlauf/Map erkannter Flood-Angriffe
├── flood_settings.json → Konfiguration des Flutschutzes (Limits, Intervalle)
├── ip_log.txt → Übersicht aktiv blockierter IPs
├── log_all_requests.txt → Vollständiges Request-Log (falls aktiviert)
├── seed_version.txt → Interner Versions-/Seed-Marker
├── temp_ip_blocks.json → Temporäre IP-Sperren (mit Ablauf)
├── visitor_ip_gate.json → Visitor-IP-Gate / Anti-Flood-Hilfsdaten
├── visitor_stats.json → Besucherzähler & tägliche Statistik
├── whitelist_paths.txt → Liste explizit erlaubter Pfade
├── whitelist_stats.json → Nutzungsstatistik erlaubter Bots
├── whitelisted_bots.txt → Liste erlaubter User-Agents (Whitelist)
├── whitelisted_ips.txt → Liste erlaubter IP-Adressen
└── whitelisted_uas.json → Whitelist-UA-Patterns/Konfig (JSON)

/plugins/bot_protection/
├── admin.php → Einstiegspunkt für das Admin-Interface
├── assets/
│ ├── css/
│ │ └── style.css → Plugin-Layout und Tab-Styling
│ └── js/
│ └── chart.js → JavaScript-Bibliothek für Charts (Chart.js)
├── include/
│ ├── bot_protection.php → Schutzlogik (Bot-Erkennung & Blocking)
│ ├── bp_logger.php → Zentrale Logging-Hilfe (sicheres File-Logging, Formate, Levels)
│ ├── bp_util.php → Utilities/Helper (Files, Paths, Parser, usw.)
│ ├── function_app.php → App-Bootstrap-Helper (Common Init, Konstanten, Glue-Code)
│ ├── function_archive.php → Archiv-Funktionen (Snapshots lesen/schreiben, Aggregation, Cleanup)
│ ├── function_bots.php → Bot-Funktionen (Erkennung, Limits, Regeln)
│ ├── function_exploit.php → Exploit-Erkennung (Path Probes / Exploit-Versuche)
│ ├── function_ip.php → IP-Helper (validieren, normalisieren, Ranges, usw.)
│ ├── function_log_archiver.php → Log-Rotation/Archivierung (wöchentliches Archiv, Index, Purge)
│ └── visitor_counter.php → Besucherzähler mit IP-Hashing
├── language/
│ ├── de_DE/plugin.lang.php → Deutsch
│ ├── en_UK/plugin.lang.php → Englisch
│ ├── es_ES/plugin.lang.php → Spanisch
│ ├── fr_FR/plugin.lang.php → Französisch
│ ├── it_IT/plugin.lang.php → Italienisch
│ ├── ja_JP/plugin.lang.php → Japanisch
│ ├── nl_NL/plugin.lang.php → Niederländisch
│ └── pl_PL/plugin.lang.php → Polnisch
├── main.inc.php → Initialisierung & zentraler Einstiegspunkt
├── admin/
│ └── bot_protection_admin.php → Verarbeitung & Anzeige im Adminbereich
└── template/
├── header.tpl → Header – Smarty-Wrapper für die Admin-UI (Tabs + Content)
├── bp_dashboard_link.tpl → Icon/Badge fürs Piwigo-Dashboard mit Link zu BYB Bot Protection
└── tabs/
├── tab0.tpl → Dashboard
├── tab1.tpl → Botliste
├── tab2.tpl → Logdatei / Log-Analyse
├── tab3.tpl → Bot-Statistik
├── tab4.tpl → Whitelist & Bot-Limits
├── tab5.tpl → Besucher
├── tab6.tpl → Temporäre Sperre (manuell hinzufügen)
├── tab7.tpl → BYB .htaccess-Bereich
├── tab8.tpl → Debug-Informationen
├── tab9.tpl → Feedback & Bug Report
├── tab10.tpl → Archiv
├── tab11.tpl → Blockierte Zugriffe
├── tab12.tpl → Protokollierung aller Anfragen
├── tab13.tpl → robots.txt-Überwachung
├── tab14.tpl → Exploit-Versuche
├── tab15.tpl → Erlaubte Bot-Zugriffsregeln
├── tab16.tpl → Erlaubte IP-Adressen
├── tab17.tpl → Pfad-Whitelist
├── tab18.tpl → User-Agent-Whitelist
├── tab19.tpl → rDNS-Whitelist
├── tab20.tpl → Flutschutz
├── tab21.tpl → Blockierte IPs
├── tab22.tpl → Blockierte IP-Adressen
├── tab23.tpl → Zeitzone (Bot Protection)
├── tab24.tpl → News-Ticker
└── tab25.tpl → Log-Archiv
    

Funktionen:

Zugriff im Adminbereich:

Nach der Aktivierung findest du den Menüpunkt unter: Plugins → Bot Protection

Before updating/upgrading Piwigo or BYB Bot Protection, be sure to back up the /_data/bot_protection/ folder.

Description & Structure

This plugin protects your entire Piwigo website from unwanted bots and direct access. It blocks known User-Agents, prevents requests without a referer, and logs all blocked attempts.

Structure:

root/
/_data/bot_protection/
├── archiv/
│ └── archive_index.json → This module automatically archives large log files to keep your /_data folder clean and fast.
├── cache/
│ └── news_data.json → Ticker cache
├── config/
│ └── settings.json → User settings (upgrade-safe; ticker, all_requests, emergency_off, etc.)
├── .htaccess → Protection file: prevents direct web access to this data
├── blocked_bots.txt → List of blocked User-Agents (blacklist)
├── blocked_folders.txt → List of blocked folder paths
├── blocked_ips.txt → Manually blocked IP addresses
├── bot_limits.json → Access limits per bot per day (whitelisted bots)
├── bot_log.txt → Log file for blocked requests
├── bot_stats.json → Statistics of blocked bots (by User-Agent)
├── bp_archive.json → Archive file: stored statistics snapshots (visitors, totals, etc.)
├── bp_archive_bots.json → Archive file: stored bot snapshots/statistics (bots, limits, etc.)
├── exploit_block_log.txt → Log file for exploit / parameter blocking
├── exploit_stats.json → Statistics for exploit detections
├── flood_bans.json → Active bans created by flood protection
├── flood_map.json → History/map of detected flood attacks
├── flood_settings.json → Configuration of flood protection (limits, intervals)
├── ip_log.txt → Overview of IPs that have been actively blocked
├── log_all_requests.txt → Full request log (if enabled)
├── seed_version.txt → Internal version/seed marker
├── temp_ip_blocks.json → Temporary IP blocks (with expiry)
├── visitor_ip_gate.json → Visitor IP gate / anti-flood helper data
├── visitor_stats.json → Visitor counter & daily statistics
├── whitelist_paths.txt → List of explicitly allowed paths
├── whitelist_stats.json → Usage statistics of allowed bots
├── whitelisted_bots.txt → List of allowed User-Agents (whitelist)
├── whitelisted_ips.txt → List of allowed IP addresses
└── whitelisted_uas.json → Whitelisted UA patterns/config (JSON)

/plugins/bot_protection/
├── admin.php → Entry point for the admin interface
├── assets/
│ ├── css/
│ │ └── style.css → Plugin layout and tab styling
│ └── js/
│ └── chart.js → JavaScript library for charts (Chart.js)
├── include/
│ ├── bot_protection.php → Protection logic (bot detection & blocking)
│ ├── bp_logger.php → Central logging helper (safe file logging, formats, levels)
│ ├── bp_util.php → Utilities/Helpers (files, paths, parser, etc.)
│ ├── function_app.php → App bootstrap helpers (common init, shared constants, glue code)
│ ├── function_archive.php → Archive functions (read/write snapshots, aggregation, cleanup)
│ ├── function_bots.php → Bot functions (detection, limits, rules)
│ ├── function_exploit.php → Exploit detection helpers (path probes / exploit attempts)
│ ├── function_ip.php → IP helper functions (validate, normalize, ranges, etc.)
│ ├── function_log_archiver.php → Log rotation/archiving (weekly archive, index updates, purge)
│ └── visitor_counter.php → Visitor counter with IP hashing
├── language/
│ ├── de_DE/plugin.lang.php → German
│ ├── en_UK/plugin.lang.php → English
│ ├── es_ES/plugin.lang.php → Spanish
│ ├── fr_FR/plugin.lang.php → French
│ ├── it_IT/plugin.lang.php → Italian
│ ├── ja_JP/plugin.lang.php → Japanese
│ ├── nl_NL/plugin.lang.php → Dutch
│ └── pl_PL/plugin.lang.php → Polish
├── main.inc.php → Initialization & central entry point
├── admin/
│ └── bot_protection_admin.php → Processing & display in the admin area
└── template/
├── header.tpl → Header - Smarty wrapper for the admin UI (tabs + content)
├── bp_dashboard_link.tpl → Icon/badge for Piwigo dashboard with link to BYB Bot Protection
└── tabs/
├── tab0.tpl → Dashboard
├── tab1.tpl → Bot list
├── tab2.tpl → Log file / Log analysis
├── tab3.tpl → Bot statistics
├── tab4.tpl → Whitelist & bot limits
├── tab5.tpl → Visitors
├── tab6.tpl → Temporary block (manual add)
├── tab7.tpl → BYB .htaccess area
├── tab8.tpl → Debug information
├── tab9.tpl → Feedback & Bug Report
├── tab10.tpl → Archive
├── tab11.tpl → Blocked requests
├── tab12.tpl → Logging all requests
├── tab13.tpl → robots.txt monitoring
├── tab14.tpl → Exploit attempts
├── tab15.tpl → Allowed bot access rules
├── tab16.tpl → Allowed IP addresses
├── tab17.tpl → Path whitelist
├── tab18.tpl → User-Agent whitelist
├── tab19.tpl → rDNS whitelist
├── tab20.tpl → Flood protection
├── tab21.tpl → Blocked IPs
├── tab22.tpl → Blocked IP addresses
├── tab23.tpl → Timezone (Bot Protection)
├── tab24.tpl → News ticker
└── tab25.tpl → Log archive
    

Features:

Access in admin panel:

After activation, find the menu entry under: Plugins → Bot Protection

Avant toute mise à jour/mise à niveau de Piwigo ou de BYB Bot Protection, sauvegardez impérativement le dossier /_data/bot_protection/.

Description & Structure

Ce plugin protège l’ensemble de votre site Piwigo contre les robots indésirables et les accès directs. Il bloque les agents utilisateurs connus, empêche les requêtes sans référent et enregistre toutes les tentatives bloquées.

Structure :

root/
/_data/bot_protection/
├── archiv/
│ └── archive_index.json → Ce module archive automatiquement les gros fichiers de logs afin de garder votre dossier /_data propre et rapide.
├── cache/
│ └── news_data.json → Cache du ticker
├── config/
│ └── settings.json → Paramètres utilisateur (sûr lors des mises à jour ; ticker, all_requests, emergency_off, etc.)
├── .htaccess → Fichier de protection : empêche l’accès web direct à ces données
├── blocked_bots.txt → Liste des User-Agents bloqués (liste noire)
├── blocked_folders.txt → Liste des chemins de dossiers bloqués
├── blocked_ips.txt → Adresses IP bloquées manuellement
├── bot_limits.json → Limites d’accès par bot et par jour (bots en liste blanche)
├── bot_log.txt → Fichier de log des requêtes bloquées
├── bot_stats.json → Statistiques des bots bloqués (par User-Agent)
├── bp_archive.json → Fichier d’archive : instantanés de statistiques stockés (visiteurs, totaux, etc.)
├── bp_archive_bots.json → Fichier d’archive : instantanés/statistiques bots stockés (bots, limites, etc.)
├── exploit_block_log.txt → Log de blocage des exploits / paramètres
├── exploit_stats.json → Statistiques des détections d’exploits
├── flood_bans.json → Bannissements actifs créés par la protection anti-flood
├── flood_map.json → Historique/carte des attaques flood détectées
├── flood_settings.json → Configuration de la protection anti-flood (limites, intervalles)
├── ip_log.txt → Aperçu des IP activement bloquées
├── log_all_requests.txt → Log complet des requêtes (si activé)
├── seed_version.txt → Marqueur interne de version/seed
├── temp_ip_blocks.json → Blocages IP temporaires (avec expiration)
├── visitor_ip_gate.json → Données auxiliaires gate IP visiteurs / anti-flood
├── visitor_stats.json → Compteur visiteurs & statistiques quotidiennes
├── whitelist_paths.txt → Liste de chemins explicitement autorisés
├── whitelist_stats.json → Statistiques d’utilisation des bots autorisés
├── whitelisted_bots.txt → Liste des User-Agents autorisés (liste blanche)
├── whitelisted_ips.txt → Liste des adresses IP autorisées
└── whitelisted_uas.json → Motifs/config UA en liste blanche (JSON)

/plugins/bot_protection/
├── admin.php → Point d’entrée de l’interface d’administration
├── assets/
│ ├── css/
│ │ └── style.css → Mise en page du plugin et style des onglets
│ └── js/
│ └── chart.js → Bibliothèque JavaScript pour graphiques (Chart.js)
├── include/
│ ├── bot_protection.php → Logique de protection (détection & blocage des bots)
│ ├── bp_logger.php → Helper central de logs (logs fichiers sûrs, formats, niveaux)
│ ├── bp_util.php → Utilitaires/Helpers (fichiers, chemins, parseur, etc.)
│ ├── function_app.php → Helpers de démarrage (init commun, constantes, glue code)
│ ├── function_archive.php → Fonctions d’archive (lire/écrire des snapshots, agrégation, nettoyage)
│ ├── function_bots.php → Fonctions bots (détection, limites, règles)
│ ├── function_exploit.php → Helpers détection d’exploits (path probes / tentatives d’exploit)
│ ├── function_ip.php → Helpers IP (valider, normaliser, plages, etc.)
│ ├── function_log_archiver.php → Rotation/archivage des logs (archive hebdo, index, purge)
│ └── visitor_counter.php → Compteur visiteurs avec hachage IP
├── language/
│ ├── de_DE/plugin.lang.php → Allemand
│ ├── en_UK/plugin.lang.php → Anglais
│ ├── es_ES/plugin.lang.php → Espagnol
│ ├── fr_FR/plugin.lang.php → Français
│ ├── it_IT/plugin.lang.php → Italien
│ ├── ja_JP/plugin.lang.php → Japonais
│ ├── nl_NL/plugin.lang.php → Néerlandais
│ └── pl_PL/plugin.lang.php → Polonais
├── main.inc.php → Initialisation & point d’entrée central
├── admin/
│ └── bot_protection_admin.php → Traitement & affichage dans l’admin
└── template/
├── header.tpl → En-tête - wrapper Smarty pour l’UI admin (onglets + contenu)
├── bp_dashboard_link.tpl → Icône/badge pour le dashboard Piwigo avec lien vers BYB Bot Protection
└── tabs/
├── tab0.tpl → Tableau de bord
├── tab1.tpl → Liste des bots
├── tab2.tpl → Fichier log / analyse des logs
├── tab3.tpl → Statistiques bots
├── tab4.tpl → Liste blanche & limites bots
├── tab5.tpl → Visiteurs
├── tab6.tpl → Blocage temporaire (ajout manuel)
├── tab7.tpl → Zone BYB .htaccess
├── tab8.tpl → Infos debug
├── tab9.tpl → Feedback & rapport de bug
├── tab10.tpl → Archive
├── tab11.tpl → Requêtes bloquées
├── tab12.tpl → Journalisation de toutes les requêtes
├── tab13.tpl → Surveillance robots.txt
├── tab14.tpl → Tentatives d’exploit
├── tab15.tpl → Règles d’accès bots autorisés
├── tab16.tpl → Adresses IP autorisées
├── tab17.tpl → Liste blanche des chemins
├── tab18.tpl → Liste blanche User-Agent
├── tab19.tpl → Liste blanche rDNS
├── tab20.tpl → Protection anti-flood
├── tab21.tpl → IP bloquées
├── tab22.tpl → Adresses IP bloquées
├── tab23.tpl → Fuseau horaire (Bot Protection)
├── tab24.tpl → Ticker news
└── tab25.tpl → Archive des logs
    

⚙️ Fonctionnalités :

Accès depuis l’interface d’administration :

Après activation, retrouvez l’entrée de menu sous : Plugins → Bot Protection

Antes de una actualización/upgrade de Piwigo o BYB Bot Protection, asegúrate de respaldar la carpeta /_data/bot_protection/.

Descripción y estructura

Este plugin protege todo tu sitio web de Piwigo frente a bots no deseados y accesos directos. Bloquea agentes de usuario conocidos, evita solicitudes sin referente (Referer) y registra todos los intentos bloqueados.

Estructura:

root/
/_data/bot_protection/
├── archiv/
│ └── archive_index.json → Este módulo archiva automáticamente los archivos de registro grandes para mantener tu carpeta /_data limpia y rápida.
├── cache/
│ └── news_data.json → Caché del ticker
├── config/
│ └── settings.json → Ajustes del usuario (seguros para actualizaciones; ticker, all_requests, emergency_off, etc.)
├── .htaccess → Archivo de protección: impide el acceso web directo a estos datos
├── blocked_bots.txt → Lista de User-Agents bloqueados (lista negra)
├── blocked_folders.txt → Lista de rutas de carpetas bloqueadas
├── blocked_ips.txt → Direcciones IP bloqueadas manualmente
├── bot_limits.json → Límites de acceso por bot y día (bots en whitelist)
├── bot_log.txt → Archivo de registro de solicitudes bloqueadas
├── bot_stats.json → Estadísticas de bots bloqueados (por User-Agent)
├── bp_archive.json → Archivo de archivo: instantáneas de estadísticas guardadas (visitantes, totales, etc.)
├── bp_archive_bots.json → Archivo de archivo: instantáneas/estadísticas de bots guardadas (bots, límites, etc.)
├── exploit_block_log.txt → Registro de bloqueo de exploits / parámetros
├── exploit_stats.json → Estadísticas de detecciones de exploit
├── flood_bans.json → Bloqueos activos creados por la protección anti-flood
├── flood_map.json → Historial/mapa de ataques flood detectados
├── flood_settings.json → Configuración de la protección anti-flood (límites, intervalos)
├── ip_log.txt → Resumen de IPs bloqueadas activamente
├── log_all_requests.txt → Registro completo de solicitudes (si está habilitado)
├── seed_version.txt → Marcador interno de versión/seed
├── temp_ip_blocks.json → Bloqueos temporales de IP (con caducidad)
├── visitor_ip_gate.json → Datos auxiliares del gate de IP de visitantes / anti-flood
├── visitor_stats.json → Contador de visitantes y estadísticas diarias
├── whitelist_paths.txt → Lista de rutas permitidas explícitamente
├── whitelist_stats.json → Estadísticas de uso de bots permitidos
├── whitelisted_bots.txt → Lista de User-Agents permitidos (whitelist)
├── whitelisted_ips.txt → Lista de direcciones IP permitidas
└── whitelisted_uas.json → Patrones/configuración de UA en whitelist (JSON)

/plugins/bot_protection/
├── admin.php → Punto de entrada para la interfaz de administración
├── assets/
│ ├── css/
│ │ └── style.css → Diseño del plugin y estilo de pestañas
│ └── js/
│ └── chart.js → Biblioteca JavaScript para gráficos (Chart.js)
├── include/
│ ├── bot_protection.php → Lógica de protección (detección y bloqueo de bots)
│ ├── bp_logger.php → Ayudante central de logging (logging seguro, formatos, niveles)
│ ├── bp_util.php → Utilidades/Helpers (archivos, rutas, parser, etc.)
│ ├── function_app.php → Helpers de arranque de la app (init común, constantes, glue code)
│ ├── function_archive.php → Funciones de archivo (leer/escribir snapshots, agregación, limpieza)
│ ├── function_bots.php → Funciones de bots (detección, límites, reglas)
│ ├── function_exploit.php → Helpers de detección de exploits (path probes / intentos de exploit)
│ ├── function_ip.php → Helpers de IP (validar, normalizar, rangos, etc.)
│ ├── function_log_archiver.php → Rotación/archivado de logs (archivo semanal, índice, purga)
│ └── visitor_counter.php → Contador de visitantes con hash de IP
├── language/
│ ├── de_DE/plugin.lang.php → Alemán
│ ├── en_UK/plugin.lang.php → Inglés
│ ├── es_ES/plugin.lang.php → Español
│ ├── fr_FR/plugin.lang.php → Francés
│ ├── it_IT/plugin.lang.php → Italiano
│ ├── ja_JP/plugin.lang.php → Japonés
│ ├── nl_NL/plugin.lang.php → Neerlandés
│ └── pl_PL/plugin.lang.php → Polaco
├── main.inc.php → Inicialización y punto de entrada central
├── admin/
│ └── bot_protection_admin.php → Procesamiento y visualización en el área de administración
└── template/
├── header.tpl → Header - wrapper Smarty para la UI de admin (tabs + contenido)
├── bp_dashboard_link.tpl → Icono/badge para el dashboard de Piwigo con enlace a BYB Bot Protection
└── tabs/
├── tab0.tpl → Panel (Dashboard)
├── tab1.tpl → Lista de bots
├── tab2.tpl → Log / análisis de logs
├── tab3.tpl → Estadísticas de bots
├── tab4.tpl → Whitelist y límites de bots
├── tab5.tpl → Visitantes
├── tab6.tpl → Bloqueo temporal (añadir manualmente)
├── tab7.tpl → Área BYB .htaccess
├── tab8.tpl → Información de depuración
├── tab9.tpl → Feedback e informe de errores
├── tab10.tpl → Archivo
├── tab11.tpl → Solicitudes bloqueadas
├── tab12.tpl → Registro de todas las solicitudes
├── tab13.tpl → Monitorización de robots.txt
├── tab14.tpl → Intentos de exploit
├── tab15.tpl → Reglas de acceso permitido para bots
├── tab16.tpl → Direcciones IP permitidas
├── tab17.tpl → Whitelist de rutas
├── tab18.tpl → Whitelist de User-Agent
├── tab19.tpl → Whitelist de rDNS
├── tab20.tpl → Protección anti-flood
├── tab21.tpl → IPs bloqueadas
├── tab22.tpl → Direcciones IP bloqueadas
├── tab23.tpl → Zona horaria (Bot Protection)
├── tab24.tpl → Ticker de noticias
└── tab25.tpl → Archivo de logs
    

Funciones:

Acceso en el panel de administración:

Tras la activación, encontrarás la entrada de menú en: Plugins → Bot Protection

Prima di un update/upgrade di Piwigo o BYB Bot Protection, assicurati di eseguire il backup della cartella /_data/bot_protection/.

Descrizione & Struttura

Questo plugin protegge l’intero sito Piwigo da bot indesiderati e accessi diretti. Blocca User-Agent noti, evita richieste senza referer e registra tutti i tentativi bloccati.

Struttura:

root/
/_data/bot_protection/
├── archiv/
│ └── archive_index.json → Questo modulo archivia automaticamente i file di log grandi per mantenere la cartella /_data pulita e veloce.
├── cache/
│ └── news_data.json → Cache del ticker
├── config/
│ └── settings.json → Impostazioni utente (sicure per gli aggiornamenti; ticker, all_requests, emergency_off, ecc.)
├── .htaccess → File di protezione: impedisce l’accesso web diretto a questi dati
├── blocked_bots.txt → Elenco degli User-Agent bloccati (blacklist)
├── blocked_folders.txt → Elenco dei percorsi di cartelle bloccati
├── blocked_ips.txt → Indirizzi IP bloccati manualmente
├── bot_limits.json → Limiti di accesso per bot al giorno (bot in whitelist)
├── bot_log.txt → File di log per le richieste bloccate
├── bot_stats.json → Statistiche dei bot bloccati (per User-Agent)
├── bp_archive.json → File di archivio: snapshot statistiche salvate (visitatori, totali, ecc.)
├── bp_archive_bots.json → File di archivio: snapshot/statistiche bot salvate (bot, limiti, ecc.)
├── exploit_block_log.txt → Log per blocco exploit / parametri
├── exploit_stats.json → Statistiche delle rilevazioni exploit
├── flood_bans.json → Ban attivi creati dalla protezione anti-flood
├── flood_map.json → Storico/mappa degli attacchi flood rilevati
├── flood_settings.json → Configurazione della protezione anti-flood (limiti, intervalli)
├── ip_log.txt → Panoramica degli IP bloccati attivamente
├── log_all_requests.txt → Log completo delle richieste (se abilitato)
├── seed_version.txt → Marker interno versione/seed
├── temp_ip_blocks.json → Blocchi IP temporanei (con scadenza)
├── visitor_ip_gate.json → Dati di supporto gate IP visitatori / anti-flood
├── visitor_stats.json → Contatore visitatori e statistiche giornaliere
├── whitelist_paths.txt → Elenco dei percorsi esplicitamente consentiti
├── whitelist_stats.json → Statistiche d’uso dei bot consentiti
├── whitelisted_bots.txt → Elenco degli User-Agent consentiti (whitelist)
├── whitelisted_ips.txt → Elenco degli indirizzi IP consentiti
└── whitelisted_uas.json → Pattern/config UA in whitelist (JSON)

/plugins/bot_protection/
├── admin.php → Punto d’ingresso dell’interfaccia admin
├── assets/
│ ├── css/
│ │ └── style.css → Layout del plugin e stile dei tab
│ └── js/
│ └── chart.js → Libreria JavaScript per grafici (Chart.js)
├── include/
│ ├── bot_protection.php → Logica di protezione (rilevamento e blocco bot)
│ ├── bp_logger.php → Helper centrale di logging (file logging sicuro, formati, livelli)
│ ├── bp_util.php → Utilità/Helper (file, path, parser, ecc.)
│ ├── function_app.php → Helper bootstrap app (init comune, costanti, glue code)
│ ├── function_archive.php → Funzioni archivio (leggi/scrivi snapshot, aggregazione, pulizia)
│ ├── function_bots.php → Funzioni bot (rilevamento, limiti, regole)
│ ├── function_exploit.php → Helper rilevamento exploit (path probes / tentativi exploit)
│ ├── function_ip.php → Helper IP (validare, normalizzare, range, ecc.)
│ ├── function_log_archiver.php → Rotazione/archiviazione log (archivio settimanale, indice, purge)
│ └── visitor_counter.php → Contatore visitatori con hashing IP
├── language/
│ ├── de_DE/plugin.lang.php → Tedesco
│ ├── en_UK/plugin.lang.php → Inglese
│ ├── es_ES/plugin.lang.php → Spagnolo
│ ├── fr_FR/plugin.lang.php → Francese
│ ├── it_IT/plugin.lang.php → Italiano
│ ├── ja_JP/plugin.lang.php → Giapponese
│ ├── nl_NL/plugin.lang.php → Olandese
│ └── pl_PL/plugin.lang.php → Polacco
├── main.inc.php → Inizializzazione e punto d’ingresso centrale
├── admin/
│ └── bot_protection_admin.php → Elaborazione e visualizzazione nell’area admin
└── template/
├── header.tpl → Header - wrapper Smarty per l’UI admin (tab + contenuto)
├── bp_dashboard_link.tpl → Icona/badge per il dashboard Piwigo con link a BYB Bot Protection
└── tabs/
├── tab0.tpl → Dashboard
├── tab1.tpl → Lista bot
├── tab2.tpl → File log / analisi log
├── tab3.tpl → Statistiche bot
├── tab4.tpl → Whitelist e limiti bot
├── tab5.tpl → Visitatori
├── tab6.tpl → Blocco temporaneo (aggiunta manuale)
├── tab7.tpl → Area BYB .htaccess
├── tab8.tpl → Informazioni debug
├── tab9.tpl → Feedback & segnalazione bug
├── tab10.tpl → Archivio
├── tab11.tpl → Richieste bloccate
├── tab12.tpl → Logging di tutte le richieste
├── tab13.tpl → Monitoraggio robots.txt
├── tab14.tpl → Tentativi di exploit
├── tab15.tpl → Regole accesso bot consentiti
├── tab16.tpl → Indirizzi IP consentiti
├── tab17.tpl → Whitelist percorsi
├── tab18.tpl → Whitelist User-Agent
├── tab19.tpl → Whitelist rDNS
├── tab20.tpl → Protezione anti-flood
├── tab21.tpl → IP bloccati
├── tab22.tpl → Indirizzi IP bloccati
├── tab23.tpl → Fuso orario (Bot Protection)
├── tab24.tpl → News ticker
└── tab25.tpl → Archivio log
    

Funzionalità:

Accesso nel pannello admin:

Dopo l’attivazione, voce di menu: Plugins → Bot Protection

Piwigo または BYB Bot Protection をアップデート/アップグレードする前に、必ず /_data/bot_protection/ フォルダをバックアップしてください。

概要と構成

このプラグインは、不要なボットや直接アクセスから Piwigo サイト全体を保護します。既知のユーザーエージェントをブロックし、Referer のないリクエストを防ぎ、すべてのブロック試行を記録します。

構成:

root/
/_data/bot_protection/
├── archiv/
│ └── archive_index.json → このモジュールは大きなログファイルを自動的にアーカイブし、/_data フォルダをクリーンで高速に保ちます。
├── cache/
│ └── news_data.json → ティッカーキャッシュ
├── config/
│ └── settings.json → ユーザー設定(アップグレード安全;ticker, all_requests, emergency_off など)
├── .htaccess → 保護ファイル:これらのデータへの直接Webアクセスを防止
├── blocked_bots.txt → ブロックされたUser-Agent一覧(ブラックリスト)
├── blocked_folders.txt → ブロックされたフォルダパス一覧
├── blocked_ips.txt → 手動でブロックされたIPアドレス
├── bot_limits.json → Botごとの1日アクセス制限(ホワイトリストBot)
├── bot_log.txt → ブロックされたリクエストのログ
├── bot_stats.json → ブロックされたBot統計(User-Agent別)
├── bp_archive.json → アーカイブファイル:統計スナップショット(訪問者、合計など)
├── bp_archive_bots.json → アーカイブファイル:Botスナップショット/統計(Bot、制限など)
├── exploit_block_log.txt → Exploit/パラメータブロックのログ
├── exploit_stats.json → Exploit検知の統計
├── flood_bans.json → フラッド対策で作成された有効なBAN
├── flood_map.json → 検知されたフラッド攻撃の履歴/マップ
├── flood_settings.json → フラッド対策の設定(制限、間隔)
├── ip_log.txt → アクティブにブロックされたIPの概要
├── log_all_requests.txt → 全リクエストログ(有効時)
├── seed_version.txt → 内部バージョン/シードマーカー
├── temp_ip_blocks.json → 一時IPブロック(期限付き)
├── visitor_ip_gate.json → 訪問者IPゲート/アンチフラッド補助データ
├── visitor_stats.json → 訪問者カウンター&日次統計
├── whitelist_paths.txt → 明示的に許可されたパス一覧
├── whitelist_stats.json → 許可されたBotの利用統計
├── whitelisted_bots.txt → 許可されたUser-Agent一覧(ホワイトリスト)
├── whitelisted_ips.txt → 許可されたIPアドレス一覧
└── whitelisted_uas.json → ホワイトリストUAパターン/設定(JSON)

/plugins/bot_protection/
├── admin.php → 管理画面のエントリーポイント
├── assets/
│ ├── css/
│ │ └── style.css → プラグインのレイアウトとタブのスタイル
│ └── js/
│ └── chart.js → グラフ用JavaScriptライブラリ(Chart.js)
├── include/
│ ├── bot_protection.php → 保護ロジック(Bot検知&ブロック)
│ ├── bp_logger.php → 中央ログヘルパー(安全なファイルログ、形式、レベル)
│ ├── bp_util.php → ユーティリティ/ヘルパー(ファイル、パス、パーサ等)
│ ├── function_app.php → アプリ起動ヘルパー(共通初期化、定数、接着コード)
│ ├── function_archive.php → アーカイブ関数(スナップショット読書き、集計、クリーンアップ)
│ ├── function_bots.php → Bot関数(検知、制限、ルール)
│ ├── function_exploit.php → Exploit検知ヘルパー(パスプローブ/試行)
│ ├── function_ip.php → IPヘルパー(検証、正規化、範囲等)
│ ├── function_log_archiver.php → ログローテ/アーカイブ(週次アーカイブ、インデックス、削除)
│ └── visitor_counter.php → IPハッシュ付き訪問者カウンター
├── language/
│ ├── de_DE/plugin.lang.php → ドイツ語
│ ├── en_UK/plugin.lang.php → 英語
│ ├── es_ES/plugin.lang.php → スペイン語
│ ├── fr_FR/plugin.lang.php → フランス語
│ ├── it_IT/plugin.lang.php → イタリア語
│ ├── ja_JP/plugin.lang.php → 日本語
│ ├── nl_NL/plugin.lang.php → オランダ語
│ └── pl_PL/plugin.lang.php → ポーランド語
├── main.inc.php → 初期化&中央エントリーポイント
├── admin/
│ └── bot_protection_admin.php → 管理画面での処理&表示
└── template/
├── header.tpl → ヘッダー - 管理UI用Smartyラッパー(タブ+コンテンツ)
├── bp_dashboard_link.tpl → Piwigoダッシュボード用アイコン/バッジ(BYBへのリンク)
└── tabs/
├── tab0.tpl → ダッシュボード
├── tab1.tpl → Botリスト
├── tab2.tpl → ログファイル / ログ解析
├── tab3.tpl → Bot統計
├── tab4.tpl → ホワイトリスト&Bot制限
├── tab5.tpl → 訪問者
├── tab6.tpl → 一時ブロック(手動追加)
├── tab7.tpl → BYB .htaccess エリア
├── tab8.tpl → デバッグ情報
├── tab9.tpl → フィードバック&バグ報告
├── tab10.tpl → アーカイブ
├── tab11.tpl → ブロックされたリクエスト
├── tab12.tpl → 全リクエストのログ
├── tab13.tpl → robots.txt 監視
├── tab14.tpl → Exploit試行
├── tab15.tpl → 許可Botアクセスルール
├── tab16.tpl → 許可IPアドレス
├── tab17.tpl → パスホワイトリスト
├── tab18.tpl → User-Agentホワイトリスト
├── tab19.tpl → rDNSホワイトリスト
├── tab20.tpl → フラッド対策
├── tab21.tpl → ブロックされたIP
├── tab22.tpl → ブロックされたIPアドレス
├── tab23.tpl → タイムゾーン(Bot Protection)
├── tab24.tpl → ニュースティッカー
└── tab25.tpl → ログアーカイブ
    

機能:

管理画面からのアクセス:

有効化後、メニュー:Plugins → Bot Protection

Zorg er vóór een update/upgrade van Piwigo of BYB Bot Protection voor dat je een back-up maakt van de map /_data/bot_protection/.

Beschrijving & Structuur

Deze plugin beschermt je volledige Piwigo-website tegen ongewenste bots en directe toegang. Hij blokkeert bekende user-agents, voorkomt verzoeken zonder referer en logt alle geblokkeerde pogingen.

Structuur:

root/
/_data/bot_protection/
├── archiv/
│ └── archive_index.json → Deze module archiveert automatisch grote logbestanden om je /_data-map schoon en snel te houden.
├── cache/
│ └── news_data.json → Ticker-cache
├── config/
│ └── settings.json → Gebruikersinstellingen (update-veilig; ticker, all_requests, emergency_off, enz.)
├── .htaccess → Beschermingsbestand: voorkomt directe webtoegang tot deze data
├── blocked_bots.txt → Lijst met geblokkeerde User-Agents (blacklist)
├── blocked_folders.txt → Lijst met geblokkeerde mappaden
├── blocked_ips.txt → Handmatig geblokkeerde IP-adressen
├── bot_limits.json → Toegangslimieten per bot per dag (whitelisted bots)
├── bot_log.txt → Logbestand voor geblokkeerde verzoeken
├── bot_stats.json → Statistieken van geblokkeerde bots (per User-Agent)
├── bp_archive.json → Archiefbestand: opgeslagen statistiek-snapshots (bezoekers, totalen, enz.)
├── bp_archive_bots.json → Archiefbestand: opgeslagen bot-snapshots/statistieken (bots, limieten, enz.)
├── exploit_block_log.txt → Logbestand voor exploit-/parameterblokkering
├── exploit_stats.json → Statistieken voor exploit-detecties
├── flood_bans.json → Actieve bans door flood-protection
├── flood_map.json → Geschiedenis/kaart van gedetecteerde flood-aanvallen
├── flood_settings.json → Configuratie van flood-protection (limieten, intervallen)
├── ip_log.txt → Overzicht van IP’s die actief geblokkeerd zijn
├── log_all_requests.txt → Volledige request-log (indien ingeschakeld)
├── seed_version.txt → Interne versie/seed-marker
├── temp_ip_blocks.json → Tijdelijke IP-blokkeringen (met vervaldatum)
├── visitor_ip_gate.json → Visitor IP gate / anti-flood hulpadministratie
├── visitor_stats.json → Bezoekersteller & dagelijkse statistieken
├── whitelist_paths.txt → Lijst met expliciet toegestane paden
├── whitelist_stats.json → Gebruiksstatistieken van toegestane bots
├── whitelisted_bots.txt → Lijst met toegestane User-Agents (whitelist)
├── whitelisted_ips.txt → Lijst met toegestane IP-adressen
└── whitelisted_uas.json → Whitelisted UA-patronen/config (JSON)

/plugins/bot_protection/
├── admin.php → Ingangspunt voor de admin-interface
├── assets/
│ ├── css/
│ │ └── style.css → Plugin-layout en tab-styling
│ └── js/
│ └── chart.js → JavaScript-bibliotheek voor grafieken (Chart.js)
├── include/
│ ├── bot_protection.php → Beschermingslogica (bot-detectie & blokkeren)
│ ├── bp_logger.php → Centrale logging-helper (veilig file-logging, formaten, levels)
│ ├── bp_util.php → Utilities/Helpers (bestanden, paden, parser, enz.)
│ ├── function_app.php → App bootstrap-helpers (common init, constants, glue code)
│ ├── function_archive.php → Archief-functies (snapshots lezen/schrijven, aggregatie, opschonen)
│ ├── function_bots.php → Bot-functies (detectie, limieten, regels)
│ ├── function_exploit.php → Exploit-detectie helpers (path probes / exploitpogingen)
│ ├── function_ip.php → IP-helperfuncties (valideren, normaliseren, ranges, enz.)
│ ├── function_log_archiver.php → Log-rotatie/archivering (wekelijkse archief, index, opschonen)
│ └── visitor_counter.php → Bezoekersteller met IP-hashing
├── language/
│ ├── de_DE/plugin.lang.php → Duits
│ ├── en_UK/plugin.lang.php → Engels
│ ├── es_ES/plugin.lang.php → Spaans
│ ├── fr_FR/plugin.lang.php → Frans
│ ├── it_IT/plugin.lang.php → Italiaans
│ ├── ja_JP/plugin.lang.php → Japans
│ ├── nl_NL/plugin.lang.php → Nederlands
│ └── pl_PL/plugin.lang.php → Pools
├── main.inc.php → Initialisatie & centraal entry point
├── admin/
│ └── bot_protection_admin.php → Verwerking & weergave in het admin-gedeelte
└── template/
├── header.tpl → Header - Smarty wrapper voor de admin-UI (tabs + content)
├── bp_dashboard_link.tpl → Icoon/badge voor Piwigo-dashboard met link naar BYB Bot Protection
└── tabs/
├── tab0.tpl → Dashboard
├── tab1.tpl → Botlijst
├── tab2.tpl → Logbestand / log-analyse
├── tab3.tpl → Botstatistieken
├── tab4.tpl → Whitelist & botlimieten
├── tab5.tpl → Bezoekers
├── tab6.tpl → Tijdelijke blokkering (handmatig toevoegen)
├── tab7.tpl → BYB .htaccess-gebied
├── tab8.tpl → Debug-informatie
├── tab9.tpl → Feedback & bugrapport
├── tab10.tpl → Archief
├── tab11.tpl → Geblokkeerde verzoeken
├── tab12.tpl → Logging van alle verzoeken
├── tab13.tpl → robots.txt monitoring
├── tab14.tpl → Exploitpogingen
├── tab15.tpl → Regels voor toegestane bottoegang
├── tab16.tpl → Toegestane IP-adressen
├── tab17.tpl → Pad-whitelist
├── tab18.tpl → User-Agent whitelist
├── tab19.tpl → rDNS whitelist
├── tab20.tpl → Flood-protection
├── tab21.tpl → Geblokkeerde IP’s
├── tab22.tpl → Geblokkeerde IP-adressen
├── tab23.tpl → Tijdzone (Bot Protection)
├── tab24.tpl → Nieuws ticker
└── tab25.tpl → Logarchief
    

Functies:

Toegang in het beheerpaneel:

Na activering vind je het menu onder: Plugins → Bot Protection

Przed aktualizacją/upgrade’em Piwigo lub BYB Bot Protection koniecznie wykonaj kopię zapasową folderu /_data/bot_protection/.

Opis i struktura

Wtyczka chroni całą stronę Piwigo przed niechcianymi botami i bezpośrednim dostępem. Blokuje znane user-agenty, zapobiega żądaniom bez nagłówka referer oraz zapisuje wszystkie zablokowane próby.

Struktura:

root/
/_data/bot_protection/
├── archiv/
│ └── archive_index.json → Ten moduł automatycznie archiwizuje duże pliki logów, aby folder /_data był czysty i szybki.
├── cache/
│ └── news_data.json → Pamięć podręczna tickera
├── config/
│ └── settings.json → Ustawienia użytkownika (bezpieczne przy aktualizacjach; ticker, all_requests, emergency_off itd.)
├── .htaccess → Plik ochronny: blokuje bezpośredni dostęp WWW do tych danych
├── blocked_bots.txt → Lista zablokowanych User-Agentów (czarna lista)
├── blocked_folders.txt → Lista zablokowanych ścieżek folderów
├── blocked_ips.txt → Ręcznie zablokowane adresy IP
├── bot_limits.json → Limity dostępu na bota dziennie (boty na białej liście)
├── bot_log.txt → Plik logów dla zablokowanych żądań
├── bot_stats.json → Statystyki zablokowanych botów (wg User-Agent)
├── bp_archive.json → Plik archiwum: zapisane snapshoty statystyk (odwiedziny, sumy itd.)
├── bp_archive_bots.json → Plik archiwum: zapisane snapshoty/statystyki botów (boty, limity itd.)
├── exploit_block_log.txt → Log blokowania exploitów / parametrów
├── exploit_stats.json → Statystyki wykryć exploitów
├── flood_bans.json → Aktywne bany utworzone przez ochronę flood
├── flood_map.json → Historia/mapa wykrytych ataków flood
├── flood_settings.json → Konfiguracja ochrony flood (limity, interwały)
├── ip_log.txt → Przegląd IP aktywnie zablokowanych
├── log_all_requests.txt → Pełny log żądań (jeśli włączone)
├── seed_version.txt → Wewnętrzny marker wersji/seed
├── temp_ip_blocks.json → Tymczasowe blokady IP (z wygaśnięciem)
├── visitor_ip_gate.json → Dane pomocnicze bramki IP odwiedzających / anti-flood
├── visitor_stats.json → Licznik odwiedzin i statystyki dzienne
├── whitelist_paths.txt → Lista jawnie dozwolonych ścieżek
├── whitelist_stats.json → Statystyki użycia dozwolonych botów
├── whitelisted_bots.txt → Lista dozwolonych User-Agentów (biała lista)
├── whitelisted_ips.txt → Lista dozwolonych adresów IP
└── whitelisted_uas.json → Wzorce/konfiguracja UA na białej liście (JSON)

/plugins/bot_protection/
├── admin.php → Punkt wejścia do interfejsu admina
├── assets/
│ ├── css/
│ │ └── style.css → Układ wtyczki i styl zakładek
│ └── js/
│ └── chart.js → Biblioteka JavaScript do wykresów (Chart.js)
├── include/
│ ├── bot_protection.php → Logika ochrony (wykrywanie i blokowanie botów)
│ ├── bp_logger.php → Centralny helper logowania (bezpieczne logi plikowe, formaty, poziomy)
│ ├── bp_util.php → Narzędzia/Helpery (pliki, ścieżki, parser itd.)
│ ├── function_app.php → Helpery startu aplikacji (wspólna inicjalizacja, stałe, glue code)
│ ├── function_archive.php → Funkcje archiwum (odczyt/zapis snapshotów, agregacja, czyszczenie)
│ ├── function_bots.php → Funkcje botów (wykrywanie, limity, reguły)
│ ├── function_exploit.php → Helpery wykrywania exploitów (path probes / próby exploitów)
│ ├── function_ip.php → Helpery IP (walidacja, normalizacja, zakresy itd.)
│ ├── function_log_archiver.php → Rotacja/archiwizacja logów (archiwum tygodniowe, indeks, purge)
│ └── visitor_counter.php → Licznik odwiedzin z hashowaniem IP
├── language/
│ ├── de_DE/plugin.lang.php → Niemiecki
│ ├── en_UK/plugin.lang.php → Angielski
│ ├── es_ES/plugin.lang.php → Hiszpański
│ ├── fr_FR/plugin.lang.php → Francuski
│ ├── it_IT/plugin.lang.php → Włoski
│ ├── ja_JP/plugin.lang.php → Japoński
│ ├── nl_NL/plugin.lang.php → Niderlandzki
│ └── pl_PL/plugin.lang.php → Polski
├── main.inc.php → Inicjalizacja i centralny punkt wejścia
├── admin/
│ └── bot_protection_admin.php → Przetwarzanie i wyświetlanie w panelu admina
└── template/
├── header.tpl → Nagłówek - wrapper Smarty dla UI admina (zakładki + treść)
├── bp_dashboard_link.tpl → Ikona/badge dla dashboardu Piwigo z linkiem do BYB Bot Protection
└── tabs/
├── tab0.tpl → Dashboard
├── tab1.tpl → Lista botów
├── tab2.tpl → Plik logów / analiza logów
├── tab3.tpl → Statystyki botów
├── tab4.tpl → Whitelist i limity botów
├── tab5.tpl → Odwiedzający
├── tab6.tpl → Blokada tymczasowa (dodanie ręczne)
├── tab7.tpl → Obszar BYB .htaccess
├── tab8.tpl → Informacje debug
├── tab9.tpl → Feedback i zgłoszenie błędu
├── tab10.tpl → Archiwum
├── tab11.tpl → Zablokowane żądania
├── tab12.tpl → Logowanie wszystkich żądań
├── tab13.tpl → Monitorowanie robots.txt
├── tab14.tpl → Próby exploitów
├── tab15.tpl → Reguły dostępu dla dozwolonych botów
├── tab16.tpl → Dozwolone adresy IP
├── tab17.tpl → Whitelist ścieżek
├── tab18.tpl → Whitelist User-Agent
├── tab19.tpl → Whitelist rDNS
├── tab20.tpl → Ochrona flood
├── tab21.tpl → Zablokowane IP
├── tab22.tpl → Zablokowane adresy IP
├── tab23.tpl → Strefa czasowa (Bot Protection)
├── tab24.tpl → Ticker news
└── tab25.tpl → Archiwum logów
    

Funkcje:

Dostęp w panelu admina:

Po aktywacji pozycja menu: Plugins → Bot Protection