Weblizar Twitter Widget - Version 1.9.5

Version Description

[18-08-2020] * Fixed : PHP 7.4.8 (minor fix).

Download this release

Release Info

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

Code changes from version 1.9.4 to 1.9.5

readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: weblizar
3
  Donate link: https://www.weblizar.com/
4
  Tags: twitter, tweets, twitter tweets, twitter widget, twitter wordPress plugin, twitter feed
5
  Requires at least: 3.8
6
- Tested up to: 5.4
7
- Stable tag: 1.9.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -113,6 +113,9 @@ Please use WordPress support forum to ask any query regarding any issue.
113
 
114
  For more information, see Weblizar(https://weblizar.com/)
115
 
 
 
 
116
  = 1.9.4 =[01-06-2020]
117
  * Minor bug fix.
118
 
3
  Donate link: https://www.weblizar.com/
4
  Tags: twitter, tweets, twitter tweets, twitter widget, twitter wordPress plugin, twitter feed
5
  Requires at least: 3.8
6
+ Tested up to: 5.5
7
+ Stable tag: 1.9.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
113
 
114
  For more information, see Weblizar(https://weblizar.com/)
115
 
116
+ = 1.9.5 =[18-08-2020]
117
+ * Fixed : PHP 7.4.8 (minor fix).
118
+
119
  = 1.9.4 =[01-06-2020]
120
  * Minor bug fix.
121
 
twiiter_help.php CHANGED
@@ -1,127 +1,132 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <script type="text/javascript">
3
- function SaveSettings() {
4
- var FbAppId = jQuery("#twitter-page-id-fetch").val();
5
- var User_name_3 = jQuery("#twitter-page-user-name").val();
6
- var show_theme = jQuery("#show-theme-background").val();
7
- var Height = jQuery("#twitter-page-url-Height").val();
8
- var link_color = jQuery("#twitter-page-lnk-Color").val();
9
- var replieses = jQuery("#exclude_replies_23").val();
10
- var photos_acces = jQuery("#photo_1234").val();
11
- var tw_language = jQuery("#tw_language").val();
12
- if(!FbAppId) {
13
- jQuery("#twitter-page-id-fetch").focus();
14
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
- jQuery("#fb-save-settings").hide();
17
- jQuery("#fb-img").show();
18
- jQuery.ajax({
19
- url: location.href,
20
- type: "POST",
21
- data: jQuery("form#fb-form").serialize(),
22
- dataType: "html",
23
- //Do not cache the page
24
- cache: false,
25
- //success
26
- success: function (html) {
27
- jQuery("#fb-img").hide();
28
- jQuery("#fb-msg").show();
29
- setTimeout(function() {location.reload(true);}, 2000);
30
  }
31
- });
32
- }
33
 
34
- function SaveApiSettings() {
35
- var wl_twitter_consumer_key = jQuery("#wl_twitter_consumer_key").val();
36
- var wl_twitter_consumer_secret = jQuery("#wl_twitter_consumer_secret").val();;
37
- var wl_twitter_access_token = jQuery("#wl_twitter_access_token").val();;
38
- var wl_twitter_token_secret = jQuery("#wl_twitter_token_secret").val();;
39
- if( ! wl_twitter_consumer_key ) {
40
- jQuery("#wl_twitter_consumer_key").focus();
41
- return false;
42
- }
43
-
44
- if( ! wl_twitter_consumer_secret ) {
45
- jQuery("#wl_twitter_consumer_secret").focus();
46
- return false;
47
- }
48
-
49
- if( ! wl_twitter_access_token ) {
50
- jQuery("#wl_twitter_access_token").focus();
51
- return false;
52
- }
53
-
54
- if( ! wl_twitter_token_secret ) {
55
- jQuery("#wl_twitter_token_secret").focus();
56
- return false;
57
- }
58
- jQuery("#fb-api-save-settings").hide();
59
- jQuery("#twitter-img").show();
60
- jQuery.ajax({
61
- url: location.href,
62
- type: "POST",
63
- data: jQuery("form#api-form").serialize(),
64
- dataType: "html",
65
- //Do not cache the page
66
- cache: false,
67
- //success
68
- success: function (html) {
69
- jQuery("#twitter-img").hide();
70
- jQuery("#wl_twitter_preview").show();
71
- setTimeout(function() {location.reload(true);}, 2000);
72
  }
73
- });
74
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  </script>
76
  <?php
77
- wp_enqueue_style('font-awesome', WEBLIZAR_TWITTER_PLUGIN_URL. 'css/all.min.css');
78
- wp_enqueue_style('wl_bootstrap', WEBLIZAR_TWITTER_PLUGIN_URL. 'css/bootstrap.min.css');
79
 
80
- if(isset($_REQUEST['twitter-page-user_name'])) {
81
 
82
- if ( ! current_user_can( 'manage_options' ) || ! wp_verify_nonce( $_POST['feeds-widget'], 'save-feeds-widget' ) ) {
83
  die;
84
  }
85
 
86
- $TwitterUserName = sanitize_text_field( $_REQUEST['twitter-page-user_name'] );
87
- $Theme = sanitize_text_field( $_REQUEST['show-theme-background'] );
88
- $Height = sanitize_text_field( $_REQUEST['twitter-page-url-Height'] );
89
- $TwitterWidgetId = sanitize_text_field( $_REQUEST['twitter-page-id-fetch'] );
90
- $LinkColor = sanitize_hex_color( $_REQUEST['twitter-page-lnk-Color'] );
91
- $ExcludeReplies = sanitize_text_field ( $_REQUEST['exclude_replies_23'] );
92
- $AutoExpandPhotos = sanitize_text_field ( $_REQUEST['photo_1234'] );
93
- $tw_language = sanitize_text_field ( $_REQUEST['tw_language'] );
94
 
95
  $TwitterSettingsArray = serialize(
96
- array(
97
- 'TwitterUserName' => $TwitterUserName,
98
- 'Theme' => $Theme,
99
- 'Height' => $Height,
100
- 'TwitterWidgetId' => $TwitterWidgetId,
101
- 'LinkColor' => $LinkColor,
102
- 'ExcludeReplies' => $ExcludeReplies,
103
- 'AutoExpandPhotos' => $AutoExpandPhotos,
104
- 'tw_language' => $tw_language,
105
- ));
 
106
  update_option("ali_twitter_shortcode", $TwitterSettingsArray);
107
  }
108
 
109
  /* Twitter api key save */
110
 
111
- if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_api_nonce'] ) ) {
112
 
113
- if ( ! current_user_can( 'manage_options' ) || ! wp_verify_nonce( $_POST['twitter_api_nonce'], 'twitter_api_nonce' ) ) {
114
  die;
115
  }
116
 
117
- $wl_twitter_consumer_key = sanitize_text_field( $_REQUEST['wl_twitter_consumer_key'] );
118
- $wl_twitter_consumer_secret = sanitize_text_field( $_REQUEST['wl_twitter_consumer_secret'] );
119
- $wl_twitter_access_token = sanitize_text_field( $_REQUEST['wl_twitter_access_token'] );
120
- $wl_twitter_token_secret = sanitize_text_field( $_REQUEST['wl_twitter_token_secret'] );
121
 
122
- $wl_twitter_tweets = ( isset( $_REQUEST['wl_twitter_tweets'] ) ) ? sanitize_text_field( $_REQUEST['wl_twitter_tweets'] ) : '4';
123
 
124
- $wl_twitter_layout = ( isset( $_REQUEST['wl_twitter_layout'] ) ) ? sanitize_text_field( $_REQUEST['wl_twitter_layout'] ) : '3';
125
 
126
  $twitter_api_settings = array(
127
  'wl_twitter_consumer_key' => $wl_twitter_consumer_key,
@@ -132,101 +137,102 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
132
  'wl_twitter_layout' => $wl_twitter_layout
133
  );
134
 
135
- update_option( 'wl_twitter_api_settings', $twitter_api_settings );
136
  }
137
  ?>
138
  <div class="block ui-tabs-panel active" id="option-general">
139
  <div class="row">
140
  <div class="col-md-6">
141
- <h2 class="well"><?php esc_html_e( 'Customize feeds shortcode Settings', 'twitter-tweets'); ?></h2>
142
  <hr>
143
  <form name='fb-form' id='fb-form'>
144
  <?php
145
- $twitterSettings = unserialize(get_option("ali_twitter_shortcode"));
146
- $TwitterUserName = "weblizar";
147
- if( isset($twitterSettings[ 'TwitterUserName' ] ) ) {
148
- $TwitterUserName = $twitterSettings[ 'TwitterUserName' ];
149
- }
150
- $TwitterWidgetId = "123";
151
- if ( isset($twitterSettings[ 'TwitterWidgetId' ] ) ) {
152
- $TwitterWidgetId = $twitterSettings[ 'TwitterWidgetId' ];
153
- }
154
- $Theme = "light";
155
- if (isset( $twitterSettings[ 'Theme' ] ) ) {
156
- $Theme = $twitterSettings[ 'Theme' ];
157
- }
158
- $Height = "450";
159
- if ( isset($twitterSettings[ 'Height' ] ) ) {
160
- $Height = $twitterSettings[ 'Height' ];
161
- }
162
- $Width = "";
163
- if ( isset($twitterSettings[ 'Width' ] ) ) {
164
- $Width = $twitterSettings[ 'Width' ];
165
- }
166
- $LinkColor = "#CC0000";
167
- if ( isset( $twitterSettings[ 'LinkColor' ] ) ) {
168
- $LinkColor = $twitterSettings[ 'LinkColor' ];
169
- }
170
- $ExcludeReplies = "yes";
171
- if ( isset( $twitterSettings[ 'ExcludeReplies' ] ) ) {
172
- $ExcludeReplies = $twitterSettings['ExcludeReplies' ];
173
- }
174
- $AutoExpandPhotos = "yes";
175
- if ( isset( $twitterSettings[ 'AutoExpandPhotos' ] ) ) {
176
- $AutoExpandPhotos = $twitterSettings[ 'AutoExpandPhotos' ];
177
- }
178
- $tw_language = "";
179
- if ( isset( $twitterSettings[ 'tw_language' ] ) ) {
180
- $tw_language = $twitterSettings[ 'tw_language' ];
181
- }
182
-
183
- wp_nonce_field( 'save-feeds-widget', 'feeds-widget' );
184
  ?>
185
  <p>
186
  <div class="container">
187
- <div class="row">
188
- <div class="col-sm">
189
- <label><?php esc_html_e( 'Twitter Account Username', 'twitter-tweets' ); ?></label>
190
- </div>
191
- <div class="col-sm">
192
- <input class="widefat" id="twitter-page-user-name" name="twitter-page-user_name" type="text" value="<?php echo esc_attr($TwitterUserName); ?>" placeholder="<?php esc_attr_e( 'Enter Your Twitter Account Username', 'twitter-tweets' ); ?>">
193
- </div>
194
- </div>
195
  </div>
196
  </p>
197
  <br>
198
  <p>
199
- <input class="widefat" id="twitter-page-id-fetch" name="twitter-page-id-fetch" type="hidden" value="<?php echo esc_attr( $TwitterWidgetId); ?>" placeholder="<?php esc_html_e( 'Enter Your Twitter Widget ID', 'twitter-tweets'); ?>">
200
  </p>
201
  <p>
202
- <div class="container">
203
- <div class="row">
204
- <div class="col-sm">
205
- <label><?php esc_html_e( 'Theme', 'twitter-tweets' ); ?></label>
206
- </div>
207
- <div class="col-sm">
208
- <select id="show-theme-background" name="show-theme-background">
209
- <option value="light" <?php if($Theme == "light") echo "selected=selected" ?>><?php esc_html_e( 'Light', 'twitter-tweets' ); ?></option>
210
- <option value="dark" <?php if($Theme == "dark") echo "selected=selected" ?>><?php esc_html_e( 'Dark', 'twitter-tweets' ); ?></option>
211
- </select>
212
- </div>
213
- </div>
214
- </div>
215
  </p>
216
  <br>
217
 
218
- <p><div class="container">
219
- <div class="row">
220
- <div class="col-sm">
221
- <label><?php esc_html_e( 'Height', 'twitter-tweets' ); ?></label>
222
- </div>
223
- <div class="col-sm">
224
- <input class="widefat wltt-slider" id="twitter-page-url-Height" name="twitter-page-url-Height" type="range" value="<?php echo esc_attr($Height ); ?>" min="0" max="1500" data-rangeSlider>
225
- <p><b><?php esc_html_e( 'Set your desire height px (Use Arrow Keys For Exact Numbers)', 'twitter-tweets' ); ?></b> <span id="twitter-range-val"></span></p>
226
-
227
- </div>
228
- </div>
229
- </div>
 
230
 
231
 
232
  </p>
@@ -234,100 +240,103 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
234
 
235
  <p>
236
  <div class="container">
237
- <div class="row">
238
- <div class="col-sm">
239
- <label><?php esc_html_e( 'URL Link Color:', 'twitter-tweets' ); ?></label>
240
- </div>
241
- <div class="col-sm">
242
-
243
- <input class=" color-field" id="twitter-page-lnk-Color" name="twitter-page-lnk-Color" type="text" value="<?php echo esc_attr( $LinkColor ); ?>" data-default-color="#effeff" >
244
- </div>
245
- </div>
246
  </div>
247
 
248
 
249
  </p>
250
  <br>
251
 
252
- <p><div class="container">
253
- <div class="row">
254
- <div class="col-sm">
255
- <label><?php esc_html_e( 'Exclude Replies on Tweets', 'twitter-tweets' ); ?></label>
256
- </div>
257
- <div class="col-sm">
258
- <select id="exclude_replies_23" name="exclude_replies_23">
259
- <option value="yes" <?php if($ExcludeReplies == "yes") echo "selected=selected" ?>><?php esc_html_e( 'Yes', 'twitter-tweets' ); ?></option>
260
- <option value="no" <?php if($ExcludeReplies == "no") echo "selected=selected" ?>><?php esc_html_e( 'No', 'twitter-tweets' ); ?></option>
261
- </select>
262
- </div>
263
- </div>
264
- </div>
 
265
 
266
 
267
  </p>
268
  <br>
269
- <p><div class="container">
270
- <div class="row">
271
- <div class="col-sm">
272
- <label><?php esc_html_e( 'Auto Expand Photos in Tweets', 'twitter-tweets' ); ?></label>
273
- </div>
274
- <div class="col-sm">
275
- <select id="photo_1234" name="photo_1234">
276
- <option value="yes" <?php if($AutoExpandPhotos == "yes") echo "selected=selected" ?>><?php esc_html_e( 'Yes', 'twitter-tweets' ); ?></option>
277
- <option value="no" <?php if($AutoExpandPhotos == "no") echo "selected=selected" ?>><?php esc_html_e( 'No', 'twitter-tweets' ); ?></option>
278
- </select>
279
- </div>
280
- </div>
281
- </div>
 
282
 
283
 
284
  </p>
285
  <br>
286
- <p><div class="container">
287
- <div class="row">
288
- <div class="col-sm">
289
- <label><?php esc_html_e( 'Select Language', 'twitter-tweets' ); ?></label>
290
- </div>
291
- <div class="col-sm">
292
- <select id="tw_language" name="tw_language">
293
- <option value=""<?php if($tw_language == "") echo "selected=selected" ?>><?php esc_html_e('Automatic', 'twitter-tweets'); ?></option>
294
- <option value="en"<?php if($tw_language == "en") echo "selected=selected" ?>><?php esc_html_e('English (default)', 'twitter-tweets'); ?></option>
295
- <option value="ar"<?php if($tw_language == "ar") echo "selected=selected" ?>><?php esc_html_e('Arabic', 'twitter-tweets'); ?></option>
296
- <option value="bn"<?php if($tw_language == "bn") echo "selected=selected" ?>><?php esc_html_e('Bengali', 'twitter-tweets'); ?></option>
297
- <option value="cs"<?php if($tw_language == "cs") echo "selected=selected" ?>><?php esc_html_e('Czech', 'twitter-tweets'); ?></option>
298
- <option value="da"<?php if($tw_language == "da") echo "selected=selected" ?>><?php esc_html_e('Danish', 'twitter-tweets'); ?></option>
299
- <option value="de"<?php if($tw_language == "de") echo "selected=selected" ?>><?php esc_html_e('German', 'twitter-tweets'); ?></option>
300
- <option value="el"<?php if($tw_language == "el") echo "selected=selected" ?>><?php esc_html_e('Greek', 'twitter-tweets'); ?></option>
301
- <option value="es"<?php if($tw_language == "es") echo "selected=selected" ?>><?php esc_html_e('Spanish', 'twitter-tweets'); ?></option>
302
- <option value="fa"<?php if($tw_language == "fa") echo "selected=selected" ?>><?php esc_html_e('Persian', 'twitter-tweets'); ?></option>
303
- <option value="fi"<?php if($tw_language == "fi") echo "selected=selected" ?>><?php esc_html_e('Finnish', 'twitter-tweets'); ?></option>
304
- <option value="fil"<?php if($tw_language == "fil") echo "selected=selected" ?>><?php esc_html_e('Filipino', 'twitter-tweets'); ?></option>
305
- <option value="fr"<?php if($tw_language == "fr") echo "selected=selected" ?>><?php esc_html_e('French', 'twitter-tweets'); ?></option>
306
- <option value="he"<?php if($tw_language == "he") echo "selected=selected" ?>><?php esc_html_e('Hebrew', 'twitter-tweets'); ?></option>
307
- <option value="hi"<?php if($tw_language == "hi") echo "selected=selected" ?>><?php esc_html_e('Hindi', 'twitter-tweets'); ?></option>
308
- <option value="hu"<?php if($tw_language == "hu") echo "selected=selected" ?>><?php esc_html_e('EHungarian', 'twitter-tweets'); ?></option>
309
- <option value="id"<?php if($tw_language == "id") echo "selected=selected" ?>><?php esc_html_e('Indonesian', 'twitter-tweets'); ?></option>
310
- <option value="it"<?php if($tw_language == "it") echo "selected=selected" ?>><?php esc_html_e('Italian', 'twitter-tweets'); ?></option>
311
- <option value="ja"<?php if($tw_language == "ja") echo "selected=selected" ?>><?php esc_html_e('Japanese', 'twitter-tweets'); ?></option>
312
- <option value="ko"<?php if($tw_language == "ko") echo "selected=selected" ?>><?php esc_html_e('Korean', 'twitter-tweets'); ?></option>
313
- <option value="msa"<?php if($tw_language == "msa") echo "selected=selected" ?>><?php esc_html_e('Malay', 'twitter-tweets'); ?></option>
314
- <option value="nl"<?php if($tw_language == "nl") echo "selected=selected" ?>><?php esc_html_e('Dutch)', 'twitter-tweets'); ?></option>
315
- <option value="no"<?php if($tw_language == "no") echo "selected=selected" ?>><?php esc_html_e('Norwegian', 'twitter-tweets'); ?></option>
316
- <option value="pl"<?php if($tw_language == "pl") echo "selected=selected" ?>><?php esc_html_e('Polish', 'twitter-tweets'); ?></option>
317
- <option value="pt"<?php if($tw_language == "pt") echo "selected=selected" ?>><?php esc_html_e('Portuguese', 'twitter-tweets'); ?></option>
318
- <option value="ro"<?php if($tw_language == "ro") echo "selected=selected" ?>><?php esc_html_e('Romanian', 'twitter-tweets'); ?></option>
319
- <option value="ru"<?php if($tw_language == "ru") echo "selected=selected" ?>><?php esc_html_e('Russian', 'twitter-tweets'); ?></option>
320
- <option value="sv"<?php if($tw_language == "sv") echo "selected=selected" ?>><?php esc_html_e('Swedish', 'twitter-tweets'); ?></option>
321
- <option value="th"<?php if($tw_language == "th") echo "selected=selected" ?>><?php esc_html_e('Thai', 'twitter-tweets'); ?></option>
322
- <option value="tr"<?php if($tw_language == "tr") echo "selected=selected" ?>><?php esc_html_e('Turkish', 'twitter-tweets'); ?></option>
323
- <option value="uk"<?php if($tw_language == "uk") echo "selected=selected" ?>><?php esc_html_e('Ukrainian', 'twitter-tweets'); ?></option>
324
- <option value="ur"<?php if($tw_language == "ur") echo "selected=selected" ?>><?php esc_html_e('Urdu', 'twitter-tweets'); ?></option>
325
- <option value="vi"<?php if($tw_language == "vi") echo "selected=selected" ?>><?php esc_html_e('Vietnamese', 'twitter-tweets'); ?></option>
326
- <option value="zh-cn"<?php if($tw_language == "zh-cn") echo "selected=selected" ?>><?php esc_html_e('Chinese (Simplified)', 'twitter-tweets'); ?></option>
327
- <option value="zh-tw"<?php if($tw_language == "zh-tw") echo "selected=selected" ?>><?php esc_html_e('Chinese', 'twitter-tweets'); ?> (Traditional)</option>
328
- </select>
329
- </div>
330
- </div>
 
331
  </div>
332
 
333
 
@@ -337,66 +346,71 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
337
  <input onclick="return SaveSettings();" type="button" class="twt_save_btn" id="fb-save-settings" name="fb-save-settings" value="SAVE">
338
 
339
  <div id="fb-img" style="display: none;">
340
- <img src="<?php echo WEBLIZAR_TWITTER_PLUGIN_URL.'images/loading.gif'; ?>" />
341
  </div>
342
  <div id="fb-msg" style="display: none;" class="alert">
343
- <?php esc_html_e( 'Settings successfully saved. Reloading page for generating preview right side of setting.', 'twitter-tweets' ); ?>
344
  </div>
345
  </form>
346
 
347
  </div>
348
  <!-- Preview Part-->
349
  <div class="col-md-6">
350
- <?php if($TwitterWidgetId) { ?>
351
- <h2 class="well"><?php esc_html_e( 'Feeds Shortcode Preview', 'twitter-tweets'); ?></h2>
352
- <hr>
353
- <p>
354
- <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>"
355
- min-width="<?php echo esc_attr($Width); ?>"
356
- height="<?php echo esc_attr($Height); ?>"
357
- data-theme="<?php echo esc_attr($Theme); ?>"
358
- data-lang="<?php echo esc_attr($tw_language); ?>"
359
- data-link-color="<?php echo esc_attr($LinkColor); ?>"></a>
360
- <div class="twt_help">
361
- <?php esc_html_e('Please copy the twitter shortcode', 'twitter-tweets' );?> <span style="color:#000;"><b>[TWTR]</b> </span> <?php esc_html_e('and paste it to on the Page/Post', 'twitter-tweets' );?></span>
362
- </div>
363
 
364
- <script>
365
- !function(d,s,id) {
366
- 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);}
367
- } (document,"script","twitter-wjs");
368
- </script>
369
- </p>
370
- <?php }?>
 
 
 
 
 
 
 
371
  </div>
372
- </div>
373
  </div>
374
 
375
  <!-- API Key -->
376
  <?php
377
- include_once('load-tweets.php');
378
  ?>
379
  <div class="block ui-tabs-panel deactive" id="option-apikey">
380
  <div class="row">
381
  <div class="col-md-6">
382
  <div class="row">
383
  <div class="col-md-12">
384
- <h2 class="well"><?php esc_html_e( 'Twitter API Setting', 'twitter-tweets'); ?></h2>
385
  </div>
386
  <div class="col-md-12">
387
  <form name='api-form' id='api-form'>
388
  <br>
389
- <p><div class="container">
390
- <div class="row">
391
- <div class="col-sm">
392
- <label><?php esc_html_e( 'Consumer Key', 'twitter-tweets' ); ?>&nbsp;*</label>
393
- </div>
394
- <div class="col-sm">
395
- <input class="widefat" id="wl_twitter_consumer_key" name="wl_twitter_consumer_key" type="text" value="<?php if( isset( $wl_twitter_consumer_key ) ) {echo esc_attr($wl_twitter_consumer_key);} ?>" placeholder="<?php esc_attr_e( 'Enter Your Twitter Consumer Key', 'twitter-tweets' ); ?>">
396
- <span class="helplink"><?php esc_html_e("Visit this link to ", 'twitter-tweets' ); ?><a href="https://weblizar.com/blog/generate-twitter-api-key/" target="_bank"><?php esc_html_e("Generate Twitter API key", 'twitter-tweets' ); ?></a></span>
397
- <br>
398
- </div>
399
- </div>
 
 
 
400
  </div>
401
 
402
 
@@ -404,15 +418,18 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
404
 
405
 
406
  <br>
407
- <p><div class="container">
408
- <div class="row">
409
- <div class="col-sm">
410
- <label><?php esc_html_e( 'Consumer Secret', 'twitter-tweets' ); ?>&nbsp;*</label>
411
- </div>
412
- <div class="col-sm">
413
- <input class="widefat" id="wl_twitter_consumer_secret" name="wl_twitter_consumer_secret" type="text" value="<?php if(isset($wl_twitter_consumer_secret)) {echo esc_attr($wl_twitter_consumer_secret);} ?>" placeholder="<?php esc_attr_e( 'Enter Your Twitter Consumer Secret', 'twitter-tweets' ); ?>">
414
- </div>
415
- </div>
 
 
 
416
  </div>
417
 
418
 
@@ -422,14 +439,16 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
422
  <br>
423
  <p>
424
  <div class="container">
425
- <div class="row">
426
- <div class="col-sm">
427
- <label><?php esc_html_e( 'Access Token', 'twitter-tweets' ); ?>&nbsp;*</label>
428
- </div>
429
- <div class="col-sm">
430
- <input class="widefat" id="wl_twitter_access_token" name="wl_twitter_access_token" type="text" value="<?php if( isset( $wl_twitter_access_token ) ) {echo esc_attr($wl_twitter_access_token);} ?>" placeholder="<?php esc_attr_e( 'Enter Your Twitter Access Token', 'twitter-tweets' ); ?>">
431
- </div>
432
- </div>
 
 
433
  </div>
434
 
435
 
@@ -439,14 +458,16 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
439
  <br>
440
  <p>
441
  <div class="container">
442
- <div class="row">
443
- <div class="col-sm">
444
- <label><?php esc_html_e( 'Access Token Secret', 'twitter-tweets' ); ?>&nbsp;*</label>
445
- </div>
446
- <div class="col-sm">
447
- <input class="widefat" id="wl_twitter_token_secret" name="wl_twitter_token_secret" type="text" value="<?php if( isset( $wl_twitter_token_secret ) ) {echo esc_attr($wl_twitter_token_secret);} ?>" placeholder="<?php esc_attr_e( 'Enter Your Twitter Token Secret', 'twitter-tweets' ); ?>">
448
- </div>
449
- </div>
 
 
450
  </div>
451
 
452
 
@@ -455,62 +476,64 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
455
  <br>
456
  <p>
457
  <div class="container">
458
- <div class="row">
459
- <div class="col-sm">
460
- <label><?php esc_html_e( 'No. Of tweets Show', 'twitter-tweets' ); ?></label>
461
- </div>
462
- <div class="col-sm">
463
- <input class="widefat wltt-slider" id="wl_twitter_tweets" name="wl_twitter_tweets" type="range" value="<?php if( isset( $wl_twitter_tweets ) ) {echo esc_attr($wl_twitter_tweets);} ?>" min="1" max="14" data-rangeSlider>
464
- <p>
465
- <b><?php esc_html_e( 'Set no of tweets you want to show (Use Arrow Keys)', 'twitter-tweets' ); ?></b> <span id="wl_twitter_range_show"></span>
466
- </p>
467
- </div>
468
- </div>
 
 
469
  </div>
470
 
471
 
472
  </p>
473
 
474
- <br>
475
  <p>
476
  <div class="container">
477
- <div class="row">
478
- <div class="col-sm">
479
- <label><?php esc_html_e( 'Layout', 'twitter-tweets' ); ?></label>
480
- </div>
481
- <div class="col-sm">
482
- <select class="widefat" name="wl_twitter_layout" id="wl_twitter_layout">
483
- <option value=""><?php esc_html_e( 'Select', 'twitter-tweets' ); ?></option>
484
- <option value="12"><?php esc_html_e( '1', 'twitter-tweets' ); ?></option>
485
- <option value="6"><?php esc_html_e( '2', 'twitter-tweets' ); ?></option>
486
- <option value="4"><?php esc_html_e( '3', 'twitter-tweets' ); ?></option>
487
- <option value="3"><?php esc_html_e( '4', 'twitter-tweets' ); ?></option>
488
- </select>
489
- </div>
490
- </div>
491
  </div>
492
 
493
 
494
  </p>
495
  <script type="text/javascript">
496
- var abc = '<?php echo esc_attr($wl_twitter_layout); ?>';
497
- jQuery('#wl_twitter_layout').find('option[value="' + abc + '"]').attr('selected', 'selected')
498
- </script>
499
  <br>
500
  <?php
501
- wp_nonce_field( 'twitter_api_nonce', 'twitter_api_nonce' );
502
  ?>
503
  <input onclick="return SaveApiSettings();" type="button" class="twt_save_btn" id="fb-api-save-settings" name="fb-api-save-settings" value="SAVE">
504
  <br><br><br>
505
  <div class="twt_help">
506
- <?php esc_html_e('Please copy the twitter shortcode', 'twitter-tweets' );?> <span style="color:#000;"> <b><?php esc_html_e('[WL_TWITTER]', 'twitter-tweets' );?></b> </span>
507
- <?php esc_html_e('and paste it to on the Page/Post', 'twitter-tweets' );?></span>
508
  </div>
509
  <div id="twitter-img" style="display: none;">
510
- <img src="<?php echo WEBLIZAR_TWITTER_PLUGIN_URL.'images/loading.gif'; ?>" />
511
  </div>
512
  <div id="wl_twitter_preview" style="display: none;" class="alert">
513
- <?php esc_html_e( 'Settings successfully saved. Reloading page for generating preview right side of setting.', 'twitter-tweets' ); ?>
514
  </div>
515
  </form>
516
  </div>
@@ -519,142 +542,150 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
519
  <div class="col-md-6">
520
  <div class="wl_twt_free">
521
  <div class="container-fluid">
522
- <div class="row">
523
- <div class="col-md-<?php if( isset( $wl_twitter_layout ) ){echo esc_attr($wl_twitter_layout);} ?>">
524
- <?php
525
- if ( isset( $statuses ) && is_array( $statuses ) ) {
526
- foreach ( $statuses as $status ) {
527
- /* user info */
528
- if( isset( $status->user ) ) {
529
- $user = $status->user;
530
- }
531
- if( isset( $user->name ) ) {
532
- $name = $user->name;
533
- }
534
- if( isset( $user->screen_name ) ) {
535
- $screen_name = $user->screen_name;
536
- }
537
- if( isset( $user->location ) ) {
538
- $location = $user->location;
539
- }
540
- if( isset( $user->description ) ) {
541
- $description = $user->description;
542
- }
543
- if( isset( $user->url ) ) {
544
- $url = $user->url;
545
- }
546
- if( isset( $status->id_str ) ) {
547
- $id_str = $status->id_str; /* use it to make link of post */
548
- }
549
- if( isset( $status->created_at ) ) {
550
- $created_at = $status->created_at; /* time when tweet was created */
551
- }
552
- /* profile_image_url */
553
- if( isset( $user->profile_image_url ) ) {
554
- $profile_image_url = $user->profile_image_url;
555
- }
556
- if( isset( $user->profile_image_url_https ) ) {
557
- $profile_image_url_https = $user->profile_image_url_https;
558
- }
559
- ?>
560
- <div class="wl_tweet_box">
561
- <p class="wl_tweet">
562
- <img class="align-self-start mr-3" src="<?php if( isset( $user->profile_image_url_https ) ){echo esc_url($profile_image_url_https);} ?>"
563
- alt="">
564
- <a href="https://twitter.com/<?php if( isset( $user->screen_name ) ){echo esc_attr($screen_name);} ?>">
565
- <?php if( isset( $user->screen_name ) ) {echo "@" . $screen_name;} ?>
566
- </a>
567
- </p>
568
- <?php
569
- // $entities = $status->entities;
570
- if ( isset( $status->extended_entities ) ) {
571
- $extended_entities_array = $status->extended_entities->media;
572
- $extended_entities = $extended_entities_array[0];
573
- $display_url = $extended_entities->display_url;
574
- $media_expanded_url = $extended_entities->expanded_url;
575
- $media_type = $extended_entities->type;
576
- $media_url = $extended_entities->media_url;
577
- if ( $media_type == "photo" ) {
578
- ?>
579
- <img src="<?php echo esc_url($media_url); ?>" class="img-fluid"/>
580
- <?php
581
- } elseif ( $media_type == "video" ) {
582
- $video_info = $extended_entities->video_info->variants[2];
583
- $content_type = $video_info->content_type;
584
- $url = $video_info->url;
585
- $new_url = str_replace( "?tag=8", "", $url );
 
 
 
 
 
 
 
586
 
587
- if ( isset( $enable_extended_entitie ) && $enable_extended_entitie == "enable" ) {
588
  ?>
589
- <a href="#" data-toggle="modal" data-target="#myModal">
590
- <img src="<?php echo esc_url($media_url); ?>" class="img-fluid"/>
591
- </a>
592
  <?php
593
- } else {
594
  ?>
595
- <a href="#">
596
- <img src="<?php echo esc_url($media_url); ?>" class="img-fluid"/>
597
- </a>
598
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
599
  }
600
  }
601
- } /* extended enntities */
602
- elseif ( ! empty( $entities->media ) && is_array( $entities->media ) ) {
603
- $media = $entities->media;
604
- foreach ( $media as $media_key => $media_value ) {
605
- $media_url = $media_value->media_url;
606
- $media_url_https = $media_value->media_url_https;
607
- $media_detail_url = $media_value->url;
608
- $media_display_url = $media_value->display_url;
609
- $media_expanded_url = $media_value->expanded_url;
610
- $media_type = $media_value->type;
611
- $media_sizes = $media_value->sizes;
612
- ?>
613
- <a href="<?php echo esc_url($media_expanded_url); ?>">
614
- <img src="<?php echo esc_url($media_url_https); ?>" class="img-fluid"/>
615
- </a>
616
  <?php
617
- }
618
- }
619
- ?>
620
- <p class="wl_tweet_desc">
621
- <?php
622
- if( isset( $status->text ) ) {
623
- echo makeLinks( $status->text );
624
- }
625
- ?>
626
- </p>
627
- <p class="wl_tweet_action_buttons">
628
- <a href="https://twitter.com/intent/retweet?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet" target="_blank" onclick="window.open('https://twitter.com/intent/retweet?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;">
629
- <?php
630
- if ( isset( $status->retweet_count ) ) {
631
- esc_html_e( 'Retweet', 'twitter-tweets' );
632
- echo esc_html("($status->retweet_count)");
633
- }
634
- ?>
635
- </a>
636
-
637
- <a href="https://twitter.com/intent/like?tweet_id=<?php echo esc_html($id_str); ?>&related=<?php echo esc_attr($screen_name); ?>"
638
- target="_blank" onclick="window.open('https://twitter.com/intent/like?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;">
639
- <?php
640
- if ( isset( $status->favorite_count ) ) {
641
- esc_html_e( 'Like', 'twitter-tweets' );
642
- echo esc_html("($status->favorite_count)");
643
- }
644
- ?>
645
- </a>
646
-
647
- <a href="https://twitter.com/intent/tweet?in_reply_to=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_html($screen_name); ?>"
648
- target="_blank" onclick="window.open('https://twitter.com/intent/tweet?in_reply_to=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;"><?php esc_html_e( 'Reply', 'twitter-tweets' ); ?>
649
- </a>
650
- </p>
651
- <span class="wl-wtp-date-font-size"><?php if( isset( $status->created_at ) ) {echo tweet_time_calculate( $created_at );} ?>
652
- &nbsp;<?php if( isset( $status->created_at ) ) {esc_html_e( 'ago', 'twitter-tweets' );} ?></span>
653
- </div> <!-- Tweet box -->
654
- <?php }
655
- } ?>
656
- </div>
657
- </div>
658
  </div>
659
  </div>
660
  </div>
@@ -671,7 +702,7 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
671
  <p class="well"><b><?php esc_html_e('Customize Feeds for Twitter plugin comes with 2 major feature.', 'twitter-tweets'); ?></b></p>
672
  <ol>
673
  <li><?php esc_html_e('Customize feeds Widget', 'twitter-tweets'); ?></li>
674
- <li><?php esc_html_e('Customize feeds Shortcode', 'twitter-tweets'); ?><?php esc_html_e('[TWTR]', 'twitter-tweets' );?></li>
675
  <li><?php esc_html_e('Note: Protected tweets will not view', 'twitter-tweets'); ?> <a href="https://help.twitter.com/en/safety-and-security/public-and-protected-tweets" target="_blank"><?php esc_html_e('Help', 'twitter-tweets'); ?></a></li>
676
  </ol>
677
  <br>
@@ -679,20 +710,20 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
679
 
680
  <ol>
681
  <li><?php esc_html_e('You can use the widget to display your Twitter Tweets in any theme Widget Sections.', 'twitter-tweets'); ?></li>
682
- <li><?php esc_html_e('Simple go to your', 'twitter-tweets' ); ?><a href="<?php echo get_site_url(); ?>/wp-admin/widgets.php"><strong><?php esc_html_e('Widgets', 'twitter-tweets'); ?></strong></a><?php esc_html_e(' section and activate available', 'twitter-tweets'); ?> <strong><?php esc_html_e('Twitter By Weblizar', 'twitter-tweets'); ?></strong> <?php esc_html_e('widget in any sidebar section, like in left sidebar, right sidebar or footer sidebar.', 'twitter-tweets'); ?></li>
683
- </ol>
684
  <br>
685
- <p class="well"><strong><?php esc_html_e('Feeds Short-code ', 'twitter-tweets'); ?><?php esc_html_e('[TWTR]', 'twitter-tweets' );?></strong></p>
686
  <ol>
687
  <li><strong>[TWTR]</strong> <?php esc_html_e('shortcode give ability to display Twitter Tweets Box in any Page / Post with content', 'twitter-tweets'); ?>.</li>
688
- <li><?php esc_html_e('To use shortcode, just copy', 'twitter-tweets'); ?> <strong><?php esc_html_e('[TWTR]', 'twitter-tweets' );?></strong><?php esc_html_e( 'shortcode and paste into content editor of any Page / Post.', 'twitter-tweets'); ?></li>
689
  </ol>
690
 
691
  <br>
692
- <p class="well"><strong><?php esc_html_e('Twitter Short-code', 'twitter-tweets'); ?><?php esc_html_e('[WL_TWITTER]', 'twitter-tweets' );?></strong></p>
693
  <ol>
694
- <li><strong><?php esc_html_e('[WL_TWITTER]', 'twitter-tweets' );?></strong><?php esc_html_e( 'shortcode, another shortcode, using API Key to login, give ability to display Twitter Tweets Box in any Page / Post with content.', 'twitter-tweets'); ?></li>
695
- <li><?php esc_html_e('To use shortcode, just copy', 'twitter-tweets'); ?> <strong><?php esc_html_e('[WL_TWITTER]', 'twitter-tweets' );?></strong><?php esc_html_e(' shortcode and paste into content editor of any Page / Post.', 'twitter-tweets'); ?></li>
696
  </ol>
697
 
698
  <br>
@@ -702,17 +733,19 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
702
 
703
  <br>
704
  <p class="well"><strong><?php esc_html_e('Q. What is Twitter Widget ID?', 'twitter-tweets'); ?></strong></p>
705
- <p><strong><?php esc_html_e('Ans. Twitter Widget ID', 'twitter-tweets'); ?></strong><?php esc_html_e( 'used to authenticate your TWITTER Page data & settings. To get your own TWITTER ID please read our very simple and easy', 'twitter-tweets'); ?> <a href="https://weblizar.com/get-twitter-widget-id/" target="_blank"><strong><?php esc_html_e('Tutorial', 'twitter-tweets'); ?></strong>.</a>
706
  </p>
707
  </div>
708
  </div>
709
  <div class="row">
710
  <div class="col-md-10">
711
- <div id="heading"><h2><?php esc_html_e('Rate Us', 'twitter-tweets' ); ?></h2></div>
712
- <p><?php esc_html_e('If you are enjoying using our', 'twitter-tweets' ); ?> <b><?php esc_html_e('Customize Feeds for Twitter Widget', 'twitter-tweets'); ?></b><?php esc_html_e( 'plugin and find it useful, then please consider writing a positive feedback. Your feedback will help us to encourage and support the plugin continued development and better user support.', 'twitter-tweets'); ?>
 
 
713
  </p>
714
  <div class="twt_star">
715
- <a class="acl-rate-us" style="text-align:center; text-decoration: none;font:normal 30px/l;" href="https://wordpress.org/plugins/twitter-tweets/#reviews" target="_blank" >
716
  <span class="dashicons dashicons-star-filled"></span>
717
  <span class="dashicons dashicons-star-filled"></span>
718
  <span class="dashicons dashicons-star-filled"></span>
@@ -726,4 +759,4 @@ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_
726
  <!---------------- our product tab------------------------>
727
  <div class="block ui-tabs-panel deactive" id="option-ourproduct">
728
  <?php require_once('our_product.php'); ?>
729
- </div>
1
+ <?php if (!defined('ABSPATH')) exit; ?>
2
  <script type="text/javascript">
3
+ function SaveSettings() {
4
+ var FbAppId = jQuery("#twitter-page-id-fetch").val();
5
+ var User_name_3 = jQuery("#twitter-page-user-name").val();
6
+ var show_theme = jQuery("#show-theme-background").val();
7
+ var Height = jQuery("#twitter-page-url-Height").val();
8
+ var link_color = jQuery("#twitter-page-lnk-Color").val();
9
+ var replieses = jQuery("#exclude_replies_23").val();
10
+ var photos_acces = jQuery("#photo_1234").val();
11
+ var tw_language = jQuery("#tw_language").val();
12
+ if (!FbAppId) {
13
+ jQuery("#twitter-page-id-fetch").focus();
14
+ return false;
15
+ }
16
+ jQuery("#fb-save-settings").hide();
17
+ jQuery("#fb-img").show();
18
+ jQuery.ajax({
19
+ url: location.href,
20
+ type: "POST",
21
+ data: jQuery("form#fb-form").serialize(),
22
+ dataType: "html",
23
+ //Do not cache the page
24
+ cache: false,
25
+ //success
26
+ success: function(html) {
27
+ jQuery("#fb-img").hide();
28
+ jQuery("#fb-msg").show();
29
+ setTimeout(function() {
30
+ location.reload(true);
31
+ }, 2000);
32
+ }
33
+ });
34
  }
35
+
36
+ function SaveApiSettings() {
37
+ var wl_twitter_consumer_key = jQuery("#wl_twitter_consumer_key").val();
38
+ var wl_twitter_consumer_secret = jQuery("#wl_twitter_consumer_secret").val();;
39
+ var wl_twitter_access_token = jQuery("#wl_twitter_access_token").val();;
40
+ var wl_twitter_token_secret = jQuery("#wl_twitter_token_secret").val();;
41
+ if (!wl_twitter_consumer_key) {
42
+ jQuery("#wl_twitter_consumer_key").focus();
43
+ return false;
 
 
 
 
 
44
  }
 
 
45
 
46
+ if (!wl_twitter_consumer_secret) {
47
+ jQuery("#wl_twitter_consumer_secret").focus();
48
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
+
51
+ if (!wl_twitter_access_token) {
52
+ jQuery("#wl_twitter_access_token").focus();
53
+ return false;
54
+ }
55
+
56
+ if (!wl_twitter_token_secret) {
57
+ jQuery("#wl_twitter_token_secret").focus();
58
+ return false;
59
+ }
60
+ jQuery("#fb-api-save-settings").hide();
61
+ jQuery("#twitter-img").show();
62
+ jQuery.ajax({
63
+ url: location.href,
64
+ type: "POST",
65
+ data: jQuery("form#api-form").serialize(),
66
+ dataType: "html",
67
+ //Do not cache the page
68
+ cache: false,
69
+ //success
70
+ success: function(html) {
71
+ jQuery("#twitter-img").hide();
72
+ jQuery("#wl_twitter_preview").show();
73
+ setTimeout(function() {
74
+ location.reload(true);
75
+ }, 2000);
76
+ }
77
+ });
78
+ }
79
  </script>
80
  <?php
81
+ wp_enqueue_style('font-awesome', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/all.min.css');
82
+ wp_enqueue_style('wl_bootstrap', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/bootstrap.min.css');
83
 
84
+ if (isset($_REQUEST['twitter-page-user_name'])) {
85
 
86
+ if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['feeds-widget'], 'save-feeds-widget')) {
87
  die;
88
  }
89
 
90
+ $TwitterUserName = sanitize_text_field($_REQUEST['twitter-page-user_name']);
91
+ $Theme = sanitize_text_field($_REQUEST['show-theme-background']);
92
+ $Height = sanitize_text_field($_REQUEST['twitter-page-url-Height']);
93
+ $TwitterWidgetId = sanitize_text_field($_REQUEST['twitter-page-id-fetch']);
94
+ $LinkColor = sanitize_hex_color($_REQUEST['twitter-page-lnk-Color']);
95
+ $ExcludeReplies = sanitize_text_field($_REQUEST['exclude_replies_23']);
96
+ $AutoExpandPhotos = sanitize_text_field($_REQUEST['photo_1234']);
97
+ $tw_language = sanitize_text_field($_REQUEST['tw_language']);
98
 
99
  $TwitterSettingsArray = serialize(
100
+ array(
101
+ 'TwitterUserName' => $TwitterUserName,
102
+ 'Theme' => $Theme,
103
+ 'Height' => $Height,
104
+ 'TwitterWidgetId' => $TwitterWidgetId,
105
+ 'LinkColor' => $LinkColor,
106
+ 'ExcludeReplies' => $ExcludeReplies,
107
+ 'AutoExpandPhotos' => $AutoExpandPhotos,
108
+ 'tw_language' => $tw_language,
109
+ )
110
+ );
111
  update_option("ali_twitter_shortcode", $TwitterSettingsArray);
112
  }
113
 
114
  /* Twitter api key save */
115
 
116
+ if (isset($_REQUEST['wl_twitter_consumer_key']) && isset($_REQUEST['twitter_api_nonce'])) {
117
 
118
+ if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['twitter_api_nonce'], 'twitter_api_nonce')) {
119
  die;
120
  }
121
 
122
+ $wl_twitter_consumer_key = sanitize_text_field($_REQUEST['wl_twitter_consumer_key']);
123
+ $wl_twitter_consumer_secret = sanitize_text_field($_REQUEST['wl_twitter_consumer_secret']);
124
+ $wl_twitter_access_token = sanitize_text_field($_REQUEST['wl_twitter_access_token']);
125
+ $wl_twitter_token_secret = sanitize_text_field($_REQUEST['wl_twitter_token_secret']);
126
 
127
+ $wl_twitter_tweets = (isset($_REQUEST['wl_twitter_tweets'])) ? sanitize_text_field($_REQUEST['wl_twitter_tweets']) : '4';
128
 
129
+ $wl_twitter_layout = (isset($_REQUEST['wl_twitter_layout'])) ? sanitize_text_field($_REQUEST['wl_twitter_layout']) : '3';
130
 
131
  $twitter_api_settings = array(
132
  'wl_twitter_consumer_key' => $wl_twitter_consumer_key,
137
  'wl_twitter_layout' => $wl_twitter_layout
138
  );
139
 
140
+ update_option('wl_twitter_api_settings', $twitter_api_settings);
141
  }
