Your WordPress as Your Personal Mastodon Instance

tl;dr: Three plugins can transform your WordPress install to your personal Mastodon Instance: ActivityPub, Enable Mastodon Apps, and Friends.

As you might know, I am the author of the Friends plugin for WordPress. I started this in 2018 with the idea (which I later described in a vision post) that something like Facebook (with private posts) could be implemented decentralized between WordPresses (and later other blogs/cmses).

To be honest, the effort is and stays somewhat niche. Social networks are good at locking people in, discovery is better, and many of my friends don’t actually run their own blog.

Joining the Fediverse

A few years later, Mastodon became big, and having been in contact with Matthias Pfefferle, I realized (after he repeatedly poked me) that it’d be great to join forces with his ActivityPub plugin (later acquired by Automattic): it allows people on Mastodon and other ActivityPub networks to follow your WordPress blog directly, not utilizing the then common “Share to Twitter” et al functionality.

So, when you have both ActivityPub and Friends installed, you can be followed and follow people on Mastodon. The Friends plugin compiles a feed of your follows (mixed in or separately also with all your RSS subscriptions).

A screenshot of the Friends plugin home screen feed.
This shows my private Friends page where statuses and posts display mixed (you can also have pure views)

This was already nice, but Matthias and I both had to implement further elements to be truly integrated into Mastodon conversations: the ActivityPub plugin implemented replies with comments, Friends implemented Boosting and Replying to any (ActivityPub) URL, and much more.

Screenshot of the ActivityPub Admin Screen
The ActivityPub admin page shows your Mastodon Handle

A (Mobile) App Ecosystem

Still, there was one piece missing. Mastodon has a thriving third-party app ecosystem. The UI of Mastodon as well of Friends (while completely customizable), is not to everyone’s taste, but you have a huge selection of apps to match your taste.

So, in the very end of 2022, I started to work on the Enable Mastodon Apps plugin. It implements the same API that Mastodon implements for talking to its clients, just in WordPress.

A screenshot of Mastodon apps
Today the official directory lists 56 apps, likely many more exist

It was quite a wild ride (that likely is not over yet), reverse engineering some clients because they would crash even if the plugin spoke exactly what the docs defined. The reason being that most apps (understandably) assume some further truths that are valid for Mastodon’s implementation, like ids, while being defined to be of string value, actually need to be numbers. Eugen Rochko actually later confirmed to me that this specific choice was merely made to avoid troubles with very large ids.

Last week, I released 0.9.0 of Enable Mastodon Apps which is almost a rewrite, fueled by contributors at the CloudFest Hackathon: special thanks to Matthias Pfefferle for hosting it, Matthias Kittsteiner, Konstantin Obenland, and Ralf Wiechers for your contributions! This resulted in a more stable implementation (ensuring correct JSONs) and a stricter separation of concerns.

Combining the Power of Three Plugins

So the combination of the three plugins now gives you the ability to fully interact with the Fediverse while not having to host your own Mastodon which comes with quite a list of requirements.

Granted, there are still rough edges (please help discover and fixing them by reporting in the respective Github issues) and we yet only have experience with a couple hundred followers and follows. But that works already reliably.

Each of the plugins are useful on their own:

  • If you have just the ActivityPub plugin, people can follow your blog on the fediverse, can comment from the fediverse on your posts and your replies will go back into the fediverse.
  • If you have just the Enable Mastodon Apps plugin, you can use Mastodon Apps to see the posts on your blog (useful if it’s a multi-people blog), reply and submit new posts.
  • If you have just the Friends plugin, you can connect WordPresses, follow RSS feeds, get keyword notifications, apply feed rules, react on posts with emoji (there is a bit of an ecosystem of its own, with further plugins Post Collection and Send to E-Reader).

Together, by making use of WordPress hooks (see for example the Enable Mastodon Apps Hooks Documentation), the plugin extend each other’s API responses or UI. What travels over the the ActivityPub protocol is handled by the ActivityPub plugin. When a feed of posts is involved, the Friends plugin will fill in your friends’ posts. And so on.

Alternative UIs

It’s really quite something to be able to browse your own blog, or statuses and blogs you follow with apps like Phanpy (web), Elk (web), Mammoth (macOS, iPad, iOS), or Tusky (Android) or Ivory (macOS and iOS).

The posting experience from mobile using a Mastodon App can be better than with the standard WordPress mobile apps. Each app covers a different use case and has posting UI specialized in that.

Empower Your WordPress!

I believe that the Fediverse comes to the rescue of blogging. Unfortunately, years ago the comment sections of the web were killed by spam. The fediverse now reopens meaningful interaction with your blog posts. Comments from the Fediverse appear in your blog and your responses are sent back as replies. That gets conversations going again!

To try it out, you can use WordPress “run WordPress in your browser” Playground to take a little glimpse at the plugins without having to install it: Note that, because of its JS nature, playground is in a sandbox and can only connect to CORS enabled URLs.

Finally, these are the links to the WordPress plugin directory:

  • ActivityPub: have conversations about your blog posts across the fediverse.
  • Enable Mastodon Apps: make WordPress compatible with Mastodon apps.
  • Friends: follow others via RSS or ActivityPub.

Thanks for reading, I am curious for your opinions! You can reply to this post on the fediverse!

Mastodon API Tester

tldr: Use the Mastodon API Tester to play with the Client API of Mastodon.

I’ve created the WordPress plugin called Enable Mastodon Apps which does a seemingly small but powerful thing: it enables you to access your WordPress blog using Mastodon apps like Tusky or Ivory. This can be used to browse your own blog and post to it. If you also have the Friends plugin and the ActivityPub plugin installed, this will actually make your WordPress blog behave like a Mastodon instance.

It does this be re-implementing the Mastodon API (unfortunately, Mastodon didn’t opt to implement the ActivityPub client-server API so this is not based on a standard) which can be tricky: it uses REST API endpoints in the (virtual) directories /oauth and /api which are so generic that they are prone to conflicts.

Additionally, although the API is well documented, many apps were created based on assumptions that are true for Mastodon itself (which caused a lot–sometimes hard to reproduce–of issues for the plugin). For example, the id of a post or a user is defined as a string but many apps crash when you put a non-number there. Or that a boosted toot needs to have a different id than the virtual “wrapping” toot (Ivory!). In such cases, apps would crash but work fine with Mastodon itself.

Even more complicated are interactions with other WordPress plugins. It can be hard to understand if the plugin is working correctly, if another plugin is interfering, the hosting provider acts quirky, or if the Mastodon app has an incompatibilty with my implementation.

Thus I have created a simple one-page JS app called Mastodon API Tester hosted on Github pages (source on Github):

I hope that this tool will help identify issues better in future, it can also be used with GotoSocial or a “real” Mastodon instance. Feel free to report issues you might encounter.

PS: the Enable Mastodon Apps plugin will be worked on at the Cloudfest Hackathon, thanks Matthias Pfefferle for taking the lead on this! (Unfortunately, I cannot make it there because I’ll be speaking at WordCamp Asia in Taipei just the weekend before that.)

PPS: Happy Birthday, Matt!

Old News but still true as ever: Facebook and Instagram are harming the Open Web

A big motivation for building the Friends Plugin is to be able to follow what my friends and family are up to. Probably the most important “follow technology” is good old RSS.

While mostly used for public posts, there are many examples of how it can deliver posts not meant for the public: the solution are individual RSS feeds per subscriber, for example paid podcasts, or like the Friends plugin gives specific feeds to friends that can contain private posts.

Now reality is that (no longer) every platform has RSS feeds. It’d be easier if they just provided themt but alas. There are plugins for the Friends plugin itself that make use of projects that have built custom parsers for specific services: Fraidyscrape and RSS Bridge.

Now unfortunately, a lot of friends and family post to Facebook or Instagram. It’s just impossible to follow these friends outside of the platforms.

  • They don’t provide (authenticated) RSS feeds. That would solve all of this.
  • They rate limit and quickly block IPs (especially Instagram) that try to read a few posts unauthenticated.
  • It’s unintuitive, developer centric and needs approval to get an API key, so it’s not something every user of the plugin can be asked.
  • Their HTML is scrambled with random class names, preventing any classic scraping.

So in the end, the content of my friends and family is locked in. It would be a solution for them to create their own blog (IndieWeb style) and share their content that way. But I am realistic enough to understand that the hurdles are great. They are already connected to their friends inside Facebook or Instagram. They get lots of likes and responses there. They are used to the UI and the apps. It’s just not good for anyone who doesn’t want to join the Facebook ecosystem and be exposed to their ads.

We’re all using RSS Readers all the time…

… we just don’t realize it. If you think about it, most of the social network services are specialized RSS Readers that combine consuming with creating. (Just to be clear, these social networks don’t provide RSS feeds, what I’m saying is that what they do could be done with RSS feeds.)

Take Facebook, for example:

  • If you follow someone, you’re subscribing to their RSS feed.
  • If you like a page, you’re subscribing to their RSS feed.
  • If you become friends someone, you’re subscribing to their RSS feed and vice versa.
  • If you view your timeline, you’re looking at all posts by your subscriptions (usually modified/filtered by Facebook).
  • If you post something, it’s added to your RSS feed and the people who are subscribed to you (via follow or friendship) get your post in their feed.

Twitter is similar, they just limit the post format to “status”. Instagram limits the post format to “image”. Tiktok to “video”.

The problem that I see with this is that this happens in a centralized manner. With RSS readers, we already have the decentralized version of this technology. The benefit of social networks is that they solve a few problems well:

  • Easily reachable and searchable user base (= audience).
  • Easy account creation (just sign up here).
  • They combine consuming with creation.

I see a possible solution in WordPress. There are many options to get WordPress hosting with your own domain. With the Friends Plugin you can then combine consuming and creating. The Friends plugin allows you to consume the web your way, WordPress is a well established way of creating content.

By using post formats, you can also create different types of content and consume the same kind of incoming content combined. See the screenshots above, showing the main, combined feed, an image feed and a status feed.

Also, commenting on posts is built in to WordPress. With a friendship based approach you can even open up comments just to friends, which can reduce the usual “spam problem.”

What’s still missing for is the convenience of single-purpose apps. The cool thing is that these apps would talk to your own server which handles retrieving of followed content vs. this being relayed to a third party (who then knows the follow patterns of everyone on their platform). With Sunlit, micro.blog has implemented something like this for photo sharing inside their micro.blog platform but I believe this could be done for “RSS” as well.

The Indieweb movement follows very similar ideas to what I described above. The concept of webmentions allows you to respond to a post by posting to your own server, sending a ping to the original article. While the WordPress + Friends approach might be a bit more integrated, I see webmentions as a reasonable bridge between the worlds.

All in all, I believe having a personal blog is good for the health of internet. It’s unfortunate that in their history, personal blogs have this huge focus on “being public.” I believe it is equally well suited to be a place for more private communication, and especially a place where you can consume the web the way you like.

Reducing Our Dependency On Third-Party Platforms For Our Online Activity

There is something that I feel is not right with today’s web structure. We, as the population of the web, create so much content that ends up on servers of large companies. We could own our data.

Therefore, I’d like to help reduce everyone’s dependency on third party platforms for their online activity.

Vision

You use your own server for publishing and interact with other people’s content on their server.

Since everybody follows this method, your content only reaches the people it is meant for, without involving a third party in the distribution.

You interact using the same means of today: web UI, mobile apps; the difference is that they don’t talk to a third-party server, neither for publishing nor getting and interacting with others’ content.

I am trying to create a solution for this with WordPress and the Friends plugin.

Note: in the following text I use the word “server” somewhat synonymous for the WordPress+Friends setup but it there could be alternative implementations. Also, server doesn’t mean “a dedicated machine somewhere,” you just need web space where you can install WordPress, which doesn’t mean it has to be expensive. For example, wpfriends.at is hosted for €1,90/month incl. domain.

Separation of Content

Today, separate social networks exist for different types of content; for example short content has its home on Twitter, Instagram is for photos. Facebook is a mix of this but allows for private content. Instant messengers like WhatsApp (or Facebook groups) are very clear about who the content or conversation is for.

