Plugin Directory

Changeset 739997


Ignore:
Timestamp:
07/12/2013 07:22:52 PM (13 years ago)
Author:
bit.ly
Message:

new error for bad connect versus bad token

Location:
bitly/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bitly/trunk/bitly.php

    r735688 r739997  
    367367        $info = $bitly->userInfo();
    368368       
    369         if ( isset($info['login']) )
    370         {
    371             $validKey = true;
    372         }
    373         else
    374         {
    375             $validKey = false;
    376         }
    377     }
    378    
     369        if ($info == false)
     370            {
     371                $validKey = false;
     372                $noConnection = true;
     373            }
     374        else   
     375            {
     376                if ( isset($info['login']) )
     377                {
     378                    $validKey = true;
     379                    $noConnection = false;
     380
     381                }
     382                else
     383                {
     384                    $validKey = false;
     385                    $noConnection = false;
     386                }
     387            }
     388    }
     389       
    379390
    380391?>
     
    403414                    <th><label for="bitly_settings-oauthToken"><?php _e( 'OAuth Token', 'bitly' ); ?></label></th>
    404415                    <td>
    405                         <?php if (isset($validKey) && !$validKey) { echo "<span style='color:red;'><strong>Invalid OAuth Token:</strong> Please verify that you have entered your Bitly OAuth token correctly.</span><br>"; } ?>
     416                        <?php if (isset($validKey) && !$validKey && !$noConnection) { echo "<span style='color:red;'><strong>Invalid OAuth Token:</strong> Please verify that you have entered your Bitly OAuth token correctly.</span><br>"; } ?>
     417                        <?php if (isset($validKey) && $noConnection) { echo "<span style='color:red;'><strong>Your Wordpress installation cannot connect to the Bitly API.  Please make sure you host allows 3rd party connections.</span><br>"; } ?>
    406418                        <input id="bitly_settings-oauthToken" name="bitly_settings[oauthToken]" type="text"
    407419                            value="<?php echo bitly_settings( 'oauthToken' ); ?>" />
  • bitly/trunk/lib/BitlyService.php

    r735688 r739997  
    208208        error_log(print_r($json['data'], true));
    209209           
    210         return $json['data'];
     210        return $json;
    211211    }
    212212
     
    291291            if ( 200 == $response['status_code'] && 'OK' == $response['status_txt'] )
    292292                return $response;
     293            if ($service == 'user/info')
     294                return $response;
    293295               
    294296        }
  • bitly/trunk/readme.txt

    r737794 r739997  
    4848Spun
    4949
    50 = How does the plugin handle previously created posts =
     50= How does the plugin handle previously created posts? =
    5151
    5252Posts that were created prior to installing the plugin will only get a bitly short link when someone actually visits the old post.  This will result in old posts showing up in your public bitly bitmark stream (https://bitly.com/u/BITLYUSERNAME) unless you have set your default bitmark privacy settings to "Private" at https://bitly.com/a/settings/saving 
Note: See TracChangeset for help on using the changeset viewer.