I just wanted to add this as a SOLVED question because it took me a while to figure it out and there was no documentation on this.
Notice: Trying to get property of non-object in /srv/www/wordpress-default/wp-includes/post.php on line 3555
Trying to wp_update_post(
) via plugin settings page and was getting this notice.
The solution was to add this line before calling the wp function: $wp_rewrite = new wp_rewrite;