#wordpress 2018-05-27

2018-05-27 UTC
tantek_ and [grantcodes] joined the channel
#
GWG
miklb, I am pushing an error improvement to help test what it happening
[miklb] joined the channel
#
[miklb]
which branch?
#
GWG
[miklb]: Hooks, but there is an issue. It crashes everything. Troubleshooting now
tantek joined the channel
#
GWG
I am disabling the check for anything but the REST API or the Micropub endpoint
#
GWG
That would be much easier if they were the same
tantek joined the channel
#
GWG
Having trouble teaching it to not try to authenticate if not Micropub
tantek_, [Natris1979], tantek, [jeremycherfas], jeremycherfas and [jgmac1106] joined the channel
#
[jgmac1106]
So I said I would stay offline all weekend but it's rainign and I needed to finish up my fourteen WordPress #indieweb challenge, and my goal was to fork a theme. I think I did this correctly adding microformats2: https://indieweb.jgregorymcverry.com
#
Loqi
Greg McVerry
#
Loqi
Home
#
[jgmac1106]
would love for folks to take a look indiewebify me says I am missing a rel="me" in my h-card, I added it but can't get it recognized. This was my first time really editing a theme, the h-card ended up being slit across the template page, the function.php, and some javascript but it seems to render back together
#
GWG
Good morning, [jgmac1106]
#
[jgmac1106]
Hey @gwg, mother n law just called and heading over need to wash the kids so I have to bail. Will be excited if I actually pulled off my last WP 14 day challenge task
#
[jgmac1106]
It is a static WordPress theme so it was easy as only mf2 had to be added, didn't have to think about post-kinds, webmentions, micropub, or anything else tricky
#
[jgmac1106]
looks like you and [miklb] hard at work all weekend, thank you so much
#
GWG
Not really. Just trying to troubleshoot a problem I myself reproduced, but don't have
#
sknebel
[jgmac1106]: not sure what indiewebify.me doesn't like about the rel=me, that seems fine to me. But "GitHub", "Bookmarks" and "E-mail" appear in the parser output, where the links behind them should be: appears as urls, that isn't right. http://pin13.net/mf2/?url=https%3A%2F%2Findieweb.jgregorymcverry.com%2Fblog%2F
#
Loqi
YouTube
#
sknebel
(also not sure about the h-entry that just says "Youtube", but I might be misunderstanding what that' for - is that a placeholder for a post?)
#
[jgmac1106]
@sknebel, the theme is meant to be a calling card, yeah I didn't know if I shoudl wrap those in the h-card and skip h-entry all otgether and make the buttons a u-url inside h-card
#
sknebel
ah, I see, you need to put the u-url on the <a> tag, not on a tag around it!
#
[jgmac1106]
here is a completed theme, basically the buttons become a menu
#
sknebel
ah, like they are used there I'd not mark them up with mf2
#
[jgmac1106]
okay, remove the h-entry? Shoudl I try to embed those a u-url inside the h-card? I could make the wrapper class h-card and get the whole page in there
#
sknebel
depends on what they are. on cog.dog they are internal navigation, so no. If you want to use them as a second row of links to external profiles (why not add youtube to the icons above?), then add rel=me. (some people mark links to external profiles also with u-url, but not everyone does that)
#
sknebel
(e.g. aaron has tons of social media profile links in his footer, which are only rel=me, vs I tantek has them as u-url on his h-card to
#
[jgmac1106]
cool will take a look, but on cog.dog you wouldn't add h-entry to those pages?
#
sknebel
oh, now I get what it does. those are JS-based subpages :/
#
sknebel
yeah, that's tricky
#
sknebel
(I thought those were links to extra pages)
#
sknebel
yeah, maybe mark them up, but be aware only some tools handle fragment links
#
[jgmac1106]
I have been struggiling with that as I am addicted (slap my hand) to pup up modals
#
[jgmac1106]
It really ia an h-modal but that isn't a thing
#
sknebel
I know Zegnat has been experimenting with multiple h-entries on a page too
#
sknebel
so maybe leave those marked up
#
sknebel
the broken urls for e-mail etc are the bigger issue
#
Zegnat
gets mentioned on the wordpress channel and is intrigued.
#
Zegnat
Oh. Multi h-entry pages rather than 1 page per h-entry? Yeah, that gets a big “experimental” flag for now. We need a lot more testing and documentation on the matter
#
sknebel
Xray has some logic to handle fragment links, right? or is that the php-parser?
#
Zegnat
I think XRay, of the top of my head, but would need to double check.
#
Zegnat
Though the way it does that means you may be excluding other data on the page, which was the issue I was having.
#
sknebel
was it loosing the author?
#
[jgmac1106]
@zegnat would I use e-content? under one h-entry for now?
#
Zegnat
sknebel, yes, it loses the author in my case. To be more precise: it only parses from the element with id === url fragment, thus all surrounding meta data is gone.
#
sknebel
yeah, for the content of the "subpages" use e-content (and p-name for the headline)
#
sknebel
ignore what I said about rel=me, that was a misunderstanding on my part
#
sknebel
Zegnat: ugh :/
#
Zegnat
You should use h-entry / e-content / etc. just as normal. But if you are marking up several h-entry on 1 URL, there may be issues with consuming parsers. Not really your issue as the writer of the markup though, [jgmac1106]
#
sknebel
and for the h-card, move the class="u-url" on the <a> tags
#
Zegnat
Are we talking about https://indieweb.jgregorymcverry.com/blog/ ? I don’t see posts there, so I can’t really comment on the exact h-entry markup.
#
Loqi
Greg McVerry
#
Zegnat
has a look at the h-card
#
Zegnat
Is “Youtube” a post? I am a little confused about that being an h-entry
#
sknebel
Zegnat: compare https://cog.dog
#
sknebel
there they are fuller posts, if that's how jgmac1106 wants to use them
#
Zegnat
And sknebel is right. The class u-url should be moved from the <li> elements within the h-card to the <a> element within them.
#
Zegnat
Right. Yes. I would definitely mark those blocks up as h-entry. Their URLs (u-url) being the URL with the fragment. And that is definitely the case where parsers may act ... funny.
#
Zegnat
It is basically a feed of posts like https://grapefruit.zegnat.net/ . Which is fine, but is the exact case that needs more testing and documenting
tantek and jeremycherfas joined the channel
#
Loqi
[dshanske] #59 Refactor in Search of Fixes
#
GWG
aaronpk: Which oddly enough, doesn't do much
#
tantek
It says it right there: Refactor
#
GWG
aaronpk: It was mostly rearranging things, adding in extra checks, etc.
#
GWG
I was trying to prevent code from executing when it didn't need to. I also was tracking certain errors.
#
GWG
I did fix pfefferle's problem, I think
#
aaronpk
I hope it works!
#
GWG
aaronpk: We'll see
tantek, davidmead and [miklb] joined the channel
#
[miklb]
GWG I just pulled down your latest hooks branch and same issue. php warning in micropub and insufficient_scope error in Quill
#
[miklb]
and note isn’t created, though the micropub data does get logged
#
GWG
Which warning?
#
GWG
The scope error comes in on the Micropub side
#
[miklb]
`in_array() expects parameter 2 to be array, null given` lines 266, 269 in micropub.php
#
[miklb]
right, but I’m assuming it’s not getting passed from indieauth?
#
GWG
I want to see why
#
GWG
I can never figure out why it works in testing but not in live
#
[miklb]
said every developer everywhere. You’re not alone
#
tantek
yeah where's that dev dice that I think gRegorLove shared?
tantek joined the channel
#
GWG
I had three people check it
#
GWG
[miklb]: Then I know what the problem is
#
GWG
[miklb]: Try using the PR in the Micropub plugin
#
Loqi
[dshanske] #127 Pull token data from IndieAuth plugin
#
GWG
I forgot that snarfed asked me to change that
[jgmac1106] joined the channel
#
[miklb]
that clears all of my errors, but doesn’t create a note. Debug log simply has `Micropub Data: {"micropub":"endpoint","q":"config"} {"micropub":"endpoint","q":"config"}`
#
GWG
Can you try logging out and logging back into Quill?
#
[miklb]
I’ll try again, but I’ve done that step before each attempt to post.
#
GWG
Use the master branch of Micropub. I just added the fix to that.
#
GWG
aaronpk: Under what circumstances would Quill cycle back to the main screen without an error message?
#
[miklb]
I’ll check back in later, got some chores to do. Thank you very much for your efforts to solve this.
#
[miklb]
it doesn’t cycle, it reloads the same page
#
[miklb]
and keeps the value of the note content
#
GWG
[miklb]: Try omnibear
#
GWG
aaronpk: Could this be something you did today?
#
GWG
Because I'm getting this Quill issue too. But Omnibear posts the note
#
[miklb]
Omnibear is saying error authenticating micropub endpoint when I try to publish. I was able to login and authenticate, it stores the token. Also got rid of issue I had of stuck authorization screen.
#
[miklb]
I wonder if I need to test with my 2fa disabled.
#
aaronpk
can you try testing with micropub.rocks or just a curl post?
#
aaronpk
let's try to eliminate the number of moving parts here
#
[miklb]
aha. It looks like maybe it’s my nginxcache purge plugin. Going to disable and test again.
#
[miklb]
yep. But nothing was surfacing those errors until I tested in micropub.rocks
#
aaronpk
what did micropub.rocks tell you that you weren't seeing before?
#
[miklb]
the debug log in wordpress had new errors I’d never seen before
#
[miklb]
I’m going to retest to see the exact error, but something about a submit button
#
[miklb]
that’s what logged from micropub.rocks. that uncaught error was new
#
[miklb]
oh, weird, it was because my cache wasn’t writable. I’ve only ever had issues with that and webmentions from brid.gy getting sent multiple times. I need to solve that.
#
[miklb]
But I believe there were issues with the plugins aside from that that are fixed with that hooks branch and micropub master
#
Loqi
gwg has 63 karma in this channel (355 overall)
#
GWG
[miklb]: We'll see what pfefferle thinks of the hooks branch
#
[miklb]
well, I spoke too soon. The first test passes from micropub.rocks, but Quill & Omnibear are still failing. Need to trace the errors.
#
[miklb]
GWG those `PHP Warning: in_array() expects parameter 2 to be array, null given` errors are back, at least when I test posting with Omnibear. No errors from Quill it seems, just nothing happens
#
[miklb]
test 100 and 200 pass in micropub.rocks
Ian joined the channel
#
GWG
I am getting Quill problems now
[Vanessa] and [miklb] joined the channel
#
[miklb]
just weird that micropub.rocks works and not any of the clients
#
GWG
I am still wondering about that
#
GWG
miklb, Quill did the same thing for me, even when I reverted. I still want someone on another platform to check
#
[miklb]
well, just saw that test 801 failed. Accept access token in POST body so running rest of tests now
#
[miklb]
rest of the 800s test pass. Just 801 accept access token in POST body failed
#
[miklb]
wonder if that’s it?
#
GWG
It's possible. Let me have a look
#
GWG
[miklb]: I just pushed a check that looks for an empty Auth header and will continue to check. Can you update and try one more time?
#
GWG
I noticed when I added fastcgi_param HTTP_AUTHORIZATION $http_authorization; it always adds an empty header
#
[miklb]
nothing changed. I logged out of both WP & Quill, authorized, tried to publish note, silent fail.
#
GWG
[miklb]: I meant, try test 801
#
[miklb]
returns 401
#
GWG
[miklb]: Fixed it
#
GWG
[miklb]: Pushed it. It was only doing GET, not POST requests
#
aaronpk
what was only doing GET requests?
#
Loqi
It looks like we don't have a page for "only doing GET requests" yet. Would you like to create it? (Or just say "only doing GET requests is ____", a sentence describing the term)
#
aaronpk
lol loqi
#
GWG
aaronpk: Test 801
#
GWG
The IndieAuth plugin only looked in $_GET for an access_token
#
GWG
Oh, and the hard reset fixed the issue
#
aaronpk
oh oops. well good thing we have tests!
#
[miklb]
confirmed 801 passes
#
GWG
Oh, and the hard reset fixed the issue
#
GWG
[miklb]: And your site? Can you post?
#
[miklb]
Quill failed. trying omnibear now, since it seems to log more
#
aaronpk
[miklb]: try a hard refresh in Quill, I just updated some JS on it today
#
[miklb]
OK, quill worked that time.
#
[miklb]
Omnibear still failing.
#
[miklb]
error authenticating micropub endpoint, authorizes fine
#
GWG
Can you clarify that?
#
[miklb]
clarify what? Omnibear?
#
[miklb]
it allows me to authenticate just fine, doesn’t hang on the getting token screen anymore, but when I try to post a note, I get an error about authenticating micropub endpoint in omnibear
#
[miklb]
and I get those two errors `in_array() expects parameter 2 to be array, null give` in debug.log
#
aaronpk
can I make a suggestion that the plugin should check if that second parameter is an array and if it is not, throw a more specific error message?
#
[miklb]
but if Quill works and micropub.rocks passes, ¯\_(ツ)_/¯
#
GWG
Which line is this?
#
[miklb]
yeah, that error went away last night, but after I pulled in micropub master it comes back using omnibear
#
aaronpk
i'm guessing either the "indieauth_scopes" filter is not running or it's returning null https://github.com/snarfed/wordpress-micropub/blob/master/micropub.php#L174
#
aaronpk
oh, the "indieauth_scopes" filter returns null if the scopes passed to it are null, so it sounds like this is something wrong with handling the default scope when the client requests no scope
#
aaronpk
checks omnibear
#
aaronpk
hm looks like omnibear is supposed to request the "create" scope
#
aaronpk
[miklb]: what's the quickest way I can reproduce this error in a clean wordpress install?
#
[miklb]
that’s a good question.
#
aaronpk
current master branch of wordpress-micropub, and wordpress.org version of the indieauth plugin?
#
[miklb]
omnibear is requesting post, create, delete, update
#
[miklb]
oh, the the hooks branch in GWG’s fork of indieauth and master branch of micropub
#
aaronpk
i'm getting "error posting note" in omnibear, but the note is actually created on my wordpress site
[tantek] joined the channel
#
aaronpk
is this some sort of CORS thing?
#
[miklb]
would that cause the array to be null?
#
[miklb]
in_array() expects parameter 2 to be array, null given
#
aaronpk
no, but I can't get omnibear to think that the request succeeded even though it did
#
[miklb]
with Omnibear, I see the micropub request logged, it fails in creating the post I’m assuming due to the null array
#
[miklb]
that’s in debug.log
#
aaronpk
unfortunately I can't seem to reproduce that because omnibear isn't even showing a response
tantek_ joined the channel
#
[miklb]
do you have the updated version with logging?
#
aaronpk
i'm using 1.1.0 which is in the chrome store
#
aaronpk
it's supposed to log stuff?
#
aaronpk
ah there's a debug checkbox
#
aaronpk
hm nothing shows up in the logs still
#
aaronpk
the weird thing is the network tab shows that wordpress returned HTTP 201, but then says there is no response data
#
[miklb]
seems like it’s not passing micropub_auth_response
#
aaronpk
I thought the error was on the static::$scopes line
#
[miklb]
that’s the error
#
[miklb]
but looking at what micropub logs, that’s the step that it doesn’t get to because of that error in Omnibear
#
[miklb]
wp error while using Omnibear
#
[miklb]
this is what is logged in a successful quill post wp_insert_post with args: {“post_content”:“quill test”,“meta_input”:{“micropub_auth_response”:{“token_type”:“Bearer”,“scope”:“create update”,“me”:“https:\/\/miklb.com\/“,”issued_by”:“https:\/\/miklb.com\/wp-json\/indieauth\/1.0\/token”,“client_id”:“https:\/\/quill.p3k.io\/“,”issued_at”:1527461635,“user”:1},“mf2_type”:[“h-
#
[miklb]
it doesn’t get that far in Omnibear
#
aaronpk
huh I can't get my wordpress to write a debug.log file
#
[miklb]
define( ‘WP_DEBUG_LOG’, true );
#
[miklb]
in wp-config?
#
aaronpk
I did that and WP_DEBUG
#
[miklb]
I have WP_DEBUG_DISPLAY false
#
[miklb]
also have define( ‘SCRIPT_DEBUG’, true);
#
[miklb]
define( ‘SAVEQUERIES’, true ); as well
#
[miklb]
but those shouldn’t deal with micropub
#
aaronpk
ah fpm is catching it and writing it to its own file
#
aaronpk
okay now I'm seeing "wp_insert_post with args" in the log file when using omnibear
#
[miklb]
so it works for your install & not mine. weird
#
GWG
It works for mine too
#
aaronpk
well it only kind of works. omnibear still thinks the request failed.
#
aaronpk
but it does create a new post on my site
#
GWG
So, why does it think that?
#
aaronpk
I can't tell
#
aaronpk
it looks like it's not getting a response body, but wordpress is returning HTTP 201
#
GWG
Troubleshooting this is not easy
#
GWG
What response body should it get?
#
aaronpk
micropub doesn't define a body, but I usually return something like {"url":"....."} with the URL of the post that was just created
#
GWG
It only says it should return location
#
GWG
Wonder what Omnibear expects?
#
GWG
I like Omnibear though. Very slick
#
aaronpk
okay, confirmed that omnibear expects some sort of http body in the response
#
aaronpk
I returned {"test":"foo"} and then it works
#
GWG
So, should we start returning a body?
#
GWG
Aha?
#
aaronpk
I think this isn't omnibear's fault after all
#
GWG
Back to being my fault?
#
aaronpk
or snarfed's
#
aaronpk
the micropub plugin returns a Content-Type header of application/json, then returns an empty body
#
aaronpk
an empty string is not a valid JSON document, so something along the chain thinks that is a failure
#
aaronpk
if you change the content type to text/plain and return an empty body then omnibear succeeds
#
GWG
So, all it has to do is return a body?
#
aaronpk
or not return application/json if it's not returning a JSON response
#
GWG
I think the body is easier
#
aaronpk
this works:
#
aaronpk
exit( $resp ? wp_json_encode( $resp ) : '{}' );
#
aaronpk
instead of exit( $resp ? wp_json_encode( $resp ) : '' );
#
GWG
I'm lookingat the same place
#
GWG
Just created the branch for it
#
GWG
If that works, I can merge that
#
[miklb]
branch where?
#
aaronpk
I don't think this has anything to do with the null scope error
#
aaronpk
but worth a fix anyway
#
GWG
[miklb]: My wordpress-micropub repo, body branch
#
GWG
aaronpk: The null scope error I fixed, I thought
#
[miklb]
is it just that one line?