Getting an error when posting

Everytime I try to post an article in Wordpress, I end up with the following errors:

Warning: file_get_contents(forum.jk-junkies.com/posts): failed to open stream: No such file or directory in /homepages/1/d563246168/htdocs/blog/wp-content/plugins/wp-discourse-master/lib/discourse.php on line 469

Warning: First parameter must either be an object or the name of an existing class in /homepages/1/d563246168/htdocs/blog/wp-content/plugins/wp-discourse-master/lib/discourse.php on line 474

Warning: Cannot modify header information - headers already sent by (output started at /homepages/1/d563246168/htdocs/blog/wp-content/plugins/wp-discourse-master/lib/discourse.php:469) in /homepages/1/d563246168/htdocs/blog/wp-admin/post.php on line 233

Warning: Cannot modify header information - headers already sent by (output started at /homepages/1/d563246168/htdocs/blog/wp-content/plugins/wp-discourse-master/lib/discourse.php:469) in /homepages/1/d563246168/htdocs/blog/wp-includes/pluggable.php on line 117877

Any ideas what I’m doing wrong here?

Are you using the latest version of the plugin?

Yup. 0.6.3 Grabbed directly from GitHub

Related issues: https://github.com/discourse/wp-discourse/search?q=file_get_contents&type=Issues&utf8=✓

This is because the plugin isn’t generating good enough errors right now. Try verifying all of the plugin settings to make sure that they’re correct.

If you’re still running into errors at that point, try doing a var_dump($json); in lib/discourse.php on L472

This is a poorly implemented WordPress plugin - I would suggest the developer switch from using file_get_content to wp_remote_get for best practices.

Agreed, which is why lately I’ve started to help out. It would be awesome if others jumped in, too. I’d really appreciate a PR (or at least a GitHub issue) if you have a moment.

:+1: on switching to wp_remote_get

You’ve over estimated my technical knowledge. All my settings I’m pretty sure are correct, but I have no idea what ^that^ means.

I’m wondering if this might be the problem? Seems it should be looking for the file at /blog/wp-content/plugins/wp-discourse-master/lib/discourse.php

Thoughts @benword, @DeanMarkTaylor?

Only guessing…
It’s trying to load a file forum.jk-junkies.com/posts and this should probably be something like http://forum.jk-junkies.com/posts so perhaps in the settings for the plugin you need to include the extra http://.

2 Likes

Holy smokes man! You nailed it! Thanks a ton!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.