#wordpress 2017-11-04

2017-11-04 UTC
tantek, [chrisaldrich], [miklb], [jeremycherfas], [kevinmarks] and [eddie] joined the channel
#
GWG
!tell [miklb] Can you have a look at the mf2_post branch? It is close to ready to deploy, and adds new check-in support(display, not UI yet).
#
Loqi
Ok, I'll tell them that when I see them next
#
Loqi
GWG: snarfed left you a message 19 hours, 47 minutes ago: thanks again for all the facepile reviews and merges!
#
Loqi
GWG: snarfed left you a message 19 hours, 47 minutes ago: just fyi the remaining ones, https://github.com/pfefferle/wordpress-semantic-linkbacks/issues/116 and https://github.com/pfefferle/wordpress-semantic-linkbacks/issues/114 , aren't priorities for me personally right now, so i'm not planning to work on them in the near future
#
GWG
!tell pfefferle Can you push the snarfed changes to wordpress.org?
#
Loqi
Ok, I'll tell them that when I see them next
mrhenko joined the channel
#
mrhenko
GWG: Do you mind if I ask some more questions about webmentions and custom post types here, before posting a GitHub issue?
#
GWG
Ask away
#
GWG
If there is a bug, I'd want to know
raretrack joined the channel
#
mrhenko
Thanks!
#
mrhenko
I'm trying to create a lightweight way to like posts on the indieweb and I figured that one way to do it would be to create a custom post type called "Likes" that is just a content field in which is type in a link, with class"u-like-of", to the thing I want to send a like to.
#
mrhenko
Here is my first test post. It's supposed to send a like to one of my own posts: http://blog.henrikcarlsson.se/likes/automatiskt-utkast/
#
Loqi
Automatiskt utkast
#
GWG
mrhenko: I do that with the Post Kinds plugin.
#
GWG
mrhenko: Do you dynamically add the like? Or is it in the post_content field?
#
GWG
If you add it in dynamically, then you need to add some code. I can show you an example
#
mrhenko
It is in the regular content field. The reason I wanted a custom post type was that it was an easy way (I thought) to get it working without spamming my RSS feeds and syndication flows with the like posts.
#
GWG
Then it should work
#
GWG
I wrote the support code...but I only tested it with pages.
#
GWG
You enabled the settings under Discussion for notifying other sites that you linked to them, correct?
#
mrhenko
It's the first setting under Discussion, right. (My WP is in Swedish, so the options are in Swedish)
#
GWG
Yes
#
mrhenko
Other webmentions work for me. If I make a post and link to someone or something, it works as intended.
#
mrhenko
But the custom post type just won't work.
[miklb] joined the channel
#
[miklb]
good morning
#
mrhenko
GWG: Just to make sure I created a regular post with the "like" post kind and a link with class="u-like-of" and that worked.
#
GWG
Okay, so maybe there is an issue.
#
[miklb]
GWG I will switch branches and test later today
#
GWG
[miklb]: Backup first?
#
GWG
It changes data
#
mrhenko
GWG: So what should I include in a GitHub issue? A link to my post, I assume? The code for my custom post type? Something else?
#
[miklb]
mrhenko the more information the better
#
mrhenko
miklb: Okay, thanks. Just need to tweak my theme a bit first. For some reason it doesn't seem to display the custom post types, even if I look at the URL of one. (I've tested this with another theme as well, so that is not the problem.)
#
GWG
mrhenko: Those would help. The link, the code for the custom post type, and any comments
#
[miklb]
you could even link to the discussion for more reference https://chat.indieweb.org/wordpress/2017-11-04#bottom
#
GWG
For all we know, WordPress changed something
#
GWG
[miklb]: I appreciate your help by the way. This is a big change to support Micropub among other things.
#
GWG
I've been working on finishing it since 5AM
#
[miklb]
I’m excited.
#
GWG
[miklb]: Me too.
#
GWG
But next is more check-in improvements.
#
mrhenko
GWG: I checked my php_error.log and found some interesting ones from when I tested this: PHP Warning: DOMDocument::loadHTML(): Empty string supplied as input in /Applications/MAMP/htdocs/blog.henrikcarlsson.se/wp-content/plugins/webmention/includes/functions.php on line 166
#
mrhenko
PHP Fatal error: Maximum execution time of 30 seconds exceeded in /Applications/MAMP/htdocs/blog.henrikcarlsson.se/wp-content/plugins/webmention/includes/functions.php on line 161
#
GWG
That's a new one
#
mrhenko
Am I right if I assume that the empty string is where my actual content should be?
#
GWG
Yes, but I assume because something timed out.
#
GWG
By why is there a DOMDocument load?
#
GWG
I've never seen that before.
#
mrhenko
When I look into webmention/includes/function.php it appears to be in webmention_discover_endpoint()
#
GWG
Which does use DOMDocument, I believe
#
GWG
Hmm...so it is timing out trying to discover the endpoint of the remote site.
#
GWG
Interesting
#
mrhenko
Hmmm, that could mean that the problem is the site that I'm trying to send a like to which is my live-site. And that site have been known to be slow. Hang on while I try something…
#
mrhenko
I tried to like a post on my dev site, from my dev site but it still didn't work. No new error messages either.
#
GWG
Trying to think of things to try
#
mrhenko
I am going to sit down with this for a while now and be very methodical. I'll get back to you soon.
#
GWG
Keep us posted
[miklb] joined the channel
#
[miklb]
mrhenko++
#
Loqi
mrhenko has 1 karma in this channel (2 overall)
#
mrhenko
The plot thickens… I'm currently testing things on my local dev version and I've disabled all plugins except the indieweb ones and I've switched to the 2017 theme and webmentions seem to work.
#
GWG
Do you have any caching plugins?
#
mrhenko
Nope
#
GWG
What are the disabled plugins?
#
Loqi
It looks like we don't have a page for "disabled plugins" yet. Would you like to create it?
#
mrhenko
I have a hunch that I'm about to test. I'm working through them methodically.
#
mrhenko
The culprit might be my homemade Twitter POSSE plugin, but I don't know for sure yet.
#
GWG
I always assume I made a mistake
#
GWG
I still remember when I messed up acegiak's site
#
GWG
That's why I'm letting [miklb] mess up his site before I inflict my code on anyone else
#
[miklb]
I’ll switch that right now
#
mrhenko
:)
#
GWG
[miklb]: Wasn't trying to push you.
#
GWG
Just pointing out I ask for someone to help me test big changes.
#
[miklb]
all good. Taking a break from chores, switching on local first.
#
GWG
[miklb]: If you have WP_DEBUG enabled, try /?pkdebug=form
#
[miklb]
whoa. What’s this magic?
#
GWG
What magic?
#
mrhenko
So this is interesting. I'm making a post with my custom post type. Its content is just a link with "u-like-of" as the class. The innerHTML is a heart and the name of the post I like. When I post it, nothing happens. I've now waited for ten minutes to make sure that it isn't just some latency in the system.
#
[miklb]
the debugger
#
mrhenko
Then I make a new post and that somehow triggers the webmention to be sent and arrives.
#
GWG
Something isn't triggering.
#
GWG
And this is with a minimal plugin set?
#
mrhenko
Indeed. But for some reason it's triggered on a new post.
#
mrhenko
Strange.
#
GWG
[miklb]: I originally built it into Semantic Linkbacks to test the code there. pfefferle removed it in production. I may leave it in here. If you do a URL, it will show you the parsed version. If you do a Post ID, it will test mf2_post, the new class
#
mrhenko
This is with a few plugins enabled. I'll try and disable some again.
#
[miklb]
cool. Looks like I have something in my custom kinds templates breaking, but for some reason not throwing an error in the debug log. I’ll need to investigate more tonight.
#
GWG
[miklb]: Kind_Meta is now a wrapper around MF2_Post. Better to rewrite after it goes stable using the new class.
#
mrhenko
Now I've disabled them all and sent a like. I will now wait for a few minutes.
#
GWG
[miklb]: Because this is a big change, I'm going to wait on you to play with it a bit before making any more changes.
#
GWG
Even though feature wise, it isn't a big change, the sheer number of bug fixes, tests, storage changes...
#
[miklb]
totally understood.
#
GWG
Oh, and Check-ins half work
#
mrhenko
Nothing happened. I created a new post and then the webmention was sent and recieved.
#
GWG
Received is good, isn't it?
#
mrhenko
Very good. But I wonder why it isn't sent until I create a new post.
#
[miklb]
ah, so it’s not triggering on the initial post creation, only on the subsequent post
#
mrhenko
Correct
#
mrhenko
I'm testing the same thing now, but using the 2017 theme to make sure the problem is not in my own theme.
#
mrhenko
Same behavior with 2017.
#
GWG
Strange.
#
GWG
Everything else is disabled?
#
mrhenko
Every non indieweb plugin
#
mrhenko
And it gets weirder.
#
mrhenko
I've now been able to confirm that Likes from my dev site to other posts on my dev site all behave like this, regardless of themes and plugins. So I wanted to see what happened if I tried to like a post, FROM my dev site TO my live site. No webmention arrive at the live site.
#
mrhenko
So I posted a new post on the dev site. Nothing happened. Posted another post on the dev site. Nothing happened.
#
mrhenko
Posted a new post __on the live site__ and an older test webmention from the dev site to the live site actually arrived at the live site, timestamped two hours ago. (Which probably correspons fairly well to when it was sent.)
#
mrhenko
Wait sorry, I spoke too soon.
#
mrhenko
What arrived was an old test Like from to live site, to the live site.
#
mrhenko
So the behaviour for Likes where I like something on the same WP installation as the like is consistent. It won't be sent (or arrive) until I post another regular post.
#
GWG
Well, sounds like a wp_cron issue
#
mrhenko
Yeah, probably. But I don't get why it would behave different for regular posts and for a custom post type. And also seems weird that it only works for "internal" webmentions. My test to send from my dev site to my live site still hasn't shown up on the live site.
#
mrhenko
I think I'll need to leave this for now and go to bed. I'll get back to it tomorrow or on monday and then I'll leave a proper bug report on GitHub.
#
[miklb]
it’s like the hook isn’t firing on insert_post
#
mrhenko
Yeah, sort of. But why would it then fire when a new post is created and for some reason pick up and "old" post. There seems to be some kind of queue somewhere that doesn't empty itself properly.
#
GWG
wp_cron is my thought
#
GWG
It does fork sending
#
mrhenko
Does it queue things up before sending?
#
GWG
Yes.
#
GWG
You can override that.
#
mrhenko
How?
#
GWG
But it mirrors the pingback sending procedure.
#
mrhenko
Thank you for your time tonight. I'll need to go to bed now before my eyes fall down.
tantek joined the channel