Automattic / wordpress-activitypub

ActivityPub for WordPress
https://wordpress.org/plugins/activitypub/
MIT License
493 stars 73 forks source link

Fediverse Creator - limited options and incorrect syntax #884

Closed edent closed 1 month ago

edent commented 1 month ago

Quick summary

The new plugin adds:

<meta property="fediverse:creator" name="fediverse:creator" content="blog@shkspr.mobi" />

As per the specification, the "property" isn't needed. The example given is:

<meta name="fediverse:creator" content="@Gargron@mastodon.social" />

Not all users will have their blog's name as their primary AP name. For example, I use my Mastodon handle. Perhaps this should be user selectable?

Incidentally, the meta element doesn't need a closing /

Steps to reproduce

  1. Enable the plugin
  2. View source.

What you expected to happen

What actually happened

Syntax is slightly incorrect causing minor psychic distress to nerds like me!

Impact

All

Available workarounds?

No but the platform is still usable

Logs or notes

No response

pfefferle commented 1 month ago

Hey @edent 👋

thanks for your feedback.

Incidentally, the meta element doesn't need a closing /

Yes, it does not have to be self-closing, but if you want to be XHTML compatible, you should add it. Besides of that, it is the default way WordPress handles metas and links.

As per the specification, the "property" isn't needed. The example given is:

The problem here is, that it is not an OGP extension if it has no property, so I decided to add both. It should not break anything and might be ready for possible changes that might come in next versions to be fully OGP compatible. Mastodon also supports the property attribute btw.

edent commented 1 month ago

OGP is dead - https://shkspr.mobi/blog/2022/11/is-open-graph-protocol-dead/ - there won't be any more updates to it.

But fair enough on the XHTML point - if indeed there are still people using that.

mikka2061 commented 1 month ago

In addition, the meta should open with a trailing @ sign, if I am not mistaken. Currently, mine shows

<meta property="fediverse:creator" name="fediverse:creator" content="mikka@mikka.is" />

when the proper syntax should be

<meta property="fediverse:creator" name="fediverse:creator" content="@mikka@mikka.is" />

pfefferle commented 1 month ago

@mikka2061 it works with and without it:

It will work with and without the leading at-symbol for the handle. If multiple tags are present on the page, the first one will be displayed, but we may add support for showing multiple authors in the future.

https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/

mikka2061 commented 1 month ago

@pfefferle

https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/

That's however sadly a function of the Outlookification of the Fediverse by Mastodon. The fish/key Implementation (no idea how others will handle it, I presume it'll be "Mastodon forced our hand") which predates Mastodon uses const usernameServerRegex = /@[\w.-]+@ for this. I'll put in a PR for some of the fish-clones to acquiesce to Gargron, but since it's neither hair nor hide, maybe add the @ in the Plugin?

Edit: probably shouldn't say "predate" since the feature is/was in Alpha/Beta on Mastodon. I do stand by my "Outlookification" comment, since Gargron's decision to make the @ optional means a sharp turn away from the commonly used @ prefix to mean social usernames as opposed to email addresses, etc.

pfefferle commented 1 month ago

But the @ is something that came up with Twitter and was adopted by Mastodon, so it is mainly a UI driven thing, the pure WebFinger ID is without the @, so it is always harder to handle the @webfinger over the pure webfinger handle. That's why I technically prefer the @-less version and because this is not user facing, I am not sure if it will ever break something!?!

mikka2061 commented 1 month ago

Ah, you're absolutely right. I stand corrected. (I'd argue, that @ predates Twitter from those IRC days of yore, I wonder if Wusel knows more about that, but you're nevertheless correct). Sending PRs out.

pfefferle commented 1 month ago

I will close this for now, please re-open if you think it is still something to do.