Changeset 751675
- Timestamp:
- 08/05/2013 02:24:29 PM (13 years ago)
- Location:
- bitly/trunk
- Files:
-
- 3 edited
-
bitly.php (modified) (4 diffs)
-
lib/BitlyService.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bitly/trunk/bitly.php
r740000 r751675 102 102 // custom for jetpack 103 103 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 104 109 { 105 110 $plugin_call = false; … … 255 260 { 256 261 // 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); 258 263 259 264 return NULL; … … 366 371 { 367 372 $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 390 384 391 385 ?> … … 414 408 <th><label for="bitly_settings-oauthToken"><?php _e( 'OAuth Token', 'bitly' ); ?></label></th> 415 409 <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>"; } ?> 418 411 <input id="bitly_settings-oauthToken" name="bitly_settings[oauthToken]" type="text" 419 412 value="<?php echo bitly_settings( 'oauthToken' ); ?>" /> -
bitly/trunk/lib/BitlyService.php
r739997 r751675 208 208 error_log(print_r($json['data'], true)); 209 209 210 return $json ;210 return $json['data']; 211 211 } 212 212 … … 285 285 curl_close( $handle ); 286 286 287 error_log(print_r($response, true)); 288 287 289 if ( !empty( $response ) ) 288 290 { … … 291 293 if ( 200 == $response['status_code'] && 'OK' == $response['status_txt'] ) 292 294 return $response; 293 if ($service == 'user/info')294 return $response;295 295 296 296 } -
bitly/trunk/readme.txt
r739997 r751675 50 50 = How does the plugin handle previously created posts? = 51 51 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 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
Note: See TracChangeset
for help on using the changeset viewer.