b2evolution / b2evolution

b2evolution CMS: Multiblog/CMS content publishing + forums + email marketing + social network + more... b2evolution includes everything you need to run and maintain a modern website. Optimized for low maintenance with easy upgrades and effective antispam. Full RWD & bootstrap support.
http://b2evolution.net/
Other
178 stars 88 forks source link

Webmention plugin #40

Closed keithbowes closed 7 years ago

keithbowes commented 7 years ago

Webmention recently became a standard, replacing the quasi-standard Pingback, which itself was designed to be a replacement for the spam magnet known as trackbacks (seemingly the only type of linkback currently supported in b2evolution). I'd like to write a plugin to implement it (a plugin seems like the only sane way to go; I can only assume the reason trackbacks aren't implemented via a plugin is that they date back to before plugins were available). Before I get started, though, there are a few questions I have.

First and foremost, if I were to write the plugin, would it be worth my time and effort, to create a branch and send a pull request on completion? Or is there just no chance that it would get into b2evolution and I should just create a standalone plugin instead?

If it can get merged into b2evolution (again, it's a plugin, so users would have to explicitly enable it), here's what I'd plan to change:

  1. Change T_comments.comment_type to enum('comment', 'trackback', 'mention', 'meta'). 'linkback' would be removed, as it's not used anywhere in the code. 'pingback' would change to 'mention', which would encapsulate all mention-based linkback protocols (not that there would be reason to implement more, as Webmention is the standard). (BTW, I already translate "pingback" as "mencio" (mention) in my Esperanto translation; it always seemed like the logical translation, even years before I heard of Webmention). An alternate solution would be to remove both 'trackback' and 'pingback' as to integrate all linkbacks into a common type (though trackbacks are different than the other linkback types and it would break blogs that enable trackbacks and use a skin that doesn't detect the 'linkback' type, two considerations which make me prefer the first solution).
  2. Likewise, change the actual code so that detecting the comment type would reflect one of the four new types (i.e. change case 'pingback': to case 'mention':).
  3. Of course, change "pingback" to "mention" in the translatable strings. Most likely, this would create easy-to-change fuzzy translations in the PO files.

What I'd like to do:

  1. Remove all references to pingbacks. It seems that they either were never implemented or were removed along the way. In fact, they were the one and only feature I missed when I switched from WordPress to b2evolution (IIRC, in the 2.x series). Considering they were replaced by Webmention, there's probably no reason to ever implement them.

The one comment in inc/items/_item.class.php that makes me suspect that there was the infrastructure for pingback support but it was never implemented is:

// dh> TODO: Add plugin hook, where a Pingback plugin could hook and provide "pingbacks"

If my Webmention plugin would be a standalone plugin, I suppose I'll just add the Webmention comments to the 'pingback' type, as there's already detection for that type in a switch...case statement in the skins (though, it wouldn't be completely accurate).

fplanque commented 7 years ago

a plugin seems like the only sane way to go

Agreed

I can only assume the reason trackbacks aren't implemented via a plugin is that they date back to before plugins were available

Correct. I'd like to remove them from the core but so many other priorities...

should just create a standalone plugin instead?

Yes please. We'll publish it on plugins.b2evolution.net but would not want to bundle it. Same thing for trackbacks if we get to the point where we pluginize it, we won't bundle it. Also btw, we'll de-bundle quite a few non-essential plugins around v7.0. Also btw, we might add an easy download + install feature for plugins that are on plugins.b2evolution.net.

Change T_comments.comment_type to enum('comment', 'trackback', 'mention', 'meta'). 'linkback' would be removed, as it's not used anywhere in the code.

We can add 'mention' if you need it. Why change 'pingback' to 'mention' instead of having both (there is no cost to the DB).

change the actual code so that detecting the comment type would reflect one of the four new types (i.e. change case 'pingback': to case 'mention':).

Unless I am mistaken, this is for display/translation purposes only, so it would make sense that plugins provide the strings and if no plugin provides a string, we'll just display 'comment' or 'feedback' (which is another wording issue we never really squared out)

Of course, change "pingback" to "mention" in the translatable strings. Most likely, this would create easy-to-change fuzzy translations in the PO files.

As said above, I'd like this to move to the plugin and the plugin's translations.

Remove all references to pingbacks. It seems that they either were never implemented or were removed along the way.

They were removed years ago when we discovered they were broken + security issue + nobody interested in fixing them. We thought we'd put them back as a plugin if someone ever wanted to volunteer that plugin ;)

Considering they were replaced by Webmention, there's probably no reason to ever implement them.

Ok.

If my Webmention plugin would be a standalone plugin, I suppose I'll just add the Webmention comments to the 'pingback' type

We can still add the "mention" or "webmention" type to the DB so it's cleaner.

keithbowes commented 7 years ago

Hm. I suppose this issue should be closed then. I'll get around to moving my plugin from a branch on my b2evolution fork to a separate repo.