Rotating Tweets (Twitter widget and shortcode) - Version 1.9.4

Version Description

  • Fixed compatibility bug with PHP 7.2

=

Download this release

Release Info

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

Code changes from version 1.9.3 to 1.9.4

Files changed (3) hide show
  1. css/rotatingtweets-sample.css +11 -4
  2. readme.txt +9 -6
  3. rotatingtweets.php +16 -7
css/rotatingtweets-sample.css CHANGED
@@ -1,8 +1,15 @@
1
- /* Rename this file to rotatingtweets.css and upload it to /wp-content/uploads/rotatingtweets.css and it will automatically be included in the rotatingtweets CSS by the plug in */
2
- /* It shouldn't be overwritten when the plug-in is upgraded! */
3
- /* This particular CSS makes a bird appear to the left of your tweets - you can find more birds at https://dev.twitter.com/docs/image-resources */
 
 
 
 
 
 
4
  div.rotatingtweets_format_0 p.rtw_main {
5
- background-image: url('../plugins/rotatingtweets/images/bird_blue_32.png');
 
6
  background-repeat:no-repeat;
7
  background-position:0 7px;
8
  padding-left: 38px;
1
+ /*
2
+ The easiest way to have special CSS for Rotating Tweets is to use additional CSS - as per https://codex.wordpress.org/CSS#Custom_CSS_in_WordPress
3
+
4
+ If you want to use the approach that Rotating Tweets used before additional CSS was available, rename this file to rotatingtweets.css and upload it to /wp-content/uploads/rotatingtweets.css and it will automatically be included in the rotatingtweets CSS by the plug in - and won't be overwritten when the plug-in is upgraded!
5
+
6
+ This particular CSS makes a bird appear to the left of your tweets - you can find more birds at https://about.twitter.com/en_gb/company/brand-resources.html
7
+
8
+ */
9
+
10
  div.rotatingtweets_format_0 p.rtw_main {
11
+ /* The line below will need to be changed to background-image: url('/wp-content/plugins/rotatingtweets/images/bird_blue_32.png'); if you use 'additional CSS' */
12
+ background-image: url('../plugins/rotatingtweets/images/bird_blue_32.png');
13
  background-repeat:no-repeat;
14
  background-position:0 7px;
15
  padding-left: 38px;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
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.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -25,7 +25,7 @@ Twitter widget and shortcode to show your latest tweets one at a time an animate
25
  * 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.
26
  * Compatible with [W3 Total Cache](/plugins/w3-total-cache/).
27
  * Supports Do Not Track (DNT)
28
- * **Multi-lingual** - now set up to be multi-lingual. The Twitter 'follow' button is automatically translated to match your site's language setting [if Twitter has made the appropriate language available](https://dev.twitter.com/docs/api/1.1/get/help/languages). Also uses [Wordpress's multi-lingual capability](http://codex.wordpress.org/I18n_for_WordPress_Developers) to enable translation of all the other text used by the plug-in via [language packs](https://translate.wordpress.org/projects/wp-plugins/rotatingtweets).
29
 
30
  If you'd like to see what the plug-in looks like in action, you can [see the plug-in working here](http://www.martintod.org.uk/2012/05/29/new-twitter-plugin-to-show-tweets-in-rotation/).
31
 
@@ -182,16 +182,19 @@ div.widget_rotatingtweets_widget, div.rotatingtweet, div.widget_rotatingtweets_w
182
  max-width: 123px;
183
  }
184
  `
185
- into your CSS - changing `123px;` to the width you're aiming at - either via putting `rotatingtweets.css` into `wp-content/uploads` or by editing your own template files.
186
 
187
  = How can I add a Twitter bird to the left of my tweets? =
188
- 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.
189
 
190
  == Upgrade notice ==
191
- = 1.9.3 =
192
- * Fixed compatibility bug with pre-4.0 versions of Wordpress
193
 
194
  == Changelog ==
 
 
 
195
  = 1.9.3 =
196
  * Fixed compatibility bug with pre-4.0 versions of Wordpress
197
 
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.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
25
  * 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.
26
  * Compatible with [W3 Total Cache](/plugins/w3-total-cache/).
27
  * Supports Do Not Track (DNT)
28
+ * **Multi-lingual** - now set up to be multi-lingual. The Twitter 'follow' button is automatically translated to match your site's language setting [if Twitter has made the appropriate language available](https://developer.twitter.com/en/docs/developer-utilities/supported-languages/api-reference/get-help-languages). Also uses [Wordpress's multi-lingual capability](http://codex.wordpress.org/I18n_for_WordPress_Developers) to enable translation of all the other text used by the plug-in via [language packs](https://translate.wordpress.org/projects/wp-plugins/rotatingtweets).
29
 
30
  If you'd like to see what the plug-in looks like in action, you can [see the plug-in working here](http://www.martintod.org.uk/2012/05/29/new-twitter-plugin-to-show-tweets-in-rotation/).
31
 
182
  max-width: 123px;
183
  }
184
  `
185
+ into your CSS - changing `123px;` to the width you're aiming at - either via [additional CSS](https://codex.wordpress.org/CSS#Custom_CSS_in_WordPress) or by editing your own template files.
186
 
187
  = How can I add a Twitter bird to the left of my tweets? =
188
+ 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.
189
 
190
  == Upgrade notice ==
191
+ = 1.9.4 =
192
+ * Fixed compatibility bug with PHP 7.2
193
 
194
  == Changelog ==
195
+ = 1.9.4 =
196
+ * Fixed compatibility bug with PHP 7.2
197
+
198
  = 1.9.3 =
199
  * Fixed compatibility bug with pre-4.0 versions of Wordpress
200
 
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.3
6
  Text Domain: rotatingtweets
7
  Domain Path: /languages
8
  Author: Martin Tod
@@ -386,9 +386,11 @@ class rotatingtweets_Widget extends WP_Widget {
386
  } // class rotatingtweets_Widget
387
 
388
  // register rotatingtweets_Widget widget
389
- add_action('widgets_init',
390
- create_function('', 'return register_widget("rotatingtweets_Widget");')
391
- );
 
 
392
 
393
  # Converts Tweet timestamp into a time description
394
  function rotatingtweets_contextualtime($small_ts, $large_ts=false) {
@@ -1035,9 +1037,9 @@ function rotatingtweets_call_twitter_API($command,$options = NULL,$api = NULL )
1035
  }
1036
  endif;
1037
  if($command != 'search/tweets'):
1038
- $apicall = "http://api.twitter.com/1/".$command.".json";
1039
  else:
1040
- $apicall = "http://search.twitter.com/search.json";
1041
  endif;
1042
  if(!empty($string)) $apicall .= "?".implode('&',$string);
1043
  if(WP_DEBUG && ! is_admin() ) echo "<!-- Using version 1 of API - calling string ".esc_attr($apicall)." -->";
@@ -2234,7 +2236,7 @@ function rotating_tweets_display($json,$args,$print=FALSE) {
2234
  if($args['no_show_screen_name']) $shortenvariables .= ' data-show-screen-name="false"';
2235
  if(isset($args['large_follow_button']) && $args['large_follow_button']) $shortenvariables .= ' data-size="large"';
2236
  $followUserText = sprintf(__('Follow @%s','rotatingtweets'),remove_accents(str_replace('@','',$args['screen_name'])));
2237
- $result .= "\n<div class='rtw_follow follow-button'><a href='http://twitter.com/".$args['screen_name']."' class='twitter-follow-button'{$shortenvariables} title='".$followUserText."' data-lang='{$twitterlocale}'>".$followUserText."</a></div>";
2238
  endif;
2239
  rotatingtweets_enqueue_scripts();
2240
  $rt_cache_delay = max($rt_cache_delay,20);
@@ -2380,6 +2382,13 @@ function rotatingtweets_enqueue_scripts() {
2380
  'jquery-cycle2-scrollvert' => plugins_url('cyclone-slider-pro/libs/cycle2/jquery.cycle2.scrollVert.min.js'),
2381
  'rotating_tweet' => plugins_url('js/rotatingtweets_v2_cyclone.js', __FILE__)
2382
  );
 
 
 
 
 
 
 
2383
  elseif ( $style == 'digital catapult' || $style == 'digitalcatapult' ):
2384
  $rt_enqueue_script_list = array(
2385
  'jquery-cycle2' => get_template_directory_uri() . '/scripts/jquery.cycle2.min.js' ,
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.4
6
  Text Domain: rotatingtweets
7
  Domain Path: /languages
8
  Author: Martin Tod
386
  } // class rotatingtweets_Widget
387
 
388
  // register rotatingtweets_Widget widget
389
+ function rotatingtweets_register_widgets() {
390
+ register_widget( 'rotatingtweets_Widget' );
391
+ }
392
+
393
+ add_action('widgets_init', 'rotatingtweets_register_widgets');
394
 
395
  # Converts Tweet timestamp into a time description
396
  function rotatingtweets_contextualtime($small_ts, $large_ts=false) {
1037
  }
1038
  endif;
1039
  if($command != 'search/tweets'):
1040
+ $apicall = "https://api.twitter.com/1/".$command.".json";
1041
  else:
1042
+ $apicall = "https://search.twitter.com/search.json";
1043
  endif;
1044
  if(!empty($string)) $apicall .= "?".implode('&',$string);
1045
  if(WP_DEBUG && ! is_admin() ) echo "<!-- Using version 1 of API - calling string ".esc_attr($apicall)." -->";
2236
  if($args['no_show_screen_name']) $shortenvariables .= ' data-show-screen-name="false"';
2237
  if(isset($args['large_follow_button']) && $args['large_follow_button']) $shortenvariables .= ' data-size="large"';
2238
  $followUserText = sprintf(__('Follow @%s','rotatingtweets'),remove_accents(str_replace('@','',$args['screen_name'])));
2239
+ $result .= "\n<div class='rtw_follow follow-button'><a href='https://twitter.com/".$args['screen_name']."' class='twitter-follow-button'{$shortenvariables} title='".$followUserText."' data-lang='{$twitterlocale}'>".$followUserText."</a></div>";
2240
  endif;
2241
  rotatingtweets_enqueue_scripts();
2242
  $rt_cache_delay = max($rt_cache_delay,20);
2382
  'jquery-cycle2-scrollvert' => plugins_url('cyclone-slider-pro/libs/cycle2/jquery.cycle2.scrollVert.min.js'),
2383
  'rotating_tweet' => plugins_url('js/rotatingtweets_v2_cyclone.js', __FILE__)
2384
  );
2385
+ elseif ( $style == 'brilliance_pro' || $style == 'brilliance pro' ):
2386
+ $rt_enqueue_script_list = array(
2387
+ 'jquery-cycle2' => get_template_directory_uri() . '/core/scripts/jquery-cycle2-min.js' ,
2388
+ 'jquery-cycle2_scrollvert' => plugins_url('js/jquery.cycle2.scrollVert.js', __FILE__),
2389
+ 'jquery-cycle2_carousel' => plugins_url('js/jquery.cycle2.carousel.js', __FILE__),
2390
+ 'rotating_tweet' => plugins_url('js/rotatingtweets_v2_cyclone.js', __FILE__)
2391
+ );
2392
  elseif ( $style == 'digital catapult' || $style == 'digitalcatapult' ):
2393
  $rt_enqueue_script_list = array(
2394
  'jquery-cycle2' => get_template_directory_uri() . '/scripts/jquery.cycle2.min.js' ,