AccessPress Twitter Feed – Twitter Feed for WordPress - Version 1.6.0

Version Description

  • Minor bug fixes
  • Security fix update
  • WordPress version 5.2.2 compatibility checked
Download this release

Release Info

Developer Access Keys
Plugin Icon 128x128 AccessPress Twitter Feed – Twitter Feed for WordPress
Version 1.6.0
Comparing to
See all releases

Code changes from version 1.5.9 to 1.6.0

APTF.class.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Version 2.2.1
4
+ * The base class for the storm twitter feed for developers.
5
+ * This class provides all the things needed for the wordpress plugin, but in theory means you don't need to use it with wordpress.
6
+ * What could go wrong?
7
+ */
8
+
9
+
10
+ if (!class_exists('TwitterOAuth')) {
11
+ require_once('oauth/twitteroauth.php');
12
+ } else {
13
+ define('TFD_USING_EXISTING_LIBRARY_TWITTEROAUTH',true);
14
+ }
15
+
16
+ class APTF_Twitter_Class {
17
+
18
+ private $defaults = array(
19
+ 'directory' => '',
20
+ 'key' => '',
21
+ 'secret' => '',
22
+ 'token' => '',
23
+ 'token_secret' => '',
24
+ 'screenname' => '',
25
+ 'cache_expire' => 1
26
+ );
27
+
28
+ public $st_last_error = false;
29
+
30
+ function __construct($args = array()) {
31
+ $this->defaults = array_merge($this->defaults, $args);
32
+ }
33
+
34
+ function __toString() {
35
+ return print_r($this->defaults, true);
36
+ }
37
+
38
+ function getTweets($screenname = false,$count = 20,$options = false) {
39
+ // BC: $count used to be the first argument
40
+ if (is_int($screenname)) {
41
+ list($screenname, $count) = array($count, $screenname);
42
+ }
43
+
44
+ if ($count > 20) $count = 20;
45
+ if ($count < 1) $count = 1;
46
+
47
+ $default_options = array('trim_user'=>true, 'exclude_replies'=>true, 'include_rts'=>false);
48
+
49
+ if ($options === false || !is_array($options)) {
50
+ $options = $default_options;
51
+ } else {
52
+ $options = array_merge($default_options, $options);
53
+ }
54
+
55
+ if ($screenname === false || $screenname === 20) $screenname = $this->defaults['screenname'];
56
+
57
+
58
+ //If we're here, we need to load.
59
+ $result = $this->oauthGetTweets($screenname,$options);
60
+
61
+ if (is_array($result) && isset($result['errors'])) {
62
+ if (is_array($result) && isset($result['errors'][0]) && isset($result['errors'][0]['message'])) {
63
+ $last_error = $result['errors'][0]['message'];
64
+ } else {
65
+ $last_error = $result['errors'];
66
+ }
67
+ return array('error'=>__('Twitter said: ',APTF_TD).json_encode($last_error));
68
+ } else {
69
+ if (is_array($result)) {
70
+ return $this->cropTweets($result,$count);
71
+
72
+ } else {
73
+ $last_error = __('Something went wrong with the twitter request: ',APTF_TD).json_encode($result);
74
+ return array('error'=>$last_error);
75
+ }
76
+ }
77
+
78
+ }
79
+
80
+ private function cropTweets($result,$count) {
81
+ return array_slice($result, 0, $count);
82
+ }
83
+
84
+
85
+
86
+ private function getOptionsHash($options) {
87
+ $hash = md5(serialize($options));
88
+ return $hash;
89
+ }
90
+
91
+
92
+
93
+ private function oauthGetTweets($screenname,$options) {
94
+ $key = $this->defaults['key'];
95
+ $secret = $this->defaults['secret'];
96
+ $token = $this->defaults['token'];
97
+ $token_secret = $this->defaults['token_secret'];
98
+
99
+ $cachename = $screenname."-".$this->getOptionsHash($options);
100
+
101
+ $options = array_merge($options, array('screen_name' => $screenname, 'count' => 20));
102
+
103
+ if (empty($key)) return array('error'=>__('Missing Consumer Key - Check Settings',APTF_TD));
104
+ if (empty($secret)) return array('error'=>__('Missing Consumer Secret - Check Settings',APTF_TD));
105
+ if (empty($token)) return array('error'=>__('Missing Access Token - Check Settings',APTF_TD));
106
+ if (empty($token_secret)) return array('error'=>__('Missing Access Token Secret - Check Settings',APTF_TD));
107
+ if (empty($screenname)) return array('error'=>__('Missing Twitter Feed Screen Name - Check Settings',APTF_TD));
108
+
109
+ $connection = new TwitterOAuth($key, $secret, $token, $token_secret);
110
+ $result = $connection->get('statuses/user_timeline', $options);
111
+
112
+ if (isset($result['errors'])) {
113
+ if (is_array($results) && isset($result['errors'][0]) && isset($result['errors'][0]['message'])) {
114
+ $last_error = '['.date('r').'] Twitter error: '.$result['errors'][0]['message'];
115
+ $this->st_last_error = $last_error;
116
+ } else {
117
+ $last_error = '['.date('r').'] Twitter returned an invalid response. It is probably down.';
118
+ $this->st_last_error = $last_error;
119
+ }
120
+ }
121
+
122
+ return $result;
123
+
124
+ }
125
+ }
accesspress-twitter-feed.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  defined('ABSPATH') or die('No script kiddies please!');
3
  /**
4
- * Plugin Name: AccessPress Twitter Feed
5
  * Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed/
6
  * Description: A plugin to show your twitter feed in your site with various configurable settings
7
- * Version: 1.5.9
8
  * Author: AccessPress Themes
9
  * Author URI: http://accesspressthemes.com
10
  * Text Domain: accesspress-twitter-feed
@@ -24,7 +24,7 @@ if (!defined('APTF_CSS_DIR')) {
24
  define('APTF_CSS_DIR', plugin_dir_url(__FILE__) . 'css');
25
  }
26
  if (!defined('APTF_VERSION')) {
27
- define('APTF_VERSION', '1.5.9');
28
  }
29
 
30
  if (!defined('APTF_TD')) {
@@ -45,11 +45,14 @@ if (!class_exists('APTF_Class')) {
45
  function __construct() {
46
  $this->aptf_settings = get_option('aptf_settings');
47
  add_action('init', array($this, 'load_text_domain')); //loads plugin text domain for internationalization
 
48
  add_action('admin_menu', array($this, 'add_plugin_admin_menu')); //adds the menu in admin section
49
  add_action('admin_enqueue_scripts', array($this, 'register_admin_scripts')); //registers scripts and css for admin section
50
  register_activation_hook(__FILE__, array($this, 'load_default_settings')); //loads default settings for the plugin while activating the plugin
 
51
  add_action('admin_post_aptf_form_action', array($this, 'aptf_form_action')); //action to save settings
52
  add_action('admin_post_aptf_restore_settings', array($this, 'aptf_restore_settings')); //action to restore default settings
 
53
  add_action('admin_post_aptf_delete_cache', array($this, 'aptf_delete_cache')); //action to delete cache
54
  add_shortcode('ap-twitter-feed', array($this, 'feed_shortcode')); //registers shortcode to display the feeds
55
  add_shortcode('ap-twitter-feed-slider', array($this, 'feed_slider_shortcode')); //registers shortcode to display the feeds as slider
@@ -81,7 +84,7 @@ if (!class_exists('APTF_Class')) {
81
  * Adds plugin's menu in the admin section
82
  */
83
  function add_plugin_admin_menu() {
84
- add_menu_page(__('AccessPress Twitter Feed', 'accesspress-twitter-feed'), __('AccessPress Twitter Feed', 'accesspress-twitter-feed'), 'manage_options', 'ap-twitter-feed', array($this, 'main_setting_page'), 'dashicons-twitter');
85
  }
86
 
87
  /**
@@ -296,14 +299,14 @@ if (!class_exists('APTF_Class')) {
296
  $tweets = (isset($aptf_settings['disable_cache']) && $aptf_settings['disable_cache']==1)?false:$tweets;
297
  if (false === $tweets) {
298
  $aptf_settings = $this->aptf_settings;
299
- $consumer_key = $aptf_settings['consumer_key'];
300
- $consumer_secret = $aptf_settings['consumer_secret'];
301
- $access_token = $aptf_settings['access_token'];
302
- $access_token_secret = $aptf_settings['access_token_secret'];
303
  $oauth_connection = $this->get_oauth_connection($consumer_key, $consumer_secret, $access_token, $access_token_secret);
304
  $api_url = "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$username."&count=".$tweets_number.'&exclude_replies=true';
305
  $tweets = $oauth_connection->get(apply_filters('aptf_api_url',$api_url,$username,$tweets_number));
306
- $cache_period = intval($aptf_settings['cache_period']) * 60;
307
  $cache_period = ($cache_period < 1) ? 3600 : $cache_period;
308
  if(!isset($tweets->errors)){
309
  set_transient('aptf_tweets', $tweets, $cache_period);
@@ -318,9 +321,88 @@ if (!class_exists('APTF_Class')) {
318
  return preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.-]*(\?\S+)?)?)?)@', '<a href="$1" target="_blank">$1</a>', $s);
319
  }
320
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
 
322
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  }
325
 
326
  /**
1
  <?php
2
  defined('ABSPATH') or die('No script kiddies please!');
3
  /**
4
+ * Plugin Name: WP TFeed
5
  * Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed/
6
  * Description: A plugin to show your twitter feed in your site with various configurable settings
7
+ * Version: 1.6.0
8
  * Author: AccessPress Themes
9
  * Author URI: http://accesspressthemes.com
10
  * Text Domain: accesspress-twitter-feed
24
  define('APTF_CSS_DIR', plugin_dir_url(__FILE__) . 'css');
25
  }
26
  if (!defined('APTF_VERSION')) {
27
+ define('APTF_VERSION', '1.6.0');
28
  }
29
 
30
  if (!defined('APTF_TD')) {
45
  function __construct() {
46
  $this->aptf_settings = get_option('aptf_settings');
47
  add_action('init', array($this, 'load_text_domain')); //loads plugin text domain for internationalization
48
+ add_filter( 'admin_footer_text', array( $this, 'aptf_admin_footer_text' ) );
49
  add_action('admin_menu', array($this, 'add_plugin_admin_menu')); //adds the menu in admin section
50
  add_action('admin_enqueue_scripts', array($this, 'register_admin_scripts')); //registers scripts and css for admin section
51
  register_activation_hook(__FILE__, array($this, 'load_default_settings')); //loads default settings for the plugin while activating the plugin
52
+
53
  add_action('admin_post_aptf_form_action', array($this, 'aptf_form_action')); //action to save settings
54
  add_action('admin_post_aptf_restore_settings', array($this, 'aptf_restore_settings')); //action to restore default settings
55
+ add_filter( 'plugin_row_meta', array( $this, 'aptf_plugin_row_meta' ), 10, 2 );
56
  add_action('admin_post_aptf_delete_cache', array($this, 'aptf_delete_cache')); //action to delete cache
57
  add_shortcode('ap-twitter-feed', array($this, 'feed_shortcode')); //registers shortcode to display the feeds
58
  add_shortcode('ap-twitter-feed-slider', array($this, 'feed_slider_shortcode')); //registers shortcode to display the feeds as slider
84
  * Adds plugin's menu in the admin section
85
  */
86
  function add_plugin_admin_menu() {
87
+ add_menu_page(__('WP TFeed', 'accesspress-twitter-feed'), __('WP TFeed', 'accesspress-twitter-feed'), 'manage_options', 'ap-twitter-feed', array($this, 'main_setting_page'), 'dashicons-twitter');
88
  }
89
 
90
  /**
299
  $tweets = (isset($aptf_settings['disable_cache']) && $aptf_settings['disable_cache']==1)?false:$tweets;
300
  if (false === $tweets) {
301
  $aptf_settings = $this->aptf_settings;
302
+ $consumer_key = esc_attr($aptf_settings['consumer_key']);
303
+ $consumer_secret = esc_attr($aptf_settings['consumer_secret']);
304
+ $access_token = esc_attr($aptf_settings['access_token']);
305
+ $access_token_secret = esc_attr($aptf_settings['access_token_secret']);
306
  $oauth_connection = $this->get_oauth_connection($consumer_key, $consumer_secret, $access_token, $access_token_secret);
307
  $api_url = "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$username."&count=".$tweets_number.'&exclude_replies=true';
308
  $tweets = $oauth_connection->get(apply_filters('aptf_api_url',$api_url,$username,$tweets_number));
309
+ $cache_period = intval(esc_attr($aptf_settings['cache_period'])) * 60;
310
  $cache_period = ($cache_period < 1) ? 3600 : $cache_period;
311
  if(!isset($tweets->errors)){
312
  set_transient('aptf_tweets', $tweets, $cache_period);
321
  return preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.-]*(\?\S+)?)?)?)@', '<a href="$1" target="_blank">$1</a>', $s);
322
  }
323
 
324
+ function aptf_plugin_row_meta( $links, $file )
325
+ {
326
+ if ( strpos( $file, 'accesspress-twitter-feed.php' ) !== false )
327
+ {
328
+ $new_links = array(
329
+ 'demo' => '<a href="https://demo.accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/" target="_blank"><span class="dashicons dashicons-welcome-view-site"></span>Live Demo</a>',
330
+ 'doc' => '<a href="https://accesspressthemes.com/documentation/documentation-plugin-instruction-accesspress-twitter-feed-pro/" target="_blank"><span class="dashicons dashicons-media-document"></span>Documentation</a>',
331
+ 'support' => '<a href="http://accesspressthemes.com/support" target="_blank"><span class="dashicons dashicons-admin-users"></span>Support</a>',
332
+ 'pro' => '<a href="https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-twitter-feed-pro%2F11029697" target="_blank"><span class="dashicons dashicons-cart"></span>Premium version</a>'
333
+ );
334
+
335
+ $links = array_merge( $links, $new_links );
336
+ }
337
+
338
+ return $links;
339
+ }
340
 
341
+ public function aptf_admin_footer_text($text)
342
+ {
343
+ if ( $_GET['page'] == 'ap-twitter-feed' ) {
344
+ $link = 'https://wordpress.org/support/plugin/accesspress-twitter-feed/reviews/#new-post';
345
+ $pro_link = 'https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-twitter-feed-pro%2F11029697';
346
+ $text = 'Enjoyed WP TFeed? <a href="' . $link . '" target="_blank">Please leave us a ★★★★★ rating</a> We really appreciate your support! | Try premium version of <a href="' . $pro_link . '" target="_blank">Accesspress Twitter Feed Pro</a> - more features, more power!';
347
+ return $text;
348
+ } else {
349
+ return $text;
350
+ }
351
+ }
352
+
353
+ /**
354
+ * Sanitizes Multi-Dimensional Array
355
+ * @param array $array
356
+ * @param array $sanitize_rule
357
+ * @return array
358
+ *
359
+ * @since 1.6.0
360
+ */
361
+ function sanitize_array($array = array(), $sanitize_rule = array())
362
+ {
363
+ if (!is_array($array) || count($array) == 0)
364
+ {
365
+ return array();
366
+ }
367
+
368
+ foreach ($array as $k => $v) {
369
+ if (!is_array($v)) {
370
+ $default_sanitize_rule = (is_numeric($k)) ? 'html' : 'text';
371
+ $sanitize_type = isset($sanitize_rule[$k]) ? $sanitize_rule[$k] : $default_sanitize_rule;
372
+ $array[$k] = self:: sanitize_value($v, $sanitize_type);
373
+ }
374
+
375
+ if (is_array($v)) {
376
+ $array[$k] = self:: sanitize_array($v, $sanitize_rule);
377
+ }
378
+ }
379
 
380
+ return $array;
381
+ }
382
+
383
+ /**
384
+ * Sanitizes Value
385
+ *
386
+ * @param type $value
387
+ * @param type $sanitize_type
388
+ * @return string
389
+ *
390
+ * @since 1.6.0
391
+ */
392
+ function sanitize_value($value = '', $sanitize_type = 'html')
393
+ {
394
+ switch ($sanitize_type)
395
+ {
396
+ case 'text':
397
+ $allowed_html = wp_kses_allowed_html('post');
398
+ // var_dump($allowed_html);
399
+ return wp_kses($value, $allowed_html);
400
+ break;
401
+ default:
402
+ return sanitize_text_field($value);
403
+ break;
404
+ }
405
+ }
406
  }
407
 
408
  /**
images/Thumbs.db DELETED
Binary file
images/{upgrade-1.jpg → upgrade-3.jpg} RENAMED
File without changes
images/{upgrade-2.jpg → upgrade-4.jpg} RENAMED
File without changes
images/upgrade-features.png ADDED
Binary file
images/upgrade.png ADDED
Binary file
inc/backend/boards/about.php CHANGED
@@ -1,18 +1,24 @@
1
  <div class="aptf-single-board-wrapper" id="aptf-about-board" style="display: none">
2
  <h3><?php _e('About', 'accesspress-twitter-feed'); ?></h3>
3
 
4
- <p><strong>AccessPress Twitter Feed </strong> - is a FREE WordPress Plugin by AccessPress Themes. </p>
5
 
6
  <p>AccessPress Themes is a venture of Access Keys - who has developed hundreds of Custom WordPress themes and plugins for its clients over the years. </p>
7
 
8
- <p><strong>AccessPress Twitter Feed</strong> is a <strong>FREE</strong> <strong>Twitter plugin</strong> for <strong>WordPress</strong>. It just takes a few minute to set it up and use. Start strong Twitter integration right on your website and increase your social reach to next level.</p>
9
  <div class="halfseperator"></div>
10
  <p><strong>Please visit our product page for more details here:</strong><br />
11
  <a href="https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed/" target="_blank">https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed/</a></p>
12
  <div class="halfseperator"></div>
13
-
 
14
  <div class="halfseperator"></div>
 
 
15
 
 
 
 
16
 
17
  <h3>More From AccessPress themes </h3>
18
  <ul class="aptf-more-products-wrap">
1
  <div class="aptf-single-board-wrapper" id="aptf-about-board" style="display: none">
2
  <h3><?php _e('About', 'accesspress-twitter-feed'); ?></h3>
3
 
4
+ <p><strong>WP TFeed </strong> - is a FREE WordPress Plugin by AccessPress Themes. </p>
5
 
6
  <p>AccessPress Themes is a venture of Access Keys - who has developed hundreds of Custom WordPress themes and plugins for its clients over the years. </p>
7
 
8
+ <p><strong>WP TFeed</strong> is a <strong>FREE</strong> <strong>Twitter plugin</strong> for <strong>WordPress</strong>. It just takes a few minute to set it up and use. Start strong Twitter integration right on your website and increase your social reach to next level.</p>
9
  <div class="halfseperator"></div>
10
  <p><strong>Please visit our product page for more details here:</strong><br />
11
  <a href="https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed/" target="_blank">https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed/</a></p>
12
  <div class="halfseperator"></div>
13
+ <p><strong>Please visit our demo page here:</strong><br />
14
+ <a href="https://demo.accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed/" target="_blank">https://demo.accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed/</a></p>
15
  <div class="halfseperator"></div>
16
+ <p><strong>Plugin documentation can be found here:</strong><br />
17
+ <a href="https://accesspressthemes.com/documentation/documentation-plugin-instruction-accesspress-twitter-feed/" target="_blank">https://accesspressthemes.com/documentation/documentation-plugin-instruction-accesspress-twitter-feed/</a></p>
18
 
19
+ <h3>Premium Upgrade</h3>
20
+ <p><strong>For premium upgrade please visit here:</strong><br />
21
+ <a href="https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/" target="_blank">https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/</a></p>
22
 
23
  <h3>More From AccessPress themes </h3>
24
  <ul class="aptf-more-products-wrap">
inc/backend/boards/how-to-use.php CHANGED
@@ -1,13 +1,13 @@
1
  <div class="aptf-single-board-wrapper" id="aptf-how_to_use-board" style="display:none">
2
  <h3><?php _e('How to use', 'accesspress-twitter-feed'); ?></h3>
3
- <p>There are two methods to display your Twitter Feeds in your site using AccessPress Twitter Feed Plugin.</p>
4
  <h4>Normal Feeds</h4>
5
- <p>For displaying Twitter Feeds in normal manner, you can use <br/><br/>[ap-twitter-feed]<br/><br/> shortcode or AccessPress Twitter Feed Widget in any registered widget area from Appearance Widget Section.You can also pass template parameter in the shortcode such as <br/>
6
  [ap-twitter-feed template="template-1/template-2/template-3"]</p>
7
 
8
  <h4>Feeds In Slider</h4>
9
  <p>To display the twitter feeds, you can either use <br/><br/>
10
- [ap-twitter-feed-slider] <br/><br/> <strong>Shortcode</strong> or <strong>AccessPress Twitter Feed Widget</strong> in any registered widget area from Appearance Widget Section.You can use template parameter in this shortcode too.</p>
11
  <p>Extra parameters that you can pass in slider shortcode are auto_slide="true/false" slide_duration="any duration in milliseconds:e.g: 1000" and controls="true/false"</p>
12
  <p>
13
  [ap-twitter-feed-slider controls="true" slide_duration="2000" auto_slide="true"]
1
  <div class="aptf-single-board-wrapper" id="aptf-how_to_use-board" style="display:none">
2
  <h3><?php _e('How to use', 'accesspress-twitter-feed'); ?></h3>
3
+ <p>There are two methods to display your Twitter Feeds in your site using WP TFeed.</p>
4
  <h4>Normal Feeds</h4>
5
+ <p>For displaying Twitter Feeds in normal manner, you can use <br/><br/>[ap-twitter-feed]<br/><br/> shortcode or WP TFeed Widget in any registered widget area from Appearance Widget Section.You can also pass template parameter in the shortcode such as <br/>
6
  [ap-twitter-feed template="template-1/template-2/template-3"]</p>
7
 
8
  <h4>Feeds In Slider</h4>
9
  <p>To display the twitter feeds, you can either use <br/><br/>
10
+ [ap-twitter-feed-slider] <br/><br/> <strong>Shortcode</strong> or <strong>WP TFeed Widget</strong> in any registered widget area from Appearance Widget Section.You can use template parameter in this shortcode too.</p>
11
  <p>Extra parameters that you can pass in slider shortcode are auto_slide="true/false" slide_duration="any duration in milliseconds:e.g: 1000" and controls="true/false"</p>
12
  <p>
13
  [ap-twitter-feed-slider controls="true" slide_duration="2000" auto_slide="true"]
inc/backend/boards/main-settings.php CHANGED
@@ -31,14 +31,14 @@
31
  <div class="aptf-option-wrapper">
32
  <label><?php _e('Twitter Username','accesspress-twitter-feed');?></label>
33
  <div class="aptf-option-field">
34
- <input type="text" name="twitter_username" value="<?php echo isset($aptf_settings['twitter_username']) ? $aptf_settings['twitter_username'] : ''; ?>" placeholder="e.g: @apthemes"/>
35
  <div class="aptf-option-note"><?php _e('Please enter the username of twitter account from which the feeds need to be fetched.For example:@apthemes', 'accesspress-twitter-feed'); ?></div>
36
  </div>
37
  </div>
38
  <div class="aptf-option-wrapper">
39
  <label><?php _e('Twitter Account Name','accesspress-twitter-feed');?></label>
40
  <div class="aptf-option-field">
41
- <input type="text" name="twitter_account_name" value="<?php echo isset($aptf_settings['twitter_account_name']) ? $aptf_settings['twitter_account_name'] : ''; ?>" placeholder="e.g: AccessPress Themes"/>
42
  <div class="aptf-option-note"><?php _e('Please enter the account name to be displayed.For example:AccessPress Themes', 'accesspress-twitter-feed'); ?></div>
43
  </div>
44
  </div>
31
  <div class="aptf-option-wrapper">
32
  <label><?php _e('Twitter Username','accesspress-twitter-feed');?></label>
33
  <div class="aptf-option-field">
34
+ <input type="text" name="twitter_username" value="<?php echo isset($aptf_settings['twitter_username']) ? esc_attr($aptf_settings['twitter_username']) : ''; ?>" placeholder="e.g: @apthemes"/>
35
  <div class="aptf-option-note"><?php _e('Please enter the username of twitter account from which the feeds need to be fetched.For example:@apthemes', 'accesspress-twitter-feed'); ?></div>
36
  </div>
37
  </div>
38
  <div class="aptf-option-wrapper">
39
  <label><?php _e('Twitter Account Name','accesspress-twitter-feed');?></label>
40
  <div class="aptf-option-field">
41
+ <input type="text" name="twitter_account_name" value="<?php echo isset($aptf_settings['twitter_account_name']) ? esc_attr($aptf_settings['twitter_account_name']) : ''; ?>" placeholder="e.g: AccessPress Themes"/>
42
  <div class="aptf-option-note"><?php _e('Please enter the account name to be displayed.For example:AccessPress Themes', 'accesspress-twitter-feed'); ?></div>
43
  </div>
44
  </div>
inc/backend/boards/more-wp.php CHANGED
@@ -1,17 +1,19 @@
1
- <div class="aptf-single-board-wrapper" id="aptf-morewp-board" style="display: none">
 
2
  <div>
3
- <p><strong>AccessPress Twitter Feed</strong> works best with every WordPress theme. It's even more remarkable when used with popular themes like VMagazine and AccessPress Parallax.</p>
4
 
5
- <p>AND IF THIS PLUGIN HAS IMPRESSED YOU, THEN YOU WOULD ENJOY OUR OTHER PROJECTS TOO. DO CHECK THESE OUT :</p>
6
 
7
- <p><a href="https://wpall.club/">WPAll Club</a> - A complete WordPress resources club. WordPress tutorials, blogs, curated free and premium themes and plugins, WordPress deals, offers, hosting info and more.</p>
8
 
9
- <p> <a href="https://themeforest.net/user/accesskeys/portfolio">Premium WordPress Themes</a> - <strong>6 premium WordPress</strong> themes well suited for all sort of websites. Professional, well coded and highly configurable themes for you. </p>
10
 
11
- <p> <a href="https://codecanyon.net/user/accesskeys/portfolio?Ref=AccessKeys">Premium WordPress Plugins</a> - <strong>45+ premium WordPress plugins</strong> of many different types. High user ratings, great quality and best sellers in CodeCanyon marketplace. </p>
12
-
13
- <p> <a href="https://accesspressthemes.com/">AccessPress Themes</a> - <strong>AccessPress Themes</strong> has 50+ beautiful and elegant, fully responsive, multipurpose themes to meet your need for free and commercial basis.</p>
14
-
15
- <p> <a href="https://8degreethemes.com/">8Degree Themes</a> - <strong>8Degree Themes</strong> offers 15+ free WordPress themes and 16+ premium WordPress themes carefully crafted with creativity.</p>
16
- </div>
 
17
  </div>
1
+ <div class="aptf-single-board-wrapper" id="aptf-morewp-board" style="display:none">
2
+ <h3><?php _e('More WordPress Resources', 'accesspress-twitter-feed'); ?></h3>
3
  <div>
4
+ <p><strong>WP TFeed</strong> works best with every WordPress theme. It's even more remarkable when used with popular themes like VMagazine and AccessPress Parallax.</p>
5
 
6
+ <p>AND IF THIS PLUGIN HAS IMPRESSED YOU, THEN YOU WOULD ENJOY OUR OTHER PROJECTS TOO. DO CHECK THESE OUT :</p>
7
 
8
+ <p><a href="https://wpall.club/">WPAll Club</a> - A complete WordPress resources club. WordPress tutorials, blogs, curated free and premium themes and plugins, WordPress deals, offers, hosting info and more.</p>
9
 
10
+ <p> <a href="https://themeforest.net/user/accesskeys/portfolio">Premium WordPress Themes</a> - <strong>6 premium WordPress</strong> themes well suited for all sort of websites. Professional, well coded and highly configurable themes for you. </p>
11
 
12
+ <p> <a href="https://codecanyon.net/user/accesskeys/portfolio?Ref=AccessKeys">Premium WordPress Plugins</a> - <strong>45+ premium WordPress plugins</strong> of many different types. High user ratings, great quality and best sellers in CodeCanyon marketplace. </p>
13
+
14
+ <p> <a href="https://accesspressthemes.com/">AccessPress Themes</a> - <strong>AccessPress Themes</strong> has 50+ beautiful and elegant, fully responsive, multipurpose themes to meet your need for free and commercial basis.</p>
15
+
16
+ <p> <a href="https://8degreethemes.com/">8Degree Themes</a> - <strong>8Degree Themes</strong> offers 15+ free WordPress themes and 16+ premium WordPress themes carefully crafted with creativity.</p>
17
+ </div>
18
+
19
  </div>
inc/backend/header.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="aptf-header-wrapper">
2
  <div class="apsc-logo">
3
- <img src="<?php echo APTF_IMAGE_DIR; ?>/logo.png" alt="<?php esc_attr_e('AccessPress Twitter FEED', 'accesspress-twitter-feed'); ?>" />
4
  </div>
5
 
6
  <div class="apsc-socials">
@@ -22,5 +22,5 @@
22
 
23
  </div>
24
  </div>
25
- <div class="apsc-title"><?php _e('AccessPress Twitter Feed', 'accesspress-twitter-feed'); ?></div>
26
  </div>
1
  <div class="aptf-header-wrapper">
2
  <div class="apsc-logo">
3
+ <img src="<?php echo APTF_IMAGE_DIR; ?>/logo.png" alt="<?php esc_attr_e('WP TFeed', 'accesspress-twitter-feed'); ?>" />
4
  </div>
5
 
6
  <div class="apsc-socials">
22
 
23
  </div>
24
  </div>
25
+ <div class="apsc-title"><?php _e('WP TFeed', 'accesspress-twitter-feed'); ?></div>
26
  </div>
inc/backend/save-settings.php CHANGED
@@ -15,26 +15,30 @@
15
  [_wp_http_referer] => /accesspress-twitter-feed/wp-admin/admin.php?page=ap-twitter-feed
16
  [aptf_settings_submit] => Save Settings
17
  */
18
- foreach ($_POST as $key => $val) {
19
- $$key = sanitize_text_field($val);
20
- }
21
 
22
- $aptf_settings = array('consumer_key' => $consumer_key,
23
- 'consumer_secret' => $consumer_secret,
24
- 'access_token' => $access_token,
25
- 'access_token_secret' => $access_token_secret,
26
- 'twitter_username' => $twitter_username,
27
- 'twitter_account_name'=>$twitter_account_name,
28
- 'cache_period' => $cache_period,
29
- 'total_feed' => $total_feed,
30
- 'feed_template' => $feed_template,
31
- 'time_format' => $time_format,
32
- 'display_username' => isset($display_username)?1:0,
33
- 'display_twitter_actions'=>isset($display_twitter_actions)?1:0,
34
- 'fallback_message'=>$fallback_message,
35
- 'display_follow_button'=>isset($display_follow_button)?1:0,
36
- 'disable_cache'=>isset($disable_cache)?1:0
 
 
 
37
  );
 
38
  $aptf_settings = apply_filters('aptf_settings',$aptf_settings);
39
  update_option('aptf_settings', $aptf_settings);
40
  wp_redirect(admin_url().'admin.php?page=ap-twitter-feed&message=1');
15
  [_wp_http_referer] => /accesspress-twitter-feed/wp-admin/admin.php?page=ap-twitter-feed
16
  [aptf_settings_submit] => Save Settings
17
  */
18
+ // foreach ($_POST as $key => $val) {
19
+ // $$key = sanitize_text_field($val);
20
+ // }
21
 
22
+ $aptfl_settings_sanitized = array();
23
+ $aptfl_settings_sanitized = stripslashes_deep( $this->sanitize_array( $_POST ) );
24
+
25
+ $aptf_settings = array('consumer_key' => $aptfl_settings_sanitized['consumer_key'],
26
+ 'consumer_secret' => $aptfl_settings_sanitized['consumer_secret'],
27
+ 'access_token' => $aptfl_settings_sanitized['access_token'],
28
+ 'access_token_secret' => $aptfl_settings_sanitized['access_token_secret'],
29
+ 'twitter_username' => $aptfl_settings_sanitized['twitter_username'],
30
+ 'twitter_account_name'=>$aptfl_settings_sanitized['twitter_account_name'],
31
+ 'cache_period' => $aptfl_settings_sanitized['cache_period'],
32
+ 'total_feed' => $aptfl_settings_sanitized['total_feed'],
33
+ 'feed_template' => $aptfl_settings_sanitized['feed_template'],
34
+ 'time_format' => $aptfl_settings_sanitized['time_format'],
35
+ 'display_username' => isset($aptfl_settings_sanitized['display_username'])?1:0,
36
+ 'display_twitter_actions'=>isset($aptfl_settings_sanitized['display_twitter_actions'])?1:0,
37
+ 'fallback_message'=>$aptfl_settings_sanitized['fallback_message'],
38
+ 'display_follow_button'=>isset($aptfl_settings_sanitized['display_follow_button'])?1:0,
39
+ 'disable_cache'=>isset($aptfl_settings_sanitized['disable_cache'])?1:0
40
  );
41
+
42
  $aptf_settings = apply_filters('aptf_settings',$aptf_settings);
43
  update_option('aptf_settings', $aptf_settings);
44
  wp_redirect(admin_url().'admin.php?page=ap-twitter-feed&message=1');
inc/backend/settings.php CHANGED
@@ -12,6 +12,8 @@ $aptf_settings = $this->aptf_settings;
12
  <li><a href="javascript:void(0)" id="aptf-about-trigger" class="aptf-tabs-trigger"><?php _e('About', APTF_VERSION); ?></a></li>
13
  <li><a href="https://wordpress.org/support/view/plugin-reviews/accesspress-twitter-feed" target="_blank"><?php _e('Give us a rating', APTF_VERSION); ?></a></li>
14
  <li><a href="javascript:void(0)" id="aptf-morewp-trigger" class="aptf-tabs-trigger"><?php _e('More WordPress Resources', APTF_VERSION); ?></a></li>
 
 
15
  </ul>
16
  </div>
17
  <div class="aptf-board-wrapper">
@@ -70,16 +72,18 @@ $aptf_settings = $this->aptf_settings;
70
  </div>
71
  </div>
72
  <div class="aptf-promo">
73
- <a href="http://codecanyon.net/item/accesspress-twitter-feed-pro/11029697?ref=AccessKeys" target="_blank"><img src="<?php echo APTF_IMAGE_DIR . '/upgrade-1.jpg' ?>"/></a>
74
  <div class="aptf-promo-actions">
75
  <a href="http://demo.accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/" title="Demo" target="_blank"><input type="button" class="aptf-demo-btn" value="Demo"/></a>
76
- <a href="http://codecanyon.net/item/accesspress-twitter-feed-pro/11029697?ref=AccessKeys" title="Upgrade" target="_blank"><input type="button" class="aptf-upgrade-btn" value="Upgrade"/></a>
 
77
  </div>
78
 
79
- <a href="http://codecanyon.net/item/accesspress-twitter-feed-pro/11029697?ref=AccessKeys" target="_blank"><img src="<?php echo APTF_IMAGE_DIR . '/upgrade-2.jpg' ?>"/></a>
80
  <div class="aptf-promo-actions">
81
  <a href="http://demo.accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/" title="Demo" target="_blank"><input type="button" class="aptf-demo-btn" value="Demo"/></a>
82
- <a href="http://codecanyon.net/item/accesspress-twitter-feed-pro/11029697?ref=AccessKeys" title="Upgrade" target="_blank"><input type="button" class="aptf-upgrade-btn" value="Upgrade"/></a>
 
83
  </div>
84
  </div>
85
  </div>
12
  <li><a href="javascript:void(0)" id="aptf-about-trigger" class="aptf-tabs-trigger"><?php _e('About', APTF_VERSION); ?></a></li>
13
  <li><a href="https://wordpress.org/support/view/plugin-reviews/accesspress-twitter-feed" target="_blank"><?php _e('Give us a rating', APTF_VERSION); ?></a></li>
14
  <li><a href="javascript:void(0)" id="aptf-morewp-trigger" class="aptf-tabs-trigger"><?php _e('More WordPress Resources', APTF_VERSION); ?></a></li>
15
+ <li><a href="https://accesspressthemes.com/documentation/accesspress-twitter-feed/" target="_blank" class="aptf-tabs-trigger"><?php _e('Documentation', APTF_VERSION); ?></a></li>
16
+ <li><a href="https://demo.accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/" target="_blank" class="aptf-tabs-trigger"><?php _e('Check Premium Versions', APTF_VERSION); ?></a></li>
17
  </ul>
18
  </div>
19
  <div class="aptf-board-wrapper">
72
  </div>
73
  </div>
74
  <div class="aptf-promo">
75
+ <a href="https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-twitter-feed-pro%2F11029697" target="_blank"><img src="<?php echo APTF_IMAGE_DIR . '/upgrade.png' ?>"/></a>
76
  <div class="aptf-promo-actions">
77
  <a href="http://demo.accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/" title="Demo" target="_blank"><input type="button" class="aptf-demo-btn" value="Demo"/></a>
78
+ <a href="https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-twitter-feed-pro%2F11029697" title="Upgrade" target="_blank"><input type="button" class="aptf-upgrade-btn" value="Upgrade"/></a>
79
+ <a href='https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/' title="Plugin Information" target="_blank"><input type="button" class="aptf-demo-btn" value="Plugin Information"/></a>
80
  </div>
81
 
82
+ <a href="https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-twitter-feed-pro%2F11029697" target="_blank"><img src="<?php echo APTF_IMAGE_DIR . '/upgrade-features.png' ?>"/></a>
83
  <div class="aptf-promo-actions">
84
  <a href="http://demo.accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/" title="Demo" target="_blank"><input type="button" class="aptf-demo-btn" value="Demo"/></a>
85
+ <a href="https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-twitter-feed-pro%2F11029697" title="Upgrade" target="_blank"><input type="button" class="aptf-upgrade-btn" value="Upgrade"/></a>
86
+ <a href='https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/' title="Plugin Information" target="_blank"><input type="button" class="aptf-demo-btn" value="Plugin Information"/></a>
87
  </div>
88
  </div>
89
  </div>
inc/backend/slider-widget.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  defined('ABSPATH') or die("No script kiddies please!");
3
  /**
4
- * Adds AccessPress Twitter Feed Widget
5
  */
