WP Dev Flag

外掛說明

This plugin makes it easy to distinguish between your local development site, and your live site.
I created this because I often use a local duplicate of my live site, for development, with the same DB, and the same URL.

I use a hosts switcher for example Gasmask to switch between Local & Live versions of the same website, and needed a quick & easy way of identifying them. This plugin acheives that in the simplest way possible.

There are settings for colour, positioning and the text displayed on the badge. It is also possible to add a link onto the badge.

螢幕擷圖

  • This is what the default badge looks like.
  • This is the Trigger Options tab.
  • This is the Display Options tab.
  • This is the Link Options tab.

安裝方式

From your WordPress dashboard

  1. Visit ‘Plugins > Add New’
  2. Search for ‘WP Dev Flag’
  3. Activate ‘WP Dev Flag’ from your Plugins page.
  4. Visit ‘WP Dev Flag Options’ in the ‘Plugins’ submenu to access the settings.

From WordPress.org

  1. Download ‘WP Dev Flag’.
  2. Upload the ‘wp-dev-flag’ directory to your ‘/wp-content/plugins/’ directory, using your favorite method (ftp, sftp, scp, etc…)
  3. Activate ‘WP Dev Flag’ from your Plugins page.
  4. Visit ‘WP Dev Flag Options’ in the ‘Plugins’ submenu to access the settings.

常見問題集

Can I create my own CSS for the badge?

Currently, you can customise the colour, text and position of the badge. The ability to add a custom class is coming in the next release.

Feel free to just style .wp-dev-flag yourself though.

I will also explore additonal options such as custom fonts & href functionality.

Will the badge display on my live site if I duplicate the entire database as is?

No, it detects the current server environment and if it doesn’t match the environment that was set originally, the plugin will not display the badge. You can simply click update to set the new environment if required.

Can I add a link to the badge?

Yes, as of Version 1.3.0 you can add your own link and toggle it to open in a new tab.

使用者評論

2020 年 11 月 21 日
I downloaded the plugin but did not install it when I saw the number of files. It might be great, I won't say anything on it, I just wanted to share a few lines of code that did the job for me instead: if (defined('WP_DEBUG') and true === WP_DEBUG) { // add a green dot at the bottom left of the screen // when WP_DEBUG in wp-config is true function devTag () { echo '<div style="background:green;border-radius:10px;bottom:20px;height:10px;left:20px;position:fixed;width:10px;z-index: 9999;"></div>'; } add_action('wp_body_open', 'devTag'); }
2019 年 4 月 12 日
Installed this on my website when I was developing it, and it's been a very handy yet simple tool for me. It's now part of my toolkit for when I am developing WordPress websites.
閱讀全部 3 則使用者評論

參與者及開發者

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

參與者

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

對開發相關資訊感興趣?

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

變更記錄

v1.3.1 – 23 May 21

  • Bug fix: Add default option values to fix possible PHP notices.

v1.3.0 – 02 Jan 21

  • Enhancement: Added a link options settings tab. This allows you to add a link and toggle it to open in a new tab.

v1.2.0 – 25 Jun 19

  • Enhancement: Added a setting to toggle the badge on the front end. You now have control over the display of the badge on both front end and dashboard, independently.

v1.1.0 – 02 Jun 19

  • Enhancement: Added the ability to show a badge in the admin dashboard. This will appear in the admin bar, to avoid obscuring any menu options.

v1.0.0

  • First Version.