Weblizar Twitter Widget - Version 2.1.0

Version Description

[21-12-2021] * Tested Upto WP 5.8.2 * minor bug fixed.

Download this release

Release Info

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

Code changes from version 2.0.0 to 2.1.0

readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.8
7
- Stable tag: 2.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -113,6 +113,10 @@ Please use WordPress support forum to ask any query regarding any issue.
113
 
114
  For more information, see Weblizar(https://weblizar.com/)
115
 
 
 
 
 
116
  = 2.0.0 =[23-07-2021]
117
  * Tested Upto WP 5.8.
118
  * Range slider value display
4
  Tags: twitter, tweets, twitter tweets, twitter widget, twitter wordPress plugin, twitter feed
5
  Requires at least: 3.8
6
  Tested up to: 5.8
7
+ Stable tag: 2.1.0
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
+ = 2.1.0 =[21-12-2021]
117
+ * Tested Upto WP 5.8.2
118
+ * minor bug fixed.
119
+
120
  = 2.0.0 =[23-07-2021]
121
  * Tested Upto WP 5.8.
122
  * Range slider value display
twiiter_help.php CHANGED
@@ -1,141 +1,149 @@
1
- <?php if (!defined('ABSPATH')) {
2
  exit;
3
  } ?>
4
  <?php
5
- wp_enqueue_style('font-awesome', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/all.min.css');
6
- wp_enqueue_style('wl_bootstrap', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/bootstrap.min.css');
7
  wp_enqueue_script( 'wl_custom_js', WEBLIZAR_TWITTER_PLUGIN_URL . 'js/wl_custom_js.js' );
8
- if (isset($_REQUEST['twitter-page-user_name'])) {
9
- if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['feeds-widget'], 'save-feeds-widget')) {
10
  die;
11
  }
12
 
13
- $TwitterUserName = sanitize_text_field($_REQUEST['twitter-page-user_name']);
14
- $Theme = sanitize_text_field($_REQUEST['show-theme-background']);
15
- $Height = sanitize_text_field($_REQUEST['twitter-page-url-Height']);
16
- $TwitterWidgetId = sanitize_text_field($_REQUEST['twitter-page-id-fetch']);
17
- $ExcludeReplies = sanitize_text_field($_REQUEST['exclude_replies_23']);
18
- $AutoExpandPhotos = sanitize_text_field($_REQUEST['photo_1234']);
19
- $tw_language = sanitize_text_field($_REQUEST['tw_language']);
20
 
21
  $TwitterSettingsArray = serialize(
22
  array(
23
  'TwitterUserName' => $TwitterUserName,
24
- 'Theme' => $Theme,
25
- 'Height' => $Height,
26
  'TwitterWidgetId' => $TwitterWidgetId,
27
  'ExcludeReplies' => $ExcludeReplies,
28
  'AutoExpandPhotos' => $AutoExpandPhotos,
29
- 'tw_language' => $tw_language,
30
  )
31
  );
32
- update_option("ali_twitter_shortcode", $TwitterSettingsArray);
33
  }
34
 
35
  /* Twitter api key save */
36
 
37
- if (isset($_REQUEST['wl_twitter_consumer_key']) && isset($_REQUEST['twitter_api_nonce'])) {
38
- if (!current_user_can('manage_options') || !wp_verify_nonce($_POST['twitter_api_nonce'], 'twitter_api_nonce')) {
39
  die;
40
  }
41
 
42
- $wl_twitter_consumer_key = sanitize_text_field($_REQUEST['wl_twitter_consumer_key']);
43
- $wl_twitter_consumer_secret = sanitize_text_field($_REQUEST['wl_twitter_consumer_secret']);
44
- $wl_twitter_access_token = sanitize_text_field($_REQUEST['wl_twitter_access_token']);
45
- $wl_twitter_token_secret = sanitize_text_field($_REQUEST['wl_twitter_token_secret']);
46
 
47
- $wl_twitter_tweets = (isset($_REQUEST['wl_twitter_tweets'])) ? sanitize_text_field($_REQUEST['wl_twitter_tweets']) : '4';
48
 
49
- $wl_twitter_layout = (isset($_REQUEST['wl_twitter_layout'])) ? sanitize_text_field($_REQUEST['wl_twitter_layout']) : '3';
50
 
51
  $twitter_api_settings = array(
52
- 'wl_twitter_consumer_key' => $wl_twitter_consumer_key,
53
  'wl_twitter_consumer_secret' => $wl_twitter_consumer_secret,
54
- 'wl_twitter_access_token' => $wl_twitter_access_token,
55
- 'wl_twitter_token_secret' => $wl_twitter_token_secret,
56
- 'wl_twitter_tweets' => $wl_twitter_tweets,
57
- 'wl_twitter_layout' => $wl_twitter_layout
58
  );
59
 
60
- update_option('wl_twitter_api_settings', $twitter_api_settings);
61
  }
62
  ?>
63
  <div class="block ui-tabs-panel active" id="option-general">
64
  <div class="row">
65
  <div class="col-md-6">
66
- <h2 class="well"><?php esc_html_e('Customize feeds shortcode Settings', 'twitter-tweets'); ?>
67
  </h2>
68
  <hr>
69
  <form name='fb-form' id='fb-form'>
70
  <?php
71
- $twitterSettings = unserialize(get_option("ali_twitter_shortcode"));
72
- $TwitterUserName = "weblizar";
73
- if (isset($twitterSettings['TwitterUserName'])) {
74
  $TwitterUserName = $twitterSettings['TwitterUserName'];
75
  }
76
- $TwitterWidgetId = "123";
77
- if (isset($twitterSettings['TwitterWidgetId'])) {
78
  $TwitterWidgetId = $twitterSettings['TwitterWidgetId'];
79
  }
80
- $Theme = "light";
81
- if (isset($twitterSettings['Theme'])) {
82
  $Theme = $twitterSettings['Theme'];
83
  }
84
- $Height = "450";
85
- if (isset($twitterSettings['Height'])) {
86
  $Height = $twitterSettings['Height'];
87
  }
88
- $Width = "";
89
- if (isset($twitterSettings['Width'])) {
90
  $Width = $twitterSettings['Width'];
91
  }
92
 
93
- $ExcludeReplies = "yes";
94
- if (isset($twitterSettings['ExcludeReplies'])) {
95
  $ExcludeReplies = $twitterSettings['ExcludeReplies'];
96
  }
97
- $AutoExpandPhotos = "yes";
98
- if (isset($twitterSettings['AutoExpandPhotos'])) {
99
  $AutoExpandPhotos = $twitterSettings['AutoExpandPhotos'];
100
  }
101
- $tw_language = "";
102
- if (isset($twitterSettings['tw_language'])) {
103
  $tw_language = $twitterSettings['tw_language'];
104
  }
105
 
106
- wp_nonce_field('save-feeds-widget', 'feeds-widget');
107
  ?>
108
  <p>
109
  <div class="container">
110
  <div class="row">
111
  <div class="col-sm">
112
- <label><?php esc_html_e('Twitter Account Username', 'twitter-tweets'); ?></label>
113
  </div>
114
  <div class="col-sm">
115
- <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'); ?>">
116
  </div>
117
  </div>
118
  </div>
119
  </p>
120
  <br>
121
  <p>
122
- <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'); ?>">
123
  </p>
124
  <p>
125
  <div class="container">
126
  <div class="row">
127
  <div class="col-sm">
128
- <label><?php esc_html_e('Theme', 'twitter-tweets'); ?></label>
129
  </div>
130
  <div class="col-sm">
131
  <select id="show-theme-background" name="show-theme-background">
132
- <option value="light" <?php if ($Theme == "light") {
133
- echo esc_attr("selected=selected");
134
- } ?>><?php esc_html_e('Light', 'twitter-tweets'); ?>
 
 
 
 
135
  </option>
136
- <option value="dark" <?php if ($Theme == "dark") {
137
- echo esc_attr("selected=selected");
138
- } ?>><?php esc_html_e('Dark', 'twitter-tweets'); ?>
 
 
 
 
139
  </option>
140
  </select>
141
  </div>
@@ -148,11 +156,11 @@ if (isset($_REQUEST['wl_twitter_consumer_key']) && isset($_REQUEST['twitter_api_
148
  <div class="container">
149
  <div class="row">
150
  <div class="col-sm">
151
- <label><?php esc_html_e('Height', 'twitter-tweets'); ?></label>
152
  </div>
153
  <div class="col-sm">
154
- <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>
155
- <p><b><?php esc_html_e('Set your desire height px (Use Arrow Keys For Exact Numbers)', 'twitter-tweets'); ?></b>
156
  <span id="twitter-range-val"></span>px
157
  </p>
158
 
@@ -165,17 +173,25 @@ if (isset($_REQUEST['wl_twitter_consumer_key']) && isset($_REQUEST['twitter_api_
165
  <div class="container">
166
  <div class="row">
167
  <div class="col-sm">
168
- <label><?php esc_html_e('Exclude Replies on Tweets', 'twitter-tweets'); ?></label>
169
  </div>
170
  <div class="col-sm">
171
  <select id="exclude_replies_23" name="exclude_replies_23">
172
- <option value="yes" <?php if ($ExcludeReplies == "yes") {
173
- echo esc_attr("selected=selected");
174
- } ?>><?php esc_html_e('Yes', 'twitter-tweets'); ?>
 
 
 
 
175
  </option>
176
- <option value="no" <?php if ($ExcludeReplies == "no") {
177
- echo esc_attr("selected=selected");
178
- } ?>><?php esc_html_e('No', 'twitter-tweets'); ?>
 
 
 
 
179
  </option>
180
  </select>
181
  </div>
@@ -189,17 +205,25 @@ if (isset($_REQUEST['wl_twitter_consumer_key']) && isset($_REQUEST['twitter_api_
189
  <div class="container">
190
  <div class="row">
191
  <div class="col-sm">
192
- <label><?php esc_html_e('Auto Expand Photos in Tweets', 'twitter-tweets'); ?></label>
193
  </div>
194
  <div class="col-sm">
195
  <select id="photo_1234" name="photo_1234">
196
- <option value="yes" <?php if ($AutoExpandPhotos == "yes") {
197
- echo esc_attr("selected=selected");
198
- } ?>><?php esc_html_e('Yes', 'twitter-tweets'); ?>
 
 
 
 
199
  </option>
200
- <option value="no" <?php if ($AutoExpandPhotos == "no") {
201
- echo esc_attr("selected=selected");
202
- } ?>><?php esc_html_e('No', 'twitter-tweets'); ?>
 
 
 
 
203
  </option>
204
  </select>
205
  </div>
@@ -213,149 +237,289 @@ if (isset($_REQUEST['wl_twitter_consumer_key']) && isset($_REQUEST['twitter_api_
213
  <div class="container">
214
  <div class="row">
215
  <div class="col-sm">
216
- <label><?php esc_html_e('Select Language', 'twitter-tweets'); ?></label>
217
  </div>
218
  <div class="col-sm">
219
  <select id="tw_language" name="tw_language">
220
- <option value="" <?php if ($tw_language == "") {
221
- echo esc_attr("selected=selected");
222
- } ?>><?php esc_html_e('Automatic', 'twitter-tweets'); ?>
 
 
 
 
223
  </option>
224
- <option value="en" <?php if ($tw_language == "en") {
225
- echo esc_attr("selected=selected");
226
- } ?>><?php esc_html_e('English (default)', 'twitter-tweets'); ?>
 
 
 
 
227
  </option>
228
- <option value="ar" <?php if ($tw_language == "ar") {
229
- echo esc_attr("selected=selected");
230
- } ?>><?php esc_html_e('Arabic', 'twitter-tweets'); ?>
 
 
 
 
231
  </option>
232
- <option value="bn" <?php if ($tw_language == "bn") {
233
- echo esc_attr("selected=selected");
234
- } ?>><?php esc_html_e('Bengali', 'twitter-tweets'); ?>
 
 
 
 
235
  </option>
236
- <option value="cs" <?php if ($tw_language == "cs") {
237
- echo esc_attr("selected=selected");
238
- } ?>><?php esc_html_e('Czech', 'twitter-tweets'); ?>
 
 
 
 
239
  </option>
240
- <option value="da" <?php if ($tw_language == "da") {
241
- echo esc_attr("selected=selected");
242
- } ?>><?php esc_html_e('Danish', 'twitter-tweets'); ?>
 
 
 
 
243
  </option>
244
- <option value="de" <?php if ($tw_language == "de") {
245
- echo esc_attr("selected=selected");
246
- } ?>><?php esc_html_e('German', 'twitter-tweets'); ?>
 
 
 
 
247
  </option>
248
- <option value="el" <?php if ($tw_language == "el") {
249
- echo esc_attr("selected=selected");
250
- } ?>><?php esc_html_e('Greek', 'twitter-tweets'); ?>
 
 
 
 
251
  </option>
252
- <option value="es" <?php if ($tw_language == "es") {
253
- echo esc_attr("selected=selected");
254
- } ?>><?php esc_html_e('Spanish', 'twitter-tweets'); ?>
 
 
 
 
255
  </option>
256
- <option value="fa" <?php if ($tw_language == "fa") {
257
- echo esc_attr("selected=selected");
258
- } ?>><?php esc_html_e('Persian', 'twitter-tweets'); ?>
 
 
 
 
259
  </option>
260
- <option value="fi" <?php if ($tw_language == "fi") {
261
- echo esc_attr("selected=selected");
262
- } ?>><?php esc_html_e('Finnish', 'twitter-tweets'); ?>
 
 
 
 
263
  </option>
264
- <option value="fil" <?php if ($tw_language == "fil") {
265
- echo esc_attr("selected=selected");
266
- } ?>><?php esc_html_e('Filipino', 'twitter-tweets'); ?>
 
 
 
 
267
  </option>
268
- <option value="fr" <?php if ($tw_language == "fr") {
269
- echo esc_attr("selected=selected");
270
- } ?>><?php esc_html_e('French', 'twitter-tweets'); ?>
 
 
 
 
271
  </option>
272
- <option value="he" <?php if ($tw_language == "he") {
273
- echo esc_attr("selected=selected");
274
- } ?>><?php esc_html_e('Hebrew', 'twitter-tweets'); ?>
 
 
 
 
275
  </option>
276
- <option value="hi" <?php if ($tw_language == "hi") {
277
- echo esc_attr("selected=selected");
278
- } ?>><?php esc_html_e('Hindi', 'twitter-tweets'); ?>
 
 
 
 
279
  </option>
280
- <option value="hu" <?php if ($tw_language == "hu") {
281
- echo esc_attr("selected=selected");
282
- } ?>><?php esc_html_e('EHungarian', 'twitter-tweets'); ?>
 
 
 
 
283
  </option>
284
- <option value="id" <?php if ($tw_language == "id") {
285
- echo esc_attr("selected=selected");
286
- } ?>><?php esc_html_e('Indonesian', 'twitter-tweets'); ?>
 
 
 
 
287
  </option>
288
- <option value="it" <?php if ($tw_language == "it") {
289
- echo esc_attr("selected=selected");
290
- } ?>><?php esc_html_e('Italian', 'twitter-tweets'); ?>
 
 
 
 
291
  </option>
292
- <option value="ja" <?php if ($tw_language == "ja") {
293
- echo esc_attr("selected=selected");
294
- } ?>><?php esc_html_e('Japanese', 'twitter-tweets'); ?>
 
 
 
 
295
  </option>
296
- <option value="ko" <?php if ($tw_language == "ko") {
297
- echo esc_attr("selected=selected");
298
- } ?>><?php esc_html_e('Korean', 'twitter-tweets'); ?>
 
 
 
 
299
  </option>
300
- <option value="msa" <?php if ($tw_language == "msa") {
301
- echo esc_attr("selected=selected");
302
- } ?>><?php esc_html_e('Malay', 'twitter-tweets'); ?>
 
 
 
 
303
  </option>
304
- <option value="nl" <?php if ($tw_language == "nl") {
305
- echo esc_attr("selected=selected");
306
- } ?>><?php esc_html_e('Dutch)', 'twitter-tweets'); ?>
 
 
 
 
307
  </option>
308
- <option value="no" <?php if ($tw_language == "no") {
309
- echo esc_attr("selected=selected");
310
- } ?>><?php esc_html_e('Norwegian', 'twitter-tweets'); ?>
 
 
 
 
311
  </option>
312
- <option value="pl" <?php if ($tw_language == "pl") {
313
- echo esc_attr("selected=selected");
314
- } ?>><?php esc_html_e('Polish', 'twitter-tweets'); ?>
 
 
 
 
315
  </option>
316
- <option value="pt" <?php if ($tw_language == "pt") {
317
- echo esc_attr("selected=selected");
318
- } ?>><?php esc_html_e('Portuguese', 'twitter-tweets'); ?>
 
 
 
 
319
  </option>
320
- <option value="ro" <?php if ($tw_language == "ro") {
321
- echo esc_attr("selected=selected");
322
- } ?>><?php esc_html_e('Romanian', 'twitter-tweets'); ?>
 
 
 
 
323
  </option>
324
- <option value="ru" <?php if ($tw_language == "ru") {
325
- echo esc_attr("selected=selected");
326
- } ?>><?php esc_html_e('Russian', 'twitter-tweets'); ?>
 
 
 
 
327
  </option>
328
- <option value="sv" <?php if ($tw_language == "sv") {
329
- echo esc_attr("selected=selected");
330
- } ?>><?php esc_html_e('Swedish', 'twitter-tweets'); ?>
 
 
 
 
331
  </option>
332
- <option value="th" <?php if ($tw_language == "th") {
333
- echo esc_attr("selected=selected");
334
- } ?>><?php esc_html_e('Thai', 'twitter-tweets'); ?>
 
 
 
 
335
  </option>
336
- <option value="tr" <?php if ($tw_language == "tr") {
337
- echo esc_attr("selected=selected");
338
- } ?>><?php esc_html_e('Turkish', 'twitter-tweets'); ?>
 
 
 
 
339
  </option>
340
- <option value="uk" <?php if ($tw_language == "uk") {
341
- echo esc_attr("selected=selected");
342
- } ?>><?php esc_html_e('Ukrainian', 'twitter-tweets'); ?>
 
 
 
 
343
  </option>
344
- <option value="ur" <?php if ($tw_language == "ur") {
345
- echo esc_attr("selected=selected");
346
- } ?>><?php esc_html_e('Urdu', 'twitter-tweets'); ?>
 
 
 
 
347
  </option>
348
- <option value="vi" <?php if ($tw_language == "vi") {
349
- echo esc_attr("selected=selected");
350
- } ?>><?php esc_html_e('Vietnamese', 'twitter-tweets'); ?>
 
 
 
 
351
  </option>
352
- <option value="zh-cn" <?php if ($tw_language == "zh-cn") {
353
- echo esc_attr("selected=selected");
354
- } ?>><?php esc_html_e('Chinese (Simplified)', 'twitter-tweets'); ?>
 
 
 
 
355
  </option>
356
- <option value="zh-tw" <?php if ($tw_language == "zh-tw") {
357
- echo esc_attr("selected=selected");
358
- } ?>><?php esc_html_e('Chinese', 'twitter-tweets'); ?>
 
 
 
 
359
  (Traditional)
360
  </option>
361
  </select>
@@ -370,25 +534,25 @@ if (isset($_REQUEST['wl_twitter_consumer_key']) && isset($_REQUEST['twitter_api_
370
  <input onclick="return SaveSettings();" type="button" class="twt_save_btn" id="fb-save-settings" name="fb-save-settings" value="SAVE">
371
 
372
  <div id="fb-img" style="display: none;">
373
- <img src="<?php echo esc_url(WEBLIZAR_TWITTER_PLUGIN_URL . 'images/loading.gif'); ?>" />
374
  </div>
375
  <div id="fb-msg" style="display: none;" class="alert">
376
- <?php esc_html_e('Settings successfully saved. Reloading page for generating preview right side of setting.', 'twitter-tweets'); ?>
377
  </div>
378
  </form>
379
 
380
  </div>
381
  <!-- Preview Part-->
382
  <div class="col-md-6">
383
- <?php if ($TwitterWidgetId) { ?>
384
- <h2 class="well"><?php esc_html_e('Feeds Shortcode Preview', 'twitter-tweets'); ?>
385
  </h2>
386
  <hr>
387
  <p>
388
- <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); ?>"></a>
389
  <div class="twt_help">
390
- <?php esc_html_e('Please copy the twitter shortcode', 'twitter-tweets'); ?>
391
- <span style="color:#000;"><b>[TWTR]</b> </span> <?php esc_html_e('and paste it to on the Page/Post', 'twitter-tweets'); ?></span>
392
  </div>
393
  </p>
394
  <?php } ?>
@@ -398,14 +562,14 @@ if (isset($_REQUEST['wl_twitter_consumer_key']) && isset($_REQUEST['twitter_api_
398
 
399
  <!-- API Key -->
400
  <?php
401
- include_once('load-tweets.php');
402
  ?>
403
  <div class="block ui-tabs-panel deactive" id="option-apikey">
404
  <div class="row">
405
  <div class="col-md-6">
406
  <div class="row">
407
  <div class="col-md-12">
408
- <h2 class="well"><?php esc_html_e('Twitter API Setting', 'twitter-tweets'); ?>
409
  </h2>
410
  </div>
411
  <div class="col-md-12">
@@ -415,13 +579,17 @@ include_once('load-tweets.php');
415
  <div class="container">
416
  <div class="row">
417
  <div class="col-sm">
418
- <label><?php esc_html_e('Consumer Key', 'twitter-tweets'); ?>&nbsp;*</label>
419
  </div>
420
  <div class="col-sm">
421
- <input class="widefat" id="wl_twitter_consumer_key" name="wl_twitter_consumer_key" type="text" value="<?php if (isset($wl_twitter_consumer_key)) {
422
- echo esc_attr($wl_twitter_consumer_key);
423
- } ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Consumer Key', 'twitter-tweets'); ?>">
424
- <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>
 
 
 
 
425
  <br>
426
  </div>
427
  </div>
@@ -436,12 +604,16 @@ include_once('load-tweets.php');
436
  <div class="container">
437
  <div class="row">
438
  <div class="col-sm">
439
- <label><?php esc_html_e('Consumer Secret', 'twitter-tweets'); ?>&nbsp;*</label>
440
  </div>
441
  <div class="col-sm">
442
- <input class="widefat" id="wl_twitter_consumer_secret" name="wl_twitter_consumer_secret" type="text" value="<?php if (isset($wl_twitter_consumer_secret)) {
443
- echo esc_attr($wl_twitter_consumer_secret);
444
- } ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Consumer Secret', 'twitter-tweets'); ?>">
 
 
 
 
445
  </div>
446
  </div>
447
  </div>
@@ -455,12 +627,16 @@ include_once('load-tweets.php');
455
  <div class="container">
456
  <div class="row">
457
  <div class="col-sm">
458
- <label><?php esc_html_e('Access Token', 'twitter-tweets'); ?>&nbsp;*</label>
459
  </div>
460
  <div class="col-sm">
461
- <input class="widefat" id="wl_twitter_access_token" name="wl_twitter_access_token" type="text" value="<?php if (isset($wl_twitter_access_token)) {
462
- echo esc_attr($wl_twitter_access_token);
463
- } ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Access Token', 'twitter-tweets'); ?>">
 
 
 
 
464
  </div>
465
  </div>
466
  </div>
@@ -474,12 +650,16 @@ include_once('load-tweets.php');
474
  <div class="container">
475
  <div class="row">
476
  <div class="col-sm">
477
- <label><?php esc_html_e('Access Token Secret', 'twitter-tweets'); ?>&nbsp;*</label>
478
  </div>
479
  <div class="col-sm">
480
- <input class="widefat" id="wl_twitter_token_secret" name="wl_twitter_token_secret" type="text" value="<?php if (isset($wl_twitter_token_secret)) {
481
- echo esc_attr($wl_twitter_token_secret);
482
- } ?>" placeholder="<?php esc_attr_e('Enter Your Twitter Token Secret', 'twitter-tweets'); ?>">
 
 
 
 
483
  </div>
484
  </div>
485
  </div>
@@ -492,13 +672,18 @@ include_once('load-tweets.php');
492
  <div class="container">
493
  <div class="row">
494
  <div class="col-sm">
495
- <label><?php esc_html_e('No. Of tweets Show', 'twitter-tweets'); ?></label>
496
  </div>
497
  <div class="col-sm">
498
- <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);
499
- } ?>" min="1" max="14" data-rangeSlider>
 
 
 
 
 
500
  <p>
501
- <b><?php esc_html_e('Set no of tweets you want to show (Use Arrow Keys d)', 'twitter-tweets'); ?></b>
502
  <span id="wl_twitter_range_show"></span>
503
  </p>
504
  </div>
@@ -513,27 +698,43 @@ include_once('load-tweets.php');
513
  <div class="container">
514
  <div class="row">
515
  <div class="col-sm">
516
- <label><?php esc_html_e('Layout', 'twitter-tweets'); ?></label>
517
  </div>
518
  <div class="col-sm">
519
  <select class="widefat" name="wl_twitter_layout" id="wl_twitter_layout">
520
- <option value=""><?php esc_html_e('Select', 'twitter-tweets'); ?>
521
  </option>
522
- <option <?php if (strval($wl_twitter_layout) == "12") {
523
- echo esc_attr('selected');
524
- } ?> value="12"><?php esc_html_e('1', 'twitter-tweets'); ?>
 
 
 
 
525
  </option>
526
- <option <?php if (strval($wl_twitter_layout) == "6") {
527
- echo esc_attr('selected');
528
- } ?> value="6"><?php esc_html_e('2', 'twitter-tweets'); ?>
 
 
 
 
529
  </option>
530
- <option <?php if (strval($wl_twitter_layout) == "4") {
531
- echo esc_attr('selected');
532
- } ?> value="4"><?php esc_html_e('3', 'twitter-tweets'); ?>
 
 
 
 
533
  </option>
534
- <option <?php if (strval($wl_twitter_layout) == "3") {
535
- echo esc_attr('selected');
536
- } ?> value="3"><?php esc_html_e('4', 'twitter-tweets'); ?>
 
 
 
 
537
  </option>
538
  </select>
539
  </div>
@@ -542,21 +743,21 @@ include_once('load-tweets.php');
542
  </p>
543
  <br>
544
  <?php
545
- wp_nonce_field('twitter_api_nonce', 'twitter_api_nonce');
546
  ?>
547
  <input onclick="return SaveApiSettings();" type="button" class="twt_save_btn" id="fb-api-save-settings" name="fb-api-save-settings" value="SAVE">
548
  <br><br><br>
549
  <div class="twt_help">
550
- <?php esc_html_e('Please copy the twitter shortcode', 'twitter-tweets'); ?>
551
- <span style="color:#000;"> <b><?php esc_html_e('[WL_TWITTER]', 'twitter-tweets'); ?></b>
552
  </span>
553
- <?php esc_html_e('and paste it to on the Page/Post', 'twitter-tweets'); ?></span>
554
  </div>
555
  <div id="twitter-img" style="display: none;">
556
- <img src="<?php echo esc_url(WEBLIZAR_TWITTER_PLUGIN_URL . 'images/loading.gif'); ?>" />
557
  </div>
558
  <div id="wl_twitter_preview" style="display: none;" class="alert">
559
- <?php esc_html_e('Settings successfully saved. Reloading page for generating preview right side of setting.', 'twitter-tweets'); ?>
560
  </div>
561
  </form>
562
  </div>
@@ -566,146 +767,172 @@ include_once('load-tweets.php');
566
  <div class="wl_twt_free">
567
  <div class="container-fluid">
568
  <div class="row">
569
- <div class="col-md-<?php if (isset($wl_twitter_layout)) {
570
- echo esc_attr($wl_twitter_layout);
571
- } ?>">
 
 
 
 
572
  <?php
573
- if (isset($statuses) && is_array($statuses)) {
574
- foreach ($statuses as $status) {
575
  /* user info */
576
- if (isset($status->user)) {
577
  $user = $status->user;
578
  }
579
- if (isset($user->name)) {
580
  $name = $user->name;
581
  }
582
- if (isset($user->screen_name)) {
583
  $screen_name = $user->screen_name;
584
  }
585
- if (isset($user->location)) {
586
  $location = $user->location;
587
  }
588
- if (isset($user->description)) {
589
  $description = $user->description;
590
  }
591
- if (isset($user->url)) {
592
  $url = $user->url;
593
  }
594
- if (isset($status->id_str)) {
595
  $id_str = $status->id_str; /* use it to make link of post */
596
  }
597
- if (isset($status->created_at)) {
598
  $created_at = $status->created_at; /* time when tweet was created */
599
  }
600
  /* profile_image_url */
601
- if (isset($user->profile_image_url)) {
602
  $profile_image_url = $user->profile_image_url;
603
  }
604
- if (isset($user->profile_image_url_https)) {
605
  $profile_image_url_https = $user->profile_image_url_https;
606
- } ?>
 
607
  <div class="wl_tweet_box">
608
  <p class="wl_tweet">
609
- <img class="align-self-start mr-3" src="<?php if (isset($user->profile_image_url_https)) {
610
- echo esc_url($profile_image_url_https);
611
- } ?>" alt="">
612
- <a href="https://twitter.com/<?php if (isset($user->screen_name)) {
613
- echo esc_attr($screen_name);
614
- } ?>">
615
- <?php if (isset($user->screen_name)) {
616
- echo esc_html("@" . $screen_name);
617
- } ?>
 
 
 
 
 
 
 
 
 
 
618
  </a>
619
  </p>
620
  <?php
621
  // $entities = $status->entities;
622
- if (isset($status->extended_entities)) {
623
  $extended_entities_array = $status->extended_entities->media;
624
  $extended_entities = $extended_entities_array[0];
625
  $display_url = $extended_entities->display_url;
626
  $media_expanded_url = $extended_entities->expanded_url;
627
  $media_type = $extended_entities->type;
628
  $media_url = $extended_entities->media_url;
629
- if ($media_type == "photo") {
630
- ?>
631
- <img src="<?php echo esc_url($media_url); ?>" class="img-fluid" />
632
  <?php
633
- } elseif ($media_type == "video") {
634
  $video_info = $extended_entities->video_info->variants[2];
635
  $content_type = $video_info->content_type;
636
  $url = $video_info->url;
637
- $new_url = str_replace("?tag=8", "", $url);
638
 
639
- if (isset($enable_extended_entitie) && $enable_extended_entitie == "enable") {
640
- ?>
641
  <a href="#" data-toggle="modal" data-target="#myModal">
642
- <img src="<?php echo esc_url($media_url); ?>" class="img-fluid" />
643
  </a>
644
- <?php
645
  } else {
646
- ?>
647
  <a href="#">
648
- <img src="<?php echo esc_url($media_url); ?>" class="img-fluid" />
649
  </a>
650
- <?php
651
  }
652
  }
653
- } /* extended enntities */ elseif (!empty($entities->media) && is_array($entities->media)) {
654
  $media = $entities->media;
655
- foreach ($media as $media_key => $media_value) {
656
  $media_url = $media_value->media_url;
657
  $media_url_https = $media_value->media_url_https;
658
  $media_detail_url = $media_value->url;
659
  $media_display_url = $media_value->display_url;
660
  $media_expanded_url = $media_value->expanded_url;
661
  $media_type = $media_value->type;
662
- $media_sizes = $media_value->sizes; ?>
663
- <a href="<?php echo esc_url($media_expanded_url); ?>">
664
- <img src="<?php echo esc_url($media_url_https); ?>" class="img-fluid" />
 
665
  </a>
666
- <?php
667
  }
668
- } ?>
 
669
  <p class="wl_tweet_desc">
670
  <?php
671
- if (isset($status->text)) {
672
- echo esc_html(makeLinks($status->text));
673
- } ?>
 
674
  </p>
675
  <p class="wl_tweet_action_buttons">
676
- <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;">
677
  <?php
678
- if (isset($status->retweet_count)) {
679
- esc_html_e('Retweet', 'twitter-tweets');
680
- echo esc_html("($status->retweet_count)");
681
- } ?>
 
682
  </a>
683
 
684
- <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;">
685
  <?php
686
- if (isset($status->favorite_count)) {
687
- esc_html_e('Like', 'twitter-tweets');
688
- echo esc_html("($status->favorite_count)");
689
- } ?>
 
690
  </a>
691
 
692
- <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'); ?>
693
  </a>
694
  </p>
695
- <span class="wl-wtp-date-font-size"><?php if (isset($status->created_at)) {
696
- echo esc_html(tweet_time_calculate($created_at));
697
- } ?>
698
- &nbsp;<?php if (isset($status->created_at)) {
699
- esc_html_e('ago', 'twitter-tweets');
700
- } ?>
 
 
 
 
 
 
701
  </span>
702
  </div> <!-- Tweet box -->
703
- <?php
704
  }
 
 
705
  }
706
- else {
707
- echo "No Feeds Found";
708
- } ?>
709
  </div>
710
  </div>
711
  </div>
@@ -719,77 +946,77 @@ include_once('load-tweets.php');
719
  <div class="row">
720
  <div class="col-md-10">
721
  <div id="heading">
722
- <h2 class="well"><?php esc_html_e('Shortcode Help Section', 'twitter-tweets'); ?>
723
  </h2>
724
  </div>
725
- <p class="well"><b><?php esc_html_e('Customize Feeds for Twitter plugin comes with 2 major feature.', 'twitter-tweets'); ?></b>
726
  </p>
727
  <ol>
728
- <li><?php esc_html_e('Customize feeds Widget', 'twitter-tweets'); ?>
729
  </li>
730
- <li><?php esc_html_e('Customize feeds Shortcode', 'twitter-tweets'); ?><?php esc_html_e('[TWTR]', 'twitter-tweets'); ?>
731
  </li>
732
- <li><?php esc_html_e('Note: Protected tweets will not view', 'twitter-tweets'); ?>
733
- <a href="https://help.twitter.com/en/safety-and-security/public-and-protected-tweets" target="_blank"><?php esc_html_e('Help', 'twitter-tweets'); ?></a>
734
  </li>
735
  </ol>
736
  <br>
737
- <p class="well"><strong><?php esc_html_e('Customize Feeds for Twitter Widget', 'twitter-tweets'); ?></strong>
738
  </p>
739
 
740
  <ol>
741
- <li><?php esc_html_e('You can use the widget to display your Twitter Tweets in any theme Widget Sections.', 'twitter-tweets'); ?>
742
  </li>
743
- <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'); ?>
744
- <strong><?php esc_html_e('Twitter By Weblizar', 'twitter-tweets'); ?></strong>
745
- <?php esc_html_e('widget in any sidebar section, like in left sidebar, right sidebar or footer sidebar.', 'twitter-tweets'); ?>
746
  </li>
747
  </ol>
748
  <br>
749
- <p class="well"><strong><?php esc_html_e('Feeds Short-code ', 'twitter-tweets'); ?><?php esc_html_e('[TWTR]', 'twitter-tweets'); ?></strong>
750
  </p>
751
  <ol>
752
- <li><strong>[TWTR]</strong> <?php esc_html_e('shortcode give ability to display Twitter Tweets Box in any Page / Post with content', 'twitter-tweets'); ?>.
753
  </li>
754
- <li><?php esc_html_e('To use shortcode, just copy', 'twitter-tweets'); ?>
755
- <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'); ?>
756
  </li>
757
  </ol>
758
 
759
  <br>
760
- <p class="well"><strong><?php esc_html_e('Twitter Short-code', 'twitter-tweets'); ?><?php esc_html_e('[WL_TWITTER]', 'twitter-tweets'); ?></strong>
761
  </p>
762
  <ol>
763
- <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'); ?>
764
  </li>
765
- <li><?php esc_html_e('To use shortcode, just copy', 'twitter-tweets'); ?>
766
- <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'); ?>
767
  </li>
768
  </ol>
769
 
770
  <br>
771
- <p class="well"><strong><?php esc_html_e('How to generate Twitter API Key', 'twitter-tweets'); ?></strong>
772
  </p>
773
- <p><?php esc_html_e('We have created a blog post on this topic. It is very easy to understand.', 'twitter-tweets'); ?>
774
- <span class="helptopic"><a href="https://weblizar.com/blog/generate-twitter-api-key/" target="_blank"><?php esc_html_e('Click here', 'twitter-tweets'); ?></a></span><?php esc_html_e(' to visit the blog.', 'twitter-tweets'); ?>
775
  </p>
776
 
777
  <br>
778
- <p class="well"><strong><?php esc_html_e('Q. What is Twitter Widget ID?', 'twitter-tweets'); ?></strong>
779
  </p>
780
- <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'); ?>
781
- <a href="https://weblizar.com/get-twitter-widget-id/" target="_blank"><strong><?php esc_html_e('Tutorial', 'twitter-tweets'); ?></strong>.</a>
782
  </p>
783
  </div>
784
  </div>
785
  <div class="row">
786
  <div class="col-md-10">
787
  <div id="heading">
788
- <h2><?php esc_html_e('Rate Us', 'twitter-tweets'); ?>
789
  </h2>
790
  </div>
791
- <p><?php esc_html_e('If you are enjoying using our', 'twitter-tweets'); ?>
792
- <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'); ?>
793
  </p>
794
  <div class="twt_star">
795
  <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">
@@ -805,5 +1032,5 @@ include_once('load-tweets.php');
805
  </div>
806
  <!---------------- our product tab------------------------>
807
  <div class="block ui-tabs-panel deactive" id="option-ourproduct">
808
- <?php require_once('our_product.php'); ?>
809
- </div>
1
+ <?php if ( ! defined( 'ABSPATH' ) ) {
2
  exit;
3
  } ?>
4
  <?php
5
+ wp_enqueue_style( 'font-awesome', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/all.min.css' );
6
+ wp_enqueue_style( 'wl_bootstrap', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/bootstrap.min.css' );
7
  wp_enqueue_script( 'wl_custom_js', WEBLIZAR_TWITTER_PLUGIN_URL . 'js/wl_custom_js.js' );
8
+ if ( isset( $_REQUEST['twitter-page-user_name'] ) ) {
9
+ if ( ! current_user_can( 'manage_options' ) || ! wp_verify_nonce( $_POST['feeds-widget'], 'save-feeds-widget' ) ) {
10
  die;
11
  }
12
 
13
+ $TwitterUserName = sanitize_text_field( $_REQUEST['twitter-page-user_name'] );
14
+ $Theme = sanitize_text_field( $_REQUEST['show-theme-background'] );
15
+ $Height = sanitize_text_field( $_REQUEST['twitter-page-url-Height'] );
16
+ $TwitterWidgetId = sanitize_text_field( $_REQUEST['twitter-page-id-fetch'] );
17
+ $ExcludeReplies = sanitize_text_field( $_REQUEST['exclude_replies_23'] );
18
+ $AutoExpandPhotos = sanitize_text_field( $_REQUEST['photo_1234'] );
19
+ $tw_language = sanitize_text_field( $_REQUEST['tw_language'] );
20
 
21
  $TwitterSettingsArray = serialize(
22
  array(
23
  'TwitterUserName' => $TwitterUserName,
24
+ 'Theme' => $Theme,
25
+ 'Height' => $Height,
26
  'TwitterWidgetId' => $TwitterWidgetId,
27
  'ExcludeReplies' => $ExcludeReplies,
28
  'AutoExpandPhotos' => $AutoExpandPhotos,
29
+ 'tw_language' => $tw_language,
30
  )
31
  );
32
+ update_option( 'ali_twitter_shortcode', $TwitterSettingsArray );
33
  }
34
 
35
  /* Twitter api key save */
36
 
37
+ if ( isset( $_REQUEST['wl_twitter_consumer_key'] ) && isset( $_REQUEST['twitter_api_nonce'] ) ) {
38
+ if ( ! current_user_can( 'manage_options' ) || ! wp_verify_nonce( $_POST['twitter_api_nonce'], 'twitter_api_nonce' ) ) {
39
  die;
40
  }
41
 
42
+ $wl_twitter_consumer_key = sanitize_text_field( $_REQUEST['wl_twitter_consumer_key'] );
43
+ $wl_twitter_consumer_secret = sanitize_text_field( $_REQUEST['wl_twitter_consumer_secret'] );
44
+ $wl_twitter_access_token = sanitize_text_field( $_REQUEST['wl_twitter_access_token'] );
45
+ $wl_twitter_token_secret = sanitize_text_field( $_REQUEST['wl_twitter_token_secret'] );
46
 
47
+ $wl_twitter_tweets = ( isset( $_REQUEST['wl_twitter_tweets'] ) ) ? sanitize_text_field( $_REQUEST['wl_twitter_tweets'] ) : '4';
48
 
49
+ $wl_twitter_layout = ( isset( $_REQUEST['wl_twitter_layout'] ) ) ? sanitize_text_field( $_REQUEST['wl_twitter_layout'] ) : '3';
50
 
51
  $twitter_api_settings = array(
52
+ 'wl_twitter_consumer_key' => $wl_twitter_consumer_key,
53
  'wl_twitter_consumer_secret' => $wl_twitter_consumer_secret,
54
+ 'wl_twitter_access_token' => $wl_twitter_access_token,
55
+ 'wl_twitter_token_secret' => $wl_twitter_token_secret,
56
+ 'wl_twitter_tweets' => $wl_twitter_tweets,
57
+ 'wl_twitter_layout' => $wl_twitter_layout,
58
  );
59
 
60
+ update_option( 'wl_twitter_api_settings', $twitter_api_settings );
61
  }
62
  ?>
63
  <div class="block ui-tabs-panel active" id="option-general">
64
  <div class="row">
65
  <div class="col-md-6">
66
+ <h2 class="well"><?php esc_html_e( 'Customize feeds shortcode Settings', 'twitter-tweets' ); ?>
67
  </h2>
68
  <hr>
69
  <form name='fb-form' id='fb-form'>
70
  <?php
71
+ $twitterSettings = unserialize( get_option( 'ali_twitter_shortcode' ) );
72
+ $TwitterUserName = 'weblizar';
73
+ if ( isset( $twitterSettings['TwitterUserName'] ) ) {
74
  $TwitterUserName = $twitterSettings['TwitterUserName'];
75
  }
76
+ $TwitterWidgetId = '123';
77
+ if ( isset( $twitterSettings['TwitterWidgetId'] ) ) {
78
  $TwitterWidgetId = $twitterSettings['TwitterWidgetId'];
79
  }
80
+ $Theme = 'light';
81
+ if ( isset( $twitterSettings['Theme'] ) ) {
82
  $Theme = $twitterSettings['Theme'];
83
  }
84
+ $Height = '450';
85
+ if ( isset( $twitterSettings['Height'] ) ) {
86
  $Height = $twitterSettings['Height'];
87
  }
88
+ $Width = '';
89
+ if ( isset( $twitterSettings['Width'] ) ) {
90
  $Width = $twitterSettings['Width'];
91
  }
92
 
93
+ $ExcludeReplies = 'yes';
94
+ if ( isset( $twitterSettings['ExcludeReplies'] ) ) {
95
  $ExcludeReplies = $twitterSettings['ExcludeReplies'];
96
  }
97
+ $AutoExpandPhotos = 'yes';
98
+ if ( isset( $twitterSettings['AutoExpandPhotos'] ) ) {
99
  $AutoExpandPhotos = $twitterSettings['AutoExpandPhotos'];
100
  }
101
+ $tw_language = '';
102
+ if ( isset( $twitterSettings['tw_language'] ) ) {
103
  $tw_language = $twitterSettings['tw_language'];
104
  }
105
 
106
+ wp_nonce_field( 'save-feeds-widget', 'feeds-widget' );
107
  ?>
108
  <p>
109
  <div class="container">
110
  <div class="row">
111
  <div class="col-sm">
112
+ <label><?php esc_html_e( 'Twitter Account Username', 'twitter-tweets' ); ?></label>
113
  </div>
114
  <div class="col-sm">
115
+ <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' ); ?>">
116
  </div>
117
  </div>
118
  </div>
119
  </p>
120
  <br>
121
  <p>
122
+ <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' ); ?>">
123
  </p>
124
  <p>
125
  <div class="container">
126
  <div class="row">
127
  <div class="col-sm">
128
+ <label><?php esc_html_e( 'Theme', 'twitter-tweets' ); ?></label>
129
  </div>
130
  <div class="col-sm">
131
  <select id="show-theme-background" name="show-theme-background">
132
+ <option value="light"
133
+ <?php
134
+ if ( $Theme == 'light' ) {
135
+ echo esc_attr( 'selected=selected' );
136
+ }
137
+ ?>
138
+ ><?php esc_html_e( 'Light', 'twitter-tweets' ); ?>
139
  </option>
140
+ <option value="dark"
141
+ <?php
142
+ if ( $Theme == 'dark' ) {
143
+ echo esc_attr( 'selected=selected' );
144
+ }
145
+ ?>
146
+ ><?php esc_html_e( 'Dark', 'twitter-tweets' ); ?>
147
  </option>
148
  </select>
149
  </div>
156
  <div class="container">
157
  <div class="row">
158
  <div class="col-sm">
159
+ <label><?php esc_html_e( 'Height', 'twitter-tweets' ); ?></label>
160
  </div>
161
  <div class="col-sm">
162
+ <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>
163
+ <p><b><?php esc_html_e( 'Set your desire height px (Use Arrow Keys For Exact Numbers)', 'twitter-tweets' ); ?></b>
164
  <span id="twitter-range-val"></span>px
165
  </p>
166
 
173
  <div class="container">
174
  <div class="row">
175
  <div class="col-sm">
176
+ <label><?php esc_html_e( 'Exclude Replies on Tweets', 'twitter-tweets' ); ?></label>
177
  </div>
178
  <div class="col-sm">
179
  <select id="exclude_replies_23" name="exclude_replies_23">
180
+ <option value="yes"
181
+ <?php
182
+ if ( $ExcludeReplies == 'yes' ) {
183
+ echo esc_attr( 'selected=selected' );
184
+ }
185
+ ?>
186
+ ><?php esc_html_e( 'Yes', 'twitter-tweets' ); ?>
187
  </option>
188
+ <option value="no"
189
+ <?php
190
+ if ( $ExcludeReplies == 'no' ) {
191
+ echo esc_attr( 'selected=selected' );
192
+ }
193
+ ?>
194
+ ><?php esc_html_e( 'No', 'twitter-tweets' ); ?>
195
  </option>
196
  </select>
197
  </div>
205
  <div class="container">
206
  <div class="row">
207
  <div class="col-sm">
208
+ <label><?php esc_html_e( 'Auto Expand Photos in Tweets', 'twitter-tweets' ); ?></label>
209
  </div>
210
  <div class="col-sm">
211
  <select id="photo_1234" name="photo_1234">
212
+ <option value="yes"
213
+ <?php
214
+ if ( $AutoExpandPhotos == 'yes' ) {
215
+ echo esc_attr( 'selected=selected' );
216
+ }
217
+ ?>
218
+ ><?php esc_html_e( 'Yes', 'twitter-tweets' ); ?>
219
  </option>
220
+ <option value="no"
221
+ <?php
222
+ if ( $AutoExpandPhotos == 'no' ) {
223
+ echo esc_attr( 'selected=selected' );
224
+ }
225
+ ?>
226
+ ><?php esc_html_e( 'No', 'twitter-tweets' ); ?>
227
  </option>
228
  </select>
229
  </div>
237
  <div class="container">
238
  <div class="row">
239
  <div class="col-sm">
240
+ <label><?php esc_html_e( 'Select Language', 'twitter-tweets' ); ?></label>
241
  </div>
242
  <div class="col-sm">
243
  <select id="tw_language" name="tw_language">
244
+ <option value=""
245
+ <?php
246
+ if ( $tw_language == '' ) {
247
+ echo esc_attr( 'selected=selected' );
248
+ }
249
+ ?>
250
+ ><?php esc_html_e( 'Automatic', 'twitter-tweets' ); ?>
251
  </option>
252
+ <option value="en"
253
+ <?php
254
+ if ( $tw_language == 'en' ) {
255
+ echo esc_attr( 'selected=selected' );
256
+ }
257
+ ?>
258
+ ><?php esc_html_e( 'English (default)', 'twitter-tweets' ); ?>
259
  </option>
260
+ <option value="ar"
261
+ <?php
262
+ if ( $tw_language == 'ar' ) {
263
+ echo esc_attr( 'selected=selected' );
264
+ }
265
+ ?>
266
+ ><?php esc_html_e( 'Arabic', 'twitter-tweets' ); ?>
267
  </option>
268
+ <option value="bn"
269
+ <?php
270
+ if ( $tw_language == 'bn' ) {
271
+ echo esc_attr( 'selected=selected' );
272
+ }
273
+ ?>
274
+ ><?php esc_html_e( 'Bengali', 'twitter-tweets' ); ?>
275
  </option>
276
+ <option value="cs"
277
+ <?php
278
+ if ( $tw_language == 'cs' ) {
279
+ echo esc_attr( 'selected=selected' );
280
+ }
281
+ ?>
282
+ ><?php esc_html_e( 'Czech', 'twitter-tweets' ); ?>
283
  </option>
284
+ <option value="da"
285
+ <?php
286
+ if ( $tw_language == 'da' ) {
287
+ echo esc_attr( 'selected=selected' );
288
+ }
289
+ ?>
290
+ ><?php esc_html_e( 'Danish', 'twitter-tweets' ); ?>
291
  </option>
292
+ <option value="de"
293
+ <?php
294
+ if ( $tw_language == 'de' ) {
295
+ echo esc_attr( 'selected=selected' );
296
+ }
297
+ ?>
298
+ ><?php esc_html_e( 'German', 'twitter-tweets' ); ?>
299
  </option>
300
+ <option value="el"
301
+ <?php
302
+ if ( $tw_language == 'el' ) {
303
+ echo esc_attr( 'selected=selected' );
304
+ }
305
+ ?>
306
+ ><?php esc_html_e( 'Greek', 'twitter-tweets' ); ?>
307
  </option>
308
+ <option value="es"
309
+ <?php
310
+ if ( $tw_language == 'es' ) {
311
+ echo esc_attr( 'selected=selected' );
312
+ }
313
+ ?>
314
+ ><?php esc_html_e( 'Spanish', 'twitter-tweets' ); ?>
315
  </option>
316
+ <option value="fa"
317
+ <?php
318
+ if ( $tw_language == 'fa' ) {
319
+ echo esc_attr( 'selected=selected' );
320
+ }
321
+ ?>
322
+ ><?php esc_html_e( 'Persian', 'twitter-tweets' ); ?>
323
  </option>
324
+ <option value="fi"
325
+ <?php
326
+ if ( $tw_language == 'fi' ) {
327
+ echo esc_attr( 'selected=selected' );
328
+ }
329
+ ?>
330
+ ><?php esc_html_e( 'Finnish', 'twitter-tweets' ); ?>
331
  </option>
332
+ <option value="fil"
333
+ <?php
334
+ if ( $tw_language == 'fil' ) {
335
+ echo esc_attr( 'selected=selected' );
336
+ }
337
+ ?>
338
+ ><?php esc_html_e( 'Filipino', 'twitter-tweets' ); ?>
339
  </option>
340
+ <option value="fr"
341
+ <?php
342
+ if ( $tw_language == 'fr' ) {
343
+ echo esc_attr( 'selected=selected' );
344
+ }
345
+ ?>
346
+ ><?php esc_html_e( 'French', 'twitter-tweets' ); ?>
347
  </option>
348
+ <option value="he"
349
+ <?php
350
+ if ( $tw_language == 'he' ) {
351
+ echo esc_attr( 'selected=selected' );
352
+ }
353
+ ?>
354
+ ><?php esc_html_e( 'Hebrew', 'twitter-tweets' ); ?>
355
  </option>
356
+ <option value="hi"
357
+ <?php
358
+ if ( $tw_language == 'hi' ) {
359
+ echo esc_attr( 'selected=selected' );
360
+ }
361
+ ?>
362
+ ><?php esc_html_e( 'Hindi', 'twitter-tweets' ); ?>
363
  </option>
364
+ <option value="hu"
365
+ <?php
366
+ if ( $tw_language == 'hu' ) {
367
+ echo esc_attr( 'selected=selected' );
368
+ }
369
+ ?>
370
+ ><?php esc_html_e( 'EHungarian', 'twitter-tweets' ); ?>
371
  </option>
372
+ <option value="id"
373
+ <?php
374
+ if ( $tw_language == 'id' ) {
375
+ echo esc_attr( 'selected=selected' );
376
+ }
377
+ ?>
378
+ ><?php esc_html_e( 'Indonesian', 'twitter-tweets' ); ?>
379
  </option>
380
+ <option value="it"
381
+ <?php
382
+ if ( $tw_language == 'it' ) {
383
+ echo esc_attr( 'selected=selected' );
384
+ }
385
+ ?>
386
+ ><?php esc_html_e( 'Italian', 'twitter-tweets' ); ?>
387
  </option>
388
+ <option value="ja"
389
+ <?php
390
+ if ( $tw_language == 'ja' ) {
391
+ echo esc_attr( 'selected=selected' );
392
+ }
393
+ ?>
394
+ ><?php esc_html_e( 'Japanese', 'twitter-tweets' ); ?>
395
  </option>
396
+ <option value="ko"
397
+ <?php
398
+ if ( $tw_language == 'ko' ) {
399
+ echo esc_attr( 'selected=selected' );
400
+ }
401
+ ?>
402
+ ><?php esc_html_e( 'Korean', 'twitter-tweets' ); ?>
403
  </option>
404
+ <option value="msa"
405
+ <?php
406
+ if ( $tw_language == 'msa' ) {
407
+ echo esc_attr( 'selected=selected' );
408
+ }
409
+ ?>
410
+ ><?php esc_html_e( 'Malay', 'twitter-tweets' ); ?>
411
  </option>
412
+ <option value="nl"
413
+ <?php
414
+ if ( $tw_language == 'nl' ) {
415
+ echo esc_attr( 'selected=selected' );
416
+ }
417
+ ?>
418
+ ><?php esc_html_e( 'Dutch)', 'twitter-tweets' ); ?>
419
  </option>
420
+ <option value="no"
421
+ <?php
422
+ if ( $tw_language == 'no' ) {
423
+ echo esc_attr( 'selected=selected' );
424
+ }
425
+ ?>
426
+ ><?php esc_html_e( 'Norwegian', 'twitter-tweets' ); ?>
427
  </option>
428
+ <option value="pl"
429
+ <?php
430
+ if ( $tw_language == 'pl' ) {
431
+ echo esc_attr( 'selected=selected' );
432
+ }
433
+ ?>
434
+ ><?php esc_html_e( 'Polish', 'twitter-tweets' ); ?>
435
  </option>
436
+ <option value="pt"
437
+ <?php
438
+ if ( $tw_language == 'pt' ) {
439
+ echo esc_attr( 'selected=selected' );
440
+ }
441
+ ?>
442
+ ><?php esc_html_e( 'Portuguese', 'twitter-tweets' ); ?>
443
  </option>
444
+ <option value="ro"
445
+ <?php
446
+ if ( $tw_language == 'ro' ) {
447
+ echo esc_attr( 'selected=selected' );
448
+ }
449
+ ?>
450
+ ><?php esc_html_e( 'Romanian', 'twitter-tweets' ); ?>
451
  </option>
452
+ <option value="ru"
453
+ <?php
454
+ if ( $tw_language == 'ru' ) {
455
+ echo esc_attr( 'selected=selected' );
456
+ }
457
+ ?>
458
+ ><?php esc_html_e( 'Russian', 'twitter-tweets' ); ?>
459
  </option>
460
+ <option value="sv"
461
+ <?php
462
+ if ( $tw_language == 'sv' ) {
463
+ echo esc_attr( 'selected=selected' );
464
+ }
465
+ ?>
466
+ ><?php esc_html_e( 'Swedish', 'twitter-tweets' ); ?>
467
  </option>
468
+ <option value="th"
469
+ <?php
470
+ if ( $tw_language == 'th' ) {
471
+ echo esc_attr( 'selected=selected' );
472
+ }
473
+ ?>
474
+ ><?php esc_html_e( 'Thai', 'twitter-tweets' ); ?>
475
  </option>
476
+ <option value="tr"
477
+ <?php
478
+ if ( $tw_language == 'tr' ) {
479
+ echo esc_attr( 'selected=selected' );
480
+ }
481
+ ?>
482
+ ><?php esc_html_e( 'Turkish', 'twitter-tweets' ); ?>
483
  </option>
484
+ <option value="uk"
485
+ <?php
486
+ if ( $tw_language == 'uk' ) {
487
+ echo esc_attr( 'selected=selected' );
488
+ }
489
+ ?>
490
+ ><?php esc_html_e( 'Ukrainian', 'twitter-tweets' ); ?>
491
  </option>
492
+ <option value="ur"
493
+ <?php
494
+ if ( $tw_language == 'ur' ) {
495
+ echo esc_attr( 'selected=selected' );
496
+ }
497
+ ?>
498
+ ><?php esc_html_e( 'Urdu', 'twitter-tweets' ); ?>
499
  </option>
500
+ <option value="vi"
501
+ <?php
502
+ if ( $tw_language == 'vi' ) {
503
+ echo esc_attr( 'selected=selected' );
504
+ }
505
+ ?>
506
+ ><?php esc_html_e( 'Vietnamese', 'twitter-tweets' ); ?>
507
  </option>
508
+ <option value="zh-cn"
509
+ <?php
510
+ if ( $tw_language == 'zh-cn' ) {
511
+ echo esc_attr( 'selected=selected' );
512
+ }
513
+ ?>
514
+ ><?php esc_html_e( 'Chinese (Simplified)', 'twitter-tweets' ); ?>
515
  </option>
516
+ <option value="zh-tw"
517
+ <?php
518
+ if ( $tw_language == 'zh-tw' ) {
519
+ echo esc_attr( 'selected=selected' );
520
+ }
521
+ ?>
522
+ ><?php esc_html_e( 'Chinese', 'twitter-tweets' ); ?>
523
  (Traditional)
524
  </option>
525
  </select>
534
  <input onclick="return SaveSettings();" type="button" class="twt_save_btn" id="fb-save-settings" name="fb-save-settings" value="SAVE">
535
 
536
  <div id="fb-img" style="display: none;">
537
+ <img src="<?php echo esc_url( WEBLIZAR_TWITTER_PLUGIN_URL . 'images/loading.gif' ); ?>" />
538
  </div>
539
  <div id="fb-msg" style="display: none;" class="alert">
540
+ <?php esc_html_e( 'Settings successfully saved. Reloading page for generating preview right side of setting.', 'twitter-tweets' ); ?>
541
  </div>
542
  </form>
543
 
544
  </div>
545
  <!-- Preview Part-->
546
  <div class="col-md-6">
547
+ <?php if ( $TwitterWidgetId ) { ?>
548
+ <h2 class="well"><?php esc_html_e( 'Feeds Shortcode Preview', 'twitter-tweets' ); ?>
549
  </h2>
550
  <hr>
551
  <p>
552
+ <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 ); ?>"></a>
553
  <div class="twt_help">
554
+ <?php esc_html_e( 'Please copy the twitter shortcode', 'twitter-tweets' ); ?>
555
+ <span style="color:#000;"><b>[TWTR]</b> </span> <?php esc_html_e( 'and paste it to on the Page/Post', 'twitter-tweets' ); ?></span>
556
  </div>
557
  </p>
558
  <?php } ?>
562
 
563
  <!-- API Key -->
564
  <?php
565
+ require_once 'load-tweets.php';
566
  ?>
567
  <div class="block ui-tabs-panel deactive" id="option-apikey">
568
  <div class="row">
569
  <div class="col-md-6">
570
  <div class="row">
571
  <div class="col-md-12">
572
+ <h2 class="well"><?php esc_html_e( 'Twitter API Setting', 'twitter-tweets' ); ?>
573
  </h2>
574
  </div>
575
  <div class="col-md-12">
579
  <div class="container">
580
  <div class="row">
581
  <div class="col-sm">
582
+ <label><?php esc_html_e( 'Consumer Key', 'twitter-tweets' ); ?>&nbsp;*</label>
583
  </div>
584
  <div class="col-sm">
585
+ <input class="widefat" id="wl_twitter_consumer_key" name="wl_twitter_consumer_key" type="text" value="
586
+ <?php
587
+ if ( isset( $wl_twitter_consumer_key ) ) {
588
+ echo esc_attr( $wl_twitter_consumer_key );
589
+ }
590
+ ?>
591
+ " placeholder="<?php esc_attr_e( 'Enter Your Twitter Consumer Key', 'twitter-tweets' ); ?>">
592
+ <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>
593
  <br>
594
  </div>
595
  </div>
604
  <div class="container">
605
  <div class="row">
606
  <div class="col-sm">
607
+ <label><?php esc_html_e( 'Consumer Secret', 'twitter-tweets' ); ?>&nbsp;*</label>
608
  </div>
609
  <div class="col-sm">
610
+ <input class="widefat" id="wl_twitter_consumer_secret" name="wl_twitter_consumer_secret" type="text" value="
611
+ <?php
612
+ if ( isset( $wl_twitter_consumer_secret ) ) {
613
+ echo esc_attr( $wl_twitter_consumer_secret );
614
+ }
615
+ ?>
616
+ " placeholder="<?php esc_attr_e( 'Enter Your Twitter Consumer Secret', 'twitter-tweets' ); ?>">
617
  </div>
618
  </div>
619
  </div>
627
  <div class="container">
628
  <div class="row">
629
  <div class="col-sm">
630
+ <label><?php esc_html_e( 'Access Token', 'twitter-tweets' ); ?>&nbsp;*</label>
631
  </div>
632
  <div class="col-sm">
633
+ <input class="widefat" id="wl_twitter_access_token" name="wl_twitter_access_token" type="text" value="
634
+ <?php
635
+ if ( isset( $wl_twitter_access_token ) ) {
636
+ echo esc_attr( $wl_twitter_access_token );
637
+ }
638
+ ?>
639
+ " placeholder="<?php esc_attr_e( 'Enter Your Twitter Access Token', 'twitter-tweets' ); ?>">
640
  </div>
641
  </div>
642
  </div>
650
  <div class="container">
651
  <div class="row">
652
  <div class="col-sm">
653
+ <label><?php esc_html_e( 'Access Token Secret', 'twitter-tweets' ); ?>&nbsp;*</label>
654
  </div>
655
  <div class="col-sm">
656
+ <input class="widefat" id="wl_twitter_token_secret" name="wl_twitter_token_secret" type="text" value="
657
+ <?php
658
+ if ( isset( $wl_twitter_token_secret ) ) {
659
+ echo esc_attr( $wl_twitter_token_secret );
660
+ }
661
+ ?>
662
+ " placeholder="<?php esc_attr_e( 'Enter Your Twitter Token Secret', 'twitter-tweets' ); ?>">
663
  </div>
664
  </div>
665
  </div>
672
  <div class="container">
673
  <div class="row">
674
  <div class="col-sm">
675
+ <label><?php esc_html_e( 'No. Of tweets Show', 'twitter-tweets' ); ?></label>
676
  </div>
677
  <div class="col-sm">
678
+ <input class="widefat wltt-slider" id="wl_twitter_tweets" name="wl_twitter_tweets" type="range" value="
679
+ <?php
680
+ if ( isset( $wl_twitter_tweets ) ) {
681
+ echo esc_attr( $wl_twitter_tweets );
682
+ }
683
+ ?>
684
+ " min="1" max="14" data-rangeSlider>
685
  <p>
686
+ <b><?php esc_html_e( 'Set no of tweets you want to show (Use Arrow Keys d)', 'twitter-tweets' ); ?></b>
687
  <span id="wl_twitter_range_show"></span>
688
  </p>
689
  </div>
698
  <div class="container">
699
  <div class="row">
700
  <div class="col-sm">
701
+ <label><?php esc_html_e( 'Layout', 'twitter-tweets' ); ?></label>
702
  </div>
703
  <div class="col-sm">
704
  <select class="widefat" name="wl_twitter_layout" id="wl_twitter_layout">
705
+ <option value=""><?php esc_html_e( 'Select', 'twitter-tweets' ); ?>
706
  </option>
707
+ <option
708
+ <?php
709
+ if ( strval( $wl_twitter_layout ) == '12' ) {
710
+ echo esc_attr( 'selected' );
711
+ }
712
+ ?>
713
+ value="12"><?php esc_html_e( '1', 'twitter-tweets' ); ?>
714
  </option>
715
+ <option
716
+ <?php
717
+ if ( strval( $wl_twitter_layout ) == '6' ) {
718
+ echo esc_attr( 'selected' );
719
+ }
720
+ ?>
721
+ value="6"><?php esc_html_e( '2', 'twitter-tweets' ); ?>
722
  </option>
723
+ <option
724
+ <?php
725
+ if ( strval( $wl_twitter_layout ) == '4' ) {
726
+ echo esc_attr( 'selected' );
727
+ }
728
+ ?>
729
+ value="4"><?php esc_html_e( '3', 'twitter-tweets' ); ?>
730
  </option>
731
+ <option
732
+ <?php
733
+ if ( strval( $wl_twitter_layout ) == '3' ) {
734
+ echo esc_attr( 'selected' );
735
+ }
736
+ ?>
737
+ value="3"><?php esc_html_e( '4', 'twitter-tweets' ); ?>
738
  </option>
739
  </select>
740
  </div>
743
  </p>
744
  <br>
745
  <?php
746
+ wp_nonce_field( 'twitter_api_nonce', 'twitter_api_nonce' );
747
  ?>
748
  <input onclick="return SaveApiSettings();" type="button" class="twt_save_btn" id="fb-api-save-settings" name="fb-api-save-settings" value="SAVE">
749
  <br><br><br>
750
  <div class="twt_help">
751
+ <?php esc_html_e( 'Please copy the twitter shortcode', 'twitter-tweets' ); ?>
752
+ <span style="color:#000;"> <b><?php esc_html_e( '[WL_TWITTER]', 'twitter-tweets' ); ?></b>
753
  </span>
754
+ <?php esc_html_e( 'and paste it to on the Page/Post', 'twitter-tweets' ); ?></span>
755
  </div>
756
  <div id="twitter-img" style="display: none;">
757
+ <img src="<?php echo esc_url( WEBLIZAR_TWITTER_PLUGIN_URL . 'images/loading.gif' ); ?>" />
758
  </div>
759
  <div id="wl_twitter_preview" style="display: none;" class="alert">
760
+ <?php esc_html_e( 'Settings successfully saved. Reloading page for generating preview right side of setting.', 'twitter-tweets' ); ?>
761
  </div>
762
  </form>
763
  </div>
767
  <div class="wl_twt_free">
768
  <div class="container-fluid">
769
  <div class="row">
770
+ <div class="col-md-
771
+ <?php
772
+ if ( isset( $wl_twitter_layout ) ) {
773
+ echo esc_attr( $wl_twitter_layout );
774
+ }
775
+ ?>
776
+ ">
777
  <?php
778
+ if ( isset( $statuses ) && is_array( $statuses ) ) {
779
+ foreach ( $statuses as $status ) {
780
  /* user info */
781
+ if ( isset( $status->user ) ) {
782
  $user = $status->user;
783
  }
784
+ if ( isset( $user->name ) ) {
785
  $name = $user->name;
786
  }
787
+ if ( isset( $user->screen_name ) ) {
788
  $screen_name = $user->screen_name;
789
  }
790
+ if ( isset( $user->location ) ) {
791
  $location = $user->location;
792
  }
793
+ if ( isset( $user->description ) ) {
794
  $description = $user->description;
795
  }
796
+ if ( isset( $user->url ) ) {
797
  $url = $user->url;
798
  }
799
+ if ( isset( $status->id_str ) ) {
800
  $id_str = $status->id_str; /* use it to make link of post */
801
  }
802
+ if ( isset( $status->created_at ) ) {
803
  $created_at = $status->created_at; /* time when tweet was created */
804
  }
805
  /* profile_image_url */
806
+ if ( isset( $user->profile_image_url ) ) {
807
  $profile_image_url = $user->profile_image_url;
808
  }
809
+ if ( isset( $user->profile_image_url_https ) ) {
810
  $profile_image_url_https = $user->profile_image_url_https;
811
+ }
812
+ ?>
813
  <div class="wl_tweet_box">
814
  <p class="wl_tweet">
815
+ <img class="align-self-start mr-3" src="
816
+ <?php
817
+ if ( isset( $user->profile_image_url_https ) ) {
818
+ echo esc_url( $profile_image_url_https );
819
+ }
820
+ ?>
821
+ " alt="">
822
+ <a href="https://twitter.com/
823
+ <?php
824
+ if ( isset( $user->screen_name ) ) {
825
+ echo esc_attr( $screen_name );
826
+ }
827
+ ?>
828
+ ">
829
+ <?php
830
+ if ( isset( $user->screen_name ) ) {
831
+ echo esc_html( '@' . $screen_name );
832
+ }
833
+ ?>
834
  </a>
835
  </p>
836
  <?php
837
  // $entities = $status->entities;
838
+ if ( isset( $status->extended_entities ) ) {
839
  $extended_entities_array = $status->extended_entities->media;
840
  $extended_entities = $extended_entities_array[0];
841
  $display_url = $extended_entities->display_url;
842
  $media_expanded_url = $extended_entities->expanded_url;
843
  $media_type = $extended_entities->type;
844
  $media_url = $extended_entities->media_url;
845
+ if ( $media_type == 'photo' ) {
846
+ ?>
847
+ <img src="<?php echo esc_url( $media_url ); ?>" class="img-fluid" />
848
  <?php
849
+ } elseif ( $media_type == 'video' ) {
850
  $video_info = $extended_entities->video_info->variants[2];
851
  $content_type = $video_info->content_type;
852
  $url = $video_info->url;
853
+ $new_url = str_replace( '?tag=8', '', $url );
854
 
855
+ if ( isset( $enable_extended_entitie ) && $enable_extended_entitie == 'enable' ) {
856
+ ?>
857
  <a href="#" data-toggle="modal" data-target="#myModal">
858
+ <img src="<?php echo esc_url( $media_url ); ?>" class="img-fluid" />
859
  </a>
860
+ <?php
861
  } else {
862
+ ?>
863
  <a href="#">
864
+ <img src="<?php echo esc_url( $media_url ); ?>" class="img-fluid" />
865
  </a>
866
+ <?php
867
  }
868
  }
869
+ } /* extended enntities */ elseif ( ! empty( $entities->media ) && is_array( $entities->media ) ) {
870
  $media = $entities->media;
871
+ foreach ( $media as $media_key => $media_value ) {
872
  $media_url = $media_value->media_url;
873
  $media_url_https = $media_value->media_url_https;
874
  $media_detail_url = $media_value->url;
875
  $media_display_url = $media_value->display_url;
876
  $media_expanded_url = $media_value->expanded_url;
877
  $media_type = $media_value->type;
878
+ $media_sizes = $media_value->sizes;
879
+ ?>
880
+ <a href="<?php echo esc_url( $media_expanded_url ); ?>">
881
+ <img src="<?php echo esc_url( $media_url_https ); ?>" class="img-fluid" />
882
  </a>
883
+ <?php
884
  }
885
+ }
886
+ ?>
887
  <p class="wl_tweet_desc">
888
  <?php
889
+ if ( isset( $status->text ) ) {
890
+ echo esc_html( makeLinks( $status->text ) );
891
+ }
892
+ ?>
893
  </p>
894
  <p class="wl_tweet_action_buttons">
895
+ <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;">
896
  <?php
897
+ if ( isset( $status->retweet_count ) ) {
898
+ esc_html_e( 'Retweet', 'twitter-tweets' );
899
+ echo esc_html( "($status->retweet_count)" );
900
+ }
901
+ ?>
902
  </a>
903
 
904
+ <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;">
905
  <?php
906
+ if ( isset( $status->favorite_count ) ) {
907
+ esc_html_e( 'Like', 'twitter-tweets' );
908
+ echo esc_html( "($status->favorite_count)" );
909
+ }
910
+ ?>
911
  </a>
912
 
913
+ <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' ); ?>
914
  </a>
915
  </p>
916
+ <span class="wl-wtp-date-font-size">
917
+ <?php
918
+ if ( isset( $status->created_at ) ) {
919
+ echo esc_html( tweet_time_calculate( $created_at ) );
920
+ }
921
+ ?>
922
+ &nbsp;
923
+ <?php
924
+ if ( isset( $status->created_at ) ) {
925
+ esc_html_e( 'ago', 'twitter-tweets' );
926
+ }
927
+ ?>
928
  </span>
929
  </div> <!-- Tweet box -->
930
+ <?php
931
  }
932
+ } else {
933
+ echo 'No Feeds Found';
934
  }
935
+ ?>
 
 
936
  </div>
937
  </div>
938
  </div>
946
  <div class="row">
947
  <div class="col-md-10">
948
  <div id="heading">
949
+ <h2 class="well"><?php esc_html_e( 'Shortcode Help Section', 'twitter-tweets' ); ?>
950
  </h2>
951
  </div>
952
+ <p class="well"><b><?php esc_html_e( 'Customize Feeds for Twitter plugin comes with 2 major feature.', 'twitter-tweets' ); ?></b>
953
  </p>
954
  <ol>
955
+ <li><?php esc_html_e( 'Customize feeds Widget', 'twitter-tweets' ); ?>
956
  </li>
957
+ <li><?php esc_html_e( 'Customize feeds Shortcode', 'twitter-tweets' ); ?><?php esc_html_e( '[TWTR]', 'twitter-tweets' ); ?>
958
  </li>
959
+ <li><?php esc_html_e( 'Note: Protected tweets will not view', 'twitter-tweets' ); ?>
960
+ <a href="https://help.twitter.com/en/safety-and-security/public-and-protected-tweets" target="_blank"><?php esc_html_e( 'Help', 'twitter-tweets' ); ?></a>
961
  </li>
962
  </ol>
963
  <br>
964
+ <p class="well"><strong><?php esc_html_e( 'Customize Feeds for Twitter Widget', 'twitter-tweets' ); ?></strong>
965
  </p>
966
 
967
  <ol>
968
+ <li><?php esc_html_e( 'You can use the widget to display your Twitter Tweets in any theme Widget Sections.', 'twitter-tweets' ); ?>
969
  </li>
970
+ <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' ); ?>
971
+ <strong><?php esc_html_e( 'Twitter By Weblizar', 'twitter-tweets' ); ?></strong>
972
+ <?php esc_html_e( 'widget in any sidebar section, like in left sidebar, right sidebar or footer sidebar.', 'twitter-tweets' ); ?>
973
  </li>
974
  </ol>
975
  <br>
976
+ <p class="well"><strong><?php esc_html_e( 'Feeds Short-code ', 'twitter-tweets' ); ?><?php esc_html_e( '[TWTR]', 'twitter-tweets' ); ?></strong>
977
  </p>
978
  <ol>
979
+ <li><strong>[TWTR]</strong> <?php esc_html_e( 'shortcode give ability to display Twitter Tweets Box in any Page / Post with content', 'twitter-tweets' ); ?>.
980
  </li>
981
+ <li><?php esc_html_e( 'To use shortcode, just copy', 'twitter-tweets' ); ?>
982
+ <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' ); ?>
983
  </li>
984
  </ol>
985
 
986
  <br>
987
+ <p class="well"><strong><?php esc_html_e( 'Twitter Short-code', 'twitter-tweets' ); ?><?php esc_html_e( '[WL_TWITTER]', 'twitter-tweets' ); ?></strong>
988
  </p>
989
  <ol>
990
+ <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' ); ?>
991
  </li>
992
+ <li><?php esc_html_e( 'To use shortcode, just copy', 'twitter-tweets' ); ?>
993
+ <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' ); ?>
994
  </li>
995
  </ol>
996
 
997
  <br>
998
+ <p class="well"><strong><?php esc_html_e( 'How to generate Twitter API Key', 'twitter-tweets' ); ?></strong>
999
  </p>
1000
+ <p><?php esc_html_e( 'We have created a blog post on this topic. It is very easy to understand.', 'twitter-tweets' ); ?>
1001
+ <span class="helptopic"><a href="https://weblizar.com/blog/generate-twitter-api-key/" target="_blank"><?php esc_html_e( 'Click here', 'twitter-tweets' ); ?></a></span><?php esc_html_e( ' to visit the blog.', 'twitter-tweets' ); ?>
1002
  </p>
1003
 
1004
  <br>
1005
+ <p class="well"><strong><?php esc_html_e( 'Q. What is Twitter Widget ID?', 'twitter-tweets' ); ?></strong>
1006
  </p>
1007
+ <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' ); ?>
1008
+ <a href="https://weblizar.com/get-twitter-widget-id/" target="_blank"><strong><?php esc_html_e( 'Tutorial', 'twitter-tweets' ); ?></strong>.</a>
1009
  </p>
1010
  </div>
1011
  </div>
1012
  <div class="row">
1013
  <div class="col-md-10">
1014
  <div id="heading">
1015
+ <h2><?php esc_html_e( 'Rate Us', 'twitter-tweets' ); ?>
1016
  </h2>
1017
  </div>
1018
+ <p><?php esc_html_e( 'If you are enjoying using our', 'twitter-tweets' ); ?>
1019
+ <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' ); ?>
1020
  </p>
1021
  <div class="twt_star">
1022
  <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">
1032
  </div>
1033
  <!---------------- our product tab------------------------>
1034
  <div class="block ui-tabs-panel deactive" id="option-ourproduct">
1035
+ <?php require_once 'our_product.php'; ?>
1036
+ </div>
twitter-tweets.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  * Plugin Name: Customize Feeds for Twitter
4
- * Version: 2.0.0
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/
@@ -11,65 +11,66 @@
11
 
12
  /*** Constant Values & Variables ***/
13
 
14
- if (!defined('ABSPATH')) {
15
- exit;
16
  }
17
 
18
- define("WEBLIZAR_TWITTER_PLUGIN_URL", plugin_dir_url(__FILE__));
19
- define("wl_twitter_dir_path", plugin_dir_path(__FILE__));
20
 
21
- add_action('plugins_loaded', 'weblizar_twitter_tweeets_load_translation');
22
  function weblizar_twitter_tweeets_load_translation() {
23
- load_plugin_textdomain('twitter-tweets', false, basename(wl_twitter_dir_path) . '/lang');
24
  }
25
 
26
- /*** Widget Code ***/
27
- require_once wl_twitter_dir_path . "vendor/autoload.php";
28
 
29
- /**** Twitter Shortcode ***/
30
- require_once "twitter-tweets_shortcode.php";
31
 
32
- /**** Twitter widgets ***/
33
- require_once "twitter_tweets_widgets.php";
34
 
35
  /** Shortcode Settings Menu **/
36
  function Weblizar_Twitter_Menu() {
37
- $AdminMenu = add_menu_page(esc_html__('Customize Feeds for Twitter', 'twitter-tweets'), esc_html__('Customize Feeds for Twitter', 'twitter-tweets'), 'manage_options', 'Twitter', 'Twitter_by_weblizar_page_function', "dashicons-wordpress-alt");
38
  }
39
- add_action('admin_menu', 'Weblizar_Twitter_Menu');
40
  function Twitter_by_weblizar_page_function() {
41
- wp_enqueue_style('wp-color-picker');
42
- wp_enqueue_script('wp-color-picker');
43
- /**CSS**/
44
- wp_enqueue_style('weblizar-option-twiiter-style-css', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/weblizar-option-twiiter-style.css');
45
- wp_enqueue_style('heroic', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/heroic-features.css');
46
 
47
- /**JS**/
48
- wp_enqueue_script('jquery');
49
- wp_enqueue_script('popper', WEBLIZAR_TWITTER_PLUGIN_URL . 'js/popper.min.js', array('jquery'), true, true);
50
- wp_enqueue_script('wl_bootstrap', WEBLIZAR_TWITTER_PLUGIN_URL . 'js/bootstrap.min.js', array('jquery'), true, true);
51
- wp_enqueue_script('weblizar-tab-js', WEBLIZAR_TWITTER_PLUGIN_URL . 'js/option-js.js', array('jquery', 'media-upload', 'jquery-ui-sortable'));
52
- require_once "twiiter_help_body.php";
53
  }
54
 
55
- add_action('wp_enqueue_scripts', 'wl_enqueue_css_frontend');
56
  function wl_enqueue_css_frontend() {
57
- if (!is_admin()) {
58
- global $post;
59
- if (is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'WL_TWITTER')) {
60
- wp_enqueue_style('front-end-css', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/front-end-css.css');
61
- wp_enqueue_style('wl-bootstrap', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/bootstrap.min.css');
62
- }
63
- wp_enqueue_script('wl-weblizar-fronend-twitter-tweets', WEBLIZAR_TWITTER_PLUGIN_URL . 'js/weblizar-fronend-twitter-tweets.js', array('jquery'), true, false);
64
- }
65
  }
66
 
67
  /*Plugin Setting Link*/
68
- function wl_twitter_settinglinks($links) {
69
- $twt_go_pro_link = '<a href="https://weblizar.com/plugins/twitter-tweets-pro/" target="_blank">' . esc_html__('Go Pro', 'twitter-tweets') . '</a>';
70
- $twitter_settings_link = '<a href="admin.php?page=Twitter">' . esc_html__('Settings', 'twitter-tweets') . '</a>';
71
- array_unshift($links, $twt_go_pro_link, $twitter_settings_link);
72
- return $links;
73
  }
74
- $plugin_wl_twitter = plugin_basename(__FILE__);
75
- add_filter("plugin_action_links_$plugin_wl_twitter", 'wl_twitter_settinglinks');
 
1
  <?php
2
  /*
3
  * Plugin Name: Customize Feeds for Twitter
4
+ * Version: 2.1.0
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/
11
 
12
  /*** Constant Values & Variables ***/
13
 
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
+ exit;
16
  }
17
 
18
+ define( 'WEBLIZAR_TWITTER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
19
+ define( 'wl_twitter_dir_path', plugin_dir_path( __FILE__ ) );
20
 
21
+ add_action( 'plugins_loaded', 'weblizar_twitter_tweeets_load_translation' );
22
  function weblizar_twitter_tweeets_load_translation() {
23
+ load_plugin_textdomain( 'twitter-tweets', false, basename( wl_twitter_dir_path ) . '/lang' );
24
  }
25
 
26
+ /*** Widget Code */
27
+ require_once wl_twitter_dir_path . 'vendor/autoload.php';
28
 
29
+ /**** Twitter Shortcode */
30
+ require_once 'twitter-tweets_shortcode.php';
31
 
32
+ /**** Twitter widgets */
33
+ require_once 'twitter_tweets_widgets.php';
34
 
35
  /** Shortcode Settings Menu **/
36
  function Weblizar_Twitter_Menu() {
37
+ $AdminMenu = add_menu_page( esc_html__( 'Customize Feeds for Twitter', 'twitter-tweets' ), esc_html__( 'Customize Feeds for Twitter', 'twitter-tweets' ), 'manage_options', 'Twitter', 'Twitter_by_weblizar_page_function', 'dashicons-wordpress-alt' );
38
  }
39
+ add_action( 'admin_menu', 'Weblizar_Twitter_Menu' );
40
  function Twitter_by_weblizar_page_function() {
41
+ wp_enqueue_style( 'wp-color-picker' );
42
+ wp_enqueue_script( 'wp-color-picker' );
43
+ /**CSS*/
44
+ wp_enqueue_style( 'weblizar-option-twiiter-style-css', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/weblizar-option-twiiter-style.css' );
45
+ wp_enqueue_style( 'heroic', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/heroic-features.css' );
46
 
47
+ /**JS*/
48
+ wp_enqueue_script( 'jquery' );
49
+ wp_enqueue_script( 'popper', WEBLIZAR_TWITTER_PLUGIN_URL . 'js/popper.min.js', array( 'jquery' ), true, true );
50
+ wp_enqueue_script( 'wl_bootstrap', WEBLIZAR_TWITTER_PLUGIN_URL . 'js/bootstrap.min.js', array( 'jquery' ), true, true );
51
+ wp_enqueue_script( 'weblizar-tab-js', WEBLIZAR_TWITTER_PLUGIN_URL . 'js/option-js.js', array( 'jquery', 'media-upload', 'jquery-ui-sortable' ) );
52
+ require_once 'twiiter_help_body.php';
53
  }
54
 
55
+ add_action( 'wp_enqueue_scripts', 'wl_enqueue_css_frontend' );
56
  function wl_enqueue_css_frontend() {
57
+ if ( ! is_admin() ) {
58
+ global $post;
59
+ if ( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'WL_TWITTER' ) ) {
60
+ wp_enqueue_style( 'front-end-css', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/front-end-css.css' );
61
+ wp_enqueue_style( 'wl-bootstrap', WEBLIZAR_TWITTER_PLUGIN_URL . 'css/bootstrap.min.css' );
62
+ }
63
+ wp_enqueue_script( 'wl-weblizar-fronend-twitter-tweets', WEBLIZAR_TWITTER_PLUGIN_URL . 'js/weblizar-fronend-twitter-tweets.js', array( 'jquery' ), true, false );
64
+ }
65
  }
66
 
67
  /*Plugin Setting Link*/
68
+ function wl_twitter_settinglinks( $links ) {
69
+ $twt_go_pro_link = '<a href="https://weblizar.com/plugins/twitter-tweets-pro/" target="_blank" style="color: red;">' . esc_html__( 'Go Pro', 'twitter-tweets' ) . '</a>';
70
+ $twitter_settings_link = '<a href="admin.php?page=Twitter">' . esc_html__( 'Settings', 'twitter-tweets' ) . '</a>';
71
+ array_unshift( $links, $twt_go_pro_link, $twitter_settings_link );
72
+ return $links;
73
  }
74
+ $plugin_wl_twitter = plugin_basename( __FILE__ );
75
+ add_filter( "plugin_action_links_$plugin_wl_twitter", 'wl_twitter_settinglinks' );
76
+
twitter-tweets_shortcode.php CHANGED
@@ -1,228 +1,256 @@
1
  <?php
2
- if (!defined('ABSPATH')) {
3
- exit;
4
  }
5
- /*** Shortcode For twitter tweet ***/
6
- add_shortcode("TWTR", "twitter_tweet_shortcode");
7
- function twitter_tweet_shortcode()
8
- {
9
- ob_start();
10
- $twitterSettings = unserialize(get_option("ali_twitter_shortcode"));
11
 
12
- if (isset($twitterSettings['TwitterUserName'])) {
13
- $TwitterUserName = $twitterSettings['TwitterUserName'];
14
- } else {
15
- $TwitterUserName = "weblizar";
16
- }
17
 
18
- $Theme = "light";
19
- if (isset($twitterSettings['Theme'])) {
20
- $Theme = $twitterSettings['Theme'];
21
- }
22
 
23
- $Height = "450";
24
- if (isset($twitterSettings['Height'])) {
25
- $Height = $twitterSettings['Height'];
26
- }
27
 
28
- $Width = "";
29
- if (isset($twitterSettings['Width'])) {
30
- $Width = $twitterSettings['Width'];
31
- }
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
  <div style="display:block;width:100%;float:left;overflow:hidden">
59
- <a class="twitter-timeline" data-dnt="true"
60
- 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-cards="hidden"></a>
66
 
67
- </div> <?php
68
- return ob_get_clean();
 
69
  }
70
- add_shortcode("WL_TWITTER", "wl_twitter_tweets_api");
71
- function wl_twitter_tweets_api()
72
- {
73
- require_once(wl_twitter_dir_path . "load-tweets.php");
74
- ob_start(); ?>
75
  <div class="wl_twt_free">
76
- <div class="container-fluid">
77
- <div class="row">
78
- <!-- <div > -->
79
- <?php if (isset($statuses) && is_array($statuses)) {
80
- foreach ($statuses as $status) {
81
- // var_dump($status);
82
- /* user info */
83
- if (isset($status->user)) {
84
- $user = $status->user;
85
- }
86
- if (isset($user->name)) {
87
- $name = $user->name;
88
- }
89
- if (isset($user->screen_name)) {
90
- $screen_name = $user->screen_name;
91
- }
92
- if (isset($user->location)) {
93
- $location = $user->location;
94
- }
95
- if (isset($user->description)) {
96
- $description = $user->description;
97
- }
98
- if (isset($user->url)) {
99
- $url = $user->url;
100
- }
101
- if (isset($status->id_str)) {
102
- $id_str = $status->id_str; /* use it to make link of post */
103
- }
104
- if (isset($status->created_at)) {
105
- $created_at = $status->created_at; /* time when tweet was created */
106
- }
107
- /* profile_image_url */
108
- if (isset($user->profile_image_url)) {
109
- $profile_image_url = $user->profile_image_url;
110
- }
111
- if (isset($user->profile_image_url_https)) {
112
- $profile_image_url_https = $user->profile_image_url_https;
113
- } ?>
114
- <div class="wl_tweet_box col-md-<?php if (isset($wl_twitter_layout)) {
115
- echo esc_attr($wl_twitter_layout);
116
- } ?>">
117
- <p class="wl_tweet">
118
- <img class="align-self-start mr-3" src="<?php if (isset($user->profile_image_url_https)) {
119
- echo esc_url($profile_image_url_https);
120
- } ?>" alt="">
121
- <a href="https://twitter.com/<?php if (isset($user->screen_name)) {
122
- echo esc_attr($screen_name);
123
- } ?>">
124
- <?php if (isset($user->screen_name)) {
125
- echo esc_html("@" . $screen_name);
126
- } ?>
127
- </a>
128
- </p>
129
- <?php
130
- if (isset($status->extended_entities)) {
131
- $extended_entities_array = $status->extended_entities->media;
132
- $extended_entities = $extended_entities_array[0];
133
- $display_url = $extended_entities->display_url;
134
- $media_expanded_url = $extended_entities->expanded_url;
135
- $media_type = $extended_entities->type;
136
- $media_url = $extended_entities->media_url;
137
- if ($media_type == "photo") {
138
- ?>
139
- <img src="<?php echo esc_url($media_url); ?>"
140
- class="img-fluid" />
141
- <?php
142
- } elseif ($media_type == "video") {
143
- $video_info = $extended_entities->video_info->variants[2];
144
- $content_type = $video_info->content_type;
145
- $url = $video_info->url;
146
- $new_url = str_replace("?tag=8", "", $url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
 
148
- if (isset($enable_extended_entitie) && $enable_extended_entitie == "enable") {
149
- ?>
150
- <a href="#" data-toggle="modal" data-target="#myModal">
151
- <img src="<?php echo esc_url($media_url); ?>"
152
- class="img-fluid" />
153
- </a>
154
- <?php
155
- } else { ?>
156
- <a href="#"><img
157
- src="<?php echo esc_url($media_url); ?>"
158
- class="img-fluid" /></a>
159
- <?php
160
- }
161
- }
162
- } /* extended enntities */ elseif (!empty($entities->media) && is_array($entities->media)) {
163
- $media = $entities->media;
164
- foreach ($media as $media_key => $media_value) {
165
- $media_url = $media_value->media_url;
166
- $media_url_https = $media_value->media_url_https;
167
- $media_detail_url = $media_value->url;
168
- $media_display_url = $media_value->display_url;
169
- $media_expanded_url = $media_value->expanded_url;
170
- $media_type = $media_value->type;
171
- $media_sizes = $media_value->sizes; ?>
172
- <a
173
- href="<?php echo esc_url($media_expanded_url); ?>">
174
- <img src="<?php echo esc_url($media_url_https); ?>"
175
- class="img-fluid" />
176
- </a>
177
- <?php
178
- }
179
- } ?>
180
- <p class="wl_tweet_desc">
181
- <?php
182
- if (isset($status->text)) {
183
- echo makeLinks($status->text);
184
- } ?>
185
- </p>
186
- <p class="wl_tweet_action_buttons">
187
- <a href="https://twitter.com/intent/retweet?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?> retweet"
188
- target="_blank"
189
- 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;">
190
- <?php
191
- if (isset($status->retweet_count)) {
192
- esc_html_e('Retweet', 'twitter-tweets');
193
- echo esc_html("($status->retweet_count)");
194
- } ?>
195
- </a>
 
 
 
 
 
196
 
197
- <a href="https://twitter.com/intent/like?tweet_id=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?>"
198
- target="_blank"
199
- 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;">
200
- <?php
201
- if (isset($status->favorite_count)) {
202
- esc_html_e('Like', 'twitter-tweets');
203
- echo esc_html("($status->favorite_count)");
204
- } ?>
205
- </a>
206
- <a href="https://twitter.com/intent/tweet?in_reply_to=<?php echo esc_attr($id_str); ?>&related=<?php echo esc_attr($screen_name); ?>"
207
- target="_blank"
208
- 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'); ?>
209
- </a>
210
- </p>
211
- <span class="wl-wtp-date-font-size">
212
- <?php if (isset($status->created_at)) {
213
- echo tweet_time_calculate($created_at);
214
- } ?>&nbsp;
215
- <?php if (isset($status->created_at)) {
216
- esc_html_e('ago', 'twitter-tweets');
217
- } ?>
218
- </span>
219
- </div> <!-- Tweet box -->
220
- <?php
221
- }
222
- } ?>
223
- <!-- </div> -->
224
- </div>
225
- </div>
 
 
 
 
 
 
 
226
  </div>
227
- <?php return ob_get_clean();
 
228
  }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
  }
5
+ /*** Shortcode For twitter tweet */
6
+ add_shortcode( 'TWTR', 'twitter_tweet_shortcode' );
7
+ function twitter_tweet_shortcode() {
8
+ ob_start();
9
+ $twitterSettings = unserialize( get_option( 'ali_twitter_shortcode' ) );
 
10
 
11
+ if ( isset( $twitterSettings['TwitterUserName'] ) ) {
12
+ $TwitterUserName = $twitterSettings['TwitterUserName'];
13
+ } else {
14
+ $TwitterUserName = 'weblizar';
15
+ }
16
 
17
+ $Theme = 'light';
18
+ if ( isset( $twitterSettings['Theme'] ) ) {
19
+ $Theme = $twitterSettings['Theme'];
20
+ }
21
 
22
+ $Height = '450';
23
+ if ( isset( $twitterSettings['Height'] ) ) {
24
+ $Height = $twitterSettings['Height'];
25
+ }
26
 
27
+ $Width = '';
28
+ if ( isset( $twitterSettings['Width'] ) ) {
29
+ $Width = $twitterSettings['Width'];
30
+ }
31
 
32
+ $ExcludeReplies = 'yes';
33
+ if ( isset( $twitterSettings['ExcludeReplies'] ) ) {
34
+ $ExcludeReplies = $twitterSettings['ExcludeReplies'];
35
+ }
36
 
37
+ $AutoExpandPhotos = 'yes';
38
+ if ( isset( $twitterSettings['AutoExpandPhotos'] ) ) {
39
+ $AutoExpandPhotos = $twitterSettings['AutoExpandPhotos'];
40
+ }
41
+ $tw_language = '';
42
+ if ( isset( $twitterSettings['tw_language'] ) ) {
43
+ $tw_language = $twitterSettings['tw_language'];
44
+ }
45
 
46
+ if ( isset( $twitterSettings['TwitterWidgetId'] ) ) {
47
+ $TwitterWidgetId = $twitterSettings['TwitterWidgetId'];
48
+ } else {
49
+ $TwitterWidgetId = '';
50
+ }
 
 
 
51
 
52
+ $title = esc_html__( 'Widget Title Here', 'twitter-tweets' );
53
+ if ( isset( $twitterSettings['title'] ) ) {
54
+ $title = $twitterSettings['title'];
55
+ } ?>
 
 
 
 
 
 
56
  <div style="display:block;width:100%;float:left;overflow:hidden">
57
+ <a class="twitter-timeline" data-dnt="true"
58
+ href="https://twitter.com/<?php echo esc_attr( $TwitterUserName ); ?>"
59
+ min-width="<?php echo esc_attr( $Width ); ?>"
60
+ height="<?php echo esc_attr( $Height ); ?>"
61
+ data-theme="<?php echo esc_attr( $Theme ); ?>"
62
+ data-lang="<?php echo esc_attr( $tw_language ); ?>"
63
+ data-cards="hidden"></a>
64
 
65
+ </div>
66
+ <?php
67
+ return ob_get_clean();
68
  }
69
+ add_shortcode( 'WL_TWITTER', 'wl_twitter_tweets_api' );
70
+ function wl_twitter_tweets_api() {
71
+ require_once wl_twitter_dir_path . 'load-tweets.php';
72
+ ob_start();
73
+ ?>
74
  <div class="wl_twt_free">
75
+ <div class="container-fluid">
76
+ <div class="row">
77
+ <!-- <div > -->
78
+ <?php
79
+ if ( isset( $statuses ) && is_array( $statuses ) ) {
80
+ foreach ( $statuses as $status ) {
81
+ // var_dump($status);
82
+ /* user info */
83
+ if ( isset( $status->user ) ) {
84
+ $user = $status->user;
85
+ }
86
+ if ( isset( $user->name ) ) {
87
+ $name = $user->name;
88
+ }
89
+ if ( isset( $user->screen_name ) ) {
90
+ $screen_name = $user->screen_name;
91
+ }
92
+ if ( isset( $user->location ) ) {
93
+ $location = $user->location;
94
+ }
95
+ if ( isset( $user->description ) ) {
96
+ $description = $user->description;
97
+ }
98
+ if ( isset( $user->url ) ) {
99
+ $url = $user->url;
100
+ }
101
+ if ( isset( $status->id_str ) ) {
102
+ $id_str = $status->id_str; /* use it to make link of post */
103
+ }
104
+ if ( isset( $status->created_at ) ) {
105
+ $created_at = $status->created_at; /* time when tweet was created */
106
+ }
107
+ /* profile_image_url */
108
+ if ( isset( $user->profile_image_url ) ) {
109
+ $profile_image_url = $user->profile_image_url;
110
+ }
111
+ if ( isset( $user->profile_image_url_https ) ) {
112
+ $profile_image_url_https = $user->profile_image_url_https;
113
+ }
114
+ ?>
115
+ <div class="wl_tweet_box col-md-
116
+ <?php
117
+ if ( isset( $wl_twitter_layout ) ) {
118
+ echo esc_attr( $wl_twitter_layout );
119
+ }
120
+ ?>
121
+ ">
122
+ <p class="wl_tweet">
123
+ <img class="align-self-start mr-3" src="
124
+ <?php
125
+ if ( isset( $user->profile_image_url_https ) ) {
126
+ echo esc_url( $profile_image_url_https );
127
+ }
128
+ ?>
129
+ " alt="">
130
+ <a href="https://twitter.com/
131
+ <?php
132
+ if ( isset( $user->screen_name ) ) {
133
+ echo esc_attr( $screen_name );
134
+ }
135
+ ?>
136
+ ">
137
+ <?php
138
+ if ( isset( $user->screen_name ) ) {
139
+ echo esc_html( '@' . $screen_name );
140
+ }
141
+ ?>
142
+ </a>
143
+ </p>
144
+ <?php
145
+ if ( isset( $status->extended_entities ) ) {
146
+ $extended_entities_array = $status->extended_entities->media;
147
+ $extended_entities = $extended_entities_array[0];
148
+ $display_url = $extended_entities->display_url;
149
+ $media_expanded_url = $extended_entities->expanded_url;
150
+ $media_type = $extended_entities->type;
151
+ $media_url = $extended_entities->media_url;
152
+ if ( $media_type == 'photo' ) {
153
+ ?>
154
+ <img src="<?php echo esc_url( $media_url ); ?>"
155
+ class="img-fluid" />
156
+ <?php
157
+ } elseif ( $media_type == 'video' ) {
158
+ $video_info = $extended_entities->video_info->variants[2];
159
+ $content_type = $video_info->content_type;
160
+ $url = $video_info->url;
161
+ $new_url = str_replace( '?tag=8', '', $url );
162
 
163
+ if ( isset( $enable_extended_entitie ) && $enable_extended_entitie == 'enable' ) {
164
+ ?>
165
+ <a href="#" data-toggle="modal" data-target="#myModal">
166
+ <img src="<?php echo esc_url( $media_url ); ?>"
167
+ class="img-fluid" />
168
+ </a>
169
+ <?php
170
+ } else {
171
+ ?>
172
+ <a href="#"><img
173
+ src="<?php echo esc_url( $media_url ); ?>"
174
+ class="img-fluid" /></a>
175
+ <?php
176
+ }
177
+ }
178
+ } /* extended enntities */ elseif ( ! empty( $entities->media ) && is_array( $entities->media ) ) {
179
+ $media = $entities->media;
180
+ foreach ( $media as $media_key => $media_value ) {
181
+ $media_url = $media_value->media_url;
182
+ $media_url_https = $media_value->media_url_https;
183
+ $media_detail_url = $media_value->url;
184
+ $media_display_url = $media_value->display_url;
185
+ $media_expanded_url = $media_value->expanded_url;
186
+ $media_type = $media_value->type;
187
+ $media_sizes = $media_value->sizes;
188
+ ?>
189
+ <a
190
+ href="<?php echo esc_url( $media_expanded_url ); ?>">
191
+ <img src="<?php echo esc_url( $media_url_https ); ?>"
192
+ class="img-fluid" />
193
+ </a>
194
+ <?php
195
+ }
196
+ }
197
+ ?>
198
+ <p class="wl_tweet_desc">
199
+ <?php
200
+ if ( isset( $status->text ) ) {
201
+ echo makeLinks( $status->text );
202
+ }
203
+ ?>
204
+ </p>
205
+ <p class="wl_tweet_action_buttons">
206
+ <a href="https://twitter.com/intent/retweet?tweet_id=<?php echo esc_attr( $id_str ); ?>&related=<?php echo esc_attr( $screen_name ); ?> retweet"
207
+ target="_blank"
208
+ 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;">
209
+ <?php
210
+ if ( isset( $status->retweet_count ) ) {
211
+ esc_html_e( 'Retweet', 'twitter-tweets' );
212
+ echo esc_html( "($status->retweet_count)" );
213
+ }
214
+ ?>
215
+ </a>
216
 
217
+ <a href="https://twitter.com/intent/like?tweet_id=<?php echo esc_attr( $id_str ); ?>&related=<?php echo esc_attr( $screen_name ); ?>"
218
+ target="_blank"
219
+ 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;">
220
+ <?php
221
+ if ( isset( $status->favorite_count ) ) {
222
+ esc_html_e( 'Like', 'twitter-tweets' );
223
+ echo esc_html( "($status->favorite_count)" );
224
+ }
225
+ ?>
226
+ </a>
227
+ <a href="https://twitter.com/intent/tweet?in_reply_to=<?php echo esc_attr( $id_str ); ?>&related=<?php echo esc_attr( $screen_name ); ?>"
228
+ target="_blank"
229
+ 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' ); ?>
230
+ </a>
231
+ </p>
232
+ <span class="wl-wtp-date-font-size">
233
+ <?php
234
+ if ( isset( $status->created_at ) ) {
235
+ echo tweet_time_calculate( $created_at );
236
+ }
237
+ ?>
238
+ &nbsp;
239
+ <?php
240
+ if ( isset( $status->created_at ) ) {
241
+ esc_html_e( 'ago', 'twitter-tweets' );
242
+ }
243
+ ?>
244
+ </span>
245
+ </div> <!-- Tweet box -->
246
+ <?php
247
+ }
248
+ }
249
+ ?>
250
+ <!-- </div> -->
251
+ </div>
252
+ </div>
253
  </div>
254
+ <?php
255
+ return ob_get_clean();
256
  }
twitter_tweets_widgets.php CHANGED
@@ -1,372 +1,530 @@
1
  <?php
2
- class WeblizarTwitter extends WP_Widget
3
- {
4
- public 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
- $ExcludeReplies = $instance['ExcludeReplies'];
28
- $AutoExpandPhotos = $instance['AutoExpandPhotos'];
29
- $TwitterWidgetId = $instance['TwitterWidgetId'];
30
- $tw_language = $instance['tw_language']; ?>
 
 
 
 
 
 
 
31
  <div style="display:block;width:100%;float:left;overflow:hidden">
32
  <a class="twitter-timeline" data-dnt="true"
33
- href="https://twitter.com/<?php echo esc_attr($TwitterUserName); ?>"
34
- min-width="<?php echo esc_attr($Width); ?>"
35
- height="<?php echo esc_attr($Height); ?>"
36
- data-theme="<?php echo esc_attr($Theme); ?>"
37
- data-lang="<?php echo esc_attr($tw_language); ?>"></a>
38
 
39
  </div>
40
- <?php
41
- echo wp_kses_post($after_widget);
42
- }
43
-
44
- /** Back-end widget form. **/
45
- public function form($instance)
46
- {
47
- if (isset($instance['TwitterUserName'])) {
48
- $TwitterUserName = $instance['TwitterUserName'];
49
- } else {
50
- $TwitterUserName = "weblizar";
51
- }
52
- if (isset($instance['Theme'])) {
53
- $Theme = $instance['Theme'];
54
- } else {
55
- $Theme = "light";
56
- }
57
- if (isset($instance['Height'])) {
58
- $Height = $instance['Height'];
59
- } else {
60
- $Height = "450";
61
- }
62
 
63
- if (isset($instance['Width'])) {
64
- $Width = $instance['Width'];
65
- } else {
66
- $Width = "450";
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
-
 
 
 
 
70
 
71
- if (isset($instance['ExcludeReplies'])) {
72
- $ExcludeReplies = $instance['ExcludeReplies'];
73
- } else {
74
- $ExcludeReplies = "yes";
75
- }
76
 
77
- if (isset($instance['AutoExpandPhotos'])) {
78
- $AutoExpandPhotos = $instance['AutoExpandPhotos'];
79
- } else {
80
- $AutoExpandPhotos = "yes";
81
- }
82
 
83
- if (isset($instance['tw_language'])) {
84
- $tw_language = $instance['tw_language'];
85
- } else {
86
- $tw_language = "";
87
- }
88
- if (isset($instance['TwitterWidgetId'])) {
89
- $TwitterWidgetId = $instance['TwitterWidgetId'];
90
- } else {
91
- $TwitterWidgetId = "";
92
- }
93
 
94
- if (isset($instance['title'])) {
95
- $title = $instance['title'];
96
- } else {
97
- $title = esc_html__('Tweets', 'Widget Title Here', 'twitter-tweets');
98
- } ?>
 
99
  <p>
100
  <label
101
- for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Title:', 'twitter-tweets'); ?></label>
102
  <input class="widefat"
103
- id="<?php echo esc_attr($this->get_field_id('title')); ?>"
104
- name="<?php echo esc_attr($this->get_field_name('title')); ?>"
105
- type="text" value="<?php echo esc_attr($title); ?>"
106
- placeholder="<?php esc_attr_e('Enter Widget Title', 'twitter-tweets'); ?>">
107
  </p>
108
  <p>
109
  <label
110
- for="<?php echo esc_attr($this->get_field_id('TwitterUserName')); ?>"><?php esc_html_e('Twitter Username', 'twitter-tweets'); ?></label>
111
  <input class="widefat"
112
- id="<?php echo esc_attr($this->get_field_id('TwitterUserName')); ?>"
113
- name="<?php echo esc_attr($this->get_field_name('TwitterUserName')); ?>"
114
- type="text" value="<?php echo esc_attr($TwitterUserName); ?>"
115
- placeholder="<?php esc_attr_e('Enter Your Twitter Account Username', 'twitter-tweets'); ?>">
116
  </p>
117
  <p>
118
  <input class="widefat"
119
- id="<?php echo esc_attr($this->get_field_id('TwitterWidgetId')); ?>"
120
- name="<?php echo esc_attr($this->get_field_name('TwitterWidgetId')); ?>"
121
  type="hidden"
122
- value="<?php echo esc_attr($TwitterWidgetId); ?>"
123
- placeholder="<?php esc_attr_e('Enter Your Twitter Widget ID', 'twitter-tweets'); ?>">
124
  </p>
125
  <p>
126
  <label
127
- for="<?php echo esc_attr($this->get_field_id('Theme')); ?>"><?php esc_html_e('Theme', 'twitter-tweets'); ?></label>
128
  <select
129
- id="<?php echo esc_attr($this->get_field_id('Theme')); ?>"
130
- name="<?php echo esc_attr($this->get_field_name('Theme')); ?>">
131
- <option value="light" <?php if ($Theme == "light") {
132
- echo esc_attr("selected=selected");
133
- } ?>><?php esc_html_e('Light', 'twitter-tweets'); ?>
134
- </option>
135
- <option value="dark" <?php if ($Theme == "dark") {
136
- echo esc_attr("selected=selected");
137
- } ?>><?php esc_html_e('Dark', 'twitter-tweets'); ?>
 
 
 
 
 
 
 
 
138
  </option>
139
  </select>
140
  </p>
141
  <p>
142
  <label
143
- for="<?php echo esc_attr($this->get_field_id('Height')); ?>"><?php esc_html_e('Height', 'twitter-tweets'); ?></label>
144
  <input class="widefat"
145
- id="<?php echo esc_attr($this->get_field_id('Height')); ?>"
146
- name="<?php echo esc_attr($this->get_field_name('Height')); ?>"
147
- type="text" value="<?php echo esc_attr($Height); ?>">
148
  </p>
149
 
150
  <p>
151
  <label
152
- for="<?php echo esc_attr($this->get_field_id('ExcludeReplies')); ?>"><?php esc_html_e('Exclude Replies on Tweets', 'twitter-tweets'); ?></label>
153
  <select
154
- id="<?php echo esc_attr($this->get_field_id('ExcludeReplies')); ?>"
155
- name="<?php echo esc_attr($this->get_field_name('ExcludeReplies')); ?>">
156
- <option value="yes" <?php if ($ExcludeReplies == "yes") {
157
- echo esc_attr("selected=selected");
158
- } ?>><?php esc_html_e('Yes', 'twitter-tweets'); ?>
159
- </option>
160
- <option value="no" <?php if ($ExcludeReplies == "no") {
161
- echo esc_attr("selected=selected");
162
- } ?>><?php esc_html_e('No', 'twitter-tweets'); ?>
 
 
 
 
 
 
 
 
163
  </option>
164
  </select>
165
  </p>
166
  <p>
167
  <label
168
- for="<?php echo esc_attr($this->get_field_id('AutoExpandPhotos')); ?>"><?php esc_html_e('Auto Expand Photos in Tweets', 'twitter-tweets'); ?></label>
169
  <select
170
- id="<?php echo esc_attr($this->get_field_id('AutoExpandPhotos')); ?>"
171
- name="<?php echo esc_attr($this->get_field_name('AutoExpandPhotos')); ?>">
172
- <option value="yes" <?php if ($AutoExpandPhotos == "yes") {
173
- echo esc_attr("selected=selected");
174
- } ?>><?php esc_html_e('Yes', 'twitter-tweets'); ?>
175
- </option>
176
- <option value="no" <?php if ($AutoExpandPhotos == "no") {
177
- echo esc_attr("selected=selected");
178
- } ?>><?php esc_html_e('No', 'twitter-tweets'); ?>
 
 
 
 
 
 
 
 
179
  </option>
180
  </select>
181
  </p>
182
  <p>
183
  <label
184
- for="<?php echo esc_attr($this->get_field_id('tw_language')); ?>"><?php esc_html_e('Select Language'); ?></label>
185
  <select
186
- id="<?php echo esc_attr($this->get_field_id('tw_language')); ?>"
187
- name="<?php echo esc_attr($this->get_field_name('tw_language')); ?>">
188
- <option value="" <?php if ($tw_language == "") {
189
- echo esc_attr("selected=selected");
190
- } ?>><?php esc_html_e('Automatic', 'twitter-tweets'); ?>
191
- </option>
192
- <option value="en" <?php if ($tw_language == "en") {
193
- echo esc_attr("selected=selected");
194
- } ?>><?php esc_html_e('English (default)', 'twitter-tweets'); ?>
195
- </option>
196
- <option value="ar" <?php if ($tw_language == "ar") {
197
- echo esc_attr("selected=selected");
198
- } ?>><?php esc_html_e('Arabic', 'twitter-tweets'); ?>
199
- </option>
200
- <option value="bn" <?php if ($tw_language == "bn") {
201
- echo esc_attr("selected=selected");
202
- } ?>><?php esc_html_e('Bengali', 'twitter-tweets'); ?>
203
- </option>
204
- <option value="cs" <?php if ($tw_language == "cs") {
205
- echo esc_attr("selected=selected");
206
- } ?>><?php esc_html_e('Czech', 'twitter-tweets'); ?>
207
- </option>
208
- <option value="da" <?php if ($tw_language == "da") {
209
- echo esc_attr("selected=selected");
210
- } ?>><?php esc_html_e('Danish', 'twitter-tweets'); ?>
211
- </option>
212
- <option value="de" <?php if ($tw_language == "de") {
213
- echo esc_attr("selected=selected");
214
- } ?>><?php esc_html_e('German', 'twitter-tweets'); ?>
215
- </option>
216
- <option value="el" <?php if ($tw_language == "el") {
217
- echo esc_attr("selected=selected");
218
- } ?>><?php esc_html_e('Greek', 'twitter-tweets'); ?>
219
- </option>
220
- <option value="es" <?php if ($tw_language == "es") {
221
- echo esc_attr("selected=selected");
222
- } ?>><?php esc_html_e('Spanish', 'twitter-tweets'); ?>
223
- </option>
224
- <option value="fa" <?php if ($tw_language == "fa") {
225
- echo esc_attr("selected=selected");
226
- } ?>><?php esc_html_e('Persian', 'twitter-tweets'); ?>
227
- </option>
228
- <option value="fi" <?php if ($tw_language == "fi") {
229
- echo esc_attr("selected=selected");
230
- } ?>><?php esc_html_e('Finnish', 'twitter-tweets'); ?>
231
- </option>
232
- <option value="fil" <?php if ($tw_language == "fil") {
233
- echo esc_attr("selected=selected");
234
- } ?>><?php esc_html_e('Filipino', 'twitter-tweets'); ?>
235
- </option>
236
- <option value="fr" <?php if ($tw_language == "fr") {
237
- echo esc_attr("selected=selected");
238
- } ?>><?php esc_html_e('French', 'twitter-tweets'); ?>
239
- </option>
240
- <option value="he" <?php if ($tw_language == "he") {
241
- echo esc_attr("selected=selected");
242
- } ?>><?php esc_html_e('Hebrew', 'twitter-tweets'); ?>
243
- </option>
244
- <option value="hi" <?php if ($tw_language == "hi") {
245
- echo esc_attr("selected=selected");
246
- } ?>><?php esc_html_e('Hindi', 'twitter-tweets'); ?>
247
- </option>
248
- <option value="hu" <?php if ($tw_language == "hu") {
249
- echo esc_attr("selected=selected");
250
- } ?>><?php esc_html_e('Hungarian', 'twitter-tweets'); ?>
251
- </option>
252
- <option value="id" <?php if ($tw_language == "id") {
253
- echo esc_attr("selected=selected");
254
- } ?>><?php esc_html_e('Indonesian', 'twitter-tweets'); ?>
255
- </option>
256
- <option value="it" <?php if ($tw_language == "it") {
257
- echo esc_attr("selected=selected");
258
- } ?>><?php esc_html_e('Italian', 'twitter-tweets'); ?>
259
- </option>
260
- <option value="ja" <?php if ($tw_language == "ja") {
261
- echo esc_attr("selected=selected");
262
- } ?>><?php esc_html_e('Japanese', 'twitter-tweets'); ?>
263
- </option>
264
- <option value="ko" <?php if ($tw_language == "ko") {
265
- echo esc_attr("selected=selected");
266
- } ?>><?php esc_html_e('Korean', 'twitter-tweets'); ?>
267
- </option>
268
- <option value="msa" <?php if ($tw_language == "msa") {
269
- echo esc_attr("selected=selected");
270
- } ?>><?php esc_html_e('Malay', 'twitter-tweets'); ?>
271
- </option>
272
- <option value="nl" <?php if ($tw_language == "nl") {
273
- echo esc_attr("selected=selected");
274
- } ?>><?php esc_html_e('Dutch', 'twitter-tweets'); ?>
275
- </option>
276
- <option value="no" <?php if ($tw_language == "no") {
277
- echo esc_attr("selected=selected");
278
- } ?>><?php esc_html_e('Norwegian', 'twitter-tweets'); ?>
279
- </option>
280
- <option value="pl" <?php if ($tw_language == "pl") {
281
- echo esc_attr("selected=selected");
282
- } ?>><?php esc_html_e('Polish', 'twitter-tweets'); ?>
283
- </option>
284
- <option value="pt" <?php if ($tw_language == "pt") {
285
- echo esc_attr("selected=selected");
286
- } ?>><?php esc_html_e('Portuguese', 'twitter-tweets'); ?>
287
- </option>
288
- <option value="ro" <?php if ($tw_language == "ro") {
289
- echo esc_attr("selected=selected");
290
- } ?>><?php esc_html_e('Romanian', 'twitter-tweets'); ?>
291
- </option>
292
- <option value="ru" <?php if ($tw_language == "ru") {
293
- echo esc_attr("selected=selected");
294
- } ?>><?php esc_html_e('Russian', 'twitter-tweets'); ?>
295
- </option>
296
- <option value="sv" <?php if ($tw_language == "sv") {
297
- echo esc_attr("selected=selected");
298
- } ?>><?php esc_html_e('Swedish', 'twitter-tweets'); ?>
299
- </option>
300
- <option value="th" <?php if ($tw_language == "th") {
301
- echo esc_attr("selected=selected");
302
- } ?>><?php esc_html_e('Thai', 'twitter-tweets'); ?>
303
- </option>
304
- <option value="tr" <?php if ($tw_language == "tr") {
305
- echo esc_attr("selected=selected");
306
- } ?>><?php esc_html_e('Turkish', 'twitter-tweets'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  </option>
308
  <option
309
- value="uk<?php if ($tw_language == "uk") {
310
- echo esc_attr("selected=selected");
311
- } ?>">
312
- <?php esc_html_e('Ukrainian', 'twitter-tweets'); ?>
313
- </option>
314
- <option value="ur" <?php if ($tw_language == "ur") {
315
- echo esc_attr("selected=selected");
316
- } ?>><?php esc_html_e('Urdu', 'twitter-tweets'); ?>
317
- </option>
318
- <option value="vi" <?php if ($tw_language == "vi") {
319
- echo esc_attr("selected=selected");
320
- } ?>><?php esc_html_e('Vietnamese', 'twitter-tweets'); ?>
321
- </option>
322
- <option value="zh-cn" <?php if ($tw_language == "zh-cn") {
323
- echo esc_attr("selected=selected");
324
- } ?>><?php esc_html_e('Chinese (Simplified)', 'twitter-tweets'); ?>
325
- </option>
326
- <option value="zh-tw" <?php if ($tw_language == "zh-tw") {
327
- echo esc_attr("selected=selected");
328
- } ?>><?php esc_html_e('Chinese (Traditional)', 'twitter-tweets'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  </option>
330
  </select>
331
  </p>
332
- <?php
333
- }
334
- /*
335
- Sanitize widget form values as they are saved.
336
- @see WP_Widget::update()
337
- @param array $new_instance Values just sent to be saved.
338
- @param array $old_instance Previously saved values from database.
339
- @return array Updated safe values to be saved.
340
- */
341
- public function update($new_instance, $old_instance)
342
- {
343
- $instance = array();
344
- $title = sanitize_text_field((!empty($new_instance['title'])) ? strip_tags($new_instance['title']) : 'Widget Title Here');
345
- $TwitterUserName = sanitize_text_field((!empty($new_instance['TwitterUserName'])) ? strip_tags($new_instance['TwitterUserName']) : '');
346
- $Theme = sanitize_text_field('theme', (!empty($new_instance['Theme'])) ? strip_tags($new_instance['Theme']) : 'light');
347
- $Height = sanitize_text_field((!empty($new_instance['Height'])) ? strip_tags($new_instance['Height']) : '450');
348
- $Width = sanitize_text_field((!empty($new_instance['Width'])) ? strip_tags($new_instance['Width']) : '');
349
- $ExcludeReplies = sanitize_text_field((!empty($new_instance['ExcludeReplies'])) ? strip_tags($new_instance['ExcludeReplies']) : 'yes');
350
- $AutoExpandPhotos = sanitize_text_field((!empty($new_instance['AutoExpandPhotos'])) ? strip_tags($new_instance['AutoExpandPhotos']) : 'yes');
351
- $TwitterWidgetId = sanitize_text_field((!empty($new_instance['TwitterWidgetId'])) ? strip_tags($new_instance['TwitterWidgetId']) : '');
352
- $tw_language = sanitize_text_field((!empty($new_instance['tw_language'])) ? strip_tags($new_instance['tw_language']) : '');
353
 
354
- $instance['title'] = $title;
355
- $instance['TwitterUserName'] = $TwitterUserName;
356
- $instance['Theme'] = $Theme;
357
- $instance['Height'] = $Height;
358
- $instance['ExcludeReplies'] = $ExcludeReplies;
359
- $instance['AutoExpandPhotos'] = $AutoExpandPhotos;
360
- $instance['TwitterWidgetId'] = $TwitterWidgetId;
361
- $instance['tw_language'] = $tw_language;
362
- $instance['Width'] = $Width;
363
- return $instance;
364
- }
365
  }
366
  // end of class WeblizarTwitter
367
  // register WeblizarTwitter widget
368
- function WeblizarTwitterWidget()
369
- {
370
- register_widget('WeblizarTwitter');
371
  }
372
- add_action('widgets_init', 'WeblizarTwitterWidget');
1
  <?php
2
+ class WeblizarTwitter extends WP_Widget {
 
 
 
 
 
 
 
 
 
3
 
4
+ public function __construct() {
5
+ parent::__construct(
6
+ 'weblizar_twitter', // Base ID
7
+ esc_html__( 'Customize Feeds for Twitter Widget', 'twitter-tweets' ), // Name
8
+ array( 'description' => esc_html__( 'Display latest tweets from your Twitter account', 'twitter-tweets' ) )
9
+ );
10
+ }
11
+
12
+ /*** Front-end display of widget. ***/
13
+ public function widget( $args, $instance ) {
14
+ // Outputs the content of the widget
15
+ extract( $args ); // Make before_widget, etc available.
16
+ $title = apply_filters( 'title', $instance['title'] );
17
+ echo wp_kses_post( $before_widget );
18
+ if ( ! empty( $title ) ) {
19
+ echo wp_kses_post( $before_title . $title . $after_title );
20
+ }
21
+ $TwitterUserName = $instance['TwitterUserName'];
22
+ $Theme = $instance['Theme'];
23
+ $Height = $instance['Height'];
24
+ $Width = $instance['Width'];
25
+ $ExcludeReplies = $instance['ExcludeReplies'];
26
+ $AutoExpandPhotos = $instance['AutoExpandPhotos'];
27
+ $TwitterWidgetId = $instance['TwitterWidgetId'];
28
+ $tw_language = $instance['tw_language']; ?>
29
  <div style="display:block;width:100%;float:left;overflow:hidden">
30
  <a class="twitter-timeline" data-dnt="true"
31
+ href="https://twitter.com/<?php echo esc_attr( $TwitterUserName ); ?>"
32
+ min-width="<?php echo esc_attr( $Width ); ?>"
33
+ height="<?php echo esc_attr( $Height ); ?>"
34
+ data-theme="<?php echo esc_attr( $Theme ); ?>"
35
+ data-lang="<?php echo esc_attr( $tw_language ); ?>"></a>
36
 
37
  </div>
38
+ <?php
39
+ echo wp_kses_post( $after_widget );
40
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
+ /** Back-end widget form. **/
43
+ public function form( $instance ) {
44
+ if ( isset( $instance['TwitterUserName'] ) ) {
45
+ $TwitterUserName = $instance['TwitterUserName'];
46
+ } else {
47
+ $TwitterUserName = 'weblizar';
48
+ }
49
+ if ( isset( $instance['Theme'] ) ) {
50
+ $Theme = $instance['Theme'];
51
+ } else {
52
+ $Theme = 'light';
53
+ }
54
+ if ( isset( $instance['Height'] ) ) {
55
+ $Height = $instance['Height'];
56
+ } else {
57
+ $Height = '450';
58
+ }
59
 
60
+ if ( isset( $instance['Width'] ) ) {
61
+ $Width = $instance['Width'];
62
+ } else {
63
+ $Width = '450';
64
+ }
65
 
66
+ if ( isset( $instance['ExcludeReplies'] ) ) {
67
+ $ExcludeReplies = $instance['ExcludeReplies'];
68
+ } else {
69
+ $ExcludeReplies = 'yes';
70
+ }
71
 
72
+ if ( isset( $instance['AutoExpandPhotos'] ) ) {
73
+ $AutoExpandPhotos = $instance['AutoExpandPhotos'];
74
+ } else {
75
+ $AutoExpandPhotos = 'yes';
76
+ }
77
 
78
+ if ( isset( $instance['tw_language'] ) ) {
79
+ $tw_language = $instance['tw_language'];
80
+ } else {
81
+ $tw_language = '';
82
+ }
83
+ if ( isset( $instance['TwitterWidgetId'] ) ) {
84
+ $TwitterWidgetId = $instance['TwitterWidgetId'];
85
+ } else {
86
+ $TwitterWidgetId = '';
87
+ }
88
 
89
+ if ( isset( $instance['title'] ) ) {
90
+ $title = $instance['title'];
91
+ } else {
92
+ $title = esc_html__( 'Tweets', 'Widget Title Here', 'twitter-tweets' );
93
+ }
94
+ ?>
95
  <p>
96
  <label
97
+ for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'twitter-tweets' ); ?></label>
98
  <input class="widefat"
99
+ id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"
100
+ name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>"
101
+ type="text" value="<?php echo esc_attr( $title ); ?>"
102
+ placeholder="<?php esc_attr_e( 'Enter Widget Title', 'twitter-tweets' ); ?>">
103
  </p>
104
  <p>
105
  <label
106
+ for="<?php echo esc_attr( $this->get_field_id( 'TwitterUserName' ) ); ?>"><?php esc_html_e( 'Twitter Username', 'twitter-tweets' ); ?></label>
107
  <input class="widefat"
108
+ id="<?php echo esc_attr( $this->get_field_id( 'TwitterUserName' ) ); ?>"
109
+ name="<?php echo esc_attr( $this->get_field_name( 'TwitterUserName' ) ); ?>"
110
+ type="text" value="<?php echo esc_attr( $TwitterUserName ); ?>"
111
+ placeholder="<?php esc_attr_e( 'Enter Your Twitter Account Username', 'twitter-tweets' ); ?>">
112
  </p>
113
  <p>
114
  <input class="widefat"
115
+ id="<?php echo esc_attr( $this->get_field_id( 'TwitterWidgetId' ) ); ?>"
116
+ name="<?php echo esc_attr( $this->get_field_name( 'TwitterWidgetId' ) ); ?>"
117
  type="hidden"
118
+ value="<?php echo esc_attr( $TwitterWidgetId ); ?>"
119
+ placeholder="<?php esc_attr_e( 'Enter Your Twitter Widget ID', 'twitter-tweets' ); ?>">
120
  </p>
121
  <p>
122
  <label
123
+ for="<?php echo esc_attr( $this->get_field_id( 'Theme' ) ); ?>"><?php esc_html_e( 'Theme', 'twitter-tweets' ); ?></label>
124
  <select
125
+ id="<?php echo esc_attr( $this->get_field_id( 'Theme' ) ); ?>"
126
+ name="<?php echo esc_attr( $this->get_field_name( 'Theme' ) ); ?>">
127
+ <option value="light"
128
+ <?php
129
+ if ( $Theme == 'light' ) {
130
+ echo esc_attr( 'selected=selected' );
131
+ }
132
+ ?>
133
+ ><?php esc_html_e( 'Light', 'twitter-tweets' ); ?>
134
+ </option>
135
+ <option value="dark"
136
+ <?php
137
+ if ( $Theme == 'dark' ) {
138
+ echo esc_attr( 'selected=selected' );
139
+ }
140
+ ?>
141
+ ><?php esc_html_e( 'Dark', 'twitter-tweets' ); ?>
142
  </option>
143
  </select>
144
  </p>
145
  <p>
146
  <label
147
+ for="<?php echo esc_attr( $this->get_field_id( 'Height' ) ); ?>"><?php esc_html_e( 'Height', 'twitter-tweets' ); ?></label>
148
  <input class="widefat"
149
+ id="<?php echo esc_attr( $this->get_field_id( 'Height' ) ); ?>"
150
+ name="<?php echo esc_attr( $this->get_field_name( 'Height' ) ); ?>"
151
+ type="text" value="<?php echo esc_attr( $Height ); ?>">
152
  </p>
153
 
154
  <p>
155
  <label
156
+ for="<?php echo esc_attr( $this->get_field_id( 'ExcludeReplies' ) ); ?>"><?php esc_html_e( 'Exclude Replies on Tweets', 'twitter-tweets' ); ?></label>
157
  <select
158
+ id="<?php echo esc_attr( $this->get_field_id( 'ExcludeReplies' ) ); ?>"
159
+ name="<?php echo esc_attr( $this->get_field_name( 'ExcludeReplies' ) ); ?>">
160
+ <option value="yes"
161
+ <?php
162
+ if ( $ExcludeReplies == 'yes' ) {
163
+ echo esc_attr( 'selected=selected' );
164
+ }
165
+ ?>
166
+ ><?php esc_html_e( 'Yes', 'twitter-tweets' ); ?>
167
+ </option>
168
+ <option value="no"
169
+ <?php
170
+ if ( $ExcludeReplies == 'no' ) {
171
+ echo esc_attr( 'selected=selected' );
172
+ }
173
+ ?>
174
+ ><?php esc_html_e( 'No', 'twitter-tweets' ); ?>
175
  </option>
176
  </select>
177
  </p>
178
  <p>
179
  <label
180
+ for="<?php echo esc_attr( $this->get_field_id( 'AutoExpandPhotos' ) ); ?>"><?php esc_html_e( 'Auto Expand Photos in Tweets', 'twitter-tweets' ); ?></label>
181
  <select
182
+ id="<?php echo esc_attr( $this->get_field_id( 'AutoExpandPhotos' ) ); ?>"
183
+ name="<?php echo esc_attr( $this->get_field_name( 'AutoExpandPhotos' ) ); ?>">
184
+ <option value="yes"
185
+ <?php
186
+ if ( $AutoExpandPhotos == 'yes' ) {
187
+ echo esc_attr( 'selected=selected' );
188
+ }
189
+ ?>
190
+ ><?php esc_html_e( 'Yes', 'twitter-tweets' ); ?>
191
+ </option>
192
+ <option value="no"
193
+ <?php
194
+ if ( $AutoExpandPhotos == 'no' ) {
195
+ echo esc_attr( 'selected=selected' );
196
+ }
197
+ ?>
198
+ ><?php esc_html_e( 'No', 'twitter-tweets' ); ?>
199
  </option>
200
  </select>
201
  </p>
202
  <p>
203
  <label
204
+ for="<?php echo esc_attr( $this->get_field_id( 'tw_language' ) ); ?>"><?php esc_html_e( 'Select Language' ); ?></label>
205
  <select
206
+ id="<?php echo esc_attr( $this->get_field_id( 'tw_language' ) ); ?>"
207
+ name="<?php echo esc_attr( $this->get_field_name( 'tw_language' ) ); ?>">
208
+ <option value=""
209
+ <?php
210
+ if ( $tw_language == '' ) {
211
+ echo esc_attr( 'selected=selected' );
212
+ }
213
+ ?>
214
+ ><?php esc_html_e( 'Automatic', 'twitter-tweets' ); ?>
215
+ </option>
216
+ <option value="en"
217
+ <?php
218
+ if ( $tw_language == 'en' ) {
219
+ echo esc_attr( 'selected=selected' );
220
+ }
221
+ ?>
222
+ ><?php esc_html_e( 'English (default)', 'twitter-tweets' ); ?>
223
+ </option>
224
+ <option value="ar"
225
+ <?php
226
+ if ( $tw_language == 'ar' ) {
227
+ echo esc_attr( 'selected=selected' );
228
+ }
229
+ ?>
230
+ ><?php esc_html_e( 'Arabic', 'twitter-tweets' ); ?>
231
+ </option>
232
+ <option value="bn"
233
+ <?php
234
+ if ( $tw_language == 'bn' ) {
235
+ echo esc_attr( 'selected=selected' );
236
+ }
237
+ ?>
238
+ ><?php esc_html_e( 'Bengali', 'twitter-tweets' ); ?>
239
+ </option>
240
+ <option value="cs"
241
+ <?php
242
+ if ( $tw_language == 'cs' ) {
243
+ echo esc_attr( 'selected=selected' );
244
+ }
245
+ ?>
246
+ ><?php esc_html_e( 'Czech', 'twitter-tweets' ); ?>
247
+ </option>
248
+ <option value="da"
249
+ <?php
250
+ if ( $tw_language == 'da' ) {
251
+ echo esc_attr( 'selected=selected' );
252
+ }
253
+ ?>
254
+ ><?php esc_html_e( 'Danish', 'twitter-tweets' ); ?>
255
+ </option>
256
+ <option value="de"
257
+ <?php
258
+ if ( $tw_language == 'de' ) {
259
+ echo esc_attr( 'selected=selected' );
260
+ }
261
+ ?>
262
+ ><?php esc_html_e( 'German', 'twitter-tweets' ); ?>
263
+ </option>
264
+ <option value="el"
265
+ <?php
266
+ if ( $tw_language == 'el' ) {
267
+ echo esc_attr( 'selected=selected' );
268
+ }
269
+ ?>
270
+ ><?php esc_html_e( 'Greek', 'twitter-tweets' ); ?>
271
+ </option>
272
+ <option value="es"
273
+ <?php
274
+ if ( $tw_language == 'es' ) {
275
+ echo esc_attr( 'selected=selected' );
276
+ }
277
+ ?>
278
+ ><?php esc_html_e( 'Spanish', 'twitter-tweets' ); ?>
279
+ </option>
280
+ <option value="fa"
281
+ <?php
282
+ if ( $tw_language == 'fa' ) {
283
+ echo esc_attr( 'selected=selected' );
284
+ }
285
+ ?>
286
+ ><?php esc_html_e( 'Persian', 'twitter-tweets' ); ?>
287
+ </option>
288
+ <option value="fi"
289
+ <?php
290
+ if ( $tw_language == 'fi' ) {
291
+ echo esc_attr( 'selected=selected' );
292
+ }
293
+ ?>
294
+ ><?php esc_html_e( 'Finnish', 'twitter-tweets' ); ?>
295
+ </option>
296
+ <option value="fil"
297
+ <?php
298
+ if ( $tw_language == 'fil' ) {
299
+ echo esc_attr( 'selected=selected' );
300
+ }
301
+ ?>
302
+ ><?php esc_html_e( 'Filipino', 'twitter-tweets' ); ?>
303
+ </option>
304
+ <option value="fr"
305
+ <?php
306
+ if ( $tw_language == 'fr' ) {
307
+ echo esc_attr( 'selected=selected' );
308
+ }
309
+ ?>
310
+ ><?php esc_html_e( 'French', 'twitter-tweets' ); ?>
311
+ </option>
312
+ <option value="he"
313
+ <?php
314
+ if ( $tw_language == 'he' ) {
315
+ echo esc_attr( 'selected=selected' );
316
+ }
317
+ ?>
318
+ ><?php esc_html_e( 'Hebrew', 'twitter-tweets' ); ?>
319
+ </option>
320
+ <option value="hi"
321
+ <?php
322
+ if ( $tw_language == 'hi' ) {
323
+ echo esc_attr( 'selected=selected' );
324
+ }
325
+ ?>
326
+ ><?php esc_html_e( 'Hindi', 'twitter-tweets' ); ?>
327
+ </option>
328
+ <option value="hu"
329
+ <?php
330
+ if ( $tw_language == 'hu' ) {
331
+ echo esc_attr( 'selected=selected' );
332
+ }
333
+ ?>
334
+ ><?php esc_html_e( 'Hungarian', 'twitter-tweets' ); ?>
335
+ </option>
336
+ <option value="id"
337
+ <?php
338
+ if ( $tw_language == 'id' ) {
339
+ echo esc_attr( 'selected=selected' );
340
+ }
341
+ ?>
342
+ ><?php esc_html_e( 'Indonesian', 'twitter-tweets' ); ?>
343
+ </option>
344
+ <option value="it"
345
+ <?php
346
+ if ( $tw_language == 'it' ) {
347
+ echo esc_attr( 'selected=selected' );
348
+ }
349
+ ?>
350
+ ><?php esc_html_e( 'Italian', 'twitter-tweets' ); ?>
351
+ </option>
352
+ <option value="ja"
353
+ <?php
354
+ if ( $tw_language == 'ja' ) {
355
+ echo esc_attr( 'selected=selected' );
356
+ }
357
+ ?>
358
+ ><?php esc_html_e( 'Japanese', 'twitter-tweets' ); ?>
359
+ </option>
360
+ <option value="ko"
361
+ <?php
362
+ if ( $tw_language == 'ko' ) {
363
+ echo esc_attr( 'selected=selected' );
364
+ }
365
+ ?>
366
+ ><?php esc_html_e( 'Korean', 'twitter-tweets' ); ?>
367
+ </option>
368
+ <option value="msa"
369
+ <?php
370
+ if ( $tw_language == 'msa' ) {
371
+ echo esc_attr( 'selected=selected' );
372
+ }
373
+ ?>
374
+ ><?php esc_html_e( 'Malay', 'twitter-tweets' ); ?>
375
+ </option>
376
+ <option value="nl"
377
+ <?php
378
+ if ( $tw_language == 'nl' ) {
379
+ echo esc_attr( 'selected=selected' );
380
+ }
381
+ ?>
382
+ ><?php esc_html_e( 'Dutch', 'twitter-tweets' ); ?>
383
+ </option>
384
+ <option value="no"
385
+ <?php
386
+ if ( $tw_language == 'no' ) {
387
+ echo esc_attr( 'selected=selected' );
388
+ }
389
+ ?>
390
+ ><?php esc_html_e( 'Norwegian', 'twitter-tweets' ); ?>
391
+ </option>
392
+ <option value="pl"
393
+ <?php
394
+ if ( $tw_language == 'pl' ) {
395
+ echo esc_attr( 'selected=selected' );
396
+ }
397
+ ?>
398
+ ><?php esc_html_e( 'Polish', 'twitter-tweets' ); ?>
399
+ </option>
400
+ <option value="pt"
401
+ <?php
402
+ if ( $tw_language == 'pt' ) {
403
+ echo esc_attr( 'selected=selected' );
404
+ }
405
+ ?>
406
+ ><?php esc_html_e( 'Portuguese', 'twitter-tweets' ); ?>
407
+ </option>
408
+ <option value="ro"
409
+ <?php
410
+ if ( $tw_language == 'ro' ) {
411
+ echo esc_attr( 'selected=selected' );
412
+ }
413
+ ?>
414
+ ><?php esc_html_e( 'Romanian', 'twitter-tweets' ); ?>
415
+ </option>
416
+ <option value="ru"
417
+ <?php
418
+ if ( $tw_language == 'ru' ) {
419
+ echo esc_attr( 'selected=selected' );
420
+ }
421
+ ?>
422
+ ><?php esc_html_e( 'Russian', 'twitter-tweets' ); ?>
423
+ </option>
424
+ <option value="sv"
425
+ <?php
426
+ if ( $tw_language == 'sv' ) {
427
+ echo esc_attr( 'selected=selected' );
428
+ }
429
+ ?>
430
+ ><?php esc_html_e( 'Swedish', 'twitter-tweets' ); ?>
431
+ </option>
432
+ <option value="th"
433
+ <?php
434
+ if ( $tw_language == 'th' ) {
435
+ echo esc_attr( 'selected=selected' );
436
+ }
437
+ ?>
438
+ ><?php esc_html_e( 'Thai', 'twitter-tweets' ); ?>
439
+ </option>
440
+ <option value="tr"
441
+ <?php
442
+ if ( $tw_language == 'tr' ) {
443
+ echo esc_attr( 'selected=selected' );
444
+ }
445
+ ?>
446
+ ><?php esc_html_e( 'Turkish', 'twitter-tweets' ); ?>
447
  </option>
448
  <option
449
+ value="uk
450
+ <?php
451
+ if ( $tw_language == 'uk' ) {
452
+ echo esc_attr( 'selected=selected' );
453
+ }
454
+ ?>
455
+ ">
456
+ <?php esc_html_e( 'Ukrainian', 'twitter-tweets' ); ?>
457
+ </option>
458
+ <option value="ur"
459
+ <?php
460
+ if ( $tw_language == 'ur' ) {
461
+ echo esc_attr( 'selected=selected' );
462
+ }
463
+ ?>
464
+ ><?php esc_html_e( 'Urdu', 'twitter-tweets' ); ?>
465
+ </option>
466
+ <option value="vi"
467
+ <?php
468
+ if ( $tw_language == 'vi' ) {
469
+ echo esc_attr( 'selected=selected' );
470
+ }
471
+ ?>
472
+ ><?php esc_html_e( 'Vietnamese', 'twitter-tweets' ); ?>
473
+ </option>
474
+ <option value="zh-cn"
475
+ <?php
476
+ if ( $tw_language == 'zh-cn' ) {
477
+ echo esc_attr( 'selected=selected' );
478
+ }
479
+ ?>
480
+ ><?php esc_html_e( 'Chinese (Simplified)', 'twitter-tweets' ); ?>
481
+ </option>
482
+ <option value="zh-tw"
483
+ <?php
484
+ if ( $tw_language == 'zh-tw' ) {
485
+ echo esc_attr( 'selected=selected' );
486
+ }
487
+ ?>
488
+ ><?php esc_html_e( 'Chinese (Traditional)', 'twitter-tweets' ); ?>
489
  </option>
490
  </select>
491
  </p>
492
+ <?php
493
+ }
494
+ /*
495
+ Sanitize widget form values as they are saved.
496
+ @see WP_Widget::update()
497
+ @param array $new_instance Values just sent to be saved.
498
+ @param array $old_instance Previously saved values from database.
499
+ @return array Updated safe values to be saved.
500
+ */
501
+ public function update( $new_instance, $old_instance ) {
502
+ $instance = array();
503
+ $title = sanitize_text_field( ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : 'Widget Title Here' );
504
+ $TwitterUserName = sanitize_text_field( ( ! empty( $new_instance['TwitterUserName'] ) ) ? strip_tags( $new_instance['TwitterUserName'] ) : '' );
505
+ $Theme = sanitize_text_field( 'theme', ( ! empty( $new_instance['Theme'] ) ) ? strip_tags( $new_instance['Theme'] ) : 'light' );
506
+ $Height = sanitize_text_field( ( ! empty( $new_instance['Height'] ) ) ? strip_tags( $new_instance['Height'] ) : '450' );
507
+ $Width = sanitize_text_field( ( ! empty( $new_instance['Width'] ) ) ? strip_tags( $new_instance['Width'] ) : '' );
508
+ $ExcludeReplies = sanitize_text_field( ( ! empty( $new_instance['ExcludeReplies'] ) ) ? strip_tags( $new_instance['ExcludeReplies'] ) : 'yes' );
509
+ $AutoExpandPhotos = sanitize_text_field( ( ! empty( $new_instance['AutoExpandPhotos'] ) ) ? strip_tags( $new_instance['AutoExpandPhotos'] ) : 'yes' );
510
+ $TwitterWidgetId = sanitize_text_field( ( ! empty( $new_instance['TwitterWidgetId'] ) ) ? strip_tags( $new_instance['TwitterWidgetId'] ) : '' );
511
+ $tw_language = sanitize_text_field( ( ! empty( $new_instance['tw_language'] ) ) ? strip_tags( $new_instance['tw_language'] ) : '' );
 
512
 
513
+ $instance['title'] = $title;
514
+ $instance['TwitterUserName'] = $TwitterUserName;
515
+ $instance['Theme'] = $Theme;
516
+ $instance['Height'] = $Height;
517
+ $instance['ExcludeReplies'] = $ExcludeReplies;
518
+ $instance['AutoExpandPhotos'] = $AutoExpandPhotos;
519
+ $instance['TwitterWidgetId'] = $TwitterWidgetId;
520
+ $instance['tw_language'] = $tw_language;
521
+ $instance['Width'] = $Width;
522
+ return $instance;
523
+ }
524
  }
525
  // end of class WeblizarTwitter
526
  // register WeblizarTwitter widget
527
+ function WeblizarTwitterWidget() {
528
+ register_widget( 'WeblizarTwitter' );
 
529
  }
530
+ add_action( 'widgets_init', 'WeblizarTwitterWidget' );