In WPCloudDeploy 4.16.2 we slipped in a new feature focused on developers. We weren’t planning on releasing it until V4.17 but it was ready so we slipped it into a fast-ring point release.
Internally we just call it ‘post-processing scripts’.
In the simplest terms, it allows you to setup a remote bash script that will execute just before the end of the server and site provisioning process.
How It Works
Just before we exit the setup of a new server or site, we’ll reach out to the URL you provide and execute the BASH script located there.
What Can You Do With It?
There are some really cool things you can do with this such as:
- Use calls to WP-CLI to download and install plugins and themes from wordpress.org or other locations.
- Add or update wp-config.php settings
- For plugins that allow license keys and other data in the wp-config.php file, you can add those in and then call their activation functions.
- Update the maximum file download size
- Install additional PHP modules
Anything you can do with a BASH script you can do with your post-processing script. This includes reaching out to other services via REST APIs, installing things like NodeJS, Git, Python and more.
This mechanism is a nice alternative to cloning a template site as a starter site.
When using a cloned site as a starter site you almost always end up having to run updates as the first step. With post-processing scripts, you might be able to just create your starter site dynamically with the most up-to-date plugins and themes.
And, of course, you can pull code from your github/bitbucket or other git compatible repo.
Preserving The Upgrade Path
This feature also means that, for some common changes, you no longer have to create a custom add-on to preserve the WPCD core upgrade path.
Instead of modifying the WPCD bash scripts directly or creating a custom add-on, you can apply your own at the end of the process to update or even reverse our scripts.
Then, when the next update shows up, your changes will not be overwritten.
Because these scripts execute on the SERVER, you do not have access to the WPCD plugin itself. This means that you cannot record values in a server or site meta-field. If you need this capability you’re back to creating your own WPCD add-on.
Still, there’s a LOT you can do with these scripts where you do not need access to the WPCD plugin.
If you’re a developer we hope you really like this feature and we look forward to seeing how you exploit it! And, of course, if you need it, we offer custom development services to create these scripts for you.
Automatic Notification Of New Articles
Sign up to get automatic notifications of new articles. This is a different list than our standard list - you only get new articles once a week (usually on Mondays). No other emails will be sent unless you sign up for our general list as well.
Follow us on Twitter! We post a lot of cool things there first. Click the bird below!