Rotating Tweets (Twitter widget and shortcode) - Version 1.6.4

Version Description

  • Add option to shorten default link length to 20 characters. Language update including new German translation. Bug fix.

=

Download this release

Release Info

Developer mpntod
Plugin Icon wp plugin Rotating Tweets (Twitter widget and shortcode)
Version 1.6.4
Comparing to
See all releases

Code changes from version 1.6.3 to 1.6.4

Files changed (2) hide show
  1. readme.txt +8 -5
  2. rotatingtweets.php +7 -3
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: mpntod
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9XCNM4QSVHYT8
4
  Tags: shortcode,widget,twitter,rotating,rotate,rotator,tweet,tweets,animation,jquery,jquery cycle,cycle,multilingual,responsive
5
  Requires at least: 2.6
6
- Tested up to: 3.6
7
- Stable tag: 1.6.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -162,12 +162,15 @@ into your CSS - changing `123px;` to the width you're aiming at - either via put
162
  You can do this by going to the `rotatingtweets/css` directory and renaming `rotatingtweets-sample.css` to `rotatingtweets.css` and putting it in the `wp-content/uploads/` directory. This displays a Twitter bird to the left of your tweets. Any CSS you put into `rotatingtweets.css` won't be overwritten when the plug-in is upgraded to the latest version.
163
 
164
  == Upgrade notice ==
165
- = 1.6.3 =
166
- * Add option to shortern default link length to 20 characters. Language update including new German translation.
167
 
168
  == Changelog ==
 
 
 
169
  = 1.6.3 =
170
- * Add option to shortern default link length to 20 characters
171
  * Language update including new German translation from Nils Kroneberg
172
  * Updated Brazilian Portuguese translation from Wilmerson Felipe
173
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9XCNM4QSVHYT8
4
  Tags: shortcode,widget,twitter,rotating,rotate,rotator,tweet,tweets,animation,jquery,jquery cycle,cycle,multilingual,responsive
5
  Requires at least: 2.6
6
+ Tested up to: 3.7
7
+ Stable tag: 1.6.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
162
  You can do this by going to the `rotatingtweets/css` directory and renaming `rotatingtweets-sample.css` to `rotatingtweets.css` and putting it in the `wp-content/uploads/` directory. This displays a Twitter bird to the left of your tweets. Any CSS you put into `rotatingtweets.css` won't be overwritten when the plug-in is upgraded to the latest version.
163
 
164
  == Upgrade notice ==
165
+ = 1.6.4 =
166
+ * Add option to shorten default link length to 20 characters. Language update including new German translation. Bug fix.
167
 
168
  == Changelog ==
169
+ = 1.6.4 =
170
+ * Bug fix when user name not recognised.
171
+
172
  = 1.6.3 =
173
+ * Add option to shorten default link length to 20 characters
174
  * Language update including new German translation from Nils Kroneberg
175
  * Updated Brazilian Portuguese translation from Wilmerson Felipe
176
 
rotatingtweets.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Rotating Tweets (Twitter widget & shortcode)
4
  Description: Replaces a shortcode such as [rotatingtweets screen_name='your_twitter_name'], or a widget, with a rotating tweets display
5
- Version: 1.6.3
6
  Text Domain: rotatingtweets
7
  Author: Martin Tod
8
  Author URI: http://www.martintod.org.uk
@@ -997,7 +997,7 @@ function rotatingtweets_get_tweets($tw_screen_name,$tw_include_rts,$tw_exclude_r
997
  if(!empty($twitterjson['errors'])):
998
  # If there's an error, reset the cache timer to make sure we don't hit Twitter too hard and get rate limited.
999
  // print_r($twitterjson);
1000
- if( $twitterjson['errors'][0]['type'] == 'Twitter' && $twitterjson['errors'][0]['code'] == 88 ):
1001
  $rate = rotatingtweets_get_rate_data();
1002
  if($rate && $rate['remaining_hits'] == 0):
1003
  $option[$stringname]['datetime']= $rate['reset_time_in_seconds'] - $cache_delay + 1;
@@ -1236,8 +1236,8 @@ function rotating_tweets_display($json,$args,$print=TRUE) {
1236
  case 88:
1237
  $rate = rotatingtweets_get_rate_data();
1238
  # Check if the problem is rate limiting
 
1239
  if(isset($rate['hourly_limit']) && $rate['hourly_limit']>0 && $rate['remaining_hits'] == 0):
1240
- $result .= "\n\t<div class = 'rotatingtweet' style='display:none'><p class='rtw_main'>". sprintf(__('This website is currently <a href=\'%s\'>rate-limited by Twitter</a>.','rotatingtweets'),'https://dev.twitter.com/docs/rate-limiting-faq') . "</p></div>";
1241
  $waittimevalue = intval(($rate['reset_time_in_seconds'] - time())/60);
1242
  $waittime = sprintf(_n('Next attempt to get data will be in %d minute','Next attempt to get data will be in %d minutes',$waittimevalue,'rotatingtweets'),$waittimevalue);
1243
  if($waittimevalue == 0) $waittime = __("Next attempt to get data will be in less than a minute",'rotatingtweets');
@@ -1284,6 +1284,10 @@ function rotating_tweets_display($json,$args,$print=TRUE) {
1284
  } else {
1285
  $targetvalue = '';
1286
  }
 
 
 
 
1287
  foreach($json as $twitter_object):
1288
  if ( ! ( ($args['exclude_replies'] && isset($twitter_object['text']) && substr($twitter_object['text'],0,1)=='@') || (!$args['include_rts'] && isset($twitter_object['retweeted_status'])) ) ):
1289
  // if (! ($args['exclude_replies'] && isset($twitter_object['text']) && substr($twitter_object['text'],0,1)=='@')): // This works to exlude replies
2
  /*
3
  Plugin Name: Rotating Tweets (Twitter widget & shortcode)
4
  Description: Replaces a shortcode such as [rotatingtweets screen_name='your_twitter_name'], or a widget, with a rotating tweets display
5
+ Version: 1.6.4
6
  Text Domain: rotatingtweets
7
  Author: Martin Tod
8
  Author URI: http://www.martintod.org.uk
997
  if(!empty($twitterjson['errors'])):
998
  # If there's an error, reset the cache timer to make sure we don't hit Twitter too hard and get rate limited.
999
  // print_r($twitterjson);
1000
+ if( $twitterjson['errors'][0]['code'] == 88 ):
1001
  $rate = rotatingtweets_get_rate_data();
1002
  if($rate && $rate['remaining_hits'] == 0):
1003
  $option[$stringname]['datetime']= $rate['reset_time_in_seconds'] - $cache_delay + 1;
1236
  case 88:
1237
  $rate = rotatingtweets_get_rate_data();
1238
  # Check if the problem is rate limiting
1239
+ $result .= "\n\t<div class = 'rotatingtweet' style='display:none'><p class='rtw_main'>". sprintf(__('This website is currently <a href=\'%s\'>rate-limited by Twitter</a>.','rotatingtweets'),'https://dev.twitter.com/docs/rate-limiting-faq') . "</p></div>";
1240
  if(isset($rate['hourly_limit']) && $rate['hourly_limit']>0 && $rate['remaining_hits'] == 0):
 
1241
  $waittimevalue = intval(($rate['reset_time_in_seconds'] - time())/60);
1242
  $waittime = sprintf(_n('Next attempt to get data will be in %d minute','Next attempt to get data will be in %d minutes',$waittimevalue,'rotatingtweets'),$waittimevalue);
1243
  if($waittimevalue == 0) $waittime = __("Next attempt to get data will be in less than a minute",'rotatingtweets');
1284
  } else {
1285
  $targetvalue = '';
1286
  }
1287
+ if(count($json)==1):
1288
+ $firstelement = reset($json);
1289
+ $json[] = $firstelement;
1290
+ endif;
1291
  foreach($json as $twitter_object):
1292
  if ( ! ( ($args['exclude_replies'] && isset($twitter_object['text']) && substr($twitter_object['text'],0,1)=='@') || (!$args['include_rts'] && isset($twitter_object['retweeted_status'])) ) ):
1293
  // if (! ($args['exclude_replies'] && isset($twitter_object['text']) && substr($twitter_object['text'],0,1)=='@')): // This works to exlude replies