a poorly drawn pomander...

Pomander

Deployment automation for Wordpress. This plugin is a set of tasks used to deploy and manage Wordpress sites. This plugin is particularly useful for moving Wordpress sites to different environments with ease.


$ composer global require pomander/wordpress:@stable
	

Load into environment

Include this in all of your environment configurations that use Wordpress. This will load all of the necessary tasks into the environment.


$env->load("Wordpress");

// settings and tasks...
	

This is what you get


deploy:plugins      # Deploy plugins in environment.
deploy:wordpress    # Deploy Wordpress in environment.
htaccess            # Create and deploy .htaccess for environments
setup               # Alias of wpify
uploads:pull        # Download uploads from environment
uploads:push        # Place all local uploads into environment
wp_config           # Create and deploy wp-config.php for environment
wpify               # Wordpress task stack for local machine (1 and done)
	

Existing tasks like deploy are automatically modified to work so you don't have to change your workflow.

Command line usage

Use pom setup to completely bootstrap your development environment.


$ pom setup

 * info fetch Wordpress 3.6
 * info plugin advanced-custom-fields at http://plugins.svn.wordpress.org/advanced-custom-fields/trunk
 * info plugins Successfully deployed.
 * info create database wordpress_development
 * info config creating wp-config.php
 * info htaccess creating .htaccess
 * info wpify success

$ pom staging deploy

 * info environment staging
 * info target ec2-54-227-42-2.compute-1.amazonaws.com
 * info deploy updating code
HEAD is now at ab476f8
 * info fetch Wordpress 3.6
 * info plugin advanced-custom-fields at http://plugins.svn.wordpress.org/advanced-custom-fields/trunk
 * info plugins Successfully deployed.
 * info config creating wp-config.php
 * info htaccess creating .htaccess
	

Every deploy will fetch a fresh copy of Wordpress, deploy your plugins, create a wp-config and htaccess file.

New Settings

Use the wordpress setting to specify which version of Wordpress you need, and any other wordpress specific options.


$env->wordpress(array(
  'version'   => '3.6',
  'db_prefix' => 'wp_',
  'base_uri'  => ''
));

$env->plugins(array(
  // fetches from plugins.wordpress.org
  'advanced-custom-fields' => array('version' => 'latest'),

  // fetches from local folder
  'gravityforms' => array('dir' => 'lib/gravityforms')

  // fetches from git repository
  'wp-github-activity' => array('branch' => 'origin/master' => 'git' => 'https://github.com/alexkingorg/wp-github-activity'),

  // fetches from svn repository
  'more-types' => array('version' => '2.1', 'svn' => 'http://plugins.svn.wordpress.org/more-fields' )

));
	

You can optionally specify a base_uri to run wordpress in a sub directory or on a non standard port.

The plugins setting allows you to specify any plugins that you would like Pomander to deploy.

Plugins can be pulled down from multiple locations, check the example to the right to see them all.

Project Structure

Pomander attempts to use a cleaner and safer structure to keep things sane.


deploy/
public/
--- themes/
--- uploads/
vendor/
--- plugins/
wordpress/
wp-config.php
	

wp-config.php is kept out of the wordpress folder for added security.

Keep your wordpress themes in public.

Plugins are automatically deployed to vendor/plugins.

Wordpress core is kept completely isolated in its own folder. Make sure when you are setting up your web server virtual host, you point the document root to the wordpress folder.