# Wordpress integration issue

**URL:** https://meta.discourse.org/t/wordpress-integration-issue/33897
**Category:** WordPress
**Created:** [September 30, 2015, 2:24am UTC](https://meta.discourse.org/t/wordpress-integration-issue/33897 "2015-09-30T02:24:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![terraboss](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/terraboss/32/381157_2.png) [@terraboss](https://meta.discourse.org/u/terraboss)
#### Post date: [September 30, 2015, 2:24am UTC](https://meta.discourse.org/t/wordpress-integration-issue/33897/1 "2015-09-30T02:24:02Z")

</div>

Hello,  
I’ve got the following error:

> Warning: First parameter must either be an object or the name of an existing class in /www/htdocs/w011e2a4/webdata/wordpress/wp-content/plugins/wp-discourse-0.6.6/lib/discourse.php on line 507

> Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w011e2a4/webdata/wordpress/wp-content/plugins/wp-discourse-0.6.6/lib/discourse.php:507) in /www/htdocs/w011e2a4/webdata/wordpress/wp-admin/post.php on line 242

> Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w011e2a4/webdata/wordpress/wp-content/plugins/wp-discourse-0.6.6/lib/discourse.php:507) in /www/htdocs/w011e2a4/webdata/wordpress/wp-includes/pluggable.php on line 1207

This happens since I’ve changed the subdomain of our WP site from sandbox._… to www._… The issue shows up when publishing a new post.

All the other sites are working probably. I didn’t notice any other issues.

The post by itself is showing this error:

> Warning: First parameter must either be an object or the name of an existing class in /www/htdocs/w011e2a4/webdata/wordpress/wp-content/plugins/wp-discourse-0.6.6/lib/discourse.php on line 507

Any clue?

---

<div class="post-metadata">

### Author: ![terraboss](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/terraboss/32/381157_2.png) [@terraboss](https://meta.discourse.org/u/terraboss)
#### Post date: [September 30, 2015, 2:46am UTC](https://meta.discourse.org/t/wordpress-integration-issue/33897/2 "2015-09-30T02:46:04Z")

</div>

Beginning at line 507, discourse.php

```
if( property_exists( $json, 'id' ) ) {
  $discourse_id = (int) $json->id;
}

if( isset( $discourse_id ) && $discourse_id > 0 ) {
  add_post_meta( $postid, 'discourse_post_id', $discourse_id, true );
}
  }
} else {
  // for now the updates are just causing grief, leave'em out
  return;
  $url = $options['url'] .'/posts/' . $discourse_id ;
  $post_options = array( 'method' => 'PUT', 'body' => http_build_query( $data ) );
  $result = wp_remote_post( $url, $post_options );
  $json = json_decode( $result['body'] );

  if(isset( $json->post ) ) {
    $json = $json->post;
  }

```

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [September 30, 2015, 11:06am UTC](https://meta.discourse.org/t/wordpress-integration-issue/33897/3 "2015-09-30T11:06:44Z")

</div>

Have you tried to simply uninstall and reinstall the plugin?

---

<div class="post-metadata">

### Author: ![terraboss](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/terraboss/32/381157_2.png) [@terraboss](https://meta.discourse.org/u/terraboss)
#### Post date: [September 30, 2015, 9:30pm UTC](https://meta.discourse.org/t/wordpress-integration-issue/33897/4 "2015-09-30T21:30:46Z")

</div>

The error is the same.
