WP twitter feeds - Version 1.4.3

Version Description

  • Added slider.php file.
Download this release

Release Info

Developer vivacityinfotech.jaipur
Plugin Icon 128x128 WP twitter feeds
Version 1.4.3
Comparing to
See all releases

Code changes from version 1.4.2 to 1.4.3

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: wp twitter feeds,twitter feeds, twitter timeline,twitter widget,twitter w
5
  Requires at least: 3.0
6
  Tested up to: 3.9.1
7
  License: GPLv2 or later
8
- Stable tag: 1.4.2
9
 
10
 
11
  WP Twitter Feeds - A simple widget which lets you add your latest tweets in just a few clicks on your website.
@@ -84,9 +84,48 @@ Installation consists of following steps:
84
  5. WP Twitter Feeds widget under Appearence->Widgets.
85
  6. WP Twitter Feeds widget on front End (Light Theme).
86
  7. WP Twitter Feeds widget on front End (Dark Theme).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
  == Changelog ==
89
 
 
 
 
90
  = 1.4.2 =
91
  * Added the option to List/Slider for the tweets. Now from the Slider option tweets can be show as a slider. A single tweet shows at a time after few second it will fade up by the next tweet.
92
 
5
  Requires at least: 3.0
6
  Tested up to: 3.9.1
7
  License: GPLv2 or later
8
+ Stable tag: 1.4.3
9
 
10
 
11
  WP Twitter Feeds - A simple widget which lets you add your latest tweets in just a few clicks on your website.
84
  5. WP Twitter Feeds widget under Appearence->Widgets.
85
  6. WP Twitter Feeds widget on front End (Light Theme).
86
  7. WP Twitter Feeds widget on front End (Dark Theme).
87
+ 8. WP Twitter Feeds widget Slider feature under Appearence->Widgets.
88
+
89
+ Requires: 3.0 or higher
90
+ Compatible up to: 3.9.1
91
+ Last Updated: 2014-7-23
92
+ Downloads: 14,993
93
+ Ratings
94
+ 4 stars
95
+ 4.7 out of 5 stars
96
+ 5 stars 2
97
+ 4 stars 1
98
+ 3 stars 0
99
+ 2 stars 0
100
+ 1 stars 0
101
+
102
+ Author
103
+ Team Vivacity
104
+ 13 plugins
105
+ Donate to this plugin »
106
+ Support
107
+
108
+ 1 of 10 support threads in the last two months have been resolved.
109
+
110
+ Got something to say? Need help?
111
+ View support forum
112
+ Compatibility
113
+ WordPress
114
+ + Plugin
115
+ =
116
+ Not enough data
117
+
118
+ 0 people say it works.
119
+ 0 people say it's broken.
120
+
121
+ Log in to vote.
122
+
123
 
124
  == Changelog ==
125
 
126
+ = 1.4.3 =
127
+ * Added slider.php file.
128
+
129
  = 1.4.2 =
130
  * Added the option to List/Slider for the tweets. Now from the Slider option tweets can be show as a slider. A single tweet shows at a time after few second it will fade up by the next tweet.
131
 
