Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Version 2.0 of Micropub plugin #150

Closed
dshanske opened this issue Aug 14, 2018 · 53 comments
Closed

Release Version 2.0 of Micropub plugin #150

dshanske opened this issue Aug 14, 2018 · 53 comments
Milestone

Comments

@dshanske
Copy link
Member

dshanske commented Aug 14, 2018

Version 2.0 is merely the name I'm using for all the changes thus far. Since I have decided I'm not going to pursue any further enhancements before releasing a new version, using this issue to track anything left to do before releasing this version as stable.

Asked @chrisaldrich , @jgmac1106, and @dougbeal if they would mind testing the current stable version for issues, as my tests with various Micropub clients seem to be working. Tests conducted with and without the IndieAuth plugin activated.

Tests should include posting with at least a client or two. Quill, Micropublish, etc.

Subject to that and any other blockers, want to share this with the world.

@dshanske dshanske added this to the 2.0.0 milestone Aug 14, 2018
@dshanske dshanske changed the title Release Version 2.0 of Micrpub plugin Release Version 2.0 of Micropub plugin Aug 14, 2018
@jackjamieson2
Copy link

A couple reports from my testing.

1. When reposting from monocle or together, the following php notices occur:

[14-Aug-2018 16:46:50 UTC] Micropub Input: {"type":["h-entry"],"properties":{"repost-of":["https://jackjamieson.net/511-2/"]}}

14-Aug-2018 16:12:27 UTC] PHP Notice: Undefined index: content in/...{path}.../wp-content/plugins/wordpress-micropub-master/includes/class-micropub-endpoint.php on line 616

[14-Aug-2018 16:12:27 UTC] PHP Notice: Undefined index: summary in/...{path}.../wp-content/plugins/wordpress-micropub-master/includes/class-micropub-endpoint.php on line 622

[14-Aug-2018 16:12:27 UTC] PHP Notice: Undefined index: content in/...{path}.../wp-content/plugins/wordpress-micropub-master/includes/class-micropub-render.php on line 79

A repost is created, but it only consists of a link to the post. The content of the repost is otherwise empty. I don't know if I've ever micropubbed a repost before so I'm not sure if this is the expected behaviour.

2. Posting from Quill with attached image
Everything works, including the image, but my log includes an 404 message about the media endpoint

[14-Aug-2018 16:55:14 UTC] REST request: /micropub/1.0/media: {"q":"last"}

[14-Aug-2018 16:55:14 UTC] REST result: : {"code":"rest_no_route","message":"No route was found matching the URL and request method","data":{"status":404}}

@dshanske
Copy link
Member Author

Re 2 above, https://indieweb.org/micropub_media_endpoint#Query_the_last_thing_uploaded - Basically, only Quill supports querying an endpoint. But right now, it generates an error because the endpoint doesn't support querying. I will change it and allow it to be queried, but it will return a proper error at this point, as not supporting last in this round.

@miklb
Copy link

miklb commented Aug 16, 2018

FWIW I’m on master of all of the plugins & I cant log in with Quill or Indigenous

@dshanske
Copy link
Member Author

@miklb Can I work with you to troubleshoot? What data do you have to reproduce?

@miklb
Copy link

miklb commented Aug 16, 2018

I’ll pull the logs & error messages & post here.

@dshanske
Copy link
Member Author

Thanks, I want to narrow it down. Are you using the IndieAuth plugin or is it disabled? Does changing that make a difference?

@dshanske
Copy link
Member Author

@jackjamieson2 If the client doesn't send the original post as content, the endpoint won't retrieve it, so that repost is technically correct.

@miklb
Copy link

miklb commented Aug 16, 2018

I updated all plugins to master. Should I be testing a branch?

@dshanske
Copy link
Member Author

No, but there is one little IndieAuth fix, but your site URL is the same as your home url?

@miklb
Copy link

miklb commented Aug 16, 2018

Indigenous

