Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Digging into the code further, I found this in fb-social-publisher.php starting at line 334:

    try {
    		$publish_result = $facebook->api('/me/' . $options["app_namespace"] . ':publish', 'POST', array('message' => $author_message, 'article' => get_permalink($post_id)));
    
    		update_post_meta($post_id, 'fb_author_post_id', sanitize_text_field($publish_result['id']));
    
    	}
    	catch (FacebookApiException $e) {
    		//Unset the option to publish to an author's Timeline, since the likely failure is because the admin didn't set up the proper OG action and object in their App Settings
    		//if it's a token issue, it's because the Author hasn't auth'd the WP site yet, so don't unset the option (since that will turn it off for all authors)
    		if ($e->getType() != 'OAuthException') {
    			$options['social_publisher']['publish_to_authors_facebook_timeline'] = false;
    
    			update_option( 'fb_options', $options );
    		}
    	}

    I would consider myself to be sub-novice in Facebook API programming, but is the /me supposed to be replaced with a user ID or something? Or is that just referring to whatever user is currently logged on in the browser session?

    Regardless, that error handling is pretty bad — it just catches the exception and silently turns that option off, with no feedback that anything failed, nor any details as to what failed. In fact, the code seems to be littered with try/catch blocks that do nothing when catching an exception. I would add some error handling myself, but I’ve never programmed a WordPress plugin before and quick Googling didn’t show any handy “show this error in the admin header section” sort of function.

    With the lack of error handling, this really isn’t version 1.0 of the plugin, it’s really more like version 0.1.

    Well, sorry for spam posting, but it seems that manually-entered curl post did come through to my “Activity” section (I was expecting it to come in as a status update, I guess).

    This makes me think that:

    1. The manual curl method worked as it was supposed to, but it just put the post somewhere I wasn’t expecting, and…

    2. There is something wrong with calling curl through PHP. I have successfully used curl on my host before, so maybe it’s just that Facebook is blocking it for some reason? In any case, the plugin code should be able to detect curl errors and report on them if anything goes wrong.

    Hmm, as a follow-up, I went to my Timeline and then clicked Activity Log. The top item on that was my post to my blog, set to Allowed on Timeline. The time on it corresponds to the post that I made manually via curl on the command line. However, it is still not actually visible on my timeline.

    I also tried creating another admin user. When I logged in as that user, it did ask me to authenticate with Facebook. I did so, and created a new post as that user, and it did not show up in my timeline or my Activity Log.

    As further information, I host my blog through BlueHost, in case there are any known issues with that host.

    I was having the same problem. I got past the “publish at least one action to your Timeline” error by going to the command line in Linux and copying and pasting the publish code that shows up under “Get Code” for Action Types — I made sure to substitute my app ID for /me in the URL. I did get a response back, and Facebook no longer gave me the “publish at least one action to your Timeline” error.

    However, posts still do not go to my Facebook wall (not even the one that I manually posted using curl). I have never been asked to authenticate with Facebook from my WordPress blog, as the documentation indicates I would be.

    Possible complicating factor: I had Wordbooker installed but deactivated. Thinking it might still be interfering, I deleted it, then deactivated and deleted the Facebook plugin, and reinstalled it. I’m still having the same trouble though — posts are not going to my wall even though I checked the option for them to do so and saved the options. I refresh that page and the option is still checked. When I make a new test post, it does not go to my Timeline, and that option is unchecked. When I check it again, it pops up https://developers.facebook.com/wordpress/#author-og-setup.

    Maybe I need to wait for the Publish action to be approved and no longer “pending”? I got the impression from the documentation that the post would go to your wall regardless of the approval status though.

    UmbralEchoes

    (@umbralechoes)

    Never mind, figured it out. There was an old PEAR installation hanging around in my webroot — I removed that, and it seemed to install okay.

    UmbralEchoes

    (@umbralechoes)

    I get a similiar error, though it seems to be a PEAR issue:

    Fatal error: Cannot redeclare class Auth_OpenID_DatabaseConnection in /home/digitax0/public_html/umbralechoes/PEAR/Auth/OpenID/DatabaseConnection.php on line 25

    Any advice on tracking down the cause of this?

    Thread Starter UmbralEchoes

    (@umbralechoes)

    Strike that. Just copying the 2.2.1 files over (and not running the upgrade script) causes this issue for me, after all plugins have been disabled. Guess I might just have to see if I can find exactly what files were changed between 2.2 and 2.2.1, and modify them manually myself.

    As a note, I tried downloading 2.2.1 onto 2 separate computers and uploading it to my website, just in case there was something wrong with one of the computers (bad hard drive sector, whatever). Same thing both times.

    Thread Starter UmbralEchoes

    (@umbralechoes)

    I’ve tried downloading 2.2.1 multiple times, and installing into a completely fresh directory on my server (though using the same wp-config.php file). The blog then works perfect fine… until I try to run the upgrade script (wp-admin/upgrade.php), and then I start getting the funky PHP code at the top of the page. If it’s not necessary to run the upgrade script when upgrading from 2.2 to 2.2.1, then I just won’t bother with it. Still seems odd that the upgrade script would break the site, though.

    Thread Starter UmbralEchoes

    (@umbralechoes)

    As further info, I can confirm that running the upgrade script is what causes this. I just tried a fresh install of 2.2 (using my old database and wp-config.php file). Everything worked fine. I copied the 2.2.1 files over. Site still worked fine. I ran the upgrade script, and the above behavior occurs.

    Also, here is my server information:

    Operating system Linux
    Kernel version 2.6.21-3_1.BHsmp
    Apache version 1.3.37 (Unix)
    PHP version 5.1.6
    MySQL version 5.0.27-standard-log

Viewing 9 replies - 1 through 9 (of 9 total)