Audit Export

Description

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
* wp audit-export export content_types --file=content_types.csv – Export to file
* wp audit-export export plugins --format=json --file=plugins.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:

  1. Extend the Audit_Export_Audit abstract class
  2. Implement required methods: prepare_data() and process_data()
  3. Set audit properties: $label, $description, $group, $data_type
  4. 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.

Installation

  1. Upload the audit-export folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Navigate to Tools > Audit Export to configure settings
  4. Run your first audit from the Reports Overview page

Requirements

  • WordPress 5.0 or higher
  • PHP 7.2 or higher
  • WP-CLI (optional, for command-line operations)

FAQ

How do I run an audit?

You can run audits in three ways:
1. Through the WordPress admin interface under Tools > Audit Export > Reports Overview
2. Using WP-CLI commands (see WP-CLI Integration section)
3. Automatically via cron if enabled in settings

Where are the audit reports stored?

Reports are stored in a custom database table and optionally exported as CSV files to your chosen directory (uploads or wp-content).

Can I add custom audits?

Yes! The plugin uses an extensible architecture. You can create custom audit classes extending the Audit_Export_Audit abstract class and register them with the audit manager.

Is the plugin multisite compatible?

The plugin works on multisite installations but operates on a per-site basis. Each site in the network maintains its own audit data.

How do I send audit data to a remote server?

Configure the Remote Post settings with your endpoint URL and authentication details. The plugin supports Basic Authentication and Bearer Token authentication methods.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Audit Export” is open source software. The following people have contributed to this plugin.

Contributors

Translate “Audit Export” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.0.1

  • Updated and tested for WordPress 6.9.

1.0.0

  • Initial release
  • Core audit functionality for 8 WordPress components
  • CSV and JSON export support
  • Remote posting capabilities
  • WP-CLI integration
  • Automated cron processing
  • Extensible architecture for custom audits