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 the comment_author_url
  • Only use the source URL, not author name and source URL

indiana-mama.com indiana-mama.com on indiana-mama.com:
(a small) 2017 Book Look Back



December 30, 2017

/

Isha

/

2 Comments







2017 Goal: 60
Actual books read: 74!
I read 27,068 pages across 74 books.
My average rating was: 3.8/5 stars.
Favorite Book: While nothing immediately stood out like in prior years, here are a couple favorites



Least Favorite/Most over hyped: (only rated 2 books below 3 stars all year, and this one was supposed to be great!)



I didn’t manage to stay on top of my reviewing. I don’t really feel down about it though, I’m pretty proud of the 74 I read this year! Josh told me to go for 100 next year. I think I will! Looking forward to all of the new adventures I will find.








Blog









Previous post
Thank you, Mrs. Hogan


















1 Comment










gRegor Morrill
December 30, 2017 at 4:37 pm








Commenting to let you know I read your posts! ;] Great jorb. I aspire to read a fraction of that many books per year, haha.




Reply














Likes



gRegor Morrill










Leave a Reply Cancel reply
Your email address will not be published. Author *
Email *
Website




Respond on your own site? Send me a Webmention by writing something on your website that links to this post and then enter your post URL below.

Testing another reply


gRegor Morrill gRegor Morrill on gregorlove.com:
IndieWeb WordPress Feedback

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


William Gillis ⚑ William Gillis ⚑ on twitter.com:
@gRegorLove This is a product of the blade my server was on getting corrupted and me falling back to a gitpage setu… https://twitter.com/i/web/status/947231668263358464

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.


indiana-mama.com indiana-mama.com on indiana-mama.com:
(a small) 2017 Book Look Back



December 30, 2017

/

Isha

/

0 Comments







2017 Goal: 60
Actual books read: 74!
I read 27,068 pages across 74 books.
My average rating was: 3.8/5 stars.
Favorite Book: While nothing immediately stood out like in prior years, here are a couple favorites



Least Favorite/Most over hyped: (only rated 2 books below 3 stars all year, and this one was supposed to be great!)



I didn’t manage to stay on top of my reviewing. I don’t really feel down about it though, I’m pretty proud of the 74 I read this year! Josh told me to go for 100 next year. I think I will! Looking forward to all of the new adventures I will find.








Blog









Previous post
Thank you, Mrs. Hogan














Leave a Reply Cancel reply
Your email address will not be published. Author *
Email *
Website

Commenting to let you know I read your posts! ;] Great jorb. I aspire to read a fraction of that many books per year, haha.


In reply to: https://www.goodreads.com/read_statuses/2142204566?comment=174763701#comment_174763701

Nice. I saw some Twitter discussion recommending it. Sounds really good!



Want to read: Star Wars: Bloodline


camb camb on odat.xyz:
Test post

Testing webmentions from another site!



In reply to: https://www.meetup.com/SoCalALN/events/246280203/

I’m attending “The Shape of Water with dinner beforehand”


Ha! Tolerated for two check-ins, Marty McGuire



Dora (indiewebcat) snoozing during Virtual Homebrew Website Club


In-browser mockup of tonight’s thoughts. Click to embiggify


gRegor Morrill gRegor Morrill on gregorlove.com:
My #newwwyear resolution for gRegorLove.com:

1) Starting today

2) I’m going to work on an improved, wider layout for photo posts and photo gallery pages

3) Before 2017-01-07

Props to @jensimmons for the motivation!

https://twitter.com/jensimmons/status/943323088405581824

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.


Chris Aldrich Chris Aldrich on boffosocko.com:
Virtual Homebrew Website Club Meetup on December 27, 2017

I’m attending “Virtual Homebrew Website Club Meetup on December 27, 2017”