這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Control Live Changes

外掛說明

This plugin has arisen from the requirements of a client who manage many of their WordPress sites via Git repositories on Beanstalk. Core WP files are not in the repo, to keep its size down, but plugins and themes are. WP upgrades are of course tested on local development and remote staging servers before being run on the production server. But since plugins and themes are in the repo, ideally they should be upgraded locally for testing, then pushed to Beanstalk. Beanstalk in turn deploys the changes to the staging server, and then the production server.

To help maintain this workflow, this plugin tests if the environment is local or not (checking for WP_LOCAL_DEV or searching for “localhost” in $_SERVER['HTTP_HOST']). If the environment isn’t local, plugin and theme installation, editing and upgrades are disabled.

The following constants can be defined in wp-config.php to override the defaults:

  • SLT_CLC_LOCAL_STRING – The string to search for in $_SERVER['HTTP_HOST'] that will indicate a local development environment. Default: "localhost"
  • SLT_CLC_DISABLE_REMOTE_CORE_UPGRADES – Default: false
  • SLT_CLC_DISABLE_REMOTE_PLUGIN_THEME_UPGRADES – This will also disable editing plugin and theme files via the admin interface. Default: true
  • SLT_CLC_OUTPUT_NOTICES – Whether to output explanatory notices on the upgrades, themes, and plugins admin pages. Default: true
  • SLT_CLC_CORE_NOTICE – Default: "Core upgrades are currently disabled on this server by the Control Live Changes plugin."
  • SLT_CLC_PLUGIN_THEME_NOTICE – Default: "Plugin and theme upgrades are currently disabled on this server by the Control Live Changes plugin."

An alternative to the SLT_CLC_LOCAL_STRING check for a local environment is the WP_LOCAL_DEV constant. This is used by Mark Jaquith in his technique for defining local database connection details in a separate file (http://markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips/). If WP_LOCAL_DEV is set to true, the SLT_CLC_LOCAL_STRING check is made irrelevant.

Development code hosted at GitHub.

安裝方式

  1. Upload the control-live-changes directory into the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. If necessary, define constants in wp-config.php to override the plugin defaults – see the Description for details.

NOTE: Instead of the above, you may want to drop the control-live-changes.php file into the /wp-content/mu-plugins/ directory to ensure that no one deactivates this plugin!

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Control Live Changes〉的開發相關工作。

參與者

將〈Control Live Changes〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

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

變更記錄

0.2.2

  • Improved screen checking for plugins and theme pages

0.2.1

  • Added tests for constants that might already be defined

0.2

  • Improved disabling functionality by using the map_meta_cap filter

0.1

  • First version