Skip to content

Getting started

Install Gorilla Staging Guard on your live site. Every staging site made from it afterwards carries the plugin and protects itself. There is nothing to set up on the staging site.

Install the plugin

  1. In WordPress, go to Plugins → Add New Plugin, search for "Gorilla Staging Guard" and choose Install Now. Or choose Upload Plugin and upload the plugin's zip file.
  2. Choose Activate.
  3. Open Tools → Staging Guard.

The plugin has four tabs: Status, Activity, Settings and About.

How the live site is recognised

The first time an administrator opens the WordPress dashboard on the live site, the plugin records the site's address as the live one. A staging site made from it carries that record under a different address, such as staging.example.com or example.com/staging, and so knows it is a staging site.

When the address is not clearly the main domain, the plugin asks instead, once, on the Plugins screen:

  • This is the live site: the address is recorded as the live one.
  • This is a staging site: email stops, payments go to test mode and scheduled tasks pause.
  • Not now: the question goes away for you; nothing changes.

Until you answer, the site sends email and takes payments as usual. See How it knows.

Say it in wp-config.php (recommended)

The surest way is to say what each site is. Add this line to wp-config.php above /* That's all, stop editing! */:

On the live site:

define( 'WP_ENVIRONMENT_TYPE', 'production' );

On a staging site:

define( 'WP_ENVIRONMENT_TYPE', 'staging' );

WP_ENVIRONMENT_TYPE is WordPress's own setting, so other plugins read it too. Many hosts set it for you on their staging sites. Use staging rather than development: development also turns on WordPress's debug mode. The plugin's other wp-config.php settings are on the Settings page.

Check that it works

On the staging site, open Tools → Staging Guard. The Status tab shows:

  1. The verdict, for example "This is a staging site of example.com. It cannot reach your customers.", and the reason the plugin decided it.
  2. The self-test: one row per protection, each with a result. Working means the protection answered as it should. Partial and Not working tell you what to look at.

On the live site, the Status tab says "This is the live site" and offers What would a staging site do?: it runs the same self-test as if the site were a staging site, without sending or changing anything. Use it before you make your first staging site.

What each row and result means: The Status tab.

After a sync from the live site

When you copy the live site over a staging site again, the staging site starts fresh:

  • It is still recognised as a staging site and protects itself straight away.
  • Its own choices on the Settings tab are gone, because they came from the live site's database, where they were never made. Choose them again if you need them, for example the addresses that may still receive email.
  • Open the Status tab and look at the self-test once, especially after you add a new plugin on the live site.

Test email and checkout on a staging site

Email is stopped for everyone, including you. To test a form or an order:

  • On the staging site, under Tools → Staging Guard → Settings, switch on Send to me, or list the addresses that may still receive mail. A message goes out only when every recipient is allowed, so a customer is never reached by accident.
  • Checkout works in each payment gateway's test mode: use the gateway's test cards.

All the choices are explained on the Settings page.

Next step

How it knows: how a site is recognised as a staging site, and what to do when it asks.