WordPress.org

Ready to get started?Download WordPress

Forums

Nextend Twitter Connect
[resolved] Twitter Error 3 upon login (10 posts)

  1. padreed123
    Member
    Posted 1 year ago #

    I'm getting 'Twitter Error 3' upon twitter logins after authorizing through twitter. It also asks to authorize every time someone logs in. Anther thing is that the twitter avatars are broken links now. Could all this be due to twitter dropping api ver. 1? I think it is cuz it just started since then..

    http://www.rapfiend.com/

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

  2. padreed123
    Member
    Posted 1 year ago #

    Here's the issue.. https://github.com/themattharris/tmhOAuth/issues/137

    To Fix it follow these steps:

    1. Download & unzip the latest tmhOauth
    https://github.com/themattharris/tmhOAuth/archive/master.zip

    2. Replace the old tmhOauth file located in
    "\wp-content\plugins\nextend-twitter-connect\sdk"
    with the newer version.

    3. Open "\wp-content\plugins\nextend-twitter-connect\nextend-twitter-connect.php" and replace
    $tmhOAuth->url('1/account/verify_credentials')
    to
    $tmhOAuth->url('1.1/account/verify_credentials')
    on lines 143 & 145

    That should do it.

  3. padreed123
    Member
    Posted 1 year ago #

    To fix the twitter avatars:

    Open "\wp-content\plugins\nextend-twitter-connect\nextend-twitter-connect.php"

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

    with
    update_user_meta($ID, 'twitter_profile_picture', $resp->profile_image_url );

    or if you want to cache the images instead of just linking from twitter then do this instead:

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

    With

    //cache profile imgs
    		  $uploads = wp_upload_dir();
    		  $upbase = $uploads['basedir'].'/';
    		  $upurl = $uploads['url'].'/';
    
                      //u can use any folder structure u'd like by changing this array.
                      //the files will be downloaded in your wp uploads folder
    
    		  $structure_arr = array('user','img','tw');
    
    		  $structure = '';
    		  foreach($structure_arr as $folder){
    			$structure .=  $folder . '/' ;
    			}
    		  $img_dir = $upbase.$structure;
    		  If(!file_exists($img_dir)) {
    			foreach($structure_arr as $folder){
    					$dir = $upbase .$folder . '/';
    					If(!file_exists($dir)){
    						mkdir($dir);
    						$upbase = $dir;
    					}
    			}
    		 }
    		 $tw_img = str_replace('_normal','',$resp->profile_image_url);
    		 $spt_tw_img = explode('.',$tw_img);
    		 $tw_ext ='.' . end($spt_tw_img);
    		 $file_name = $img_dir.$ID.$tw_ext;
    		 $get_tw_img = file_get_contents($tw_img);
    		  file_put_contents($file_name,$get_tw_img);
    		  update_user_meta($ID, 'twitter_profile_picture',  $upurl . $structure.$ID.$tw_ext);
  4. padreed123
    Member
    Posted 1 year ago #

    Hopefully they update the plugin soon.. and if they do remember that it'll wipe out the caching option from above unless they adopt it.

  5. Damien
    Member
    Posted 1 year ago #

    You are brilliant, thank you for taking the time to post this. Really appreciate it. Someone give this man a beer!

  6. Damien
    Member
    Posted 1 year ago #

    edited out. fixed

  7. Sivaprabu Ganesan
    Member
    Posted 1 year ago #

    Hi dear Padreed123,

    I got an error Twitter Error 1

    I changed above all before i got Twitter Error 3 now Twitter Error 1 how can i fix the error?

  8. padreed123
    Member
    Posted 1 year ago #

    The plugin has been recently updated.

  9. Sivaprabu Ganesan
    Member
    Posted 1 year ago #

    I download and updated the new plugin 1.4.59 version but now i got error like

    Twitter Error 1

  10. ethernick
    Member
    Posted 1 year ago #

    hey gsivaprabu,

    I think I fixed the problem on my end. What PHP version are you running? It looks like the how it determined a couple file paths would only work with PHP > 5.3. It was using __DIR__ instead of the following

    I updated tmOAuth.php lines 67 & 68 to

    'curl_cainfo'    => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'cacert.pem',
    'curl_capath'   => dirname(__FILE__),

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic