WordPress.org

Plugin Directory

WP-CFM

Manage and deploy WordPress configuration changes

WP-CFM lets you copy database configuration to / from the filesystem. Easily deploy configuration changes without needing to copy the entire database. WP-CFM is similar to Drupal's Features module.

How will WP-CFM benefit me?

  • Less need to copy over the entire database.
  • No more rushing to figure out which settings you forgot to change.
  • Easily track and version configuration changes via git, subversion, etc.

Which data does WP-CFM support?

  • WP settings (wp_options table)
  • Multisite settings (wp_sitemeta table)
  • Taxonomy terms
  • Custom Field Suite field groups
  • Coming soon: Advanced Custom Fields support

Terminology

  • Bundle - A group of (one or more) settings to track
  • Push - Export database settings to the filesystem
  • Pull - Import file-based settings into the database

WP-CLI

WP-CFM supports [pull / push / diff] of bundles from the command-line using WP-CLI:

wp config pull [bundle_name]
wp config push [bundle_name]
wp config diff [bundle_name]
wp config bundles
wp config show_bundle [bundle_name]

You can optionally set bundle_name to "all" to include all bundles.

Append the --network flag to include multisite bundles.

How to add custom configuration

add_filter( 'wpcfm_configuration_items', 'my_configuration_items' );
add_filter( 'wpcfm_pull_callback', 'my_pull_callback' );


/**
 * Register custom settings
 *
 * @param array $items Associative array of configuration items
 * @return array
 */
function my_configuration_items( $items ) {
    $items['myprefix_data'] = array(
        'value'     => 'YOUR CONFIGURATION DATA',
        'label'     => 'The value label', // optional
        'group'     => 'The Group Name', // optional
    );
    return $items;
}


/**
 * Tell WP-CFM how to import custom settings
 *
 * $params['name']          The option name
 * $params['group']         The option group
 * $params['old_value']     The current DB value that will get overwritten
 * $params['new_value']     The new DB value
 */
function my_pull_callback( $params ) {
    if ( 'myprefix_data' == $params['name'] ) {
        // Import the data
    }
}

Requires: 3.9 or higher
Compatible up to: 4.2.3
Last Updated: 2015-4-7
Active Installs: 300+

Ratings

5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1