REST result: : {"code":"unauthorized","message":"missing access token","data":{"status":401}}

and Quill just did a weird redirect loop to this https://miklb.com/?me=https%3A%2F%2Fmiklb.com%2F&redirect_uri=https%3A%2F%2Fquill.p3k.io%2Fauth%2Fcallback&client_id=https%3A%2F%2Fquill.p3k.io%2F&state=75e9a54201f754ae&scope=create%20update%20media&response_type=code

@dshanske
Copy link
Member Author

So, missing access token suggests server filtering of the header

@dshanske
Copy link
Member Author

But that url is missing wp login.php

@miklb
Copy link

miklb commented Aug 16, 2018

To my knowledge, I haven't changed any header settings in nginx in a long time, and was able to authenticate not that long ago. I've lost track honestly of when things last fully worked together though.

@dshanske
Copy link
Member Author

I wonder what it could be.

@dshanske
Copy link
Member Author

Is this working without the IndieAuth plugin?

@miklb
Copy link

miklb commented Aug 16, 2018

Is this working without the IndieAuth plugin?

I haven't tested that, I thought the idea of refactoring the micropub plugin was better compatibility with WP IndieAuth.

I'll try and test with IndieAuth off later this evening.

@dshanske
Copy link
Member Author

Process of elimination

@miklb
Copy link

miklb commented Aug 16, 2018 via email

@dshanske
Copy link
Member Author

I am sorry

@miklb
Copy link

miklb commented Aug 17, 2018

I don’t hold you responsible David for my website woes.

@miklb
Copy link

miklb commented Aug 17, 2018

@dshanske you should still have a login to the indiewp.com on my server if you want to test my server configuration/mulit-site. Let me know if you need me to resend or activate/install anything. There is a plugin to view debug log from the admin too.

@dshanske
Copy link
Member Author

@jackjamieson2 The latest merge should fix the PHP notices.

@dshanske
Copy link
Member Author

As of this comment, per my conversation with @snarfed. I'm freezing any further enhancements. Only fixes and tests will be pushed until we release a version. While I'd like it if 100% of people had no issues, some are due to server issues and such, which I am always chasing as a priority to troubleshoot. I probably should settle for it working for the same or more people as it did before all these pushes and continue trying to figure out the remaining people's issues afterward.

@miklb
Copy link

miklb commented Aug 19, 2018

Can you document “server issues” that can cause the plugins to fail?

@chrisaldrich
Copy link
Contributor

Some observations from a fresh install running current IW Stack, but with the test Micropub install:

Using micropublish.net to send a note gives the following error:
There was an error making a request to your Micropub endpoint. The error received was: Warning: in_array() expects parameter 2 to be array, null given in htdocs/site/wp-content/plugins/wordpress-micropub-master/includes/class-micropub-endpoint.php on line 164

followed by:
Warning: Invalid argument supplied for foreach() in /htdocs//wp-includes/rest-api/class-wp-rest-server.php on line 1259 {"error":"insufficient_scope","error_description":"scope insufficient to create posts"}

I was able to log into IndieBookClub.biz and post there, but post didn't micropub to appear on my site. (This is likely a header stripping issue I'd seen with my production server, but isn't fixed on this install. I'll see what happens when I run things on my production site shortly.)

Quill note post with photo worked (and showed up as photo kind).

Bookmark post from quill gave 404 Page Not Found and redirected to https://quill.p3k.io/null on Draft and other modes, but posted mostly properly except that the Bookmark and URL text appeared in the_content instead of within post kinds as I would have suspected.

Teacup worked and set the right post kind, but put all content into the_content instead of into the properties fields I would have expected for Post Kinds. I could have sworn someone said Teacup had a media endpoint if it detected the site had one available, but I never saw a way to upload photos for the media endpoint in Teacup.

While most of this may not seem perfect, it seems solid enough to me that I'll install the test version on production and rerun several of the tests including for OYS which I've got set up pthere and a couple of others. Given a few bumps my test server surely has, I suspect some of the issues I've seen will wash themselves out.

