Version Description
- [Fixed] Class conflict error - check for use before including
- [Fixed] Emoji error (presented as for each error) 4-byte emoji issue
- [Fixed] Word break (letter break on certain browsers) - moved so break on links only to ensure long URLs don't break display
Download this release
Release Info
Developer | Planet Interactive |
Plugin | Simple Twitter Tweets |
Version | 3.0 |
Comparing to | |
See all releases |
Code changes from version 2.1 to 3.0
- README.txt +7 -2
- css/stt.css +1 -1
- css/stt.min.css +1 -1
- simple-twitter-tweets.php +125 -117
README.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: Planet Interactive
|
|
3 |
Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A9437VN7R36VN
|
4 |
Tags: Twitter, Stream, Tweets, Twitter OAuth, social
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag:
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -131,6 +131,11 @@ We've tested it and as far as we know it works great! Phew, but if you have an i
|
|
131 |
|
132 |
== Changelog ==
|
133 |
|
|
|
|
|
|
|
|
|
|
|
134 |
= 2.1 =
|
135 |
* [Updated] Intents was on by default before selected (but not saved) - now off on initialisation and user selection to turn on required
|
136 |
* [Fixed] Show Avatar was maintaining indent of tweets when turned off after having been set. Now checks for Avatar on flag not just size change.
|
3 |
Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A9437VN7R36VN
|
4 |
Tags: Twitter, Stream, Tweets, Twitter OAuth, social
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 3.9
|
7 |
+
Stable tag: 3.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
131 |
|
132 |
== Changelog ==
|
133 |
|
134 |
+
= 3.0 =
|
135 |
+
* [Fixed] Class conflict error - check for use before including
|
136 |
+
* [Fixed] Emoji error (presented as for each error) 4-byte emoji issue
|
137 |
+
* [Fixed] Word break (letter break on certain browsers) - moved so break on links only to ensure long URLs don't break display
|
138 |
+
|
139 |
= 2.1 =
|
140 |
* [Updated] Intents was on by default before selected (but not saved) - now off on initialisation and user selection to turn on required
|
141 |
* [Fixed] Show Avatar was maintaining indent of tweets when turned off after having been set. Now checks for Avatar on flag not just size change.
|
css/stt.css
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
font-style: normal;
|
12 |
}
|
13 |
/* push in list item and pull out image if avatar display */
|
14 |
-
.tweets li{
|
15 |
-ms-word-break: break-all;
|
16 |
word-break: break-all;
|
17 |
/* Non standard for webkit */
|
11 |
font-style: normal;
|
12 |
}
|
13 |
/* push in list item and pull out image if avatar display */
|
14 |
+
.tweets li > a{
|
15 |
-ms-word-break: break-all;
|
16 |
word-break: break-all;
|
17 |
/* Non standard for webkit */
|
css/stt.min.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
@font-face{font-family:'stt-intents';src:url('fonts/stt-intents.eot')}@font-face{font-family:'stt-intents';src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAWQAA0AAAAACAgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABoAAAAcZoSdXkdERUYAAAFMAAAAHwAAACAANQAGT1MvMgAAAWwAAABHAAAAVi7i3BxjbWFwAAABtAAAAFUAAAFqodkD8Wdhc3AAAAIMAAAACAAAAAj//wADZ2x5ZgAAAhQAAAHQAAACXJAtYUdoZWFkAAAD5AAAADMAAAA2/fluKWhoZWEAAAQYAAAAIAAAACQDif/paG10eAAABDgAAAAYAAAAIAlVAABsb2NhAAAEUAAAABIAAAASAewBNG1heHAAAARkAAAAHQAAACAATABPbmFtZQAABIQAAADXAAABuXl6fnVwb3N0AAAFXAAAADQAAABaJCWFRHicY2BgYGQAgpOd+YYg+lztdDEYDQBAyQXkAAB4nGNgZGBg4ANiCQYQYGJgZGBmYAeSLGAeAwAEsQA8AHicY2BkPMA4gYGVgYNRmdGSgYHBDkpfZxBjKGZgY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f5wMwxRkRwoqQYikcY4yt8ABrnIQTeq7CQ/JdeIQ0WtAZJRMq8/5V4BgzrIQHOGAnnNBzER6Sb8Ij8gMdPLdGDcdc9bEDOu917XzlPC9ftbe+R9NrIbc40qGQI4NhLnh+937VLLfmMYw5o8WGDRvn9017rFSeGVWojyl4s1Zbo3Nj6fxn7JJ6S7XuxwxfhtFQVm1XN07ZzPzV5wlIcketAHicY2BiwA84gJiRgYmRiZGZkYWRlZGNvTQv083AwABCm1uCaUNDI6i4KYh2BcoDAOnwCww=) format('woff'),url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAANAIAAAwBQRkZUTWaEnV4AAAfsAAAAHEdERUYANQAGAAAHzAAAACBPUy8yLuLcHAAAAVgAAABWY21hcKHZA/EAAAHQAAABamdhc3D//wADAAAHxAAAAAhnbHlmkC1hRwAAA1AAAAJcaGVhZP35bikAAADcAAAANmhoZWEDif/pAAABFAAAACRobXR4CVUAAAAAAbAAAAAgbG9jYQHsATQAAAM8AAAAEm1heHAATABPAAABOAAAACBuYW1leXp+dQAABawAAAG5cG9zdCQlhUQAAAdoAAAAWgABAAAAAQAAzATBq18PPPUACwHAAAAAAM59lxYAAAAAzn2XFv///8AB4AGAAAAACAACAAAAAAAAAAEAAAGA/8AAKAHg///+QAHgAAEAAAAAAAAAAAAAAAAAAAAIAAEAAAAIAEwAAgAAAAAAAgAAAAEAAQAAAEAAAAAAAAAAAQHAAZAABQAIASMBOQAAAD4BIwE5AAAA1wAWAHMAAAIABQMAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUGZFZABA4ADxEgGA/8AAKAGAAECAAAABAAAAAAAAAcAAAAAAAAAAlQAAAAAAAAHAAAAB4AAAAaAAAAHAAAAAAAADAAAAAwAAABwAAQAAAAAAZAADAAEAAAAcAAQASAAAAA4ACAACAAYAAOAA8ADwBfB58RL//wAAAADgAPAA8AXwefES//8AACAHEAMQAQ+LDvMAAQAAAAAAAAAAAAAAAAAAAAABBgAAAQAAAAAAAAABAgA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0NTYBwBkcHgscHxsoJjYDOWIjDCkXEyogDAwJCQkvHjJACwtATT1mPyMbASsLBBIhEAYdNiYLCgMzKhUZMRsLASEzBgQCHCMBJwEpL0xcLgYGFAAAAAAADACWAAEAAAAAAAEACwAYAAEAAAAAAAIABwA0AAEAAAAAAAMAKACOAAEAAAAAAAQACwDPAAEAAAAAAAUACwDzAAEAAAAAAAYACwEXAAMAAQQJAAEAFgAAAAMAAQQJAAIADgAkAAMAAQQJAAMAUAA8AAMAAQQJAAQAFgC3AAMAAQQJAAUAFgDbAAMAAQQJAAYAFgD/AHMAdAB0AC0AaQBuAHQAZQBuAHQAcwAAc3R0LWludGVudHMAAGkAbgB0AGUAbgB0AHMAAGludGVudHMAAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAAcwB0AHQALQBpAG4AdABlAG4AdABzACAAOgAgADEAMQAtADEAMAAtADIAMAAxADMAAEZvbnRGb3JnZSAyLjAgOiBzdHQtaW50ZW50cyA6IDExLTEwLTIwMTMAAHMAdAB0AC0AaQBuAHQAZQBuAHQAcwAAc3R0LWludGVudHMAAFYAZQByAHMAaQBvAG4AIAAxAC4AMAAAVmVyc2lvbiAxLjAAAHMAdAB0AC0AaQBuAHQAZQBuAHQAcwAAc3R0LWludGVudHMAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAEAAgECAQMBBAEFAQYHdW5pRjAwMAd1bmlGMDc5B3VuaUYxMTIHdW5pRjAwNQd1bmlFMDAwAAAAAAAB//8AAgABAAAADgAAABgAAAAAAAIAAQADAAcAAQAEAAAAAgAAAAAAAQAAAADJiW8xAAAAAM59lxYAAAAAzn2XFg==) format('truetype');font-weight:normal;font-style:normal}
|
2 |
-
.tweets li{-ms-word-break:break-all;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto}.avatar{margin-left:53px}
|
3 |
.avatar img{float:left;margin-left:-53px}.a-corn{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.intent-meta{margin-top:5px}.intent-meta a{margin-right:5px}
|
4 |
[data-icon]:before{font-family:'stt-intents';content:attr(data-icon);speak:none;font-weight:normal;font-variant:normal;font-size:14px;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
5 |
.pi-visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}
|
1 |
@font-face{font-family:'stt-intents';src:url('fonts/stt-intents.eot')}@font-face{font-family:'stt-intents';src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAWQAA0AAAAACAgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABoAAAAcZoSdXkdERUYAAAFMAAAAHwAAACAANQAGT1MvMgAAAWwAAABHAAAAVi7i3BxjbWFwAAABtAAAAFUAAAFqodkD8Wdhc3AAAAIMAAAACAAAAAj//wADZ2x5ZgAAAhQAAAHQAAACXJAtYUdoZWFkAAAD5AAAADMAAAA2/fluKWhoZWEAAAQYAAAAIAAAACQDif/paG10eAAABDgAAAAYAAAAIAlVAABsb2NhAAAEUAAAABIAAAASAewBNG1heHAAAARkAAAAHQAAACAATABPbmFtZQAABIQAAADXAAABuXl6fnVwb3N0AAAFXAAAADQAAABaJCWFRHicY2BgYGQAgpOd+YYg+lztdDEYDQBAyQXkAAB4nGNgZGBg4ANiCQYQYGJgZGBmYAeSLGAeAwAEsQA8AHicY2BkPMA4gYGVgYNRmdGSgYHBDkpfZxBjKGZgYGJgZWaAAwEEkyEgzTWFweEBw0chxob/Bxg0GBsYHBoYGBhBcgCOlwsBAHicY2BgYGaAYBkGRgYQSAHyGMF8FgYPIM3HwMHAxMDGwPCA4QPDB9YPlR+F/v8HKUTlK7ALMAsw8nfzfYaagwQYgbphgoxMQIIJXQG6juEHAJ1mEWUAAAAAAAAB//8AAnicVZG5bttAEEB39hhKS5qWFR4WdFgiYVFHIDG8r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FgAAAAMAAQQJAAIADgAkAAMAAQQJAAMAUAA8AAMAAQQJAAQAFgC3AAMAAQQJAAUAFgDbAAMAAQQJAAYAFgD/AHMAdAB0AC0AaQBuAHQAZQBuAHQAcwAAc3R0LWludGVudHMAAGkAbgB0AGUAbgB0AHMAAGludGVudHMAAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAAcwB0AHQALQBpAG4AdABlAG4AdABzACAAOgAgADEAMQAtADEAMAAtADIAMAAxADMAAEZvbnRGb3JnZSAyLjAgOiBzdHQtaW50ZW50cyA6IDExLTEwLTIwMTMAAHMAdAB0AC0AaQBuAHQAZQBuAHQAcwAAc3R0LWludGVudHMAAFYAZQByAHMAaQBvAG4AIAAxAC4AMAAAVmVyc2lvbiAxLjAAAHMAdAB0AC0AaQBuAHQAZQBuAHQAcwAAc3R0LWludGVudHMAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAEAAgECAQMBBAEFAQYHdW5pRjAwMAd1bmlGMDc5B3VuaUYxMTIHdW5pRjAwNQd1bmlFMDAwAAAAAAAB//8AAgABAAAADgAAABgAAAAAAAIAAQADAAcAAQAEAAAAAgAAAAAAAQAAAADJiW8xAAAAAM59lxYAAAAAzn2XFg==) format('truetype');font-weight:normal;font-style:normal}
|
2 |
+
.tweets li>a{-ms-word-break:break-all;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto}.avatar{margin-left:53px}
|
3 |
.avatar img{float:left;margin-left:-53px}.a-corn{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.intent-meta{margin-top:5px}.intent-meta a{margin-right:5px}
|
4 |
[data-icon]:before{font-family:'stt-intents';content:attr(data-icon);speak:none;font-weight:normal;font-variant:normal;font-size:14px;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|
5 |
.pi-visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}
|
simple-twitter-tweets.php
CHANGED
@@ -4,24 +4,24 @@ Plugin Name: Simple Twitter Tweets
|
|
4 |
Plugin URI: http://www.planet-interactive.co.uk/simple-twitter-tweets
|
5 |
Description: Display last x number tweets from Twitter API stream, store locally in database to present past tweets when failure to access Twitters restrictive API occurs
|
6 |
Author: Ashley Sheinwald
|
7 |
-
Version:
|
8 |
Author URI: http://www.planet-interactive.co.uk/
|
9 |
*/
|
10 |
|
11 |
/* Copyright 2013 Ashley Sheinwald (email : ashley@planet-interactive.co.uk)
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
*/
|
26 |
|
27 |
// USED FOR DEBUG
|
@@ -62,21 +62,21 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
62 |
return;
|
63 |
|
64 |
// Get global $wp_version - what version of WordPress is installed.
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
wp_enqueue_script('PI_stt_js', plugins_url( '/simple-twitter-tweets/js/sttAdmin.min.js' , dirname(__FILE__) ), array('jquery'));
|
81 |
}
|
82 |
|
@@ -110,7 +110,7 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
110 |
|
111 |
//Set up some default widget settings.
|
112 |
$defaults = array(
|
113 |
-
|
114 |
, 'name' => __('iPlanetUK', 'pi-tweet')
|
115 |
, 'numTweets' => __(4, 'pi-tweet') // How many to display
|
116 |
, 'cacheTime' => __(5, 'pi-tweet') // Time in minutes between updates
|
@@ -164,8 +164,8 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
164 |
<?php
|
165 |
// Show error if cURL not installed - extension required for Twitter API calls
|
166 |
if (!in_array('curl', get_loaded_extensions())) {
|
167 |
-
|
168 |
-
|
169 |
?>
|
170 |
|
171 |
<p>
|
@@ -199,8 +199,8 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
199 |
<label for="<?php echo $this->get_field_id('accessTokenSecret'); ?>">Access Token Secret: <input class="widefat" id="<?php echo $this->get_field_id('accessTokenSecret'); ?>" name="<?php echo $this->get_field_name('accessTokenSecret'); ?>" type="text" value="<?php echo esc_attr($accessTokenSecret); ?>" /></label>
|
200 |
</p>
|
201 |
<p>
|
202 |
-
|
203 |
-
|
204 |
</p>
|
205 |
</div>
|
206 |
</div>
|
@@ -212,12 +212,12 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
212 |
<div style="padding:10px;">
|
213 |
<p>Display your Twitter Avatar: image</p>
|
214 |
<p>
|
215 |
-
|
216 |
-
|
217 |
</p>
|
218 |
<p>
|
219 |
-
|
220 |
-
|
221 |
</p>
|
222 |
<p>
|
223 |
<label for="<?php echo $this->get_field_id('avatarSize'); ?>">Size of Avatar (default: 48): <input class="widefat" id="<?php echo $this->get_field_id('avatarSize'); ?>" name="<?php echo $this->get_field_name('avatarSize'); ?>" type="text" value="<?php echo esc_attr($avatarSize); ?>" /><br><em>input number only</em></label>
|
@@ -231,12 +231,12 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
231 |
<h4 class="button-secondary" style="width:100%; text-align:center;">Time Display Options <span style="font-size:75%;">▼</span></h4>
|
232 |
<div style="padding:10px;">
|
233 |
<p>
|
234 |
-
|
235 |
-
|
236 |
</p>
|
237 |
<p>
|
238 |
-
|
239 |
-
|
240 |
</p>
|
241 |
</div>
|
242 |
</div>
|
@@ -247,12 +247,12 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
247 |
<h4 class="button-secondary" style="width:100%; text-align:center;">Twitter Intents <span style="font-size:75%;">▼</span></h4>
|
248 |
<div style="padding:10px;">
|
249 |
<p>
|
250 |
-
|
251 |
-
|
252 |
</p>
|
253 |
<p>
|
254 |
-
|
255 |
-
|
256 |
</p>
|
257 |
<p>
|
258 |
<label for="<?php echo $this->get_field_id('intentColor'); ?>">Intent icons colour: <input class="intentColor" id="<?php echo $this->get_field_id('intentColor'); ?>" name="<?php echo $this->get_field_name('intentColor'); ?>" type="text" value="<?php echo esc_attr($intentColor); ?>" /></label>
|
@@ -265,16 +265,16 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
265 |
<h4 class="button-secondary" style="width:100%; text-align:center;">Twitter Follow Button <span style="font-size:75%;">▼</span></h4>
|
266 |
<div style="padding:10px;">
|
267 |
<p>
|
268 |
-
|
269 |
-
|
270 |
</p>
|
271 |
<p>
|
272 |
-
|
273 |
-
|
274 |
</p>
|
275 |
<p>
|
276 |
-
|
277 |
-
|
278 |
</p>
|
279 |
<p>
|
280 |
<label for="<?php echo $this->get_field_id('dataLang'); ?>">Language: <input class="widefat" id="<?php echo $this->get_field_id('dataLang'); ?>" name="<?php echo $this->get_field_name('dataLang'); ?>" type="text" value="<?php echo esc_attr($dataLang); ?>" /></label>
|
@@ -287,17 +287,17 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
287 |
function update($new_instance, $old_instance){
|
288 |
$instance = $old_instance;
|
289 |
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
$instance['dataShowCount'] = $new_instance['dataShowCount'];
|
302 |
$instance['dataShowScreenName'] = $new_instance['dataShowScreenName'];
|
303 |
$instance['dataLang'] = $new_instance['dataLang'];
|
@@ -359,7 +359,7 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
359 |
<ul class="tweets">
|
360 |
<?php
|
361 |
/*
|
362 |
-
|
363 |
* Twitter API call:
|
364 |
* http://dev.twitter.com/doc/get/statuses/user_timeline
|
365 |
* WP transient API ref.
|
@@ -401,11 +401,18 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
401 |
$transName = 'list-tweets-'.$name; // Name of value in database. [added $name for multiple account use]
|
402 |
$backupName = $transName . '-backup'; // Name of backup value in database.
|
403 |
|
|
|
404 |
// Do we already have saved tweet data? If not, lets get it.
|
405 |
-
if(false === ($tweets = get_transient($transName) ) ) :
|
|
|
|
|
|
|
|
|
406 |
|
407 |
// Get the tweets from Twitter.
|
408 |
-
include 'twitteroauth/twitteroauth.php';
|
|
|
|
|
409 |
|
410 |
$connection = new TwitterOAuth(
|
411 |
$consumerKey, // Consumer key
|
@@ -440,76 +447,77 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
440 |
for($i = 0; $i < $limitToDisplay; $i++) :
|
441 |
$tweet = $fetchedTweets[$i];
|
442 |
|
443 |
-
|
444 |
-
|
445 |
|
446 |
// COMMUNITY REQUEST !!!!!! (2)
|
447 |
-
|
448 |
|
449 |
-
|
450 |
-
|
451 |
|
452 |
-
|
453 |
-
|
454 |
|
455 |
// Process Tweets - Use Twitter entities for correct URL, hash and mentions
|
456 |
$text = $this->process_links($tweet);
|
457 |
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
endfor;
|
473 |
|
474 |
// Save our new transient, and update the backup.
|
475 |
-
set_transient($transName, $tweets, 60 * $cacheTime);
|
|
|
476 |
update_option($backupName, $tweets);
|
477 |
endif;
|
478 |
endif;
|
479 |
|
480 |
// Thanks to Andrew Tibbetts - http://wordpress.org/support/profile/andrewgtibbetts
|
481 |
function twitter_time_diff( $from, $to = '' ) {
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
}
|
495 |
|
496 |
// Now display the tweets, if we can.
|
497 |
if($tweets) : ?>
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
<a href="http://www.twitter.com/<?php echo $screen_name; ?>" target="_blank" title="Follow <?php echo $name; ?> on Twitter [Opens new window]">
|
514 |
<?php
|
515 |
|
@@ -529,7 +537,7 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
529 |
|
530 |
?>
|
531 |
</a>
|
532 |
-
|
533 |
|
534 |
<?php // INTENTS REF: DISPLAY OR NOT
|
535 |
if($twitterIntents == "true"){
|
@@ -547,16 +555,16 @@ class PI_SimpleTwitterTweets extends WP_Widget{
|
|
547 |
</div>
|
548 |
<?php } ?>
|
549 |
|
550 |
-
|
551 |
-
|
552 |
|
553 |
<?php else : ?>
|
554 |
-
|
555 |
<?php endif; ?>
|
556 |
</ul>
|
557 |
|
558 |
<?php
|
559 |
-
|
560 |
// Make it an options choice though
|
561 |
if($twitterFollow){ ?>
|
562 |
<a href="https://twitter.com/<?php echo $PI_name; ?>" class="twitter-follow-button" data-show-count="<?php echo $dataShowCount; ?>" data-show-screen-name="<?php echo $dataShowScreenName; ?>" data-lang="<?php echo $dataLang; ?>">Follow @<?php echo $PI_name; ?></a>
|
4 |
Plugin URI: http://www.planet-interactive.co.uk/simple-twitter-tweets
|
5 |
Description: Display last x number tweets from Twitter API stream, store locally in database to present past tweets when failure to access Twitters restrictive API occurs
|
6 |
Author: Ashley Sheinwald
|
7 |
+
Version: 3.0
|
8 |
Author URI: http://www.planet-interactive.co.uk/
|
9 |
*/
|
10 |
|
11 |
/* Copyright 2013 Ashley Sheinwald (email : ashley@planet-interactive.co.uk)
|
12 |
|
13 |
+
This program is free software; you can redistribute it and/or modify
|
14 |
+
it under the terms of the GNU General Public License, version 2, as
|
15 |
+
published by the Free Software Foundation.
|
16 |
|
17 |
+
This program is distributed in the hope that it will be useful,
|
18 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
+
GNU General Public License for more details.
|
21 |
|
22 |
+
You should have received a copy of the GNU General Public License
|
23 |
+
along with this program; if not, write to the Free Software
|
24 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
|
27 |
// USED FOR DEBUG
|
62 |
return;
|
63 |
|
64 |
// Get global $wp_version - what version of WordPress is installed.
|
65 |
+
global $wp_version;
|
66 |
+
|
67 |
+
// If the WordPress >= 3.5, then load the new WordPress color picker.
|
68 |
+
if ( 3.5 <= $wp_version ){
|
69 |
+
//Both the necessary css and javascript have been registered already by WordPress, so all we have to do is load them with their handle.
|
70 |
+
wp_enqueue_style( 'wp-color-picker' );
|
71 |
+
wp_enqueue_script( 'wp-color-picker' );
|
72 |
+
}
|
73 |
+
// If the WP < 3.5 load the older farbtasic color picker.
|
74 |
+
else {
|
75 |
+
// As above load both style sna scripts
|
76 |
+
wp_enqueue_style( 'farbtastic' );
|
77 |
+
wp_enqueue_script( 'farbtastic' );
|
78 |
+
}
|
79 |
+
// Now load STT JS
|
80 |
wp_enqueue_script('PI_stt_js', plugins_url( '/simple-twitter-tweets/js/sttAdmin.min.js' , dirname(__FILE__) ), array('jquery'));
|
81 |
}
|
82 |
|
110 |
|
111 |
//Set up some default widget settings.
|
112 |
$defaults = array(
|
113 |
+
'title' => __('Recent Tweets', 'pi-tweet')
|
114 |
, 'name' => __('iPlanetUK', 'pi-tweet')
|
115 |
, 'numTweets' => __(4, 'pi-tweet') // How many to display
|
116 |
, 'cacheTime' => __(5, 'pi-tweet') // Time in minutes between updates
|
164 |
<?php
|
165 |
// Show error if cURL not installed - extension required for Twitter API calls
|
166 |
if (!in_array('curl', get_loaded_extensions())) {
|
167 |
+
echo '<p style="background-color:pink;padding:10px;border:1px solid red;"><strong>You do not have cURL installed! This is a required PHP extension to use the Twitter API: <a href="http://curl.haxx.se/docs/install.html" taget="_blank">cURL install</a></strong></p>';
|
168 |
+
}
|
169 |
?>
|
170 |
|
171 |
<p>
|
199 |
<label for="<?php echo $this->get_field_id('accessTokenSecret'); ?>">Access Token Secret: <input class="widefat" id="<?php echo $this->get_field_id('accessTokenSecret'); ?>" name="<?php echo $this->get_field_name('accessTokenSecret'); ?>" type="text" value="<?php echo esc_attr($accessTokenSecret); ?>" /></label>
|
200 |
</p>
|
201 |
<p>
|
202 |
+
<input class="checkbox" type="checkbox" <?php checked( isset( $instance['exclude_replies']), true ); ?> id="<?php echo $this->get_field_id( 'exclude_replies' ); ?>" name="<?php echo $this->get_field_name( 'exclude_replies' ); ?>" />
|
203 |
+
<label for="<?php echo $this->get_field_id( 'exclude_replies' ); ?>"><?php _e('Exclude_@replies', 'pi-tweet'); ?></label>
|
204 |
</p>
|
205 |
</div>
|
206 |
</div>
|
212 |
<div style="padding:10px;">
|
213 |
<p>Display your Twitter Avatar: image</p>
|
214 |
<p>
|
215 |
+
<input class="checkbox" type="checkbox" value="true" <?php checked( ( isset( $instance['showAvatar']) && ($instance['showAvatar'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'showAvatar' ); ?>" name="<?php echo $this->get_field_name( 'showAvatar' ); ?>" />
|
216 |
+
<label for="<?php echo $this->get_field_id( 'showAvatar' ); ?>"><?php _e('Show your avatar image', 'pi-tweet'); ?></label>
|
217 |
</p>
|
218 |
<p>
|
219 |
+
<input class="checkbox" type="checkbox" value="true" <?php checked( ( isset( $instance['roundCorners']) && ($instance['showAvatar'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'roundCorners' ); ?>" name="<?php echo $this->get_field_name( 'roundCorners' ); ?>" />
|
220 |
+
<label for="<?php echo $this->get_field_id( 'roundCorners' ); ?>"><?php _e('Round avatar corners (5px)', 'pi-tweet'); ?></label>
|
221 |
</p>
|
222 |
<p>
|
223 |
<label for="<?php echo $this->get_field_id('avatarSize'); ?>">Size of Avatar (default: 48): <input class="widefat" id="<?php echo $this->get_field_id('avatarSize'); ?>" name="<?php echo $this->get_field_name('avatarSize'); ?>" type="text" value="<?php echo esc_attr($avatarSize); ?>" /><br><em>input number only</em></label>
|
231 |
<h4 class="button-secondary" style="width:100%; text-align:center;">Time Display Options <span style="font-size:75%;">▼</span></h4>
|
232 |
<div style="padding:10px;">
|
233 |
<p>
|
234 |
+
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['timeRef']) && ($instance['timeRef'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'timeRef' ); ?>" name="<?php echo $this->get_field_name( 'timeRef' ); ?>" />
|
235 |
+
<label for="<?php echo $this->get_field_id( 'timeRef' ); ?>"><?php _e('Change to short time reference <br><em>h for Hour(s), d for Day(s) ... <strong>Twitter style</strong></em>', 'pi-tweet'); ?></label>
|
236 |
</p>
|
237 |
<p>
|
238 |
+
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['timeAgo']) && ($instance['timeAgo'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'timeAgo' ); ?>" name="<?php echo $this->get_field_name( 'timeAgo' ); ?>" value="true" />
|
239 |
+
<label for="<?php echo $this->get_field_id( 'timeAgo' ); ?>"><?php _e('Show "ago" after the time', 'pi-tweet'); ?></label>
|
240 |
</p>
|
241 |
</div>
|
242 |
</div>
|
247 |
<h4 class="button-secondary" style="width:100%; text-align:center;">Twitter Intents <span style="font-size:75%;">▼</span></h4>
|
248 |
<div style="padding:10px;">
|
249 |
<p>
|
250 |
+
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['twitterIntents']) && ($instance['twitterIntents'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'twitterIntents' ); ?>" name="<?php echo $this->get_field_name( 'twitterIntents' ); ?>" />
|
251 |
+
<label for="<?php echo $this->get_field_id( 'twitterIntents' ); ?>"><?php _e('Show Twitter Intents', 'pi-tweet'); ?></label>
|
252 |
</p>
|
253 |
<p>
|
254 |
+
<input class="checkbox" type="checkbox" value="true" <?php checked( (isset( $instance['twitterIntentsText']) && ($instance['twitterIntentsText'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'twitterIntentsText' ); ?>" name="<?php echo $this->get_field_name( 'twitterIntentsText' ); ?>" />
|
255 |
+
<label for="<?php echo $this->get_field_id( 'twitterIntentsText' ); ?>"><?php _e('Hide Twitter Intents Text <br><em>e.g. just use icons</em>', 'pi-tweet'); ?></label>
|
256 |
</p>
|
257 |
<p>
|
258 |
<label for="<?php echo $this->get_field_id('intentColor'); ?>">Intent icons colour: <input class="intentColor" id="<?php echo $this->get_field_id('intentColor'); ?>" name="<?php echo $this->get_field_name('intentColor'); ?>" type="text" value="<?php echo esc_attr($intentColor); ?>" /></label>
|
265 |
<h4 class="button-secondary" style="width:100%; text-align:center;">Twitter Follow Button <span style="font-size:75%;">▼</span></h4>
|
266 |
<div style="padding:10px;">
|
267 |
<p>
|
268 |
+
<input class="checkbox" type="checkbox" <?php checked( (isset( $instance['twitterFollow']) && ($instance['twitterFollow'] == "on") ), true ); ?> id="<?php echo $this->get_field_id( 'twitterFollow' ); ?>" name="<?php echo $this->get_field_name( 'twitterFollow' ); ?>" />
|
269 |
+
<label for="<?php echo $this->get_field_id( 'twitterFollow' ); ?>"><?php _e('Show Twitter Follow Button', 'pi-tweet'); ?></label>
|
270 |
</p>
|
271 |
<p>
|
272 |
+
<input class="checkbox" type="checkbox" <?php checked( (isset( $instance['dataShowScreenName']) && ($instance['dataShowScreenName'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'dataShowScreenName' ); ?>" name="<?php echo $this->get_field_name( 'dataShowScreenName' ); ?>" value="true" />
|
273 |
+
<label for="<?php echo $this->get_field_id( 'dataShowScreenName' ); ?>"><?php _e('Show Twitter Screen Name', 'pi-tweet'); ?></label>
|
274 |
</p>
|
275 |
<p>
|
276 |
+
<input class="checkbox" type="checkbox" <?php checked( (isset( $instance['dataShowCount']) && ($instance['dataShowCount'] == "true") ), true ); ?> id="<?php echo $this->get_field_id( 'dataShowCount' ); ?>" name="<?php echo $this->get_field_name( 'dataShowCount' ); ?>" value="true" />
|
277 |
+
<label for="<?php echo $this->get_field_id( 'dataShowCount' ); ?>"><?php _e('Show Twitter Followers Count', 'pi-tweet'); ?></label>
|
278 |
</p>
|
279 |
<p>
|
280 |
<label for="<?php echo $this->get_field_id('dataLang'); ?>">Language: <input class="widefat" id="<?php echo $this->get_field_id('dataLang'); ?>" name="<?php echo $this->get_field_name('dataLang'); ?>" type="text" value="<?php echo esc_attr($dataLang); ?>" /></label>
|
287 |
function update($new_instance, $old_instance){
|
288 |
$instance = $old_instance;
|
289 |
|
290 |
+
//Strip tags from title and name to remove HTML
|
291 |
+
$instance['title'] = strip_tags( $new_instance['title'] );
|
292 |
+
$instance['name'] = strip_tags( $new_instance['name'] );
|
293 |
+
$instance['numTweets'] = $new_instance['numTweets'];
|
294 |
+
$instance['cacheTime'] = $new_instance['cacheTime'];
|
295 |
+
$instance['consumerKey'] = trim($new_instance['consumerKey']);
|
296 |
+
$instance['consumerSecret'] = trim($new_instance['consumerSecret']);
|
297 |
+
$instance['accessToken'] = trim($new_instance['accessToken']);
|
298 |
+
$instance['accessTokenSecret'] = trim($new_instance['accessTokenSecret']);
|
299 |
+
$instance['exclude_replies'] = $new_instance['exclude_replies'];
|
300 |
+
$instance['twitterFollow'] = $new_instance['twitterFollow'];
|
301 |
$instance['dataShowCount'] = $new_instance['dataShowCount'];
|
302 |
$instance['dataShowScreenName'] = $new_instance['dataShowScreenName'];
|
303 |
$instance['dataLang'] = $new_instance['dataLang'];
|
359 |
<ul class="tweets">
|
360 |
<?php
|
361 |
/*
|
362 |
+
* Uses:
|
363 |
* Twitter API call:
|
364 |
* http://dev.twitter.com/doc/get/statuses/user_timeline
|
365 |
* WP transient API ref.
|
401 |
$transName = 'list-tweets-'.$name; // Name of value in database. [added $name for multiple account use]
|
402 |
$backupName = $transName . '-backup'; // Name of backup value in database.
|
403 |
|
404 |
+
// #####################################################
|
405 |
// Do we already have saved tweet data? If not, lets get it.
|
406 |
+
// base64 fix for emoji ? --> if(false === ($tweets = unserialize(base64_decode(get_transient($transName) ))) ) :
|
407 |
+
// if not complete enough implement -> https://github.com/iamcal/php-emoji
|
408 |
+
// #####################################################
|
409 |
+
// if(false === ($tweets = get_transient($transName) ) ) :
|
410 |
+
if(false === ($tweets = unserialize(base64_decode(get_transient($transName) ))) ) :
|
411 |
|
412 |
// Get the tweets from Twitter.
|
413 |
+
//include 'twitteroauth/twitteroauth.php';
|
414 |
+
if ( ! class_exists('TwitterOAuth') )
|
415 |
+
include 'twitteroauth/twitteroauth.php';
|
416 |
|
417 |
$connection = new TwitterOAuth(
|
418 |
$consumerKey, // Consumer key
|
447 |
for($i = 0; $i < $limitToDisplay; $i++) :
|
448 |
$tweet = $fetchedTweets[$i];
|
449 |
|
450 |
+
// Core info.
|
451 |
+
$name = $tweet->user->name;
|
452 |
|
453 |
// COMMUNITY REQUEST !!!!!! (2)
|
454 |
+
$screen_name = $tweet->user->screen_name;
|
455 |
|
456 |
+
$permalink = 'http://twitter.com/'. $name .'/status/'. $tweet->id_str;
|
457 |
+
$tweet_id = $tweet->id_str;
|
458 |
|
459 |
+
/* Alternative image sizes method: http://dev.twitter.com/doc/get/users/profile_image/:screen_name */
|
460 |
+
$image = $tweet->user->profile_image_url;
|
461 |
|
462 |
// Process Tweets - Use Twitter entities for correct URL, hash and mentions
|
463 |
$text = $this->process_links($tweet);
|
464 |
|
465 |
+
// Need to get time in Unix format.
|
466 |
+
$time = $tweet->created_at;
|
467 |
+
$time = date_parse($time);
|
468 |
+
$uTime = mktime($time['hour'], $time['minute'], $time['second'], $time['month'], $time['day'], $time['year']);
|
469 |
+
|
470 |
+
// Now make the new array.
|
471 |
+
$tweets[] = array(
|
472 |
+
'text' => $text,
|
473 |
+
'name' => $name,
|
474 |
+
'permalink' => $permalink,
|
475 |
+
'image' => $image,
|
476 |
+
'time' => $uTime,
|
477 |
+
'tweet_id' => $tweet_id
|
478 |
+
);
|
479 |
endfor;
|
480 |
|
481 |
// Save our new transient, and update the backup.
|
482 |
+
// set_transient($transName, $tweets, 60 * $cacheTime);
|
483 |
+
base64_encode(serialize(set_transient($transName, $tweets, 60 * $cacheTime)));
|
484 |
update_option($backupName, $tweets);
|
485 |
endif;
|
486 |
endif;
|
487 |
|
488 |
// Thanks to Andrew Tibbetts - http://wordpress.org/support/profile/andrewgtibbetts
|
489 |
function twitter_time_diff( $from, $to = '' ) {
|
490 |
+
$diff = human_time_diff($from,$to);
|
491 |
+
$replace = array(
|
492 |
+
' hour' => 'h',
|
493 |
+
' hours' => 'h',
|
494 |
+
' day' => 'd',
|
495 |
+
' days' => 'd',
|
496 |
+
' minute' => 'm',
|
497 |
+
' minutes' => 'm',
|
498 |
+
' second' => 's',
|
499 |
+
' seconds' => 's',
|
500 |
+
);
|
501 |
+
return strtr($diff,$replace);
|
502 |
}
|
503 |
|
504 |
// Now display the tweets, if we can.
|
505 |
if($tweets) : ?>
|
506 |
+
<?php foreach($tweets as $t) : ?>
|
507 |
+
<li<?php echo ($showAvatar) ? ' class="avatar"':""; ?><?php echo ($showAvatar && $avatarSize) ? ' style="margin-left:'.($avatarSize+5).'px"':""; ?>>
|
508 |
+
<?php
|
509 |
+
if ($showAvatar){
|
510 |
+
echo '<img ';
|
511 |
+
echo ($avatarSize) ? ' style="margin-left:-'.($avatarSize+5).'px"':"";
|
512 |
+
echo ($avatarSize) ? 'width="'.$avatarSize.'px" height="'.$avatarSize.'px"' : 'width="48px" height="48px"';
|
513 |
+
echo 'src="'.$t['image'].'" alt="Tweet Avatar" class="';
|
514 |
+
echo ($roundCorners) ? 'a-corn':'';
|
515 |
+
echo '"/>';
|
516 |
+
}
|
517 |
+
?>
|
518 |
+
<?php echo $t['text']; ?>
|
519 |
+
<br/><em>
|
520 |
+
<?php if(!isset($screen_name)){ $screen_name = $name; }?>
|
521 |
<a href="http://www.twitter.com/<?php echo $screen_name; ?>" target="_blank" title="Follow <?php echo $name; ?> on Twitter [Opens new window]">
|
522 |
<?php
|
523 |
|
537 |
|
538 |
?>
|
539 |
</a>
|
540 |
+
</em>
|
541 |
|
542 |
<?php // INTENTS REF: DISPLAY OR NOT
|
543 |
if($twitterIntents == "true"){
|
555 |
</div>
|
556 |
<?php } ?>
|
557 |
|
558 |
+
</li>
|
559 |
+
<?php endforeach; ?>
|
560 |
|
561 |
<?php else : ?>
|
562 |
+
<li>Waiting for Twitter... Once Twitter is ready they will display my Tweets again.</li>
|
563 |
<?php endif; ?>
|
564 |
</ul>
|
565 |
|
566 |
<?php
|
567 |
+
// ADD Twitter follow button - to increase engagement
|
568 |
// Make it an options choice though
|
569 |
if($twitterFollow){ ?>
|
570 |
<a href="https://twitter.com/<?php echo $PI_name; ?>" class="twitter-follow-button" data-show-count="<?php echo $dataShowCount; ?>" data-show-screen-name="<?php echo $dataShowScreenName; ?>" data-lang="<?php echo $dataLang; ?>">Follow @<?php echo $PI_name; ?></a>
|