142
  ?>
143
  <div class="block ui-tabs-panel active" id="option-general">
144
  <div class="row">
145
  <div class="col-md-6">
146
+ <h2 class="well"><?php esc_html_e('Customize feeds shortcode Settings', 'twitter-tweets'); ?></h2>
147
  <hr>
148
  <form name='fb-form' id='fb-form'>
149
  <?php
150
+ $twitterSettings = unserialize(get_option("ali_twitter_shortcode"));
151
+ $TwitterUserName = "weblizar";
152
+ if (isset($twitterSettings['TwitterUserName'])) {
153
+ $TwitterUserName = $twitterSettings['TwitterUserName'];
154
+ }
155
+ $TwitterWidgetId = "123";
156
+ if (isset($twitterSettings['TwitterWidgetId'])) {
157
+ $TwitterWidgetId = $twitterSettings['TwitterWidgetId'];
158
+ }
159
+ $Theme = "light";
160
+ if (isset($twitterSettings['Theme'])) {
161
+ $Theme = $twitterSettings['Theme'];
162
+ }
163
+ $Height = "450";
164
+ if (isset($twitterSettings['Height'])) {
165
+ $Height = $twitterSettings['Height'];
166
+ }
167
+ $Width = "";
168
+ if (isset($twitterSettings['Width'])) {
169
+ $Width = $twitterSettings['Width'];
170
+ }
171
+ $LinkColor = "#CC0000";
172
+ if (isset($twitterSettings['LinkColor'])) {
173
+ $LinkColor = $twitterSettings['LinkColor'];
174
+ }
175
+ $ExcludeReplies = "yes";
176
+ if (isset($twitterSettings['ExcludeReplies'])) {
177
+ $ExcludeReplies = $twitterSettings['ExcludeReplies'];
178
+ }
179
+ $AutoExpandPhotos = "yes";
180
+ if (isset($twitterSettings['AutoExpandPhotos'])) {
181
+ $AutoExpandPhotos = $twitterSettings['AutoExpandPhotos'];
182
+ }
183
+ $tw_language = "";
184
+ if (isset($twitterSettings['tw_language'])) {
185
+ $tw_language = $twitterSettings['tw_language'];
186
+ }
187
+
188
+ wp_nonce_field('save-feeds-widget', 'feeds-widget');
189
  ?>
