I’ve just released an update to my Revisions plugin released just a few short weeks ago, Revisions. The update to the plugins are in areas both architectural and UI based.
Architectural Improvements
On the architectural side one big improvement was made in the way the plugin created new Revisions of content. In the old version of the plugin a revision was made too late on the post update process after the user clicked the Save/Publish buttons. Effectively the updated post content and the latest revision were the same. In the newer version of the plugin the revision is generated earlier in the WP core processing. This mean we can take a copy of the post content before it is updated by WP core. This means the latest revision is the real previous version of the content.
UI Improvements
For the UI changes there are quite a few.
- Above the revision listing I added two new checkboxes, Minor Edit and a Revisions Status. The Minor Edit checkbox is a single-use option to tell the plugin NOT to generate a new revision when you save the post item. This functions like most wikis. The Revisions Status allow you to totally disable revision generation for the post. This is handy if you just don’t want to use revisions on certain post items. Or if you are like me trying to make some complex edits and just want to disable new revisions because you will be making a dozen or so minor edits. So you can turn it off make you changes then turn it back on.
- I’ve added logic to limit the display of revisions to the last 5 items. Below the list of revisions is a link. When you click this link the page will slide to reveal the older revisions.
- Added checkboxes at each revision to allow deletions. This is pretty handy is you just want to clean house. Not that if you delete revision 5 of 8 the numbering will NOT re sequence itself. But if you delete the latest revision then the revision number will be reused.
- On WP 2.5 and higher I added the Minor Edit and Revision Status checkboxes to the sidebar. This will make it easier to set the checkboxes to keep from scrolling to the bottom of the editor form. And with some jQuery magic when the sidebar checkboxes are set the lower checkboxes are also set.
Future Changes
I still have a long list of changes I’m reviewing for possible inclusionin future releases.
- One change was submitted that included actual changes to plugin to support versioning categories and tags. This was great. But I’m still holding on the change. In my view categories and tags are not as volatile as text content. Beside if a revision used a category that had since been deleted what should the action be?
- How to handle delete of the main post/page. Currently the plugin will delete all revisions when the parent post/page is deleted. I don’t like this. I want to build an interface to allow recreation of a post from a revision.
I also have some other small items on the list but they are not work mentioning. If you have any other suggestions please feel free to send them my way.
Download
You can download version 1.8 of the Revisions plugin from the WordPress.org plugin repository.