PHP updates and fixing BuddyPress Follow

BuddyPress Follow is a plugin we use to enable you to follow rather than “friend” each other. Sadly, it is not PHP 8 ready. This was holding us back both in terms of security and speed.

Today, I fixed that.

It was a four-line fix, which I shared here.

Find line 133 in buddypress-followers/_inc/bp-follow-widgets.php

add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Follow_Following_Widget");' ) );

Then write this instead:

function BP_Follow_Following_Widget_init_func(){
    register_widget("BP_Follow_Following_Widget");
}

add_action( 'widgets_init', 'BP_Follow_Following_Widget_init_func' );

The reason this works is that the function create_function() was removed in PHP 8 and was deprecated in 7.4 or thereabout.

Also, this post is the first to use the new Open Mention Tag Patterns. These are dead simple one-line paragraphs with hyperlink templates which can be used to tag your content in OpenMentions, which will ping via WebMention. Your post will then (eventually) be listed on OpenMentions.com.

By default, the writing patterns are enabled for all, but you can add dreamlogging templates if you admin a blog here and want to. You can find the code here. While, yes, you can just grab a link and use it, I think the Patterns are one step easier. Edit as you wish.

The next line was the Pattern:

This is a WordPress Development post.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)

Bugs
2
Fixes and tweaks

In this morning’s dev notes, we have a patched potential security vulnerability and some CSS tweaks to do with sign up. First, the scary-sounding one. I patched a possible security hole. Some core site functionality was being provided by a deprecated and retired plugin. A patched version exists, but it …

Bugs
1
A few small display bugs

I’m currently tracking a few small bugs with the site. I do not have an ETA on fixing all the bugs because I am yet to figure out what caused them.

WordPress Development
8
Possible site speed-up feature

The news is that WordPress released a performance plugin that could offer “Near-Instant Load Times”. Danny pointed this one out to me. It looks good. WordPress released an official plugin that adds support for a cutting edge technology called speculative loading that can help boost site performance and improve the …

Skip to toolbar