Version: 1.8.2
Author: Van Isle Web Solutions
Author URI: https://www.vanislebc.com
Tested With: ClassicPress 2.2.0 / WordPress 6.x
PHP: 8.2+ compatible
License: GPLv2 or later
WP Database Analyzer is a lightweight, all‑in‑one diagnostic and maintenance tool for WordPress and ClassicPress administrators. It analyzes, cleans, and maintains your core database tables for optimal health, helping to detect orphaned data, expired transients, fragmentation and other performance issues directly from the admin dashboard. The plugin requires no external services or dependencies and runs entirely within your site.
- Scans all core tables (posts, postmeta, users, comments, terms, options, etc.)
- Reports table size, fragmentation, and index usage
- Highlights large or bloated tables and high fragmentation
- Displays clean, readable results in the dashboard
- Run Performance Analysis – generate a new report instantly
- View Last Saved Report, Download, or Clear previous reports
- Last report stored in the options table (
autoload: no) for safe persistence
- Detects significant fragmentation (>10 MB and >10%)
- Allows safe one‑click
OPTIMIZE TABLEactions - Displays success/error notices and verifies repair after completion
- Scans for orphaned entries in postmeta, commentmeta, usermeta, and termmeta
- Identifies expired transients and presents sample listings
- Lets admins selectively delete only specific orphan types
- Includes confirmation and warning dialogs for safety
- Lists largest options in the
wp_options/cp_optionstable (top 200 by size) - Shows option name, size, and autoload status
- Allows toggling autoload flag (
yes/no) safely via AJAX - Useful for identifying plugins or themes loading large data on every page load
- Adds Run Repair on Core Tables button for rare corruption issues
- Warns users to back up before running repairs
- Logs repair and cleanup events to a lightweight activity log
- Enables automated weekly database analysis via WP‑Cron
- Optional auto‑optimization of fragmented tables after each run
- Optionally emails a summary report to the site admin
- Tracks and displays next scheduled run and recent activity
- Lists non‑core tables sharing the DB prefix (e.g. plugin or theme tables)
- Displays row count, data size, index size, and storage engine
- Provides a full Cron Task Overview with next run time, schedule, creator, and orphan status
- Identifies missing callbacks as Possible Orphaned Cron Jobs
- Fully integrated beneath the main report for continuous monitoring
- Adds a System Snapshot panel showing:
- Database name & table prefix
- Last analysis time
- Next scheduled run
- Approximate database size (total / core / non‑core)
- PHP, MySQL, and WP/CP versions
- Adds a Download Last Report button (CSV) with a lightweight activity log
- Introduces developer filters:
wpdb_analyzer_fragmentation_thresholds– customize MB/% thresholdswpdb_analyzer_core_tables– extend or override the list of “core” tableswpdb_analyzer_log_event– hook into the maintenance log for custom logging
wp-db-analyzer/
├── includes/
│ └── class-wordpress-analyzer.php # Core analysis engine
├── LICENSE
├── README.md # This file
└── wp-db-analyzer.php # Admin UI, diagnostics, cleanup & cron logic
- PHP 8.0 or higher (tested with 8.2)
- MySQL 5.7 / MariaDB 10.3 or newer
- WordPress 6.x or ClassicPress 2.x
- Administrator privileges
- Added System Snapshot box at top of the tools screen
- Snapshot now shows database size and basic environment versions
- Added CSV export for the maintenance log
- Minor UI text tweaks and internal code clean‑up
- Added one-click CSV export of Recent Maintenance Activity
- Sanitizes CSV output and forces safe download
- New internal action: admin_post_wpdb_analyzer_export_log
- Added filters for fragmentation thresholds
- Added filters for core table list overrides
- Added before/after logging actions
- First stage of making the plugin developer-extensible
- Added Advanced Diagnostics section with non‑core table listing and cron task overview
- Marked tasks without callbacks as “Possible Orphan” for easy troubleshooting
- Displayed creator type (Core, Plugin, Theme) for better traceability
- Integrated results beneath Recent Maintenance Activity
- Added weekly scheduled analysis using WP‑Cron
- Optional automatic optimization after each run
- Optional email summary to admin email address
- Logged scheduling events in Recent Maintenance Activity
- Added JavaScript confirm dialogs with multi‑line warnings
- Highlighted dangerous actions with yellow notices
- Added server‑side logging for repair and cleanup events
- Introduced Orphan Data Cleanup and Options Overview
- Added Table Repair tool and maintenance logs
- Improved error handling and admin UI
- Replaced raw exception output with safe admin notices
- Logged full details server‑side only
- Removed file path and SQL fragment exposure
- Added report persistence and download capability
- Added Optimize Fragmented Tables feature
- Improved analyzer performance and layout