@dshanske
Copy link
Member Author

@miklb Trying to.

@aaronpk
Copy link
Member

aaronpk commented Aug 19, 2018

I just tried installing indieauth and micropub on a new wordpress from master.

I was able to get an access token, and I tried posting from the command line:

curl -H "Authorization: Bearer EmqwS2gHFxB9H28G7mEAnMcu1UXhCbUVEzDfw8KAiPhjKzBd9O6CIf2zpxevtHYM40YSQLJ98xL8CZg6g2fKlZmQNSkeOObd0xLn9gBPwBQuXUuDMgIYvGXGoXF24pPH" -d h=entry -d content=hi https://wordpress.com.dev/index.php?rest_route=/micropub/1.0/endpoint
<br />
<b>Warning</b>:  in_array() expects parameter 2 to be array, null given in <b>/Users/aaronparecki/Code/wordpress/wordpress/wp-content/plugins/micropub/includes/class-micropub-endpoint.php</b> on line <b>164</b><br />
<br />
<b>Warning</b>:  in_array() expects parameter 2 to be array, null given in <b>/Users/aaronparecki/Code/wordpress/wordpress/wp-content/plugins/micropub/includes/class-micropub-endpoint.php</b> on line <b>164</b><br />
<br />
<b>Warning</b>:  in_array() expects parameter 2 to be array, null given in <b>/Users/aaronparecki/Code/wordpress/wordpress/wp-content/plugins/micropub/includes/class-micropub-endpoint.php</b> on line <b>164</b><br />
<br />
<b>Warning</b>:  in_array() expects parameter 2 to be array, null given in <b>/Users/aaronparecki/Code/wordpress/wordpress/wp-content/plugins/micropub/includes/class-micropub-endpoint.php</b> on line <b>164</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/Users/aaronparecki/Code/wordpress/wordpress/wp-includes/rest-api/class-wp-rest-server.php</b> on line <b>1259</b><br />
{"error":"insufficient_scope","error_description":"scope insufficient to create posts"}

if I remove the authorization header, it fails in the same way. If there is no authorization header, or if the access token is not valid, it should return an error before trying to check for scopes.

@chrisaldrich
Copy link
Contributor

Micropub errors for OYS 8-25-18 (using master branch from 2018-08-24 ef76125)
[25-Aug-2018 18:42:04 UTC] Micropub Error: 403 forbidden - Unauthorized [25-Aug-2018 18:42:04 UTC] REST request: /micropub/1.0/endpoint: {"type":["h-entry"],"properties":{"published":["2018-08-24T17:44:13-07:00"],"syndication":["https:\/\/www.swarmapp.com\/user\/11479\/checkin\/5b80a65de0c0c9002c0c8589"],"content":["Being lazy for dinner tonight."],"photo":["https:\/\/igx.4sqi.net\/img\/general\/original\/11479_Z5VSLqOla8M3LhlRo_7QKUXeiGvaufQM1NTUYg32Dp0.jpg"],"checkin":[{"type":["h-card"],"properties":{"name":["Gerrish Grill"],"url":["https:\/\/foursquare.com\/v\/5b66159f2db4a9002ce66d2b"],"latitude":[34.1745],"longitude":[-118.09457],"locality":["Pasadena"],"region":["CA"],"country-name":["United States"],"postal-code":["91107"]},"value":"https:\/\/foursquare.com\/v\/5b66159f2db4a9002ce66d2b"}],"location":[{"type":["h-adr"],"properties":{"latitude":[34.1745],"longitude":[-118.09457],"locality":["Pasadena"],"region":["CA"],"country-name":["United States"],"postal-code":["91107"]}}]}}(Header Absent) [25-Aug-2018 18:42:04 UTC] REST result: /micropub/1.0/endpoint: {"error":"forbidden","error_description":"Unauthorized"}(403) - null(User ID: 0) [25-Aug-2018 18:42:04 UTC] PHP Warning: Invalid argument supplied for foreach() in /htdocs/wp-includes/rest-api/class-wp-rest-server.php on line 1259 [25-Aug-2018 18:42:08 UTC] PHP Notice: Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045 [25-Aug-2018 18:42:08 UTC] PHP Notice: Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045 [25-Aug-2018 18:42:08 UTC] PHP Notice: Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045 [25-Aug-2018 18:42:09 UTC] PHP Notice: Array to string conversion in /htdocs//wp-includes/formatting.php on line 1045 [25-Aug-2018 18:42:12 UTC] PHP Notice: Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045 [25-Aug-2018 18:42:12 UTC] PHP Notice: Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045 [25-Aug-2018 18:42:14 UTC] http://nominatim.openstreetmap.org/reverse?format=json&extratags=1&addressdetails=1&lat=45.53548&lon=-122.621244&zoom=18&accept-language=en-US [25-Aug-2018 18:42:15 UTC] http://nominatim.openstreetmap.org/reverse?format=json&extratags=1&addressdetails=1&lat=45.53548&lon=-122.621244&zoom=18&accept-language=en-US

