Maybe? The MU Plugin approach works for database-only syncs, but not for staging systems like on CW which actually fully replace the staging/dev site with a new copy of the live, and thus we’d have to re-install the plugin every time we resynch. Having it in the live but disabled somehow for that install would really come in handy.
Thanks!
G’day Phil,
Interesting use case. I’ll consider this. A little complicated with multisite however, where the expectation is the MU plugin stops everything.
Are you able to have a constant defined on the live site that isn’t copied to staging sites? e.g. do you set WP_ENVIRONMENT_TYPE differently on live and staging sites?
cheers,
Ross
Hello Ross,
Thanks for getting back to us. Yea, we do use a constant like that in wp-config.php which is environment-specific (article). I think it’s pretty common for switching to test systems automatically on staging, etc. I’d think you could create a multisite and non-multisite branch and trigger the right functionality for each scenario via is_multisite().
It would be a huge help for us to use as another tool along with the Must-Use feature to cover more scenarios. Staging/Dev emails are such a pain as you well know. We’d definitely be up for a Pro version of the plugin with such features.
Thanks again,
Philip
Heya Ross,
I just came across this, https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/. Turns out WP has a built-in feature even for determining the environment and setting it via WP_ENVIRONMENT_TYPE.
Would certainly make life a whole lot easier for us if it were implemented!
Thanks for considering it,
Philip