PHPackages                             awei01/version-controlled-wordpress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. awei01/version-controlled-wordpress

ActiveProject[Utility &amp; Helpers](/categories/utility)

awei01/version-controlled-wordpress
===================================

Version controlled wordpress boilerplate

v0.0.6(9y ago)29MITPHP

Since Feb 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/awei01/version-controlled-wordpress)[ Packagist](https://packagist.org/packages/awei01/version-controlled-wordpress)[ RSS](/packages/awei01-version-controlled-wordpress/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

Version Controlled Wordpress
============================

[](#version-controlled-wordpress)

This is an opinionated boilerplate installation of wordpress that seeks to make development and deployment more manageable by allowing everything to be under source control, including media uploads and database.

While this boilerplate should work on any operating system, this readme is written with Linux/Debian system in mind. You'll have to google alternative commands for your particular environment.

Note that on Windows environments, symlinks are kind of a pain to accomplish. You'll have to google how to resolve these.

Motivation
----------

[](#motivation)

Wordpress was born in an age when FTP was the best tool used to publish websites. It was primarily intended for designers and not developers. As a result, maintenance and version control are a nightmare. This repository seeks to mitigate some of the headaches a developer may encounter when developing and maintaining a Wordpress installation.

This repository assumes that you are technically proficient enough to find your way around a server via a command prompt.

Default Configuration
---------------------

[](#default-configuration)

All the following configurations can be disabled via the `.env` file

- File-based caching: Store cache in the file system `storage/cache` instead of your `wp_options` table.
- File-based database: Now you can version control your blog content. You don't have to export/import a mysql dump.
- Upload folder outside of `wp-content`: Your `uploads` folder is located outside of `wp-content`. This way, you can version control your uploads.
- Automated plugin management: Manage your plugins via `composer.json` without relying on the web-based installation process.
- Disable automated updates: Core, plugins and themes updates are disabled, saving database read/writes. You now have finer control over versioning via `composer.json`.
- Suppress admin menu items and widgets: Themes and plugins menu items are hidden by default since they're now managed via `composer.json`. Certain dashboard widgets are removed by default.

System Requirements
-------------------

[](#system-requirements)

Note: All of the following commands are for Debian based systems.

- A webserver: While any server should technically work with this codebase, I'm assuming Apache and provide a sample config file in `/server/apache.example.conf`. To install: `apt-get install apache2`
- PHP &gt;5.6: While earlier versions of PHP may work, I've developed this boilerplate using PHP 5.6.17-3. `apt-get install php5`
- SQLite PDO driver: `apt-get install php5-sqlite` This overrides the default MySQL database. If you really want MySQL, there are ways to re-enable it.
- Git: A version control tool. `apt-get install git`
- Composer: A PHP package manager. [Installation instructions](https://getcomposer.org/download/)

Suggested Installation
----------------------

[](#suggested-installation)

- Install via Composer: `composer create-project --prefer-dist awei01/version-controlled-wordpress `
- Change directory into your folder: `cd `
- Initialize your repository so that you can start checking in your code changes: `git init`

When using the above step on a virtual machine, I have encountered issues with the symbolic links within the project breaking. I'm not sure why this is occurring. To fix the problem, you can try the Alternative Installation instructions or, manually fix the symlinks yourself.

Alternative Installation
------------------------

[](#alternative-installation)

- Clone this repository: `git clone https://github.com/awei01/version-controlled-wordpress.git ./`
- Change directory into your folder: `cd `
- Have Composer install dependencies: `composer install`
- Rename the git remote to upstream: `git remote rename origin upstream`
- Initialize your repository so that you can start checking in your code changes: `git remote add origin `

### Continue Set Up

[](#continue-set-up)

- Copy `.env.sample` to `.env` and edit the values to suit your configuration
- Ensure `storage` folder is recursively is writeable `chmod -R 766 storage`
- Copy and edit your `server/apache.example.conf` into your Apache `sites-enabled`
- Restart Apache
- Browse to your domain and you should get the Wordpress installation page.
- The default location for Wordpress admin is `http:///wp/wp-admin`

Required Symlinks
-----------------

[](#required-symlinks)

- `public/wp` points to `wp` for wordpress core files
- `public/content/db.php` points to `modules/sqlite/init.php` to use SQLite instead of MySQL
- `public/content/object-cache.php` points to `modules/file-cache/init.php` to use file-based caching
- `public/content/plugins` points to `/wp-plugins` for Composer managed wordpress plugins
- `public/uploads` to `storage/uploads` for uploaded media

Composer Managed Modules
------------------------

[](#composer-managed-modules)

- `vlucas/phpdotenv`: Allow loading environment specific configurations via flat file.
- `illuminate/cache`: Allow for file-based caching
- `illuminate/filesystem`: Allow for file-based caching
- `symfony/var-dumper`: Supporting modules for `illuminate/cache`

Composer Managed Wordpress Plugins
----------------------------------

[](#composer-managed-wordpress-plugins)

These can be found on  or

- `johnpbloch/wordpress`: Core module to manage Wordpress through Composer.
- `disable-all-wp-updates`: To prevent wordpress from checking for newer versions.
- `sqlite-integration`: So we can check in a flat file for the database.

Installing plugins/themes
-------------------------

[](#installing-pluginsthemes)

Plugins and themes are now managed via the `composer.json` file.

- Use  to locate your plugin or theme and add it to the `require` section of `composer.json`.
- Run `composer update` from the command line to install the new dependencies.
- If you've installed a plugin and you're using file-based caching, you'll need to delete the cache first: `rm -rf storage/cache/*`
- Browse to your site again and your new plugins will be activated.

Migrating an Existing Wordpress Installation
--------------------------------------------

[](#migrating-an-existing-wordpress-installation)

Here are some suggestions on migrating your existing installation. These instructions all assume you're using the default configurations for this repository.

### Backup

[](#backup)

- You should cover your ass by backing up the existing installation. Use `mysqldump` to get a full dump of your database. Compress and save the existing codebase, including your `uploads` folder.

### Setup

[](#setup)

- Create a new local development environment using this repository.
- Modify `composer.json` so that the version of `johnpbloch/wordpress` matches your current installation. \* If you want to upgrade your Wordpress core version, I suggest doing it after migration is complete.

### Plugins

[](#plugins)

- Search for your plugins on  and add them to your `composer.json`. You'll probably want the exact versions that you have already installed on your existing application. If you want to try a later plugin version, you can give it a shot. It should be trivial to switch between plugin versions.
- If you've made code-related customizations to your plugins, you can copy these directly into the `wp-plugins` folder and update `.gitignore` files so that these customizations are saved in your repository. In this case, do not add the plugin to your `composer.json`.

### Themes

[](#themes)

- Same as plugins; find the appropriate module and add them to your `composer.json`.
- If you've made code-related customizations to your themes, copy these directly into the `wp-themes` folder and update `.gitignore` files so that these customizations are saved in your repository.
- If you've made theme customizations and you know you're not going to switch themes going forward, you can just copy your theme files into `/theme` and it will just show up as the `default` theme.

### Preview

[](#preview)

- Fire up apache and browse to your local server. You will be prompted to create a new Wordpress installation.

### Migrating Content

[](#migrating-content)

At this point, you should have a clean install of your site. Of course, your posts, pages, comments, etc., will not have been migrated yet.

#### Simple Export/Import

[](#simple-exportimport)

- Leverage the default Wordpress exporting capabilities by going to the admin interface of your production environment and navigating to `Tools > Export`.
- Download the export file and save it on your development machine.
- Install the `wpackagist-plugin/wordpress-importer` in your `composer.json` on your local environment.
- On your environment admin interface, you can now go to `Tools > Import` and follow the instructions to import the file you just downloaded.

#### Advanced Export/Import

[](#advanced-exportimport)

- Use the `mysqldump` script from your production environment and replicate the MySQL database locally.
- You'll need to convert your MySQL script to SQLite somehow. I've used the tool `RazorSQL` (free for 30 days) with some success.
- Copy your `uploads` directory into the `/storage/uploads` folder. Now all your images should exist on your server.

Suggestions and Pull Requests are welcomed
------------------------------------------

[](#suggestions-and-pull-requests-are-welcomed)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~48 days

Total

6

Last Release

3559d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1174aaee56b8d9abbdf27d09a8daf8f275b2eb4f79ec3668b52d959d7d443166?d=identicon)[awei01](/maintainers/awei01)

---

Top Contributors

[![awei01](https://avatars.githubusercontent.com/u/2857763?v=4)](https://github.com/awei01 "awei01 (72 commits)")

---

Tags

wordpressversion control

### Embed Badge

![Health badge](/badges/awei01-version-controlled-wordpress/health.svg)

```
[![Health](https://phpackages.com/badges/awei01-version-controlled-wordpress/health.svg)](https://phpackages.com/packages/awei01-version-controlled-wordpress)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k441.8k2](/packages/roots-bedrock)[wordpress/skeleton

Composer based WordPress project skeleton.

461.7k](/packages/wordpress-skeleton)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
