I am using THIS add-on to my wordpress theme facebook login ! but it’s stopped working ! I found some answers about it and changed the codes like this;

$token_and_expire = wp_remote_get( 'https://graph.facebook.com/v2.8/oauth/access_token?client_id=' . $app_id . '&redirect_uri=' . get_site_url() . '/wp-admin/admin-ajax.php?action=facebook_oauth_callback&client_secret=' . $secret_key . '&code=' . $_GET['code'] );
$response = wp_remote_retrieve_body( $token_and_expire );

if ( isset( $response->access_token ) ) {
    $fields = array(
        'id',
        'name',
        'first_name',
        'last_name',
        'link',
        'website',
        'gender',
        'locale',
        'about',
        'email',
        'hometown',
        'location',
        'verified',
        'picture.type(large)',
    );
    $access_token = $response->access_token;
    $user_information = wp_remote_get( 'https://graph.facebook.com/v2.8/me?access_token=' . $access_token . '&fields=' . implode( ',', $fields ) . '' );

but doesn’t work ! I need help thanks for answers

Read more here: facebook wordpress add-on stopped working?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: