Confirm that site is indeed not a WordPress site after XML-RPC validation fails#796
Conversation
dfc746c to
f69793a
Compare
|
@guarani the code can be reviewed but ideally, I would do some more manual testing myself, so I'm not targeting 23.6 for sure. If you'll have time to review the code or critique the solution overall - great, I'll finish after I come back. Thanks! 🙇 |
Split presentation and business logic to allow for easier testing before making any changes
f69793a to
9db1d08
Compare
In rare cases, XMLRPC validation can fail for unexpected reasons. Make a fallback check to determine if site is WP site before concluding to the user that the site is not WordPress site
9db1d08 to
a27ac06
Compare
SiobhyB
left a comment
There was a problem hiding this comment.
@staskus, thank you for working on this! 🙇♀️ I verified that the misleading "not a WordPress site" error is resolved with these changes applied:
| Before | After |
|---|---|
![]() |
![]() |
In addition, I went through the steps at wordpress-mobile/WordPress-iOS#17724 and tried a few ways to see if I could break login, but couldn't.
The only note I have is that, although less confusing than before, I feel some users won't know what next steps to take or perhaps even what XML-RPC is. How would you feel about adding a sentence like Please check with your hosting provider to find out if they are blocking XML-RPC access? Or perhaps even linking to our support doc? I understand that this might be out of the scope of this PR though. Let me know if I should open a separate issue regarding the wording!
I went through each commit as well as your descriptions, and the logic seems sound to me. That said, I'm not an iOS developer, so it might be wise to have @guarani or another iOS developer do another pass.
Approving based on my testing and understanding of the logic. :)
…sometimes-displays-incorrectly
guarani
left a comment
There was a problem hiding this comment.
Approved via wordpress-mobile/WordPress-iOS#17724.
The code change looks good and I ran this repos tests locally.
…sometimes-displays-incorrectly


More context: wordpress-mobile/WordPress-iOS#18497 (comment)
Related PR wordpress-mobile/WordPress-iOS#21904
In rare cases, XML-RPC validation can fail and indicate that the site is not a WordPress site when it actually is.
To avoid this corner case, I added an additional
isWPSitecheck afterguessXMLRPCURLand before showing errors to the users:isWPSite(connect/site-info) API call confirms it, then we inform the user that the site is invalidisWPSite(connect/site-info) API suggests otherwise, we inform users about XML-RPC issues which they can then look for further assistanceImplementation details
I didn't want to change this fragile code before writing tests to it and to write tests I needed to split business logic from UI. I recommend reviewing commit by commit:
CHANGELOG.mdif necessary.