Rotating Tweets (Twitter widget and shortcode) - Version 1.9.8

Version Description

  • Fixes problem with Twitter intents for users with a high number user ID

=

Download this release

Release Info

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

Code changes from version 1.9.7 to 1.9.8

Files changed (2) hide show
  1. readme.txt +9 -6
  2. rotatingtweets.php +7 -7
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,page builder,do not track,dnt
5
  Requires at least: 3.2
6
- Tested up to: 4.9
7
- Stable tag: 1.9.7
8
  Requires PHP: 5.2.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -20,8 +20,8 @@ Twitter widget and shortcode to show your latest tweets one at a time an animate
20
  * **Reliable** - keeps showing your latest Tweets even if the Twitter website is down.
21
  * **Customizable** - you decide whose tweets to show, how many to show, whether to include retweets and replies, and whether to show a follow button. You can also decide how quickly the tweets rotate and what type of animation to use.
22
  * **Responsive** - resizes as your page resizes
23
- * **GDPR compliant ** - with default settings, collects no user data and shares no user data (including IP addresses) with anyone else. Supports 'Do Not Track' (DNT).
24
- * Gives you the option to show a fully customizable Twitter 'follow' button. *For note, because of the way Twitter's code for the Twitter button works, use of this button currently means that site visitors who have not set 'Do Not Track' will have their visit tracked by Twitter.*
25
  * Replaces [t.co](http://t.co) links with the original link
26
  * Caches the most recent data from Twitter to avoid problems with rate limiting
27
  * Uses [jQuery](http://jquery.com/), [jQuery.Cycle](http://jquery.malsup.com/cycle/) and [jQuery.Cycle2](http://jquery.malsup.com/cycle2/) to produce a nice smooth result.
@@ -192,10 +192,13 @@ into your CSS - changing `123px;` to the width you're aiming at - either via [ad
192
  You can do this by going to the `rotatingtweets/css` directory, opening `rotatingtweets-sample.css` and copying its contents (modifying the link to the bird graphic to match your site) into [additional CSS](https://codex.wordpress.org/CSS#Custom_CSS_in_WordPress) (the preferred approach from Wordpress 4.7 onwards) on the [Appearance Customize Screen](https://codex.wordpress.org/Appearance_Customize_Screen) page. Alternatively rename `rotatingtweets-sample.css` to `rotatingtweets.css` and put it in the `wp-content/uploads/` directory. Or copy the CSS into your own template files. Any of these approaches will display a Twitter bird to the left of your tweets.
193
 
194
  == Upgrade notice ==
195
- = 1.9.7 =
196
- * Fixes display bug where a Tweet contains two copies of the same URL.
197
 
198
  == Changelog ==
 
 
 
199
  = 1.9.7 =
200
  * Fixes display bug where a Tweet contains two copies of the same URL.
201
 
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,page builder,do not track,dnt
5
  Requires at least: 3.2
6
+ Tested up to: 5.0
7
+ Stable tag: 1.9.8
8
  Requires PHP: 5.2.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
20
  * **Reliable** - keeps showing your latest Tweets even if the Twitter website is down.
21
  * **Customizable** - you decide whose tweets to show, how many to show, whether to include retweets and replies, and whether to show a follow button. You can also decide how quickly the tweets rotate and what type of animation to use.
22
  * **Responsive** - resizes as your page resizes
23
+ * **GDPR-friendly** - with default settings, collects no user data and shares no user data (including IP addresses) with anyone else. Supports 'Do Not Track' (DNT).
24
+ * Gives you the option to show a fully customizable Twitter 'follow' button. *For note, because of the way Twitter's code for the Twitter button works, the button will display as a regular text link to site visitors who have set 'Do Not Track'.*
25
  * Replaces [t.co](http://t.co) links with the original link
26
  * Caches the most recent data from Twitter to avoid problems with rate limiting
27
  * Uses [jQuery](http://jquery.com/), [jQuery.Cycle](http://jquery.malsup.com/cycle/) and [jQuery.Cycle2](http://jquery.malsup.com/cycle2/) to produce a nice smooth result.
192
  You can do this by going to the `rotatingtweets/css` directory, opening `rotatingtweets-sample.css` and copying its contents (modifying the link to the bird graphic to match your site) into [additional CSS](https://codex.wordpress.org/CSS#Custom_CSS_in_WordPress) (the preferred approach from Wordpress 4.7 onwards) on the [Appearance Customize Screen](https://codex.wordpress.org/Appearance_Customize_Screen) page. Alternatively rename `rotatingtweets-sample.css` to `rotatingtweets.css` and put it in the `wp-content/uploads/` directory. Or copy the CSS into your own template files. Any of these approaches will display a Twitter bird to the left of your tweets.
193
 
194
  == Upgrade notice ==
195
+ = 1.9.8 =
196
+ * Fixes problem with Twitter intents for users with a high number user ID
197
 
198
  == Changelog ==
199
+ = 1.9.8 =
200
+ * Fixes problem with Twitter intents for users with a high number user ID
201
+
202
  = 1.9.7 =
203
  * Fixes display bug where a Tweet contains two copies of the same URL.
204
 
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.9.7
6
  Text Domain: rotatingtweets
7
  Domain Path: /languages
8
  Author: Martin Tod
@@ -453,7 +453,7 @@ function rotatingtweets_intents($twitter_object,$lang, $icons = 1,$targetvalue='
453
  // Produces a link to someone's name, icon or screen name (or to the text of your choice) using the 'intent' format for linking
454
  function rotatingtweets_user_intent($person,$lang,$linkcontent,$targetvalue='',$iconsize='normal') {
455
  if(!is_array($person)) return;
456
- $return = "<a href='https://twitter.com/intent/user?user_id={$person['id']}' title='".esc_attr($person['name'])."' lang='{$lang}'{$targetvalue}>";
457
  switch($linkcontent){
458
  case 'icon':
459
  $before = '_normal.';
@@ -483,7 +483,7 @@ function rotatingtweets_user_intent($person,$lang,$linkcontent,$targetvalue='',$
483
  $return .= "@".$person['screen_name']."</a>";
484
  break;
485
  case 'blue_bird':
486
- $return = "<a href='https://twitter.com/intent/user?user_id={$person['id']}' title='".esc_attr(sprintf(__('Follow @%s','rotatingtweets'),$person['name']))."' lang='{$lang}'{$targetvalue}>";
487
  $return .= '<img src="'.plugin_dir_url( __FILE__ ).'images/bird_blue_32.png" class="twitter_icon" alt="'.__('Twitter','rotatingtweets').'" /></a>';
488
  break;
489
  default:
@@ -2007,7 +2007,7 @@ function rotating_tweets_display($json,$args,$print=FALSE) {
2007
  else:
2008
  $screennamecount = 1;
2009
  endif;
2010
- $meta .= sprintf(_n('from <a href=\'%1$s\' title=\'%2$s\'>%2$s\'s Twitter</a>','from <a href=\'%1$s\' title=\'%2$s\'>%2$s\' Twitter</a>',$screennamecount,'rotatingtweets'),'https://twitter.com/intent/user?user_id='.$user['id'],$user['name']);
2011
  endif;
2012
  if($args['show_meta_via']):
2013
  if(!empty($meta)) $meta .= ' ';
@@ -2136,7 +2136,7 @@ function rotating_tweets_display($json,$args,$print=FALSE) {
2136
  else:
2137
  $screennamecount = 1;
2138
  endif;
2139
- $meta .= sprintf(_n('from <a href=\'%1$s\' title=\'%2$s\'>%2$s\'s Twitter</a>','from <a href=\'%1$s\' title=\'%2$s\'>%2$s\' Twitter</a>',$screennamecount,'rotatingtweets'),'https://twitter.com/intent/user?user_id='.$user['id'],$user['name']);
2140
  endif;
2141
  $result .= rotatingtweets_timestamp_link($twitter_object,'long',$targetvalue);
2142
  if(isset($args['show_meta_prev_next']) && $args['show_meta_prev_next'] && $args['np_pos']=='tweets'):
@@ -2158,7 +2158,7 @@ function rotating_tweets_display($json,$args,$print=FALSE) {
2158
  else:
2159
  $screennamecount = 1;
2160
  endif;
2161
- $meta .= sprintf(_n('from <a href=\'%1$s\' title=\'%2$s\'>%2$s\'s Twitter</a>','from <a href=\'%1$s\' title=\'%2$s\'>%2$s\' Twitter</a>',$screennamecount,'rotatingtweets'),'https://twitter.com/intent/user?user_id='.$user['id'],$user['name']);
2162
  endif;
2163
  if($args['show_meta_via']):
2164
  if(!empty($meta)) $meta .= ' ';
@@ -2188,7 +2188,7 @@ function rotating_tweets_display($json,$args,$print=FALSE) {
2188
  else:
2189
  $screennamecount = 1;
2190
  endif;
2191
- $meta .= sprintf(_n('from <a href=\'%1$s\' title=\'%2$s\'>%2$s\'s Twitter</a>','from <a href=\'%1$s\' title=\'%2$s\'>%2$s\' Twitter</a>',$screennamecount,'rotatingtweets'),'https://twitter.com/intent/user?user_id='.$user['id'],$user['name']);
2192
  endif;
2193
  if($args['show_meta_via']):
2194
  if(!empty($meta)) $meta .= ' ';
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.9.8
6
  Text Domain: rotatingtweets
7
  Domain Path: /languages
8
  Author: Martin Tod
453
  // Produces a link to someone's name, icon or screen name (or to the text of your choice) using the 'intent' format for linking
454
  function rotatingtweets_user_intent($person,$lang,$linkcontent,$targetvalue='',$iconsize='normal') {
455
  if(!is_array($person)) return;
456
+ $return = "<a href='https://twitter.com/intent/user?screen_name=".urlencode($person['screen_name'])."' title='".esc_attr($person['name'])."' lang='{$lang}'{$targetvalue}>";
457
  switch($linkcontent){
458
  case 'icon':
459
  $before = '_normal.';
483
  $return .= "@".$person['screen_name']."</a>";
484
  break;
485
  case 'blue_bird':
486
+ $return = "<a href='https://twitter.com/intent/user?screen_name=".urlencode($person['screen_name'])."' title='".esc_attr(sprintf(__('Follow @%s','rotatingtweets'),$person['name']))."' lang='{$lang}'{$targetvalue}>";
487
  $return .= '<img src="'.plugin_dir_url( __FILE__ ).'images/bird_blue_32.png" class="twitter_icon" alt="'.__('Twitter','rotatingtweets').'" /></a>';
488
  break;
489
  default:
2007
  else:
2008
  $screennamecount = 1;
2009
  endif;
2010
+ $meta .= sprintf(_n('from <a href=\'%1$s\' title=\'%2$s\'>%2$s\'s Twitter</a>','from <a href=\'%1$s\' title=\'%2$s\'>%2$s\' Twitter</a>',$screennamecount,'rotatingtweets'),'https://twitter.com/intent/user?screen_name='.urlencode($user['screen_name']),$user['name']);
2011
  endif;
2012
  if($args['show_meta_via']):
2013
  if(!empty($meta)) $meta .= ' ';
2136
  else:
2137
  $screennamecount = 1;
2138
  endif;
2139
+ $meta .= sprintf(_n('from <a href=\'%1$s\' title=\'%2$s\'>%2$s\'s Twitter</a>','from <a href=\'%1$s\' title=\'%2$s\'>%2$s\' Twitter</a>',$screennamecount,'rotatingtweets'),'https://twitter.com/intent/user?screen_name='.urlencode($user['screen_name']),$user['name']);
2140
  endif;
2141
  $result .= rotatingtweets_timestamp_link($twitter_object,'long',$targetvalue);
2142
  if(isset($args['show_meta_prev_next']) && $args['show_meta_prev_next'] && $args['np_pos']=='tweets'):
2158
  else:
2159
  $screennamecount = 1;
2160
  endif;
2161
+ $meta .= sprintf(_n('from <a href=\'%1$s\' title=\'%2$s\'>%2$s\'s Twitter</a>','from <a href=\'%1$s\' title=\'%2$s\'>%2$s\' Twitter</a>',$screennamecount,'rotatingtweets'),'https://twitter.com/intent/user?screen_name='.urlencode($user['screen_name']),$user['name']);
2162
  endif;
2163
  if($args['show_meta_via']):
2164
  if(!empty($meta)) $meta .= ' ';
2188
  else:
2189
  $screennamecount = 1;
2190
  endif;
2191
+ $meta .= sprintf(_n('from <a href=\'%1$s\' title=\'%2$s\'>%2$s\'s Twitter</a>','from <a href=\'%1$s\' title=\'%2$s\'>%2$s\' Twitter</a>',$screennamecount,'rotatingtweets'),'https://twitter.com/intent/user?screen_name='.urlencode($user['screen_name']),$user['name']);
2192
  endif;
2193
  if($args['show_meta_via']):
2194
  if(!empty($meta)) $meta .= ' ';