Unlike other WordPress hosting platforms, on SwiftShield, the WordPress base/source code is completely hidden away and managed by our build systems. If you are using only standard public themes/plugins then these can be installed via the Appearance -> Themes and Plugins sections of the WordPress admin. There’s no need for you to transfer files/manage updates or any of the other tiresome administrative tasks normally associated with managing a WordPress instance.
However if you have your own custom code in the form of custom themes, custom plugins or your own PHP libraries, then you need to make use of Composer to define these custom libraries and tell our systems how and where to find them.
When you login into your WordPress admin on SwiftShield, you will see a menu item in the admin menu titled “SwiftShield”, if you open this and then click on the “Composer” tab you will see an editable Composer JSON file. This is where the dependencies for your WordPress instance are defined. You can edit this file to add custom themes, plugins or composer libraries. When you hit “Save” our build system will read in your changes, rebuild your site with the new dependencies and deploy the updated site to our servers (this process typically takes about 4 minutes).
Including custom themes/plugins from private repositories
If you require the use of custom themes or plugins (or indeed any Composer PHP library), you will need to place your code in a git repository such as GitHub or BitBucket. There are two ways to approach this:
The “official” composer way
With this method, each of your custom plugins/themes lives in it’s own separate repository, which contains a dedicated composer.json in the root. This is the way composer libraries are typically made available and you can then add them to your site by adding a repository stanza to your composer file EG
"repositories": {
"swiftshield-plugin": {
"type": "vcs",
"url": "git@bitbucket.org:crimble-crumble/wordpress-plugin-swiftshield.git"
}
},
This will then make the plugin/theme in this repository available to be added in the “require” stanza of the file EG:
"require": {
"swiftshield/swiftshield": "*",
}
Although this is a nice clean way to handle your private dependencies, sometimes it is more practical to maintain a single repository which contains all of your custom themes/plugins/modules in a single repository. In this case, you will use the:
Single Repository Method
This method allows you to manage all of your custom code in a single repo and tell your composer file where to go and find them. This method is unique to SwiftShield and utilised some custom composer configuration.
To be continued…