# Getting an error when posting

**URL:** https://meta.discourse.org/t/getting-an-error-when-posting/24666
**Category:** WordPress
**Created:** [February 1, 2015, 12:14am UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666 "2015-02-01T00:14:58Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![kaylinator](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaylinator/32/115564_2.png) [@kaylinator](https://meta.discourse.org/u/kaylinator)
#### Post date: [February 1, 2015, 12:14am UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/1 "2015-02-01T00:14:58Z")

</div>

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](http://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?

---

<div class="post-metadata">

### Author: ![benword](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benword/32/493782_2.png) [@benword](https://meta.discourse.org/u/benword)
#### Post date: [February 1, 2015, 12:35am UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/2 "2015-02-01T00:35:11Z")

</div>

Are you using the latest version of the plugin?

---

<div class="post-metadata">

### Author: ![kaylinator](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaylinator/32/115564_2.png) [@kaylinator](https://meta.discourse.org/u/kaylinator)
#### Post date: [February 1, 2015, 12:44am UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/3 "2015-02-01T00:44:02Z")

</div>

Yup. 0.6.3 Grabbed directly from [GitHub](https://github.com/discourse/wp-discourse)

---

<div class="post-metadata">

### Author: ![benword](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benword/32/493782_2.png) [@benword](https://meta.discourse.org/u/benword)
#### Post date: [February 1, 2015, 12:50am UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/4 "2015-02-01T00:50:25Z")

</div>

Related issues: [Issue search results · GitHub](https://github.com/discourse/wp-discourse/search?q=file_get_contents&type=Issues&utf8=%E2%9C%93)

This is because the plugin [isn’t generating good enough errors right now](https://github.com/discourse/wp-discourse/blob/9be62c9943a94aac5c739254fbf84c345fc86726/lib/discourse.php#L472). 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

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [February 1, 2015, 1:19am UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/5 "2015-02-01T01:19:19Z")

</div>

> [@kaylinator](#):
>
> file\_get\_contents

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.

---

<div class="post-metadata">

### Author: ![benword](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benword/32/493782_2.png) [@benword](https://meta.discourse.org/u/benword)
#### Post date: [February 1, 2015, 2:33am UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/6 "2015-02-01T02:33:02Z")

</div>

> [@DeanMarkTaylor](#):
>
> This is a poorly implemented WordPress plugin

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.

👍 on switching to `wp_remote_get`

---

<div class="post-metadata">

### Author: ![kaylinator](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaylinator/32/115564_2.png) [@kaylinator](https://meta.discourse.org/u/kaylinator)
#### Post date: [February 1, 2015, 8:31am UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/7 "2015-02-01T08:31:53Z")

</div>

> [@benword](#):
>
> try doing a var\_dump($json); in lib/discourse.php on L472

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

---

<div class="post-metadata">

### Author: ![kaylinator](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaylinator/32/115564_2.png) [@kaylinator](https://meta.discourse.org/u/kaylinator)
#### Post date: [February 1, 2015, 9:18pm UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/8 "2015-02-01T21:18:10Z")

</div>

> [@kaylinator](#):
>
> No such file or directory in /homepages/1/d563246168/htdocs/blog/wp-content/plugins/wp-discourse-master/lib/discourse.php

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?

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [February 2, 2015, 12:28pm UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/9 "2015-02-02T12:28:19Z")

</div>

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://`.

---

<div class="post-metadata">

### Author: ![kaylinator](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaylinator/32/115564_2.png) [@kaylinator](https://meta.discourse.org/u/kaylinator)
#### Post date: [February 2, 2015, 7:29pm UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/10 "2015-02-02T19:29:29Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 16, 2023, 2:53pm UTC](https://meta.discourse.org/t/getting-an-error-when-posting/24666/11 "2023-05-16T14:53:39Z")

</div>

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