Fun with Microformat Pingbacks
For some time the pingback problem has bothered me. The problem is that the content that is retrieved by WordPress doesn’t provide a useful summary of the point the pinging post’s author was trying to make. In that respect, treating the ping like a comment, i.e. quoting any part of it on the original post, is fairly useless. This plugin is my response to this problem.
When I thought the problem through I found that I could divide up links into two categories: “Hey look at this’, and “Here are my comments on’.
The former doesn’t add to the conversation, so there is no value to the readers in displaying it on the original post; why would someone ever want to visit a link to the post they linked from?
The latter on the other hand is something of interest, and so that is what we really need more information about.
When I thought it through I realised that any comment on a post is really a review, and there was already a standard, albeit one still in draft, that was created expressly for this: the hReview Microformat.
The benefit of the hReview format is that it is perfectly tailored to this use. It has a URL option that allows the review to specifically reference the post the comment relates to and a summary option that allows the reviewer to summarise their opinion, as they would in a comment on the original site.
The Plugin
The key that the plugin does is to intercept pingbacks and parse the target post looking for an hReview. When it finds one that points at our post it finds the summary text and uses that as the comment text.
This requires PHP 5 and thus far has been tested only on WordPress 2.5. If you use it on another version with success let me know.
For the time being I have implemented only the most basic functionality. I don’t want to force users to comply with a particular use of the Microformat so I haven’t included any authoring help, and I don’t want to prejudge the type of information that bloggers will want added to their comments.
This then is an initial build that people can use to get a feel, and give me feedback on for the future.
There are only two options that can be selected, both off by default:
1. Ignore non-microformat pings.
2. Promote microformat pings to regular comments.
To change these just go to the MF Pings page under settings.
The intention of these is to create an incentive, other than creating better conversations, to use the hReview format, instead of simply linking.
A sample hReview HTML block is included in the readme file of the plugin and you can download it here: Fun with Microformat Plugins at WordPress Extend.
Note: Testing this kind of plugin is very difficult and so I am not entirely confident that every part of it does what it should. You should be aware of this if you are thinking of using it.
