Automattic / wordpress-activitypub

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

Feature Request: Map WordPress post type to Activity Type #678

Open DeadSuperHero opened 5 months ago

DeadSuperHero commented 5 months ago

What

Publications and blogs can make extensive use of different WordPress types: images, videos, podcasts, reviews, articles, and more. The problem is that the current ActivityPub plugin makes a big assumption that a blog's admin wants all of their stuff to appear as a singular uniform type to Fediverse Actors, even when specific WordPress types might be suited to something else.

Screenshot_20240125_140218_Firefox

Screenshot_20240125_140157_Firefox

We humbly request an extension of the existing customization feature to be applicable on a per-Wordpress-post-type basis.

Why

One struggle that we've had with the WordPress-ActivityPub plugin is that it currently takes an "all or nothing" approach for a blog.

We Distribute has multiple types of WordPress posts:

We're also looking at adopting short-form posts for quick news updates.

Here's the problem: all of these will only be rendered as one uniform Activity type. If we choose Article, even short-form content will be unreadable from platforms such as Mastodon. If we choose Note, that might cause problems for platforms specifically designed to post and read Article activities.

It would be incredibly useful to extend the existing customization options for federation to be applied on a per-Wordpress-post-type basis.

How

The plugin could check to see which post types are currently enabled on a WordPress site, then provide customization options for what Activity type is used, and how the template is customized.

This would allow content coming out of WordPress look more native to Fediverse platforms supporting particular types. From a UX perspective, maybe the Customization section would represent different tabs for each WordPress post type, and users could decide which activity type should be mapped.

pfefferle commented 5 months ago

Thanks for filing that issue! I am totally with you and already prepared a PR for that, I am curious about your feedback: https://github.com/Automattic/wordpress-activitypub/pull/661

DeadSuperHero commented 5 months ago

Wow! 🤯 I guess we're on the same page about this.

DeadSuperHero commented 2 months ago

I just wanted to follow up on this, as it's something I'm still thinking about. I see that you have improved the defaults in your PR - which is good! That is definitely a great improvement.

One thing that I have been thinking about for We Distribute, is the idea of mapping different WordPress Post Types to different ActivityPub vocabulary representations.

Here are the WordPress Post Types we currently support:

It would be really cool to be able to use something like this dialog: image

On individual WordPress Post Types. So, it could be something like this:

I realize I might be asking a lot, but being able to do this for better compatibility with the network would be great for our site.

pfefferle commented 2 months ago

I realize I might be asking a lot, but being able to do this for better compatibility with the network would be great for our site.

I like that you ask a lot, that means you care! 🫶

The current code uses Article as default and sets Note if it is of the type: 'aside', 'status', 'quote', 'note', 'gallery', 'image', 'video' or 'audio', it changes to Note.

So if I change it so that "Note" is the default and that "Article" is set specifically for articles only, it might work like you proposed?

I think I like the idea, because as Note is handled the best, every unknown WordPress content should us that as default!

Thanks for your feedback!

DeadSuperHero commented 2 months ago

I think I'm pretty comfortable with that idea! That should work for most use-cases.