WordPress.org

Ready to get started?Download WordPress

Forums

WPBook
[resolved] Cannot get WPBook working properly (46 posts)

  1. chrismillard
    Member
    Posted 1 year ago #

    Hi John,

    After getting WPBook Lite working, I thought I would try WPBook as it appears to have more features that I need.

    Since I don't have SSL on my blog, I'm using http://fbssl.me to provide a URL.

    I've got my app set up on Facebook with the "Website with Facebook Login", "App on Facebook" and "Page Tab" all configured.

    In WPBook, when I click on the "Checking permissions" link, it takes me to a Facebook page where it shows the following:-

    This page is where you can check and grant extended permissions, which enable WPBook to publish to your personal wall and/or to the walls of fan pages.

    The Facebook profile ID you are currently logged in to Facebook as is . You have defined <my FB used ID was here> as your Facebook user id in WPBook Settings.

    Your Facebook Profile ID must match the ID with which you are logged in to Facebook, or else an access token will not be stored and publishing to Facebook will fail. Please update the "YOUR Facebook Profile ID" setting in WPBook settings to match the userid shown above.

    FB profile has granted these permissions:
    •read_stream - no
    •publish_stream - no
    •manage_pages - no
    •user_groups - no

    An access token for this user has been stored.

    Stored access token is <long access token here>

    Active access token is <long access token here>

    You've indicated you wish to publish to this group: <my group id was here>

    ERROR: The user access token does not include publish stream and offline access permissions.

    To correct any of these, Grant or re-grant permissions for your userid. (This is required if you intend to publish to your personal wall OR any fan pages.)

    I click on the link to Grant or re-grant permissions but it doesn't seem to work for me, and I therefore don't know how to change the permissions.

    http://wordpress.org/plugins/wpbook/

  2. chrismillard
    Member
    Posted 1 year ago #

    When I enable the debug options of WPBook and check permissions, this is the error that appears:-

    This page is where you can check and grant extended permissions, which enable WPBook to publish to your personal wall and/or to the walls of fan pages.

    The Facebook profile ID you are currently logged in to Facebook as is . You have defined 902280384 as your Facebook user id in WPBook Settings.

    Your Facebook Profile ID must match the ID with which you are logged in to Facebook, or else an access token will not be stored and publishing to Facebook will fail. Please update the "YOUR Facebook Profile ID" setting in WPBook settings to match the userid shown above.

    FB profile has granted these permissions:

    Caught exception in getting permissions for user: Parser error: unexpected end of query.Error code: 601

    I wondered if it might be a browser issue, but it doesn't appear to be.

  3. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Hmm. Not sure what's going on there. Note where you say "The Facebook profile ID you are currently logged in to Facebook as is ." - seems like it doesn't have the right ID there.

    When you click "Grant or re-grant permissions for your userid" what happens? You said it doesn't seem to work for you, but what is the experience?

    Are you re-using the same token you were using before for WPBook LIte? Same "application" in Facebook?

    I don't know how the http://fbssl.me system works, but it seems like you're not getting the right access token generated or stored.

  4. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Actually I think this is a new bug - but I think that what is displayed is just wrong, and the access token you have may be just fine.

    Go to that "Check permissions page" the one which loads inside FB and tells you what your access token is.

    Copy the access token (big long string, make sure you get all of it) and paste it into Facebook's access token debugger:
    https://developers.facebook.com/tools/debug

    I think what you'll see is it has a ~2 month expiration and has all the right "scopes"

    i think what has happened is that this page showing status of the current token no longer reports the right status, which I will work on

  5. chrismillard
    Member
    Posted 1 year ago #

    Hi John,

    I've pasted the access token, and here's what I get:-

    Application ID 538253799574754 : LJScotland
    User ID 100006480657592 : JogScotland Lochaber
    Issued 1376766667 (on Saturday)
    Expires 1381950667 (in about 2 months)
    Valid True
    Origin Web
    Scopes create_note manage_pages photo_upload publish_actions publish_stream read_stream share_item status_update user_groups video_upload

    and when I try to publish a post (with WPBook enabled), I get the following error:-

    No post id returned from Facebook, $fb_response was /n and $fb_page_type was and $wpbook_description was test and $my_title was test

  6. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Chris - thanks for the update. I just tagged 2.6.4 in the SVN repo so you should see an update shortly - that will fix the "check permissions" page to show the right permissions.

    The question is why you are getting that response from Facebook.

    What kind of page are you trying to post to? Is it a fan page or a group? What is the PageID you have in your settings?

    In your WPBook settings inside WordPress are you publishing to your own personal profile AND to a page, or just a page?

  7. chrismillard
    Member
    Posted 1 year ago #

    Hi John - I've updated to 2.6.4 and the check permissions is now working ok, but I'm still getting the error when publishing a post to Facebook:-

    No post id returned from Facebook, $fb_response was /n and $fb_page_type was and $wpbook_description was test and $my_title was test

    On the Stream/Wall options, I have selected the option to "Publish new posts to the wall of this page/group:" and have put the correct ID in the Group ID field (132017353494120), and I've chosen to Publish as Posts.

    I am not trying to publish to my own wall.

  8. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Ah, now we're getting somewhere - thanks for the detail.

    Just tagged 2.6.5 - you may have found a bug that's been there a long time but no one told me about issues posting to groups.

    Two things changed in 2.6.5 - to really test both, update and then generate a new access token from the permissions page. (I changed how the publish API is called but also requested the "publish_actions" permission I wasn't getting before).

  9. chrismillard
    Member
    Posted 1 year ago #

    John - Updated to 2.6.5 but I'm still getting the error regarding No post id returned from Facebook....

  10. chrismillard
    Member
    Posted 1 year ago #

    I should just add to my above comment, that as part of my testing, I have deactivated all plugins except WPBook, I've also de-authorized the app in Facebook, then in the WPBook settings have checked the permissions and gone through the process of re-granting all permissions in Facebook again, but it's still giving me the same No post id error....

  11. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Hmm. I'm at a bit of a loss.

    In the past whenever this symptom has shown up ($fb_response was /n) it has been some kind of misconfiguration - either the group ID not being right, or the profile ID not being right, or the API key not being right.

    Do you have WPBook generating a debug log? (in the settings you can enable debugging)? Does it suggest anything useful?

    You can go to the Facebook Graph API explorer https://developers.facebook.com/tools/explorer/

    And you can paste in your access token, and try to do a "POST" request to /groupid/feed

    (where groupid is your groupid) and see if that gives you any more specific error.

    Unfortunately without some feedback from the Facebook API I can't see what's wrong here.

    Have you been able to post to your Profile (as a test) or to a page (as a test)?

  12. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Is your user profile able to post to the group wall directly? (Not using the API?)

  13. chrismillard
    Member
    Posted 1 year ago #

    Using the Graph API explorer, I can post to the group feed ok.

    In WPBook, when I enable the option "Show errors posting to FaceBook stream", this is the error that occurs when I try to post:-

    Caught exception in publish to group Invalid appsecret_proof provided in the API argument Error code: 0

    And these are the contents of wpbook_pub.txt - I tried publishing both with and without a feature image - both failed.

    2013-08-21 05:02:54 :Caught exception testing access_token: Error validating application. Cannot get application info due to a system error.Error code: 0
    2013-08-21 05:02:54 : publish_to_facebook running, target_admin is 100006480657592
    2013-08-21 05:02:54 : Post ID is 102
    2013-08-21 05:02:54 : My permalink is http://apps.facebook.com/ljscotland/test/
    2013-08-21 05:02:54 : Get Post Thumbnail function does not exist, or no thumb
    2013-08-21 05:02:54 : Post thumbail is
    2013-08-21 05:02:54 : Post share link is
    2013-08-21 05:02:54 : Publishing to personal wall, admin is 100006480657592
    2013-08-21 05:02:54 : Publishing as excerpt, is
    2013-08-21 05:41:34 :Caught exception testing access_token: Error validating application. Cannot get application info due to a system error.Error code: 0
    2013-08-21 05:41:34 : publish_to_facebook running, target_admin is 100006480657592
    2013-08-21 05:41:34 : Post ID is 105
    2013-08-21 05:41:34 : My permalink is http://apps.facebook.com/ljscotland/test-2/
    2013-08-21 05:41:34 : function exists, and this post has_post_thumbnail - post_Id is 105
    2013-08-21 05:41:34 : my_thumb_id is 73
    2013-08-21 05:41:34 : my_image is <full url to image was here>
    2013-08-21 05:41:34 : Post thumbail is <full url to image was here>
    2013-08-21 05:41:34 : Post share link is
    2013-08-21 05:41:34 : Past stream_publish, fb_response is
    2013-08-21 05:41:34 : Publishing to group 132017353494120
    2013-08-21 05:41:34 : Publishing to group, image is <full url to image was here>

  14. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Hmm. That error:

    Invalid appsecret_proof provided in the API argument

    Would suggest that your "App Secret" was wrong - have you validated that this is properly stored, and hasn't changed?

    Might be worth doing an "reset" on the app secret (which generates a new one) and making sure it is properly copied to and saved in the right place in the WPBook settings.

    Make sure the App ID and App secret are both fully copied, with no white-space on either end, and stored in the WPBook settings.

  15. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Hmm. Looking at some Facebook documentation on "appsecret_proof" -
    https://developers.facebook.com/docs/reference/api/securing-graph-api/

    Can you check and see whether in the advanced settings for your facebook application you have "Require AppSecret Proof for Server API calls:" set to enabled?

    This should be disabled.

    That said, the Facebook API docs say that the PHP library (which WPBook uses) adds this 'appsecret_proof' automatically, so I'd still say look and see if you have the correct app secret

  16. chrismillard
    Member
    Posted 1 year ago #

    I've changed the app secret, and updated the settings in WPBook. There was no whitespace before or after the previous secret. Likewise there are no whitespaces before or after the new app secret that I have put in, but it still provides the same error message.

    Do you want to go to my Worpress site and create a login, and I can give you admin access to take a look at the setup?

  17. chrismillard
    Member
    Posted 1 year ago #

    "Require AppSecret Proof for Server API calls:" is (and always has been) disabled.

  18. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Chris - I just registered on your site.

    I notice the app doesn't load under https - it works ok if I set my Facebook security to allow http browsing, and can view the canvas page, but I can't browse to the canvas page under https.

    Can you also email me (you'll have my email since I just registered on your site) screenshots of the settings for your Facebook app?

  19. chrismillard
    Member
    Posted 1 year ago #

    John - did you register at http://jogscotland-lochaber.org.uk ? I can't see your user account at all on there...

  20. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    I did (just a few minutes ago). Oddly I didn't get an email about it either.

    I used the register link and put in a username of jeckman and an @gmail email address

    Is your server setup to send email?

  21. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    I notice in the process you're offering Facebook social login - is that also using the Facebook API?

    Having multiple Facebook API registrations for the same domain may be the issue - you've got two different APP IDs and two different app secrets, both sharing a Facebook PHP API

  22. chrismillard
    Member
    Posted 1 year ago #

    Flippin' 'eck - I think Better WP Security was blocking email registrations!!!

    Can you try again John?

  23. chrismillard
    Member
    Posted 1 year ago #

    I've upgraded you to admin...

  24. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    Don't see anything obvious in the WPBook settings but clearly an issue somewhere in how we're using the access token.

    Can you send screenshots of the app settings in Facebook, or make me a developer on your Facebook app?

    Any chance you have "Stream post URL security" enabled?

    I do notice I can't browse to your Facebook app canvas page via HTTPS - what's going on there?

  25. AKCarlow
    Member
    Posted 1 year ago #

    Can I join in? I'm getting "Caught exception in publish to group Invalid appsecret_proof provided in the API argument Error code: 0" when I try to use WPBook to post from the https://carlowphoto.ie blog to the facebook group Carlow Photographic Society

  26. johneckman
    Member
    Plugin Author

    Posted 1 year ago #

    AKCarlow - sure, though it might be more effective to start a new thread.

    Was WPBook working for you before, or is this a new install?

    Are you able to post to your profile? Are you able to post to pages?

    (I'm beginning to wonder if something has changed in the API for posting to groups as I don't post to any groups and you two are having trouble).

    I do get SSL errors trying to view your blog under SSL - what's the address of your Facebook Application?

  27. AKCarlow
    Member
    Posted 1 year ago #

    WPBook was working, though with persistent expired access token. Updating to the latest version seemed to fix that, but then ...
    we migrated our blog to a new server. Getting Gallery working again was a bit hectic, so it is only now that I am getting back to WPBook. I have poked at so many settings that I don't know what I might have changed ...

    If I look at the canvas page for the facebook app (https://apps.facebook.com/carlowpic/) it does show the posts on the WordPress blog (https://carlowphoto.ie/).

    When you ask "Are you able to post to your profile? Are you able to post to pages?" do you mean directly in facebook (yes) or via WordPress/WPBook (haven't tried)?

  28. johneckman
    Member
    Plugin Author

    Posted 12 months ago #

    @AKCarlow - what I'm trying to determine is whether you are able to post (using WPBook from WordPress) to your own profile and or Pages you administer - if so, then the issue is specific to groups.

    Is it possible your application ID or Secret changed as you migrated?

    I'm wondering if something changed when I updated to the newer version of the Facebook php SDK, which is specific to posting to groups - will keep looking.

  29. AKCarlow
    Member
    Posted 12 months ago #

    Right.

    In the WPBook settings I selected "publish new posts to your wall" and deselected "publish posts to this wall" where I formerly had the group id. Note that I am admin for this group.

    I made a new post and got the error "Caught exception in stream publish for user: Invalid appsecret_proof provided in the API argumentError code: 0" (I have "show errors posting to facebook walls" selected). The new post shows up on the canvas page, but not my wall.

    One additional observation: when I check permissions with publishing to my page selected, I get no errors, but when the group page is selected, I get "ERROR: The user access token does not include publish stream and offline access permissions."

  30. johneckman
    Member
    Plugin Author

    Posted 12 months ago #

    I think the "check permissions" page is just saying that because "offline_access" got deprecated a while back - so it returns false, but that's probably not the real error, since you have the necessary publishing permissions.

    Thanks for pointing it out, though - I can clean that up.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags