#wordpress 2017-12-31

2017-12-31 UTC
#
gRegorLove
Ohh, the comment_type=webmention I saw was for the like, not the reply.
#
gRegorLove
Is there a reason comment_type=webmention isn't set for replies?
#
gRegorLove
If it did that, I have a hook that will approve subsequent wm after the first one is approved.
#
GWG
gRegorLove: Because a reply = comment, and comment in WordPress is ""
#
GWG
There actually is a proposal to change that
#
gRegorLove
Ah, and you're using comment_type to determine how they're displayed.
#
gRegorLove
Makes sense
#
GWG
Well, we discussed a breaking change. Instead of it being type='webmention' and semantic_type='like' type="like"
#
gRegorLove
Maybe I can get what I want by checking the comment_meta for webmention_created_at
#
GWG
gRegorLove: That's one of the reasons we added that into meta
#
[miklb]
GWG that ticket seems like an interesting one to tackle
#
GWG
[miklb]: No one cares because it isn't Gutenberg.
#
GWG
But, it is tagged as an essential step toward custom comment types, which would help
#
[miklb]
I don’t see any patches, has anyone written anything to mock up that idea?
[kevinmarks] joined the channel
#
GWG
No.
#
[miklb]
and your concern about working on it is that it would be ignored due to not being part of Gutenberg?
#
[miklb]
or just not something you’re interested in working on?
#
GWG
Well, I'm interested in custom comment types.
#
GWG
But, partially I think it would be ignored.
#
GWG
Partially, the backcompat and upgrade stuff is problematic
#
[miklb]
understood. I would just hate to hear anyone not interested in contributing something to WordPress because it isn’t part of Gutenberg.
#
GWG
I feel that if I called webmention Gutenmentions, they'd include it
#
GWG
But honestly, I'd submit if not for my concern re trying to get an upgrade routine together
#
[miklb]
seems like getting the custom comment type sorted in core before webmentions come to core might be a logical progression
#
GWG
I need at least one interested Core committer to get it
#
GWG
so I'm going for parsing.
#
[miklb]
I would certainly help advocate for the change and see who’s eye I could catch.
#
[miklb]
and help find eyes for the upgrade routine code
#
GWG
I may tackle it someday
#
GWG
But I want to try other things first
#
GWG
If I stall on the Press This project, I have Indieauth
#
gRegorLove
Debugging WP filters like pre_comment_approved is tricky. Any tips?
#
GWG
I wish
#
gRegorLove
does the lazy mail() way
#
gRegorLove
Woo, got it to work!
#
gRegorLove
Uses comment_author_url, which afaik isn't (easily?) spoofed.
#
gRegorLove
I sent one webmention to my friend's site, it was approved, and subsequent webmentions are automatically approved.
#
gRegorLove
comment_author_url despite the name, is the source URL of the webmention.
#
GWG
gRegorLove: Not indefinitely
#
gRegorLove
Not sure what you mean
#
GWG
I've talked about changing that
#
gRegorLove
Ah. Well, the technique could be altered to check wp_comments_meta table instead.
#
gRegorLove
In fact, probably a better solution, but this works today. :)
[tantek] joined the channel
#
gRegorLove
*wp_commentmeta
#
[miklb]
I need to look at a reply webmention again in the db and see what is stored.
#
gRegorLove
meta has a lot: source, target, created_at, avatar, canonical, type, mf2, etc.
#
gRegorLove
An improvement to that snippet would be to check the wp options for comment_whitelist being on first, like check_comment() does.
#
GWG
gRegorLove: The reason I submitted the PR to store more meta was to move toward that.
#
gRegorLove
FWIW (as a non-daily-WP user), I like the idea of using the comment meta for this special handling, so the wp_comments.comment_author_url is truly the author's URL, from their h-card in the case of webmentions
#
gRegorLove
Sounds great, GWG.
#
gRegorLove
Thanks for the help today. It was fun to get more familiar with indieweb WP
#
GWG
gRegorLove: A lot of the little things I did were to set up for plans I have yet to execute
#
GWG
Like storing created_at, since comments don't have a modified date.
#
Loqi
[gRegor Morrill] 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 comment...
#
[miklb]
I’m now very intrigued gRegorLove I’ve had issues with replies going to the trash and hope to solve that with what you’ve surfaced
#
gRegorLove
trash is interesting (vs. just pending). Any keyword moderation set up?
#
[miklb]
yes, I do have a blacklist that I copied from somewhere, I haven’t actually grepped the whole list to see if anything there is catching it
#
[miklb]
I’d rather solve with a hammer and whitelist them explicitly 🙂
#
[miklb]
Also discovered this evening I’m not displaying regular mentions anywhere on my entries
gRegorLove_ joined the channel
#
gRegorLove_
miklb: that snippet should work, then. It's similar to the one on the wiki, it just does additional checks instead of "approve all webmentions"
#
gRegorLove_
check_comment() is called, then wp_blacklist_check(), and finally the pre_comment_approved() filter, so whatever the latter returns takes precedence.
#
gRegorLove_
So even if you have moderated keywords in comments, they'll be ignored in webmentions
#
[miklb]
right, but since these are converted to regular WP comments as replies if I’m not mistaken, might need to take a different route
#
gRegorLove_
Not sure what you mean by "these"
#
[miklb]
the webmention replies coming from bridgy backfeed
#
gRegorLove_
This is tested with webmentions, which are stored as regular WP comments, along with some meta
#
gRegorLove_
WP treats them the same
#
[miklb]
wait, I thought webmentions get turned into the webmention comment_type
#
[miklb]
but a reply stays a default comment
#
gRegorLove_
Not all, but that's comment_type isn't used in my snippet.
#
gRegorLove_
My snippet checks if the comment has a meta field "webmention_created_at"
#
[miklb]
I’ll re-read
#
GWG
I need to go back to that code
#
gRegorLove_
and checks if the comment has a comment_author_url.
#
gRegorLove_
For all received webmentions (currently) the comment_author_url is the source URL of the webmention.
#
gRegorLove_
If both those conditions pass, it parses just the scheme and host from the comment_author_url and queries if any previously-approved comment_author_urls start with that domain.
#
Loqi
[gRegor Morrill] Testing another reply
#
gRegorLove_
And the target successfully did the above, found my previously-approved webmention, and approved this one without user interaction
#
[miklb]
cool. That sounds about what I want.
#
gRegorLove_
I guess down-side is if you approve a twitter.com backfeed, all subsequent tweets will be approved, regardless if they're spam.
#
gRegorLove_
So Twitter will still need a special case at some point
#
gRegorLove_
But I like that this follows expected WP behavior, "I approved your last comment, so your subsequent comments are approved too"
#
[miklb]
right, which is why I want to look at what else is stored from bridgy backfeeds to see if anything else I could surface to check
#
[miklb]
agreed
#
gRegorLove_
Ahh, now I follow the Bridgy comments. Yeah, makes sense.
#
gRegorLove_
You could exclude Bridgy backfeed by checking $commentdata['comment_meta']['webmention_source_url']
#
gRegorLove_
(or customize)
#
gRegorLove_
Alright, heading out for a while
#
[miklb]
cheers
#
GWG
You see why I haven't added anything to the plugin on this yet
#
GWG
Needs to be mapped out
#
GWG
Sorry about being slow, had to shovel the stairs
#
[miklb]
it’s supposed to get down to 27 ℉ here by Friday. I’m putting a new hvac system in Tuesday. I’d love a little snow but doubtful.
#
GWG
miklb, you are welcome to come shovel mine
#
[miklb]
emphasis on “little”
#
GWG
Hmmm... pfefferle merged person tags and better post types. Good
[eddie] and [miklb] joined the channel
#
[miklb]
I can’t find any developer docs for comment_whitelist
[eddie], gRegorLove_ and gRegorLove joined the channel
#
gRegorLove
comment_whitelist is the checkbox value for "Comment author must have a previously approved comment"
#
gRegorLove
It's a flag used in check_comment()
[miklb] joined the channel
#
[miklb]
ah, thanks for the clarification
#
GWG
I just got access to the REST API using Indieauth
#
[miklb]
woohoo!
#
Loqi
😄
#
Loqi
gwg has 35 karma in this channel (297 overall)
#
GWG
[miklb]: Right now, I'm using the Indieauth.com token endpoint. Once I add a lot more safety measures, you should be able to use any token endpoint.
#
[miklb]
that’s awesome
#
GWG
I'm using inspiration from snarfed's micropub token verification code, the WordPress Oauth2 server, etc.
#
GWG
I'm looking at every source for this.
#
GWG
I'm trying to figure out what to do about scope.
#
[miklb]
not sure I follow
#
GWG
Oauth2 uses a scope parameter to authorize specific permissions.
#
GWG
However, WordPress doesn't really have that.
#
[miklb]
user roles isn’t a proper ACL is it
#
[miklb]
and that’s an age old conversation in the land of WordPress
#
GWG
Well, just because the user has a role, doesn't mean you want to delegate it to an application
#
[miklb]
roles & capabilities I should have said
#
[miklb]
should there be app “users” with custom roles and caps?
#
GWG
But still...
#
[miklb]
perhaps I’m not following still
#
GWG
How do you limit capabilities when you are delegating a user's access?
#
[miklb]
I guess that’s why I was musing about creating an app user with an interface to check off custom capabilities and create a access token kinda the way GitHub does it.
#
[miklb]
and maybe have some defaults mapped for the existing roles that are documented?
#
[miklb]
sorry, thinking out loud.
#
GWG
Well, Micropub has a bunch, for example.
#
GWG
So, there needs to be a way to map it.
#
GWG
Most micropub endpoints request create, post, or update.
#
[miklb]
which could generally be mapped to existing roles, no?
#
GWG
I may just be missing it, but the issue being that in WordPress, logging in as the user gives you all the permissions of the user
#
[miklb]
correct. But if a new user is created for each app, or an access token generated, couldn’t that allow the user to limit the apps access to less than say, admin?
#
GWG
Yes.
#
GWG
But then how do you post as your user.
#
[miklb]
hmm. a usermeta key for who to set the author to that defaults to the user that created the new user (not even sure if that part is possible)
#
GWG
One problem at a time. Better finish logging in first
#
GWG
Likely I'll just have to set a global variable.
#
[miklb]
wait, how does the micropub plugin handle it now?
#
GWG
If it doesn't have the post or create scope, it errors out
[kevinmarks] and [colinwalker] joined the channel
#
[colinwalker]
!tell gRegorLove Thanks for the webmention approval snippet, I’ll implement it and see how it goes. Does it override other criteria like number of links in a comment?
#
Loqi
Ok, I'll tell them that when I see them next
[kevinmarks], doubleloop, aaronpk, [eddie], CamB and gRegorLove joined the channel
#
gRegorLove
Updated the WordPress snippet from yesterday slightly: https://gregorlove.com/2017/12/ive-updated-this-so-it/
#
Loqi
gRegorLove: [colinwalker] left you a message 7 hours, 10 minutes ago: Thanks for the webmention approval snippet, I’ll implement it and see how it goes. Does it override other criteria like number of links in a comment?
#
Loqi
[gRegor Morrill] I’ve updated this code snippet so it abides by your Discussion settings for the checkbox “Comment author must have a previously approved comment.” I’ve also updated it to use the webmention_source_url which is part of the comment meta data ...
#
gRegorLove
Oops, need to update that post a bit. Code snippet is fine though.
[kevinmarks] joined the channel
#
GWG
gRegorLove: I'd like to have something like that in the plugin itself
#
gRegorLove
That post is updated ^
#
gRegorLove
It *does* override the spam checks for maximum number of links and comment blacklist keywords.
#
gRegorLove
But I think that's generally acceptable
#
gRegorLove
GWG: I'm happy to submit a PR.
#
gRegorLove
!tell colinwalker Updated snippet and note about it: https://gregorlove.com/2017/12/ive-updated-this-so-it/
#
Loqi
Ok, I'll tell them that when I see them next
#
Loqi
[gRegor Morrill] I’ve updated this code snippet so it abides by your Discussion settings for the checkbox “Comment author must have a previously approved comment.” I’ve also updated it to use the webmention_source_url which is part of the comment meta data ...
#
GWG
gRegorLove: You can. I meant to submit my comment domain whitelist PR
#
gRegorLove
I think they're both a good idea. This is just a baseline function, but the plugin could also provide more precision, like whitelisting specific twitter user URLs
#
GWG
gRegorLove: How about you outline your thoughts in an issue?
#
GWG
Then we can hash it out over time.
#
gRegorLove
Does one exist already for your comment whitelist? or new issue?
#
GWG
There are some that are adjacent
#
Loqi
[dshanske] #38 Optionally Automatically Approve Likes/Favorites/Reposts while Moderating Comments
#
GWG
Nothing about a whitelist right now
#
gRegorLove
I'll start a new one and include that reference
#
gRegorLove
Does this belong in Semantic Linkbacks of Webmention repo?
#
gRegorLove
I was thinking the latter
#
GWG
In one with hooks so the other can add in
#
gRegorLove
Actually that #38 looks like exactly what I've set up, so will comment there.
#
Loqi
[dshanske] #87 Better Spam and Moderation Handling
#
GWG
Try this one under Webmention
#
GWG
And you can reference #38 in Semantic Linkbacks
[eddie] joined the channel
#
gRegorLove
GWG: Writing it up now. Can you share the comment meta for a bridgy webmention? In a gist or on your site
#
gRegorLove
Ah, awesome!
#
gRegorLove
Webmention adds meta as well. Is any of that Bridgy-specific?
#
gRegorLove
Looks like just created_at, source_url, and target_url for my indie site wm
#
GWG
No. But I should add it in.
#
gRegorLove
semantic_linkbacks_canonical will be the actual tweet URL, right?
#
GWG
It should be, yes
tantek joined the channel
#
Loqi
[gRegorLove] I've recently implemented @dshanske's option 3 on a friend's site, detailed here: https://gregorlove.com/2017/12/one-of-the-known-issues/ and in the subsequent note. I hadn't seen this issue, but he directed me to comment here with my thoughts. I'...
#
gRegorLove
This is another data point for me thinking Semantic Linkbacks should be part of Webmention. The canonical URL should be part of the webmention comment meta imo.
#
GWG
gRegorLove: It will be a while
#
gRegorLove
Oh, I know
#
gRegorLove
Not trying to be a pest about it
#
tantek
GWG what's the GitHub issue on the merging of Semantic Linkbacks into Webmention
#
tantek
we need to collect all these reasonings there
#
tantek
to make it *not* be a while
#
tantek
and hopefully prioritize as a top priority for the Webmention plugin in 2018
#
Loqi
[dshanske] #112 Merge Semantic Linkbacks into this plugin
#
tantek
gRegorLove: ^^^ go for it, let's capture it
#
gRegorLove
Ooh, github updates new comments live in the browser. Hadn't seen that before. Tantek's just showed up.
#
tantek
yes that's pretty slick
#
tantek
speaking of
#
tantek
what are realtime comments
#
Loqi
It looks like we don't have a page for "realtime comments" yet. Would you like to create it? (Or just say "realtime comments is ____", a sentence describing the term)
#
tantek
thought we did
#
tantek
goes to -dev with this
#
tantek
realtime comments are /realtime
[kevinmarks] joined the channel
#
Loqi
[gRegorLove] Some reasons I think they should be merged: * Easier setup, fewer steps. "Install this one plugin, then..." * Nice presentation of webmentions should be a core part of the plugin. Installing the plugin should give the functionality _and_ improved...
#
tantek
would appreciate thoughts from the usual WP daily-users around here too, [miklb], snarfed, [eddie]
[miklb] joined the channel
#
[miklb]
thoughts on?
#
Loqi
[dshanske] #112 Merge Semantic Linkbacks into this plugin
#
[miklb]
I’m comfortable with pfefferle’s pacing on when to merge the two.
#
[miklb]
I agree less plugins is better, but I also understand his perspective on the 2 plugins. There was also a discussion to rename the semantic linkbacks plugin, but I see his concerns there too.
#
tantek
I would be more willing to appreciate that point of view (delaying merging) if this wasn't seemingly an issue with nearly every new gen2-3 person that uses WordPress and wants to get on IndieWeb
#
tantek
merging would also eliminate the need to rename
#
[miklb]
I agree merged would be less confusing, but ultimately it’s his decision and I’m respecting that.
#
tantek
Sure. The point is to gather opinions of what's better for the plugin and WordPress users, regardles of who is maintaining etc.
gRegorLove_ joined the channel
#
[miklb]
we are having a group chat next week to hope to clarify a few sticking points on interoperability between the plugins and maybe how to move forward with webmentions & the WP comments system. Hopefully from that pfefferle can give some concrete goals as to how to get to a merge.
tantek and tantek_ joined the channel