Rotating Tweets (Twitter widget and shortcode) - Version 1.8.7

Version Description

  • Support for 'Do Not Track'. Fix minor bug with Selective Refresh.

=

Download this release

Release Info

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

Code changes from version 1.8.6 to 1.8.7

js/rotating_tweet.js CHANGED
@@ -287,20 +287,23 @@ jQuery(document).ready(function() {
287
  jQuery(this).find('.rtw_intents').hide();
288
  });
289
  });
290
- /* And call the Twitter script while we're at it! */
291
- window.twttr = (function(d, s, id) {
292
- var js, fjs = d.getElementsByTagName(s)[0],
293
- t = window.twttr || {};
294
- if (d.getElementById(id)) return t;
295
- js = d.createElement(s);
296
- js.id = id;
297
- js.src = "https://platform.twitter.com/widgets.js";
298
- fjs.parentNode.insertBefore(js, fjs);
299
-
300
- t._e = [];
301
- t.ready = function(f) {
302
- t._e.push(f);
303
- };
304
-
305
- return t;
306
- }(document, "script", "twitter-wjs"));
 
 
 
287
  jQuery(this).find('.rtw_intents').hide();
288
  });
289
  });
290
+ if(navigator.doNotTrack != 'yes' && navigator.doNotTrack != 1 && window.doNotTrack != 1 && navigator.msDoNotTrack != 1) {
291
+ // Do (or don't do) stuff.
292
+ /* And call the Twitter script while we're at it! */
293
+ window.twttr = (function(d, s, id) {
294
+ var js, fjs = d.getElementsByTagName(s)[0],
295
+ t = window.twttr || {};
296
+ if (d.getElementById(id)) return t;
297
+ js = d.createElement(s);
298
+ js.id = id;
299
+ js.src = "https://platform.twitter.com/widgets.js";
300
+ fjs.parentNode.insertBefore(js, fjs);
301
+
302
+ t._e = [];
303
+ t.ready = function(f) {
304
+ t._e.push(f);
305
+ };
306
+
307
+ return t;
308
+ }(document, "script", "twitter-wjs"));
309
+ };
js/rotatingtweets_v2.js CHANGED
@@ -104,30 +104,36 @@ jQuery(document).ready(function() {
104
  };
105
  // Re-load Twitter widgets when a partial is rendered.
106
  wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
107
- console.log(placement);
108
- var newid = '#' + placement.container[0].id;
109
- rotatingtweetsInteraction(newid + " > .rotatingtweets" );
110
- jQuery( newid + " > .rotatingtweets" ).cycle2();
111
- twttr.widgets.load(
112
- document.getElementById(newid)
113
- );
 
 
 
 
114
  } );
115
  });
116
- /* And call the Twitter script while we're at it! */
117
- /* Standard script to call Twitter */
118
- window.twttr = (function(d, s, id) {
119
- var js, fjs = d.getElementsByTagName(s)[0],
120
- t = window.twttr || {};
121
- if (d.getElementById(id)) return t;
122
- js = d.createElement(s);
123
- js.id = id;
124
- js.src = "https://platform.twitter.com/widgets.js";
125
- fjs.parentNode.insertBefore(js, fjs);
126
-
127
- t._e = [];
128
- t.ready = function(f) {
129
- t._e.push(f);
130
- };
131
-
132
- return t;
133
- }(document, "script", "twitter-wjs"));
 
 
104
  };
105
  // Re-load Twitter widgets when a partial is rendered.
106
  wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
107
+ if ( placement.container ) {
108
+ var newid = '#' + placement.container[0].id;
109
+ rotatingtweetsInteraction(newid + " > .rotatingtweets" );
110
+ jQuery( newid + " > .rotatingtweets" ).cycle2('destroy');
111
+ jQuery( newid + " > .rotatingtweets" ).cycle2();
112
+ if(navigator.doNotTrack != 'yes' && navigator.doNotTrack != 1 && window.doNotTrack != 1 && navigator.msDoNotTrack != 1) {
113
+ twttr.widgets.load(
114
+ document.getElementById(newid)
115
+ );
116
+ };
117
+ };
118
  } );
119
  });
