Viewing 15 replies - 1 through 15 (of 20 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Sorry, my mistake. I was unfamiliar with the new URI schema.

    The api.w.org link in the header is part of the new JSON REST API included with WordPress 4.4. This is simply a link to let sites know that your site now supports the forthcoming REST API, which will be the way that other systems interact with WordPress in future versions.

    The REST API will be the future foundation of things like mobile apps, themes, plugins, and pretty much anything that interacts with your website. It’s the connection point for future development, basically.

    Hope that helps!

    Thread Starter robin_dean

    (@robin_dean)

    It does and I thank you.

    However, I’d like to know what’s going to be done about it rendering invalid markup. Valid code is important to many of us, myself included.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    That markup is not invalid. So, don’t know what you’re asking about here?

    Thread Starter robin_dean

    (@robin_dean)

    Copying and pasting the entire contents of *any* post/page on my site and pasting it directly into https://validator.w3.org/#validate_by_input

    I receive the following response …

    Error: Bad value https://api.w.org/ for attribute rel on element link: The string https://api.w.org/ is not a registered keyword.
    From line 89, column 1; to line 89, column 83
    </script>?<link rel=’https://api.w.org/&#8217; href=’https://www.theridingobsession.com/wp-json/&#8217; />?<link
    Syntax of list of link-type keywords:
    A whitespace-separated list of link types listed as allowed on <link> in the HTML specification or listed as an allowed on <link> on the Microformats wiki without duplicate keywords in the list. You can register link types on the Microformats wiki yourself.

    … so no, it isn’t valid or yes, it is invalid (take your pick) ??

    Hey Otto,

    Huge fan of the JSON REST API. I think it’s a great addition and holds a ton of potential, but I’ll throw my 2 cents out.

    I can’t successfully visit api.w.org in Chrome or Safari. I can’t even ping it. What’s it doing as a link reference in the source code? I just troubleshot a 404 error that Media Temple directly attributed to that link rel.

    If a link is included, shouldn’t the url at least resolve to a valid resource. Am I missing something here?

    Thanks,
    Justin

    Thread Starter robin_dean

    (@robin_dean)

    … and why was this thread marked as resolved? The w3c validator remains unhappy and I have yet to allow the code back into the buffer.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Hi Andrew! Thanks, but I’m good. I’ll get my issue figured out, it’s just a random undefined javascript reference generating a 404, thankfully unrelated to this issue…no big deal.

    I am just getting involved because my clients’ host (Media Temple) specifically called out this reference as the offender causing the 404 (which it is not). My subsequent google search led me to this conversation and I think it’s a valid concern. Who owns w.org and why doesn’t api.w.org resolve? If it’s not resolving, why is it being included in potentially millions of sites source code as a reference?

    I’m glad you stopped by though, I think robin_dean’s follow up question deserves a response. Is this resolved? Any resolution to the validation question?

    Thanks,
    Justin

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Moderators often resolve threads after they feel the question has been answered – however please don’t take that the wrong way. A lot of people on the forums forget to mark their threads resolved and so we’ve developed a general practice to resolve threads when we think they’re resolved.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The original poster should be able to mark it resolved or unresolved themselves on the right-hand side of the thread (considering you’re using the forums on desktop). I had already marked the thread unresolved before you replied @wpappdev.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    @robin_dean, Can you show us the Webpage in context?

    @andrew, cool, that makes a lot of sense. Thanks for the reply!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    To answer both questions here:

    The message W3C’s validator gives here is this:

    The string https://api.w.org/ is not a registered keyword

    This is not a validation error. This says that the W3C scanner doesn’t know what that rel value means. Which is fine, they don’t need to know what it means.

    Now, I probably would have chosen a different value for the rel there, but it is what it is. Regardless of what was chosen, the validator would not know about it yet because it is new.

    As for who owns w.org, we do. The w.org domain is owned by the WordPress Foundation. The api.w.org doesn’t point to anywhere at present, nor does it really need to do so. That is not a link, it’s an identifier.

    The bottom line is that the results from the W3C Validator are largely irrelevant to modern web programming, and will always lag behind new development in the field. Maybe they will fix the validator to know about it, maybe an alternate rel will be chosen in the future. This is undetermined at present.

    If you care about validation, then by all means, remove it. Most people don’t care about validation, because being valid does not actually improve anything or prevent any problems. Validation mattered a lot when XHTML was the big thing. But XHTML is dead now, and HTML5 is fault-tolerant. You can put any gobbledy-gook you like in your document, and HTML5 will ignore that which it does not understand.

    The markup for that link is valid HTML5, and the rel value is irrelevant except for systems which are looking specifically for it, which they will do in order to find the JSON REST API endpoints to talk to. Removing it will make the REST API not work with your site.

    Thread Starter robin_dean

    (@robin_dean)

    Before I continue blathering on, please note that I’m not trying to be pessimistic. I too am stoked about the REST API not for having read anything about it but because of all the excited statements of others.

    The bottom line is that I want my site to validate LOL. The w3c’s been good to us. We should continue considering it worthwhile.

    The bottom line is that the results from the W3C Validator are largely irrelevant to modern web programming, and will always lag behind new development in the field. Maybe they will fix the validator to know about it, maybe an alternate rel will be chosen in the future. This is undetermined at present.

    … In my mind, this is more of an Internet Explorer (or Microsoft in general) mentality.

    I’m preparing to read up on this new JSON REST API.

    Final Question (For Now):

    Since I’m capturing the buffer, can’t I just change the keyword to something more, um, prototype friendly?

    If so, what would you suggest that will trigger a green light with the w3c and also allow it to operate as your plans intend?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    The w3c’s been good to us. We should continue considering it worthwhile.

    Don’t confuse the W3C the organization with a tool they create. The W3C does good work. it’s the validator that is pants. ??

    Since I’m capturing the buffer, can’t I just change the keyword to something more, um, prototype friendly?

    No. Anything you change it to will simply be something they won’t recognize as well. They’re not saying that the URL is bad, or that it shouldn’t be in a rel, or anything else. They’re saying that that is not a particular value for “rel” that they know about already, so they’re giving you the warning in case it is wrong.

    The validator is a tool for developers, not for end-users. Users never see behind the curtain. They don’t care how it works, as long as it does. Changing the rel value to something else won’t fix the validator not knowing about it, and if it’s something else, then clients that are looking specifically for that one won’t find it.

    If so, what would you suggest that will trigger a green light with the w3c and also allow it to operate as your plans intend?

    That is not possible. There is no way to change this on your end. The validator needs to be updated to recognize the new rel value. The rel value itself has to stabilize first. This will likely be in WordPress 4.5 when the endpoints for the REST API are added and clients start to use it more.

    To put it another way, this is a totally ignorable error. It doesn’t affect whether your site works or not. It won’t break your site to leave it there. The validator is simply being overly protective, and you can safely not care about that particular error.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘"rel='https://api.w.org/' json" Noise Doesn't Validate’ is closed to new replies.