One of the known issues with webmentions in WordPress is that they are often flagged as spam by default. There is a workaround snippet of code on the wiki to automatically approve them. That got me thinking about the core feature of approving comments only from previously-approved commenters. It seemed there should be a way to leverage that core feature for webmentions as well.
I found the WordPress code that pre-approves those type of comments. The main issue is that it requires both the comment author name and email. I wrote a filter function that instead checks the name and webmention source URL against previously-approved webmentions.
Here is the code: https://gist.github.com/gRegorLove/8215cb9c9584b364aaf4ef2999416f56
I put it in the theme’s functions.php file and it worked!
Further improvements would be to:
- Add a conditional check for the WordPress option
comment_whitelist
so it only does this when that option is enabled - Use the wp_commentmeta table,
webmention_source_url
instead of thecomment_author_url
- Only use the source URL, not author name and source URL
Testing another reply
Got the webmentions sorted out. Turns out I installed but forgot to activate the plugins. Working smoothly now!
Testing WebSub notifications with https://websub.rocks
Definitely easier to maintain than a WordPress install. Nice!
If you add http://microformats.org/wiki/h-entry I can subscribe directly to the HTML page with https://woodwind.xyz, no XML feed necessary.
@rechelon FYI: I apparently subscribed to https://humaniterations.net/feed/ a while back and https is failing now.
I see your feed is also at /feed.xml now, so might want to redirect /feed to there.
Commenting to let you know I read your posts! ;] Great jorb. I aspire to read a fraction of that many books per year, haha.
Nice. I saw some Twitter discussion recommending it. Sounds really good!
Want to read: Star Wars: Bloodline
Testing webmentions from another site!
Want to read: The Honest Truth about Dishonesty
I’m attending “The Shape of Water with dinner beforehand”
Some thoughts on my #newwwyear resolution:
Use the wide container class I already have to make the content area maximum 960px wide. (e.g. the top of my style guide)
Apply the same wide container to the header. Put logo in left 3-4 columns and navigation links in the remaining columns. Trim down the whitespace between the header and content (but not too much; let things breathe).
For resolutions < 960px wide, let photos be full-bleed. Text posts should still have some padding on the edges for readability, though.
I’m attending “Virtual Homebrew Website Club Meetup on December 27, 2017”