Medium / medium-wordpress-plugin

The official WordPress plugin for cross-posting to Medium.
https://medium.com
Apache License 2.0
210 stars 40 forks source link

Server Error 500 #36

Closed 8BrickDMG closed 8 years ago

8BrickDMG commented 8 years ago

Hi,

I recently installed the plugin into our Wordpress environment and I noticed that adding in the Medium token into the users profile page, causes an error 500 when saving. This can only be triggered when saving something in that field. Any other profile settings save fine.

Any ideas on how to resolve this? I've gone and added the token directly to the database to work around this.

Thanks! Jason.

frankiejarrett commented 8 years ago

Hi @8BrickDMG, the more details you can provide about your environment, the better. This will help others reproduce the issue.

majelbstoat commented 8 years ago

Also, @8BrickDMG, can you include the (anonymised) error log line?

8BrickDMG commented 8 years ago

Hi @fjarrett and @majelbstoat. Here are the following details of the environment.

WordPress version = 4.3.1 PHP version = PHP 5.6.4-4ubuntu6.2 (cli) (built: Jul 2 2015 15:29:28) OS = Ubuntu Server 15.04

List of active plugins = AddThis Sharing Buttons v5.1.2 Contact Form 7 v4.3 Countdown Pro Wpdevart v10.0 Google XML Sitemaps v4.0.8 MailChimp for WordPress Lite v2.3.16 MailChimp Forms by MailMunch v2.1.2 Medium v1.0 OptionTree v2.5.5 Rotating Tweets (Twitter widget & shortcode) v1.7.18 WordPress Importer v0.6.1 WP Robots Txt v1.1 WP-SpamShield v1.9.6.3

Theme name = Awesome App Child (This has been modified slightly).

I do get this error log when I turn the debug setting on (if this isn't what you asked for, please help direct me to where I should be looking for the logs as I'm still learning Wordpress):

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use __construct() instead. in /home/upteam/unleashingpotential.org.uk/wp-includes/functions.php on line 3457

Notice: A session had already been started - ignoring session_start() in /home/upteam/unleashingpotential.org.uk/wp-content/plugins/medium/lib/medium-admin.php on line 20

wjmoner commented 8 years ago

I'm also receiving the same 500 Server Error when attempting to apply the integration key to a publication. Theme: Twenty-Fifteen default, no changes, no plugins other than Akismet. When I press reload after the 500 Error, I get a message in the browser stating "Invalid User ID."

majelbstoat commented 8 years ago

Hey @wjmoner, that's very strange. Can you email the token you used to developers@medium.com for the attention of Jamie, and I can try and reproduce. (Does it happen for all tokens, if you generate another one for yourself from the settings page?)

Thanks for the info too, @8BrickDMG.

Chrisjgreenough commented 8 years ago

@majelbstoat we have a very similar environment and we are receiving the same error. There is no effect when creating new tokens. I've installed the plugin via Wordpress and via the zip file on GitHub separately just incase. Is it possible to also email you our token?

majelbstoat commented 8 years ago

Yep, please do.

On Wed, Nov 4, 2015 at 9:49 PM Chris Greenough notifications@github.com wrote:

We have a very similar environment and we are receiving the same error. There is no effect when creating new tokens. I've installed the plugin via Wordpress and via the zip file on GitHub separately just incase. Is it possible to also email you our token?

— Reply to this email directly or view it on GitHub https://github.com/Medium/medium-wordpress-plugin/issues/36#issuecomment-153963634 .

majelbstoat commented 8 years ago

Ok, I've tested both the supplied tokens, and they are working as expected, which points to some kind of failure in the WP plugin itself.

You can try this yourself with curl on the command line:

curl -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' https://api.medium.com/v1/me

Will do my best to dig in to the root cause, but without error messages, or a line number it's pretty hard.

majelbstoat commented 8 years ago

Hey @wjmoner, @Chrisjgreenough, @8BrickDMG,

Can you paste a screenshot of the exact errors you see in the browser? I've done extensive testing with large combinations of plugins without reproducing, so I think it must be something to do with server configuration. It might be to do with the version of cURL that is on the server, or something else like that. Going to move to wp's own request library and see if that helps, but it's a bit of a guess at the moment.

@8BrickDMG since you added the token directly in the db, have you since been able to cross-post to Medium?

Chrisjgreenough commented 8 years ago

@majelbstoat screen shot 2015-11-06 at 1 52 25 pm We are looking into our server to see if it's a server error on our end.

Chrisjgreenough commented 8 years ago

@majelbstoat it was our cURL version. Thanks!

majelbstoat commented 8 years ago

Awesome, thanks for double-checking. Hopefully the move to wp_remote_get() in the next version will catch and fallback to an alternative for others.

majelbstoat commented 8 years ago

(What cURL version did you have? And what version worked?)

majelbstoat commented 8 years ago

@wjmoner, @8BrickDMG, I just merged a patch to use WP's standard request libraries. If you're able, can you upgrade to this version, and let me know if it solves the problem?

If it doesn't, it's likely to be your curl config/version, as it was for Chris, but would be good to know if this actually solves the problem.

wjmoner commented 8 years ago

@majelbstoat Thanks for all your help! The new plugin connected using my Medium token without trouble. Great work, thanks!

To answer your question, curl 7.35.0 (x86_64-pc-linux-gnu)

Chrisjgreenough commented 8 years ago

@majelbstoat we used the latest edge version from apt-get.

majelbstoat commented 8 years ago

Going to call this fixed. Thanks for debug help everyone.