190
  <p>
191
  <div class="container">
192
+ <div class="row">
193
+ <div class="col-sm">
194
+ <label><?php esc_html_e('Twitter Account Username', 'twitter-tweets'); ?></label>
195
+ </div>
196
+ <div class="col-sm">
197
+ <input class="widefat" id="twitter-page-user-name" name="twitter-page-user_name" type="text" value="<?php echo esc_attr($TwitterUserName); ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Account Username', 'twitter-tweets'); ?>">
198
+ </div>
199
+ </div>
200
  </div>
201
  </p>
202
  <br>
203
  <p>
204
+ <input class="widefat" id="twitter-page-id-fetch" name="twitter-page-id-fetch" type="hidden" value="<?php echo esc_attr($TwitterWidgetId); ?>" placeholder="<?php esc_html_e('Enter Your Twitter Widget ID', 'twitter-tweets'); ?>">
205
  </p>
206
  <p>
207
+ <div class="container">
208
+ <div class="row">
209
+ <div class="col-sm">
210
+ <label><?php esc_html_e('Theme', 'twitter-tweets'); ?></label>
211
+ </div>
212
+ <div class="col-sm">
213
+ <select id="show-theme-background" name="show-theme-background">
214
+ <option value="light" <?php if ($Theme == "light") echo "selected=selected" ?>><?php esc_html_e('Light', 'twitter-tweets'); ?></option>
215
+ <option value="dark" <?php if ($Theme == "dark") echo "selected=selected" ?>><?php esc_html_e('Dark', 'twitter-tweets'); ?></option>
216
+ </select>
217
+ </div>
218
+ </div>
219
+ </div>
220
  </p>
221
  <br>
222
 
223
+ <p>
224
+ <div class="container">
225
+ <div class="row">
226
+ <div class="col-sm">
227
+ <label><?php esc_html_e('Height', 'twitter-tweets'); ?></label>
228
+ </div>
229
+ <div class="col-sm">
230
+ <input class="widefat wltt-slider" id="twitter-page-url-Height" name="twitter-page-url-Height" type="range" value="<?php echo esc_attr($Height); ?>" min="0" max="1500" data-rangeSlider>
231
+ <p><b><?php esc_html_e('Set your desire height px (Use Arrow Keys For Exact Numbers)', 'twitter-tweets'); ?></b> <span id="twitter-range-val"></span></p>
232
+
233
+ </div>
234
+ </div>
235
+ </div>
236
 
237
 
238
  </p>
240
 
241
  <p>
242
  <div class="container">
243
+ <div class="row">
244
+ <div class="col-sm">
245
+ <label><?php esc_html_e('URL Link Color:', 'twitter-tweets'); ?></label>
246
+ </div>
247
+ <div class="col-sm">
248
+
249
+ <input class=" color-field" id="twitter-page-lnk-Color" name="twitter-page-lnk-Color" type="text" value="<?php echo esc_attr($LinkColor); ?>" data-default-color="#effeff">
250
+ </div>
251
+ </div>
252
  </div>
253
 
254
 
255
  </p>
256
  <br>
257
 
258
+ <p>
259
+ <div class="container">
260
+ <div class="row">
261
+ <div class="col-sm">
262
+ <label><?php esc_html_e('Exclude Replies on Tweets', 'twitter-tweets'); ?></label>
263
+ </div>
264
+ <div class="col-sm">
265
+ <select id="exclude_replies_23" name="exclude_replies_23">
266
+ <option value="yes" <?php if ($ExcludeReplies == "yes") echo "selected=selected" ?>><?php esc_html_e('Yes', 'twitter-tweets'); ?></option>
267
+ <option value="no" <?php if ($ExcludeReplies == "no") echo "selected=selected" ?>><?php esc_html_e('No', 'twitter-tweets'); ?></option>
268
+ </select>
269
+ </div>
270
+ </div>
271
+ </div>
272
 
273
 
274
  </p>
275
  <br>
