WP Manifestindependent plugin directory
manifest / content / content-media-revision-manager

Content/Media Versioning & Revision Manager

Track and manage versions of posts, pages, and media files with rollback capabilities, diff views, and automatic backups.

by Bilal Mahmood · github.com/sahibbilal/content-media-revision-manager · website

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/sahibbilal/content-media-revision-manager/archive/refs/heads/main.zip

A comprehensive WordPress plugin that tracks and manages versions of posts, pages, and media files with rollback capabilities, diff views, and automatic backups.

📋 Table of Contents

✨ Features

Core Functionality

  • 📝 Version History for Posts/Pages

    • Track every update of posts and pages including title, content, excerpt, status, and meta data
    • Automatic version creation on content changes
    • Manual snapshot capability from the editor
    • Configurable auto-backup intervals (5/15/60 minutes)
  • 🖼️ Media File Versioning

    • Automatically detect file replacements
    • Store previous versions of uploaded images and files
    • Separate storage directory for old versions (/uploads/versioning-old/)
    • Database references for efficient tracking
  • 📸 Manual Snapshots

    • "Save Snapshot" button in WordPress editor
    • Create versions on-demand at any time
    • Clearly marked in version history
  • ⏰ Auto Backups

    • Configurable intervals: 5, 15, or 60 minutes
    • Smart versioning: only creates versions when content actually changes
    • Respects time intervals to prevent duplicate versions
  • ↩️ Rollback Functionality

    • One-click rollback to any previous version
    • Works for both posts/pages and media files
    • Automatic backup before rollback (safety feature)
    • Full restoration of content, meta, ACF fields, and featured images
  • 🔍 Diff View

    • Side-by-side comparison of versions
    • Uses WordPress built-in diff functionality
    • Compare any version with current content
    • Visual highlighting of changes
  • 📊 Activity Logs

    • Track who edited what and when
    • IP address logging
    • Detailed action tracking (auto backup, manual snapshot, rollback)
    • Two-level view: Posts list → Revisions detail
    • Search and filter capabilities
    • WordPress-style list table with pagination
  • 💾 Lightweight Storage

    • Custom database tables for efficient version storage
    • Automatic cleanup of old versions (configurable limits)
    • Separate directory for media file versions

Advanced Features

  • 🎨 Gutenberg Block Support

    • Full support for Gutenberg editor
    • Captures complete block content
    • Works with REST API saves
  • 🔧 ACF (Advanced Custom Fields) Support

    • Automatically captures all ACF field values
    • Full restoration on rollback
    • Cache clearing for proper field display
  • 🖼️ Featured Image Tracking

    • Featured images included in version history
    • Visual display in version detail view
    • Full restoration on rollback
  • 🔐 Security

    • Protected versioning directory (.htaccess)
    • Permission checks for all actions
    • Nonce verification for AJAX requests

📦 Requirements

  • WordPress: 5.0 or higher
  • PHP: 7.4 or higher
  • MySQL: 5.6 or higher (or MariaDB equivalent)

🚀 Installation

Method 1: WordPress Admin (Recommended)

  1. Download the plugin ZIP file
  2. Go to Plugins → Add New in your WordPress admin
  3. Click Upload Plugin
  4. Choose the ZIP file and click Install Now
  5. Activate the plugin

Method 2: Manual Installation

  1. Download and extract the plugin files
  2. Upload the content-media-revision-manager folder to /wp-content/plugins/
  3. Activate the plugin through the Plugins menu in WordPress

Post-Installation

  1. The plugin will automatically create required database tables on activation
  2. The versioning directory will be created in /wp-content/uploads/versioning-old/
  3. Configure settings from Version Manager → Settings

📖 Usage

Creating Versions

Automatic Versioning

Versions are automatically created when:

  • Content (title, content, excerpt) changes
  • Post status changes
  • Featured image changes
  • ACF fields are updated
  • Time interval is reached (if enabled)

Manual Snapshots

  1. Edit any post or page
  2. Click the "Save Snapshot" button in the editor
  3. A manual snapshot will be created immediately
  4. Manual snapshots are marked with a camera icon in version history

Viewing Version History

From Post Editor

  1. Edit a post or page
  2. Check the "Version History" meta box in the sidebar
  3. Click "View All Versions" to see the full history

From Version Manager Menu

  1. Go to Version Manager in the admin menu
  2. Click on a post title to view its revision history
  3. Click on any version to see details

Rolling Back to a Previous Version

  1. Navigate to the version you want to restore
  2. Click the "Rollback" button
  3. Confirm the action
  4. The post will be restored to that version
  5. A new version is automatically created before rollback (safety backup)

Comparing Versions

  1. View any version in the Version Manager
  2. Click "Compare with Current" button
  3. See side-by-side diff of changes
  4. Highlighted additions and deletions

Viewing Activity Logs

  1. Go to Version Manager → Activity Logs
  2. View all posts with version history
  3. Click on a post to see all its revision logs
  4. Use search and filters to find specific actions
  5. Filter by action type (Auto Backup, Manual Snapshot, Rollback)

Managing Media Versions

  1. Go to Media Library
  2. Edit any media file
  3. Click "View History" link in the Versions field
  4. View all versions of that media file
  5. Rollback to previous versions if needed

⚙️ Configuration

Settings Page

Navigate to Version Manager → Settings to configure:

Auto Backup

  • Enable/Disable: Toggle automatic version backups
  • Backup Interval: Choose 5, 15, or 60 minutes
    • How often to automatically save versions
    • Only creates versions if content has changed

Version Limits

  • Max Versions per Post/Page: Default 50

    • Older versions are automatically deleted when limit is reached
    • Manual snapshots are preserved longer
  • Max Versions per Media: Default 20

    • Limits storage usage for media files
    • Oldest versions are deleted first

Database Tables

The plugin creates three custom tables:

  1. wp_cmvrm_versions: Stores post/page versions
  2. wp_cmvrm_media_versions: Stores media file versions
  3. wp_cmvrm_logs: Stores activity logs

Storage Locations

  • Post/Page Versions: Stored in database (efficient for text content)
  • Media File Versions: Stored in /wp-content/uploads/versioning-old/
  • Activity Logs: Stored in database

📸 Screenshots

Version History Meta Box

Version History Meta Box Version history displayed in the post editor sidebar

Version Manager Dashboard

Version Manager Dashboard Overview of all version statistics and settings

Version Detail View

Version Detail View Detailed view of a specific version with content and featured image

Diff Comparison

Diff Comparison Side-by-side comparison of version changes

Activity Logs

Activity Logs Comprehensive activity log with search and filter options

Settings Page

Settings Page Configuration options for auto-backup and version limits

❓ FAQ

Does this work with custom post types?

Currently, the plugin only versions posts and pages. Support for custom post types may be added in future versions.

How much storage space does this use?

Storage usage depends on:

  • How often you update content
  • Number of versions kept per post/media
  • Size of media files

The plugin automatically deletes old versions when limits are reached. You can configure these limits in settings.

Can I delete old versions manually?

Yes, old versions are automatically deleted when the maximum limit is reached. Manual snapshots are preserved longer than automatic backups.

Does this replace WordPress revisions?

No, this plugin works alongside WordPress's built-in revision system. It provides additional features like:

  • Media file versioning
  • Manual snapshots
  • Better user interface
  • Activity logs
  • Rollback functionality

Will this slow down my site?

The plugin is designed to be lightweight:

  • Uses custom database tables (not WordPress postmeta)
  • Only creates versions when content changes
  • Automatic cleanup of old versions
  • Efficient queries and indexing

Can I export/import versions?

Version export/import functionality is not currently available but may be added in future versions.

Does this work with page builders?

Yes, the plugin captures the complete post content including:

  • Gutenberg blocks
  • Classic editor content
  • Page builder shortcodes/markup

However, page builders that store content outside of post_content may require additional integration.

What happens if I delete the plugin?

If you deactivate the plugin:

  • Existing versions remain in the database
  • Media versions remain in the storage directory
  • You can reactivate to access them again

