Weblizar Twitter Widget - Version 0.2

Version Description

  • resolved css error.
Download this release

Release Info

Developer weblizar
Plugin Icon 128x128 Weblizar Twitter Widget
Version 0.2
Comparing to
See all releases

Version 0.2

Files changed (5) hide show
  1. readme.txt +92 -0
  2. screenshot-1.png +0 -0
  3. screenshot-2.png +0 -0
  4. screenshot-3.png +0 -0
  5. twitter-tweets.php +232 -0
readme.txt ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Tweets ===
2
+ Contributors: weblizar
3
+ Donate link: http://www.weblizar.com/
4
+ Tags: twitter, twitter plugin, button, connect, follow button, tvet, tvett, tvit, tviter, tvitt, tweet, tweeter, twett, twit, twiter, twitter connect, tweet, twitter connect, twitter follow, twitter follow button, twitter share, twitter share button, social, button, social button, stream, tweets, twitter widget, latest tweets, add tweet, twitter shortcode, twitter button, reply, follow me, like, follow, twitter news, tweets
5
+ Requires at least: 3.0
6
+ Tested up to: 3.9.1
7
+ Stable tag: 0.2
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+
12
+ Twitter Tweets Display your tweets on your website with follow button.
13
+
14
+ == Description ==
15
+
16
+ Twitter tweets plugin is a twitter widget plugin display twitter accounts latest tweets on your WordPress blog.
17
+
18
+ Twitter tweets plugin allows you to set your twitter account widget Id & twitter username. You can customize twitter widget by apply custom height, auto expand tweets images, custom link URL color, On / Off tweets reply etc.
19
+
20
+ Using **Twitter Tweets** widget display your least tweets on your WordPress blog site.
21
+
22
+ **Features**
23
+
24
+ * Twitter Tweets Widget
25
+ * Widget Customization Settings
26
+ * Widget Title
27
+ * Widget Theme Option
28
+ * Set Widget Height
29
+ * Tweets URL Link Color Option
30
+ * Show/Hide Tweets Reply
31
+ * Add Follow Button
32
+ * Submit Your Tweet live on your website
33
+ * Re tweet and choose your favourite tweets
34
+ * Auto Expand Photos in Tweets
35
+
36
+
37
+ == Features ==
38
+ * Twitter Tweets Widget
39
+ * Widget Customization Settings
40
+ * Widget Title
41
+ * Widget Theme Option
42
+ * Set Widget Height
43
+ * Tweets URL Link Color Option
44
+ * Show/Hide Tweets Reply
45
+ * Auto Expand Photos in Tweets
46
+
47
+ = Docs & Support =
48
+
49
+ You can find [docs](http://weblizar.com/twitter-tweets/), [FAQ](http://www.weblizar.com/faq/) and more detailed information about Twitter Tweets on [Weblizar](http://www.weblizar.com). If you were unable to find the answer to your question on the FAQ or in any of the documentation, you should check the [support forum](http://weblizar.com/twitter-tweets/) on WordPress.org.
50
+
51
+ = We Need Your Support =
52
+
53
+ It is really hard to continue development and support for this free plugin without contributions from users like you. If you are enjoying using our Testimonial plugin and find it useful, then please consider [__Making a Donation__](http://www.weblizar.com). Your donation will help us to encourage and support the plugin's continued development and better user support.
54
+
55
+
56
+ = Translators =
57
+
58
+ Please contribute to translate our plugin. Contact at `lizarweb (at) gmail (dot) com`.
59
+
60
+ == Installation ==
61
+
62
+ 1. Upload the entire `twitter-tweets` folder to the `/wp-content/plugins/` directory.
63
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
64
+ 3. Go to Widgets in Appearance Menu and activate the **Twitter Tweets** widget.
65
+
66
+ == Frequently Asked Questions ==
67
+
68
+ Please use WordPress support forum to ask any query regarding any issue.
69
+
70
+ == Screenshots ==
71
+
72
+ 1. Twitter Tweets Widget Preview
73
+ 2. Twitter Tweets Widget Settings
74
+ 3. Twitter Tweets Widget Preview On Site
75
+
76
+ == Changelog ==
77
+
78
+ For more information, see Weblizar(http://wwww.weblizar.com/).
79
+
80
+ = 0.2 =
81
+
82
+ * resolved css error.
83
+
84
+ = 0.1 =
85
+
86
+ * Widget Customization Settings
87
+ * Widget Title
88
+ * Widget Theme Option
89
+ * Set Widget Height
90
+ * Tweets URL Link Color Option
91
+ * Show/Hide Tweets Reply
92
+ * Auto Expand Photos in Tweets
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
twitter-tweets.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Twitter Tweets
4
+ * Version: 0.2
5
+ * Description: Display latest tweets on WordPress blog from Twitter account.
6
+ * Author: WebLizar
7
+ * Author URI: http://www.weblizar.com
8
+ * Plugin URI: http://www.weblizar.com/plugins/
9
+ *
10
+ * This program is free software; you can redistribute it and/or
11
+ * modify it under the terms of the GNU General Public License
12
+ * as published by the Free Software Foundation; either version 2
13
+ * of the License, or (at your option) any later version.
14
+ *
15
+ * This program is distributed in the hope that it will be useful,
16
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ * GNU General Public License for more details.
19
+ *
20
+ * You should have received a copy of the GNU General Public License
21
+ * along with this program; if not, write to the Free Software
22
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
+ */
24
+
25
+ /**
26
+ * Constant Values & Variables
27
+ */
28
+ define("WEBLIZAR_TWITTER_PLUGIN_URL", plugin_dir_url(__FILE__));
29
+ define("WEBLIZAR_TWITTER_TEXT_DOMAIN", "weblizar_twitter");
30
+
31
+ /**
32
+ * Widget Code
33
+ */
34
+
35
+ /**
36
+ * Adds Foo_Widget widget.
37
+ */
38
+ class WeblizarTwitter extends WP_Widget {
39
+
40
+ /**
41
+ * Register widget with WordPress.
42
+ */
43
+ function __construct() {
44
+ parent::__construct(
45
+ 'weblizar_twitter', // Base ID
46
+ 'Twitter Tweets', // Name
47
+ array( 'description' => __( 'Display latest tweets from your Twitter account', WEBLIZAR_TWITTER_TEXT_DOMAIN ), ) // Args
48
+ );
49
+ }
50
+
51
+ /**
52
+ * Front-end display of widget.
53
+ *
54
+ * @see WP_Widget::widget()
55
+ *
56
+ * @param array $args Widget arguments.
57
+ * @param array $instance Saved values from database.
58
+ */
59
+ public function widget( $args, $instance ) {
60
+ $TwitterUserName = apply_filters( 'weblizar_twitter_user_name', $instance['TwitterUserName'] );
61
+ $Theme = apply_filters( 'weblizar_twitter_theme', $instance['Theme'] );
62
+ $Height = apply_filters( 'weblizar_twitter_height', $instance['Height'] );
63
+ $Width = apply_filters( 'weblizar_twitter_width', $instance['Width'] );
64
+ $LinkColor = apply_filters( 'weblizar_twitter_link_color', $instance['LinkColor'] );
65
+ $ExcludeReplies = apply_filters( 'weblizar_twitter_exclude_replies', $instance['ExcludeReplies'] );
66
+ $AutoExpandPhotos = apply_filters( 'weblizar_twitter_auto_expand_photo', $instance['AutoExpandPhotos'] );
67
+ $TwitterWidgetId = apply_filters( 'weblizar_twitter_widget_id', $instance['TwitterWidgetId'] );
68
+ ?>
69
+ <!--generated code-->
70
+ <!--<a class="twitter-timeline" href="https://twitter.com/weblizar" data-widget-id="462084801944485888">Tweets by @weblizar</a>
71
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>-->
72
+
73
+ <!--default development code-->
74
+ <!--<a class="twitter-timeline"
75
+ href="https://twitter.com/weblizar"
76
+ data-screen-name="weblizar"
77
+ data-widget-id="462084801944485888"
78
+ data-related="twitterapi,twitter"
79
+ data-aria-polite="assertive"
80
+ data-tweet-limit="5"
81
+ lang="EN">Tweets by @weblizar</a>-->
82
+
83
+ <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo $TwitterUserName; ?>" min-width="<?php echo $Width; ?>" height="<?php echo $Height; ?>" data-theme="<?php echo $Theme; ?>" data-link-color="<?php echo $LinkColor; ?>px" data-widget-id="<?php echo $TwitterWidgetId; ?>">Twitter Tweets</a>
84
+ <script>
85
+ !function(d,s,id) {
86
+ var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}
87
+ } (document,"script","twitter-wjs");
88
+ </script>
89
+ <?php
90
+ }
91
+
92
+ /**
93
+ * Back-end widget form.
94
+ *
95
+ * @see WP_Widget::form()
96
+ *
97
+ * @param array $instance Previously saved values from database.
98
+ */
99
+ public function form( $instance ) {
100
+
101
+ if ( isset( $instance[ 'TwitterUserName' ] ) ) {
102
+ $TwitterUserName = $instance[ 'TwitterUserName' ];
103
+ } else {
104
+ $TwitterUserName = "weblizar";
105
+ }
106
+
107
+ if ( isset( $instance[ 'Theme' ] ) ) {
108
+ $Theme = $instance[ 'Theme' ];
109
+ } else {
110
+ $Theme = "light";
111
+ }
112
+
113
+ $Height = "450";
114
+ if ( isset( $instance[ 'Height' ] ) ) {
115
+ $Height = $instance[ 'Height' ];
116
+ }
117
+
118
+ $Width = "";
119
+ if ( isset( $instance[ 'Width' ] ) ) {
120
+ $Width = $instance[ 'Width' ];
121
+ }
122
+
123
+ if ( isset( $instance[ 'LinkColor' ] ) ) {
124
+ $LinkColor = $instance[ 'LinkColor' ];
125
+ } else {
126
+ $LinkColor = "#CC0000";
127
+ }
128
+
129
+ if ( isset( $instance[ 'ExcludeReplies' ] ) ) {
130
+ $ExcludeReplies = $instance[ 'ExcludeReplies' ];
131
+ } else {
132
+ $ExcludeReplies = "yes";
133
+ }
134
+
135
+ if ( isset( $instance[ 'AutoExpandPhotos' ] ) ) {
136
+ $AutoExpandPhotos = $instance[ 'AutoExpandPhotos' ];
137
+ } else {
138
+ $AutoExpandPhotos = "yes";
139
+ }
140
+
141
+ if ( isset( $instance[ 'TwitterWidgetId' ] ) ) {
142
+ $TwitterWidgetId = $instance[ 'TwitterWidgetId' ];
143
+ } else {
144
+ $TwitterWidgetId = "462084801944485888";
145
+ }
146
+ ?>
147
+
148
+ <p>
149
+ <label for="<?php echo $this->get_field_id( 'TwitterUserName' ); ?>"><?php _e( 'Twitter Username' ); ?></label>
150
+ <input class="widefat" id="<?php echo $this->get_field_id( 'TwitterUserName' ); ?>" name="<?php echo $this->get_field_name( 'TwitterUserName' ); ?>" type="text" value="<?php echo esc_attr( $TwitterUserName ); ?>">
151
+ </p>
152
+
153
+ <p>
154
+ <label for="<?php echo $this->get_field_id( 'TwitterWidgetId' ); ?>"><?php _e( 'Twitter Widget Id' ); ?> (Required)</label>
155
+ <input class="widefat" id="<?php echo $this->get_field_id( 'TwitterWidgetId' ); ?>" name="<?php echo $this->get_field_name( 'TwitterWidgetId' ); ?>" type="text" value="<?php echo esc_attr( $TwitterWidgetId ); ?>">
156
+ Get Your Twitter Widget Id: <a href="https://dev.twitter.com/discussions/20722" target="_blank">HERE</a>
157
+ </p>
158
+
159
+ <p>
160
+ <label for="<?php echo $this->get_field_id( 'Theme' ); ?>"><?php _e( 'Theme' ); ?></label>
161
+ <select id="<?php echo $this->get_field_id( 'Theme' ); ?>" name="<?php echo $this->get_field_name( 'Theme' ); ?>">
162
+ <option value="light" <?php if($Theme == "light") echo "selected=selected" ?>>Light</option>
163
+ <option value="dark" <?php if($Theme == "dark") echo "selected=selected" ?>>Dark</option>
164
+ </select>
165
+ </p>
166
+
167
+ <p>
168
+ <label for="<?php echo $this->get_field_id( 'Height' ); ?>"><?php _e( 'Height' ); ?></label>
169
+ <input class="widefat" id="<?php echo $this->get_field_id( 'Height' ); ?>" name="<?php echo $this->get_field_name( 'Height' ); ?>" type="text" value="<?php echo esc_attr( $Height ); ?>">
170
+ </p>
171
+
172
+ <!--<p>
173
+ <label for="<?php /*echo $this->get_field_id( 'Width' ); */?>"><?php /*_e( 'Width' ); */?></label>
174
+ <input class="widefat" id="<?php /*echo $this->get_field_id( 'Width' ); */?>" name="<?php /*echo $this->get_field_name( 'Width' ); */?>" type="text" value="<?php /*echo esc_attr( $Width ); */?>">
175
+ </p>-->
176
+
177
+ <p>
178
+ <label for="<?php echo $this->get_field_id( 'LinkColor' ); ?>"><?php _e( 'URL Link Color:' ); ?></label>
179
+ <input class="widefat" id="<?php echo $this->get_field_id( 'LinkColor' ); ?>" name="<?php echo $this->get_field_name( 'LinkColor' ); ?>" type="text" value="<?php echo esc_attr( $LinkColor ); ?>">
180
+ Find More Color Codes <a href="http://html-color-codes.info/" target="_blank">HERE</a>
181
+ </p>
182
+
183
+ <p>
184
+ <label for="<?php echo $this->get_field_id( 'ExcludeReplies' ); ?>"><?php _e( 'Exclude Replies on Tweets' ); ?></label>
185
+ <select id="<?php echo $this->get_field_id( 'ExcludeReplies' ); ?>" name="<?php echo $this->get_field_name( 'ExcludeReplies' ); ?>">
186
+ <option value="yes" <?php if($ExcludeReplies == "yes") echo "selected=selected" ?>>Yes</option>
187
+ <option value="no" <?php if($ExcludeReplies == "no") echo "selected=selected" ?>>No</option>
188
+ </select>
189
+ </p>
190
+
191
+ <p>
192
+ <label for="<?php echo $this->get_field_id( 'AutoExpandPhotos' ); ?>"><?php _e( 'Auto Expand Photos in Tweets' ); ?></label>
193
+ <select id="<?php echo $this->get_field_id( 'AutoExpandPhotos' ); ?>" name="<?php echo $this->get_field_name( 'AutoExpandPhotos' ); ?>">
194
+ <option value="yes" <?php if($AutoExpandPhotos == "yes") echo "selected=selected" ?>>Yes</option>
195
+ <option value="no" <?php if($AutoExpandPhotos == "no") echo "selected=selected" ?>>No</option>
196
+ </select>
197
+ </p>
198
+
199
+ <?php
200
+ }
201
+
202
+ /**
203
+ * Sanitize widget form values as they are saved.
204
+ *
205
+ * @see WP_Widget::update()
206
+ *
207
+ * @param array $new_instance Values just sent to be saved.
208
+ * @param array $old_instance Previously saved values from database.
209
+ *
210
+ * @return array Updated safe values to be saved.
211
+ */
212
+ public function update( $new_instance, $old_instance ) {
213
+ $instance = array();
214
+ $instance['TwitterUserName'] = ( ! empty( $new_instance['TwitterUserName'] ) ) ? strip_tags( $new_instance['TwitterUserName'] ) : 'weblizar';
215
+ $instance['Theme'] = ( ! empty( $new_instance['Theme'] ) ) ? strip_tags( $new_instance['Theme'] ) : 'light';
216
+ $instance['Height'] = ( ! empty( $new_instance['Height'] ) ) ? strip_tags( $new_instance['Height'] ) : '450';
217
+ $instance['Width'] = ( ! empty( $new_instance['Width'] ) ) ? strip_tags( $new_instance['Width'] ) : '';
218
+ $instance['LinkColor'] = ( ! empty( $new_instance['LinkColor'] ) ) ? strip_tags( $new_instance['LinkColor'] ) : '#CC0000';
219
+ $instance['ExcludeReplies'] = ( ! empty( $new_instance['ExcludeReplies'] ) ) ? strip_tags( $new_instance['ExcludeReplies'] ) : 'yes';
220
+ $instance['AutoExpandPhotos'] = ( ! empty( $new_instance['AutoExpandPhotos'] ) ) ? strip_tags( $new_instance['AutoExpandPhotos'] ) : 'yes';
221
+ $instance['TwitterWidgetId'] = ( ! empty( $new_instance['TwitterWidgetId'] ) ) ? strip_tags( $new_instance['TwitterWidgetId'] ) : '462084801944485888';
222
+ return $instance;
223
+ }
224
+
225
+ } // end of class WeblizarTwitter
226
+
227
+ // register WeblizarTwitter widget
228
+ function WeblizarTwitterWidget() {
229
+ register_widget( 'WeblizarTwitter' );
230
+ }
231
+ add_action( 'widgets_init', 'WeblizarTwitterWidget' );
232
+ ?>