WordPress.org

Plugin Directory

Changeset 539774


Ignore:
Timestamp:
05/04/12 06:28:01 (2 years ago)
Author:
SteveAtty
Message:

Version 2.1.10 - Fixes the auth loop problem reported by some users

Location:
wordbooker
Files:
2 edited
13 copied

Legend:

Unmodified
Added
Removed
  • wordbooker/tags/2.1.10/readme.txt

    r539162 r539774  
    66Requires at least: 2.9 
    77Tested up to: 3.3.1 
    8 Stable tag: 2.1.9 
     8Stable tag: 2.1.10 
    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.  
     
    117117 
    118118== Changelog == 
     119 
     120= Version 2.1.10 04/05/2012 = 
     121- Recoded the token renewal code to handle Facebook returning null values  
     122- Added jpe in the list of recognised image files. 
     123 
    119124 
    120125= Version 2.1.9 02/05/2012 = 
  • wordbooker/tags/2.1.10/wordbooker.php

    r539162 r539774  
    66Author: Steve Atty  
    77Author URI: http://wordbooker.tty.org.uk 
    8 Version: 2.1.9 
     8Version: 2.1.10 
    99*/ 
    1010 
     
    3939define('WORDBOOKER_DEBUG', false); 
    4040define('WORDBOOKER_TESTING', false); 
    41 define('WORDBOOKER_CODE_RELEASE',"2.1.9 - Now Your Ships are Burned"); 
     41define('WORDBOOKER_CODE_RELEASE',"2.1.10 - Far Beyond The Sun"); 
    4242 
    4343# For Troubleshooting  
     
    734734 
    735735function wordbooker_render_errorlogs() { 
     736    wordbooker_renew_access_token(); 
    736737    global $user_ID, $wpdb,$blog_id; 
    737738    $diaglevel=wordbooker_get_option('wordbooker_advanced_diagnostics_level'); 
     
    917918} 
    918919 
    919 function wordbooker_renew_access_token ($userid=null) { 
     920function wordbooker_renew_access_token($userid=null) { 
    920921    global $wpdb,$user_ID,$wbooker_user_id; 
    921922    if(is_null($userid)){$userid=$user_ID;} 
     
    926927    foreach($result as $user_row){ 
    927928        if ($user_row->updated==$today) { 
    928         wordbooker_debugger("Access token already updated today"," ",-1,99) ;  
    929         } else { 
    930         try { 
    931             $ret_code=wordbooker_get_access_token(unserialize($user_row->access_token)); 
    932         }    
    933         catch (Exception $e) { 
    934             $error_code = $e->getCode(); 
    935             $error_msg = $e->getMessage(); 
    936             wordbooker_debugger("Access token refresh failed   ".$error_msg,$error_code,$post_id,-1,99) ; 
    937         } 
    938         $x=split('&',$ret_code); 
    939         $x=split('=',$x[0]); 
    940         $access_token=$x[1]; 
    941         $sql= "Update " . WORDBOOKER_USERDATA . " set access_token = '" . serialize($access_token) . "', updated=".$today." where user_id=".$userid; 
    942         $result = $wpdb->query($sql); 
    943         wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-1,99) ; 
    944         wordbooker_debugger("Access token is now ",$access_token,-1,99) ; 
    945         wordbooker_debugger("Access token updated"," ",-1,99) ; 
     929            wordbooker_debugger("Access token already updated today"," ",-1,99) ;  
     930            } else { 
     931            try { 
     932                $ret_code=wordbooker_get_access_token(unserialize($user_row->access_token)); 
     933            }    
     934            catch (Exception $e) { 
     935                $error_code = $e->getCode(); 
     936                $error_msg = $e->getMessage(); 
     937                wordbooker_debugger("Access token refresh failed   ".$error_msg,$error_code,-1,99) ; 
     938            }    
     939        #   var_dump($user_ID); 
     940            $x=split('&',$ret_code); 
     941            $x=split('=',$x[0]); 
     942            $access_token=$x[1]; 
     943            if (strlen($access_token) > 15) { 
     944                $sql= "Update " . WORDBOOKER_USERDATA . " set access_token = '" . serialize($access_token) . "', updated=".$today." where user_id=".$userid; 
     945                $result = $wpdb->query($sql); 
     946                wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-1,99) ; 
     947                wordbooker_debugger("Access token is now ",$access_token,-1,99) ; 
     948                wordbooker_debugger("Access token updated"," ",-1,99) ; 
     949            } 
    946950        } 
    947951    } 
     
    10001004<?php 
    10011005    $access_token=get_check_session(); 
    1002     $loginUrl2='https://www.facebook.com/dialog/oauth?client_id='.WORDBOOKER_FB_ID.'&redirect_uri=https://wordbooker.tty.org.uk/index2.html?br='.urlencode(get_bloginfo('wpurl').'&fbid='.WORDBOOKER_FB_ID).'&scope=publish_actions,publish_stream,offline_access,user_status,read_stream,email,user_groups,manage_pages,read_friendlists&response_type=token'; 
     1006    $loginUrl2='https://www.facebook.com/dialog/oauth?client_id='.WORDBOOKER_FB_ID.'&redirect_uri=https://wordbooker.tty.org.uk/index2.html?br='.urlencode(get_bloginfo('wpurl').'&fbid='.WORDBOOKER_FB_ID).'&scope=publish_actions,publish_stream,user_status,read_stream,email,user_groups,manage_pages,read_friendlists&response_type=token'; 
    10031007 
    10041008    if ( is_null($access_token) ) { 
     
    10661070    echo '</form> </div>'; 
    10671071 
    1068     wordbooker_renew_access_token(); 
    10691072    $description=__("Recent Facebook Activity for this site", 'wordbooker'); 
    10701073 
     
    16231626    global $post; 
    16241627    $newimages = array(); 
    1625     $image_types= array ('jpg','jpeg','gif','png','tif','bmp'); 
     1628    $image_types= array ('jpg','jpeg','gif','png','tif','bmp','jpe'); 
    16261629    $strip_array= array ('addthis.com','gravatar.com','zemanta.com','wp-includes','plugins','favicon.ico','facebook.com','themes','mu-plugins','fbcdn.net'); 
    16271630    foreach($images as $single){ 
  • wordbooker/trunk/readme.txt

    r539162 r539774  
    66Requires at least: 2.9 
    77Tested up to: 3.3.1 
    8 Stable tag: 2.1.9 
     8Stable tag: 2.1.10 
    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.  
     
    117117 
    118118== Changelog == 
     119 
     120= Version 2.1.10 04/05/2012 = 
     121- Recoded the token renewal code to handle Facebook returning null values  
     122- Added jpe in the list of recognised image files. 
     123 
    119124 
    120125= Version 2.1.9 02/05/2012 = 
  • wordbooker/trunk/wordbooker.php

    r539162 r539774  
    66Author: Steve Atty  
    77Author URI: http://wordbooker.tty.org.uk 
    8 Version: 2.1.9 
     8Version: 2.1.10 
    99*/ 
    1010 
     
    3939define('WORDBOOKER_DEBUG', false); 
    4040define('WORDBOOKER_TESTING', false); 
    41 define('WORDBOOKER_CODE_RELEASE',"2.1.9 - Now Your Ships are Burned"); 
     41define('WORDBOOKER_CODE_RELEASE',"2.1.10 - Far Beyond The Sun"); 
    4242 
    4343# For Troubleshooting  
     
    734734 
    735735function wordbooker_render_errorlogs() { 
     736    wordbooker_renew_access_token(); 
    736737    global $user_ID, $wpdb,$blog_id; 
    737738    $diaglevel=wordbooker_get_option('wordbooker_advanced_diagnostics_level'); 
     
    917918} 
    918919 
    919 function wordbooker_renew_access_token ($userid=null) { 
     920function wordbooker_renew_access_token($userid=null) { 
    920921    global $wpdb,$user_ID,$wbooker_user_id; 
    921922    if(is_null($userid)){$userid=$user_ID;} 
     
    926927    foreach($result as $user_row){ 
    927928        if ($user_row->updated==$today) { 
    928         wordbooker_debugger("Access token already updated today"," ",-1,99) ;  
    929         } else { 
    930         try { 
    931             $ret_code=wordbooker_get_access_token(unserialize($user_row->access_token)); 
    932         }    
    933         catch (Exception $e) { 
    934             $error_code = $e->getCode(); 
    935             $error_msg = $e->getMessage(); 
    936             wordbooker_debugger("Access token refresh failed   ".$error_msg,$error_code,$post_id,-1,99) ; 
    937         } 
    938         $x=split('&',$ret_code); 
    939         $x=split('=',$x[0]); 
    940         $access_token=$x[1]; 
    941         $sql= "Update " . WORDBOOKER_USERDATA . " set access_token = '" . serialize($access_token) . "', updated=".$today." where user_id=".$userid; 
    942         $result = $wpdb->query($sql); 
    943         wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-1,99) ; 
    944         wordbooker_debugger("Access token is now ",$access_token,-1,99) ; 
    945         wordbooker_debugger("Access token updated"," ",-1,99) ; 
     929            wordbooker_debugger("Access token already updated today"," ",-1,99) ;  
     930            } else { 
     931            try { 
     932                $ret_code=wordbooker_get_access_token(unserialize($user_row->access_token)); 
     933            }    
     934            catch (Exception $e) { 
     935                $error_code = $e->getCode(); 
     936                $error_msg = $e->getMessage(); 
     937                wordbooker_debugger("Access token refresh failed   ".$error_msg,$error_code,-1,99) ; 
     938            }    
     939        #   var_dump($user_ID); 
     940            $x=split('&',$ret_code); 
     941            $x=split('=',$x[0]); 
     942            $access_token=$x[1]; 
     943            if (strlen($access_token) > 15) { 
     944                $sql= "Update " . WORDBOOKER_USERDATA . " set access_token = '" . serialize($access_token) . "', updated=".$today." where user_id=".$userid; 
     945                $result = $wpdb->query($sql); 
     946                wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-1,99) ; 
     947                wordbooker_debugger("Access token is now ",$access_token,-1,99) ; 
     948                wordbooker_debugger("Access token updated"," ",-1,99) ; 
     949            } 
    946950        } 
    947951    } 
     
    10001004<?php 
    10011005    $access_token=get_check_session(); 
    1002     $loginUrl2='https://www.facebook.com/dialog/oauth?client_id='.WORDBOOKER_FB_ID.'&redirect_uri=https://wordbooker.tty.org.uk/index2.html?br='.urlencode(get_bloginfo('wpurl').'&fbid='.WORDBOOKER_FB_ID).'&scope=publish_actions,publish_stream,offline_access,user_status,read_stream,email,user_groups,manage_pages,read_friendlists&response_type=token'; 
     1006    $loginUrl2='https://www.facebook.com/dialog/oauth?client_id='.WORDBOOKER_FB_ID.'&redirect_uri=https://wordbooker.tty.org.uk/index2.html?br='.urlencode(get_bloginfo('wpurl').'&fbid='.WORDBOOKER_FB_ID).'&scope=publish_actions,publish_stream,user_status,read_stream,email,user_groups,manage_pages,read_friendlists&response_type=token'; 
    10031007 
    10041008    if ( is_null($access_token) ) { 
     
    10661070    echo '</form> </div>'; 
    10671071 
    1068     wordbooker_renew_access_token(); 
    10691072    $description=__("Recent Facebook Activity for this site", 'wordbooker'); 
    10701073 
     
    16231626    global $post; 
    16241627    $newimages = array(); 
    1625     $image_types= array ('jpg','jpeg','gif','png','tif','bmp'); 
     1628    $image_types= array ('jpg','jpeg','gif','png','tif','bmp','jpe'); 
    16261629    $strip_array= array ('addthis.com','gravatar.com','zemanta.com','wp-includes','plugins','favicon.ico','facebook.com','themes','mu-plugins','fbcdn.net'); 
    16271630    foreach($images as $single){ 
Note: See TracChangeset for help on using the changeset viewer.