120
+ if(navigator.doNotTrack != 'yes' && navigator.doNotTrack != 1 && window.doNotTrack != 1 && navigator.msDoNotTrack != 1) {
121
+ /* And call the Twitter script while we're at it! */
122
+ /* Standard script to call Twitter */
123
+ window.twttr = (function(d, s, id) {
124
+ var js, fjs = d.getElementsByTagName(s)[0],
125
+ t = window.twttr || {};
126
+ if (d.getElementById(id)) return t;
127
+ js = d.createElement(s);
128
+ js.id = id;
129
+ js.src = "https://platform.twitter.com/widgets.js";
130
+ fjs.parentNode.insertBefore(js, fjs);
131
+
132
+ t._e = [];
133
+ t.ready = function(f) {
134
+ t._e.push(f);
135
+ };
136
+
137
+ return t;
138
+ }(document, "script", "twitter-wjs"));
139
+ };
js/rotatingtweets_v2_cyclone.js CHANGED
@@ -105,30 +105,36 @@ jQuery(document).ready(function() {
105
  };
106
  // Re-load Twitter widgets when a partial is rendered.
107
  wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
108
- console.log( placement );
109
- var newid = '#' + placement.container[0].id;
110
- rotatingtweetsInteraction(newid + " > .rotatingtweets" );
111
- jQuery( newid + " > .rotatingtweets" ).cycle();
112
- twttr.widgets.load(
113
- document.getElementById(newid)
114
- );
 
 
 
 
115
  } );
116
  });
117
- /* And call the Twitter script while we're at it! */
118
- /* Standard script to call Twitter */
119
- window.twttr = (function(d, s, id) {
120
- var js, fjs = d.getElementsByTagName(s)[0],
121
- t = window.twttr || {};
122
- if (d.getElementById(id)) return t;
123
- js = d.createElement(s);
124
- js.id = id;
125
- js.src = "https://platform.twitter.com/widgets.js";
126
- fjs.parentNode.insertBefore(js, fjs);
127
-
128
- t._e = [];
129
- t.ready = function(f) {
130
- t._e.push(f);
131
- };
132
-
133
- return t;
134
- }(document, "script", "twitter-wjs"));
 
 
105
  };
106
  // Re-load Twitter widgets when a partial is rendered.
107
  wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
108
+ if ( placement.container ) {
109
+ var newid = '#' + placement.container[0].id;
110
+ rotatingtweetsInteraction(newid + " > .rotatingtweets" );
111
+ jQuery( newid + " > .rotatingtweets" ).cycle('destroy');
112
+ jQuery( newid + " > .rotatingtweets" ).cycle();
113
+ if(navigator.doNotTrack != 'yes' && navigator.doNotTrack != 1 && window.doNotTrack != 1 && navigator.msDoNotTrack != 1) {
114
+ twttr.widgets.load(
115
+ document.getElementById(newid)
116
+ );
117
+ };
118
+ };
119
  } );
120
  });
121
+ if(navigator.doNotTrack != 'yes' && navigator.doNotTrack != 1 && window.doNotTrack != 1 && navigator.msDoNotTrack != 1) {
122
+ /* And call the Twitter script while we're at it! */
123
+ /* Standard script to call Twitter */
124
+ window.twttr = (function(d, s, id) {
125
+ var js, fjs = d.getElementsByTagName(s)[0],
126
+ t = window.twttr || {};
127
+ if (d.getElementById(id)) return t;
128
+ js = d.createElement(s);
129
+ js.id = id;
130
+ js.src = "https://platform.twitter.com/widgets.js";
131
+ fjs.parentNode.insertBefore(js, fjs);
132
+
133
+ t._e = [];
134
+ t.ready = function(f) {
135
+ t._e.push(f);
136
+ };
137
+
138
+ return t;
139
+ }(document, "script", "twitter-wjs"));
140
+ };
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
5
  Requires at least: 3.2
6
  Tested up to: 4.6.1
7
- Stable tag: 1.8.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -184,10 +184,14 @@ into your CSS - changing `123px;` to the width you're aiming at - either via put
184
  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.
185
 
186
  == Upgrade notice ==
187
- = 1.8.6 =
188
- * Fixing minor bug in German translation.
189
 
190
  == Changelog ==
 
 
 
 
191
  = 1.8.6 =
192
  * Fixing minor bug in German translation.
193
  * Removing "Undefined variable" notice on line 165
4
  Tags: shortcode,widget,twitter,rotating,rotate,rotator,tweet,tweets,animation,jquery,jquery cycle,cycle,multilingual,responsive,page builder
5
  Requires at least: 3.2
6
  Tested up to: 4.6.1
7
+ Stable tag: 1.8.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
184
  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.
185
 
186
  == Upgrade notice ==
187
+ = 1.8.7 =
188
+ * Support for 'Do Not Track'. Fix minor bug with Selective Refresh.
189
 
190
  == Changelog ==
191
+ = 1.8.7 =
192
+ * De-activates Twitter JavaScript if 'Do Not Track' is enabled.
193
+ * Fix minor bug with Selective Refresh.
194
+
195
  = 1.8.6 =
196
  * Fixing minor bug in German translation.
197
  * Removing "Undefined variable" notice on line 165
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.8.6
6
  Text Domain: rotatingtweets
7
  Domain Path: /languages
8
  Author: Martin Tod
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.8.7
6
  Text Domain: rotatingtweets
7
  Domain Path: /languages
8
  Author: Martin Tod