If you delete the plugin:

  • Database tables remain (you may want to clean them up manually)
  • Media versions remain in storage directory

📝 Changelog

1.0.0 (Initial Release)

Features

  • Post/page versioning with auto-backup
  • Media file versioning
  • Manual snapshots
  • Rollback functionality
  • Diff view
  • Activity logs with search and filters
  • Admin interface
  • Gutenberg block support
  • ACF fields support
  • Featured image tracking
  • WordPress-style list tables
  • Two-level activity log view (Posts → Revisions)

Technical

  • Custom database tables
  • REST API integration for Gutenberg
  • ACF hooks integration
  • Efficient version comparison
  • Automatic cleanup of old versions
  • Security hardening

🛠️ Development

File Structure

content-media-revision-manager/
├── content-media-revision-manager.php  # Main plugin file
├── readme.txt                          # WordPress.org readme
├── README.md                           # This file
├── includes/
│   ├── class-cmvrm-database.php        # Database management
│   ├── class-cmvrm-post-versioning.php # Post/page versioning
│   ├── class-cmvrm-media-versioning.php # Media versioning
│   ├── class-cmvrm-admin.php           # Admin interface
│   ├── class-cmvrm-rollback.php         # Rollback functionality
│   ├── class-cmvrm-diff.php             # Diff view
│   ├── class-cmvrm-logger.php           # Activity logging
│   ├── class-cmvrm-ajax.php             # AJAX handlers
│   └── class-cmvrm-logs-list-table.php  # Logs list table
└── assets/
    ├── css/
    │   └── admin.css                   # Admin styles
    └── js/
        └── admin.js                    # Admin scripts

Hooks and Filters

Actions

  • save_post (priority 99) - Main post save hook
  • wp_insert_post (priority 99) - New post creation
  • rest_after_insert_post - Gutenberg/REST API saves
  • acf/save_post - ACF field saves
  • add_attachment - New media uploads
  • wp_update_attachment_metadata - Media file updates

Filters

  • cron_schedules - Custom backup interval
  • plugin_action_links - Settings link in plugins list
  • attachment_fields_to_edit - Media version field

Database Schema

wp_cmvrm_versions

  • Stores post/page versions with full content and meta

wp_cmvrm_media_versions

  • Stores media file versions with file paths and metadata

wp_cmvrm_logs

  • Stores activity logs with user, action, and details

🤝 Support

Getting Help

  • Documentation: Check this README and the plugin's inline documentation
  • Issues: Report bugs or request features on GitHub
  • WordPress.org: Visit the plugin support forum (if available)

Reporting Bugs

When reporting bugs, please include:

  • WordPress version
  • PHP version
  • Plugin version
  • Steps to reproduce
  • Error messages (if any)
  • Screenshots (if applicable)

📄 License

This plugin is licensed under the GPL v2 or later.

Copyright (C) 2024 Bilal Mahmood

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

👤 Author

Bilal Mahmood

🙏 Credits

  • Built with WordPress best practices
  • Uses WordPress core functionality for diff views
  • Follows WordPress coding standards
  • Compatible with major WordPress plugins (ACF, etc.)

📈 Roadmap

Planned Features

  • [ ] Custom post type support
  • [ ] Version export/import
  • [ ] Scheduled version cleanup
  • [ ] Version comparison API
  • [ ] REST API endpoints
  • [ ] CLI commands
  • [ ] Multisite support enhancements
  • [ ] Version tagging/labeling
  • [ ] Email notifications on rollback
  • [ ] Version statistics and analytics

Known Limitations

  • Only supports posts and pages (not custom post types)
  • Media versioning requires file system access
  • Large media files may consume significant storage
  • Version comparison is text-based (no visual diff for media)

Made with ❤️ for the WordPress community

If you find this plugin useful, please consider:

  • ⭐ Starring the repository
  • 🐛 Reporting bugs
  • 💡 Suggesting features
  • 📝 Contributing code

Thank you for using Content/Media Versioning & Revision Manager!