Using Sunshine on a Staging or Development Site
A staging site is a private copy of your website where you can test updates before they reach your real store. Staging and development sites don't count toward the number of sites your Sunshine license allows, so you can activate your license there and still have your live site activated too.
How Sunshine Knows a Site Is Staging
When you activate a license, Sunshine sends sunshinephotocart.com two things: your site's address and your site's environment type. A site counts as staging or development, and doesn't use up an activation, when either of these is true:
- The environment type is set to
staging,developmentorlocal. This is a WordPress setting (see below). - The site's address looks like a staging or local site. For example:
- An address that starts with
staging.,staging-,test.ordev., likestaging.yoursite.com - An address that ends in
.local,.testor.localhost, likeyoursite.local localhost, or a private network address like192.168.1.10- A staging address from a web host, such as
yoursite.wpengine.com,yoursite.kinsta.cloud,yoursite.flywheelstaging.com,yoursite.cloudwaysapps.com,yoursite.mystagingwebsite.comoryoursite.wpcomstaging.com
For the best result, use both. Put your staging copy on a staging address like staging.yoursite.com and set its environment type to staging.
A staging copy in a folder on your live domain, like yoursite.com/staging/, can still be activated as long as the environment type is set to staging. But because the address itself looks like a regular site, it shows up in your account as one of your sites. If you're setting up a new staging copy, a subdomain like staging.yoursite.com is the better choice.
Setting the Environment Type
Some web hosts set this for you automatically when you use their one-click staging tool. If yours doesn't, or you made the copy yourself, add this line to the staging site's wp-config.php file, above the line that says /* That's all, stop editing! */:
define( 'WP_ENVIRONMENT_TYPE', 'staging' );
Learn how to add this custom code to your WordPress website
You can check what it's set to in your WordPress admin under Tools > Site Health > Info > WordPress. Look for Environment type.
Only add this to your staging or development copy. Your live site should always stay set to production, which is what WordPress uses when nothing is set.
Activating Your License on the Staging Site
- Set the environment type on the staging site (see above).
- On the staging site, go to Sunshine > Settings > Licenses.
- Enter your license key and click Activate.
That's it. Your live site stays activated, and your add-ons work and update on the staging site the same way they do on your live site.
Copying Your Live Site to Staging
If you copy your live site to make a staging site, the copy brings your license key along with it, but it still points at your live site's address. The staging site may show a message that your license was activated on a different site.
That message doesn't mean anything is wrong with your live site. Make sure the environment type is set on the staging copy, then click Activate on its Licenses screen. This adds the staging site to your license without touching the live one.
Don't remove your live site from Manage Sites in your account to make room for a staging site. With the environment type set, you don't need to.
Seeing Which Sites Are Activated
Go to Account > Licenses on sunshinephotocart.com and click Manage Sites next to your license. This lists every site your license is activated on. You can deactivate any site you're no longer using, like an old staging copy you've deleted.
Still need help?
If you have not yet found your answer in the documentation articles, please contact support