About this plugin
Audit Export is a comprehensive WordPress plugin designed to help site administrators and developers analyze and report on the entity structure and overall usage of their WordPress site. The plugin provides detailed audits of various WordPress components and allows you to export this data in multiple formats.
Key Features
- Comprehensive Site Auditing: Analyze plugins, themes, content types, taxonomies, menus, widgets, users & roles, and generate overall site reports
- Multiple Export Options: Export audit reports as CSV files or store them in the database
- Remote Posting: Send audit data to remote endpoints with authentication support
- WP-CLI Integration: Full command-line interface for all plugin operations
- Automated Processing: Schedule audits to run automatically via WordPress cron
- Extensible Architecture: Hook-based system for adding custom audits and modifying behavior
Available Audits
- Plugins Audit: Lists all installed plugins with status, version, and metadata
- Themes Audit: Reports on installed themes and their configurations
- Content Types Audit: Analyzes custom post types and their usage
- Taxonomies Audit: Reviews all taxonomies including custom ones
- Menus Audit: Examines navigation menu structures
- Widgets Audit: Audits widget areas and active widgets
- Users & Roles Audit: Reports on user accounts and role assignments
- Site Report: Comprehensive overview of the WordPress installation
Export Capabilities
- Save reports to the WordPress database
- Export as CSV files to the filesystem
- Send data to remote endpoints via HTTP POST
- Support for JSON and CSV formats
Use Cases
- Site Documentation: Generate comprehensive documentation of your WordPress site structure
- Migration Planning: Analyze site components before migrations
- Development Workflows: Track changes in site structure over time
- Client Reporting: Provide detailed site analysis reports to clients
- Multi-site Management: Centralize reporting from multiple WordPress installations
WP-CLI Integration
The plugin provides comprehensive WP-CLI commands for all operations:
List Available Audits
wp audit-export list
Shows all available audit reports with their ID, group, description, type, and last processed date.
Run Audits
wp audit-export run [<audit_id>] [--all] [--format=<format>]
Examples:
* wp audit-export run – Interactive audit selection
* wp audit-export run --all – Process all audits
* wp audit-export run site_report – Run specific audit
* wp audit-export run content_types --format=csv – Run audit with specific output format
Export Audits
wp audit-export export <audit_id> [--file=<file>] [--format=<format>]
Examples:
* wp audit-export export site_report – Export to stdout
csv – Export to file
json – Export as JSON
Manage Cron
wp audit-export cron <action>
Actions:
* status – Show cron status and next run time
* enable – Enable cron processing
* disable – Disable cron processing
* run – Manually trigger cron execution
* schedule – Schedule cron events
Test Remote Connection
wp audit-export test-connection
Tests the configured remote endpoint connection.
Force Remote Post
wp audit-export force-post <audit_id>
Manually post a specific audit to the remote endpoint.
Plugin Information
wp audit-export info
Displays plugin version, statistics, and configuration status.
Configuration
File Export Settings
- Save to Filesystem: Enable/disable saving exports to files
- Filesystem Type: Choose between uploads directory or content directory
- Export Path: Subdirectory path for saving export files
Cron Settings
- Enable Cron: Turn on automated audit processing
- Run on Every Cron: Process audits on each WordPress cron execution
- Cron Frequency: Set interval in minutes (if not running on every cron)
- Queue Timeout: Maximum processing time per audit in seconds
Remote Post Settings
Basic Settings:
* Enable Remote Post: Turn on posting to remote endpoints
* Remote URL: Endpoint URL for receiving audit data
* Site Name: Identifier for this WordPress site
Authentication:
* Authentication Type: None, Basic, or Bearer Token
* Username/Password: For Basic Authentication
* Bearer Token: For token-based authentication
Advanced:
* Timeout: Request timeout in seconds (30-900)
* Verify SSL: SSL certificate verification
* Debug Mode: Enable detailed logging
Hooks and Filters
Actions
- audit_export_complete – Fired after an audit completes processing
- audit_export_before_process – Fired before processing an audit
- audit_export_after_process – Fired after processing an audit
Filters
- audit_export_post_url – Modify the remote post URL
- audit_export_post_data – Modify data before remote posting
- audit_export_post_site_info – Customize site information in remote posts
- audit_export_post_request_args – Modify HTTP request arguments
- audit_export_{audit_id}_headers – Customize CSV headers for specific audits
- audit_export_{audit_id}_data – Modify audit data before saving
Developer Documentation
Creating Custom Audits
To create a custom audit:
- Extend the Audit_Export_Audit abstract class
- Implement required methods: prepare_data() and process_data()
- Set audit properties: $label, $description, $group, $data_type
- Register with the audit manager using the audit_export_register_audits action
Example:
class My_Custom_Audit extends Audit_Export_Audit { protected $label = 'My Custom Audit'; protected $description = 'Audits custom functionality'; protected $group = 'custom';
public function prepare_data() { // Return array of items to process }
public function process_data( $item ) { // Process individual item and return data row } }
Database Structure
The plugin creates a table {prefix}_audit_export_reports with columns:
* id – Primary key
* audit_name – Audit identifier
* audit_data – JSON-encoded audit results
* created_at – Timestamp
* created_by – User ID
Support
For bug reports and feature requests, please use the plugin support forum.
Privacy Policy
This plugin stores audit data in your WordPress database and optionally saves CSV files to your server. When remote posting is enabled, audit data is sent to configured external endpoints. No data is sent to third parties without explicit configuration.