WordPress.org

Ready to get started?Download WordPress

Forums

Simple Facebook Connect
[resolved] Register / Login Bug (no connection WP DB) (12 posts)

  1. nlsubtitles
    Member
    Posted 2 years ago #

    Hi,

    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?

    http://wordpress.org/extend/plugins/simple-facebook-connect/

  2. nlsubtitles
    Member
    Posted 2 years ago #

    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!

  3. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 2 years ago #

    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.

  4. nlsubtitles
    Member
    Posted 2 years ago #

    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!
    Thanks!

  5. madxpo
    Member
    Posted 2 years ago #

    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.

  6. ozdane75
    Member
    Posted 2 years ago #

    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

  7. madxpo
    Member
    Posted 2 years ago #

    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 .

  8. madxpo
    Member
    Posted 2 years ago #

    here's the whole thing.

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

  9. nlsubtitles
    Member
    Posted 2 years ago #

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

  10. nlsubtitles
    Member
    Posted 2 years ago #

    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?

  11. madxpo
    Member
    Posted 2 years ago #

    glad it worked.

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

  12. scoobasteve
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic