[WordPress] 外掛分享: Environmental Plugin Manager

WordPress 外掛 Environmental Plugin Manager 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Environmental Plugin Manager」是 2013-10-15 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2014-04-11,距離現在已有 4041 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
  • 有 1 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

andrezrv |

外掛標籤

local | plugins | staging | testing | production | development | environment |

內容簡介

非常重要:此外掛已被停用,不再維護。請考慮改用Stage WP Plugin Manager。

若您在本機環境進行開發,當您將程式碼和資料庫部署到暫存或正式伺服器時,您會發現有些已啟用的外掛在暫存及正式環境並不需要。當然,您可以在部署前或之後停用這些外掛,但如果您想要更改程式碼或從遠端更新本機資料庫,您會需要這些外掛再次啟用。這整個啟用及停用外掛的測試流程可能非常令人沮喪,並且有時會是浪費時間的做法。

在這些情況下,環境外掛管理器可成為您的好幫手。不幸的是,由於這個外掛執行的敏感工作,它並不能立刻使用,因此除了安裝此外掛以外,您需要進一步做一些工作。

請仔細閱讀以下說明。

我需要什麼來使其運作?

環境外掛管理器以您的工作流程為假設:

在您的 WordPress 設定檔(通常是 wp-config.php)中,您需要有一個名為 WP_ENV_PLUGINS 的常數。
WP_ENV_PLUGINS 值必須是以下三者之一:development, staging, production。

WP_ENV_PLUGINS 的值在每個階段中是不同的。有些開發者喜歡為每個環境維護不同的設定檔,或者根據某些評估更改常數的值。例如,您可以在 wp-config.php 檔案中設置以下內容:

if ( file_exists( dirname( FILE ) . ‘/development-config.php’ ) ) { define(‘WP_ENV_PLUGINS’, ‘development’); } elseif ( file_exists( dirname( FILE ) . ‘/staging-config.php’ ) ) { define(‘WP_ENV_PLUGINS’, ‘staging’); } else { define(‘WP_ENV_PLUGINS’, ‘production’); }

如果您遵循此範例,請注意 development-config.php 不應該在部署到暫存和正式環境中包括在內,且 development-config.php 及 staging-config.php 不應該存在於您的正式環境中。

這些假設不會更改,因此您需要遵循這個實踐以正確使用此外掛。

如何設置我的環境?

安裝此外掛後(建議先在開發環境中安裝),您會發現在清單中每個已啟用外掛的下方出現一個新連結,上面寫著「僅供開發使用」(請注意,根據您的WP_ENV_PLUGINS常數,「開發」也可能為「暫存」或「正式」)。請記住這一點,並按照以下步驟進行:

啟用您需要在環境中使用的所有外掛程式。
對於所有要標記為僅限開發使用的外掛程式,請點選「僅供開發使用」連結。

按下連結後,該外掛程式將被新增到僅限在目前環境下啟用的外掛程式清單中。如果您想要將外掛程式從清單中移除,您可以點擊「不再僅供開發使用」連結。

如何在部署後重置我的環境?

一旦您成功進行完整的部署(包括檔案和資料庫),例如從開發環境到暫存,您會發現那些選擇在開發使用的外掛程式在暫存環境中會自動停用,且可能還會出現在已停用的外掛程式清單中。這是正常現象,接下來您可以按照上述步驟和您的WP_ENV_PLUGINS常數,重新啟用或停用外掛程式即可。

原文外掛簡介

VERY IMPORTANT: This plugin is deprecated and will not be mantained anymore. Please consider using Stage WP Plugin Manager instead.
If you develop locally, at some point you’ll have some plugins active in your local environment that you don’t need anymore when you deploy your code and database to staging or production. Sure, you can deactivate them before or after deploying, but you’re gonna need them again to be active if you want to perform changes to your code, or update your local database from your remote one. The whole process of activate and deactivate plugins for testing purposes could be really frustrating, and sometimes a complete waste of time.
Is in that kind of situations when the Environmental Plugin Manager can be a really helpful friend. Sadly, due to the sentitive work that this plugin performs, it doesn’t work right out of the box, so besides from installing this plugin, you need to do some additional work.
Please read the following instructions very carefully.
What do I need to make it work?
The Environmental Plugin Manager works on some assumptions about your workflow:

You have a constant named WP_ENV_PLUGINS defined in your WordPress configuration file (often wp-config.php).
The WP_ENV_PLUGINS value is one of the following: development, staging, production.

The value of WP_ENV_PLUGINS is different in each of your stages. Some developers prefer to keep different configuration files for each one of their environments, 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 ) . ‘/development-config.php’ ) ) { define(‘WP_ENV_PLUGINS’, ‘development’); } elseif ( file_exists( dirname( FILE ) . ‘/staging-config.php’ ) ) { define(‘WP_ENV_PLUGINS’, ‘staging’); } else { define(‘WP_ENV_PLUGINS’, ‘production’); }

If you follow this example, note that development-config.php should not be included in your deployments to staging and production, and both development-config.php and staging-config.php should not exist in your production environment.
These assumptions are not going to change, so you need to follow this practice in order to use this plugin correctly.
How do I set up my environment?
Once you have installed this plugin (my recommendation is to do it first in development), you will notice that a new link appears under each active plugin of the list, which reads “Use for development only” (note that “development” could also be “staging” or “production”, depending on your WP_ENV_PLUGINS constant). Keep that in mind and follow these steps:

Activate all the plugins that you need to use for your environment.
Click the “Use for development only” link for all the plugins you want to mark as development-only.