276
+ <p>
277
+ <div class="container">
278
+ <div class="row">
279
+ <div class="col-sm">
280
+ <label><?php esc_html_e('Auto Expand Photos in Tweets', 'twitter-tweets'); ?></label>
281
+ </div>
282
+ <div class="col-sm">
283
+ <select id="photo_1234" name="photo_1234">
284
+ <option value="yes" <?php if ($AutoExpandPhotos == "yes") echo "selected=selected" ?>><?php esc_html_e('Yes', 'twitter-tweets'); ?></option>
285
+ <option value="no" <?php if ($AutoExpandPhotos == "no") echo "selected=selected" ?>><?php esc_html_e('No', 'twitter-tweets'); ?></option>
286
+ </select>
287
+ </div>
288
+ </div>
289
+ </div>
290
 
291
 
292
  </p>
293
  <br>
294
+ <p>
295
+ <div class="container">
296
+ <div class="row">
297
+ <div class="col-sm">
298
+ <label><?php esc_html_e('Select Language', 'twitter-tweets'); ?></label>
299
+ </div>
300
+ <div class="col-sm">
301
+ <select id="tw_language" name="tw_language">
302
+ <option value="" <?php if ($tw_language == "") echo "selected=selected" ?>><?php esc_html_e('Automatic', 'twitter-tweets'); ?></option>
303
+ <option value="en" <?php if ($tw_language == "en") echo "selected=selected" ?>><?php esc_html_e('English (default)', 'twitter-tweets'); ?></option>
304
+ <option value="ar" <?php if ($tw_language == "ar") echo "selected=selected" ?>><?php esc_html_e('Arabic', 'twitter-tweets'); ?></option>
305
+ <option value="bn" <?php if ($tw_language == "bn") echo "selected=selected" ?>><?php esc_html_e('Bengali', 'twitter-tweets'); ?></option>
306
+ <option value="cs" <?php if ($tw_language == "cs") echo "selected=selected" ?>><?php esc_html_e('Czech', 'twitter-tweets'); ?></option>
307
+ <option value="da" <?php if ($tw_language == "da") echo "selected=selected" ?>><?php esc_html_e('Danish', 'twitter-tweets'); ?></option>
308
+ <option value="de" <?php if ($tw_language == "de") echo "selected=selected" ?>><?php esc_html_e('German', 'twitter-tweets'); ?></option>
309
+ <option value="el" <?php if ($tw_language == "el") echo "selected=selected" ?>><?php esc_html_e('Greek', 'twitter-tweets'); ?></option>
310
+ <option value="es" <?php if ($tw_language == "es") echo "selected=selected" ?>><?php esc_html_e('Spanish', 'twitter-tweets'); ?></option>
311
+ <option value="fa" <?php if ($tw_language == "fa") echo "selected=selected" ?>><?php esc_html_e('Persian', 'twitter-tweets'); ?></option>
312
+ <option value="fi" <?php if ($tw_language == "fi") echo "selected=selected" ?>><?php esc_html_e('Finnish', 'twitter-tweets'); ?></option>
313
+ <option value="fil" <?php if ($tw_language == "fil") echo "selected=selected" ?>><?php esc_html_e('Filipino', 'twitter-tweets'); ?></option>
314
+ <option value="fr" <?php if ($tw_language == "fr") echo "selected=selected" ?>><?php esc_html_e('French', 'twitter-tweets'); ?></option>
315
+ <option value="he" <?php if ($tw_language == "he") echo "selected=selected" ?>><?php esc_html_e('Hebrew', 'twitter-tweets'); ?></option>
316
+ <option value="hi" <?php if ($tw_language == "hi") echo "selected=selected" ?>><?php esc_html_e('Hindi', 'twitter-tweets'); ?></option>
317
+ <option value="hu" <?php if ($tw_language == "hu") echo "selected=selected" ?>><?php esc_html_e('EHungarian', 'twitter-tweets'); ?></option>
318
+ <option value="id" <?php if ($tw_language == "id") echo "selected=selected" ?>><?php esc_html_e('Indonesian', 'twitter-tweets'); ?></option>
319
+ <option value="it" <?php if ($tw_language == "it") echo "selected=selected" ?>><?php esc_html_e('Italian', 'twitter-tweets'); ?></option>
320
+ <option value="ja" <?php if ($tw_language == "ja") echo "selected=selected" ?>><?php esc_html_e('Japanese', 'twitter-tweets'); ?></option>
321
+ <option value="ko" <?php if ($tw_language == "ko") echo "selected=selected" ?>><?php esc_html_e('Korean', 'twitter-tweets'); ?></option>
322
+ <option value="msa" <?php if ($tw_language == "msa") echo "selected=selected" ?>><?php esc_html_e('Malay', 'twitter-tweets'); ?></option>
323
+ <option value="nl" <?php if ($tw_language == "nl") echo "selected=selected" ?>><?php esc_html_e('Dutch)', 'twitter-tweets'); ?></option>
324
+ <option value="no" <?php if ($tw_language == "no") echo "selected=selected" ?>><?php esc_html_e('Norwegian', 'twitter-tweets'); ?></option>
325
+ <option value="pl" <?php if ($tw_language == "pl") echo "selected=selected" ?>><?php esc_html_e('Polish', 'twitter-tweets'); ?></option>
326
+ <option value="pt" <?php if ($tw_language == "pt") echo "selected=selected" ?>><?php esc_html_e('Portuguese', 'twitter-tweets'); ?></option>
327
+ <option value="ro" <?php if ($tw_language == "ro") echo "selected=selected" ?>><?php esc_html_e('Romanian', 'twitter-tweets'); ?></option>
328
+ <option value="ru" <?php if ($tw_language == "ru") echo "selected=selected" ?>><?php esc_html_e('Russian', 'twitter-tweets'); ?></option>
329
+ <option value="sv" <?php if ($tw_language == "sv") echo "selected=selected" ?>><?php esc_html_e('Swedish', 'twitter-tweets'); ?></option>
330
+ <option value="th" <?php if ($tw_language == "th") echo "selected=selected" ?>><?php esc_html_e('Thai', 'twitter-tweets'); ?></option>
331
+ <option value="tr" <?php if ($tw_language == "tr") echo "selected=selected" ?>><?php esc_html_e('Turkish', 'twitter-tweets'); ?></option>
332
+ <option value="uk" <?php if ($tw_language == "uk") echo "selected=selected" ?>><?php esc_html_e('Ukrainian', 'twitter-tweets'); ?></option>
333
+ <option value="ur" <?php if ($tw_language == "ur") echo "selected=selected" ?>><?php esc_html_e('Urdu', 'twitter-tweets'); ?></option>
334
+ <option value="vi" <?php if ($tw_language == "vi") echo "selected=selected" ?>><?php esc_html_e('Vietnamese', 'twitter-tweets'); ?></option>
335
+ <option value="zh-cn" <?php if ($tw_language == "zh-cn") echo "selected=selected" ?>><?php esc_html_e('Chinese (Simplified)', 'twitter-tweets'); ?></option>
336
+ <option value="zh-tw" <?php if ($tw_language == "zh-tw") echo "selected=selected" ?>><?php esc_html_e('Chinese', 'twitter-tweets'); ?> (Traditional)</option>
337
+ </select>
338
+ </div>
339
+ </div>
340
  </div>
341
 
342
 
346
  <input onclick="return SaveSettings();" type="button" class="twt_save_btn" id="fb-save-settings" name="fb-save-settings" value="SAVE">
347
 
348
  <div id="fb-img" style="display: none;">
349
+ <img src="<?php echo WEBLIZAR_TWITTER_PLUGIN_URL . 'images/loading.gif'; ?>" />
350
  </div>
351
  <div id="fb-msg" style="display: none;" class="alert">
352
+ <?php esc_html_e('Settings successfully saved. Reloading page for generating preview right side of setting.', 'twitter-tweets'); ?>
353
  </div>
354
  </form>
355
 
356
  </div>
357
  <!-- Preview Part-->
358
  <div class="col-md-6">
359
+ <?php if ($TwitterWidgetId) { ?>
360
+ <h2 class="well"><?php esc_html_e('Feeds Shortcode Preview', 'twitter-tweets'); ?></h2>
361
+ <hr>
362
+ <p>
363
+ <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>" min-width="<?php echo esc_attr($Width); ?>" height="<?php echo esc_attr($Height); ?>" data-theme="<?php echo esc_attr($Theme); ?>" data-lang="<?php echo esc_attr($tw_language); ?>" data-link-color="<?php echo esc_attr($LinkColor); ?>"></a>
364
+ <div class="twt_help">
365
+ <?php esc_html_e('Please copy the twitter shortcode', 'twitter-tweets'); ?> <span style="color:#000;"><b>[TWTR]</b> </span> <?php esc_html_e('and paste it to on the Page/Post', 'twitter-tweets'); ?></span>
366
+ </div>
 
 
 
 
 
367
 
368
+ <script>
369
+ ! function(d, s, id) {
370
+ var js, fjs = d.getElementsByTagName(s)[0],
371
+ p = /^http:/.test(d.location) ? 'http' : 'https';
372
+ if (!d.getElementById(id)) {
373
+ js = d.createElement(s);
374
+ js.id = id;
375
+ js.src = p + "://platform.twitter.com/widgets.js";
376
+ fjs.parentNode.insertBefore(js, fjs);
377
+ }
378
+ }(document, "script", "twitter-wjs");
379
+ </script>
380
+ </p>
381
+ <?php } ?>
382
  </div>
383
+ </div>
384
  </div>
385
 
386
  <!-- API Key -->
387
  <?php
388
+ include_once('load-tweets.php');
389
  ?>
390
  <div class="block ui-tabs-panel deactive" id="option-apikey">
391
  <div class="row">
392
  <div class="col-md-6">
393
  <div class="row">
394
  <div class="col-md-12">
395
+ <h2 class="well"><?php esc_html_e('Twitter API Setting', 'twitter-tweets'); ?></h2>
396
  </div>
397
  <div class="col-md-12">
398
  <form name='api-form' id='api-form'>
399
  <br>
400
+ <p>
401
+ <div class="container">
402
+ <div class="row">
403
+ <div class="col-sm">
404
+ <label><?php esc_html_e('Consumer Key', 'twitter-tweets'); ?>&nbsp;*</label>
405
+ </div>
406
+ <div class="col-sm">
407
+ <input class="widefat" id="wl_twitter_consumer_key" name="wl_twitter_consumer_key" type="text" value="<?php if (isset($wl_twitter_consumer_key)) {
408
+ echo esc_attr($wl_twitter_consumer_key);
409
+ } ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Consumer Key', 'twitter-tweets'); ?>">
410
+ <span class="helplink"><?php esc_html_e("Visit this link to ", 'twitter-tweets'); ?><a href="https://weblizar.com/blog/generate-twitter-api-key/" target="_bank"><?php esc_html_e("Generate Twitter API key", 'twitter-tweets'); ?></a></span>
411
+ <br>
412
+ </div>
413
+ </div>
414
  </div>
415
 
416
 
418
 
419
 
420
  <br>
421
+ <p>
422
+ <div class="container">
423
+ <div class="row">
424
+ <div class="col-sm">
425
+ <label><?php esc_html_e('Consumer Secret', 'twitter-tweets'); ?>&nbsp;*</label>
426
+ </div>
427
+ <div class="col-sm">
428
+ <input class="widefat" id="wl_twitter_consumer_secret" name="wl_twitter_consumer_secret" type="text" value="<?php if (isset($wl_twitter_consumer_secret)) {
429
+ echo esc_attr($wl_twitter_consumer_secret);
430
+ } ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Consumer Secret', 'twitter-tweets'); ?>">
431
+ </div>
432
+ </div>
433
  </div>
434
 
435
 
439
  <br>
440
  <p>
441
  <div class="container">
442
+ <div class="row">
443
+ <div class="col-sm">
444
+ <label><?php esc_html_e('Access Token', 'twitter-tweets'); ?>&nbsp;*</label>
445
+ </div>
446
+ <div class="col-sm">
447
+ <input class="widefat" id="wl_twitter_access_token" name="wl_twitter_access_token" type="text" value="<?php if (isset($wl_twitter_access_token)) {
448
+ echo esc_attr($wl_twitter_access_token);
449
+ } ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Access Token', 'twitter-tweets'); ?>">
450
+ </div>
451
+ </div>
452
  </div>
453
 
454
 
458
  <br>
459
  <p>
460
  <div class="container">
461
+ <div class="row">
462
+ <div class="col-sm">
463
+ <label><?php esc_html_e('Access Token Secret', 'twitter-tweets'); ?>&nbsp;*</label>
464
+ </div>
465
+ <div class="col-sm">
466
+ <input class="widefat" id="wl_twitter_token_secret" name="wl_twitter_token_secret" type="text" value="<?php if (isset($wl_twitter_token_secret)) {
467
+ echo esc_attr($wl_twitter_token_secret);
468
+ } ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Token Secret', 'twitter-tweets'); ?>">
469
+ </div>
470
+ </div>
471
  </div>
472
 
473
 
476
  <br>
477
  <p>
478
  <div class="container">
479
+ <div class="row">
480
+ <div class="col-sm">
481
+ <label><?php esc_html_e('No. Of tweets Show', 'twitter-tweets'); ?></label>
482
+ </div>
483
+ <div class="col-sm">
484
+ <input class="widefat wltt-slider" id="wl_twitter_tweets" name="wl_twitter_tweets" type="range" value="<?php if (isset($wl_twitter_tweets)) {
485
+ echo esc_attr($wl_twitter_tweets);
486
+ } ?>" min="1" max="14" data-rangeSlider>
487
+ <p>
488
+ <b><?php esc_html_e('Set no of tweets you want to show (Use Arrow Keys)', 'twitter-tweets'); ?></b> <span id="wl_twitter_range_show"></span>
489
+ </p>
490
+ </div>
491
+ </div>
492
  </div>
493
 
494
 
495
  </p>
496
 
497
+ <br>
498
  <p>
499
  <div class="container">
500
+ <div class="row">
501
+ <div class="col-sm">
502
+ <label><?php esc_html_e('Layout', 'twitter-tweets'); ?></label>
503
+ </div>
504
+ <div class="col-sm">
505
+ <select class="widefat" name="wl_twitter_layout" id="wl_twitter_layout">
506
+ <option value=""><?php esc_html_e('Select', 'twitter-tweets'); ?></option>
507
+ <option value="12"><?php esc_html_e('1', 'twitter-tweets'); ?></option>
508
+ <option value="6"><?php esc_html_e('2', 'twitter-tweets'); ?></option>
509
+ <option value="4"><?php esc_html_e('3', 'twitter-tweets'); ?></option>
510
+ <option value="3"><?php esc_html_e('4', 'twitter-tweets'); ?></option>
511
+ </select>
512
+ </div>
513
+ </div>
514
  </div>
515
 
516
 
517
  </p>
518
  <script type="text/javascript">
519
+ var abc = '<?php echo esc_attr($wl_twitter_layout); ?>';
520
+ jQuery('#wl_twitter_layout').find('option[value="' + abc + '"]').attr('selected', 'selected')
521
+ </script>
522
  <br>
523
  <?php
524
+ wp_nonce_field('twitter_api_nonce', 'twitter_api_nonce');
525
  ?>
526
  <input onclick="return SaveApiSettings();" type="button" class="twt_save_btn" id="fb-api-save-settings" name="fb-api-save-settings" value="SAVE">
527
  <br><br><br>
528
  <div class="twt_help">
529
+ <?php esc_html_e('Please copy the twitter shortcode', 'twitter-tweets'); ?> <span style="color:#000;"> <b><?php esc_html_e('[WL_TWITTER]', 'twitter-tweets'); ?></b> </span>
530
+ <?php esc_html_e('and paste it to on the Page/Post', 'twitter-tweets'); ?></span>
531
  </div>
532
  <div id="twitter-img" style="display: none;">
533
+ <img src="<?php echo WEBLIZAR_TWITTER_PLUGIN_URL . 'images/loading.gif'; ?>" />
534
  </div>
535
  <div id="wl_twitter_preview" style="display: none;" class="alert">
536
+ <?php esc_html_e('Settings successfully saved. Reloading page for generating preview right side of setting.', 'twitter-tweets'); ?>
537
  </div>
538
  </form>
539
  </div>
542
  <div class="col-md-6">
543
  <div class="wl_twt_free">
544
  <div class="container-fluid">