README.txt~ ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Plugin Name ===
2
+ Contributors: vivacityinfotech.jaipur
3
+ Donate link: http://tinyurl.com/owxtkmt
4
+ Tags: wp twitter feeds,twitter feeds, twitter timeline,twitter widget,twitter widget for wordpress,wp twitter feeds widget,live tweets, live twitter feeds, tweets, feeds, wp twitter feeds plugin, twitter user tweets, twitter 1.1, twitter api
5
+ Requires at least: 3.0
6
+ Tested up to: 3.9.1
7
+ License: GPLv2 or later
8
+ Stable tag: 1.4.3
9
+
10
+
11
+ WP Twitter Feeds - A simple widget which lets you add your latest tweets in just a few clicks on your website.
12
+
13
+ == Description ==
14
+
15
+ An easy Twitter feeds widget that provides facility to display twitter tweets on your website using the latest Twitter 1.1 API. A simple widget which lets you add your latest tweets in widget areas. Get started in just a few clicks and use the provided Widget to easily display your Tweets on your website.
16
+
17
+ Now you don`t need to copy and paste the code from twitter with your settings anymore, just install the plugin and set the options.
18
+ By option page, you can define the duration of fade effect, the number of tweet to see and other things.
19
+
20
+ The "WP Twitter Feeds" Widget will never require your Twitter password, because it based on Open Authentication (OAuth) keys and secrets, that you will get by creating your application at Twitter. It gets all your required data from API. Incase you change your password, you won’t need to update your Widget in your Blog.
21
+
22
+ = Plugin Features =
23
+
24
+ *Easy install
25
+ *Very easy to configure.
26
+ *Display Tweets with a Widget.
27
+ *Choose to show a profile image, Tweets border, Tweets theme and much more.
28
+ *Multiple instance so you can use Twitter widget multiple places.
29
+ *Different color Options.
30
+ *Lightweight and loading fast
31
+ *Set maximum number of tweets to display
32
+ *Turn on/off displaying avatar
33
+ *Supports v1.1 of the Twitter API
34
+
35
+
36
+ = Rate Us / Feedback =
37
+
38
+ Please take the time to let us and others know about your experiences by leaving a review, so that we can improve the plugin for you and other users.
39
+
40
+ If you like the plugin please [Donate here](http://bit.ly/1icl56K).
41
+
42
+ = Want More? =
43
+
44
+ If You Want more functionality or some modifications, just drop us a line what you want and We will try to add or modify the plugin functions.
45
+
46
+
47
+
48
+ == Available Languages ==
49
+
50
+ English
51
+
52
+ == Installation ==
53
+
54
+ Installation consists of following steps:
55
+
56
+ 1. Upload "WP Twitter Tweets" to the /wp-content/plugins/ directory
57
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
58
+ 3. Place the "WP Twitter Tweets" Widget on your sidebar and add twitter username with API details of Twitter.
59
+
60
+ == Frequently Asked Questions ==
61
+
62
+ = How to create a Twitter Application =
63
+
64
+ 1. Visit the Twitter Developers Site: The first thing you need to do is head on down to dev.twitter.com. In order to create an account, all you need to do is click on the “Sign In” link at the top right.
65
+
66
+ 2. Sign in with your Twitter Account: Next, sign in with the Twitter account you want to associate with your app. You do have a Twitter account don’t you?!
67
+
68
+ 3. Go to “My Applications”: Once you’re logged in, click on the downwards arrow to the right of your Twitter image and select “My Applications”. This is where all your registered Twitter apps will appear.
69
+
70
+ 4. Create a New Application: If you are new to the Developers site you won’t see any applications registered. Either way, it’s time to create our first application. To do this, click on the big “Create a new application” button.
71
+
72
+ 5. Fill in your Application Details: It’s been easy so far, but this screen often makes people confused. Don’t worry, it’s a lot easier than you think. First of all you need to give your app a unique name (one that no one else has used for their Twitter app). Since we’re going to be an creating app for personal use and not one that other people can register and use, just put your domain name in or perhaps even your name. You don’t have to worry much about the description– you can change this later. I’ve put “a set of Twitter tools for personal use”.Put your website in the website field– don’t worry that it isn’t (as Twitter ask) your application’s publicly accessible home page. However, this website will be where your app is hosted.For now ignore the Callback URL field. If you are allowing users to log into your app to authenticate themselves, you’d enter the URL where they would be returned after they’ve given permission to Twitter to use your app.Once you’ve done this, make sure you’ve read the “Developer Rules Of The Road” blurb, check the “Yes, I agree” box, fill in the CAPTCHA (don’t you just love them) and click the “create your Twitter Application” button. Hurrah!
73
+
74
+ 6. Create Your Access Token.
75
+
76
+ 7. Make a note of your OAuth Settings.
77
+
78
+ == Screenshots ==
79
+
80
+ 1. WP Twitter Feeds plugin installed and appears in the plugins menu.
81
+ 2. WP Twitter Feeds widget under Appearence->Widgets.
82
+ 3. WP Twitter Feeds widget under Appearence->Widgets.
83
+ 4. WP Twitter Feeds widget under Appearence->Widgets.
84
+ 5. WP Twitter Feeds widget under Appearence->Widgets.
85
+ 6. WP Twitter Feeds widget on front End (Light Theme).
86
+ 7. WP Twitter Feeds widget on front End (Dark Theme).
87
+ 8. WP Twitter Feeds widget Slider feature under Appearence->Widgets.
88
+
89
+ Requires: 3.0 or higher
90
+ Compatible up to: 3.9.1
91
+ Last Updated: 2014-7-23
92
+ Downloads: 14,993
93
+ Ratings
94
+ 4 stars
95
+ 4.7 out of 5 stars
96
+ 5 stars 2
97
+ 4 stars 1
98
+ 3 stars 0
99
+ 2 stars 0
100
+ 1 stars 0
101
+
102
+ Author
103
+ Team Vivacity
104
+ 13 plugins
105
+ Donate to this plugin »
106
+ Support
107
+
108
+ 1 of 10 support threads in the last two months have been resolved.
109
+
110
+ Got something to say? Need help?
111
+ View support forum
112
+ Compatibility
113
+ WordPress
114
+ + Plugin
115
+ =
116
+ Not enough data
117
+
118
+ 0 people say it works.
119
+ 0 people say it's broken.
120
+
121
+ Log in to vote.
122
+
123
+
124
+ == Changelog ==
125
+
126
+ = 1.4.2 =
127
+ * Added the option to List/Slider for the tweets. Now from the Slider option tweets can be show as a slider. A single tweet shows at a time after few second it will fade up by the next tweet.
128
+
129
+ = 1.4.1 =
130
+ * Squashed some css style conflicts with wordpress theme.
131
+
132
+ = 1.3 =
133
+ * Added the feature to change tweets theme.
134
+ * Added the option to show/hide border arround the tweets.
135
+
136
+ = 1.2 =
137
+ * Improved Fornt-End UI design.
138
+
139
+ = 1.1 =
140
+ * Boxed layout for tweets.
141
+ * Improved Twitter username validation in the widget.
142
+
143
+ = 1.0 =
144
+ * Initial release
145
+
146
+
js/responsiveslides.min.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /*! http://responsiveslides.com v1.54 by @viljamis */
2
+ (function(c,I,B){c.fn.responsiveSlides=function(l){var a=c.extend({auto:!0,speed:500,timeout:4E3,pager:!1,nav:!1,random:!1,pause:!1,pauseControls:!0,prevText:"Previous",nextText:"Next",maxwidth:"",navContainer:"",manualControls:"",namespace:"rslides",before:c.noop,after:c.noop},l);return this.each(function(){B++;var f=c(this),s,r,t,m,p,q,n=0,e=f.children(),C=e.size(),h=parseFloat(a.speed),D=parseFloat(a.timeout),u=parseFloat(a.maxwidth),g=a.namespace,d=g+B,E=g+"_nav "+d+"_nav",v=g+"_here",j=d+"_on",
3
+ w=d+"_s",k=c("<ul class='"+g+"_tabs "+d+"_tabs' />"),x={"float":"left",position:"relative",opacity:1,zIndex:2,width:"100%"},y={"float":"none",position:"absolute",opacity:0,zIndex:1,width:"100%"},F=function(){var b=(document.body||document.documentElement).style,a="transition";if("string"===typeof b[a])return!0;s=["Moz","Webkit","Khtml","O","ms"];var a=a.charAt(0).toUpperCase()+a.substr(1),c;for(c=0;c<s.length;c++)if("string"===typeof b[s[c]+a])return!0;return!1}(),z=function(b){a.before(b);F?(e.removeClass(j).css(y).eq(b).addClass(j).css(x),
4
+ n=b,setTimeout(function(){a.after(b)},h)):e.stop().fadeOut(h,function(){c(this).removeClass(j).css(y).css("opacity",1)}).eq(b).fadeIn(h,function(){c(this).addClass(j).css(x);a.after(b);n=b})};a.random&&(e.sort(function(){return Math.round(Math.random())-0.5}),f.empty().append(e));e.each(function(a){this.id=w+a});f.addClass(g+" "+d);l&&l.maxwidth&&f.css("max-width",u);e.hide().css(y).eq(0).addClass(j).css(x).show();F&&e.show().css({"-webkit-transition":"opacity "+h+"ms ease-in-out","-moz-transition":"opacity "+
5
+ h+"ms ease-in-out","-o-transition":"opacity "+h+"ms ease-in-out",transition:"opacity "+h+"ms ease-in-out"});if(1<e.size()){if(D<h+100)return;if(a.pager&&!a.manualControls){var A=[];e.each(function(a){a+=1;A+="<li><a href='#' class='"+w+a+"'>"+a+"</a></li>"});k.append(A);l.navContainer?c(a.navContainer).append(k):f.after(k)}a.manualControls&&(k=c(a.manualControls),k.addClass(g+"_tabs "+d+"_tabs"));(a.pager||a.manualControls)&&k.find("li").each(function(a){c(this).addClass(w+(a+1))});if(a.pager||a.manualControls)q=
6
+ k.find("a"),r=function(a){q.closest("li").removeClass(v).eq(a).addClass(v)};a.auto&&(t=function(){p=setInterval(function(){e.stop(!0,!0);var b=n+1<C?n+1:0;(a.pager||a.manualControls)&&r(b);z(b)},D)},t());m=function(){a.auto&&(clearInterval(p),t())};a.pause&&f.hover(function(){clearInterval(p)},function(){m()});if(a.pager||a.manualControls)q.bind("click",function(b){b.preventDefault();a.pauseControls||m();b=q.index(this);n===b||c("."+j).queue("fx").length||(r(b),z(b))}).eq(0).closest("li").addClass(v),
7
+ a.pauseControls&&q.hover(function(){clearInterval(p)},function(){m()});if(a.nav){g="<a href='#' class='"+E+" prev'>"+a.prevText+"</a><a href='#' class='"+E+" next'>"+a.nextText+"</a>";l.navContainer?c(a.navContainer).append(g):f.after(g);var d=c("."+d+"_nav"),G=d.filter(".prev");d.bind("click",function(b){b.preventDefault();b=c("."+j);if(!b.queue("fx").length){var d=e.index(b);b=d-1;d=d+1<C?n+1:0;z(c(this)[0]===G[0]?b:d);if(a.pager||a.manualControls)r(c(this)[0]===G[0]?b:d);a.pauseControls||m()}});
8
+ a.pauseControls&&d.hover(function(){clearInterval(p)},function(){m()})}}if("undefined"===typeof document.body.style.maxWidth&&l.maxwidth){var H=function(){f.css("width","100%");f.width()>u&&f.css("width",u)};H();c(I).bind("resize",function(){H()})}})}})(jQuery,this,0);
slider.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * HTML output for the Horizontal Slider style of widget.
4
+ */
5
+ ?>
6
+
7
+ <?php
8
+ // Prepare Classes
9
+ $classes[] = 'slider';
10
+ $classes[] = $widget_id;
11
+ ?>
12
+
13
+ <ul class="fetched_tweets <?php echo $class; ?> <?php echo implode(' ', $classes); ?>" data-timeout="10000" data-speed="1000" data-animation="fade">
14
+
15
+ <?php
16
+
17
+ $tweets_count = $wpltf_wdgt_tweets_cnt;
18
+ $name = $wpltf_wdgt_name;
19
+ $timeto_store = $wpltf_wdgt_store_time;
20
+ $consumerSecret = trim($wpltf_wdgt_consumerSecret);
21
+ $accessToken = trim($wpltf_wdgt_accessToken);
22
+ $accessTokenSecret = trim($wpltf_wdgt_accessTokenSecret);
23
+ $replies_excl = $widget_replies_excl;
24
+ $consumerKey = trim($wpltf_wdgt_consumerKey);
25
+ //$dataShowCount = ($wpltf_wdgt_dataShowCount != "true") ? "false" : "true";
26
+ $disp_screen_name = ($wpltf_wdgt_disp_scr_name != "true") ? "false" : "true";
27
+ $intents_text = $wpltf_wdgt_twitterIntentsText;
28
+ $color_intents = $wpltf_wdgt_intentColor;
29
+ $slide_style = $wpltf_wdgt_slide_style;
30
+ $cache_transient = $wpltf_wdgt_timeRef;
31
+ $alter_ago_time = $wpltf_wdgt_timeAgo;
32
+ $twitterIntents = $wpltf_wdgt_twitterIntents;
33
+ $showAvatar = $wpltf_wdgt_showAvatar;
34
+ $border_rad_avatar = $wpltf_wdgt_border_rad;
35
+ $transName = 'list-tweets-'.$name;
36
+ $backupName = $transName . '-backup';
37
+ if(false === ($tweets = get_transient($transName) ) ) :
38
+ $twitter_outh_path = WP_PLUGIN_DIR. '/wp-twitter-feeds/controller/twitteroauth/twitteroauth.php';
39
+ require_once ($twitter_outh_path);
40
+
41
+ $api_call = new TwitterOAuth(
42
+ $consumerKey,
43
+ $consumerSecret,
44
+ $accessToken,
45
+ $accessTokenSecret
46
+ );
47
+ $totalToFetch = ($replies_excl) ? max(50, $tweets_count * 3) : $tweets_count;
48
+
49
+ $fetchedTweets = $api_call->get(
50
+ 'statuses/user_timeline',
51
+ array(
52
+ 'screen_name' => $name,
53
+ 'count' => $totalToFetch,
54
+ 'replies_excl' => $replies_excl
55
+ )
56
+ );
57
+
58
+ if($api_call->http_code != 200) :
59
+ $tweets = get_option($backupName);
60
+
61
+ else :
62
+ $limitToDisplay = min($tweets_count, count($fetchedTweets));
63
+
64
+ for($i = 0; $i < $limitToDisplay; $i++) :
65
+ $tweet = $fetchedTweets[$i];
66
+ $name = $tweet->user->name;
67
+ $screen_name = $tweet->user->screen_name;
68
+ $permalink = 'http://twitter.com/'. $name .'/status/'. $tweet->id_str;
69
+ $tweet_id = $tweet->id_str;
70
+ $image = $tweet->user->profile_image_url;
71
+ $text = $this->sanitize_links($tweet);
72
+ $time = $tweet->created_at;
73
+ $time = date_parse($time);
74
+ $uTime = mktime($time['hour'], $time['minute'], $time['second'], $time['month'], $time['day'], $time['year']);
75
+ $tweets[] = array(
76
+ 'text' => $text,
77
+ 'scr_name'=>$screen_name,
78
+ 'favourite_count'=>$tweet->favorite_count,
79
+ 'retweet_count'=>$tweet->retweet_count,
80
+ 'name' => $name,
81
+ 'permalink' => $permalink,
82
+ 'image' => $image,
83
+ 'time' => $uTime,
84
+ 'tweet_id' => $tweet_id
85
+ );
86
+ endfor;
87
+ set_transient($transName, $tweets, 60 * $timeto_store);
88
+ update_option($backupName, $tweets);
89
+ endif;
90
+ endif;
91
+ if(!function_exists('twitter_time_diff'))
92
+ {
93
+ function twitter_time_diff( $from, $to = '' ) {
94
+ $diff = human_time_diff($from,$to);
95
+ $replace = array(
96
+ ' hour' => 'h',
97
+ ' hours' => 'h',
98
+ ' day' => 'd',
99
+ ' days' => 'd',
100
+ ' minute' => 'm',
101
+ ' minutes' => 'm',
102
+ ' second' => 's',
103
+ ' seconds' => 's',
104
+ );
105
+ return strtr($diff,$replace);
106
+ }
107
+ }
108
+ if($tweets) : ?>
109
+ <?php foreach($tweets as $t) : ?>
110
+ <li class="tweets_avatar">
111
+ <?php
112
+ echo '<div class="tweet_wrap"><div class="wdtf-user-card ltr">';
113
+ if ($showAvatar){
114
+
115
+ echo '<img ';
116
+ echo 'width="45px" height="45px"';
117
+ echo 'src="'.$t['image'].'" alt="Tweet Avatar" class="';
118
+ echo ($border_rad_avatar) ? 'circular':'';
119
+ echo '"/>';
120
+ }
121
+ if(!isset($screen_name)){$screen_name = $name;}
122
+
123
+ if($disp_screen_name!='false')
124
+ {
125
+ echo '<div class="wdtf-screen-name">';
126
+ echo "<span class=\"screen_name\">{$t['name']}</span><br>";
127
+ echo "<a href=\"https://twitter.com/{$screen_name}\" target=\"_blank\" dir=\"ltr\">@{$screen_name}</a></div>";
128
+
129
+ }
130
+ echo '<div class="clear"></div></div>';
131
+ ?>
132
+ <div class="tweet_data">
133
+ <?php echo $t['text']; ?>
134
+ </div>
135
+ <br/>
136
+ <div class="clear"></div>
137
+ <div class="times">
138
+ <em>
139
+
140
+ <a href="http://www.twitter.com/<?php echo $screen_name; ?>" target="_blank" title="Follow <?php echo $name; ?> on Twitter [Opens new window]">
141
+ <?php
142
+ if($cache_transient == "true"){
143
+ $timeDisplay = twitter_time_diff($t['time'], current_time('timestamp'));
144
+ }else{
145
+ $timeDisplay = human_time_diff($t['time'], current_time('timestamp'));
146
+ }
147
+ if($alter_ago_time == "true"){
148
+ $displayAgo = " ago";
149
+ }
150
+ printf(__('%1$s%2$s'), $timeDisplay, $displayAgo);
151
+
152
+ ?>
153
+ </a>
154
+ </em>
155
+ </div>
156
+ <?php if($twitterIntents == "true"){
157
+ ?>
158
+ <div class="tweets-intent-data">
159
+ <?php if($t['favourite_count']!=0 || $t['retweet_count']!=0){?>
160
+ <span class="stats-narrow customisable-border"><span class="stats" data-scribe="component:stats">
161
+ <?php if($t['retweet_count']!=0)
162
+ {?>
163
+ <a href="https://twitter.com/<?php echo $screen_name; ?>/statuses/<?php echo $t['tweet_id']; ?>" title="View Tweet on Twitter" data-scribe="element:favorite_count" target="_blank">
164
+ <span class="stats-favorites">
165
+ <strong><?php echo $t['retweet_count'];?></strong> retweet<?php if($t['retweet_count']>1)echo's';?>
166
+ </span>
167
+ </a>
168
+ <?php } ?>
169
+ <?php if($t['favourite_count']!=0)
170
+ {?>
171
+ <a href="https://twitter.com/<?php echo $screen_name; ?>/statuses/<?php echo $t['tweet_id']; ?>" title="View Tweet on Twitter" data-scribe="element:favorite_count" target="_blank">
172
+ <span class="stats-favorites">
173
+ <strong><?php echo $t['favourite_count'];?></strong> Favorite<?php if($t['favourite_count']>1)echo's';?>
174
+ </span>
175
+ </a>
176
+ <?php }?>
177
+
178
+ </span>
179
+ </span>
180
+ <div class="clear"></div>
181
+ <div class="seperator_wpltf"></div>
182
+ <?php }?>
183
+ <ul class="tweet-actions " role="menu" >
184
+ <li><a href="http://twitter.com/intent/tweet?in_reply_to=<?php echo $t['tweet_id']; ?>" data-lang="en" class="in-reply-to" title="Reply" target="_blank"><span aria-hidden="true" data-icon="&#xf079;" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
185
+ <li><a href="http://twitter.com/intent/retweet?tweet_id=<?php echo $t['tweet_id']; ?>" data-lang="en" class="retweet" title="Retweet" target="_blank"><span aria-hidden="true" data-icon="&#xf112;" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
186
+ <li><a href="http://twitter.com/intent/favorite?tweet_id=<?php echo $t['tweet_id']; ?>" data-lang="en" class="favorite" title="Favorite" target="_blank"><span aria-hidden="true" data-icon="&#xf005;" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
187
+ </ul>
188
+ </div>
189
+ <?php } ?>
190
+ <div class="clear"></div>
191
+ </div><div class="clear"></div>
192
+ </li>
193
+ <?php endforeach; ?>
194
+
195
+ <?php else : ?>
196
+ <li>Waiting for twitter.com...Try reloading the page again </li>
197
+ <?php endif; ?>
198
+ </ul>
views/slider.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * HTML output for the Horizontal Slider style of widget.
4
+ */
5
+ ?>
6
+
7
+ <?php
8
+ // Prepare Classes
9
+ $classes[] = 'slider';
10
+ $classes[] = $widget_id;
11
+ ?>
12
+
13
+ <ul class="fetched_tweets <?php echo $class; ?> <?php echo implode(' ', $classes); ?>" data-timeout="10000" data-speed="1000" data-animation="fade">
14
+
15
+ <?php
16
+
17
+ $tweets_count = $wpltf_wdgt_tweets_cnt;
18
+ $name = $wpltf_wdgt_name;
19
+ $timeto_store = $wpltf_wdgt_store_time;
20
+ $consumerSecret = trim($wpltf_wdgt_consumerSecret);
21
+ $accessToken = trim($wpltf_wdgt_accessToken);
22
+ $accessTokenSecret = trim($wpltf_wdgt_accessTokenSecret);
23
+ $replies_excl = $widget_replies_excl;
24
+ $consumerKey = trim($wpltf_wdgt_consumerKey);
25
+ //$dataShowCount = ($wpltf_wdgt_dataShowCount != "true") ? "false" : "true";
26
+ $disp_screen_name = ($wpltf_wdgt_disp_scr_name != "true") ? "false" : "true";
27
+ $intents_text = $wpltf_wdgt_twitterIntentsText;
28
+ $color_intents = $wpltf_wdgt_intentColor;
29
+ $slide_style = $wpltf_wdgt_slide_style;
30
+ $cache_transient = $wpltf_wdgt_timeRef;
31
+ $alter_ago_time = $wpltf_wdgt_timeAgo;
32
+ $twitterIntents = $wpltf_wdgt_twitterIntents;
33
+ $showAvatar = $wpltf_wdgt_showAvatar;
34
+ $border_rad_avatar = $wpltf_wdgt_border_rad;
35
+ $transName = 'list-tweets-'.$name;
36
+ $backupName = $transName . '-backup';
37
+ if(false === ($tweets = get_transient($transName) ) ) :
38
+ $twitter_outh_path = WP_PLUGIN_DIR. '/wp-twitter-feeds/controller/twitteroauth/twitteroauth.php';
39
+ require_once ($twitter_outh_path);
40
+
41
+ $api_call = new TwitterOAuth(
42
+ $consumerKey,
43
+ $consumerSecret,
44
+ $accessToken,
45
+ $accessTokenSecret
46
+ );
47
+ $totalToFetch = ($replies_excl) ? max(50, $tweets_count * 3) : $tweets_count;
48
+
49
+ $fetchedTweets = $api_call->get(
50
+ 'statuses/user_timeline',
51
+ array(
52
+ 'screen_name' => $name,
53
+ 'count' => $totalToFetch,
54
+ 'replies_excl' => $replies_excl
55
+ )
56
+ );
57
+
58
+ if($api_call->http_code != 200) :
59
+ $tweets = get_option($backupName);
60
+
61
+ else :
62
+ $limitToDisplay = min($tweets_count, count($fetchedTweets));
63
+
64
+ for($i = 0; $i < $limitToDisplay; $i++) :
65
+ $tweet = $fetchedTweets[$i];
66
+ $name = $tweet->user->name;
67
+ $screen_name = $tweet->user->screen_name;
68
+ $permalink = 'http://twitter.com/'. $name .'/status/'. $tweet->id_str;
69
+ $tweet_id = $tweet->id_str;
70
+ $image = $tweet->user->profile_image_url;
71
+ $text = $this->sanitize_links($tweet);
72
+ $time = $tweet->created_at;
73
+ $time = date_parse($time);
74
+ $uTime = mktime($time['hour'], $time['minute'], $time['second'], $time['month'], $time['day'], $time['year']);
75
+ $tweets[] = array(
76
+ 'text' => $text,
77
+ 'scr_name'=>$screen_name,
78
+ 'favourite_count'=>$tweet->favorite_count,
79
+ 'retweet_count'=>$tweet->retweet_count,
80
+ 'name' => $name,
81
+ 'permalink' => $permalink,
82
+ 'image' => $image,
83
+ 'time' => $uTime,
84
+ 'tweet_id' => $tweet_id
85
+ );
86
+ endfor;
87
+ set_transient($transName, $tweets, 60 * $timeto_store);
88
+ update_option($backupName, $tweets);
89
+ endif;
90
+ endif;
91
+ if(!function_exists('twitter_time_diff'))
92
+ {
93
+ function twitter_time_diff( $from, $to = '' ) {
94
+ $diff = human_time_diff($from,$to);
95
+ $replace = array(
96
+ ' hour' => 'h',
97
+ ' hours' => 'h',
98
+ ' day' => 'd',
99
+ ' days' => 'd',
100
+ ' minute' => 'm',
101
+ ' minutes' => 'm',
102
+ ' second' => 's',
103
+ ' seconds' => 's',
104
+ );
105
+ return strtr($diff,$replace);
106
+ }
107
+ }
108
+ if($tweets) : ?>
109
+ <?php foreach($tweets as $t) : ?>
110
+ <li class="tweets_avatar">
111
+ <?php
112
+ echo '<div class="tweet_wrap"><div class="wdtf-user-card ltr">';
113
+ if ($showAvatar){
114
+
115
+ echo '<img ';
116
+ echo 'width="45px" height="45px"';
117
+ echo 'src="'.$t['image'].'" alt="Tweet Avatar" class="';
118
+ echo ($border_rad_avatar) ? 'circular':'';
119
+ echo '"/>';
120
+ }
121
+ if(!isset($screen_name)){$screen_name = $name;}
122
+
123
+ if($disp_screen_name!='false')
124
+ {
125
+ echo '<div class="wdtf-screen-name">';
126
+ echo "<span class=\"screen_name\">{$t['name']}</span><br>";
127
+ echo "<a href=\"https://twitter.com/{$screen_name}\" target=\"_blank\" dir=\"ltr\">@{$screen_name}</a></div>";
128
+
129
+ }
130
+ echo '<div class="clear"></div></div>';
131
+ ?>
132
+ <div class="tweet_data">
133
+ <?php echo $t['text']; ?>
134
+ </div>
135
+ <br/>
136
+ <div class="clear"></div>
137
+ <div class="times">
138
+ <em>
139
+
140
+ <a href="http://www.twitter.com/<?php echo $screen_name; ?>" target="_blank" title="Follow <?php echo $name; ?> on Twitter [Opens new window]">
141
+ <?php
142
+ if($cache_transient == "true"){
143
+ $timeDisplay = twitter_time_diff($t['time'], current_time('timestamp'));
144
+ }else{
145
+ $timeDisplay = human_time_diff($t['time'], current_time('timestamp'));
146
+ }
147
+ if($alter_ago_time == "true"){
148
+ $displayAgo = " ago";
149
+ }
150
+ printf(__('%1$s%2$s'), $timeDisplay, $displayAgo);
151
+
152
+ ?>
153
+ </a>
154
+ </em>
155
+ </div>
156
+ <?php if($twitterIntents == "true"){
157
+ ?>
158
+ <div class="tweets-intent-data">
159
+ <?php if($t['favourite_count']!=0 || $t['retweet_count']!=0){?>
160
+ <span class="stats-narrow customisable-border"><span class="stats" data-scribe="component:stats">
161
+ <?php if($t['retweet_count']!=0)
162
+ {?>
163
+ <a href="https://twitter.com/<?php echo $screen_name; ?>/statuses/<?php echo $t['tweet_id']; ?>" title="View Tweet on Twitter" data-scribe="element:favorite_count" target="_blank">
164
+ <span class="stats-favorites">
165
+ <strong><?php echo $t['retweet_count'];?></strong> retweet<?php if($t['retweet_count']>1)echo's';?>
166
+ </span>
167
+ </a>
168
+ <?php } ?>
169
+ <?php if($t['favourite_count']!=0)
170
+ {?>
171
+ <a href="https://twitter.com/<?php echo $screen_name; ?>/statuses/<?php echo $t['tweet_id']; ?>" title="View Tweet on Twitter" data-scribe="element:favorite_count" target="_blank">
172
+ <span class="stats-favorites">
173
+ <strong><?php echo $t['favourite_count'];?></strong> Favorite<?php if($t['favourite_count']>1)echo's';?>
174
+ </span>
175
+ </a>
176
+ <?php }?>
177
+
178
+ </span>
179
+ </span>
180
+ <div class="clear"></div>
181
+ <div class="seperator_wpltf"></div>
182
+ <?php }?>
183
+ <ul class="tweet-actions " role="menu" >
184
+ <li><a href="http://twitter.com/intent/tweet?in_reply_to=<?php echo $t['tweet_id']; ?>" data-lang="en" class="in-reply-to" title="Reply" target="_blank"><span aria-hidden="true" data-icon="&#xf079;" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
185
+ <li><a href="http://twitter.com/intent/retweet?tweet_id=<?php echo $t['tweet_id']; ?>" data-lang="en" class="retweet" title="Retweet" target="_blank"><span aria-hidden="true" data-icon="&#xf112;" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
186
+ <li><a href="http://twitter.com/intent/favorite?tweet_id=<?php echo $t['tweet_id']; ?>" data-lang="en" class="favorite" title="Favorite" target="_blank"><span aria-hidden="true" data-icon="&#xf005;" <?php echo ($color_intents) ? 'style="color:'.$color_intents.';"' :''; ?>></span></a></li>
187
+ </ul>
188
+ </div>
189
+ <?php } ?>
190
+ <div class="clear"></div>
191
+ </div><div class="clear"></div>
192
+ </li>
193
+ <?php endforeach; ?>
194
+
195
+ <?php else : ?>
196
+ <li>Waiting for twitter.com...Try reloading the page again </li>
197
+ <?php endif; ?>
198
+ </ul>
wp-latest-twitter-tweets.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Twitter Feeds
4
  Plugin URI: http://www.vivacityinfotech.net/
5
  Description: Displays latest tweets from your Twitter account using Twitter oAuth API 1.1.
6
  Author: Vivacity Infotech Pvt. Ltd.
7
- Version: 1.4.2
8
  Author URI: http://www.vivacityinfotech.net/
9
 
10
  Copyright 2014 Vivacity InfoTech Pvt. Ltd. (email : support@vivacityinfotech.com)
4
  Plugin URI: http://www.vivacityinfotech.net/
5
  Description: Displays latest tweets from your Twitter account using Twitter oAuth API 1.1.
6
  Author: Vivacity Infotech Pvt. Ltd.
7
+ Version: 1.4.3
8
  Author URI: http://www.vivacityinfotech.net/
9
 
10
  Copyright 2014 Vivacity InfoTech Pvt. Ltd. (email : support@vivacityinfotech.com)
wp-latest-twitter-tweets.php~ ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WP Twitter Feeds
4
+ Plugin URI: http://www.vivacityinfotech.net/
5
+ Description: Displays latest tweets from your Twitter account using Twitter oAuth API 1.1.
6
+ Author: Vivacity Infotech Pvt. Ltd.
7
+ Version: 1.4.1
8
+ Author URI: http://www.vivacityinfotech.net/
9
+
10
+ Copyright 2014 Vivacity InfoTech Pvt. Ltd. (email : support@vivacityinfotech.com)
11
+
12
+ This program is free software; you can redistribute it and/or modify
13
+ it under the terms of the GNU General Public License, version 2, as
14
+ published by the Free Software Foundation.
15
+
16
+ This program is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with this program; if not, write to the Free Software
23
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
+
25
+ */
26
+ include('twitter_usr_validation.php');
27
+ require_once('controller/twitter_widget.class.php');
28
+ add_action( 'widgets_init', 'wpltf_reg_widget');
29
+ function wpltf_reg_widget()
30
+ {
31
+
32
+ register_widget("wptt_TwitterTweets");
33
+ }
34
+
35
+ add_filter('plugin_row_meta', 'add_meta_links',10, 2);
36
+ function add_meta_links($links, $file) {
37
+ if ( strpos( $file, 'wp-latest-twitter-tweets.php' ) !== false ) {
38
+ $links[] = '<a href="http://wordpress.org/support/plugin/wp-twitter-feeds">Support</a>';
39
+ $links[] = '<a href="http://bit.ly/1icl56K">Donate</a>';
40
+ }
41
+ return $links;
42
+ }
43
+ ?>