[x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
Changes proposed in this Pull Request:
Fixes an issue we run into occasionally where a clone/staging site will pollute live ESP data because there are multiple sites connected to the same ESP and syncing data.
How to test the changes in this Pull Request:
Unit tests should prove the case for newspackstaging.com sites, but you can also actually test on one of those sites.
Locally:
get option wc_subscriptions_siteurl should return something like http://newspack_[wc_subscriptions_siteurl]_dev.local (with your local site URL and that thing in the middle of it). Update it to some other URL (keep the thing in the middle of it). This will automatically put WC Subscriptions into staging mode.
Before applying this patch, update the status of a subscription. Observe the status change IS reflected in the NP_Membership Status data synced up to the ESP.
Apply the patch, update the status of a subscription. Observe the status change is NOT reflected in the data synced up to the ESP.
Add define( 'NEWSPACK_FORCE_ALLOW_ESP_SYNC', true ); to your wp-config. Update a subscription status again and observe the change IS reflected at the ESP.
Other information:
[x] Have you added an explanation of what your changes do and why you'd like us to include them?
[x] Have you written new tests for your changes, as applicable?
[x] Have you successfully ran tests with your changes locally?
All Submissions:
Changes proposed in this Pull Request:
Fixes an issue we run into occasionally where a clone/staging site will pollute live ESP data because there are multiple sites connected to the same ESP and syncing data.
How to test the changes in this Pull Request:
newspackstaging.com
sites, but you can also actually test on one of those sites.Locally:
get option wc_subscriptions_siteurl
should return something likehttp://newspack_[wc_subscriptions_siteurl]_dev.local
(with your local site URL and that thing in the middle of it). Update it to some other URL (keep the thing in the middle of it). This will automatically put WC Subscriptions into staging mode.NP_Membership Status
data synced up to the ESP.define( 'NEWSPACK_FORCE_ALLOW_ESP_SYNC', true );
to your wp-config. Update a subscription status again and observe the change IS reflected at the ESP.Other information: