Support » Plugin: Simple Facebook Connect » [Plugin: Simple Facebook Connect] Register / Login Bug (no connection WP DB)

  • Resolved nlsubtitles



    Great plugin, works great except for this bug I found.
    Browsing through Google and the Support forums here, I reckon it’s not something new and a lot of SFC users are experiencing this problem.

    The problem is that the plugin does NOT connect FB User to WP User

    I have the Login and Register modules active.
    When a new user registers WITH FB credentials, a password is emailed and in Facebook the app displays (Account Settings – > Apps), so all seems to be in order.

    BUT the WordPress user account is NOT automatically connected to the Facebook account. (this is where it goes wrong!!)

    Then if the user goes to /wp-login.php WITH Facebook logged in, the user is automatically redirected to /wp-login.php?action=register.
    (this is probably because the FB App recognizes the user, but since the FB acount is not connected to WP account, the user is not ‘recognized’ by the site.)

    Then if the user fills in the Register form again with the same FB credentials, the WordPress user account is finally connected to the Facebook account. And this is where it gets really strange:
    On the 2nd Register try, the user can fill out any username, it does not matter, it still connects the Username entered in the 1st Register attempt to the Facebook account.

    Obviously the problem is that the WP UserAccount is not connected to FB UserAccount on 1st Register attempt, but only after the user Registers AGAIN with same FB credentials.

    Anyone got any ideas on how to fix this problem?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Otto, any thoughts?
    Sorry for the huge story above, the main problem is that the WP account is not automatically connected to the FB account.
    And thus the user has to ‘register’ twice if they want their FB account attached to the WP account.

    Pleeeease help, will buy beer!

    Plugin Author Samuel Wood (Otto)

    (@otto42) Admin

    This is a known issue with the registration module. No fix at the moment though. Sorry. Try the development version of the plugin, that’s where the latest fixes always go.

    Thanks for the answer!!!
    At least now I know it is a known problem and not only on my site.

    Will try the development version!

    Hey Otto,

    I’ve got a fix for this issue.

    in sfc_register.php line 89 i added the following

    global $fb_uid;
    $fb_uid = $data['user_id'];

    and in line 98 (after the last { ) i added this new function

    function sfc_wordpressid_usermeta($user_id) {
        global $wpdb;
        global $fb_uid;
        update_usermeta($user_id, 'fbuid', $fb_uid); // connect the account so we don't have to query this again
    add_action( 'user_register', 'sfc_wordpressid_usermeta');

    Please let me know if there are any issues or concerns.

    I am having the same issue described above. Madxpo – excuse my ignorance but how do i find line 89 and 98 in the plugin code without just scrolling down each line? Thanks

    erm.. i’m gonna assume that you are using notepad.

    try notepad++ instead. it will show you the line numbers.

    If you rather not, the lines are near the end of the sfc_register.php .

    here’s the whole thing.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Thanks madxpo, gonna try tyour solution right now.
    Will let you know if it works.

    Thanks a lot madxpo, your fix works for me!!!

    Only 1 problem left, making the “connect this account with facebook” button work in a frontend profile editor.. anyone got tips?

    glad it worked.

    Sorry I have no experience with the front end plugin so I can’t help there.

    Just want to add that this thread saved my life. The fix that madxpo shared is also working for me. Woohoo!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: Simple Facebook Connect] Register / Login Bug (no connection WP DB)’ is closed to new replies.