Sticky cache after changing a network's domain/path
After changing the domain/path of a network via https://github.com/stuttter/wp-multi-network/blob/66ac5b8bb2c9082c49b0b06fc4830006a3151d5c/wp-multi-network/includes/functions.php#L634 , the old URL was still being populated via https://github.com/stuttter/wp-multi-network/blob/66ac5b8bb2c9082c49b0b06fc4830006a3151d5c/wp-multi-network/includes/metaboxes/edit-network.php#L22 until running wp_cache_flush.
We run clean_network_cache, which sounds like it should take care of it, but didn't. Still digging around on it.
This has a secondary issue that can leave you in a weird situation.
- Change the network domain/path from example.com to example.coms.
- On the page reload, the cache will still display example.com for the network domain/path (though the individual subsites below will display .coms URL).
- Submit update, which has example.com still in error.
- The network domain/path accepts the change, but the individual subsites do not change. I think it is due to this conditional https://github.com/stuttter/wp-multi-network/blob/66ac5b8bb2c9082c49b0b06fc4830006a3151d5c/wp-multi-network/includes/functions.php#L688
- The result is the domain/path is set as example.com while the subsites are on .coms.
There is no way to retrigger the loop to update the domain on all subsites. If you edit it to, say, example.test, the subsites would update to example.tests. In this example, the s at the end of the URL would always remain.
To resolve, need to edit the db (_blogs and the specific blog's options table) to change the URL of the primary site to the correct domain, then you can update the others through the UI for each site.
I've made a few modifications here.
Instead of calling refresh_blog_details() we are now calling clean_blog_cache() directly.
Curious if you have a better experience once 2.5.0 is released. 🙏