Plugin Directory

Changeset 751675


Ignore:
Timestamp:
08/05/2013 02:24:29 PM (13 years ago)
Author:
bit.ly
Message:

fix for seo plugins

Location:
bitly/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bitly/trunk/bitly.php

    r740000 r751675  
    102102            // custom for jetpack
    103103            if (strpos($b['file'],'sharing-service') !== false && strpos($b['file'],'jetpack') !== false && $b['function'] == 'get_display' )
     104            {
     105                $plugin_call = false;
     106                break;
     107            }
     108            else if (strpos($b['file'],'sitemap') !== false) // Don't return custom links in sitemaps
    104109            {
    105110                $plugin_call = false;
     
    255260        {
    256261            // TODO: throw error
    257             error_log("Unable to get a bit.ly link for permalink '$permalink' and post id '$post_id'!");
     262            error_log("Unable to get a bit.ly link for permalink '$permalink' and post id '$post_id'!", 0);
    258263           
    259264            return NULL;
     
    366371    {
    367372        $info = $bitly->userInfo();
    368        
    369         if ($info == false)
    370             {
    371                 $validKey = false;
    372                 $noConnection = true;
    373             }
    374         else   
    375             {
    376                 if ( isset($info['data']['login']) )
    377                 {
    378                     $validKey = true;
    379                     $noConnection = false;
    380 
    381                 }
    382                 else
    383                 {
    384                     $validKey = false;
    385                     $noConnection = false;
    386                 }
    387             }
    388     }
    389        
     373        error_log("Check if the token is valid on bitly", 0);
     374        if ( isset($info['login']) )
     375        {
     376            $validKey = true;
     377        }
     378        else
     379        {
     380            $validKey = false;
     381        }
     382    }
     383   
    390384
    391385?>
     
    414408                    <th><label for="bitly_settings-oauthToken"><?php _e( 'OAuth Token', 'bitly' ); ?></label></th>
    415409                    <td>
    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>"; } ?>
     410                        <?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>"; } ?>
    418411                        <input id="bitly_settings-oauthToken" name="bitly_settings[oauthToken]" type="text"
    419412                            value="<?php echo bitly_settings( 'oauthToken' ); ?>" />
  • bitly/trunk/lib/BitlyService.php

    r739997 r751675  
    208208        error_log(print_r($json['data'], true));
    209209           
    210         return $json;
     210        return $json['data'];
    211211    }
    212212
     
    285285        curl_close( $handle );
    286286
     287        error_log(print_r($response, true));
     288       
    287289        if ( !empty( $response ) )
    288290        {
     
    291293            if ( 200 == $response['status_code'] && 'OK' == $response['status_txt'] )
    292294                return $response;
    293             if ($service == 'user/info')
    294                 return $response;
    295295               
    296296        }
  • bitly/trunk/readme.txt

    r739997 r751675  
    5050= How does the plugin handle previously created posts? =
    5151
    52 Posts 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  
     52Posts 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.