WP Manifestindependent plugin directory
manifest / developer / code-snippets-revisions

Code Snippets Revisions

Unofficial prototype: local revision history and rollback for Code Snippets. Not affiliated with Code Snippets Pro.

by Robert Staddon · github.com/robertstaddon/code-snippets-revisions · 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/robertstaddon/code-snippets-revisions/archive/refs/heads/main.zip

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_max filter)
  • 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

  1. Activate Code Snippets, then this plugin.
  2. Open an existing snippet, change it, and save.
  3. Use Revisions below the editor to preview, compare, or restore.

License

GPL-2.0-or-later