[WordPress] 外掛分享: Switcheroo

WordPress 外掛 Switcheroo 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Switcheroo」是 2025-02-03 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2025-03-12,距離現在已有 53 天。
  • 外掛最低要求 WordPress 5.0 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 8.0 以上。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

ufmedia |

外掛標籤

development | feature flags | site management |

內容簡介

總結:功能標誌是控制網站功能可用性的強大工具。透過啟用或停用標誌,您可以控制網站上的活動內容,而無需部署新程式碼。

1. 什麼是功能標誌?
- 功能標誌是控制網站功能可用性的工具,可以透過啟用或停用標誌來控制網站上的活動內容。

2. 如何定義每個功能?
- 每個功能具有唯一的 ID、標題、描述、狀態和連結。

3. 如何在程式碼中管理功能標誌?
- 使用條件陳述式將功能特定的程式碼包裹起來,以檢查標誌是否已啟用。

4. 功能標誌有哪些建議的狀態?
- 草稿、實驗性、啟用、廢棄、破壞性、存檔、高風險。

5. 如何透過命令列管理功能標誌?
- 使用 WP-CLI 中的 wp switcheroo 指令來檢視和修改功能標誌。

原文外掛簡介

Feature flags are a powerful tool for controlling the availability of features on your site. By enabling or disabling flags, you can control what is active on your site without needing to deploy new code.
Features are defined in the switcheroo.json file located in the root of your project.
Each feature has:

Unique ID: An identifier for the feature.
Title: A human-readable name.
Description: Explains the feature’s purpose.
Status: Indicates whether the feature is active, experimental, deprecated, etc.
Link: An optional link to further information.

You can toggle each feature within the Switcheroo Settings in the WP Admin (Settings -> Switcheroo).
Usage
Managing Feature Flags in Code
You can wrap your feature-specific code in a conditional statement to check if a flag is enabled.
For example, use the switcheroo_flag_status('my_feature') function to determine whether a feature is active and include its logic conditionally.
Suggested Feature Flag Statuses
Each feature flag can be assigned a status, allowing for better organisation and understanding of the feature’s state:

Draft: The feature is still in development and not ready for use.
Experimental: The feature is available for testing but may have known issues.
Active: The feature is live and functional on the site.
Deprecated: The feature is being phased out and may be removed in the future.
Breaking: The feature introduces significant changes; enabling or disabling it may cause issues.
Archived: The feature has been permanently removed or is no longer supported.
High-Risk: The feature introduces significant changes or is under scrutiny for potential issues.

Command Line Management
You can also manage your feature flags via the command line using WP-CLI. The wp switcheroo command allows you to view and modify feature flags.
Examples:
– wp switcheroo: List all flags and their statuses.
– wp switcheroo my_feature: Check the status of the my_feature flag.
– wp switcheroo my_feature on: Enable the my_feature flag.
– wp switcheroo my_feature off: Disable the my_feature flag.

各版本下載點

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

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


1.0.1 | 1.0.2 | trunk |

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

  • Query Monitor – The developer tools panel for WordPress 》ministrator user). This cookie can be set by defining QM_AUTH_KEY in your wp-config.php file., To learn more about how to use Query Monitor, please...。
  • Yoast Test Helper 》此外掛能幫您測試 Yoast SEO、Yoast SEO 外掛和整合功能,並且方便地重置不同功能。同時,讓您可以設定資料庫版本,方便測試資料庫升級過程是否順利。, 功能,...。
  • What The File 》What The File 是一個 WordPress 外掛,在您的工具列中增加了一個選項,顯示目前正在檢視的頁面所使用的文件和模板部分。, 您可以通過單擊文件名直接使用佈景...。
  • P3 (Plugin Performance Profiler) 》這個外掛程式可以創建您 WordPress 網站的外掛程式效能概況,並且藉由測量這些外掛對網站載入時間的影響。通常WordPress網站由於過多或配置不佳的外掛程式而...。
  • Prevent Browser Caching 》您是一位前端開發人員嗎?想要清除所有使用者的瀏覽器快取嗎?只需啟用此外掛程式並展現您的作品!, Prevent Browser Caching 外掛程式可讓您自動或手動一鍵...。
  • Stop Emails 》這個 WordPress 外掛可以停止發送電子郵件。它可以停止由 WordPress 核心、外掛和佈景主題所產生的所有出站信件,使用 wp_mail() 函數發送的信件也會停止發送...。
  • WP Secure Maintenance 》想要將您的網站鎖定進行維護或開發嗎?那麼這就是正確的外掛程式。使用 WP Secure Maintenance,您可以使用密碼鎖定整個網站。, 功能:, , 設置密碼,以保護...。
  • Ultrapress 》lugins you need are not compatible with each other, which is why Ultrapress was developed. It is a suite of tools designed for WordPress developers...。
  • Monkeyman Rewrite Analyzer 》這是一個了解你的重寫規則(“美麗連結”)的工具。如果你正在添加或修改規則,並想要了解它們的運作方式(或者為什麼它們不起作用),這個工具是必不可少的。,...。
  • What Template 》在管理列中加入目前頁面的範本名稱。, 由於這個外掛揭露了關於啟用佈景主題的潛在敏感訊息,因此建議僅在開發環境下啟用,並不應在生產網站上啟用。。
  • Display Environment Type 》WordPress 5.5 引入了一種區分環境類型(開發、備試、正式)的方式。此外掛會在管理列顯示您網站的環境類型。, 更多有關此新功能的資訊。
  • Developer 》一個能幫助 WordPress 開發者進行開發的外掛。, 這個外掛將幫助您優化您的開發環境,確保您已安裝所有必要的工具和外掛。, 如果您想查看代碼並做出貢獻,加入...。
  • Cron View 》此外掛在管理面板中添加了一個頁面,您可以在其中查看所有排隊的 Cron 事件,了解它們的到期時間、所在的排程(或是否為一次性事件)以及它們將調用的鈎子。...。
  • WP PHP Console 》, PHP Console 讓你可以透過 Google Chrome 擴充元件 PHP Console 和 PHP Console 伺服器程式庫 處理 PHP 錯誤和例外、輸出變數、遠端執行 PHP 程式等等多種...。
  • WP Example Content 》這個外掛可以輕鬆地協助你設計和開發新的及現有佈景主題,加入或移除範例文章內容。享受它的便利!, 在啟用外掛後,只需進入管理面板導覽 (通常為最後一項),...。

文章
Filter
Apply Filters
Mastodon