Category: wordpress

Reblog of Matthias Pfefferle:

Reblog via Matthias Pfefferle

We released version 2.3.0 of the plugin for .

Some new features:

* Support for alt-attributes
* Prioritize attachments based on the post format (article => all, audio => audio, video => video, …)
* Improve JS widgets
* A better default content handling based on the Object Type
* You can now add/remove the capability to use ActivityPub for each User

Full changelog: github.com/Automattic/wordpres

Download: github.com/Automattic/wordpres

Removing all default WordPress CSS styles

The weet theme is extremely fast. One of the ways to achieve this, is by not loading any of the styles that are shipped with WordPress.

After updating to WordPress version 6.4, I noticed that a stylesheet was loading with this theme. Apparently a new stylesheet was introduced. I used the excellent Query Monitor plugin to tell me where this was loaded. Turns out that a separate stylesheet for components exists.

Query monitor panel showing CSS source link for the wp-components handle

In classic themes you can remove stylesheets with PHP if you know the appropriate handle.

function my_dequeue_styles() {
  wp_dequeue_style( 'global-styles' );
  wp_dequeue_style( 'wp-block-library' );
  wp_dequeue_style( 'classic-theme-styles' );
  wp_dequeue_style( 'wp-components' );
}
add_action( 'wp_enqueue_scripts', 'my_dequeue_styles', 10, 0 );

In that case you also have to provide your own CSS.

It seems that I have to keep my eye on changes in WordPress and update the weet theme accordingly.

New features in ActivityPub plugin version 1.0

After a lot of work, version 1.0 of the ActivityPub plugin for WordPress was released. The overall usability has been improved and some of the most requested features were implemented.

The biggest addition is the blog-wide ActivityPub profile. And you can freely set the ID for it. Before you could only follow individual WordPress accounts. That is bit of a hassle, if you want to see all posts. Now you can even decide if authors can be followed or not. So you have more control over which profiles are active.

Screenshot of the profiles settings

A big question for a lot of people is, how you can follow someone and who is following authors. This information was only available in the WordPress admin interface, but now you can add 2 blocks to your website:

  • Fediverse Followers
  • Follow me on the Fediverse

The blocks can also be used as widgets in classic themes, not just in block themes.

ActivityPub blocks in the widget area of the WordPress Customizer

Unfortunately, using these blocks have a significant performance impact, loading almost 2 MB of JavaScript. I will not be using them for now. A GitHub issue was already raised. Hopefully this will improve soon.

Of course, a lot of minor improvements and fixes were included in version 1.0. Have a look at the changelog for a full list. And version 1.0.1 has quickly followed the initial release.

Writing blog posts for ActivityPub

Should ActivityPub posts be written differently from blog posts? That is the question I’m asking myself since posting to the Fediverse with WordPress.

For wee.press I started with the regular settings of the ActivityPub plugin. Turns out that by default the full content is posted, minus some formatting.

Post in Mastodon starting with: This WordPress site uses the ActivityPub plugin …

A couple of things stood out to me:

  • The title of the post wasn’t included. Blog posts have titles, but Mastodon posts don’t. So that makes some kind of sense.
  • People will read posts in an app. Saying “This WordPress site” makes little sense, when it appears on someone’s timeline. Spelling out the site name makes it more clear in other contexts.
  • Full posts are uncommon on Mastodon and similar ActivityPub services.

Luckily, you can customise the output for ActivityPub. I changed it to include the title and a link to the article. Most people will be used to seeing short posts. Personally, I prefer not to see the long posts inside the timeline, because it disrupts the reading flow when scrolling. Also long texts differ too much from typical posts.

ActivityPub settings for: Post-Content, Number of images, Activity-Object-Type, Supported post types

I also added hash tags and hash categories, because this way it can be easier found on Mastodon. I have to admit that it took me a couple of seconds to realise what “hashcats” stands for 😸 The hash tags are plain text, so they support the native functionality in apps. The plugin has the ability to link to the WordPress tag page, but I doubt I will ever use that.

The default for attached images is 3, but I changed that to 1. My posts focus mostly on writing about WordPress and less showing lots of photos or screenshots.

Pages are not that interesting in timelines, so I only enabled posts to get listed.

I still have to look into how WordPress post formats work. In the past this wasn’t very useful to me, so I never used them. But with ActivityPub this functionality might make more sense. I guess I have to read up on how Activity-Object-Types are intended to be used.

It would be nice to have the ability to select the output for each post individually. If I post photos from an event, I probably would want to post all photos. Or occasionally add an extra link or a handle, not just the article URL. How I would like to post, will likely evolve over time, as I get more experienced using ActivityPub.