WP-Post-Meta-Revisions
Allow selected post meta keys to be tracked in revisions.
The facts
- Rating
- 4.2★ from 5
- Active installs
- 400+
- Price
- Free
- Last updated
- 17 Jul 2023
- Added
- Dec 2014
- Requires WP
- 4.1
- Tested up to
- WP 6.2.11
- Downloads
- 16,122
Our analysis
AI-assistedWP-Post-Meta-Revisions is a WordPress plugin that adds a revisioning feature for post meta data. It allows users to track changes to specific meta keys, storing revisions whenever the meta value changes. This plugin is aimed at developers or site owners who want to implement and test post meta revisioning in their WordPress sites.
To use the plugin, you must add the desired meta keys via a filter in your theme or plugin code. It supports multiple values for a single key and allows for restoring previous meta values, making it useful for managing post metadata effectively.
Best for: This plugin suits developers and site owners looking to manage post meta revisions in WordPress.
What it does well
- ✓Implements post meta revisioning feature
- ✓Stores revisions on save and auto-saves
- ✓Allows restoring of previous meta values
- ✓Supports multiple values for a single key
- ✓Includes unit tests for functionality
Where it falls short
- •Requires WordPress version 4.1 or newer
- •Limited information on ongoing support or updates
Verdict
WP-Post-Meta-Revisions offers a practical solution for tracking changes to post meta data, though it may require some technical knowledge to implement effectively.
From the developer
Adam Silverstein's own description of WP-Post-Meta-Revisions, lightly tidied.
This plugin implements a post meta revisioning feature as arrived at in https://core.trac.wordpress.org/ticket/20564.
The goal of releasing this code as a plugin is to allow as many people as possible to easily test the post meta revisioning feature, and also hopefully move towards inclusion of the feature into core, following the Features as Plugins model.
Further development of the code for this plugin will continue on its GitHub repository. Pull requests welcome!
To use this plugin, you must be running WordPress 4.1 or newer, two hooks were added in 4.1 that are required for this implementation.
To revision a post meta, you add its key via a filter:
function add_meta_keys_to_revision( $keys ) {
$keys[] = 'meta-key-to-revision';
return $keys;
}
add_filter( 'wp_post_revision_meta_keys', 'add_meta_keys_to_revision' );
Features:
- Allows for a whitelisted array of ‘revisioned’ meta keys (which can change at any time)
- A revision for the meta is stored on save (if the meta value has changed)
- A meta revision save (if changed) is also triggered during auto-saves
- Restoring a revision restores the revisioned meta field’s values at that revision (including auto-saves)
- Supports storing of multiple values for a single key (and restoring them)
- Adds revisioned meta to the preview data via get_post_metadata
- Includes unit tests demonstrating feature
- Travis CI tests integrated with GitHub repository, props @mattheu