545
+ <div class="row">
546
+ <div class="col-md-<?php if (isset($wl_twitter_layout)) {
547
+ echo esc_attr($wl_twitter_layout);
548
+ } ?>">
549
+ <?php
550
+ if (isset($statuses) && is_array($statuses)) {
551
+ foreach ($statuses as $status) {
552
+ /* user info */
553
+ if (isset($status->user)) {
554
+ $user = $status->user;
555
+ }
556
+ if (isset($user->name)) {
557
+ $name = $user->name;
558
+ }
559
+ if (isset($user->screen_name)) {
560
+ $screen_name = $user->screen_name;
561
+ }
562
+ if (isset($user->location)) {
563
+ $location = $user->location;
564
+ }
565
+ if (isset($user->description)) {
566
+ $description = $user->description;
567
+ }
568
+ if (isset($user->url)) {
569
+ $url = $user->url;
570
+ }
571
+ if (isset($status->id_str)) {
572
+ $id_str = $status->id_str; /* use it to make link of post */
573
+ }
574
+ if (isset($status->created_at)) {
575
+ $created_at = $status->created_at; /* time when tweet was created */
576
+ }
577
+ /* profile_image_url */
578
+ if (isset($user->profile_image_url)) {
579
+ $profile_image_url = $user->profile_image_url;
580
+ }
581
+ if (isset($user->profile_image_url_https)) {
582
+ $profile_image_url_https = $user->profile_image_url_https;
583
+ }
584
+ ?>
585
+ <div class="wl_tweet_box">
586
+ <p class="wl_tweet">
587
+ <img class="align-self-start mr-3" src="<?php if (isset($user->profile_image_url_https)) {
588
+ echo esc_url($profile_image_url_https);
589
+ } ?>" alt="">
590
+ <a href="https://twitter.com/<?php if (isset($user->screen_name)) {
591
+ echo esc_attr($screen_name);
592
+ } ?>">
593
+ <?php if (isset($user->screen_name)) {
594
+ echo "@" . $screen_name;
595
+ } ?>
596
+ </a>
597
+ </p>
598
+ <?php
599
+ // $entities = $status->entities;
600
+ if (isset($status->extended_entities)) {
601
+ $extended_entities_array = $status->extended_entities->media;
602
+ $extended_entities = $extended_entities_array[0];
603
+ $display_url = $extended_entities->display_url;
604
+ $media_expanded_url = $extended_entities->expanded_url;
605
+ $media_type = $extended_entities->type;
606
+ $media_url = $extended_entities->media_url;
607
+ if ($media_type == "photo") {
608
+ ?>
609
+ <img src="<?php echo esc_url($media_url); ?>" class="img-fluid" />
610
+ <?php
611
+ } elseif ($media_type == "video") {
612
+ $video_info = $extended_entities->video_info->variants[2];
613
+ $content_type = $video_info->content_type;
614
+ $url = $video_info->url;
615
+ $new_url = str_replace("?tag=8", "", $url);
616
 
617
+ if (isset($enable_extended_entitie) && $enable_extended_entitie == "enable") {
618
  ?>
619
+ <a href="#" data-toggle="modal" data-target="#myModal">
620
+ <img src="<?php echo esc_url($media_url); ?>" class="img-fluid" />
621
+ </a>
622
  <?php
623
+ } else {
624
  ?>
625
+ <a href="#">
626
+ <img src="<?php echo esc_url($media_url); ?>" class="img-fluid" />
627
+ </a>
628
  <?php
629
+ }
630
+ }
631
+ } /* extended enntities */ elseif (!empty($entities->media) && is_array($entities->media)) {
632
+ $media = $entities->media;
633
+ foreach ($media as $media_key => $media_value) {
634
+ $media_url = $media_value->media_url;
635
+ $media_url_https = $media_value->media_url_https;
636
+ $media_detail_url = $media_value->url;
637
+ $media_display_url = $media_value->display_url;
638
+ $media_expanded_url = $media_value->expanded_url;
639
+ $media_type = $media_value->type;
640
+ $media_sizes = $media_value->sizes;
641
+ ?>
642
+ <a href="<?php echo esc_url($media_expanded_url); ?>">
643
+ <img src="<?php echo esc_url($media_url_https); ?>" class="img-fluid" />
644
+ </a>
645
+ <?php
646
  }
647
  }
648
+ ?>
649
+ <p class="wl_tweet_desc">
 
 
 
 
 
 
 
 
 
 
 
 
 
650
  <?php
651
+ if (isset($status->text)) {
652
+ echo makeLinks($status->text);
653
+ }
654
+ ?>
655
+ </p>
656
+ <p class="wl_tweet_action_buttons">
657
+ <a href="https://twitter.com/intent/retweet?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet" target="_blank" onclick="window.open('https://twitter.com/intent/retweet?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;">
658
+ <?php
659
+ if (isset($status->retweet_count)) {
660
+ esc_html_e('Retweet', 'twitter-tweets');
661
+ echo esc_html("($status->retweet_count)");
662
+ }
663
+ ?>
664
+ </a>
665
+
666
+ <a href="https://twitter.com/intent/like?tweet_id=<?php echo esc_html($id_str); ?>&related=<?php echo esc_attr($screen_name); ?>" target="_blank" onclick="window.open('https://twitter.com/intent/like?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;">
667
+ <?php
668
+ if (isset($status->favorite_count)) {
669
+ esc_html_e('Like', 'twitter-tweets');
670
+ echo esc_html("($status->favorite_count)");
671
+ }
672
+ ?>
673
+ </a>
674
+
675
+ <a href="https://twitter.com/intent/tweet?in_reply_to=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_html($screen_name); ?>" target="_blank" onclick="window.open('https://twitter.com/intent/tweet?in_reply_to=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;"><?php esc_html_e('Reply', 'twitter-tweets'); ?>
676
+ </a>
677
+ </p>
678
+ <span class="wl-wtp-date-font-size"><?php if (isset($status->created_at)) {
679
+ echo tweet_time_calculate($created_at);
680
+ } ?>
681
+ &nbsp;<?php if (isset($status->created_at)) {
682
+ esc_html_e('ago', 'twitter-tweets');
683
+ } ?></span>
684
+ </div> <!-- Tweet box -->
685
+ <?php }
686
+ } ?>
687
+ </div>
688
+ </div>
 
 
 
689
  </div>
690
  </div>
691
  </div>
702
  <p class="well"><b><?php esc_html_e('Customize Feeds for Twitter plugin comes with 2 major feature.', 'twitter-tweets'); ?></b></p>
703
  <ol>
704
  <li><?php esc_html_e('Customize feeds Widget', 'twitter-tweets'); ?></li>
705
+ <li><?php esc_html_e('Customize feeds Shortcode', 'twitter-tweets'); ?><?php esc_html_e('[TWTR]', 'twitter-tweets'); ?></li>
706
  <li><?php esc_html_e('Note: Protected tweets will not view', 'twitter-tweets'); ?> <a href="https://help.twitter.com/en/safety-and-security/public-and-protected-tweets" target="_blank"><?php esc_html_e('Help', 'twitter-tweets'); ?></a></li>
707
  </ol>
708
  <br>
710
 
711
  <ol>
712
  <li><?php esc_html_e('You can use the widget to display your Twitter Tweets in any theme Widget Sections.', 'twitter-tweets'); ?></li>
713
+ <li><?php esc_html_e('Simple go to your', 'twitter-tweets'); ?><a href="<?php echo get_site_url(); ?>/wp-admin/widgets.php"><strong><?php esc_html_e('Widgets', 'twitter-tweets'); ?></strong></a><?php esc_html_e(' section and activate available', 'twitter-tweets'); ?> <strong><?php esc_html_e('Twitter By Weblizar', 'twitter-tweets'); ?></strong> <?php esc_html_e('widget in any sidebar section, like in left sidebar, right sidebar or footer sidebar.', 'twitter-tweets'); ?></li>
714
+ </ol>
715
  <br>
716
+ <p class="well"><strong><?php esc_html_e('Feeds Short-code ', 'twitter-tweets'); ?><?php esc_html_e('[TWTR]', 'twitter-tweets'); ?></strong></p>
717
  <ol>
718
  <li><strong>[TWTR]</strong> <?php esc_html_e('shortcode give ability to display Twitter Tweets Box in any Page / Post with content', 'twitter-tweets'); ?>.</li>
719
+ <li><?php esc_html_e('To use shortcode, just copy', 'twitter-tweets'); ?> <strong><?php esc_html_e('[TWTR]', 'twitter-tweets'); ?></strong><?php esc_html_e('shortcode and paste into content editor of any Page / Post.', 'twitter-tweets'); ?></li>
720
  </ol>
721
 
722
  <br>
723
+ <p class="well"><strong><?php esc_html_e('Twitter Short-code', 'twitter-tweets'); ?><?php esc_html_e('[WL_TWITTER]', 'twitter-tweets'); ?></strong></p>
724
  <ol>
725
+ <li><strong><?php esc_html_e('[WL_TWITTER]', 'twitter-tweets'); ?></strong><?php esc_html_e('shortcode, another shortcode, using API Key to login, give ability to display Twitter Tweets Box in any Page / Post with content.', 'twitter-tweets'); ?></li>
726
+ <li><?php esc_html_e('To use shortcode, just copy', 'twitter-tweets'); ?> <strong><?php esc_html_e('[WL_TWITTER]', 'twitter-tweets'); ?></strong><?php esc_html_e(' shortcode and paste into content editor of any Page / Post.', 'twitter-tweets'); ?></li>
727
  </ol>
728
 
729
  <br>
733
 
734
  <br>
735
  <p class="well"><strong><?php esc_html_e('Q. What is Twitter Widget ID?', 'twitter-tweets'); ?></strong></p>
736
+ <p><strong><?php esc_html_e('Ans. Twitter Widget ID', 'twitter-tweets'); ?></strong><?php esc_html_e('used to authenticate your TWITTER Page data & settings. To get your own TWITTER ID please read our very simple and easy', 'twitter-tweets'); ?> <a href="https://weblizar.com/get-twitter-widget-id/" target="_blank"><strong><?php esc_html_e('Tutorial', 'twitter-tweets'); ?></strong>.</a>
737
  </p>
738
  </div>
739
  </div>
740
  <div class="row">
741
  <div class="col-md-10">
742
+ <div id="heading">
743
+ <h2><?php esc_html_e('Rate Us', 'twitter-tweets'); ?></h2>
744
+ </div>
745
+ <p><?php esc_html_e('If you are enjoying using our', 'twitter-tweets'); ?> <b><?php esc_html_e('Customize Feeds for Twitter Widget', 'twitter-tweets'); ?></b><?php esc_html_e('plugin and find it useful, then please consider writing a positive feedback. Your feedback will help us to encourage and support the plugin continued development and better user support.', 'twitter-tweets'); ?>
746
  </p>
747
  <div class="twt_star">
748
+ <a class="acl-rate-us" style="text-align:center; text-decoration: none;font:normal 30px/l;" href="https://wordpress.org/plugins/twitter-tweets/#reviews" target="_blank">
749
  <span class="dashicons dashicons-star-filled"></span>
750
  <span class="dashicons dashicons-star-filled"></span>
751
  <span class="dashicons dashicons-star-filled"></span>
759
  <!---------------- our product tab------------------------>
760
  <div class="block ui-tabs-panel deactive" id="option-ourproduct">
761
  <?php require_once('our_product.php'); ?>
762
+ </div>
twiiter_help_body.php CHANGED
@@ -1,49 +1,51 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <div class="wrap" id="weblizar_wrap">
3
- <div id="content_wrap">
4
  <div class="weblizar-header">
5
- <h2><span class="dashicons dashicons-twitter" style="width: auto;"><?php esc_html_e('Customize Feeds for Twitter', 'twitter-tweets');?></span></h2>
6
  <br>
7
  <div class="weblizar-submenu-links" id="weblizar-submenu-links">
8
  <ul>
9
- <li class=""><div class="dashicons dashicons-format-chat"></div>
10
- <a href="https://wordpress.org/plugins/twitter-tweets/" target="_blank" title="<?php esc_attr_e( 'Support Forum', 'twitter-tweets' ); ?>">
11
- <?php esc_html_e('Support Forum', 'twitter-tweets');?></a>
 
12
  </li>
13
- <li class=""><div class="dashicons dashicons-welcome-write-blog"></div>
14
- <a href="<?php echo WEBLIZAR_TWITTER_PLUGIN_URL.'readme.txt'; ?>" target="_blank" title="<?php esc_attr_e( 'Plugin Changelog', 'twitter-tweets' ); ?>">
15
- <?php esc_html_e('Plugin Change Log','twitter-tweets');?></a>
 
16
  </li>
17
  </ul>
18
- </div>
19
- </div>
20
  </div>
21
  <div id="content">
22
  <div id="options_tabs" class="ui-tabs">
23
- <ul class="options_tabs ui-tabs-nav" role="tablist" id="nav">
24
  <li class="active">
25
  <a id="general">
26
- <div class="dashicons dashicons-admin-generic"></div><?php esc_html_e('Feeds Widget','twitter-tweets');?>
27
  </a>
28
  </li>
29
  <li>
30
  <a id="apikey">
31
- <div class="dashicons dashicons-admin-generic"></div><?php esc_html_e('Twitter Feeds','twitter-tweets');?>
32
  </a>
33
- </li>
34
  <li>
35
  <a id="needhelp">
36
- <div class="dashicons dashicons-editor-help"></div><?php esc_html_e('Need Help', 'twitter-tweets');?>
37
  </a>
38
  </li>
39
  <li>
40
  <a id="ourproduct">
41
- <div class="dashicons dashicons-plus"></div><?php esc_html_e('Upgrade To Pro', 'twitter-tweets');?>
42
  </a>
43
- </li>
44
  </ul>
45
- <?php include('banner.php'); ?>
46
  <?php require_once('twiiter_help.php'); ?>
47
- </div>
48
  </div>
49
- </div>
1
+ <?php if (!defined('ABSPATH')) exit; ?>
2
  <div class="wrap" id="weblizar_wrap">
3
+ <div id="content_wrap">
4
  <div class="weblizar-header">
5
+ <h2><span class="dashicons dashicons-twitter" style="width: auto;"><?php esc_html_e('Customize Feeds for Twitter', 'twitter-tweets'); ?></span></h2>
6
  <br>
7
  <div class="weblizar-submenu-links" id="weblizar-submenu-links">
8
  <ul>
9
+ <li class="">
10
+ <div class="dashicons dashicons-format-chat"></div>
11
+ <a href="https://wordpress.org/plugins/twitter-tweets/" target="_blank" title="<?php esc_attr_e('Support Forum', 'twitter-tweets'); ?>">
12
+ <?php esc_html_e('Support Forum', 'twitter-tweets'); ?></a>
13
  </li>
14
+ <li class="">
15
+ <div class="dashicons dashicons-welcome-write-blog"></div>
16
+ <a href="<?php echo WEBLIZAR_TWITTER_PLUGIN_URL . 'readme.txt'; ?>" target="_blank" title="<?php esc_attr_e('Plugin Changelog', 'twitter-tweets'); ?>">
17
+ <?php esc_html_e('Plugin Change Log', 'twitter-tweets'); ?></a>
18
  </li>
19
  </ul>
20
+ </div>
21
+ </div>
22
  </div>
23
  <div id="content">
24
  <div id="options_tabs" class="ui-tabs">
25
+ <ul class="options_tabs ui-tabs-nav" role="tablist" id="nav">
26
  <li class="active">
27
  <a id="general">
28
+ <div class="dashicons dashicons-admin-generic"></div><?php esc_html_e('Feeds Widget', 'twitter-tweets'); ?>
29
  </a>
30
  </li>
31
  <li>
32
  <a id="apikey">
33
+ <div class="dashicons dashicons-admin-generic"></div><?php esc_html_e('Twitter Feeds', 'twitter-tweets'); ?>
34
  </a>
35
+ </li>
36
  <li>
37
  <a id="needhelp">
38
+ <div class="dashicons dashicons-editor-help"></div><?php esc_html_e('Need Help', 'twitter-tweets'); ?>
39
  </a>
40
  </li>
41
  <li>
42
  <a id="ourproduct">
43
+ <div class="dashicons dashicons-plus"></div><?php esc_html_e('Upgrade To Pro', 'twitter-tweets'); ?>
44
  </a>
45
+ </li>
46
  </ul>
47
+ <?php include('banner.php'); ?>
48
  <?php require_once('twiiter_help.php'); ?>
49
+ </div>
50
  </div>
51
+ </div>
twitter-tweets.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  * Plugin Name: Customize Feeds for Twitter
4
- * Version: 1.9.4
5
  * Description: Customize Feeds for Twitter plugin for WordPress. You can use this to display real time Twitter feeds on any where on your webiste by using shortcode or widgets
6
  * Author: Weblizar
7
  * Author URI: https://www.weblizar.com/
@@ -69,4 +69,3 @@ function wl_twitter_settinglinks( $links ) {
69
  }
70
  $plugin_wl_twitter = plugin_basename( __FILE__ );
71
  add_filter( "plugin_action_links_$plugin_wl_twitter", 'wl_twitter_settinglinks' );
72
- ?>
1
  <?php
2
  /*
3
  * Plugin Name: Customize Feeds for Twitter
4
+ * Version: 1.9.5
5
  * Description: Customize Feeds for Twitter plugin for WordPress. You can use this to display real time Twitter feeds on any where on your webiste by using shortcode or widgets
6
  * Author: Weblizar
7
  * Author URI: https://www.weblizar.com/
69
  }
70
  $plugin_wl_twitter = plugin_basename( __FILE__ );
71
  add_filter( "plugin_action_links_$plugin_wl_twitter", 'wl_twitter_settinglinks' );
 
twitter-tweets_shortcode.php CHANGED
@@ -1,215 +1,228 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
  /*** Shortcode For twitter tweet ***/
4
  add_shortcode("TWTR", "twitter_tweet_shortcode");
5
- function twitter_tweet_shortcode() {
 
6
  ob_start();
7
  $twitterSettings = unserialize(get_option("ali_twitter_shortcode"));
8
 
9
- if( isset($twitterSettings[ 'TwitterUserName' ] ) ) {
10
- $TwitterUserName = $twitterSettings[ 'TwitterUserName' ];
11
  } else $TwitterUserName = "weblizar";
12
 
13
  $Theme = "light";
14
- if (isset($twitterSettings[ 'Theme' ] ) ) {
15
- $Theme = $twitterSettings[ 'Theme' ];
16
  }
17
 
18
  $Height = "450";
19
- if ( isset($twitterSettings[ 'Height' ] ) ) {
20
- $Height = $twitterSettings[ 'Height' ];
21
  }
22
 
23
  $Width = "";
24
- if (isset($twitterSettings[ 'Width' ] ) ) {
25
- $Width = $twitterSettings[ 'Width' ];
26
  }
27
 
28
  $LinkColor = "#CC0000";
29
- if (isset( $twitterSettings[ 'LinkColor' ] ) ) {
30
- $LinkColor = $twitterSettings[ 'LinkColor' ];
31
  }
32
 
33
  $ExcludeReplies = "yes";
34
- if (isset( $twitterSettings[ 'ExcludeReplies' ] ) ) {
35
- $ExcludeReplies = $twitterSettings['ExcludeReplies' ];
36
  }
37
 
38
  $AutoExpandPhotos = "yes";
39
- if (isset( $twitterSettings[ 'AutoExpandPhotos' ] ) ) {
40
- $AutoExpandPhotos = $twitterSettings[ 'AutoExpandPhotos' ];
41
  }
42
  $tw_language = "";
43
- if (isset( $twitterSettings[ 'tw_language' ] ) ) {
44
- $tw_language = $twitterSettings[ 'tw_language' ];
45
  }
46
 
47
- if (isset($twitterSettings[ 'TwitterWidgetId' ] ) ) {
48
- $TwitterWidgetId = $twitterSettings[ 'TwitterWidgetId' ];
49
  } else {
50
  $TwitterWidgetId = "";
51
  }
52
 
53
- $title = esc_html__( 'Widget Title Here', 'twitter-tweets' );
54
- if(isset($twitterSettings[ 'title' ] ) ) {
55
- $title = $twitterSettings[ 'title' ];
56
  }
57
 
58
- ?>
59
  <div style="display:block;width:100%;float:left;overflow:hidden">
60
- <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>"
61
- min-width="<?php echo esc_attr($Width); ?>"
62
- height="<?php echo esc_attr($Height); ?>"
63
- data-theme="<?php echo esc_attr($Theme); ?>"
64
- data-lang="<?php echo esc_attr($tw_language); ?>"
65
- data-link-color="<?php echo esc_attr($LinkColor); ?>"
66
- data-cards="hidden"></a>
67
  <script>
68
- !function(d,s,id) {
69
- 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);}
70
- } (document,"script","twitter-wjs");
 
 
 
 
 
 
 
