• i am facing an authentication problem. I followed instructions to allow posting from wordpress to author timeline on facebook. I created the open graph action, then created a post on wordpress and went back to click submit on open graph action. I could not do it because I am not authenticated and therefore facebook is not recognizing the post as coming from me. so how do i authenticate myself

    https://www.ads-software.com/extend/plugins/facebook/

Viewing 15 replies - 16 through 30 (of 72 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.

    Plugin Contributor Matt Kelly (Facebook)

    (@mattwkelly)

    “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.”

    Unfortunately we had to remove error logging as part of VIP submission. We’re pushing a new version tomorrow that outputs errors once a post/page is submitted, though.

    Same problem. No yellow authenticate bar.

    Plugin Contributor Matt Kelly (Facebook)

    (@mattwkelly)

    UmbralEchoes:
    “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.”

    Download 1.0.1– we’re no longer just swallowing the errors.

    /me/ just queries the currently active user (based on access token passed)

    Can you let me know what you get when you try to publish something, now? An admin status message should be set once the post/page is published.

    psychesmartautismtm:
    Are you still seeing this issue in 1.0.1? Thanks

    Thread Starter psychesmartautismtm

    (@psychesmartautismtm)

    thanks Matt for trying to resolve this problem. Unfortunately, i just updated the plugin and checked “publish to author’s timeline” only to enter the same loop as in previous version. i.e. open graph won’t let me submit a publish action and wordpress won’t show an authentication prompt. note: if it matters I use www.ads-software.com platform from within my website.

    I get the following error message when trying to post new post.

    Error: {“message”:”Unknown path components: /kyaccinfo:publish”,”type”:”OAuthException”}

    No yellow admin status message. First post on timeline says “auto draft”. Second post actually posted to Facebook timeline, but when I go to submit, I get the same “must publish at least one action…”

    No yellow status message for authentication, but got a message saying post did post to Facebook timeline, but after error message above.

    Same error as Mayhem1969

    Failed posting to your Facebook Timeline. Error: {“message”:”Unknown path components: /eestudentprojects:publish”,”type”:”OAuthException”}

    Still posts to the Facebook Page alright, but not to the Author’s Facebook Timeline.

    Plugin Contributor Matt Kelly (Facebook)

    (@mattwkelly)

    psychesmartautismtm: the “Social Publishing” checkbox is enabled, and you’ve saved the settings, right?

    Can you go to https://www.facebook.com/settings/?tab=privacy&ref=mb -> “Ads, Apps, and Websites” and see if you’ve authenticated your app in the past? If so, try removing it and see if that fixes the problem (of the yellow bar not appearing).

    mayhem1969, Igloozion: thanks, we’re looking into it.

    Just wanted to post my process and provide screenshots:
    FB Error.jpg

    Gonna post this in a different thread because it seems to be a different problem.

    Thread Starter psychesmartautismtm

    (@psychesmartautismtm)

    Matt, I removed the authenticated app and went back and did the same thing, still no authentication and no submit action.

    Plugin Contributor Matt Kelly (Facebook)

    (@mattwkelly)

    Igloozion/mayhem1969: what do you have entered as your App namespace in WordPress?

    What’s the name space in app settings on developers.facebook.com? Those need to be the same thing.

    Plugin Contributor Matt Kelly (Facebook)

    (@mattwkelly)

    @psychesmartautismtm: is it possible to look at your apache logs and see if there are any errors being reported?

    They are the same (in my case eestudentprojects) I retyped my app ID and App Secret, too, just to make sure there were no issues with copy/pasting the fields.

    They are the same in my case as well.

Viewing 15 replies - 16 through 30 (of 72 total)
  • The topic ‘[Plugin: Facebook] Post to author timeline authentication’ is closed to new replies.