6
  class APTF_Slider_Widget extends WP_Widget {
7
 
@@ -11,8 +11,8 @@ class APTF_Slider_Widget extends WP_Widget {
11
  function __construct() {
12
  parent::__construct(
13
  'aptf_slider_widget', // Base ID
14
- __('AccessPress Tweets Slider', 'accesspress-twitter-feed'), // Name
15
- array('description' => __('AccessPress Tweets Slider Widget', 'accesspress-twitter-feed')) // Args
16
  );
17
  }
18
 
@@ -30,10 +30,10 @@ class APTF_Slider_Widget extends WP_Widget {
30
  if (!empty($instance['title'])) {
31
  echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
32
  }
33
- $controls = isset($instance['controls'])?$instance['controls']:false;
34
- $slide_duration = (isset($instance['slide_duration'])&& $instance['slide_duration']!='')?$instance['slide_duration']:'1500';
35
- $auto_slide = isset($instance['auto_slide'])?$instance['auto_slide']:false;
36
- $template = isset($instance['template'])?$instance['template']:'template-1';
37
  $follow_button = (isset($instance['follow_button']) && $instance['follow_button']==1)?'true':'false';
38
  echo do_shortcode('[ap-twitter-feed-slider auto_slide="'.$auto_slide.'" controls="'.$controls.'" slide_duration="'.$slide_duration.'" follow_button="'.$follow_button.'" template="'.$template.'"]');
39
  echo $args['after_widget'];
@@ -47,12 +47,12 @@ class APTF_Slider_Widget extends WP_Widget {
47
  * @param array $instance Previously saved values from database.
48
  */
49
  public function form($instance) {
50
- $title = isset($instance['title'])?$instance['title']:'';
51
- $controls = (isset($instance['controls']))?$instance['controls']:0;
52
- $slide_duration = (isset($instance['slide_duration']))?$instance['slide_duration']:'';
53
- $auto_slide = (isset($instance['auto_slide']))?$instance['auto_slide']:0;
54
- $template = isset($instance['template'])?$instance['template']:'template-1';
55
- $follow_button = isset($instance['follow_button'])?$instance['follow_button']:0;
56
 
57
  ?>
58
  <p>
@@ -102,12 +102,12 @@ class APTF_Slider_Widget extends WP_Widget {
102
  // echo "<pre>";
103
  // die(print_r($new_instance,true));
104
  $instance = array();
105
- $instance['title'] = isset($new_instance['title'])?strip_tags($new_instance['title']):'';
106
- $instance['slide_duration'] = isset($new_instance['slide_duration'])?sanitize_text_field($new_instance['slide_duration']):'';
107
- $instance['template'] = isset($new_instance['template'])?$new_instance['template']:'';
108
- $instance['controls'] = isset($new_instance['controls'])?$new_instance['controls']:0;
109
- $instance['auto_slide'] = isset($new_instance['auto_slide'])?$new_instance['auto_slide']:0;
110
- $instance['follow_button'] = isset($new_instance['follow_button'])?$new_instance['follow_button']:0;
111
 
112
  return $instance;
113
  }
1
  <?php
2
  defined('ABSPATH') or die("No script kiddies please!");
3
  /**
4
+ * Adds WP TFeed Widget
5
  */
6
  class APTF_Slider_Widget extends WP_Widget {
7
 
11
  function __construct() {
12
  parent::__construct(
13
  'aptf_slider_widget', // Base ID
14
+ __('WP TFeed Slider', 'accesspress-twitter-feed'), // Name
15
+ array('description' => __('WP TFeed Slider Widget', 'accesspress-twitter-feed')) // Args
16
  );
17
  }
18
 
30
  if (!empty($instance['title'])) {
31
  echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
32
  }
33
+ $controls = isset($instance['controls'])?esc_attr($instance['controls']):false;
34
+ $slide_duration = (isset($instance['slide_duration'])&& $instance['slide_duration']!='')?esc_attr($instance['slide_duration']):'1500';
35
+ $auto_slide = isset($instance['auto_slide'])?esc_attr($instance['auto_slide']):false;
36
+ $template = isset($instance['template'])?esc_attr($instance['template']):'template-1';
37
  $follow_button = (isset($instance['follow_button']) && $instance['follow_button']==1)?'true':'false';
38
  echo do_shortcode('[ap-twitter-feed-slider auto_slide="'.$auto_slide.'" controls="'.$controls.'" slide_duration="'.$slide_duration.'" follow_button="'.$follow_button.'" template="'.$template.'"]');
39
  echo $args['after_widget'];
47
  * @param array $instance Previously saved values from database.
48
  */
49
  public function form($instance) {
50
+ $title = isset($instance['title'])?esc_attr($instance['title']):'';
51
+ $controls = (isset($instance['controls']))?esc_attr($instance['controls']):0;
52
+ $slide_duration = (isset($instance['slide_duration']))?esc_attr($instance['slide_duration']):'';
53
+ $auto_slide = (isset($instance['auto_slide']))?esc_attr($instance['auto_slide']):0;
54
+ $template = isset($instance['template'])?esc_attr($instance['template']):'template-1';
55
+ $follow_button = isset($instance['follow_button'])?esc_attr($instance['follow_button']):0;
56
 
57
  ?>
58
  <p>
102
  // echo "<pre>";
103
  // die(print_r($new_instance,true));
104
  $instance = array();
105
+ $instance['title'] = isset($new_instance['title'])?esc_attr($new_instance['title']):'';
106
+ $instance['slide_duration'] = isset($new_instance['slide_duration'])?esc_attr($new_instance['slide_duration']):'';
107
+ $instance['template'] = isset($new_instance['template'])?esc_attr($new_instance['template']):'';
108
+ $instance['controls'] = isset($new_instance['controls'])?esc_attr($new_instance['controls']):0;
109
+ $instance['auto_slide'] = isset($new_instance['auto_slide'])?esc_attr($new_instance['auto_slide']):0;
110
+ $instance['follow_button'] = isset($new_instance['follow_button'])?esc_attr($new_instance['follow_button']):0;
111
 
112
  return $instance;
113
  }
inc/backend/widget.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  defined('ABSPATH') or die("No script kiddies please!");
3
  /**
4
- * Adds AccessPress Twitter Feed Widget
5
  */
6
  class APTF_Widget extends WP_Widget {
7
 
@@ -11,8 +11,8 @@ class APTF_Widget extends WP_Widget {
11
  function __construct() {
12
  parent::__construct(
13
  'aptf_widget', // Base ID
14
- __('AccessPress Twitter Feeds', 'accesspress-twitter-feed'), // Name
15
- array('description' => __('AccessPress Twitter Feed Widget', 'accesspress-twitter-feed')) // Args
16
  );
17
  }
18
 
@@ -28,11 +28,11 @@ class APTF_Widget extends WP_Widget {
28
  $follow_button = (isset($instance['follow_button']) && $instance['follow_button']==1)?'true':'false';
29
  echo $args['before_widget'];
30
  if (!empty($instance['title'])) {
31
- echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
32
  }
33
 
34
  if(isset($instance['template']) && $instance['template']!=''){
35
- echo do_shortcode('[ap-twitter-feed template="'.$instance['template'].'" follow_button="'.$follow_button.'"]');
36
  }else
37
  {
38
  echo do_shortcode('[ap-twitter-feed follow_button="'.$follow_button.'"]');
@@ -48,9 +48,9 @@ class APTF_Widget extends WP_Widget {
48
  * @param array $instance Previously saved values from database.
49
  */
50
  public function form($instance) {
51
- $title = isset($instance['title'])?$instance['title']:'';
52
- $template = isset($instance['template'])?$instance['template']:'';
53
- $follow_button = isset($instance['follow_button'])?$instance['follow_button']:0;
54
 
55
  ?>
56
  <p>
@@ -88,9 +88,9 @@ class APTF_Widget extends WP_Widget {
88
  public function update($new_instance, $old_instance) {
89
  //die(print_r($new_instance));
90
  $instance = array();
91
- $instance['title'] = (!empty($new_instance['title']) ) ? strip_tags($new_instance['title']): '';
92
- $instance['template'] = (!empty($new_instance['template']) ) ? strip_tags($new_instance['template']): '';
93
- $instance['follow_button'] = isset($new_instance['follow_button'])?$new_instance['follow_button']:0;
94
  return $instance;
95
  }
96
 
1
  <?php
2
  defined('ABSPATH') or die("No script kiddies please!");
3
  /**
4
+ * Adds WP TFeed Widget
5
  */
6
  class APTF_Widget extends WP_Widget {
7
 
11
  function __construct() {
12
  parent::__construct(
13
  'aptf_widget', // Base ID
14
+ __('WP TFeed', 'accesspress-twitter-feed'), // Name
15
+ array('description' => __('WP TFeed Widget', 'accesspress-twitter-feed')) // Args
16
  );
17
  }
18
 
28
  $follow_button = (isset($instance['follow_button']) && $instance['follow_button']==1)?'true':'false';
29
  echo $args['before_widget'];
30
  if (!empty($instance['title'])) {
31
+ echo $args['before_title'] . apply_filters('widget_title', esc_attr($instance['title'])) . $args['after_title'];
32
  }
33
 
34
  if(isset($instance['template']) && $instance['template']!=''){
35
+ echo do_shortcode('[ap-twitter-feed template="'.esc_attr($instance['template']).'" follow_button="'.$follow_button.'"]');
36
  }else
37
  {
38
  echo do_shortcode('[ap-twitter-feed follow_button="'.$follow_button.'"]');
48
  * @param array $instance Previously saved values from database.
49
  */
50
  public function form($instance) {
51
+ $title = isset($instance['title'])?esc_attr($instance['title']):'';
52
+ $template = isset($instance['template'])?esc_attr($instance['template']):'';
53
+ $follow_button = isset($instance['follow_button'])?esc_attr($instance['follow_button']):0;
54
 
55
  ?>
56
  <p>
88
  public function update($new_instance, $old_instance) {
89
  //die(print_r($new_instance));
90
  $instance = array();
91
+ $instance['title'] = (!empty($new_instance['title']) ) ? esc_attr($new_instance['title']): '';
92
+ $instance['template'] = (!empty($new_instance['template']) ) ? esc_attr($new_instance['template']): '';
93
+ $instance['follow_button'] = isset($new_instance['follow_button'])?esc_attr($new_instance['follow_button']):0;
94
  return $instance;
95
  }
96
 
inc/frontend/shortcode.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  $aptf_settings = $this->aptf_settings;
3
  $username = $aptf_settings['twitter_username'];
4
- $display_name = isset($aptf_settings['twitter_account_name']) ? $aptf_settings['twitter_account_name'] : '' ;
5
  //$tweets = $this->get_tweets($username, $aptf_settings['total_feed']);
6
  $tweets = $this->get_twitter_tweets($username, $aptf_settings['total_feed']);
7
  //$this->print_array($tweets);
@@ -19,7 +19,7 @@ if(isset($atts['follow_button'])){
19
 
20
  }
21
  if(isset($tweets->errors)){
22
- $fallback_message = ($aptf_settings['fallback_message']=='')?__('Something went wrong with the twitter. Please check your credentials and twitter username in the twitter settings.','accesspress-twitter-feed'):$aptf_settings['fallback_message'];
23
  ?>
24
  <p><?php echo $fallback_message;?></p>
25
  <?php
1
  <?php
2
  $aptf_settings = $this->aptf_settings;
3
  $username = $aptf_settings['twitter_username'];
4
+ $display_name = isset($aptf_settings['twitter_account_name']) ? esc_attr($aptf_settings['twitter_account_name']) : '' ;
5
  //$tweets = $this->get_tweets($username, $aptf_settings['total_feed']);
6
  $tweets = $this->get_twitter_tweets($username, $aptf_settings['total_feed']);
7
  //$this->print_array($tweets);
19
 
20
  }
21
  if(isset($tweets->errors)){
22
+ $fallback_message = ($aptf_settings['fallback_message']=='')?__('Something went wrong with the twitter. Please check your credentials and twitter username in the twitter settings.','accesspress-twitter-feed'):esc_attr($aptf_settings['fallback_message']);
23
  ?>
24
  <p><?php echo $fallback_message;?></p>
25
  <?php
inc/frontend/slider-shortcode.php CHANGED
@@ -2,10 +2,10 @@
2
  $aptf_settings = $this->aptf_settings;
3
  $username = $aptf_settings['twitter_username'];
4
  $tweets = $this->get_twitter_tweets($username, $aptf_settings['total_feed']);
5
- $template = isset($atts['template'])?$atts['template']:'template-1';
6
- $auto_slide = isset($atts['auto_slide'])?$atts['auto_slide']:'true';
7
- $slide_controls = isset($atts['controls'])?$atts['controls']:'true';
8
- $slide_duration = isset($atts['slide_duration'])?$atts['slide_duration']:'3000';
9
  if(isset($atts['follow_button'])){
10
  if($atts['follow_button']=='true'){
11
  $aptf_settings['display_follow_button'] = 1;
@@ -17,7 +17,7 @@ if(isset($atts['follow_button'])){
17
  }
18
  if(isset($tweets->errors)){
19
  //$this->print_array($tweets);
20
- $fallback_message = ($aptf_settings['fallback_message']=='')?__('Something went wrong with the twitter.','accesspress-twitter-feed'):$aptf_settings['fallback_message'];
21
  ?>
22
  <p><?php echo $fallback_message;?></p>
23
  <?php
2
  $aptf_settings = $this->aptf_settings;
3
  $username = $aptf_settings['twitter_username'];
4
  $tweets = $this->get_twitter_tweets($username, $aptf_settings['total_feed']);
5
+ $template = isset($atts['template'])?esc_attr($atts['template']):'template-1';
6
+ $auto_slide = isset($atts['auto_slide'])?esc_attr($atts['auto_slide']):'true';
7
+ $slide_controls = isset($atts['controls'])?esc_attr($atts['controls']):'true';
8
+ $slide_duration = isset($atts['slide_duration'])?esc_attr($atts['slide_duration']):'3000';
9
  if(isset($atts['follow_button'])){
10
  if($atts['follow_button']=='true'){
11
  $aptf_settings['display_follow_button'] = 1;
17
  }
18
  if(isset($tweets->errors)){
19
  //$this->print_array($tweets);
20
+ $fallback_message = ($aptf_settings['fallback_message']=='')?__('Something went wrong with the twitter.','accesspress-twitter-feed'):esc_attr($aptf_settings['fallback_message']);
21
  ?>
22
  <p><?php echo $fallback_message;?></p>
23
  <?php
inc/frontend/templates/default/template-1.php CHANGED
@@ -5,7 +5,6 @@
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
8
- //$this->print_array($tweet);
9
  ?>
10
 
11
  <div class="aptf-single-tweet-wrapper">
@@ -32,16 +31,7 @@
32
  }
33
  }
34
 
35
- // iii. Links in Tweet text must be displayed using the display_url
36
- // field in the URL entities API response, and link to the original t.co url field.
37
- /* if (is_array($tweet->entities->urls)) {
38
- foreach ($tweet->entities->urls as $key => $link) {
39
- $the_tweet = preg_replace(
40
- '`' . $link->url . '`', '<a href="' . $link->url . '" target="_blank">' . $link->url . '</a>', $the_tweet);
41
- }
42
- }
43
- */
44
- echo $the_tweet . ' ';
45
  ?>
46
  </div><!--tweet content-->
47
  <?php if (isset($aptf_settings['display_twitter_actions']) && $aptf_settings['display_twitter_actions'] == 1) { ?>
@@ -50,7 +40,7 @@
50
  <!--Tweet Action -->
51
  <?php } ?>
52
  </div>
53
- <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" class="aptf-tweet-name" target="_blank"><?php echo $username; ?></a> <?php } ?>
54
  <div class="aptf-tweet-date">
55
  <p class="aptf-timestamp">
56
  <a href="https://twitter.com/<?php echo $username; ?>/status/<?php echo $tweet->id_str; ?>" target="_blank"> -
@@ -62,15 +52,11 @@
62
  } else {
63
  ?>
64
 
65
- <p><a href="http://twitter.com/'<?php echo $username; ?> " target="_blank"><?php _e('Click here to read ' . $username . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
66
  <?php
67
  }
68
  ?>
69
 
70
-
71
-
72
-
73
-
74
  </div><!-- single_tweet_wrap-->
75
 
76
 
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
 
8
  ?>
9
 
10
  <div class="aptf-single-tweet-wrapper">
31
  }
32
  }
33
 
34
+ _e($the_tweet) . ' ';
 
 
 
 
 
 
 
 
 
35
  ?>
36
  </div><!--tweet content-->
37
  <?php if (isset($aptf_settings['display_twitter_actions']) && $aptf_settings['display_twitter_actions'] == 1) { ?>
40
  <!--Tweet Action -->
41
  <?php } ?>
42
  </div>
43
+ <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" class="aptf-tweet-name" target="_blank"><?php esc_attr_e($username); ?></a> <?php } ?>
44
  <div class="aptf-tweet-date">
45
  <p class="aptf-timestamp">
46
  <a href="https://twitter.com/<?php echo $username; ?>/status/<?php echo $tweet->id_str; ?>" target="_blank"> -
52
  } else {
53
  ?>
54
 
55
+ <p><a href="http://twitter.com/'<?php echo $username; ?> " target="_blank"><?php _e('Click here to read ' . esc_attr($username) . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
56
  <?php
57
  }
58
  ?>
59
 
 
 
 
 
60
  </div><!-- single_tweet_wrap-->
61
 
62
 
inc/frontend/templates/default/template-2.php CHANGED
@@ -5,12 +5,11 @@
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
8
- //$this->print_array($tweet);
9
  ?>
10
 
11
  <div class="aptf-single-tweet-wrapper">
12
  <div class="aptf-tweet-content">
13
- <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" class="aptf-tweet-name" target="_blank"><?php echo $display_name; ?></a> <span class="aptf-tweet-username"><?php echo $username; ?></span> <?php } ?>
14
  <div class="clear"></div>
15
  <?php
16
  if ($tweet->text) {
@@ -33,17 +32,7 @@
33
  }
34
  }
35
 
36
- // iii. Links in Tweet text must be displayed using the display_url
37
- // field in the URL entities API response, and link to the original t.co url field.
38
- /* if (is_array($tweet->entities->urls)) {
39
- foreach ($tweet->entities->urls as $key => $link) {
40
- $the_tweet = preg_replace(
41
- '`' . $link->url . '`', '<a href="' . $link->url . '" target="_blank">' . $link->url . '</a>', $the_tweet);
42
- }
43
- }
44
- */
45
-
46
- echo $the_tweet . ' ';
47
  ?>
48
  </div><!--tweet content-->
49
  <div class="aptf-tweet-date">
@@ -57,7 +46,7 @@
57
  } else {
58
  ?>
59
 
60
- <p><a href="http://twitter.com/'<?php echo $username; ?> " target="_blank"><?php _e('Click here to read ' . $username . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
61
  <?php
62
  }
63
  ?>
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
 
8
  ?>
9
 
10
  <div class="aptf-single-tweet-wrapper">
11
  <div class="aptf-tweet-content">
12
+ <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" class="aptf-tweet-name" target="_blank"><?php esc_attr_e($display_name); ?></a> <span class="aptf-tweet-username"><?php esc_attr_e($username); ?></span> <?php } ?>
13
  <div class="clear"></div>
14
  <?php
15
  if ($tweet->text) {
32
  }
33
  }
34
 
35
+ _e($the_tweet) . ' ';
 
 
 
 
 
 
 
 
 
 
36
  ?>
37
  </div><!--tweet content-->
38
  <div class="aptf-tweet-date">
46
  } else {
47
  ?>
48
 
49
+ <p><a href="http://twitter.com/'<?php echo $username; ?> " target="_blank"><?php _e('Click here to read ' . esc_attr($username) . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
50
  <?php
51
  }
52
  ?>
inc/frontend/templates/default/template-3.php CHANGED
@@ -5,12 +5,11 @@
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
8
- //$this->print_array($tweet);
9
  ?>
10
 
11
  <div class="aptf-single-tweet-wrapper">
12
  <div class="aptf-tweet-content">
13
- <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" target="_blank"><?php echo $username; ?></a><?php } ?>
14
  <p class="aptf-timestamp">
15
  <a href="https://twitter.com/<?php echo $username; ?>/status/<?php echo $tweet->id_str; ?>" target="_blank"> -
16
  <?php echo $this->get_date_format($tweet->created_at, $aptf_settings['time_format']); ?>
@@ -37,16 +36,7 @@
37
  }
38
  }
39
 
40
- // iii. Links in Tweet text must be displayed using the display_url
41
- // field in the URL entities API response, and link to the original t.co url field.
42
- /* if (is_array($tweet->entities->urls)) {
43
- foreach ($tweet->entities->urls as $key => $link) {
44
- $the_tweet = preg_replace(
45
- '`' . $link->url . '`', '<a href="' . $link->url . '" target="_blank">' . $link->url . '</a>', $the_tweet);
46
- }
47
- } */
48
-
49
- echo $the_tweet . ' ';
50
  ?>
51
  </div><!--tweet content-->
52
 
@@ -54,7 +44,7 @@
54
  } else {
55
  ?>
56
 
57
- <p><a href="http://twitter.com/'<?php echo $username; ?> " target="_blank"><?php _e('Click here to read ' . $username . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
58
  <?php
59
  }
60
  ?>
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
 
8
  ?>
9
 
10
  <div class="aptf-single-tweet-wrapper">
11
  <div class="aptf-tweet-content">
12
+ <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" target="_blank"><?php esc_attr_e($username); ?></a><?php } ?>
13
  <p class="aptf-timestamp">
14
  <a href="https://twitter.com/<?php echo $username; ?>/status/<?php echo $tweet->id_str; ?>" target="_blank"> -
15
  <?php echo $this->get_date_format($tweet->created_at, $aptf_settings['time_format']); ?>
36
  }
37
  }
38
 
39
+ _e($the_tweet) . ' ';
 
 
 
 
 
 
 
 
 
40
  ?>
41
  </div><!--tweet content-->
42
 
44
  } else {
45
  ?>
46
 
47
+ <p><a href="http://twitter.com/'<?php echo $username; ?> " target="_blank"><?php _e('Click here to read ' . esc_attr($username) . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
48
  <?php
49
  }
50
  ?>
inc/frontend/templates/follow-btn.php CHANGED
@@ -1,3 +1,3 @@
1
  <div class="aptf-center-align">
2
- <a href="<?php echo "https://twitter.com/".$username;?>" target="_blank" class="aptf-follow-link"><div class="aptf-follow-btn"><i></i><span id="l" class="label">Follow <b><?php echo $username;?></b></span></div></a>
3
  </div>
1
  <div class="aptf-center-align">
2
+ <a href="<?php echo "https://twitter.com/".$username;?>" target="_blank" class="aptf-follow-link"><div class="aptf-follow-btn"><i></i><span id="l" class="label">Follow <b><?php esc_attr_e($username);?></b></span></div></a>
3
  </div>
inc/frontend/templates/slider/template-1.php CHANGED
@@ -5,12 +5,11 @@
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
8
- //$this->print_array($tweet);
9
  ?>
10
 
11
  <div class="aptf-single-tweet-slide">
12
  <div class="aptf-tweet-content">
13
- <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" class="aptf-tweet-name" target="_blank"><?php echo $username; ?></a><?php } ?>
14
  <p class="aptf-timestamp">
15
  <a href="https://twitter.com/<?php echo $username; ?>/status/<?php echo $tweet->id_str; ?>" class="aptf-tweet-name" target="_blank"> -
16
  <?php echo $this->get_date_format($tweet->created_at, $aptf_settings['time_format']); ?>
@@ -48,16 +47,7 @@
48
  }
49
  }
50
 
51
- // iii. Links in Tweet text must be displayed using the display_url
52
- // field in the URL entities API response, and link to the original t.co url field.
53
- /* if (is_array($tweet->entities->urls)) {
54
- foreach ($tweet->entities->urls as $key => $link) {
55
- $the_tweet = preg_replace(
56
- '`' . $link->url . '`', '<a href="' . $link->url . '" target="_blank">' . $link->url . '</a>', $the_tweet);
57
- }
58
- } */
59
-
60
- echo $the_tweet . ' ';
61
  ?>
62
  </div><!--tweet content-->
63
 
@@ -65,7 +55,7 @@
65
  } else {
66
  ?>
67
 
68
- <p><a href="http://twitter.com/'<?php echo $username; ?> " class="aptf-tweet-name" target="_blank"><?php _e('Click here to read ' . $username . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
69
  <?php
70
  }
71
  ?>
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
 
8
  ?>
9
 
10
  <div class="aptf-single-tweet-slide">
11
  <div class="aptf-tweet-content">
12
+ <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" class="aptf-tweet-name" target="_blank"><?php esc_attr_e($username); ?></a><?php } ?>
13
  <p class="aptf-timestamp">
14
  <a href="https://twitter.com/<?php echo $username; ?>/status/<?php echo $tweet->id_str; ?>" class="aptf-tweet-name" target="_blank"> -
15
  <?php echo $this->get_date_format($tweet->created_at, $aptf_settings['time_format']); ?>
47
  }
48
  }
49
 
50
+ _e($the_tweet) . ' ';
 
 
 
 
 
 
 
 
 
51
  ?>
52
  </div><!--tweet content-->
53
 
55
  } else {
56
  ?>
57
 
58
+ <p><a href="http://twitter.com/'<?php echo $username; ?> " class="aptf-tweet-name" target="_blank"><?php _e('Click here to read ' . esc_attr($username) . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
59
  <?php
60
  }
61
  ?>
inc/frontend/templates/slider/template-2.php CHANGED
@@ -5,12 +5,11 @@
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
8
- //$this->print_array($tweet);
9
  ?>
10
 
11
  <div class="aptf-single-tweet-slide">
12
  <div class="aptf-tweet-content">
13
- <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" class="aptf-tweet-name" target="_blank"><?php echo $username; ?></a><?php } ?>
14
  <p class="aptf-timestamp">
15
  <a href="https://twitter.com/<?php echo $username; ?>/status/<?php echo $tweet->id_str; ?>" class="aptf-tweet-name" target="_blank"> -
16
  <?php echo $this->get_date_format($tweet->created_at, $aptf_settings['time_format']); ?>
@@ -41,14 +40,14 @@
41
 
42
 
43
 
44
- echo $the_tweet . ' ';
45
  ?>
46
  </div><!--tweet content-->
47
  <?php
48
  } else {
49
  ?>
50
 
51
- <p><a href="http://twitter.com/'<?php echo $username; ?> " class="aptf-tweet-name" target="_blank"><?php _e('Click here to read ' . $username . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
52
  <?php
53
  }
54
  ?>
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
 
8
  ?>
9
 
10
  <div class="aptf-single-tweet-slide">
11
  <div class="aptf-tweet-content">
12
+ <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" class="aptf-tweet-name" target="_blank"><?php esc_attr_e($username); ?></a><?php } ?>
13
  <p class="aptf-timestamp">
14
  <a href="https://twitter.com/<?php echo $username; ?>/status/<?php echo $tweet->id_str; ?>" class="aptf-tweet-name" target="_blank"> -
15
  <?php echo $this->get_date_format($tweet->created_at, $aptf_settings['time_format']); ?>
40
 
41
 
42
 
43
+ _e($the_tweet) . ' ';
44
  ?>
45
  </div><!--tweet content-->
46
  <?php
47
  } else {
48
  ?>
49
 
50
+ <p><a href="http://twitter.com/'<?php echo $username; ?> " class="aptf-tweet-name" target="_blank"><?php _e('Click here to read ' . esc_attr($username) . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
51
  <?php
52
  }
53
  ?>
inc/frontend/templates/slider/template-3.php CHANGED
@@ -5,7 +5,6 @@
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
8
- //$this->print_array($tweet);
9
  ?>
10
 
11
  <div class="aptf-single-tweet-wrapper">
@@ -35,7 +34,7 @@
35
 
36
 
37
 
38
- echo $the_tweet . ' ';
39
  ?>
40
  </div><!--tweet content-->
41
  <?php if (isset($aptf_settings['display_twitter_actions']) && $aptf_settings['display_twitter_actions'] == 1) { ?>
@@ -44,7 +43,7 @@
44
  <!--Tweet Action -->
45
  <?php } ?>
46
  </div>
47
- <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" class="aptf-tweet-name" target="_blank"><?php echo $username; ?></a> <?php } ?>
48
  <div class="aptf-tweet-date">
49
 
50
  <p class="aptf-timestamp">
@@ -57,7 +56,7 @@
57
  } else {
58
  ?>
59
 
60
- <p><a href="http://twitter.com/'<?php echo $username; ?> " target="_blank"><?php _e('Click here to read ' . $username . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
61
  <?php
62
  }
63
  ?>
5
  //echo '<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>';
6
 
7
  foreach ($tweets as $tweet) {
 
8
  ?>
9
 
10
  <div class="aptf-single-tweet-wrapper">
34
 
35
 
36
 
37
+ _e($the_tweet) . ' ';
38
  ?>
39
  </div><!--tweet content-->
40
  <?php if (isset($aptf_settings['display_twitter_actions']) && $aptf_settings['display_twitter_actions'] == 1) { ?>
43
  <!--Tweet Action -->
44
  <?php } ?>
45
  </div>
46
+ <?php if ($aptf_settings['display_username'] == 1) { ?><a href="http://twitter.com/<?php echo $username; ?>" class="aptf-tweet-name" target="_blank"><?php esc_attr_e($username); ?></a> <?php } ?>
47
  <div class="aptf-tweet-date">
48
 
49
  <p class="aptf-timestamp">
56
  } else {
57
  ?>
58
 
59
+ <p><a href="http://twitter.com/'<?php echo $username; ?> " target="_blank"><?php _e('Click here to read ' . esc_attr($username) . '\'S Twitter feed', 'accesspress-twitter-feed'); ?></a></p>
60
  <?php
61
  }
62
  ?>
oauth/OAuth.php ADDED
@@ -0,0 +1,874 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // vim: foldmethod=marker
3
+
4
+ /* Generic exception class
5
+ */
6
+ if (!class_exists('OAuthException')) {
7
+ class OAuthException extends Exception {
8
+ // pass
9
+ }
10
+ }
11
+
12
+ class OAuthConsumer {
13
+ public $key;
14
+ public $secret;
15
+
16
+ function __construct($key, $secret, $callback_url=NULL) {
17
+ $this->key = $key;
18
+ $this->secret = $secret;
19
+ $this->callback_url = $callback_url;
20
+ }
21
+
22
+ function __toString() {
23
+ return "OAuthConsumer[key=$this->key,secret=$this->secret]";
24
+ }
25
+ }
26
+
27
+ class OAuthToken {
28
+ // access tokens and request tokens
29
+ public $key;
30
+ public $secret;
31
+
32
+ /**
33
+ * key = the token
34
+ * secret = the token secret
35
+ */
36
+ function __construct($key, $secret) {
37
+ $this->key = $key;
38
+ $this->secret = $secret;
39
+ }
40
+
41
+ /**
42
+ * generates the basic string serialization of a token that a server
43
+ * would respond to request_token and access_token calls with
44
+ */
45
+ function to_string() {
46
+ return "oauth_token=" .
47
+ OAuthUtil::urlencode_rfc3986($this->key) .
48
+ "&oauth_token_secret=" .
49
+ OAuthUtil::urlencode_rfc3986($this->secret);
50
+ }
51
+
52
+ function __toString() {
53
+ return $this->to_string();
54
+ }
55
+ }
56
+
57
+ /**
58
+ * A class for implementing a Signature Method
59
+ * See section 9 ("Signing Requests") in the spec
60
+ */
61
+ abstract class OAuthSignatureMethod {
62
+ /**
63
+ * Needs to return the name of the Signature Method (ie HMAC-SHA1)
64
+ * @return string
65
+ */
66
+ abstract public function get_name();
67
+
68
+ /**
69
+ * Build up the signature
70
+ * NOTE: The output of this function MUST NOT be urlencoded.
71
+ * the encoding is handled in OAuthRequest when the final
72
+ * request is serialized
73
+ * @param OAuthRequest $request
74
+ * @param OAuthConsumer $consumer
75
+ * @param OAuthToken $token
76
+ * @return string
77
+ */
78
+ abstract public function build_signature($request, $consumer, $token);
79
+
80
+ /**
81
+ * Verifies that a given signature is correct
82
+ * @param OAuthRequest $request
83
+ * @param OAuthConsumer $consumer
84
+ * @param OAuthToken $token
85
+ * @param string $signature
86
+ * @return bool
87
+ */
88
+ public function check_signature($request, $consumer, $token, $signature) {
89
+ $built = $this->build_signature($request, $consumer, $token);
90
+ return $built == $signature;
91
+ }
92
+ }
93
+
94
+ /**
95
+ * The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104]
96
+ * where the Signature Base String is the text and the key is the concatenated values (each first
97
+ * encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&'
98
+ * character (ASCII code 38) even if empty.
99
+ * - Chapter 9.2 ("HMAC-SHA1")
100
+ */
101
+ class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod {
102
+ function get_name() {
103
+ return "HMAC-SHA1";
104
+ }
105
+
106
+ public function build_signature($request, $consumer, $token) {
107
+ $base_string = $request->get_signature_base_string();
108
+ $request->base_string = $base_string;
109
+
110
+ $key_parts = array(
111
+ $consumer->secret,
112
+ ($token) ? $token->secret : ""
113
+ );
114
+
115
+ $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
116
+ $key = implode('&', $key_parts);
117
+
118
+ return base64_encode(hash_hmac('sha1', $base_string, $key, true));
119
+ }
120
+ }
121
+
122
+ /**
123
+ * The PLAINTEXT method does not provide any security protection and SHOULD only be used
124
+ * over a secure channel such as HTTPS. It does not use the Signature Base String.
125
+ * - Chapter 9.4 ("PLAINTEXT")
126
+ */
127
+ class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod {
128
+ public function get_name() {
129
+ return "PLAINTEXT";
130
+ }
131
+
132
+ /**
133
+ * oauth_signature is set to the concatenated encoded values of the Consumer Secret and
134
+ * Token Secret, separated by a '&' character (ASCII code 38), even if either secret is
135
+ * empty. The result MUST be encoded again.
136
+ * - Chapter 9.4.1 ("Generating Signatures")
137
+ *
138
+ * Please note that the second encoding MUST NOT happen in the SignatureMethod, as
139
+ * OAuthRequest handles this!
140
+ */
141
+ public function build_signature($request, $consumer, $token) {
142
+ $key_parts = array(
143
+ $consumer->secret,
144
+ ($token) ? $token->secret : ""
145
+ );
146
+
147
+ $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
148
+ $key = implode('&', $key_parts);
149
+ $request->base_string = $key;
150
+
151
+ return $key;
152
+ }
153
+ }
154
+
155
+ /**
156
+ * The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in
157
+ * [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for
158
+ * EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a
159
+ * verified way to the Service Provider, in a manner which is beyond the scope of this
160
+ * specification.
161
+ * - Chapter 9.3 ("RSA-SHA1")
162
+ */
163
+ abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod {
164
+ public function get_name() {
165
+ return "RSA-SHA1";
166
+ }
167
+
168
+ // Up to the SP to implement this lookup of keys. Possible ideas are:
169
+ // (1) do a lookup in a table of trusted certs keyed off of consumer
170
+ // (2) fetch via http using a url provided by the requester
171
+ // (3) some sort of specific discovery code based on request
172
+ //
173
+ // Either way should return a string representation of the certificate
174
+ protected abstract function fetch_public_cert(&$request);
175
+
176
+ // Up to the SP to implement this lookup of keys. Possible ideas are:
177
+ // (1) do a lookup in a table of trusted certs keyed off of consumer
178
+ //
179
+ // Either way should return a string representation of the certificate
180
+ protected abstract function fetch_private_cert(&$request);
181
+
182
+ public function build_signature($request, $consumer, $token) {
183
+ $base_string = $request->get_signature_base_string();
184
+ $request->base_string = $base_string;
185
+
186
+ // Fetch the private key cert based on the request
187
+ $cert = $this->fetch_private_cert($request);
188
+
189
+ // Pull the private key ID from the certificate
190
+ $privatekeyid = openssl_get_privatekey($cert);
191
+
192
+ // Sign using the key
193
+ $ok = openssl_sign($base_string, $signature, $privatekeyid);
194
+
195
+ // Release the key resource
196
+ openssl_free_key($privatekeyid);
197
+
198
+ return base64_encode($signature);
199
+ }
200
+
201
+ public function check_signature($request, $consumer, $token, $signature) {
202
+ $decoded_sig = base64_decode($signature);
203
+
204
+ $base_string = $request->get_signature_base_string();
205
+
206
+ // Fetch the public key cert based on the request
207
+ $cert = $this->fetch_public_cert($request);
208
+
209
+ // Pull the public key ID from the certificate
210
+ $publickeyid = openssl_get_publickey($cert);
211
+
212
+ // Check the computed signature against the one passed in the query
213
+ $ok = openssl_verify($base_string, $decoded_sig, $publickeyid);
214
+
215
+ // Release the key resource
216
+ openssl_free_key($publickeyid);
217
+
218
+ return $ok == 1;
219
+ }
220
+ }
221
+
222
+ class OAuthRequest {
223
+ private $parameters;
224
+ private $http_method;
225
+ private $http_url;
226
+ // for debug purposes
227
+ public $base_string;
228
+ public static $version = '1.0';
229
+ public static $POST_INPUT = 'php://input';
230
+
231
+ function __construct($http_method, $http_url, $parameters=NULL) {
232
+ @$parameters or $parameters = array();
233
+ $parameters = array_merge( OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
234
+ $this->parameters = $parameters;
235
+ $this->http_method = $http_method;
236
+ $this->http_url = $http_url;
237
+ }
238
+
239
+
240
+ /**
241
+ * attempt to build up a request from what was passed to the server
242
+ */
243
+ public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) {
244
+ $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")
245
+ ? 'http'
246
+ : 'https';
247
+ @$http_url or $http_url = $scheme .
248
+ '://' . $_SERVER['HTTP_HOST'] .
249
+ ':' .
250
+ $_SERVER['SERVER_PORT'] .
251
+ $_SERVER['REQUEST_URI'];
252
+ @$http_method or $http_method = $_SERVER['REQUEST_METHOD'];
253
+
254
+ // We weren't handed any parameters, so let's find the ones relevant to
255
+ // this request.
256
+ // If you run XML-RPC or similar you should use this to provide your own
257
+ // parsed parameter-list
258
+ if (!$parameters) {
259
+ // Find request headers
260
+ $request_headers = OAuthUtil::get_headers();
261
+
262
+ // Parse the query-string to find GET parameters
263
+ $parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']);
264
+
265
+ // It's a POST request of the proper content-type, so parse POST
266
+ // parameters and add those overriding any duplicates from GET
267
+ if ($http_method == "POST"
268
+ && @strstr($request_headers["Content-Type"],
269
+ "application/x-www-form-urlencoded")
270
+ ) {
271
+ $post_data = OAuthUtil::parse_parameters(
272
+ file_get_contents(self::$POST_INPUT)
273
+ );
274
+ $parameters = array_merge($parameters, $post_data);
275
+ }
276
+
277
+ // We have a Authorization-header with OAuth data. Parse the header
278
+ // and add those overriding any duplicates from GET or POST
279
+ if (@substr($request_headers['Authorization'], 0, 6) == "OAuth ") {
280
+ $header_parameters = OAuthUtil::split_header(
281
+ $request_headers['Authorization']
282
+ );
283
+ $parameters = array_merge($parameters, $header_parameters);
284
+ }
285
+
286
+ }
287
+
288
+ return new OAuthRequest($http_method, $http_url, $parameters);
289
+ }
290
+
291
+ /**
292
+ * pretty much a helper function to set up the request
293
+ */
294
+ public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) {
295
+ @$parameters or $parameters = array();
296
+ $defaults = array("oauth_version" => OAuthRequest::$version,
297
+ "oauth_nonce" => OAuthRequest::generate_nonce(),
298
+ "oauth_timestamp" => OAuthRequest::generate_timestamp(),
299
+ "oauth_consumer_key" => $consumer->key);
300
+ if ($token)
301
+ $defaults['oauth_token'] = $token->key;
302
+
303
+ $parameters = array_merge($defaults, $parameters);
304
+
305
+ return new OAuthRequest($http_method, $http_url, $parameters);
306
+ }
307
+
308
+ public function set_parameter($name, $value, $allow_duplicates = true) {
309
+ if ($allow_duplicates && isset($this->parameters[$name])) {
310
+ // We have already added parameter(s) with this name, so add to the list
311
+ if (is_scalar($this->parameters[$name])) {
312
+ // This is the first duplicate, so transform scalar (string)
313
+ // into an array so we can add the duplicates
314
+ $this->parameters[$name] = array($this->parameters[$name]);
315
+ }
316
+
317
+ $this->parameters[$name][] = $value;
318
+ } else {
319
+ $this->parameters[$name] = $value;
320
+ }
321
+ }
322
+
323
+ public function get_parameter($name) {
324
+ return isset($this->parameters[$name]) ? $this->parameters[$name] : null;
325
+ }
326
+
327
+ public function get_parameters() {
328
+ return $this->parameters;
329
+ }
330
+
331
+ public function unset_parameter($name) {
332
+ unset($this->parameters[$name]);
333
+ }
334
+
335
+ /**
336
+ * The request parameters, sorted and concatenated into a normalized string.
337
+ * @return string
338
+ */
339
+ public function get_signable_parameters() {
340
+ // Grab all parameters
341
+ $params = $this->parameters;
342
+
343
+ // Remove oauth_signature if present
344
+ // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
345
+ if (isset($params['oauth_signature'])) {
346
+ unset($params['oauth_signature']);
347
+ }
348
+
349
+ return OAuthUtil::build_http_query($params);
350
+ }
351
+
352
+ /**
353
+ * Returns the base string of this request
354
+ *
355
+ * The base string defined as the method, the url
356
+ * and the parameters (normalized), each urlencoded
357
+ * and the concated with &.
358
+ */
359
+ public function get_signature_base_string() {
360
+ $parts = array(
361
+ $this->get_normalized_http_method(),
362
+ $this->get_normalized_http_url(),
363
+ $this->get_signable_parameters()
364
+ );
365
+
366
+ $parts = OAuthUtil::urlencode_rfc3986($parts);
367
+
368
+ return implode('&', $parts);
369
+ }
370
+
371
+ /**
372
+ * just uppercases the http method
373
+ */
374
+ public function get_normalized_http_method() {
375
+ return strtoupper($this->http_method);
376
+ }
377
+
378
+ /**
379
+ * parses the url and rebuilds it to be
380
+ * scheme://host/path
381
+ */
382
+ public function get_normalized_http_url() {
383
+ $parts = parse_url($this->http_url);
384
+
385
+ $port = @$parts['port'];
386
+ $scheme = $parts['scheme'];
387
+ $host = $parts['host'];
388
+ $path = @$parts['path'];
389
+
390
+ $port or $port = ($scheme == 'https') ? '443' : '80';
391
+
392
+ if (($scheme == 'https' && $port != '443')
393
+ || ($scheme == 'http' && $port != '80')) {
394
+ $host = "$host:$port";
395
+ }
396
+ return "$scheme://$host$path";
397
+ }
398
+
399
+ /**
400
+ * builds a url usable for a GET request
401
+ */
402
+ public function to_url() {
403
+ $post_data = $this->to_postdata();
404
+ $out = $this->get_normalized_http_url();
405
+ if ($post_data) {
406
+ $out .= '?'.$post_data;
407
+ }
408
+ return $out;
409
+ }
410
+
411
+ /**
412
+ * builds the data one would send in a POST request
413
+ */
414
+ public function to_postdata() {
415
+ return OAuthUtil::build_http_query($this->parameters);
416
+ }
417
+
418
+ /**
419
+ * builds the Authorization: header
420
+ */
421
+ public function to_header($realm=null) {
422
+ $first = true;
423
+ if($realm) {
424
+ $out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"';
425
+ $first = false;
426
+ } else
427
+ $out = 'Authorization: OAuth';
428
+
429
+ $total = array();
430
+ foreach ($this->parameters as $k => $v) {
431
+ if (substr($k, 0, 5) != "oauth") continue;
432
+ if (is_array($v)) {
433
+ throw new OAuthException('Arrays not supported in headers');
434
+ }
435
+ $out .= ($first) ? ' ' : ',';
436
+ $out .= OAuthUtil::urlencode_rfc3986($k) .
437
+ '="' .
438
+ OAuthUtil::urlencode_rfc3986($v) .
439
+ '"';
440
+ $first = false;
441
+ }
442
+ return $out;
443
+ }
444
+
445
+ public function __toString() {
446
+ return $this->to_url();
447
+ }
448
+
449
+
450
+ public function sign_request($signature_method, $consumer, $token) {
451
+ $this->set_parameter(
452
+ "oauth_signature_method",
453
+ $signature_method->get_name(),
454
+ false
455
+ );
456
+ $signature = $this->build_signature($signature_method, $consumer, $token);
457
+ $this->set_parameter("oauth_signature", $signature, false);
458
+ }
459
+
460
+ public function build_signature($signature_method, $consumer, $token) {
461
+ $signature = $signature_method->build_signature($this, $consumer, $token);
462
+ return $signature;
463
+ }
464
+
465
+ /**
466
+ * util function: current timestamp
467
+ */
468
+ private static function generate_timestamp() {
469
+ return time();
470
+ }
471
+
472
+ /**
473
+ * util function: current nonce
474
+ */
475
+ private static function generate_nonce() {
476
+ $mt = microtime();
477
+ $rand = mt_rand();
478
+
479
+ return md5($mt . $rand); // md5s look nicer than numbers
480
+ }
481
+ }
482
+
483
+ class OAuthServer {
484
+ protected $timestamp_threshold = 300; // in seconds, five minutes
485
+ protected $version = '1.0'; // hi blaine
486
+ protected $signature_methods = array();
487
+
488
+ protected $data_store;
489
+
490
+ function __construct($data_store) {
491
+ $this->data_store = $data_store;
492
+ }
493
+
494
+ public function add_signature_method($signature_method) {
495
+ $this->signature_methods[$signature_method->get_name()] =
496
+ $signature_method;
497
+ }
498
+
499
+ // high level functions
500
+
501
+ /**
502
+ * process a request_token request
503
+ * returns the request token on success
504
+ */
505
+ public function fetch_request_token(&$request) {
506
+ $this->get_version($request);
507
+
508
+ $consumer = $this->get_consumer($request);
509
+
510
+ // no token required for the initial token request
511
+ $token = NULL;
512
+
513
+ $this->check_signature($request, $consumer, $token);
514
+
515
+ // Rev A change
516
+ $callback = $request->get_parameter('oauth_callback');
517
+ $new_token = $this->data_store->new_request_token($consumer, $callback);
518
+
519
+ return $new_token;
520
+ }
521
+
522
+ /**
523
+ * process an access_token request
524
+ * returns the access token on success
525
+ */
526
+ public function fetch_access_token(&$request) {
527
+ $this->get_version($request);
528
+
529
+ $consumer = $this->get_consumer($request);
530
+
531
+ // requires authorized request token
532
+ $token = $this->get_token($request, $consumer, "request");
533
+
534
+ $this->check_signature($request, $consumer, $token);
535
+
536
+ // Rev A change
537
+ $verifier = $request->get_parameter('oauth_verifier');
538
+ $new_token = $this->data_store->new_access_token($token, $consumer, $verifier);
539
+
540
+ return $new_token;
541
+ }
542
+
543
+ /**
544
+ * verify an api call, checks all the parameters
545
+ */
546
+ public function verify_request(&$request) {
547
+ $this->get_version($request);
548
+ $consumer = $this->get_consumer($request);
549
+ $token = $this->get_token($request, $consumer, "access");
550
+ $this->check_signature($request, $consumer, $token);
551
+ return array($consumer, $token);
552
+ }
553
+
554
+ // Internals from here
555
+ /**
556
+ * version 1
557
+ */
558
+ private function get_version(&$request) {
559
+ $version = $request->get_parameter("oauth_version");
560
+ if (!$version) {
561
+ // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.
562
+ // Chapter 7.0 ("Accessing Protected Ressources")
563
+ $version = '1.0';
564
+ }
565
+ if ($version !== $this->version) {
566
+ throw new OAuthException("OAuth version '$version' not supported");
567
+ }
568
+ return $version;
569
+ }
570
+
571
+ /**
572
+ * figure out the signature with some defaults
573
+ */
574
+ private function get_signature_method(&$request) {
575
+ $signature_method =
576
+ @$request->get_parameter("oauth_signature_method");
577
+
578
+ if (!$signature_method) {
579
+ // According to chapter 7 ("Accessing Protected Ressources") the signature-method
580
+ // parameter is required, and we can't just fallback to PLAINTEXT
581
+ throw new OAuthException('No signature method parameter. This parameter is required');
582
+ }
583
+
584
+ if (!in_array($signature_method,
585
+ array_keys($this->signature_methods))) {
586
+ throw new OAuthException(
587
+ "Signature method '$signature_method' not supported " .
588
+ "try one of the following: " .
589
+ implode(", ", array_keys($this->signature_methods))
590
+ );
591
+ }
592
+ return $this->signature_methods[$signature_method];
593
+ }
594
+
595
+ /**
596
+ * try to find the consumer for the provided request's consumer key
597
+ */
598
+ private function get_consumer(&$request) {
599
+ $consumer_key = @$request->get_parameter("oauth_consumer_key");
600
+ if (!$consumer_key) {
601
+ throw new OAuthException("Invalid consumer key");
602
+ }
603
+
604
+ $consumer = $this->data_store->lookup_consumer($consumer_key);
605
+ if (!$consumer) {
606
+ throw new OAuthException("Invalid consumer");
607
+ }
608
+
609
+ return $consumer;
610
+ }
611
+
612
+ /**
613
+ * try to find the token for the provided request's token key
614
+ */
615
+ private function get_token(&$request, $consumer, $token_type="access") {
616
+ $token_field = @$request->get_parameter('oauth_token');
617
+ $token = $this->data_store->lookup_token(
618
+ $consumer, $token_type, $token_field
619
+ );
620
+ if (!$token) {
621
+ throw new OAuthException("Invalid $token_type token: $token_field");
622
+ }
623
+ return $token;
624
+ }
625
+
626
+ /**
627
+ * all-in-one function to check the signature on a request
628
+ * should guess the signature method appropriately
629
+ */
630
+ private function check_signature(&$request, $consumer, $token) {
631
+ // this should probably be in a different method
632
+ $timestamp = @$request->get_parameter('oauth_timestamp');
633
+ $nonce = @$request->get_parameter('oauth_nonce');
634
+
635
+ $this->check_timestamp($timestamp);
636
+ $this->check_nonce($consumer, $token, $nonce, $timestamp);
637
+
638
+ $signature_method = $this->get_signature_method($request);
639
+
640
+ $signature = $request->get_parameter('oauth_signature');
641
+ $valid_sig = $signature_method->check_signature(
642
+ $request,
643
+ $consumer,
644
+ $token,
645
+ $signature
646
+ );
647
+
648
+ if (!$valid_sig) {
649
+ throw new OAuthException("Invalid signature");
650
+ }
651
+ }
652
+
653
+ /**
654
+ * check that the timestamp is new enough
655
+ */
656
+ private function check_timestamp($timestamp) {
657
+ if( ! $timestamp )
658
+ throw new OAuthException(
659
+ 'Missing timestamp parameter. The parameter is required'
660
+ );
661
+
662
+ // verify that timestamp is recentish
663
+ $now = time();
664
+ if (abs($now - $timestamp) > $this->timestamp_threshold) {
665
+ throw new OAuthException(
666
+ "Expired timestamp, yours $timestamp, ours $now"
667
+ );
668
+ }
669
+ }
670
+
671
+ /**
672
+ * check that the nonce is not repeated
673
+ */
674
+ private function check_nonce($consumer, $token, $nonce, $timestamp) {
675
+ if( ! $nonce )
676
+ throw new OAuthException(
677
+ 'Missing nonce parameter. The parameter is required'
678
+ );
679
+
680
+ // verify that the nonce is uniqueish
681
+ $found = $this->data_store->lookup_nonce(
682
+ $consumer,
683
+ $token,
684
+ $nonce,
685
+ $timestamp
686
+ );
687
+ if ($found) {
688
+ throw new OAuthException("Nonce already used: $nonce");
689
+ }
690
+ }
691
+
692
+ }
693
+
694
+ class OAuthDataStore {
695
+ function lookup_consumer($consumer_key) {
696
+ // implement me
697
+ }
698
+
699
+ function lookup_token($consumer, $token_type, $token) {
700
+ // implement me
701
+ }
702
+
703
+ function lookup_nonce($consumer, $token, $nonce, $timestamp) {
704
+ // implement me
705
+ }
706
+
707
+ function new_request_token($consumer, $callback = null) {
708
+ // return a new token attached to this consumer
709
+ }
710
+
711
+ function new_access_token($token, $consumer, $verifier = null) {
712
+ // return a new access token attached to this consumer
713
+ // for the user associated with this token if the request token
714
+ // is authorized
715
+ // should also invalidate the request token
716
+ }
717
+
718
+ }
719
+
720
+ class OAuthUtil {
721
+ public static function urlencode_rfc3986($input) {
722
+ if (is_array($input)) {
723
+ return array_map(array('OAuthUtil', 'urlencode_rfc3986'), $input);
724
+ } else if (is_scalar($input)) {
725
+ return str_replace(
726
+ '+',
727
+ ' ',
728
+ str_replace('%7E', '~', rawurlencode($input))
729
+ );
730
+ } else {
731
+ return '';
732
+ }
733
+ }
734
+
735
+
736
+ // This decode function isn't taking into consideration the above
737
+ // modifications to the encoding process. However, this method doesn't
738
+ // seem to be used anywhere so leaving it as is.
739
+ public static function urldecode_rfc3986($string) {
740
+ return urldecode($string);
741
+ }
742
+
743
+ // Utility function for turning the Authorization: header into
744
+ // parameters, has to do some unescaping
745
+ // Can filter out any non-oauth parameters if needed (default behaviour)
746
+ public static function split_header($header, $only_allow_oauth_parameters = true) {
747
+ $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
748
+ $offset = 0;
749
+ $params = array();
750
+ while (preg_match($pattern, $header, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) {
751
+ $match = $matches[0];
752
+ $header_name = $matches[2][0];
753
+ $header_content = (isset($matches[5])) ? $matches[5][0] : $matches[4][0];
754
+ if (preg_match('/^oauth_/', $header_name) || !$only_allow_oauth_parameters) {
755
+ $params[$header_name] = OAuthUtil::urldecode_rfc3986($header_content);
756
+ }
757
+ $offset = $match[1] + strlen($match[0]);
758
+ }
759
+
760
+ if (isset($params['realm'])) {
761
+ unset($params['realm']);
762
+ }
763
+
764
+ return $params;
765
+ }
766
+
767
+ // helper to try to sort out headers for people who aren't running apache
768
+ public static function get_headers() {
769
+ if (function_exists('apache_request_headers')) {
770
+ // we need this to get the actual Authorization: header
771
+ // because apache tends to tell us it doesn't exist
772
+ $headers = apache_request_headers();
773
+
774
+ // sanitize the output of apache_request_headers because
775
+ // we always want the keys to be Cased-Like-This and arh()
776
+ // returns the headers in the same case as they are in the
777
+ // request
778
+ $out = array();
779
+ foreach( $headers AS $key => $value ) {
780
+ $key = str_replace(
781
+ " ",
782
+ "-",
783
+ ucwords(strtolower(str_replace("-", " ", $key)))
784
+ );
785
+ $out[$key] = $value;
786
+ }
787
+ } else {
788
+ // otherwise we don't have apache and are just going to have to hope
789
+ // that $_SERVER actually contains what we need
790
+ $out = array();
791
+ if( isset($_SERVER['CONTENT_TYPE']) )
792
+ $out['Content-Type'] = $_SERVER['CONTENT_TYPE'];
793
+ if( isset($_ENV['CONTENT_TYPE']) )
794
+ $out['Content-Type'] = $_ENV['CONTENT_TYPE'];
795
+
796
+ foreach ($_SERVER as $key => $value) {
797
+ if (substr($key, 0, 5) == "HTTP_") {
798
+ // this is chaos, basically it is just there to capitalize the first
799
+ // letter of every word that is not an initial HTTP and strip HTTP
800
+ // code from przemek
801
+ $key = str_replace(
802
+ " ",
803
+ "-",
804
+ ucwords(strtolower(str_replace("_", " ", substr($key, 5))))
805
+ );
806
+ $out[$key] = $value;
807
+ }
808
+ }
809
+ }
810
+ return $out;
811
+ }
812
+
813
+ // This function takes a input like a=b&a=c&d=e and returns the parsed
814
+ // parameters like this
815
+ // array('a' => array('b','c'), 'd' => 'e')
816
+ public static function parse_parameters( $input ) {
817
+ if (!isset($input) || !$input) return array();
818
+
819
+ $pairs = explode('&', $input);
820
+
821
+ $parsed_parameters = array();
822
+ foreach ($pairs as $pair) {
823
+ $split = explode('=', $pair, 2);
824
+ $parameter = OAuthUtil::urldecode_rfc3986($split[0]);
825
+ $value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : '';
826
+
827
+ if (isset($parsed_parameters[$parameter])) {
828
+ // We have already recieved parameter(s) with this name, so add to the list
829
+ // of parameters with this name
830
+
831
+ if (is_scalar($parsed_parameters[$parameter])) {
832
+ // This is the first duplicate, so transform scalar (string) into an array
833
+ // so we can add the duplicates
834
+ $parsed_parameters[$parameter] = array($parsed_parameters[$parameter]);
835
+ }
836
+
837
+ $parsed_parameters[$parameter][] = $value;
838
+ } else {
839
+ $parsed_parameters[$parameter] = $value;
840
+ }
841
+ }
842
+ return $parsed_parameters;
843
+ }
844
+
845
+ public static function build_http_query($params) {
846
+ if (!$params) return '';
847
+
848
+ // Urlencode both keys and values
849
+ $keys = OAuthUtil::urlencode_rfc3986(array_keys($params));
850
+ $values = OAuthUtil::urlencode_rfc3986(array_values($params));
851
+ $params = array_combine($keys, $values);
852
+
853
+ // Parameters are sorted by name, using lexicographical byte value ordering.
854
+ // Ref: Spec: 9.1.1 (1)
855
+ uksort($params, 'strcmp');
856
+
857
+ $pairs = array();
858
+ foreach ($params as $parameter => $value) {
859
+ if (is_array($value)) {
860
+ // If two or more parameters share the same name, they are sorted by their value
861
+ // Ref: Spec: 9.1.1 (1)
862
+ natsort($value);
863
+ foreach ($value as $duplicate_value) {
864
+ $pairs[] = $parameter . '=' . $duplicate_value;
865
+ }
866
+ } else {
867
+ $pairs[] = $parameter . '=' . $value;
868
+ }
869
+ }
870
+ // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
871
+ // Each name-value pair is separated by an '&' character (ASCII code 38)
872
+ return implode('&', $pairs);
873
+ }
874
+ }
oauth/twitteroauth.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * Abraham Williams (abraham@abrah.am) http://abrah.am
5
+ *
6
+ * The first PHP Library to support OAuth for Twitter's REST API.
7
+ * Modified for compatibility with other plugins which could provide OAuthConsumer by Liam Gladdy, 2014.
8
+ */
9
+
10
+ /* Load OAuth lib. You can find it at http://oauth.net */
11
+ if (!class_exists('OAuthConsumer')) {
12
+ require_once('OAuth.php');
13
+ } else {
14
+ define('THR_USING_EXISTING_LIBRARY_OAUTH',true);
15
+ }
16
+
17
+ /**
18
+ * Twitter OAuth class
19
+ */
20
+ class TwitterOAuth {
21
+ /* Contains the last HTTP status code returned. */
22
+ public $http_code;
23
+ /* Contains the last API call. */
24
+ public $url;
25
+ /* Set up the API root URL. */
26
+ public $host = "https://api.twitter.com/1.1/";
27
+ /* Set timeout default. */
28
+ public $timeout = 3;
29
+ /* Set connect timeout. */
30
+ public $connecttimeout = 2;
31
+ /* Verify SSL Cert. */
32
+ public $ssl_verifypeer = FALSE;
33
+ /* Respons format. */
34
+ public $format = 'json';
35
+ /* Decode returned json data. */
36
+ public $decode_json = TRUE;
37
+ /* Contains the last HTTP headers returned. */
38
+ public $http_info;
39
+ /* Set the useragnet. */
40
+ public $useragent = 'Twitter Feed for Wordpress Developers 2.2.0';
41
+ /* Immediately retry the API call if the response was not successful. */
42
+ //public $retry = TRUE;
43
+
44
+
45
+
46
+
47
+ /**
48
+ * Set API URLS
49
+ */
50
+ function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; }
51
+ function authenticateURL() { return 'https://api.twitter.com/oauth/authenticate'; }
52
+ function authorizeURL() { return 'https://api.twitter.com/oauth/authorize'; }
53
+ function requestTokenURL() { return 'https://api.twitter.com/oauth/request_token'; }
54
+
55
+ /**
56
+ * Debug helpers
57
+ */
58
+ function lastStatusCode() { return $this->http_status; }
59
+ function lastAPICall() { return $this->last_api_call; }
60
+
61
+ /**
62
+ * construct TwitterOAuth object
63
+ */
64
+ function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
65
+ $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
66
+ $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret);
67
+ if (!empty($oauth_token) && !empty($oauth_token_secret)) {
68
+ $this->token = new OAuthConsumer($oauth_token, $oauth_token_secret);
69
+ } else {
70
+ $this->token = NULL;
71
+ }
72
+ }
73
+
74
+
75
+ /**
76
+ * Get a request_token from Twitter
77
+ *
78
+ * @returns a key/value array containing oauth_token and oauth_token_secret
79
+ */
80
+ function getRequestToken($oauth_callback) {
81
+ $parameters = array();
82
+ $parameters['oauth_callback'] = $oauth_callback;
83
+ $request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);
84
+ $token = OAuthUtil::parse_parameters($request);
85
+ $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
86
+ return $token;
87
+ }
88
+
89
+ /**
90
+ * Get the authorize URL
91
+ *
92
+ * @returns a string
93
+ */
94
+ function getAuthorizeURL($token, $sign_in_with_twitter = TRUE) {
95
+ if (is_array($token)) {
96
+ $token = $token['oauth_token'];
97
+ }
98
+ if (empty($sign_in_with_twitter)) {
99
+ return $this->authorizeURL() . "?oauth_token={$token}";
100
+ } else {
101
+ return $this->authenticateURL() . "?oauth_token={$token}";
102
+ }
103
+ }
104
+
105
+ /**
106
+ * Exchange request token and secret for an access token and
107
+ * secret, to sign API calls.
108
+ *
109
+ * @returns array("oauth_token" => "the-access-token",
110
+ * "oauth_token_secret" => "the-access-secret",
111
+ * "user_id" => "9436992",
112
+ * "screen_name" => "abraham")
113
+ */
114
+ function getAccessToken($oauth_verifier) {
115
+ $parameters = array();
116
+ $parameters['oauth_verifier'] = $oauth_verifier;
117
+ $request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters);
118
+ $token = OAuthUtil::parse_parameters($request);
119
+ $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
120
+ return $token;
121
+ }
122
+
123
+ /**
124
+ * One time exchange of username and password for access token and secret.
125
+ *
126
+ * @returns array("oauth_token" => "the-access-token",
127
+ * "oauth_token_secret" => "the-access-secret",
128
+ * "user_id" => "9436992",
129
+ * "screen_name" => "abraham",
130
+ * "x_auth_expires" => "0")
131
+ */
132
+ function getXAuthToken($username, $password) {
133
+ $parameters = array();
134
+ $parameters['x_auth_username'] = $username;
135
+ $parameters['x_auth_password'] = $password;
136
+ $parameters['x_auth_mode'] = 'client_auth';
137
+ $request = $this->oAuthRequest($this->accessTokenURL(), 'POST', $parameters);
138
+ $token = OAuthUtil::parse_parameters($request);
139
+ $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
140
+ return $token;
141
+ }
142
+
143
+ /**
144
+ * GET wrapper for oAuthRequest.
145
+ */
146
+ function get($url, $parameters = array()) {
147
+ $response = $this->oAuthRequest($url, 'GET', $parameters);
148
+ if ($this->format === 'json' && $this->decode_json) {
149
+ return json_decode($response,true);
150
+ }
151
+ return $response;
152
+ }
153
+
154
+ /**
155
+ * POST wrapper for oAuthRequest.
156
+ */
157
+ function post($url, $parameters = array()) {
158
+ $response = $this->oAuthRequest($url, 'POST', $parameters);
159
+ if ($this->format === 'json' && $this->decode_json) {
160
+ return json_decode($response,true);
161
+ }
162
+ return $response;
163
+ }
164
+
165
+ /**
166
+ * DELETE wrapper for oAuthReqeust.
167
+ */
168
+ function delete($url, $parameters = array()) {
169
+ $response = $this->oAuthRequest($url, 'DELETE', $parameters);
170
+ if ($this->format === 'json' && $this->decode_json) {
171
+ return json_decode($response,true);
172
+ }
173
+ return $response;
174
+ }
175
+
176
+ /**
177
+ * Format and sign an OAuth / API request
178
+ */
179
+ function oAuthRequest($url, $method, $parameters) {
180
+ if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) {
181
+ $url = "{$this->host}{$url}.{$this->format}";
182
+ }
183
+ $request = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters);
184
+ $request->sign_request($this->sha1_method, $this->consumer, $this->token);
185
+ switch ($method) {
186
+ case 'GET':
187
+ return $this->http($request->to_url(), 'GET');
188
+ default:
189
+ return $this->http($request->get_normalized_http_url(), $method, $request->to_postdata());
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Make an HTTP request
195
+ *
196
+ * @return API results
197
+ */
198
+ function http($url, $method, $postfields = NULL) {
199
+ $this->http_info = array();
200
+ $ci = curl_init();
201
+ /* Curl settings */
202
+ curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);
203
+ curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);
204
+ curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);
205
+ curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);
206
+ curl_setopt($ci, CURLOPT_HTTPHEADER, array('Expect:'));
207
+ curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);
208
+ curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));
209
+ curl_setopt($ci, CURLOPT_HEADER, FALSE);
210
+
211
+ switch ($method) {
212
+ case 'POST':
213
+ curl_setopt($ci, CURLOPT_POST, TRUE);
214
+ if (!empty($postfields)) {
215
+ curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);
216
+ }
217
+ break;
218
+ case 'DELETE':
219
+ curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');
220
+ if (!empty($postfields)) {
221
+ $url = "{$url}?{$postfields}";
222
+ }
223
+ }
224
+
225
+ curl_setopt($ci, CURLOPT_URL, $url);
226
+ $response = curl_exec($ci);
227
+ $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);
228
+ $this->http_info = array_merge($this->http_info, curl_getinfo($ci));
229
+ $this->url = $url;
230
+ curl_close ($ci);
231
+ return $response;
232
+ }
233
+
234
+ /**
235
+ * Get the header info to store.
236
+ */
237
+ function getHeader($ch, $header) {
238
+ $i = strpos($header, ':');
239
+ if (!empty($i)) {
240
+ $key = str_replace('-', '_', strtolower(substr($header, 0, $i)));
241
+ $value = trim(substr($header, $i + 2));
242
+ $this->http_header[$key] = $value;
243
+ }
244
+ return strlen($header);
245
+ }
246
+ }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === AccessPress Twitter Feed - Twitter Feed for WordPress ===
2
  Contributors: Access Keys
