WP-CFM

外掛說明

WP-CFM 能讓網站管理員將資料庫中儲存的網站組態複製至檔案系統,反之亦然,這樣便能輕鬆部署組態變更而不需複製整個資料庫。WP-CFM 與 Drupal 的功能模組功能相近。

使用 WP-CFM 能讓網站管理員的受益之處

  • 不需複製整個資料庫。
  • 不必急於找出網站管理員遺忘的設定變更。
  • 透過 git、subversion 等的功能輕鬆追蹤及版本組態變更。

WP-CFM 支援的資料

  • WordPress 設定 (wp_options 資料表)
  • 多站網路設定 (wp_sitemeta 資料表)
  • 分類法詞彙
  • Custom Field Suite 欄位群組

術語解釋

  • 組態組合:要追蹤的一或多個設定組成的群組 (組態組合名稱建議使用英文命名)
  • 推送:將資料庫儲存的設定匯出至檔案系統
  • 提取:將儲存於檔案中的設定匯入至資料庫

WP-CLI

WP-CFM 支援使用 WP-CLI 的命令列命令 wp config pullwp config pushwp config diff (由外掛新增) 對組態組合進行對應的操作:

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

網站管理員可以將 bundle_name 設定為 all 以納入全部組態組合。

在命令後方附加 --network 便能納入多站網路組態組合。

篩選器

請參考 GitHub Wiki 參照頁面中的篩選器說明。

螢幕擷圖

  • 外掛功能管理設定頁面
  • 編輯組態組合中的組態
  • 差異檢視器可以追蹤組態組合中的變更

安裝方式

  1. 下載並啟用外掛。
  2. 前往 [設定]→[WP-CFM] 以進行組態。

使用者評論

2021 年 4 月 11 日
Great plugin guys! Makes life so much easier. One request: would it be possible to add an ajax search field to search wp_options? Finding the right option can be difficult on sites with lots of wp_options entries.
2020 年 3 月 24 日
This plugin, especially in terms of exporting and importing various Woocommerce settings and Woocommerce Addons, this plugin is so so useful.
2016 年 9 月 3 日
Awesome plugin for tracking configuration in version control. I auto import bundles in my test and live environments when deploying from development which saves me a ton of time from having to make the same configuration updates over and over.
2016 年 9 月 3 日 5 則留言
Great plugin, works as advertised. I'm using the plugin to deploy settings and keep them under version control. If it could just save advanced custom fields and page/sub-page structure it would be essential on any site
閱讀全部 9 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈WP-CFM〉的開發相關工作。

參與者

〈WP-CFM〉外掛目前已有 3 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈WP-CFM〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.7.5

  • Fix: Tested with latest WordPress release v6.0.2. Removing the plugin outdated notice at WordPress.org plugin repository.

1.7.4

  • Fix: Pantheon Quick Silver hooks silently failing to pull updated configuration.

1.7.3

  • Fix: PHP notice “WP_Scripts::localize was called incorrectly”. The $l10n parameter must be an array.

1.7.2

  • Improved: Fix Warning invalid argument supplied on CLI command.

1.7.1

  • Improved: Cache results of WPCFM_Registry::get_configuration_items() (props @fariasf).
  • New: Added --format parameter for the bundles command to retrieve bundle information from the CLI (props @gilzow).
  • Improved: Use home_url() instead of WP_HOME since this one isn’t always guaranteed to be set (props @kyletaylored).
  • Fix: Warning invalid argument supplied for foreach() on CLI command (props @adnoh).

1.6

  • Improved: Following WordPress best practices. Including CSS and JS scripts for plugin admin page using admin_enqueue_scripts action.
  • New: Filters wpcfm_multi_env and wpcfm_current_env to activate multiple environments functionality.
  • New: Detects Pantheon hosting automatically and activates the multiple environments functionality. Registers out of the box dev, test and live for Pantheon.
  • New: Filter wpcfm_is_ssot adds capability to set configuration bundles as the Single Source of Truth (SSOT), rather than the database, for all tracked options.

1.5.1

  • Fix: Tested with latest WordPress 5.2.1. Removing the plugin outdated notice at WordPress.org plugin repository.

1.5

  • New: Toggle to show/hide already registered options (props @mickaelperrin)
  • New: wpcfm_config_format filter allow export configuration as YAML files (props @mickaelperrin)
  • New: Check configuration file exist before import (props @mickaelperrin)
  • Fix: File bundle properties are not checked (props @mickaelperrin)
  • Fix: Import wp-cfm settings (props @mickaelperrin)
  • Fix: Bad PHP Version comparison (props @mickaelperrin)
  • Fix: Undefined constant WPCFM_CONFIG_FORMAT_REQUESTED (props @mickaelperrin)
  • Improved: Better Custom Field Suite plugin detection (props @s3ththompson)

1.4.5

  • Fix: only the first taxonomy was showing in the admin UI (props @Rebenton)

1.4.4

  • New: wpcfm_config_dir filter (customize config dir)
  • New: wpcfm_config_url filter (customize config url)
  • Fix: issue with .dot files in config directory
  • Fix: PHP7 warning

1.4.3

  • Fixed: WP-CLI diff (props @mortana42)

1.4.2

  • Fixed: pulls broken due to taxonomy bug
  • Fixed: Custom Field Suite support
  • Improved: code formatting

1.4.1

  • Wrapped CFS integration into a class
  • Removed unnecessary diff code
  • Code formatting tweaks

1.4

  • New: support for taxonomy terms
  • Improved: better usability for response messages
  • Improved: replaced multiselect UI tool
  • Fixed: diff viewer highlighting issues
  • Added screenshots

1.3.2

  • wp-cli diff support (props @joshkoenig)
  • wp-cli show bundles support (props @joshkoenig)
  • wp-cli get bundle details (props @joshkoenig)

1.3.1

  • Fix for bundle deletion
  • Better WP-CLI network support
  • Now using “wp_mkdir_p” to check for writable config folder
  • Updated translations

1.3

  • Multisite support (props @alfreddatakillen)
  • Added download link for each bundle (props @alfreddatakillen)
  • Notification when the same option is stored in multiple bundles
  • Subclasses can be accessed as base class variables
  • Fix: ensure that “old_value” exists
  • Updated translations

1.2

  • Made “diff viewer” close button appear clickable
  • Fixed bug with Custom Field Suite and loop sub-fields

1.1

  • Added support for a config option label
  • Added get_facet_by_name helper method
  • Admin UI now recognizes file bundles
  • Better error handling

1.0.5

  • Synchronize bundle config options list with file during Pull

1.0.4

  • Added i18n support
  • Fallback for JSON_PRETTY_PRINT when PHP < 5.4
  • Fixed PHP notices when doing Pulls
  • Excluded some unnecessary CFS config options

1.0.3

  • Added relative plugin URL (props @tormjens)
  • Added subtle admin screen animations
  • Better file error handling
  • CFS integration – each field group now has its own configuration item
  • Added wpcfm_pull_callback filter
  • Moved the “all” bundle handler from the ajax class to readwrite

1.0.2

  • Fix: error when Custom Field Suite isn’t active

1.0.1

  • Custom Field Suite integration