Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domains: Improve copy for TLDs unavailable for registration on WordPress.com #7300

Merged
merged 3 commits into from
Aug 15, 2016

Conversation

klimeryk
Copy link
Contributor

@klimeryk klimeryk commented Aug 5, 2016

Fixes #6810

Before, the error message was not very helpful (and it was shown as an intimidating error):

screen shot 2016-08-05 at 13 34 21

Now, the copy has been improved (thank you, @ranh!) and the notice has info severity:

screen shot 2016-08-05 at 13 33 45

The Learn more link points to https://en.support.wordpress.com/map-existing-domain/.

/cc @aidvu @umurkontaci for code review
/cc @spncrb

Test live: https://calypso.live/?branch=fix/tld-error-message

@klimeryk klimeryk added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature Group] Emails & Domains Features related to email integrations and domain management. labels Aug 5, 2016
@klimeryk klimeryk self-assigned this Aug 5, 2016
@ghost
Copy link

ghost commented Aug 5, 2016

Product looks good to me 👍

message = this.translate( 'Sorry but %(domain)s cannot be registered on WordPress.com.', {
args: { domain: domain }
} );
const tldIndex = domain.lastIndexOf( '.' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about SLDs? (.co.uk e.g.)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good point since .co.uk results in
screen shot 2016-08-05 at 9 56 28 am

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a isSubdomain function in https://github.com/Automattic/wp-calypso/blob/master/client/lib/domains/index.js#L114 which might be useful

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I realized that it will do that for SLDs - but the sentence remains true. The domains "ends with .uk". I'm not familiar with any SLD which we don't allow registrations but allow registrations for the TLD of that SLD (ugh, hope that's clear). So, for co.uk we don't support .co.uk nor do we support .uk.
Why not just use the SLD in the notice? I can't figure out an easy way to reliably extract SLDs, if present. Picking just the TLD is safer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of the message is about the domains we don't support though. A straightforward, non-optimized way could be to count the dots and make use of the isSubdomain function;

if (dots.length == 1) {
  // TLD
} else if ( isSubdomain( domain ) ) {
  // TLD (also subdomain)
} else {
  // SLD (grab last 2 dots)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why I've not opted for such a solution is because unfortunately it's not as straightforward (as it usually is with domains). The isSubdomain function is very simple and dumb - it checks for 2-3 characters long tokens between dots and assumes those are TLD/SLDs. But there are many >3 character long SLDs (.school.za, .csiro.au, .film.hu, etc.) and there are many 2-3 character long domain names (cnn.com is an obvious one, az.pl is another example). The only reliable way is to have a hardcoded list of all the possible SLDs - something we can't afford on the frontend and doesn't seem worth a trip to the backend. Hence my proposal to just use the TLD part. It's not ideal, but I think given the situation is the optimal solution (it's better to stick to something we are more certain of than to confuse the user with guessing if we're dealing with a TLD/SLD/subdomain).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think handling co.uk. is more important than some super rare domains. But if you are feeling strongly towards handling it this way I think that's alright as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add this info in the error response from the server? You get the TLD extracted there anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's probably the best to do it - I'll try to do that in a separate patch in the meantime (though, I admit, it's not high priority 😉).

@umurkontaci umurkontaci self-assigned this Aug 12, 2016
@umurkontaci
Copy link
Contributor

Our node version has been bumped to 6.1.0 since this branch has been created. So it needs a rebase :)

@umurkontaci umurkontaci force-pushed the fix/tld-error-message branch from 389dd99 to a8c8398 Compare August 12, 2016 01:16
@umurkontaci
Copy link
Contributor

I did the rebase everything seems OK.

This is good to go, is there possibility of a delay when we try to determine whether the domain is registered or not? Like when the user registers a domain elsewhere and comes to our site right after and sees this message? In a sense, they already came here to "add" their domain.

It's certainly better than what we had before but I think it's something to think about for future.

@umurkontaci umurkontaci added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Aug 12, 2016
@klimeryk
Copy link
Contributor Author

That's a good point. It's probably highly dependent on the registrar - how fast they update/propagate. @spncrb, can you keep an eye out for such cases and let me know if they are confusing for users?

@klimeryk klimeryk merged commit 81242a4 into master Aug 15, 2016
@klimeryk klimeryk deleted the fix/tld-error-message branch August 15, 2016 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Emails & Domains Features related to email integrations and domain management. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Domain Search: TLD error messages
4 participants