3
  Tags: twitter, twitter feeds, twitter slider, twitter feeds slider, twitter plugin, twitter feed plugin, twitter tweets, tweets, twitter tweet plugin, recent tweets widget, recent tweets plugin, recent tweet feeds
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 4.0
6
- Tested up to: 5.0
7
- Stable tag: 1.5.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -13,7 +13,7 @@ Display real-time Twitter feeds on your website. Update your website visitors wi
13
  == Description ==
14
  [Homepage](https://accesspressthemes.com/) | [Documentation](https://accesspressthemes.com/documentation/accesspress-twitter-feed/) | [Support](https://accesspressthemes.com/support) | [Demo](http://demo.accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed/) | [Premium Version](https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/)
15
 
16
- <strong>AccessPress Twitter Feed</strong> is a FREE 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. Display tweets as a feed or in slider. It just takes a few minute to set it up and use. Start strong Twitter integration right on your website and increase your social reach to next level.
17
 
18
 
19
 
@@ -81,7 +81,7 @@ For complete information and documentation regarding plugin,please visit below l
81
  == More Resources ==
82
  Themes Compatible With Our Plugin :
83
 
84
- AccessPress Twitter Feed works best with every WordPress theme. Its even more remarkable when used with popular themes of ours or any other being compatible to almost all of the themes.
85
 
86
  AND IF THIS PLUGIN HAS IMPRESSED YOU, THEN YOU WOULD ENJOY OUR OTHER PROJECTS TOO. DO CHECK THESE OUT :
87
 
@@ -100,8 +100,8 @@ AND IF THIS PLUGIN HAS IMPRESSED YOU, THEN YOU WOULD ENJOY OUR OTHER PROJECTS TO
100
  1. Unzip accesspress-twitter-feed.zip
101
  1. Upload all the files to the /wp-content/plugins/accesspress-twitter-feed
102
  1. Activate the plugin through the 'Plugins' menu in WordPress.
103
- 1. For customizing the plugin's settings, click on AccessPress Twitter Feed menu in Wordpress left admin menu.
104
- 1. To display the social counts in the frontend,please use [ap-twitter-feed] shortcode or AccessPress Twitter Feed Widget wherever necessary.
105
 
106
  == Frequently Asked Questions ==
107
  = What does this plugin do? =
@@ -125,6 +125,11 @@ Once you install the plugin , you can check some general documentation about how
125
 
126
 
127
  == Changelog ==
 
 
 
 
 
128
  = 1.5.9 =
129
  * Removed use of php session
130
  * Updated some sanitizations
@@ -293,4 +298,4 @@ Once you install the plugin , you can check some general documentation about how
293
 
294
 
295
  == Upgrade Notice ==
296
- There is an update available for the AccessPress Twitter Feed Plugin.Please update to recieve new updates and bug fixes.
1
+ === WP TFeed ===
2
  Contributors: Access Keys
3
  Tags: twitter, twitter feeds, twitter slider, twitter feeds slider, twitter plugin, twitter feed plugin, twitter tweets, tweets, twitter tweet plugin, recent tweets widget, recent tweets plugin, recent tweet feeds
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 4.0
6
+ Tested up to: 5.2.2
7
+ Stable tag: 1.6.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
13
  == Description ==
14
  [Homepage](https://accesspressthemes.com/) | [Documentation](https://accesspressthemes.com/documentation/accesspress-twitter-feed/) | [Support](https://accesspressthemes.com/support) | [Demo](http://demo.accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed/) | [Premium Version](https://accesspressthemes.com/wordpress-plugins/accesspress-twitter-feed-pro/)
15
 
16
+ <strong>WP TFeed</strong> is a FREE 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. Display tweets as a feed or in slider. It just takes a few minute to set it up and use. Start strong Twitter integration right on your website and increase your social reach to next level.
17
 
18
 
19
 
81
  == More Resources ==
82
  Themes Compatible With Our Plugin :
83
 
84
+ WP TFeed works best with every WordPress theme. Its even more remarkable when used with popular themes of ours or any other being compatible to almost all of the themes.
85
 
86
  AND IF THIS PLUGIN HAS IMPRESSED YOU, THEN YOU WOULD ENJOY OUR OTHER PROJECTS TOO. DO CHECK THESE OUT :
87
 
100
  1. Unzip accesspress-twitter-feed.zip
101
  1. Upload all the files to the /wp-content/plugins/accesspress-twitter-feed
102
  1. Activate the plugin through the 'Plugins' menu in WordPress.
103
+ 1. For customizing the plugin's settings, click on WP TFeed menu in Wordpress left admin menu.
104
+ 1. To display the twitter feeds in the frontend,please use [ap-twitter-feed] shortcode or WP TFeed Widget wherever necessary.
105
 
106
  == Frequently Asked Questions ==
107
  = What does this plugin do? =
125
 
126
 
127
  == Changelog ==
128
+ = 1.6.0 =
129
+ * Minor bug fixes
130
+ * Security fix update
131
+ * WordPress version 5.2.2 compatibility checked
132
+
133
  = 1.5.9 =
134
  * Removed use of php session
135
  * Updated some sanitizations
298
 
299
 
300
  == Upgrade Notice ==
301
+ There is an update available for the WP TFeed Plugin.Please update to recieve new updates and bug fixes.