71
  </script>
72
  </div>
73
- <?php
74
  return ob_get_clean();
75
  }
76
  add_shortcode("WL_TWITTER", "wl_twitter_tweets_api");
77
- function wl_twitter_tweets_api() {
78
- require_once( wl_twitter_dir_path . "load-tweets.php" );
 
79
  ob_start();
80
  ?>
81
- <div class="wl_twt_free">
82
- <div class="container-fluid">
83
- <div class="row">
84
- <!-- <div > -->
85
- <?php if ( isset( $statuses ) && is_array( $statuses ) ) {
86
- foreach ( $statuses as $status ) {
87
- // var_dump($status);
88
- /* user info */
89
- if( isset( $status->user ) ) {
90
- $user = $status->user;
91
- }
92
- if( isset( $user->name ) ) {
93
- $name = $user->name;
94
- }
95
- if( isset( $user->screen_name ) ) {
96
- $screen_name = $user->screen_name;
97
- }
98
- if( isset( $user->location ) ) {
99
- $location = $user->location;
100
- }
101
- if( isset( $user->description ) ) {
102
- $description = $user->description;
103
- }
104
- if( isset( $user->url ) ) {
105
- $url = $user->url;
106
- }
107
- if( isset( $status->id_str ) ) {
108
- $id_str = $status->id_str; /* use it to make link of post */
109
- }
110
- if( isset( $status->created_at ) ) {
111
- $created_at = $status->created_at; /* time when tweet was created */
112
- }
113
- /* profile_image_url */
114
- if( isset( $user->profile_image_url ) ) {
115
- $profile_image_url = $user->profile_image_url;
116
- }
117
- if( isset( $user->profile_image_url_https ) ) {
118
- $profile_image_url_https = $user->profile_image_url_https;
119
- }
120
  ?>
121
- <div class="wl_tweet_box col-md-<?php if( isset( $wl_twitter_layout ) ) {echo esc_attr($wl_twitter_layout);} ?>">
122
- <p class="wl_tweet">
123
- <img class="align-self-start mr-3" src="<?php if( isset( $user->profile_image_url_https ) ) { echo esc_url($profile_image_url_https); } ?>" alt="">
124
- <a href="https://twitter.com/<?php if( isset( $user->screen_name ) ) {echo esc_attr($screen_name);} ?>">
125
- <?php if( isset( $user->screen_name ) ) {echo "@" . $screen_name;} ?>
126
- </a>
127
- </p>
128
- <?php
129
- if ( isset( $status->extended_entities ) ) {
130
- $extended_entities_array = $status->extended_entities->media;
131
- $extended_entities = $extended_entities_array[0];
132
- $display_url = $extended_entities->display_url;
133
- $media_expanded_url = $extended_entities->expanded_url;
134
- $media_type = $extended_entities->type;
135
- $media_url = $extended_entities->media_url;
136
- if ( $media_type == "photo" ) {
137
- ?>
138
- <img src="<?php echo esc_url($media_url); ?>" class="img-fluid"/>
139
- <?php
140
- } elseif ( $media_type == "video" ) {
141
- $video_info = $extended_entities->video_info->variants[2];
142
- $content_type = $video_info->content_type;
143
- $url = $video_info->url;
144
- $new_url = str_replace( "?tag=8", "", $url );
 
 
 
 
 
 
 
 
145
 
146
- if ( isset( $enable_extended_entitie ) && $enable_extended_entitie == "enable" ) {
147
  ?>
148
- <a href="#" data-toggle="modal" data-target="#myModal">
149
- <img src="<?php echo esc_url($media_url); ?>" class="img-fluid"/>
150
- </a>
151
  <?php
152
- } else { ?>
153
- <a href="#"><img src="<?php echo esc_url($media_url); ?>" class="img-fluid"/></a>
154
  <?php
 
155
  }
156
- }
157
- } /* extended enntities */
158
- elseif ( ! empty( $entities->media ) && is_array( $entities->media ) ) {
159
- $media = $entities->media;
160
- foreach ( $media as $media_key => $media_value ) {
161
- $media_url = $media_value->media_url;
162
- $media_url_https = $media_value->media_url_https;
163
- $media_detail_url = $media_value->url;
164
- $media_display_url = $media_value->display_url;
165
- $media_expanded_url = $media_value->expanded_url;
166
- $media_type = $media_value->type;
167
- $media_sizes = $media_value->sizes; ?>
168
- <a href="<?php echo esc_url($media_expanded_url); ?>">
169
- <img src="<?php echo esc_url($media_url_https); ?>" class="img-fluid"/>
170
- </a>
171
- <?php
172
- }
173
- } ?>
174
- <p class="wl_tweet_desc">
175
- <?php
176
- if( isset( $status->text ) ) {
177
- echo makeLinks( $status->text );
178
- }
179
- ?>
180
- </p>
181
- <p class="wl_tweet_action_buttons">
182
- <a href="https://twitter.com/intent/retweet?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet"
183
- target="_blank"
184
- onclick="window.open('https://twitter.com/intent/retweet?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;">
185
  <?php
186
- if ( isset( $status->retweet_count ) ) {
187
- esc_html_e( 'Retweet', 'twitter-tweets' );
188
- echo esc_html("($status->retweet_count)");
189
  }
190
- ?>
191
- </a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
 
193
- <a href="https://twitter.com/intent/like?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?>" target="_blank" onclick="window.open('https://twitter.com/intent/like?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;">
194
- <?php
195
- if ( isset( $status->favorite_count ) ) {
196
- esc_html_e( 'Like', 'twitter-tweets' );
197
- echo esc_html("($status->favorite_count)");
198
- }
199
- ?>
200
- </a>
201
- <a href="https://twitter.com/intent/tweet?in_reply_to=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?>" target="_blank" onclick="window.open('https://twitter.com/intent/tweet?in_reply_to=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;"><?php esc_html_e( 'Reply', 'twitter-tweets' ); ?>
202
- </a>
203
- </p>
204
- <span class="wl-wtp-date-font-size">
205
- <?php if( isset( $status->created_at ) ) {echo tweet_time_calculate( $created_at );} ?>&nbsp;
206
- <?php if( isset( $status->created_at ) ) { esc_html_e( 'ago', 'twitter-tweets' );} ?>
207
- </span>
208
- </div> <!-- Tweet box -->
209
- <?php }
210
- } ?>
211
- <!-- </div> -->
212
- </div>
 
 
 
 
 
213
  </div>
214
- </div>
215
- <?php return ob_get_clean(); } ?>
1
  <?php
2
+ if (!defined('ABSPATH')) exit;
3
  /*** Shortcode For twitter tweet ***/
4
  add_shortcode("TWTR", "twitter_tweet_shortcode");
5
+ function twitter_tweet_shortcode()
6
+ {
7
  ob_start();
8
  $twitterSettings = unserialize(get_option("ali_twitter_shortcode"));
9
 
10
+ if (isset($twitterSettings['TwitterUserName'])) {
11
+ $TwitterUserName = $twitterSettings['TwitterUserName'];
12
  } else $TwitterUserName = "weblizar";
13
 
14
  $Theme = "light";
15
+ if (isset($twitterSettings['Theme'])) {
16
+ $Theme = $twitterSettings['Theme'];
17
  }
18
 
19
  $Height = "450";
20
+ if (isset($twitterSettings['Height'])) {
21
+ $Height = $twitterSettings['Height'];
22
  }
23
 
24
  $Width = "";
25
+ if (isset($twitterSettings['Width'])) {
26
+ $Width = $twitterSettings['Width'];
27
  }
28
 
29
  $LinkColor = "#CC0000";
30
+ if (isset($twitterSettings['LinkColor'])) {
31
+ $LinkColor = $twitterSettings['LinkColor'];
32
  }
33
 
34
  $ExcludeReplies = "yes";
35
+ if (isset($twitterSettings['ExcludeReplies'])) {
36
+ $ExcludeReplies = $twitterSettings['ExcludeReplies'];
37
  }
38
 
39
  $AutoExpandPhotos = "yes";
40
+ if (isset($twitterSettings['AutoExpandPhotos'])) {
41
+ $AutoExpandPhotos = $twitterSettings['AutoExpandPhotos'];
42
  }
43
  $tw_language = "";
44
+ if (isset($twitterSettings['tw_language'])) {
45
+ $tw_language = $twitterSettings['tw_language'];
46
  }
47
 
48
+ if (isset($twitterSettings['TwitterWidgetId'])) {
49
+ $TwitterWidgetId = $twitterSettings['TwitterWidgetId'];
50
  } else {
51
  $TwitterWidgetId = "";
52
  }
53
 
54
+ $title = esc_html__('Widget Title Here', 'twitter-tweets');
55
+ if (isset($twitterSettings['title'])) {
56
+ $title = $twitterSettings['title'];
57
  }
58
 
59
+ ?>
60
  <div style="display:block;width:100%;float:left;overflow:hidden">
61
+ <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>" min-width="<?php echo esc_attr($Width); ?>" height="<?php echo esc_attr($Height); ?>" data-theme="<?php echo esc_attr($Theme); ?>" data-lang="<?php echo esc_attr($tw_language); ?>" data-link-color="<?php echo esc_attr($LinkColor); ?>" data-cards="hidden"></a>
 
 
 
 
 
 
62
  <script>
63
+ ! function(d, s, id) {
64
+ var js, fjs = d.getElementsByTagName(s)[0],
65
+ p = /^http:/.test(d.location) ? 'http' : 'https';
66
+ if (!d.getElementById(id)) {
67
+ js = d.createElement(s);
68
+ js.id = id;
69
+ js.src = p + "://platform.twitter.com/widgets.js";
70
+ fjs.parentNode.insertBefore(js, fjs);
71
+ }
72
+ }(document, "script", "twitter-wjs");
73
  </script>
74
  </div>
75
+ <?php
76
  return ob_get_clean();
77
  }
78
  add_shortcode("WL_TWITTER", "wl_twitter_tweets_api");
79
+ function wl_twitter_tweets_api()
80
+ {
81
+ require_once(wl_twitter_dir_path . "load-tweets.php");
82
  ob_start();
83
  ?>
84
+ <div class="wl_twt_free">
85
+ <div class="container-fluid">
86
+ <div class="row">
87
+ <!-- <div > -->
88
+ <?php if (isset($statuses) && is_array($statuses)) {
89
+ foreach ($statuses as $status) {
90
+ // var_dump($status);
91
+ /* user info */
92
+ if (isset($status->user)) {
93
+ $user = $status->user;
94
+ }
95
+ if (isset($user->name)) {
96
+ $name = $user->name;
97
+ }
98
+ if (isset($user->screen_name)) {
99
+ $screen_name = $user->screen_name;
100
+ }
101
+ if (isset($user->location)) {
102
+ $location = $user->location;
103
+ }
104
+ if (isset($user->description)) {
105
+ $description = $user->description;
106
+ }
107
+ if (isset($user->url)) {
108
+ $url = $user->url;
109
+ }
110
+ if (isset($status->id_str)) {
111
+ $id_str = $status->id_str; /* use it to make link of post */
112
+ }
113
+ if (isset($status->created_at)) {
114
+ $created_at = $status->created_at; /* time when tweet was created */
115
+ }
116
+ /* profile_image_url */
117
+ if (isset($user->profile_image_url)) {
118
+ $profile_image_url = $user->profile_image_url;
119
+ }
120
+ if (isset($user->profile_image_url_https)) {
121
+ $profile_image_url_https = $user->profile_image_url_https;
122
+ }
123
  ?>
124
+ <div class="wl_tweet_box col-md-<?php if (isset($wl_twitter_layout)) {
125
+ echo esc_attr($wl_twitter_layout);
126
+ } ?>">
127
+ <p class="wl_tweet">
128
+ <img class="align-self-start mr-3" src="<?php if (isset($user->profile_image_url_https)) {
129
+ echo esc_url($profile_image_url_https);
130
+ } ?>" alt="">
131
+ <a href="https://twitter.com/<?php if (isset($user->screen_name)) {
132
+ echo esc_attr($screen_name);
133
+ } ?>">
134
+ <?php if (isset($user->screen_name)) {
135
+ echo "@" . $screen_name;
136
+ } ?>
137
+ </a>
138
+ </p>
139
+ <?php
140
+ if (isset($status->extended_entities)) {
141
+ $extended_entities_array = $status->extended_entities->media;
142
+ $extended_entities = $extended_entities_array[0];
143
+ $display_url = $extended_entities->display_url;
144
+ $media_expanded_url = $extended_entities->expanded_url;
145
+ $media_type = $extended_entities->type;
146
+ $media_url = $extended_entities->media_url;
147
+ if ($media_type == "photo") {
148
+ ?>
149
+ <img src="<?php echo esc_url($media_url); ?>" class="img-fluid" />
150
+ <?php
151
+ } elseif ($media_type == "video") {
152
+ $video_info = $extended_entities->video_info->variants[2];
153
+ $content_type = $video_info->content_type;
154
+ $url = $video_info->url;
155
+ $new_url = str_replace("?tag=8", "", $url);
156
 
157
+ if (isset($enable_extended_entitie) && $enable_extended_entitie == "enable") {
158
  ?>
159
+ <a href="#" data-toggle="modal" data-target="#myModal">
160
+ <img src="<?php echo esc_url($media_url); ?>" class="img-fluid" />
161
+ </a>
162
  <?php
163
+ } else { ?>
164
+ <a href="#"><img src="<?php echo esc_url($media_url); ?>" class="img-fluid" /></a>
165
  <?php
166
+ }
167
  }
168
+ } /* extended enntities */ elseif (!empty($entities->media) && is_array($entities->media)) {
169
+ $media = $entities->media;
170
+ foreach ($media as $media_key => $media_value) {
171
+ $media_url = $media_value->media_url;
172
+ $media_url_https = $media_value->media_url_https;
173
+ $media_detail_url = $media_value->url;
174
+ $media_display_url = $media_value->display_url;
175
+ $media_expanded_url = $media_value->expanded_url;
176
+ $media_type = $media_value->type;
177
+ $media_sizes = $media_value->sizes; ?>
178
+ <a href="<?php echo esc_url($media_expanded_url); ?>">
179
+ <img src="<?php echo esc_url($media_url_https); ?>" class="img-fluid" />
180
+ </a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  <?php
 
 
 
182
  }
183
+ } ?>
184
+ <p class="wl_tweet_desc">
185
+ <?php
186
+ if (isset($status->text)) {
187
+ echo makeLinks($status->text);
188
+ }
189
+ ?>
190
+ </p>
191
+ <p class="wl_tweet_action_buttons">
192
+ <a href="https://twitter.com/intent/retweet?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet" target="_blank" onclick="window.open('https://twitter.com/intent/retweet?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;">
193
+ <?php
194
+ if (isset($status->retweet_count)) {
195
+ esc_html_e('Retweet', 'twitter-tweets');
196
+ echo esc_html("($status->retweet_count)");
197
+ }
198
+ ?>
199
+ </a>
200
 
201
+ <a href="https://twitter.com/intent/like?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?>" target="_blank" onclick="window.open('https://twitter.com/intent/like?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;">
202
+ <?php
203
+ if (isset($status->favorite_count)) {
204
+ esc_html_e('Like', 'twitter-tweets');
205
+ echo esc_html("($status->favorite_count)");
206
+ }
207
+ ?>
208
+ </a>
209
+ <a href="https://twitter.com/intent/tweet?in_reply_to=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?>" target="_blank" onclick="window.open('https://twitter.com/intent/tweet?in_reply_to=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet', 'newwindow', 'width=600,height=450'); return false;"><?php esc_html_e('Reply', 'twitter-tweets'); ?>
210
+ </a>
211
+ </p>
212
+ <span class="wl-wtp-date-font-size">
213
+ <?php if (isset($status->created_at)) {
214
+ echo tweet_time_calculate($created_at);
215
+ } ?>&nbsp;
216
+ <?php if (isset($status->created_at)) {
217
+ esc_html_e('ago', 'twitter-tweets');
218
+ } ?>
219
+ </span>
220
+ </div> <!-- Tweet box -->
221
+ <?php }
222
+ } ?>
223
+ <!-- </div> -->
224
+ </div>
225
+ </div>
226
  </div>
227
+ <?php return ob_get_clean();
228
+ } ?>
twitter_tweets_widgets.php CHANGED
@@ -1,223 +1,234 @@
1
  <?php