(Originally published at https://boffosocko.com/2018/08/25/reply-to-release-version-2-0-of-micropub-plugin-%c2%b7-issue-150-%c2%b7-snarfed-wordpress-micropub/)

@asuh
Copy link

asuh commented Aug 25, 2018

Installed tree ef76125 from this repo, updated WP Indieauth to 3.1.5, logged into Quill to post a Note, received a 403 error when clicking on Post button.

Error log produces the following:
Invalid argument supplied for foreach() in [...]/wp-includes/rest-api/class-wp-rest-server.php on line 1259

It shows the REST request I made from Quill with everything I filled out and ends with (Header Absent)

Similar to @chrisaldrich above

@miklb
Copy link

miklb commented Aug 25, 2018

for complete reporting I am seeing this from Omnibear

**this is fixed in latest master of IndieAuth**
25-Aug-2018 20:02:28 UTC] PHP Notice:  Undefined variable: params in plugins/wordpress-indieauth/includes/class-indieauth-authorize.php on line 118 

[25-Aug-2018 20:02:28 UTC] Micropub Error: 403 forbidden - Unauthorized 
[25-Aug-2018 20:02:28 UTC] REST request: /micropub/1.0/endpoint: {"q":"syndicate-to"}(Header Present) 
[25-Aug-2018 20:02:28 UTC] REST result: /micropub/1.0/endpoint: {"error":"forbidden","error_description":"Unauthorized"}(403) - null(User ID: 0) 
[25-Aug-2018 20:02:28 UTC] PHP Warning:  Invalid argument supplied for foreach() in /wp-includes/rest-api/class-wp-rest-server.php on line 1259

@chrisaldrich
Copy link
Contributor

With the most recent version 261c782 I'm still getting errors posting with OwnYourSwarm:

Is this indicating it isn't finding the correct user account?

[06-Sep-2018 17:48:12 UTC] PHP Notice:  Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045
[06-Sep-2018 17:48:12 UTC] PHP Notice:  Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045
[06-Sep-2018 17:48:12 UTC] PHP Notice:  Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045
[06-Sep-2018 17:48:13 UTC] PHP Notice:  Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045
[06-Sep-2018 17:48:20 UTC] PHP Notice:  Trying to get property of non-object in /htdocs/wp-includes/post-template.php on line 298
[06-Sep-2018 17:48:20 UTC] PHP Notice:  Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045
[06-Sep-2018 17:48:21 UTC] PHP Notice:  Array to string conversion in /htdocs/wp-includes/formatting.php on line 1045
 
[06-Sep-2018 17:48:30 UTC] Micropub Error: 403 forbidden - Unauthorized
 
