Safely copy your WordPress, WooCommerce, and membership site between production and staging.
Author: | ryanshoover (profile at wordpress.org) |
WordPress version required: | 4.7 |
WordPress version tested: | 5.1.1 |
Plugin version: | 0.3.2 |
Added to WordPress repository: | 09-02-2019 |
Last updated: | 23-03-2019
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
Rating, %: | 100 |
Rated by: | 1 |
Plugin URI: | https://github.com/ryanshoover/safe-staging |
Total downloads: | 1 193 |
Active installs: | 20+ |
Click to start download
|
FAQ
Can I complicate how the plugin determines what the production URL is?
The filter safe_staging_is_production
will let you change what the plugin sees as the production site.
For example, the filter below will let you support an alternative production URL.
/**
* Change whether Safe Staging thinks the current site
* is the production site.
*
* @param bool $is_prod Is this the production site.
* @return bool Whether we should treat this as an alternative production site.
*/
add_filter(
'safe_staging_is_production',
function( $is_prod ) {
$alternative_prod_url = 'https://myothersite.com';
if ( site_url() === $alternative_prod_url ) {
$is_prod = true;
}
return $is_prod;
}
);
Can I let other emails get sent on staging sites?
The filter safe_staging_is_whitelist_email
will let you intervene just before an email is blocked.
For example, the filter below will let you support an alternative production URL.
/**
* Determine whether a particular email should be sent.
*
* In this case we test if the to recipient is our admin address.
*
* @param bool $whitelisted Should the email actually send.
* @param object $this Instance of the Fake PHPMailer class.
* @return bool Whitelist value tested against the recipient.
*/
add_filter(
'safe_staging_is_whitelist_email'
function( $whitelisted, $phpmailer ) {
if ( 'admin@mysite.com' === $phpmailer->getToAddresses() ) {
$whitelisted = true;
}
return $whitelisted;
},
10,
2
);
Can I change the message that shows on the checkout page?
The filter safe_staging_checkout_notice
will let you override the message shown on the cart and checkout pages.
/**
* Change the warning message that gets displayed on the checkout page
* of staging sites.
*
* @return string New message to show on the checkout page.
*/
add_filter(
'safe_staging_checkout_notice',
function() {
return 'You\'ve found our staging site! You might want to go back to the production site.';
}
)
ChangeLog
0.3.2
- Improves CI / CD
- Adds wpunit tests
0.3
- Improve admin notifications
- Clarifies readme code examples
- Adds wpunit tests
0.2.3
- Adds support for CI / CD code management
0.2.1
- Bumps compatibility to 5.1.
- Adds uninstall file.
0.2
- Adds noindex tag to the staging site.