2
- class WeblizarTwitter extends WP_Widget {
3
- function __construct() {
 
 
4
  parent::__construct(
5
- 'weblizar_twitter', // Base ID
6
- esc_html__( 'Customize Feeds for Twitter Widget', 'twitter-tweets' ), // Name
7
- array( 'description' => esc_html__( 'Display latest tweets from your Twitter account', 'twitter-tweets' )));
 
8
  }
9
 
10
  /*** Front-end display of widget. ***/
11
- public function widget( $args, $instance ) {
 
12
  // Outputs the content of the widget
13
  extract($args); // Make before_widget, etc available.
14
  $title = apply_filters('title', $instance['title']);
15
- echo wp_kses_post($before_widget);
16
- if (!empty($title)) { echo wp_kses_post($before_title . $title . $after_title); }
 
 
17
  $TwitterUserName = $instance['TwitterUserName'];
18
- $Theme = $instance['Theme'];
19
- $Height = $instance['Height'];
20
- $Width = $instance['Width'];
21
- $LinkColor = $instance['LinkColor'];
22
- $ExcludeReplies = $instance['ExcludeReplies'];
23
- $AutoExpandPhotos = $instance['AutoExpandPhotos'];
24
- $TwitterWidgetId = $instance['TwitterWidgetId'];
25
- $tw_language = $instance['tw_language'];
26
- ?>
27
- <div style="display:block;width:100%;float:left;overflow:hidden">
28
- <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>"
29
- min-width="<?php echo esc_attr($Width); ?>"
30
- height="<?php echo esc_attr($Height); ?>"
31
- data-theme="<?php echo esc_attr($Theme); ?>"
32
- data-lang="<?php echo esc_attr($tw_language); ?>"
33
- data-link-color="<?php echo esc_attr($LinkColor); ?>"></a>
34
  <script>
35
- !function(d,s,id) {
36
- 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);}
37
- } (document,"script","twitter-wjs");
 
 
 
 
 
 
 
38
  </script>
39
  </div>
40
- <?php
41
  echo wp_kses_post($after_widget);
42
  }
43
 
44
  /** Back-end widget form. **/
45
- public function form( $instance ) {
46
- if ( isset( $instance[ 'TwitterUserName' ] ) ) {
47
- $TwitterUserName = $instance[ 'TwitterUserName' ];
48
- } else {
 
49
  $TwitterUserName = "weblizar";
50
  }
51
- if ( isset( $instance[ 'Theme' ] ) ) {
52
- $Theme = $instance[ 'Theme' ];
53
- } else {
54
  $Theme = "light";
55
  }
56
- if ( isset( $instance[ 'Height' ] ) ) {
57
- $Height = $instance[ 'Height' ];
58
- } else {
59
  $Height = "450";
60
  }
61
 
62
- if ( isset( $instance[ 'Width' ] ) ) {
63
- $Width = $instance[ 'Width' ];
64
- } else {
65
  $Width = "450";
66
  }
67
 
68
- if ( isset( $instance[ 'LinkColor' ] ) ) {
69
- $LinkColor = $instance[ 'LinkColor' ];
70
- } else {
71
  $LinkColor = "#0000ff";
72
  }
73
 
74
- if ( isset( $instance[ 'ExcludeReplies' ] ) ) {
75
- $ExcludeReplies = $instance[ 'ExcludeReplies' ];
76
  } else {
77
  $ExcludeReplies = "yes";
78
  }
79
 
80
- if ( isset( $instance[ 'AutoExpandPhotos' ] ) ) {
81
- $AutoExpandPhotos = $instance[ 'AutoExpandPhotos' ];
82
  } else {
83
  $AutoExpandPhotos = "yes";
84
  }
85
 
86
- if ( isset( $instance[ 'tw_language' ] ) ) {
87
- $tw_language = $instance[ 'tw_language' ];
88
  } else {
89
  $tw_language = "";
90
  }
91
- if ( isset( $instance[ 'TwitterWidgetId' ] ) ) {
92
- $TwitterWidgetId = $instance[ 'TwitterWidgetId' ];
93
  } else {
94
  $TwitterWidgetId = "";
95
  }
96
 
97
- if ( isset( $instance[ 'title' ] ) ) {
98
- $title = $instance[ 'title' ];
99
  } else {
100
- $title = esc_html__( 'Tweets', 'Widget Title Here', 'twitter-tweets' );
101
  } ?>
102
  <p>
103
- <label for="<?php echo esc_attr($this->get_field_id( 'title' )); ?>"><?php esc_html_e( 'Title:', 'twitter-tweets' ); ?></label>
104
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'title' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'title' )); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" placeholder="<?php esc_attr_e( 'Enter Widget Title','twitter-tweets'); ?>">
105
  </p>
106
  <p>
107
- <label for="<?php echo esc_attr($this->get_field_id( 'TwitterUserName' )); ?>"><?php esc_html_e( 'Twitter Username', 'twitter-tweets' ); ?></label>
108
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'TwitterUserName' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'TwitterUserName' )); ?>" type="text" value="<?php echo esc_attr( $TwitterUserName ); ?>" placeholder="<?php esc_attr_e( 'Enter Your Twitter Account Username', 'twitter-tweets'); ?>">
109
  </p>
110
  <p>
111
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'TwitterWidgetId' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'TwitterWidgetId' )); ?>" type="hidden" value="<?php echo esc_attr( $TwitterWidgetId ); ?>" placeholder="<?php esc_attr_e( 'Enter Your Twitter Widget ID','twitter-tweets'); ?>">
112
  </p>
113
  <p>
114
- <label for="<?php echo esc_attr($this->get_field_id( 'Theme' )); ?>"><?php esc_html_e( 'Theme', 'twitter-tweets' ); ?></label>
115
- <select id="<?php echo esc_attr($this->get_field_id( 'Theme' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'Theme' )); ?>">
116
- <option value="light" <?php if($Theme == "light") echo "selected=selected" ?>><?php esc_html_e( 'Light', 'twitter-tweets' ); ?></option>
117
- <option value="dark" <?php if($Theme == "dark") echo "selected=selected" ?>><?php esc_html_e( 'Dark', 'twitter-tweets' ); ?></option>
118
  </select>
119
  </p>
120
  <p>
121
- <label for="<?php echo esc_attr($this->get_field_id( 'Height' )); ?>"><?php esc_html_e( 'Height', 'twitter-tweets' ); ?></label>
122
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'Height' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'Height' )); ?>" type="text" value="<?php echo esc_attr( $Height ); ?>">
123
  </p>
124
  <p>
125
- <label for="<?php echo esc_attr($this->get_field_id( 'LinkColor' )); ?>"><?php esc_html_e( 'URL Link Color:','twitter-tweets' ); ?></label>
126
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id( 'LinkColor' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'LinkColor' )); ?>" type="text" value="<?php echo esc_attr( $LinkColor ); ?>">
127
- <?php esc_html_e( 'Find More Color Codes', 'twitter-tweets' ); ?> <a href="http://html-color-codes.info/" target="_blank"><?php esc_html_e( 'HERE', 'twitter-tweets' ); ?></a>
128
  </p>
129
  <p>
130
- <label for="<?php echo esc_attr($this->get_field_id( 'ExcludeReplies' )); ?>"><?php esc_html_e( 'Exclude Replies on Tweets', 'twitter-tweets' ); ?></label>
131
- <select id="<?php echo esc_attr($this->get_field_id( 'ExcludeReplies' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'ExcludeReplies' )); ?>">
132
- <option value="yes" <?php if($ExcludeReplies == "yes") echo "selected=selected" ?>><?php esc_html_e( 'Yes', 'twitter-tweets' ); ?></option>
133
- <option value="no" <?php if($ExcludeReplies == "no") echo "selected=selected" ?>><?php esc_html_e( 'No', 'twitter-tweets' ); ?></option>
134
  </select>
135
  </p>
136
  <p>
137
- <label for="<?php echo esc_attr($this->get_field_id( 'AutoExpandPhotos' )); ?>"><?php esc_html_e( 'Auto Expand Photos in Tweets', 'twitter-tweets' ); ?></label>
138
- <select id="<?php echo esc_attr($this->get_field_id( 'AutoExpandPhotos' )); ?>" name="<?php echo esc_attr($this->get_field_name('AutoExpandPhotos' )); ?>">
139
- <option value="yes" <?php if($AutoExpandPhotos == "yes") echo "selected=selected" ?>><?php esc_html_e( 'Yes', 'twitter-tweets' ); ?></option>
140
- <option value="no" <?php if($AutoExpandPhotos == "no") echo "selected=selected" ?>><?php esc_html_e( 'No', 'twitter-tweets' ); ?></option>
141
  </select>
142
  </p>
143
  <p>
144
- <label for="<?php echo esc_attr($this->get_field_id( 'tw_language' )); ?>"><?php esc_html_e( 'Select Language' ); ?></label>
145
- <select id="<?php echo esc_attr($this->get_field_id( 'tw_language' )); ?>" name="<?php echo esc_attr($this->get_field_name('tw_language' )); ?>">
146
- <option value=""<?php if($tw_language == "") echo "selected=selected" ?>><?php esc_html_e('Automatic', 'twitter-tweets'); ?></option>
147
- <option value="en"<?php if($tw_language == "en") echo "selected=selected" ?>><?php esc_html_e('English (default)', 'twitter-tweets'); ?></option>
148
- <option value="ar"<?php if($tw_language == "ar") echo "selected=selected" ?>><?php esc_html_e('Arabic', 'twitter-tweets'); ?></option>
149
- <option value="bn"<?php if($tw_language == "bn") echo "selected=selected" ?>><?php esc_html_e('Bengali', 'twitter-tweets'); ?></option>
150
- <option value="cs"<?php if($tw_language == "cs") echo "selected=selected" ?>><?php esc_html_e('Czech', 'twitter-tweets'); ?></option>
151
- <option value="da"<?php if($tw_language == "da") echo "selected=selected" ?>><?php esc_html_e('Danish', 'twitter-tweets'); ?></option>
152
- <option value="de"<?php if($tw_language == "de") echo "selected=selected" ?>><?php esc_html_e('German', 'twitter-tweets'); ?></option>
153
- <option value="el"<?php if($tw_language == "el") echo "selected=selected" ?>><?php esc_html_e('Greek', 'twitter-tweets'); ?></option>
154
- <option value="es"<?php if($tw_language == "es") echo "selected=selected" ?>><?php esc_html_e('Spanish', 'twitter-tweets'); ?></option>
155
- <option value="fa"<?php if($tw_language == "fa") echo "selected=selected" ?>><?php esc_html_e('Persian', 'twitter-tweets'); ?></option>
156
- <option value="fi"<?php if($tw_language == "fi") echo "selected=selected" ?>><?php esc_html_e('Finnish', 'twitter-tweets'); ?></option>
157
- <option value="fil"<?php if($tw_language == "fil") echo "selected=selected" ?>><?php esc_html_e('Filipino', 'twitter-tweets'); ?></option>
158
- <option value="fr"<?php if($tw_language == "fr") echo "selected=selected" ?>><?php esc_html_e('French', 'twitter-tweets'); ?></option>
159
- <option value="he"<?php if($tw_language == "he") echo "selected=selected" ?>><?php esc_html_e('Hebrew', 'twitter-tweets'); ?></option>
160
- <option value="hi"<?php if($tw_language == "hi") echo "selected=selected" ?>><?php esc_html_e('Hindi', 'twitter-tweets'); ?></option>
161
- <option value="hu"<?php if($tw_language == "hu") echo "selected=selected" ?>><?php esc_html_e('Hungarian', 'twitter-tweets'); ?></option>
162
- <option value="id"<?php if($tw_language == "id") echo "selected=selected" ?>><?php esc_html_e('Indonesian', 'twitter-tweets'); ?></option>
163
- <option value="it"<?php if($tw_language == "it") echo "selected=selected" ?>><?php esc_html_e('Italian', 'twitter-tweets'); ?></option>
164
- <option value="ja"<?php if($tw_language == "ja") echo "selected=selected" ?>><?php esc_html_e('Japanese', 'twitter-tweets'); ?></option>
165
- <option value="ko"<?php if($tw_language == "ko") echo "selected=selected" ?>><?php esc_html_e('Korean', 'twitter-tweets'); ?></option>
166
- <option value="msa"<?php if($tw_language == "msa") echo "selected=selected" ?>><?php esc_html_e('Malay', 'twitter-tweets'); ?></option>
167
- <option value="nl"<?php if($tw_language == "nl") echo "selected=selected" ?>><?php esc_html_e('Dutch', 'twitter-tweets'); ?></option>
168
- <option value="no"<?php if($tw_language == "no") echo "selected=selected" ?>><?php esc_html_e('Norwegian', 'twitter-tweets'); ?></option>
169
- <option value="pl"<?php if($tw_language == "pl") echo "selected=selected" ?>><?php esc_html_e('Polish', 'twitter-tweets'); ?></option>
170
- <option value="pt"<?php if($tw_language == "pt") echo "selected=selected" ?>><?php esc_html_e('Portuguese', 'twitter-tweets'); ?></option>
171
- <option value="ro"<?php if($tw_language == "ro") echo "selected=selected" ?>><?php esc_html_e('Romanian', 'twitter-tweets'); ?></option>
172
- <option value="ru"<?php if($tw_language == "ru") echo "selected=selected" ?>><?php esc_html_e('Russian', 'twitter-tweets'); ?></option>
173
- <option value="sv"<?php if($tw_language == "sv") echo "selected=selected" ?>><?php esc_html_e('Swedish', 'twitter-tweets'); ?></option>
174
- <option value="th"<?php if($tw_language == "th") echo "selected=selected" ?>><?php esc_html_e('Thai', 'twitter-tweets'); ?></option>
175
- <option value="tr"<?php if($tw_language == "tr") echo "selected=selected" ?>><?php esc_html_e('Turkish', 'twitter-tweets'); ?></option>
176
- <option value="uk<?php if($tw_language == "uk") echo "selected=selected" ?>"><?php esc_html_e('Ukrainian', 'twitter-tweets'); ?></option>
177
- <option value="ur"<?php if($tw_language == "ur") echo "selected=selected" ?>><?php esc_html_e('Urdu', 'twitter-tweets'); ?></option>
178
- <option value="vi"<?php if($tw_language == "vi") echo "selected=selected" ?>><?php esc_html_e('Vietnamese', 'twitter-tweets'); ?></option>
179
- <option value="zh-cn"<?php if($tw_language == "zh-cn") echo "selected=selected" ?>><?php esc_html_e('Chinese (Simplified)', 'twitter-tweets'); ?></option>
180
- <option value="zh-tw"<?php if($tw_language == "zh-tw") echo "selected=selected" ?>><?php esc_html_e('Chinese (Traditional)', 'twitter-tweets'); ?></option>
181
  </select>
182
  </p>
183
- <?php
184
  }
185
- /*
186
  Sanitize widget form values as they are saved.
187
  @see WP_Widget::update()
188
  @param array $new_instance Values just sent to be saved.
189
  @param array $old_instance Previously saved values from database.
190
  @return array Updated safe values to be saved.
191
  */
192
- public function update( $new_instance, $old_instance ) {
193
- $instance = array();
194
- $title= sanitize_text_field( ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : 'Widget Title Here' );
195
- $TwitterUserName = sanitize_text_field( ( ! empty( $new_instance['TwitterUserName'] ) ) ? strip_tags( $new_instance['TwitterUserName'] ) : '' );
196
- $Theme = sanitize_text_field( 'theme', ( ! empty( $new_instance['Theme'] ) ) ? strip_tags( $new_instance['Theme'] ) : 'light' );
197
- $Height = sanitize_text_field( ( ! empty( $new_instance['Height'] ) ) ? strip_tags( $new_instance['Height'] ) : '450' );
198
- $Width = sanitize_text_field( ( ! empty( $new_instance['Width'] ) ) ? strip_tags( $new_instance['Width'] ) : '' );
199
- $Linkcolor = sanitize_hex_color( ( ! empty( $new_instance['LinkColor'] ) ) ? strip_tags( $new_instance['LinkColor'] ) : '#CC0000' );
200
- $ExcludeReplies = sanitize_text_field( ( ! empty( $new_instance['ExcludeReplies'] ) ) ? strip_tags( $new_instance['ExcludeReplies'] ) : 'yes' );
201
- $AutoExpandPhotos = sanitize_text_field( ( ! empty( $new_instance['AutoExpandPhotos'] ) ) ? strip_tags( $new_instance['AutoExpandPhotos'] ) : 'yes' );
202
- $TwitterWidgetId = sanitize_text_field( ( ! empty( $new_instance['TwitterWidgetId'] ) ) ? strip_tags( $new_instance['TwitterWidgetId'] ) : '' );
203
- $tw_language = sanitize_text_field( ( ! empty( $new_instance['tw_language'] ) ) ? strip_tags( $new_instance['tw_language'] ) : '' );
 
204
 
205
- $instance['title'] = $title;
206
- $instance['TwitterUserName'] = $TwitterUserName;
207
- $instance['Theme'] = $Theme;
208
- $instance['Height'] = $Height;
209
- $instance['LinkColor'] = $Linkcolor;
210
- $instance['ExcludeReplies'] = $ExcludeReplies;
211
- $instance['AutoExpandPhotos'] = $AutoExpandPhotos;
212
- $instance['TwitterWidgetId'] = $TwitterWidgetId;
213
- $instance['tw_language'] = $tw_language;
214
- $instance['Width'] = $Width;
215
- return $instance;
216
  }
217
  }
218
  // end of class WeblizarTwitter
219
  // register WeblizarTwitter widget
220
- function WeblizarTwitterWidget() {
221
- register_widget( 'WeblizarTwitter' );
 
222
  }
223
- add_action( 'widgets_init', 'WeblizarTwitterWidget' );
1
  <?php
