WordPress.org

Plugin Directory

Changeset 593722


Ignore:
Timestamp:
09/02/12 17:41:27 (20 months ago)
Author:
SteveAtty
Message:

Version 2.1.17 - Curl IPv6 fixes

Location:
wordbooker
Files:
3 edited
17 copied

Legend:

Unmodified
Added
Removed
  • wordbooker/tags/2.1.17/includes/wordbooker_facebook_curl.php

    r593720 r593722  
    6868} 
    6969 
     70function wordbooker_friends($access_token,$flid) { 
     71        $url = 'https://graph.facebook.com/'.$flid.'/members?access_token='.$access_token.'&format=JSON'; 
     72        if ($flid==-100) { 
     73          $url = 'https://graph.facebook.com/me/friends?access_token='.$access_token.'&format=JSON';} 
     74    $x=wordbooker_make_curl_call($url); 
     75        return($x); 
     76} 
    7077function wordbooker_delete_fb_post($fb_post_id,$access_token){ 
    7178    $url='https://graph.facebook.com/'.$fb_post_id.'?method=delete&access_token='.$access_token; 
     
    7582 
    7683function wordbooker_get_access_token($access_token) { 
    77     #$url='https://graph.facebook.com/oauth/access_token?client_id='.WORDBOOKER_FB_ID.'&client_secret='.WORDBOOKER_FB_SECRET.'&grant_type=fb_exchange_token&fb_exchange_token='.$access_token; 
    7884    $url='https://wordbooker.tty.org.uk/refresh.php?oldie='.$access_token; 
    7985    $x=wordbooker_make_curl_call2($url); 
     
    8692        $url = 'https://graph.facebook.com/'.$fb_id.'/feed/?access_token='.$access_token.'&format=JSON&limit=10'; 
    8793    $x=wordbooker_make_curl_call($url); 
    88     #var_dump($x); 
    8994        return($x); 
    9095} 
    9196function wordbooker_fb_pemissions($fb_id,$access_token) { 
    9297    if (!isset($fb_id)){$fb_id='me';} 
    93         $url = 'https://graph.facebook.com/'.$fb_id.'/permissions?access_token='.$access_token.'&format=JSON'; 
     98        $url = 'https://graph.facebook.com/'.$fb_id.'/permissions?access_token=22'.$access_token.'&format=JSON'; 
    9499    $x=wordbooker_make_curl_call($url); 
    95100        return($x); 
    96101} 
    97102function wordbooker_fb_get_comments($fb_id,$access_token) { 
    98     $url = 'https://graph.facebook.com/'.$fb_id.'/comments?access_token='.$access_token; 
     103    $url = 'https://graph.facebook.com/'.$fb_id.'/comments?access_token=22'.$access_token; 
    99104    $x=wordbooker_make_curl_call($url); 
    100105        return($x); 
     
    121126 
    122127function wordbooker_make_curl_call($url) { 
     128    global $wordbooker_settings;     
    123129    $ch = curl_init(); 
    124130        curl_setopt($ch, CURLOPT_URL, $url); 
     
    129135    curl_setopt($ch, CURLOPT_TIMEOUT, 60); 
    130136    curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/fb_ca_chain_bundle.crt'); 
    131     @curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
     137    if (WORDBOOKER_IPV==6 && isset($wordbooker_settings['wordbooker_use_curl_4'])) { 
     138    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
     139    } 
    132140        $response = curl_exec($ch); 
    133141    $err_no=curl_errno($ch); 
     
    135143        curl_close($ch); 
    136144    $x=json_decode( $response); 
    137     if (isset($x->message)) {  
    138         throw new Exception ($x->message); 
     145    //var_dump($x); 
     146    if (isset($x->error_msg)) {  
     147    $error=$x->error_msg;} 
     148    if (isset($x->error->message)) {  
     149    $error=$x->error->message;} 
     150    if (isset($error)) {  
     151        throw new Exception ($error); 
    139152    } 
    140153     return( $x); 
     
    142155 
    143156function wordbooker_make_curl_call2($url) { 
     157    global $wordbooker_settings; 
    144158    $ch = curl_init(); 
    145159        curl_setopt($ch, CURLOPT_URL, $url); 
     
    150164    curl_setopt($ch, CURLOPT_TIMEOUT, 60); 
    151165    curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/fb_ca_chain_bundle.crt'); 
    152     @curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
     166    if (WORDBOOKER_IPV==6 && isset($wordbooker_settings['wordbooker_use_curl_4'])) { 
     167    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
     168    } 
    153169        $response = curl_exec($ch); 
    154170    $err_no=curl_errno($ch); 
    155171    $err_text=curl_error($ch); 
    156172        curl_close($ch); 
    157     wordbooker_debugger("Curl Call returns ",print_r($response,true),-5,98) ; 
     173    //wordbooker_debugger("Curl Call returns ",print_r($response,true),-5,98) ; 
    158174    $x=json_decode($response); 
    159175    if (is_null($x)) {$x=$response;} 
     
    165181 
    166182function wordbooker_make_curl_post_call($url,$data) { 
     183    global $wordbooker_settings; 
    167184    $ch = curl_init(); 
    168185        curl_setopt($ch, CURLOPT_URL, $url); 
     
    172189    curl_setopt($ch, CURLOPT_TIMEOUT, 60); 
    173190    curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/fb_ca_chain_bundle.crt'); 
    174     @curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
    175      curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
     191    if (WORDBOOKER_IPV==6 && isset($wordbooker_settings['wordbooker_use_curl_4'])) { 
     192    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
     193    } 
     194    curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
    176195        $response = curl_exec($ch); 
    177196    $err_no=curl_errno($ch); 
  • wordbooker/tags/2.1.17/readme.txt

    r593720 r593722  
    66Requires at least: 2.9 
    77Tested up to: 3.4.1 
    8 Stable tag: 2.1.16 
     8Stable tag: 2.1.17 
    99 
    1010This plugin allows you to cross-post your blog posts to your Facebook Wall and to any Facebook Fan Page / Group that you are an administrator for.  
     
    116116== Changelog == 
    117117 
    118 = Version 2.1.16  02/09/2012 = 
     118= Version 2.1.17  02/09/2012 = 
    119119- Changes to the IPv6 options to curl - option is disabled unless IPv6 available in curl 
    120120- Added IPv6 Fail back to IPv4 for DNS resolution in Advanced Options section 
    121121- Replaced two backticks with quotes to fix problems with Use Site URL not Blog Description in Wall Posts 
    122122- Changed minimum number of FB comments from 2 to 0. 
     123 
     124= Version 2.1.16  02/09/2012 = 
     125- Lost in SVN. 
    123126 
    124127= Version 2.1.15 25/08/2012 = 
  • wordbooker/tags/2.1.17/wordbooker.php

    r593720 r593722  
    66Author: Steve Atty  
    77Author URI: http://wordbooker.tty.org.uk 
    8 Version: 2.1.16 
     8Version: 2.1.17 
    99*/ 
    1010 
     
    3939define('WORDBOOKER_DEBUG', false); 
    4040define('WORDBOOKER_TESTING', false); 
    41 define('WORDBOOKER_CODE_RELEASE',"2.1.16 R00 - Machine Beside Machine"); 
     41define('WORDBOOKER_CODE_RELEASE',"2.1.17 R00 - Machine Beside Machine"); 
    4242 
    4343# For Troubleshooting  
  • wordbooker/trunk/includes/wordbooker_facebook_curl.php

    r593720 r593722  
    6868} 
    6969 
     70function wordbooker_friends($access_token,$flid) { 
     71        $url = 'https://graph.facebook.com/'.$flid.'/members?access_token='.$access_token.'&format=JSON'; 
     72        if ($flid==-100) { 
     73          $url = 'https://graph.facebook.com/me/friends?access_token='.$access_token.'&format=JSON';} 
     74    $x=wordbooker_make_curl_call($url); 
     75        return($x); 
     76} 
    7077function wordbooker_delete_fb_post($fb_post_id,$access_token){ 
    7178    $url='https://graph.facebook.com/'.$fb_post_id.'?method=delete&access_token='.$access_token; 
     
    7582 
    7683function wordbooker_get_access_token($access_token) { 
    77     #$url='https://graph.facebook.com/oauth/access_token?client_id='.WORDBOOKER_FB_ID.'&client_secret='.WORDBOOKER_FB_SECRET.'&grant_type=fb_exchange_token&fb_exchange_token='.$access_token; 
    7884    $url='https://wordbooker.tty.org.uk/refresh.php?oldie='.$access_token; 
    7985    $x=wordbooker_make_curl_call2($url); 
     
    8692        $url = 'https://graph.facebook.com/'.$fb_id.'/feed/?access_token='.$access_token.'&format=JSON&limit=10'; 
    8793    $x=wordbooker_make_curl_call($url); 
    88     #var_dump($x); 
    8994        return($x); 
    9095} 
    9196function wordbooker_fb_pemissions($fb_id,$access_token) { 
    9297    if (!isset($fb_id)){$fb_id='me';} 
    93         $url = 'https://graph.facebook.com/'.$fb_id.'/permissions?access_token='.$access_token.'&format=JSON'; 
     98        $url = 'https://graph.facebook.com/'.$fb_id.'/permissions?access_token=22'.$access_token.'&format=JSON'; 
    9499    $x=wordbooker_make_curl_call($url); 
    95100        return($x); 
    96101} 
    97102function wordbooker_fb_get_comments($fb_id,$access_token) { 
    98     $url = 'https://graph.facebook.com/'.$fb_id.'/comments?access_token='.$access_token; 
     103    $url = 'https://graph.facebook.com/'.$fb_id.'/comments?access_token=22'.$access_token; 
    99104    $x=wordbooker_make_curl_call($url); 
    100105        return($x); 
     
    121126 
    122127function wordbooker_make_curl_call($url) { 
     128    global $wordbooker_settings;     
    123129    $ch = curl_init(); 
    124130        curl_setopt($ch, CURLOPT_URL, $url); 
     
    129135    curl_setopt($ch, CURLOPT_TIMEOUT, 60); 
    130136    curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/fb_ca_chain_bundle.crt'); 
    131     @curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
     137    if (WORDBOOKER_IPV==6 && isset($wordbooker_settings['wordbooker_use_curl_4'])) { 
     138    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
     139    } 
    132140        $response = curl_exec($ch); 
    133141    $err_no=curl_errno($ch); 
     
    135143        curl_close($ch); 
    136144    $x=json_decode( $response); 
    137     if (isset($x->message)) {  
    138         throw new Exception ($x->message); 
     145    //var_dump($x); 
     146    if (isset($x->error_msg)) {  
     147    $error=$x->error_msg;} 
     148    if (isset($x->error->message)) {  
     149    $error=$x->error->message;} 
     150    if (isset($error)) {  
     151        throw new Exception ($error); 
    139152    } 
    140153     return( $x); 
     
    142155 
    143156function wordbooker_make_curl_call2($url) { 
     157    global $wordbooker_settings; 
    144158    $ch = curl_init(); 
    145159        curl_setopt($ch, CURLOPT_URL, $url); 
     
    150164    curl_setopt($ch, CURLOPT_TIMEOUT, 60); 
    151165    curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/fb_ca_chain_bundle.crt'); 
    152     @curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
     166    if (WORDBOOKER_IPV==6 && isset($wordbooker_settings['wordbooker_use_curl_4'])) { 
     167    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
     168    } 
    153169        $response = curl_exec($ch); 
    154170    $err_no=curl_errno($ch); 
    155171    $err_text=curl_error($ch); 
    156172        curl_close($ch); 
    157     wordbooker_debugger("Curl Call returns ",print_r($response,true),-5,98) ; 
     173    //wordbooker_debugger("Curl Call returns ",print_r($response,true),-5,98) ; 
    158174    $x=json_decode($response); 
    159175    if (is_null($x)) {$x=$response;} 
     
    165181 
    166182function wordbooker_make_curl_post_call($url,$data) { 
     183    global $wordbooker_settings; 
    167184    $ch = curl_init(); 
    168185        curl_setopt($ch, CURLOPT_URL, $url); 
     
    172189    curl_setopt($ch, CURLOPT_TIMEOUT, 60); 
    173190    curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/fb_ca_chain_bundle.crt'); 
    174     @curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
    175      curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
     191    if (WORDBOOKER_IPV==6 && isset($wordbooker_settings['wordbooker_use_curl_4'])) { 
     192    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); 
     193    } 
     194    curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
    176195        $response = curl_exec($ch); 
    177196    $err_no=curl_errno($ch); 
  • wordbooker/trunk/readme.txt

    r593720 r593722  
    66Requires at least: 2.9 
    77Tested up to: 3.4.1 
    8 Stable tag: 2.1.16 
     8Stable tag: 2.1.17 
    99 
    1010This plugin allows you to cross-post your blog posts to your Facebook Wall and to any Facebook Fan Page / Group that you are an administrator for.  
     
    116116== Changelog == 
    117117 
    118 = Version 2.1.16  02/09/2012 = 
     118= Version 2.1.17  02/09/2012 = 
    119119- Changes to the IPv6 options to curl - option is disabled unless IPv6 available in curl 
    120120- Added IPv6 Fail back to IPv4 for DNS resolution in Advanced Options section 
    121121- Replaced two backticks with quotes to fix problems with Use Site URL not Blog Description in Wall Posts 
    122122- Changed minimum number of FB comments from 2 to 0. 
     123 
     124= Version 2.1.16  02/09/2012 = 
     125- Lost in SVN. 
    123126 
    124127= Version 2.1.15 25/08/2012 = 
  • wordbooker/trunk/wordbooker.php

    r593720 r593722  
    66Author: Steve Atty  
    77Author URI: http://wordbooker.tty.org.uk 
    8 Version: 2.1.16 
     8Version: 2.1.17 
    99*/ 
    1010 
     
    3939define('WORDBOOKER_DEBUG', false); 
    4040define('WORDBOOKER_TESTING', false); 
    41 define('WORDBOOKER_CODE_RELEASE',"2.1.16 R00 - Machine Beside Machine"); 
     41define('WORDBOOKER_CODE_RELEASE',"2.1.17 R00 - Machine Beside Machine"); 
    4242 
    4343# For Troubleshooting  
Note: See TracChangeset for help on using the changeset viewer.