Introduction To WordPress Deployment With WP Pusher

For many developers, deploying WordPress code still means copying files over an FTP connection. Error prone and inefficient. The good news: There's a better way!

What is a deployment?

What exactly is a deployment? According to the dictionary "to deploy" means "to put into use or action". In a software context, deployment refers to when we release something new to our users. If we are WordPress developers that would often mean shipping an update to a plugin or theme. Deploying code in WordPress often involves the auto updater, both for core and package updates.

The way WordPress works, core updates is taken care of by the auto updater and normally we avoid editing core code. The same goes for plugins and themes that are available through the repositories. When it comes to private code, hosted on GitHub or Bitbucket, however, the auto updater won't help us. Then we need a special tool like WP Pusher to update our code, unless we want to manually copy the changes via FTP - to all our clients' websites.

A note on architecture

The auto updater in WordPress is actually quite powerful and if we want to tap in to the full power of it, we need to understand a few things about the architecture of WordPress. The purpose of WP Pusher is to work along side of the auto updater, so it's critical not to work against it.

The auto updater knows about, and can install and update, the 2 core components of WordPress: The core and the packages (plugins and themes).

This is also why it's usually a bad idea to keep all of WordPress, including all packages, under version control. The WordPress core is meant to be installed once and then updated through the auto updater.

Automatic deployments with WP Pusher

Once you have installed a plugin or a theme with the WP Pusher plugin, you can enable the Push-to-Deploy feature. With Push-to-Deploy enabled, your code will be updated every time you push code to your GitHub, Bitbucket or GitLab repository.

Behind the scenes, your Git host will send a JSON payload to tell WP Pusher that code was updated. When a payload is received and parsed, WP Pusher will instruct the auto updater to fetch the newest code and install it. The auto updater can be used for many things - also for automatic deployments.

Level up with WP Pusher

Up your workflow and try out WP Pusher. Deploy directly from GitHub or Bitbucket and never again copy files over FTP. It works everywhere - even on cheap shared hosting!