2
+ class WeblizarTwitter extends WP_Widget
3
+ {
4
+ function __construct()
5
+ {
6
  parent::__construct(
7
+ 'weblizar_twitter', // Base ID
8
+ esc_html__('Customize Feeds for Twitter Widget', 'twitter-tweets'), // Name
9
+ array('description' => esc_html__('Display latest tweets from your Twitter account', 'twitter-tweets'))
10
+ );
11
  }
12
 
13
  /*** Front-end display of widget. ***/
14
+ public function widget($args, $instance)
15
+ {
16
  // Outputs the content of the widget
17
  extract($args); // Make before_widget, etc available.
18
  $title = apply_filters('title', $instance['title']);
19
+ echo wp_kses_post($before_widget);
20
+ if (!empty($title)) {
21
+ echo wp_kses_post($before_title . $title . $after_title);
22
+ }
23
  $TwitterUserName = $instance['TwitterUserName'];
24
+ $Theme = $instance['Theme'];
25
+ $Height = $instance['Height'];
26
+ $Width = $instance['Width'];
27
+ $LinkColor = $instance['LinkColor'];
28
+ $ExcludeReplies = $instance['ExcludeReplies'];
29
+ $AutoExpandPhotos = $instance['AutoExpandPhotos'];
30
+ $TwitterWidgetId = $instance['TwitterWidgetId'];
31
+ $tw_language = $instance['tw_language'];
32
+ ?>
33
+ <div style="display:block;width:100%;float:left;overflow:hidden">
34
+ <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>" min-width="<?php echo esc_attr($Width); ?>" height="<?php echo esc_attr($Height); ?>" data-theme="<?php echo esc_attr($Theme); ?>" data-lang="<?php echo esc_attr($tw_language); ?>" data-link-color="<?php echo esc_attr($LinkColor); ?>"></a>
 
 
 
 
 
35
  <script>
36
+ ! function(d, s, id) {
37
+ var js, fjs = d.getElementsByTagName(s)[0],
38
+ p = /^http:/.test(d.location) ? 'http' : 'https';
39
+ if (!d.getElementById(id)) {
40
+ js = d.createElement(s);
41
+ js.id = id;
42
+ js.src = p + "://platform.twitter.com/widgets.js";
43
+ fjs.parentNode.insertBefore(js, fjs);
44
+ }
45
+ }(document, "script", "twitter-wjs");
46
  </script>
47
  </div>
48
+ <?php
49
  echo wp_kses_post($after_widget);
50
  }
51
 
52
  /** Back-end widget form. **/
53
+ public function form($instance)
54
+ {
55
+ if (isset($instance['TwitterUserName'])) {
56
+ $TwitterUserName = $instance['TwitterUserName'];
57
+ } else {
58
  $TwitterUserName = "weblizar";
59
  }
60
+ if (isset($instance['Theme'])) {
61
+ $Theme = $instance['Theme'];
62
+ } else {
63
  $Theme = "light";
64
  }
65
+ if (isset($instance['Height'])) {
66
+ $Height = $instance['Height'];
67
+ } else {
68
  $Height = "450";
69
  }
70
 
71
+ if (isset($instance['Width'])) {
72
+ $Width = $instance['Width'];
73
+ } else {
74
  $Width = "450";
75
  }
76
 
77
+ if (isset($instance['LinkColor'])) {
78
+ $LinkColor = $instance['LinkColor'];
79
+ } else {
80
  $LinkColor = "#0000ff";
81
  }
82
 
83
+ if (isset($instance['ExcludeReplies'])) {
84
+ $ExcludeReplies = $instance['ExcludeReplies'];
85
  } else {
86
  $ExcludeReplies = "yes";
87
  }
88
 
89
+ if (isset($instance['AutoExpandPhotos'])) {
90
+ $AutoExpandPhotos = $instance['AutoExpandPhotos'];
91
  } else {
92
  $AutoExpandPhotos = "yes";
93
  }
94
 
95
+ if (isset($instance['tw_language'])) {
96
+ $tw_language = $instance['tw_language'];
97
  } else {
98
  $tw_language = "";
99
  }
100
+ if (isset($instance['TwitterWidgetId'])) {
101
+ $TwitterWidgetId = $instance['TwitterWidgetId'];
102
  } else {
103
  $TwitterWidgetId = "";
104
  }
105
 
106
+ if (isset($instance['title'])) {
107
+ $title = $instance['title'];
108
  } else {
109
+ $title = esc_html__('Tweets', 'Widget Title Here', 'twitter-tweets');
110
  } ?>
111
  <p>
112
+ <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Title:', 'twitter-tweets'); ?></label>
113
+ <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>" placeholder="<?php esc_attr_e('Enter Widget Title', 'twitter-tweets'); ?>">
114
  </p>
115
  <p>
116
+ <label for="<?php echo esc_attr($this->get_field_id('TwitterUserName')); ?>"><?php esc_html_e('Twitter Username', 'twitter-tweets'); ?></label>
117
+ <input class="widefat" id="<?php echo esc_attr($this->get_field_id('TwitterUserName')); ?>" name="<?php echo esc_attr($this->get_field_name('TwitterUserName')); ?>" type="text" value="<?php echo esc_attr($TwitterUserName); ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Account Username', 'twitter-tweets'); ?>">
118
  </p>
119
  <p>
120
+ <input class="widefat" id="<?php echo esc_attr($this->get_field_id('TwitterWidgetId')); ?>" name="<?php echo esc_attr($this->get_field_name('TwitterWidgetId')); ?>" type="hidden" value="<?php echo esc_attr($TwitterWidgetId); ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Widget ID', 'twitter-tweets'); ?>">
121
  </p>
122
  <p>
123
+ <label for="<?php echo esc_attr($this->get_field_id('Theme')); ?>"><?php esc_html_e('Theme', 'twitter-tweets'); ?></label>
124
+ <select id="<?php echo esc_attr($this->get_field_id('Theme')); ?>" name="<?php echo esc_attr($this->get_field_name('Theme')); ?>">
125
+ <option value="light" <?php if ($Theme == "light") echo "selected=selected" ?>><?php esc_html_e('Light', 'twitter-tweets'); ?></option>
126
+ <option value="dark" <?php if ($Theme == "dark") echo "selected=selected" ?>><?php esc_html_e('Dark', 'twitter-tweets'); ?></option>
127
  </select>
128
  </p>
129
  <p>
130
+ <label for="<?php echo esc_attr($this->get_field_id('Height')); ?>"><?php esc_html_e('Height', 'twitter-tweets'); ?></label>
131
+ <input class="widefat" id="<?php echo esc_attr($this->get_field_id('Height')); ?>" name="<?php echo esc_attr($this->get_field_name('Height')); ?>" type="text" value="<?php echo esc_attr($Height); ?>">
132
  </p>
133
  <p>
134
+ <label for="<?php echo esc_attr($this->get_field_id('LinkColor')); ?>"><?php esc_html_e('URL Link Color:', 'twitter-tweets'); ?></label>
135
+ <input class="widefat" id="<?php echo esc_attr($this->get_field_id('LinkColor')); ?>" name="<?php echo esc_attr($this->get_field_name('LinkColor')); ?>" type="text" value="<?php echo esc_attr($LinkColor); ?>">
136
+ <?php esc_html_e('Find More Color Codes', 'twitter-tweets'); ?> <a href="http://html-color-codes.info/" target="_blank"><?php esc_html_e('HERE', 'twitter-tweets'); ?></a>
137
  </p>
138
  <p>
139
+ <label for="<?php echo esc_attr($this->get_field_id('ExcludeReplies')); ?>"><?php esc_html_e('Exclude Replies on Tweets', 'twitter-tweets'); ?></label>
140
+ <select id="<?php echo esc_attr($this->get_field_id('ExcludeReplies')); ?>" name="<?php echo esc_attr($this->get_field_name('ExcludeReplies')); ?>">
141
+ <option value="yes" <?php if ($ExcludeReplies == "yes") echo "selected=selected" ?>><?php esc_html_e('Yes', 'twitter-tweets'); ?></option>
142
+ <option value="no" <?php if ($ExcludeReplies == "no") echo "selected=selected" ?>><?php esc_html_e('No', 'twitter-tweets'); ?></option>
143
  </select>
144
  </p>
145
  <p>
146
+ <label for="<?php echo esc_attr($this->get_field_id('AutoExpandPhotos')); ?>"><?php esc_html_e('Auto Expand Photos in Tweets', 'twitter-tweets'); ?></label>
147
+ <select id="<?php echo esc_attr($this->get_field_id('AutoExpandPhotos')); ?>" name="<?php echo esc_attr($this->get_field_name('AutoExpandPhotos')); ?>">
148
+ <option value="yes" <?php if ($AutoExpandPhotos == "yes") echo "selected=selected" ?>><?php esc_html_e('Yes', 'twitter-tweets'); ?></option>
149
+ <option value="no" <?php if ($AutoExpandPhotos == "no") echo "selected=selected" ?>><?php esc_html_e('No', 'twitter-tweets'); ?></option>
150
  </select>
151
  </p>
152
  <p>
153
+ <label for="<?php echo esc_attr($this->get_field_id('tw_language')); ?>"><?php esc_html_e('Select Language'); ?></label>
154
+ <select id="<?php echo esc_attr($this->get_field_id('tw_language')); ?>" name="<?php echo esc_attr($this->get_field_name('tw_language')); ?>">
155
+ <option value="" <?php if ($tw_language == "") echo "selected=selected" ?>><?php esc_html_e('Automatic', 'twitter-tweets'); ?></option>
156
+ <option value="en" <?php if ($tw_language == "en") echo "selected=selected" ?>><?php esc_html_e('English (default)', 'twitter-tweets'); ?></option>
157
+ <option value="ar" <?php if ($tw_language == "ar") echo "selected=selected" ?>><?php esc_html_e('Arabic', 'twitter-tweets'); ?></option>
158
+ <option value="bn" <?php if ($tw_language == "bn") echo "selected=selected" ?>><?php esc_html_e('Bengali', 'twitter-tweets'); ?></option>
159
+ <option value="cs" <?php if ($tw_language == "cs") echo "selected=selected" ?>><?php esc_html_e('Czech', 'twitter-tweets'); ?></option>
160
+ <option value="da" <?php if ($tw_language == "da") echo "selected=selected" ?>><?php esc_html_e('Danish', 'twitter-tweets'); ?></option>
161
+ <option value="de" <?php if ($tw_language == "de") echo "selected=selected" ?>><?php esc_html_e('German', 'twitter-tweets'); ?></option>
162
+ <option value="el" <?php if ($tw_language == "el") echo "selected=selected" ?>><?php esc_html_e('Greek', 'twitter-tweets'); ?></option>
163
+ <option value="es" <?php if ($tw_language == "es") echo "selected=selected" ?>><?php esc_html_e('Spanish', 'twitter-tweets'); ?></option>
164
+ <option value="fa" <?php if ($tw_language == "fa") echo "selected=selected" ?>><?php esc_html_e('Persian', 'twitter-tweets'); ?></option>
165
+ <option value="fi" <?php if ($tw_language == "fi") echo "selected=selected" ?>><?php esc_html_e('Finnish', 'twitter-tweets'); ?></option>
166
+ <option value="fil" <?php if ($tw_language == "fil") echo "selected=selected" ?>><?php esc_html_e('Filipino', 'twitter-tweets'); ?></option>
167
+ <option value="fr" <?php if ($tw_language == "fr") echo "selected=selected" ?>><?php esc_html_e('French', 'twitter-tweets'); ?></option>
168
+ <option value="he" <?php if ($tw_language == "he") echo "selected=selected" ?>><?php esc_html_e('Hebrew', 'twitter-tweets'); ?></option>
169
+ <option value="hi" <?php if ($tw_language == "hi") echo "selected=selected" ?>><?php esc_html_e('Hindi', 'twitter-tweets'); ?></option>
170
+ <option value="hu" <?php if ($tw_language == "hu") echo "selected=selected" ?>><?php esc_html_e('Hungarian', 'twitter-tweets'); ?></option>
171
+ <option value="id" <?php if ($tw_language == "id") echo "selected=selected" ?>><?php esc_html_e('Indonesian', 'twitter-tweets'); ?></option>
172
+ <option value="it" <?php if ($tw_language == "it") echo "selected=selected" ?>><?php esc_html_e('Italian', 'twitter-tweets'); ?></option>
173
+ <option value="ja" <?php if ($tw_language == "ja") echo "selected=selected" ?>><?php esc_html_e('Japanese', 'twitter-tweets'); ?></option>
174
+ <option value="ko" <?php if ($tw_language == "ko") echo "selected=selected" ?>><?php esc_html_e('Korean', 'twitter-tweets'); ?></option>
175
+ <option value="msa" <?php if ($tw_language == "msa") echo "selected=selected" ?>><?php esc_html_e('Malay', 'twitter-tweets'); ?></option>
176
+ <option value="nl" <?php if ($tw_language == "nl") echo "selected=selected" ?>><?php esc_html_e('Dutch', 'twitter-tweets'); ?></option>
177
+ <option value="no" <?php if ($tw_language == "no") echo "selected=selected" ?>><?php esc_html_e('Norwegian', 'twitter-tweets'); ?></option>
178
+ <option value="pl" <?php if ($tw_language == "pl") echo "selected=selected" ?>><?php esc_html_e('Polish', 'twitter-tweets'); ?></option>
179
+ <option value="pt" <?php if ($tw_language == "pt") echo "selected=selected" ?>><?php esc_html_e('Portuguese', 'twitter-tweets'); ?></option>
180
+ <option value="ro" <?php if ($tw_language == "ro") echo "selected=selected" ?>><?php esc_html_e('Romanian', 'twitter-tweets'); ?></option>
181
+ <option value="ru" <?php if ($tw_language == "ru") echo "selected=selected" ?>><?php esc_html_e('Russian', 'twitter-tweets'); ?></option>
182
+ <option value="sv" <?php if ($tw_language == "sv") echo "selected=selected" ?>><?php esc_html_e('Swedish', 'twitter-tweets'); ?></option>
183
+ <option value="th" <?php if ($tw_language == "th") echo "selected=selected" ?>><?php esc_html_e('Thai', 'twitter-tweets'); ?></option>
184
+ <option value="tr" <?php if ($tw_language == "tr") echo "selected=selected" ?>><?php esc_html_e('Turkish', 'twitter-tweets'); ?></option>
185
+ <option value="uk<?php if ($tw_language == "uk") echo "selected=selected" ?>"><?php esc_html_e('Ukrainian', 'twitter-tweets'); ?></option>
186
+ <option value="ur" <?php if ($tw_language == "ur") echo "selected=selected" ?>><?php esc_html_e('Urdu', 'twitter-tweets'); ?></option>
187
+ <option value="vi" <?php if ($tw_language == "vi") echo "selected=selected" ?>><?php esc_html_e('Vietnamese', 'twitter-tweets'); ?></option>
188
+ <option value="zh-cn" <?php if ($tw_language == "zh-cn") echo "selected=selected" ?>><?php esc_html_e('Chinese (Simplified)', 'twitter-tweets'); ?></option>
189
+ <option value="zh-tw" <?php if ($tw_language == "zh-tw") echo "selected=selected" ?>><?php esc_html_e('Chinese (Traditional)', 'twitter-tweets'); ?></option>
190
  </select>
191
  </p>
192
+ <?php
193
  }
194
+ /*
195
  Sanitize widget form values as they are saved.
196
  @see WP_Widget::update()
197
  @param array $new_instance Values just sent to be saved.
198
  @param array $old_instance Previously saved values from database.
199
  @return array Updated safe values to be saved.
200
  */
201
+ public function update($new_instance, $old_instance)
202
+ {
203
+ $instance = array();
204
+ $title = sanitize_text_field((!empty($new_instance['title'])) ? strip_tags($new_instance['title']) : 'Widget Title Here');
205
+ $TwitterUserName = sanitize_text_field((!empty($new_instance['TwitterUserName'])) ? strip_tags($new_instance['TwitterUserName']) : '');
206
+ $Theme = sanitize_text_field('theme', (!empty($new_instance['Theme'])) ? strip_tags($new_instance['Theme']) : 'light');
207
+ $Height = sanitize_text_field((!empty($new_instance['Height'])) ? strip_tags($new_instance['Height']) : '450');
208
+ $Width = sanitize_text_field((!empty($new_instance['Width'])) ? strip_tags($new_instance['Width']) : '');
209
+ $Linkcolor = sanitize_hex_color((!empty($new_instance['LinkColor'])) ? strip_tags($new_instance['LinkColor']) : '#CC0000');
210
+ $ExcludeReplies = sanitize_text_field((!empty($new_instance['ExcludeReplies'])) ? strip_tags($new_instance['ExcludeReplies']) : 'yes');
211
+ $AutoExpandPhotos = sanitize_text_field((!empty($new_instance['AutoExpandPhotos'])) ? strip_tags($new_instance['AutoExpandPhotos']) : 'yes');
212
+ $TwitterWidgetId = sanitize_text_field((!empty($new_instance['TwitterWidgetId'])) ? strip_tags($new_instance['TwitterWidgetId']) : '');
213
+ $tw_language = sanitize_text_field((!empty($new_instance['tw_language'])) ? strip_tags($new_instance['tw_language']) : '');
214
 
215
+ $instance['title'] = $title;
216
+ $instance['TwitterUserName'] = $TwitterUserName;
217
+ $instance['Theme'] = $Theme;
218
+ $instance['Height'] = $Height;
219
+ $instance['LinkColor'] = $Linkcolor;
220
+ $instance['ExcludeReplies'] = $ExcludeReplies;
221
+ $instance['AutoExpandPhotos'] = $AutoExpandPhotos;
222
+ $instance['TwitterWidgetId'] = $TwitterWidgetId;
223
+ $instance['tw_language'] = $tw_language;
224
+ $instance['Width'] = $Width;
225
+ return $instance;
226
  }
227
  }
228
  // end of class WeblizarTwitter
229
  // register WeblizarTwitter widget
230
+ function WeblizarTwitterWidget()
231
+ {
232
+ register_widget('WeblizarTwitter');
233
  }
234
+ add_action('widgets_init', 'WeblizarTwitterWidget');
vendor/abraham/twitteroauth/src/SignatureMethod.php CHANGED
@@ -58,7 +58,7 @@ abstract class SignatureMethod
58
  // Avoid a timing leak with a (hopefully) time insensitive compare
59
  $result = 0;
60
  for ($i = 0; $i < strlen($signature); $i++) {
61
- $result |= ord($built{$i}) ^ ord($signature{$i});
62
  }
63
 
64
  return $result == 0;
58
  // Avoid a timing leak with a (hopefully) time insensitive compare
59
  $result = 0;
60
  for ($i = 0; $i < strlen($signature); $i++) {
61
+ $result |= ord($built[$i]) ^ ord($signature[$i]);
62
  }
63
 
64
  return $result == 0;