前言介紹
- 這款 WordPress 外掛「Stage WP Plugin Manager」是 2014-04-10 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2014-12-07,距離現在已有 3802 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
- 有 3 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
andrezrv |
外掛標籤
stage | manager | plugins | testing |
內容簡介
如果你是在本機開發 WordPress,你可能會有一些啟用的外掛,但在你要佈署到伺服器時並不需要。當然,你可以在佈署前在本機停用它們,或者在遠端伺服器佈署後再停用它們,但如果你未來要在本機上進行工作(特別是當你從遠端更新本機資料庫時),你又需要啟用它們。在這種情況下,每個階段手動啟用和停用外掛的整個流程可能會讓你很沮喪,甚至浪費很多時間。
Stage WP Plugin Manager 旨在以快速而優雅的方式解決這個問題,通過自動“假”的啟用每個階段所選的外掛來解決問題:你附加到階段的每個外掛都將立即被視為該階段上的活動外掛,無論其先前狀態如何,或者其在其他階段的當前狀態如何。由於只有活動外掛清單被過濾而不是重寫,因此您可以通過分離其來恢復外掛的先前狀態,並通過停用 Stage WP Plugin Manager 回到原始設置。
請非常仔細地閱讀以下說明。
入門
Stage WP Plugin Manager 假設你的工作流程如下:
在 WordPress 配置文件(通常是 wp-config.php)中,你有一個名稱為 WP_STAGE 的常數。
WP_STAGE 的值是支援的階段之一。預設支援的階段是 local、staging和 production。
WP_STAGE 在你的每個階段中都不同。
一些開發人員喜歡為他們的每個階段保留不同的配置文件,或者基於某些評估改變常數的值。例如,你可以在 wp-config.php 文件中加入如下內容:
if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) {
define( 'WP_STAGE', 'local' );
} elseif ( file_exists( dirname( __FILE__ ) . '/staging-config.php' ) ) {
define( 'WP_STAGE', 'staging' );
} else {
define( 'WP_STAGE', 'production' );
}
如果你遵循這個範例,請注意 local-config.php 不應該在佈署到中和生產環境時包含,local-config.php 和 staging-config.php 在你的生產階段中都不應該存在。
附加和分離
安裝這個外掛後,您會注意到在清單中的每個已啟用的外掛下面,會多一個連結,寫有“附加到 [your-stage] 階段”。點擊該連結,你就可以讓外掛在你工作的階段中保持啟用狀態,但在其他階段中不啟用(除非你在其他階段中也附加了該外掛)。
如果你想從一個階段中的活動外掛列表中刪除一個外掛,只需要點擊“從 [your-stage] 階段分離”。
此外,你可以通過進入「外掛」>「階段管理」,批次選擇要附加或分離每個階段的外掛。
新增和擴展功能
Stage WP Plugin Manager 允許你通過提供過濾器和動作來擴展其功能。
例如,你可以透過向 stage_wp_plugin_manager_stages 過濾器中添加自定義階段,甚至刪除預設階段,像這樣:
function add_stages( $stages ) {
$stages[] = 'other';
return $stages;
}
add_filter( 'stage_wp_plugin_manager_stages', 'add_stages' );
原文外掛簡介
If you develop in a local machine, at some point you’ll have some active plugins there that you don’t need in the servers that you’re deploying to. Sure, you can deactivate them in your local machine before deploying, or after deploying in the remote ones, but you’re gonna need them again to be active if you want to perform local work in the future, specially when you update your local database from a remote one. On such kind of scenarios, the whole process of manually activating and deactivating plugins for each stage can be really frustrating, sometimes even taking a lot of your time.
Stage WP Plugin Manager is meant to solve that problem in an quick and elegant way, by doing an automatic “fake” activation of the plugins you select for each stage: every plugin you attach to a stage will be immediatly treated as an active plugin on that stage, no matter what its previous status was, or its current status on the other stages. Since the list of active plugins is just filtered instead of rewritten, you can restore the previous status of a plugin by detaching it, and go back to your original setup by deactivating Stage WP Plugin Manager.
Please read the following instructions very carefully.
Getting Started
Stage WP Plugin Manager works on some assumptions about your workflow:
You have a constant named WP_STAGE defined in your WordPress configuration file (often wp-config.php).
The value of WP_STAGE is one of the supported stages. The default supported stages are local, staging and production.
The value of WP_STAGE is different in each of your stages.
Some developers prefer to keep different configuration files for each one of their stages, or change the values of their constants based on some evaluation. For example, you could have something like this in your wp-config.php file:
if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) {
define( 'WP_STAGE', 'local' );
} elseif ( file_exists( dirname( __FILE__ ) . '/staging-config.php' ) ) {
define( 'WP_STAGE', 'staging' );
} else {
define( 'WP_STAGE', 'production' );
}
If you follow this example, note that local-config.php should not be included in your deployments to staging and production, and both local-config.php and staging-config.php should not exist in your production stage.
Attach & Detach
Once you have installed this plugin, you will notice that a new link appears under each active plugin of the list, which reads “Attach to [your-stage] stage”. By clicking that link, you are setting a plugin to be always active in the stage you’re working at, and not active on the other stages (unless you attach the plugin to the other stages too).
In case you want to remove a plugin from the list of active plugins for a stage, you just need to click the “Detach from [your-stage] stage”.
Additionally, you can make bulk selections of plugins to be attached or detached for each stage by going to Plugins > Stage Management.
Add & Extend Functionality
Stage WP Plugin Manager allows you to extend its functionality by offering hooks for filters and actions.
For example, you can add your custom stages or even remove the default ones by hooking in the stage_wp_plugin_manager_stages filter, having something like this in your plugin:
function add_stages( $stages ) {
$stages[] = 'other';
return $stages;
}
add_filter( 'stage_wp_plugin_manager_stages', 'add_stages' );
Additionally, you can give a nicer name to your new stage by hooking in the stage_wp_plugin_manager_stages_txt filter:
function add_stages_txt( $stages_txt ) {
$stages_txt['other'] = __( 'Other stage' );
return $stages_txt;
}
add_filter( 'stage_wp_plugin_manager_stages_txt', 'add_stages_txt' );
Here’s the complete list of actions and filters that Stage WP Plugin Manager offers:
Action hooks
stage_wp_plugin_manager_before_init: Perform some process before Stage WP Plugin Manager initializes.
stage_wp_plugin_manager_init: Perform some process after Stage WP Plugin Manager initializes.
Filter hooks
stage_wp_plugin_manager_stages: Modifiy the current supported stages.
stage_wp_plugin_manager_default_stage: Modify the default stage.
stage_wp_plugin_manager_managed_plugins: Modify the list of plugins managed by Stage WP Plugin Manager.
stage_wp_plugin_manager_stage_plugins: Modify the list of plugins attached to the current stage.
stage_wp_plugin_manager_non_stage_plugins: Modify the list of managed plugins that are not attached to the current stage.
stage_wp_plugin_manager_nonce_key: Modify the nonce key used for data validation.
stage_wp_plugin_manager_help_description: Modify contents of “Description” help tab.
stage_wp_plugin_manager_help_getting_started: Modify contents of “Getting Started” help tab
stage_wp_plugin_manager_help_attach_detach: Modify contents of “Attach & Detach Plugins” help tab
stage_wp_plugin_manager_help_add_extend: Modify contents of “Adding Stages & Extending” help tab
stage_wp_plugin_manager_help_credits: Modify contents of “Credits” help tab
WordPress MultiSite Compatibility
If you’re using MultiSite and set this plugin to network activated, you can use it to attach plugins to stages on a sitewide basis 🙂
Improve Your Workflow
This plugin was originally meant as a complement for WP Bareboner, an advanced Git model repo, and Stage WP, a deployment tool based in Capistrano. The three projects work really well separated, but their real power can only be seen by using them together.
Contribute
You can make suggestions and submit your own modifications to this plugin on Github.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Stage WP Plugin Manager」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
WP Rollback – Rollback Plugins and Themes 》這個外掛可以快速、輕鬆地將 WordPress.org 的任何主題或外掛回滾至任何之前(或更新)的版本,無需手動操作。它的操作方式就像是外掛升級一樣簡單,只是您是...。
Download Plugin 》, 啟用此外掛。, 在外掛頁面下方,您可以看到每個外掛名稱下方的下載連結。, 點選任何一個下載連結,即可下載該外掛的 zip 檔案到您的電腦上。, 好了,就這樣...。
Advanced Automatic Updates 》Advanced Automatic Updates 為 WordPress 內建的自動更新功能添加了額外的選項。除了安全更新外,它還支持安裝重大版本、外掛、主題甚至是定期的 SVN 檢出!...。
Softaculous 》**Softaculous 提供強大的 WordPress 管理功能**, , **問題:**, 1. Softaculous 是什麼?它提供了什麼特色功能?, 2. 如何在 Softaculous 中管理多個 WordPr...。
WPCore Plugin Manager 》WPCore 是一個工具,允許您管理 WordPress 外掛集合,然後快速安裝它們到任何 WordPress 網站上。您可以在 https://wpcore.com 生成您的集合,然後通過將唯一...。
WP Fingerprint 》為什麼應該使用 WPFingerprint?, WordPress 是全球最受歡迎的開源 CMS,據估計有三分之一的網站使用 WordPress。如果你是黑客,這個巨大的目標會成為你的攻...。
Plugin Notes Plus 》你曾經回到之前建立的網站並問自己:“為什麼我要安裝這個外掛程式?”這個外掛程式在外掛程式頁面上提供了一個額外的欄位,讓你可以添加、編輯或刪除有關你安...。
Embed PDF 》此外掛可使用 Google Docs Viewer 內嵌 PDF 檔案, 只需在獨立一行或使用內嵌標籤 http://example.com/file.pdf 中包含 PDF 文件的 URL,本外...。
Wp Favs – Plugin Manager 》, Wp Favs 是一個批量外掛程式管理工具,讓您從 https://wpfavs.com 匯入您的外掛清單(又稱 Wp Favs),或從 WordPress.org 獲取您喜愛的外掛程式。, 您可以...。
Meks Quick Plugin Disabler 》Meks快速插件禁用器的主要用途是快速找出網站上最近遇到的任何問題是否與當前正在運行的插件之一有關。, 它適用於開發人員、技術支援工程師以及常規的WordPre...。
Comment Form Js Validation 》此外掛可用於 WordPress 網站的評論 JS 驗證,讓您的評論表單更加安全。此外掛的選項,可讓您設置自己的驗證訊息,也可添加 Google Captcha (reCAPTCHA)。, ...。
WP Disables Updates 》WP Disables Updates 允許您禁用插件、佈景主題、翻譯或 WordPress 核心更新。, 主要功能:, , 禁用插件更新。, 禁用佈景主題更新。, 禁用翻譯更新。, 禁用 W...。
WIP Custom Login 》WIP Custom Login 可以讓您自定義 WordPress 的登入區域,您能夠取代管理員 WordPress 徽章、設定背景圖片等等。, , 高級功能。, , 預設外觀, 您可以設定預...。
Plugins List 》功能, 此外,外掛還具有以下功能:, , 可透過短代碼在任何頁面上插入插件列表, 可以選擇要輸出的插件數據為哪些資訊, 可輸出啟用和未啟用的插件,也可設定描...。
Plugin Security Scanner 》此外掛可檢測您的其他外掛或佈景主題是否存在安全漏洞,方法是通過查閱 WPScan 漏洞數據庫中的相關詳細信息。, 系統會每日執行一次掃描,當偵測到有漏洞存在...。