Once you click a link, that plugin will be added to the list of plugins that need to be active only in the current environment. You can click the “No more development only” link if you want to remove the plugin from the list.
How do I reset my environment after a deploy?
Once you performed a complete deploy (files and database) to a different environment, let’s say from development to staging, you will see that those plugins you selected in development to be active only in that environment are still active. Fear not! This is an intended behavior, as it would be insecure to change the status of the plugins without your knowledge, so you need to do it manually by just clicking the “Reset Plugins Environment (staging)” button that you see in your admin bar. After that, you should see your development-only plugins as not active.
That’s pretty much it. You can test it yourself before deploying by just changing the values of WP_ENV_PLUGINS.
Auto-reset mode
If you prefer your environments to be reset automatically, without clicking any button, you can add a second constant to your configuration file, called WP_ENV_PLUGINS_AUTO_RESET, which should be set to true. If you use this method, you won’t see the reset button in the admin bar anymore (instead, it will be replaced by an environment indicator), but keep in mind that the reset process will run every time a page of your site is loaded. It shouldn’t take a lot of resources, though.
If you use the auto-reset process, using this plugin as a must-use will be a lot more effective.
Will this plugin work on MultiSite installations?
If you’re using MultiSite, please note that you can activate and deactivate this plugin globally, but you cannot manage plugin environments for the whole network, just for individual sites. Also, this plugin cannot manage network activated plugins. This is in the to-do list, though.
Contribute
You can make suggestions and submit your own modifications to this plugin on Github.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Environmental Plugin Manager」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0 | 1.1 | 1.1.1 | 1.1.2 | trunk |

延伸相關外掛(你可能也想知道)

  • FakerPress 》當您創建新的主題或外掛時,您總是需要創建自訂數據以測試您的外掛是否正常運作,作為開發人員,我們自己也遇到過這個問題。, 我們這個外掛的目標是填補這個...。
  • Plugin Check (PCP) 》總結:, 「Plugin Check」是一種方便測試外掛程式是否符合Plugin Review團隊的基本需求標準的方式。透過這個外掛程式,您能夠執行團隊所使用的大部分檢查,並...。
  • WordPress Beta Tester 》這個外掛提供了一個簡單的方式,讓您可以參與WordPress的Beta測試。, 安裝了這個外掛後,您可以使用內置的升級器,在點擊一個按鈕的情況下,輕鬆升級您的網站...。
  • RTL Tester 》這個外掛會在管理列上新增一個按鈕,讓管理者可以切換網站文字方向。它可以用來測試支援從右至左(RTL)的文字方向的 WordPress 主題與外掛。。
  • Debug Bar Rewrite Rules 》Debug Bar Rewrite Rules 外掛能將透過篩選條件改變的 Rewrite Rules 的相關資訊新增至 Debug Bar 的一個新面板中。此外掛是 Debug Bar 的擴充套件,但也可以...。
  • CheckView Automated Testing 》總結:CheckView是友善的WordPress自動化測試平台,適合開發人員、商店所有者和代理商使用。, , 問題與答案:, 1. CheckView 是什麼?, - CheckView是一個Wor...。
  • Admin Bar Tools 》這個外掛會在管理列新增一個新的選項卡,提供簡單但實用的提示和工具。, , 顯示頁面中使用的查詢數量及生成該頁面所需的時間。, 顯示 PHP 記憶體使用量和 PHP...。
  • PHP/MySQL CPU performance statistics 》CPU效能測試:, 此外掛會在您的PHP網頁伺服器和MySQL資料庫伺服器上進行各種計算和字串操作。, 為了進一步測試MySQL伺服器,此外掛會在一個自訂的資料庫表格...。
  • Woo Email Control 》這個 Woocommerce 電子郵件系統的增強功能允許您更好地控制您的 Woocommerce 電子郵件。, , 添加任何大小的產品圖像 - (需要 Woocommerce 2.6+), 嵌入和附...。
  • Smartlook 》Smartlook 是一個免費的網站和行動應用程式分析工具,可提供訪客錄影、熱區地圖、轉換漏斗和自動事件追蹤等功能。, 此外掛可協助您輕鬆整合Smartlook代碼到您...。
  • Theme Preview 》預設情況下,查看新佈景主題在您網站上的外觀方式,唯一的辦法是將其啟用,讓所有訪問者都可以看到。使用此外掛程式,可以在不啟用佈景主題的情況下預覽其外...。
  • Rewrite Rule Testing 》這個外掛提供一個簡單的介面,可以測試您的自訂重新導向規則。, 這個外掛的目的是為了能夠測試您自己的重新導向規則,所以您可能最感興趣的是如何進行測試,...。
  • Random Numbers Generator 》這個外掛可以讓你顯示預先格式化的隨機數字,以供測試或演示, 屬性:, range:兩個由逗號分隔的數字。輸出將包含一個最小值和最大值之間的數字。, format:任...。
  • Developer Debug Tools 》這是一個 WordPress 外掛,提供開發者進行網站開發和疑難排解時的除錯和測試工具。, , 直接在管理區中查看 debug.log 和錯誤日誌(應用程式紀錄),便於閱讀...。
  • Shopwarden – Automated WooCommerce monitoring & testing 》Shopwarden 確保您的 WooCommerce 商店完全運作,並確保您不會錯失任何訂單。通過廣泛的檢查,我們確保您商店的每個方面都正常運作。我們監控您的運行時間,...。

文章
Filter
Apply Filters
Mastodon