Skip to content
risingisland edited this page Dec 5, 2025 · 1 revision

Plugin Cleanup (Secure Edition)

Find and safely delete inactive plugins with all their files and orphaned data β€” including leftovers from previously removed plugins.

πŸ”’ Security-hardened, audit-logged, and GetSimple CE compatible.


πŸ“¦ Overview

This plugin helps administrators clean up their GetSimple installation by:

  • Listing all active & inactive plugins
  • Detecting plugin-associated data files (.json, .xml, .txt, etc.)
  • Identifying orphaned data files (belonging to no known plugin)
  • Providing safe, one-click deletion of selected plugins + their data
  • Protecting critical system files automatically

Ideal for maintaining a lean, fast, and secure GetSimple site.


βœ… Features

Feature Description
🧹 Inactive Plugin Detection Lists plugins not enabled in plugins.xml
πŸ“ Full Content Scan Shows main .php file, folder contents, and data files
πŸ” Code-Based Data Detection Scans plugin code to auto-detect data storage methods (JSON, XML, DB, etc.)
πŸ—‘οΈ Orphaned Files Finder Finds data files not linked to any current plugin
πŸ” Security Hardening CSRF protection, path validation, critical file protection
πŸ“ Audit Logging All actions logged to data/other/cleanup_audit.log
🌐 RTL & LTR Support Full English & Arabic interface

βš™οΈ Installation

  1. Download plugin-cleanup.php
  2. Upload to your /plugins/ directory
  3. Log in to GetSimple admin β†’ Plugins β†’ Plugin Cleanup appears in sidebar
  4. Click to run

βœ… No configuration needed.


πŸ”’ Security Measures

  • CSRF Tokens: Every deletion requires a time-limited token
  • Path Validation: Blocks directory traversal (../, absolute paths)
  • Critical File Protection: Never allows deletion of gsconfig.php, *.xml core files, etc.
  • File Size Limits: Skips files >10MB by default
  • Permission Checks: Only accessible to logged-in admins
  • Session-Based Tokens: Tokens expire after 2 hours

All security events and deletions are logged to data/other/cleanup_audit.log.


πŸ“ Files & Structure

  • plugin-cleanup.php β€” Main plugin file
  • data/other/cleanup_audit.log β€” Security & deletion log (auto-created)

No database or extra dependencies required.


πŸ“ Changelog

v2.0 (Security Hardened)

  • Added CSRF protection with session tokens
  • Implemented path validation & critical file blocking
  • Added audit logging for security compliance
  • Fixed XSS via proper htmlspecialchars() escaping
  • Enhanced orphaned file detection
  • Added Arabic/English bilingual UI
  • Improved performance (partial file reads)

v1.1

  • Initial public release

πŸ› οΈ Developer Info

  • Author: Fahad4x4
  • License: MIT
  • Compatible with: GetSimple CMS CE β‰₯ 3.3.20
  • GitHub: (optional: add if you have a repo)
  • Homepage: https://getsimple-ce.ovh/

πŸ’‘ Tip: Always backup before mass deletion β€” though the plugin protects core files, caution is wise!