Template Versioning- Week 5

What I’ve been working on

This week I have been working on the default version control system. Once I finally figured out how custom posts work and how I wanted to store the information, implementing the methods wasn’t too bad.
The one hold-up that I had was that I couldn’t quite figure out why the slashes were being stripped from my file content strings, but then I saw that add_post_meta strips the slashes from the post_meta values and simply added extra slashes in order to compensate for this.

Current Status

I’m almost finished with the full implementation of the default VCS I just have one or two more methods to finish coding which shouldn’t be very hard at all. I plan on finishing this up today or tomorrow. At that point I will be ready to start considering how to integrate my code with the UI.

The Revision Class

I have decided that I am changing the way the Revision class is to be used. It will be analogous to a post object in wordpress- it will simply be the way that I return the revision data : files/their names, commit message, the revision identifier. That way if another plugin wishes to do some additional data manipulation they have the choice of extending the Revision class or putting the code in their adapter.


  1. Currently I am considering whether or not to make the default VCS included by default with the plugin installation, and subsequently a user would deactivate it from a settings page. Alternatively I could make it into a separate plugin that the user would have to install in order for the version control system to work at all.
  2. If a user has multiple VCS adapter plugins installed, how do they select which one to use? Should I have a plugin page, or should I simply specify that the user may only have one VCS adapter plugin active at any given time?
  3. I’m considering how exactly to hook in the adapter plugins into the main plugin. I’m probably going to use the settings API. Depending on what I decide to do with the default VCS, if I decide to include it in the main plugin code as it is right now, I may code a “dummy” plugin that doesn’t really do anything in order to test that the adapter plugins correctly integrate with the main plugin.

As always, any comments/suggestions are appreciated!