So, separating content makes for a more homogeneous experience when consuming the content, also you have a good grasp of where (and for whom) you want to publish your content.

On your own server, you can separate out different types of content as well (in WordPress this is called “post formats”). You can also post something privately, only giving access to authenticated users.

Adding a friend and subscribing to multiple platforms on which they publish

The key is to connect the different types appropriately. By fetching the content from your friends and placing them in such “buckets,” you now have the option to view everyone’s content from multiple perspectives: everything from a single friend (or a group) across content types, or everything across friends of just one content type.

By continuing to use specialized apps for different types of content, you keep the benefits but exclude the third-party having full access to the content since they now talk to your own server.

Platforms

The possibility to publish on the Internet by using your own server (most of the time: rented web space) is well-established since blogging was invented. It can become clunky when you interact with others: how do I respond?

That’s why there are several reasons why platforms are appealing:

  • It’s easy to connect with others on the same platform.
  • Leveraging network effects is easier since the platform knows who is connected to whom.
  • Spam is usually under control.

Thinking back to the era of blogging, we had lots of interactions with others using comments and pingbacks. What mainly led to its demise was automated spam which reduced everybody’s willingness to be open for interaction. Commenting meant moderating spam.

Core

So one of the core features of the Friends plugin is to solve the authentication problem between people you know and trust.

When you decide “to become friends” with someone, it means that you both get (low privilege) accounts on each other’s servers.

You can give them permission to see your privately published content, or not. When you want to respond to their post, you are automatically authenticated on their side.

This means that you could close comments for unauthenticated users (thus eliminating spam) but keep the discussion open for your friends.

Transitioning

Using your own server still has a learning curve. Getting started with a self-hosted WordPress and installing the Friends plugin is not as trivial as creating an account on a social network.

While it has become considerably easier to register a domain, get webspace connected, and a WordPress installed, there are still many further steps until you really can get started.

So, reality is that your friends likely won’t be migrating off third-party networks. Possibly never.

To still allow yourself to disconnect, the Friends plugin allows you to follow your friends across different (possibly third-party) channels including popular social networks like Twitter.

You can subscribe to someone on Twitter and their messages will be aggregated on your server under their user, in the respective post format.

This means that you can either view all the content (that you follow) for a single friend, or you can view the aggregate type of content, e.g. all the short messages your friends posted across services.

Not only for “real” Friends

Many use social networks to not only follow people they know and trust, but also to follow the news or celebrities. Despite the name of the Friends plugin, it can also do that.

You can subscribe any supported content (some out of the box, for others you can extend it with plugins) but not go into the friendship realm.

Your server takes care of fetching the content from various third-party sources and you can then consume the content in the way you see fit:

  • The local “Friends UI” on your own server,
  • an RSS reader,
  • or more specialized clients like mobile apps.

Ads

One side-effect of this could possibly be that this removes our content from being wrapped in ads and websites trying to have us spend as much time as possible on their site.

We’d all spend a little money for domain and server every month or year for our own gain. We don’t need to put ads to our content.

For journalistic content it is already not uncommon for tech publications to provide an ad-free RSS feed as part of their paid subscription.

More Ideas

You can use your server to store more things, for example:

Your personal bookmark collection and todo lists (I have a work-in-progress for transitioning my previous project called thinkery.me to a WordPress plugin thinkery to host this yourself and use the Android app as a client).

Leverage your aggregated content as your own browser start page (my WordPress plugin called Startpage).

Right now, this is only implemented for WordPress, and the authentication is only leveraged for consuming private content and posting comments. But it doesn’t need to end there.

The authentication could be used for further actions, for example you could give posting permissions to your friends to create a (private) forum, hosted by you or a friend.

The Friendship protocol is a REST API that can be implemented in other software as well.

The Friends plugin is open source and GPL.

Work in Progress

How far along the way is the Friends plugin? It’s already well usuable for your own purposes. Like I said above, you can establish friendships between servers and consume your friends’ content, even from third-party social networks.

There is still a lot to do, especially around commenting and notifications. Better tools are needed for leveraging network effects, like search your friends+ posts and explore their friends (if they allow you to do so).