This document will cover the basics of managing a staging website when running a website with MemberPress.
The guide will also help you configure all needed settings to avoid potential issues with your live or staging website.
Working With Staging Website
You can occasionally encounter issues with WordPress or MemberPress that require thorough debugging.
Issues can sometimes be created by simply updating or adding a new plugin or theme to your website. They can also result from working with different plugins, caching, server or hosting problems, etc.
In most cases, it's hard to know the cause of the issue without proper troubleshooting. Troubleshooting often involves disabling plugins, changing the theme, examining the template files, etc. If done on your live website (environment), this can create problems with the website's functioning.
Having a staging website can be beneficial for the overall management of your live website. A staging website is used to update or install new plugins and themes, test code or settings changes, or debug. Also, having a staging website will help any support team solve issues faster.
Staging Website Setup
Setting up a staging website is often not complicated and can be done even by a non-technical person.
Most hosting companies include the option for creating a staging website in their basic package. If available, this option will probably be the easiest way to create a staging website.
Otherwise, you could create a staging website using a plugin like Duplicator. Alternatively, you can create a staging website manually.
Managing Staging and Live Website
You can move the data between your Live and Staging websites:
- Pulling is the process of copying your Live (production) website files to your Staging website.
- Pushing is the opposite process of Pulling. In this process, the contents of your Staging website are copied to the Live website.
These processes will replace all existing files on the destination website. Thus, for example, the pushing process will replace all existing files on the Live website with the Staging website files.
Therefore, to safely update plugins and ensure there will be no issues with your live website functioning, follow these steps:
- Pull your Live website to your Staging website. This will make your Staging website identical to your Live website.
- Log in to your Staging website, and apply any updates you have.
- Once you are sure that there are no issues following the updates you applied,
Configuring MemberPress Emails
Once you have created your staging site, please follow these steps to ensure there are no conflicts with your live site:
- Disable Reminders: Go to Dashboard > MemberPress > Reminders and disable all reminders. Here, you remove all reminders or only disable emails while keeping all reminders. To disable emails for each reminder, follow these steps:
- Hover over the reminder name and click the Edit link;
- Disable both user-related and admin-related emails by unchecking their (Send…) options.
- Disable add-ons: Disable the following MemberPress Add-Ons on your staging site:
- Developer Tools
- ActiveCampaign (Lists)
- ActiveCampaign (Tags)
- AWeber
- Constant Contact
- ConvertKit
- Drip – Tags Version
- GetResponse
- MailChimp 3.0
- MailPoet
- Mailster
- Disable MemberPress Notification Emails:
- Navigate to the Dashboard > MemberPress > Settings > Emails tab;
- Here, uncheck all user and admin emails in the list.
These settings prevent double-sending (sending the same email from the live and staging website), wrongly sent emails or similar issues.
Once this is done, follow the directions below to configure your specific payment gateway to work properly on the staging site.
Stop All Emails on Staging
With all MemberPress Notifications, Reminders, and marketing integrations deactivated, you should expect no issues related to emails.
On the other hand, emails could also be triggered by other third-party plugins or WordPress.
In this case, you can use one of the third-party plugins to prevent the staging website from sending any emails. Please note that this will stop all emails on your staging website, not just MemberPress ones.
Stripe
If you are using Stripe as your payment method, to avoid any negative impact on your payments, you will need to follow these steps:
Pulling (Live > Staging)
Once the pulling process is done, please apply the following changes to Stripe settings:
- On your Live website:
- Disconnect your Stripe Payment Gateway
- Visit the URI: https://[live.domain.com]/wp-admin/?mp-clear-connection-data=true to clear your connection data. (Replace [live.domain.com] with your actual live domain.
- On your Staging website:
- Disconnect your Stripe Payment Gateway
- DO NOT Delete the Payment Gateway
- Visit the URI: https://[staging.domain.com]/wp-admin/?mp-clear-connection-data=true to clear your connection data. (Replace [staging.domain.com] with your actual staging domain.
- Back on your Live website:
- Reconnect your Stripe Payment Gateway to your live account.
- Back on your Staging website:
- Connect your Stripe Payment Gateway.
- Check the Test Mode box on the Stripe Payment Gateway settings.
- Click the Update button at the bottom of the page to save the settings.
You are all set. Live payments will still be processed and will work properly. Your payments on the staging website will be in Stripe test mode. You can see these transactions by going to your Stripe dashboard and enabling the Test Mode toggle in the top right:
Pushing (Staging > Live)
Following the push of the files from the Staging to the Live website, please apply the following settings:
- Before pushing Live: Disconnect, but DO NOT Delete the Stripe payment gateway on the staging site.
- Then, push to live.
- After pushing to live, visit the URI https://live.domain.com/wp-admin/?mp-clear-connection-data=true on the live site to clear your connection data.
- Reconnect your live Stripe gateway.
- Uncheck the Test Mode box in the Stripe Payment Gateway Settings.
- Click the Update button to save the options.
PayPal
We also recommend using PayPal Sandbox mode on your staging site. For this, you will need to create a sandbox account for using the PayPal payment method.
The other option is to add a new PayPal payment gateway using a testing account. It is best to leave your live PayPal payment gateway enabled. Be sure to delete any test payment gateways you create before pushing back to live.
If you find this still too complicated, you can simply make some test payments with Stripe on your live site by putting Stripe in test mode.
Authorize.net
If you are using Authorize.Net, you'll need to update the Silent Post and Webhook URLs.
If you find this still too complicated, you can simply make some test payments with Stripe on your live site by putting Stripe in test mode.