WordPress.org

Ready to get started?Download WordPress

Forums

Adding a link should check for "http://" (4 posts)

  1. jimmerd
    Member
    Posted 1 year ago #

    One of WordPress's great strengths is that it works beautifully for idiot users. This is (in my experience) where other CMSs fall down.

    But one part that could be made more idiot-proof is adding links.

    I can't tell you how many times one of my clients has added a link and it breaks for lack of "http://" at the beginning.

    So somebody selects the text and clicks the ADD LINK button and types in "google.com", tests the post and it goes to "http://theclientsite.com/google.com"

    My suggestion: the code should check links for ".com, .org, .net, etc." and if it finds that, either ask "Do you want to link to http://google.com" or just ensure that the http:// is there. I think adding http would be safe as it's very unlikely that if a link contains .com the user wanted to keep us within their own site.

    Hope this helps,
    Jim

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    So somebody selects the text and clicks the ADD LINK button and types in "google.com", tests the post and it goes to "http://theclientsite.com/google.com"

    So why aren't they adding their url to the http:// that's already present in the popup window? Isn't this really a case of users not actually reading the screen properly? Because, at the end of the day, there's really no cure for this.

    I think adding http would be safe as it's very unlikely that if a link contains .com the user wanted to keep us within their own site.

    I disagree. http is not the only protocol that can be used to create a link.

  3. jimmerd
    Member
    Posted 1 year ago #

    I agree that it's their own fault. But when it happens repeatedly (and believe me, it does), can't those who designed the system take another look?

    I am also well aware that if you make things idiot-proof, the Flying Spaghetti Monster just creates a better idiot.

    Also, the http:// that's already there is also pre-selected. So if someone starts typing or pastes a URL without first clicking at the end of it, the http:// is wiped out.

    And yes, other protocols would have to be taken care of but that should also be easy.

    I don't know enough PHP to try to write a plugin to do this but for me it would be something like:

    When someone tries to insert a link:
    a. check if the link contains a top-level domain: .com, .org, .net
    b. if it does, ensure that it also contains a protocol
    c. if a but not b, prompt the user that they should add this unless it's REALLY a local, relative link

    I'm open to the idea that this may be a stupid idea. But I've seen this mistake so often (twice today on different sites) that I can't help thinking we can help people with a little code.

    Thanks for your time,
    Jim

  4. This comes up now and again. The reason we don't is ... well, what if you wanted relative links? We try hard not to assume we know intent in these cases :) If I want a link to be /about and not http://ipstenu.org/about, WP should honor me.

Topic Closed

This topic has been closed to new replies.

About this Topic