WordPress.org

Ready to get started?Download WordPress

Forums

Nextend Twitter Connect
[resolved] Invalid Twitter Profile Image Url (2 posts)

  1. playvue
    Member
    Posted 1 year ago #

    I am getting a broken/blank image for the avatar's of the users created using this plugin. I believe this is because you are using a url to pull the twitter profile images that is no longer valid in the Twitter API v1.1. Here is the setting in nextend-twitter-connect/nextend-twitter-connect.php:

    update_user_meta($ID, 'twitter_profile_picture', 'https://api.twitter.com/1.1/users/profile_image?user_id=' . $resp->id . '&size=bigger');

    The url referenced is no longer valid. As far as I know (having used this API call on a different, non-WP site), you have to access the users/show API call and pull the profile_image_url value that is returned amongst the other json data.

    As is, this makes the plugin unusable. Which, admittedly, confuses me as it seems to be actively used by many.

    http://wordpress.org/extend/plugins/nextend-twitter-connect/

  2. playvue
    Member
    Posted 1 year ago #

    Actually, it turns out the solution is much easier than I expected. The CORRECT url is returned from the Twitter account/verify_credentials call which is triggered when creating the new WP user. So, the only change that needs to happen here is to replace the update_user_meta call ref'd above with following (I left the prev/broken code and just commented it out):

    //update_user_meta($ID, 'twitter_profile_picture', 'https://api.twitter.com/1.1/users/profile_image?user_id=' . $resp->id . '&size=bigger');
    update_user_meta($ID, 'twitter_profile_picture', $resp->profile_image_url);

    Hope this comes in handy for others!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic