Changes proposed in this Pull Request
With paid plans, domain mappings are essentially a feature of the plan and are always free. So, it does not make sense to go through checkout to “purchase” them.
This PR tries to make this flow as quick as possible – from the Add mapping view you get directly redirected (that sounds funny) to domain management view for that domain. From there, you get all the instructions on how to set up your mapping.
Testing instructions
This is best tested with D60566-code on the backend.
For a site on a free plan: there should be no differences. You go through Checkout, don’t stop at jail, etc. 😉
For site on a free plan with a paid plan in shopping cart and a mapping in the cart: no differences. Since we need to go through checkout anyway for the plan, the mapping is OK to be in the purchase. But going forward, this might become a problem that we’ll need to handle somehow (cc @hambai).
For a site on a paid plan: you go through the normal mapping flow, get to this screen:
When you click Add
, there should be a request fired to add-domain-mapping
endpoint (see the above backend patch). Once that successfully completes, you should just get redirected to the domain details page for the newly mapped domain:
This screen contains great, up to date and detailed instructions on how to proceed.
Please also test some failure paths – I’ve made some improvements to the logic around those, as it seems they were broken before (infinite “busy” state if the endpoint returned an error, the notice was not dismissable despite having an X
button). Easiest to probably just hardcode some WP_Error
returns on the backend.
Unfortunately, no screenshots were provided by the developer.