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

Easy Local Site

外掛說明

When working on a local site and a production site at the same time, things can easily get confusing and you forget which site you’re looking at. This plugin adds a hard-to-miss, bright orange reminder to the toolbar and prepends [LOCAL] to the title tag on your local site.

If you’ve imported a database from a production site, you may also want to avoid sending emails out to real users. This plugin overrides the ‘to’ address of all outgoing emails, sending them instead to an address specified by you. This enables you to test contact forms, notifications or any other outgoing email communications. All emails will have the original recipient’s email address prepended to the subject line so you can see at a glance who they were originally intended for.

The WP_LOCAL_DEV constant method

You must use the WP_LOCAL_DEV constant method as outlined by Mark Jaquith: markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips

If the WP_LOCAL_DEV constant is not defined this plugin will do nothing. This means you can safely put it in your mu-plugins folder and include it in your Git repository on a production site.

安裝方式

To install directly from your WordPress dashboard:

  1. Go to the Plugins menu and click Add New.
  2. Search for Easy Local Site.
  3. Click Install Now next to the Easy Local Site plugin.
  4. Activate the plugin.

Alternatively, see the official WordPress Codex guide to Manually Installing Plugins.

Using the mu-plugins folder is better

Ideally you should install Easy Local Site in wp-content/mu-plugins (plugins in here are ‘Must Use’ and are automatically activated). This will mean that it is always activated, even after migrating a database from a production site where the plugin is not installed/activated, so you don’t have to remember to manually activate it.

The WP_LOCAL_DEV constant method

You must use the WP_LOCAL_DEV constant method as outlined by Mark Jaquith: markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips

If the WP_LOCAL_DEV constant is not defined this plugin will do nothing. This means you can safely put it in your mu-plugins folder and include it in your Git repository on a production site.

Overriding outgoing emails

To override outgoing emails, you must define WP_LOCAL_EMAIL in local-config.php as follows:

define( ‘WP_LOCAL_EMAIL’, ‘me@myemailaddress.com’ );

Download from GitHub

You can also download this plugin from GitHub at https://github.com/lumpysimon/wp-easy-local-site

使用者評論

2017 年 2 月 7 日
Ever made a change during development or testing content on a website, believing you are just testing you local site but in fact you just changed the live site instead? Or vice versa. With this plugin you get used to the red rectangle with the lettering Local site and the [Local site] prefix in the title bar. It could be a bit more clear that the emails are only redirected when the WP_LOCAL_EMAIL variable is set: define( 'WP_LOCAL_EMAIL', 'me@example.com' );
閱讀全部 1 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Easy Local Site〉的開發相關工作。

參與者

將〈Easy Local Site〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

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

變更記錄

0.3

  • Use WP_LOCAL_EMAIL constant for email address (for easier use by teams in a version-controlled environment)
  • Prepare for localisation.
  • Add PHPDoc comments

0.2

  • Add email overriding

0.1

  • Initial release