Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/robertstaddon/code-snippets-revisions/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Unofficial prototype: local revision history and rollback for Code Snippets.
Not affiliated with Code Snippets Pro. Disable this plugin if core ships history (issue #146).
What it does
Snippets are stored in wp_snippets, not as posts, so WordPress revisions do not apply. This add-on:
- Snapshots the previous snippet on each real
save_snippet()update - Keeps the last 20 revisions per snippet (
csr_revisions_maxfilter) - Adds a Revisions panel under the Edit Snippet screen
- Restores through
save_snippet()so linting, flat files, and cloud push still run
Activation toggles, lock, and condition attach (the update_snippet hook without a previous object) are not snapshotted.
Requirements
- WordPress 5.5+
- PHP 7.4+
- Code Snippets free or Pro
Usage
- Activate Code Snippets, then this plugin.
- Open an existing snippet, change it, and save.
- Use Revisions below the editor to preview, compare, or restore.
License
GPL-2.0-or-later