pfefferle / wordpress-webmention

A Webmention plugin for WordPress
https://wordpress.org/plugins/webmention/
MIT License
117 stars 31 forks source link

Semantic Linkback Data picked up wrong Canonical Url #216

Closed bekopharm closed 5 years ago

bekopharm commented 5 years ago

I got a webmention (v3.8.11) on an blog article from my own blog (which is fine) but the Semantic Linback Data's Canonical url is off and I don't know why.

image

I got the Github URL in my page source here as part of a Social Media Rel Me List by the Independent Publisher theme and not as e.g. Site Address setting:

<a class="icon-github url u-url" href="https://github.com/bekoli" title="Beko Pharm @ GitHub"><span class="relmename">github</span>

Tbf I don't know exactly how this should work so it may be my own fault.

What do I have do change that the Webmention doesn't show as "Beko Pharm mentioned this Article on github.com." since this is clearly wrong.

dshanske commented 5 years ago

Yes, but it is how it is being parsed, which is a theme issue, as opposed to an issue with Semantic Linkbacks. It sees those links as inside instead of outside the post.

dshanske commented 5 years ago

Can try to help with that

bekopharm commented 5 years ago

Thanks for your reply @dshanske. I've no link to Github within the <article> scope but it can be read when traversing the DOM upwards. Is this what the problem is?

What is the plugin exactly looking for? I fail to identify a fitting property at e.g. https://schema.org/BlogPosting

dshanske commented 5 years ago

The Semantic Linkbacks plugin currently handles this, not webmention. But it uses microformats 2, you can look at the parser it uses at php.microformats.io.

bekopharm commented 5 years ago

Found it: https://github.com/pfefferle/wordpress-semantic-linkbacks/blob/26e197146a2c80327ffa8651fab7f87ad7fc8efc/includes/class-linkbacks-mf2-handler.php#L252

And yes it is indeed the first url parsed:

image

I'm not sure that this behaivor makes sense. Should I report it over at https://github.com/pfefferle/wordpress-semantic-linkbacks or just make sure that the mf2 parser lists the blog url first?

pfefferle commented 5 years ago

I think it is, as @dshanske said, a theme problem, not a problem of the Webmention/SL plugin. Do you use SemPress or Autonomie/ZenPress?

pfefferle commented 5 years ago

And there is another theme problem, the „real“ permalink is not listed anywhere...

dshanske commented 5 years ago

I have a fork of Independent Publisher called Indieweb Publisher that might satisfy

bekopharm commented 5 years ago

I found out that there is Independent Publisher 2 by now and when I parse this I get also a canonical url (that is in fact also on Independent Publisher 1):

image

alas I don't see this parsed in wordpress-semantic-linkbacks, no?

pfefferle commented 5 years ago

Canonical is not used by SL because it is a global information that relates to the page and not necessarily to the article (h-entry).

dshanske commented 5 years ago

I checked my other implementation of the parsing code and it still interprets it similarly because of the issues identified. There are some mitigations I can think of, such as if there are multiple u-urls preferring the one on the same domain, but that wouldn't have helped here.

bekopharm commented 5 years ago

I start go get the idea. Thanks for your input. I'll edit this to get the canonical url first as hotfix and migrate to a theme that doesn't have this issue at all later.