[06-Sep-2018 17:48:30 UTC] REST request: /micropub/1.0/endpoint: {"type":["h-entry"],"properties":{"published":["2018-09-05T17:05:41-07:00"],"syndication":["https:\/\/www.swarmapp.com\/user\/11479\/checkin\/5b906f556cd68e00258e6ec6"],"content":["Afternoon soccer"],"photo":["https:\/\/igx.4sqi.net\/img\/general\/original\/11479_J-cY4WxP6tHKCHQj1P52Fe3Q6Aa3XBQNSUmXXlhDaFc.jpg"],"checkin":[{"type":["h-card"],"properties":{"name":["Jefferson Park"],"url":["https:\/\/foursquare.com\/v\/4bfe831c8992a593b49cadb0"],"latitude":[34.154797926121],"longitude":[-118.11971716429],"locality":["Pasadena"],"region":["CA"],"country-name":["United States"],"postal-code":["91106"]},"value":"https:\/\/foursquare.com\/v\/4bfe831c8992a593b49cadb0"}],"location":[{"type":["h-adr"],"properties":{"latitude":[34.154797926121],"longitude":[-118.11971716429],"locality":["Pasadena"],"region":["CA"],"country-name":["United States"],"postal-code":["91106"]}}]}}(Header Absent)
 
[06-Sep-2018 17:48:30 UTC] REST result: /micropub/1.0/endpoint: {"error":"forbidden","error_description":"Unauthorized"}(403) - null(User ID: 0)

[06-Sep-2018 17:48:30 UTC] PHP Warning:  Invalid argument supplied for foreach() in /htdocs/wp-includes/rest-api/class-wp-rest-server.php on line 1259

@miklb
Copy link

miklb commented Sep 6, 2018

I asked in IRC/chat but my curiosity about the error message regarding User: 0 and @dshanske clarifying that means "no credentials", is this an indieauth issue? I realize the 2 are intrinsically connected at this point, but how to get to the source of the error has me questioning where it is actually coming from, despite the error message.

@miklb
Copy link

miklb commented Sep 7, 2018

my latest debug.log for the error

Micropub Error: 403 forbidden - Unauthorized 
REST request: /micropub/1.0/endpoint: {"q":"syndicate-to"}(Header Present) 
REST result: /micropub/1.0/endpoint: {"error":"forbidden","error_description":"Unauthorized"}(403) - null(User ID: 0) 
PHP Warning:  Invalid argument supplied for foreach() in /wp-includes/rest-api/class-wp-rest-server.php on line 1259

@miklb
Copy link

miklb commented Sep 7, 2018

@chrisaldrich is your site a stand alone WP install or a network install?

@chrisaldrich
Copy link
Contributor

@miklb That one is from a simple instance on a shared server.

@dshanske
Copy link
Member Author

I am trying to figure out that error notice in the rest server.

@dshanske
Copy link
Member Author

The invalid argument foreach is coming from a line in the REST server that sends headers.

https://github.com/WordPress/WordPress/blob/master/wp-includes/rest-api/class-wp-rest-server.php#1269 (In the older versions 1259).

It is called earlier as part of serve_request. I'm still stumped. The only possible thing I can think of that might explain this is the debug handling class. I'm curious if the error goes away if WP_DEBUG is false. But, that's the only thing in IndieAuth or Micropub that modifies the response coming back in

@ngm
Copy link

ngm commented Sep 22, 2018

Testing this version, installed via .zip download of master branch.

These are my installed plugins, if it's helpful:

| akismet | active | none | 4.0.8 |
| aperture | active | none | 1.0.2 |
| bridgy-publish | active | none | 1.4.2 |
| duplicator | active | none | 1.2.46 |
| gutenberg | inactive | none | 3.9.0 |
| host-meta | active | none | 1.3.0 |
| hum | active | none | 1.2.2 |
| indieauth | active | none | 3.1.6 |
| indieweb | active | none | 3.3.10 |
| indieweb-press-this | active | none | 1.0.4 |
| autopost-to-mastodon | active | none | 3.0 |
| wordpress-micropub-master | active | none | 1.4.3 |
| indieweb-post-kinds | active | none | 3.0.9 |
| pressforward | active | none | 5.1.1 |
| redirect-list | active | none | 1.8 |
| semantic-linkbacks | active | none | 3.9.1 |
| simply-static | active | none | 2.1.0 |
| syndication-links | active | none | 3.4.1 |
| timber-library | active | none | 1.7.1 |
| wordpress-webactions-master | active | none | 1.0.0 |
| webmention | active | none | 3.8.4 |
| wordpress-webmention-for-comments-master | active | none | 1.0.1 |
| wordfence | active | none | 7.1.12 |
| wordpress-seo | active | none | 8.2.1 |

A simple note post from Quill posted successfully after the update.
Also simple note works OK from micropublish.

@ngm
Copy link

ngm commented Sep 22, 2018

When I Refresh Configuration from Indigenous for Android, I get the following errors:

Error getting syndication targets: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

Error getting media endpoint: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

Error getting post-types: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject

Indigenous was previously configured OK, but I'll just doublecheck and revert to previous WP Micropub to confirm what happens.

UPDATE: Refresh Configuration is fine with v1.4.3 of WP Micropub plugin.

@dshanske
Copy link
Member Author

I use Indigenous for Android. @swentel Thoughts?

@dshanske
Copy link
Member Author

@ngm By the way, Webmention for Comments was merged into Webmentions

@swentel
Copy link

swentel commented Sep 22, 2018

@dshanske difference in endpoints maybe? I vaguely kind of remember seeing something like ?endpoint=micropub vs /micropub/1.0/endpoint (or something alike)

If that's the case, Indigenous doesn't refresh endpoints yet :/ So you'll have to delete the account and add it again to get the new endpoints.

@dshanske
Copy link
Member Author

That would be it.

@swentel
Copy link

swentel commented Sep 22, 2018

I'll prioritize IndiePass/indiepass-android#94 :)

@ngm
Copy link

ngm commented Sep 22, 2018

Marvellous, thanks @swentel

@dshanske - can confirm now then that posting via the new Micropub endpoint is working for me from Indigenous also.

@ngm
Copy link

ngm commented Sep 23, 2018

On 2.0, when I syndicate my posts to Mastodon (via all micropub clients that I've tried), the content is wrapped in <div id="e-content">...</div>. It doesn't happen on 1.4.3.

(Noting that it's very possible that it's a problem with my theme or my syndication target code, but any pointers as to why it's not happening in 1.4.3?)

@dshanske
Copy link
Member Author

It's a Post Kinds issue I need to push to stable. It doesn't know where to disable that extra code because of the Micropub changes.

@dshanske
Copy link
Member Author

dshanske commented Oct 5, 2018

I fear I will never get enough data on issues regarding auth

@dshanske
Copy link
Member Author

dshanske commented Oct 7, 2018

indieweb/wordpress-indieauth#113 - Auth issue @asuh reported has been resolved. Documentation to address in various plugins.

The Micropub auth, which maps URL to author and is enabled when the IndieAuth plugin isn't active, would suffer the same issue.

@asuh
Copy link

asuh commented Oct 7, 2018

As @dshanske reported above, issue is resolved.

My problem had to do with using www and non-www in the hostname. My site eventually forced www on the domain name so that Let's Encrypt wouldn't cause a redirect loop from the web host and WordPress competing with different hostnames.

Considering my site forces www, I used the full host with www with Quill and it worked when I posted a note.

@dshanske
Copy link
Member Author

Being as many of the issues seem to be with an Indieauth plugin Micropub interaction and I think I fixed another Indieauth issue, want to retest this.

@dshanske
Copy link
Member Author

I think, with 3.1.9 of Indieauth, we may be ready to release.

@dshanske
Copy link
Member Author

Released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

8 participants