How to Set Up VersionPress for Git-Powered Version Control
One of the best things about WordPress is how easy it is to make sweeping changes to a website in just a few minutes. But with no easy way to revert a website to a previous state, you can lose a lot of work very quickly if you aren’t careful.
VersionPress brings the power of Git to WordPress so you can make as many changes as your want with the knowledge that undoing any change is just a click away.
If you’ve ever created even a simple website from scratch you can better appreciate the power of WordPress. With WordPress, a few clicks is all it takes to completely change the appearance of your site by installing a new theme, new features can be added in an instant by installing a plugin, website users can be managed with ease, and all of this can be done without typing a single line of code.
The only problem is that most actions in WordPress are irreversible. With the exception of page and post revisions, which are tracked pretty well by the WordPress core, if you want to undo any changes you have to recreate them. Even worse, unless you’re a WordPress developer, there’s a good chance that a lot of the changes you make to your site are made to your live site, meaning that if something goes wrong the consequences could be severe.
VersionPress is a project that promises to change all of that. By bringing the power of Git version management to WordPress websites, VersionPress adds an undo button to every single change made to a WordPress website. Make a change you regret and undoing that change is just a button click away.
Continue reading, or jump ahead using these links:
- VersionPress: The Basic Idea
- Bringing a Big Idea to Market
- The Future of VersionPress
- Taking VersionPress for a Test Drive
- What Does the Future Hold for VersionPress?
VersionPress: The Basic Idea
The basic concept behind VersionPress is summed up in a few simple ideas. VersionPress is a tool that can be used to:
- Track every change made to a WordPress website.
- Make it easy to undo a single change, a group of changes, or to revert a website to a previous state by undoing all changes back to that point.
- Make it easy to work with staging sites and merge the staging site database back with the live database without losing any data from either database.
- Make backups much more efficient.
- Make version control and staging accessible to non-technical WordPress users.
In essence, VersionPress is designed to be “the Undo button for WordPress”.
- Make a content change you wish you hadn’t? Just hit Undo.
- Change the permalink structure accidentally thereby breaking all post links in the process? No problem. Just hit Undo.
- Switch themes only to realize you now have a bunch of ugly shortcodes to clean up? Hit Undo, create a staging environment, clean them up, and push the changes from the staging site to the live site without losing any updates made to your live site in the meantime.
- Need to downgrade to a previous version of WordPress due to plugin incompatibility with the latest version of WordPress? No problem, VersionPress will even let you undo core updates.
And that’s just the tip of the iceberg. VersionPress aims to track every tiny change, even the dismissal of admin notifications, and to make it easy to selectively undo anything. VersionPress is an ambitious undertaking that aims to do nothing less than to
bring version control to the masses.
Bringing a Big Idea to Market
In 2012, two web developers, Borek Bernard and Jan Voracek, began to work on a version control system that would allow them to better coordinate their efforts when working on WordPress development projects. At the time, the system was an internal project the two developers used to manage their own projects, and they worked on the idea as time would allow throughout 2012 and 2013.
By the beginning of 2014, enough of the technical foundation has been laid that they were confident that creating a robust, user-friendly, version control system for WordPress was technically possible. However, it wouldn’t be easy. In order to be able to devote the time needed to develop VersionPress, they were going to need some funding.
VersionPress was announced in June of 2014 and a crowdfunding campaign was launched at the same time. During the crowdfunding campaign, the decision was made to make VersionPress a fully GPL-licensed project so that it would be fully embraced by the WordPress community. However, at that time, VersionPress development was still completed privately by Borek and Jan.
While the crowdfunding campaign went on to raise a modest sum, the response from the WordPress community was enthusiastic and overwhelmingly supportive. As a result, Jan and Borek decided to move forward with the project despite the fact that their fundraising goal was not met.
Following the completion of the crowdfunding campaign, in the second half of 2014, a few pre-release versions of the plugin were made available to campaign backers. Then in January of 2015, an Early Access Program was announced. This was a paid program open to anyone and conceived as a way to fund ongoing development of the plugin while giving supporters early access to the plugin as it reached development milestones. The first major version of the plugin, VersionPress 1.0, was released to Early Access Program members 3 months later, in April of 2015.
In October of 2015, VersionPress 2.0 was released and a round of seed funding in the amount of $400,000 was announced simultaneously. The following month, VersionPress moved to GitHub in anticipation of a switch from a private to an open-source development model, a transition which occurred in April of 2016.
On April 29, 2016, the first completely open-source release of the plugin, VersionPress 3.0, was announced.
While VersionPress 3.0 is still considered an early access version of the plugin, it delivers on the original promise to bring version control to the masses.
- Change tracking in VersionPress 3.0 is thorough and automatic.
- Changes can be undone individually or in bulk.
- Creation of staging sites is supported as is merging of staging sites with the live production site.
However, that doesn’t mean that all the heavy lifting is done. Several major milestones are still planned for the future.
The Future of VersionPress
So what features are still lacking in VersionPress? While much has been done, there is still much left to do:
- VersionPress works best in a private hosting environment, although some shared hosting providers do support it.
- VersionPress is still very much a product for developers and technical users. It is not suited for non-technical users and that has to change for VersionPress to be a long-term success.
- While the plugin works well with fairly standard WordPress sites, VersionPress doesn’t work with many complex plugins and feature-rich themes. Greater compatibility with third-party plugins is a primary area of focus for VersionPress 4.0.
- While staging sites and site cloning is supported, it can only be done through WP-CLI. A user-friendly graphical user interface (GUI) for non-technical users has yet to be developed.
- Multisite is not supported, although multisite support is on the roadmap and contributors toward this specific milestone are wanted.
Taking VersionPress for a Test Drive
VersionPress sounds amazing, so much so that I set up a fresh WordPress installation, downloaded the latest version of the plugin from GitHub, and gave it a test drive.
I should point out at this point that VersionPress is not ready for production sites. If you want to try VersionPress for yourself, set up a brand new WordPress installation and try it out on a site you can afford to break. Also, keep in mind that VersionPress doesn’t yet play nice with a lot of complex plugins and page-builder themes. Better compatibility with complex plugins and themes is on the roadmap for VersionPress 4.0, but for the time being the plugin still isn’t suitable for anything but fairly plain-vanilla WordPress websites.
Here’s what I learned by trying out VersionPress for myself.
Installation is Easy
If you’ve ever installed a plugin manually, you can install VersionPress. Just get the latest release, head to Plugins > Add New, select Upload and install the plugin. After installing the plugin, activate it.
A second activation step completed in the VersionPress admin screen is required to fully activate the plugin. The second activation step includes system requirements checklist that verifies that your hosting environment meets all of the VersionPress system requirements.
If your system fails to meet any of the requirements, VersionPress will let you know which system requirements haven’t been met.
Assuming your system meets all of the requirements, click Activate VersionPress. It may take a minute or two for VersionPress to complete the setup process.
Basic VersionPress Functionality is Solid
Every change you make on a WordPress site while VersionPress is activated will be logged and visible from the VersionPress admin screen. From this screen, you can see and review the details of every change, undo any change, undo multiple changes simultaneously, and completely revert the website to a previous state.
To get things rolling I made a few changes. Here’s what I did:
- I published a new post titled Test Post;
- I created a new page called Test Page;
- I created a new user named Fiction;
- And I added a new comment to the default Hello World post.
Like magic, all of my changes were tracked.
Perhaps even more impressive, when a change is made in one browser tab while the VersionPress admin screen is loaded in a second browser tab, a prompt appears on the VersionPress admin screen letting you know that additional changes have been made and can be seen by refreshing the page..
Undoing a change was also as easy as it could possibly be. All you have to do is select Undo this. Before the change is undone a confirmation message appears with a reminder that it’s a good idea to have a backup on hand since the plugin is still in early release status.
Reverting multiple changes was also very easy. To test this out I went back to one of the earliest changes recorded and selected Roll back to this. Again, a confirmation message appeared and I had to select Ok to rollback to the previous state.
Surprisingly, when I rolled the site back to the previous state I was immediately logged out of the WordPress admin and when I tried to log back in I found myself unable to do so. After resetting my password I realized what had happened. One of the changes I had undone when I opted to roll the site back was a password change. When I reverted the site to its previous state, my password was changed back along with the other reverted changes.
VersionPress Isn’t Ready for the Masses Yet
My VersionPress test drive was not as smooth as it could have been. The truth is that I ran into several roadblocks while setting up VersionPress and putting it through its paces.
First lesson learned: You need to know Git, servers, and WordPress pretty well to set up VersionPress.
In order to use VersionPress, Git must be available on the server. Prior to writing this article I had never installed Git, accessed it using the control line, or used Git for version control. While I’ve played around with GitHub a bit, I admit that I am not as well-versed in version control or Git as I should be.
At first, I tried to get VersionPress running locally on a XAMPP-powered WordPress installation. However, after an hour or two of research into setting up Git and XAMPP to work together I switched to using my hosting account instead.
Thankfully, I have a Siteground hosting account and Siteground is one of the few shared hosting providers known to support VersionPress. I created a brand new WordPress installation manually, removed all plugins, and installed VersionPress without issue.
Things seemed to be going pretty well.
However, when I made changes, they weren’t showing up in the VersionPress admin screen. I thought maybe something had gone wrong during installation. So I deactivated the plugin and attempted to delete it planning to download a fresh copy and reinstall it. However, when I attempted to delete VersionPress an error message was generated, the permissions for the directory where WordPress was installed were changed, and a 403 Forbidden error message was displayed when I tried to access the website Dashboard.
After fixing the directory permissions and reinstalling VersionPress, I was able to ascertain that the changes were being logged by VersionPress but not displayed. A hard refresh of the browser window was required to cause the logged changes to appear in the VersionPress admin screen.
Eventually, I was able to get Git installed and VersionPress running on my local XAMPP-powered environment where it runs beautifully. Changes are logged nearly immediately and show up without requiring a hard refresh. Also, just to make sure, I deactivated and deleted VersionPress locally, and no error messages were generated.
The issues I faced when attempting to use VersionPress with my SiteGround hosting account taught me another lesson.
Second lesson learned: VersionPress doesn’t work everywhere.
If you try out VersionPress, plan on it taking a little while to get your environment set up properly, and don’t use VersionPress on a production site without keeping separate backups at frequent intervals.
Another realization I came to while looking into VersionPress is that you have to use WP-CLI to access the staging and database merging capabilities of VersionPress. While a user-friendly GUI for non-technical users is in the works, for the time being, WP-CLI is the only way to access these features.
The third lesson learned: If you’re going to use VersionPress 3.0 you need to be comfortable with SSH, know your way around the command line, and be familiar with WP-CLI to get the most out of VersionPress.
What Does the Future Hold for VersionPress?
The team behind VersionPress is pushing for a product that makes staging, database merging, and version control accessible to non-technical WordPress users. VersionPress hasn’t quite reached this lofty goal and there is still progress to be made on several fronts:
- Support for run-of-the-mill shared server hosting needs to improve;
- Support for multisite needs to be developed;
- Access to advanced features, such as staging sites, needs to transition from the command line to an easy-to-use graphical user interface.
Considering the current rapid pace of progress and the financial backing the project now enjoys, I believe it’s only a matter of time until VersionPress delivers on the promise to make version control and site staging a reality for everyday WordPress users. Once that happens, VersionPress will be an invaluable tool not just for WordPress developers, but also for the masses of everyday non-technical WordPress users.Tags: