oAuth Twitter Feed for Developers - Version 2.3.0

Version Description

  • Support for WordPress's new internationalization system.
Download this release

Release Info

Developer lgladdy
Plugin Icon wp plugin oAuth Twitter Feed for Developers
Version 2.3.0
Comparing to
See all releases

Code changes from version 2.2.1 to 2.3.0

README.md CHANGED
@@ -60,7 +60,7 @@ Uses Abraham Williams's Twitter OAuth class.
60
  About
61
  =====
62
 
63
- Version: 2.2.1
64
 
65
  Written by Liam Gladdy of Storm Consultancy - <http://www.stormconsultancy.co.uk>
66
 
@@ -71,7 +71,7 @@ If you are looking for a [Bath WordPress Developer](http://www.stormconsultancy.
71
  License
72
  =======
73
 
74
- Copyright (c) 2014 Storm Consultancy (EU) Ltd and Liam Gladdy,
75
  <http://www.stormconsultancy.co.uk/>
76
 
77
  Permission is hereby granted, free of charge, to any person obtaining
60
  About
61
  =====
62
 
63
+ Version: 2.3.0
64
 
65
  Written by Liam Gladdy of Storm Consultancy - <http://www.stormconsultancy.co.uk>
66
 
71
  License
72
  =======
73
 
74
+ Copyright (c) 2016 Storm Consultancy (EU) Ltd and Liam Gladdy,
75
  <http://www.stormconsultancy.co.uk/>
76
 
77
  Permission is hereby granted, free of charge, to any person obtaining
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === oAuth Twitter Feed for Developers ===
2
- Contributors: stormuk, lgladdy
3
- Donate link: http://www.stormconsultancy.co.uk/
4
  Tags: twitter, oauth, feed, tweets
5
  Requires at least: 3.4
6
- Tested up to: 4.2
7
- Stable tag: 2.2.1
8
- Version: 2.2.1
9
  License: MIT
10
  License URI: http://opensource.org/licenses/MIT
11
 
@@ -66,18 +66,18 @@ Uses Abraham Williams's Twitter OAuth class.
66
 
67
  == About ==
68
 
69
- Version: 2.2.1
70
 
71
  Written by Liam Gladdy of Storm Consultancy - <http://www.stormconsultancy.co.uk>
72
 
73
  Storm Consultancy are a web design and development agency based in Bath, UK.
74
 
75
- If you are looking for a [Bath WordPress Developer](http://www.stormconsultancy.co.uk/services/bath-wordpress-developers), then [get in touch](http://www.stormconsultancy.co.uk/contact)!
76
 
77
  == License ==
78
 
79
- Copyright (c) 2014 Storm Consultancy (EU) Ltd and Liam Gladdy,
80
- <http://www.stormconsultancy.co.uk/>
81
 
82
  Permission is hereby granted, free of charge, to any person obtaining
83
  a copy of this software and associated documentation files (the
@@ -100,6 +100,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
100
 
101
  == Changelog ==
102
 
 
 
 
103
  = 2.2.1 =
104
  * Grah! Fixes a fairly major issue where if not loading from a cache, the tweet cache is an object, rather than an array. This should be configurable (maybe in 2.3), but for now - fix it.
105
 
@@ -141,4 +144,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
141
  * Correct documentation files for inclusion by wordpress
142
 
143
  = 1.0 =
144
- * First version
1
  === oAuth Twitter Feed for Developers ===
2
+ Contributors: lgladdy, stormuk
3
+ Donate link: https://stormconsultancy.co.uk
4
  Tags: twitter, oauth, feed, tweets
5
  Requires at least: 3.4
6
+ Tested up to: 4.7.3
7
+ Stable tag: 2.3.0
8
+ Version: 2.3.0
9
  License: MIT
10
  License URI: http://opensource.org/licenses/MIT
11
 
66
 
67
  == About ==
68
 
69
+ Version: 2.3.0
70
 
71
  Written by Liam Gladdy of Storm Consultancy - <http://www.stormconsultancy.co.uk>
72
 
73
  Storm Consultancy are a web design and development agency based in Bath, UK.
74
 
75
+ If you are looking for a [Bath WordPress Developer](http://www.stormconsultancy.co.uk), then [get in touch](http://www.stormconsultancy.co.uk/contact)!
76
 
77
  == License ==
78
 
79
+ Copyright (c) 2016 Liam Gladdy and Storm Consultancy (EU) Ltd,
80
+ <https://gladdy.uk/>, <http://www.stormconsultancy.co.uk/>
81
 
82
  Permission is hereby granted, free of charge, to any person obtaining
83
  a copy of this software and associated documentation files (the
100
 
101
  == Changelog ==
102
 
103
+ = 2.3.0 =
104
+ * Support for WordPress's new internationalization system.
105
+
106
  = 2.2.1 =
107
  * Grah! Fixes a fairly major issue where if not loading from a cache, the tweet cache is an object, rather than an array. This should be configurable (maybe in 2.3), but for now - fix it.
108
 
144
  * Correct documentation files for inclusion by wordpress
145
 
146
  = 1.0 =
147
+ * First version
twitter-feed-for-developers-settings.php CHANGED
@@ -7,17 +7,17 @@ if (is_admin()) {
7
  }
8
 
9
  function tdf_menu() {
10
- add_options_page('Twitter Feed for Developers','Twitter Feed Auth','manage_options','tdf_settings','tdf_settings_output');
11
  }
12
 
13
  function tdf_settings() {
14
  $tdf = array();
15
- $tdf[] = array('name'=>'tdf_consumer_key','label'=>'Twitter Application API Key');
16
- $tdf[] = array('name'=>'tdf_consumer_secret','label'=>'Twitter Application API Secret');
17
- $tdf[] = array('name'=>'tdf_access_token','label'=>'Account Access Token');
18
- $tdf[] = array('name'=>'tdf_access_token_secret','label'=>'Account Access Token Secret');
19
- $tdf[] = array('name'=>'tdf_cache_expire','label'=>'Cache Duration (Default 3600)');
20
- $tdf[] = array('name'=>'tdf_user_timeline','label'=>'Twitter Feed Screen Name*');
21
  return $tdf;
22
  }
23
 
@@ -40,21 +40,37 @@ function tdf_settings_output() {
40
  $reflector = new ReflectionClass('TwitterOAuth');
41
  $file = $reflector->getFileName();
42
 
43
- echo '<div id="message" class="error"><p><strong>oAuth Twitter Feed for Developers</strong> is using an existing version of the TwitterOAuth class library to provide compatibility with existing plugins.<br />This could lead to conflicts if the plugin is using an different version of the class.</p><p>The class is being loaded at <strong>'.$file.'</strong></p></div>';
 
 
 
 
 
 
 
 
44
  }
45
 
46
  if (defined('TFD_USING_EXISTING_LIBRARY_OAUTH') && TFD_USING_EXISTING_LIBRARY_OAUTH) {
47
  $reflector = new ReflectionClass('OAuthConsumer');
48
  $file = $reflector->getFileName();
 
 
 
 
 
 
 
 
49
 
50
- echo '<div id="message" class="error"><p><strong>oAuth Twitter Feed for Developers</strong> is using an existing version of the PHP OAuth library to provide compatibility with existing plugins or your PHP installation.<br />This could lead to conflicts if the plugin, or your PHP installed class is using an different version of the class.</p><p>The class is being loaded at <strong>'.$file.'</strong></p></div>';
51
  }
52
 
53
- echo '<p>Most of this configuration can found on the application overview page on the <a href="http://dev.twitter.com/apps">http://dev.twitter.com</a> website.</p>';
54
- echo '<p>When creating an application for this plugin, you don\'t need to set a callback location and you only need read access.</p>';
55
- echo '<p>You will need to generate an oAuth token once you\'ve created the application. The button for that is on the bottom of the application overview page.</p>';
56
- echo '<p>Once configured, you then need to call getTweets() anywhere in your template. getTweets supports 3 parameters - the username of the twitter feed you want to load, the number of tweets to load (max 20), and any additional parameters you want to send to Twitter. An example code usage is shown under the debug information below.</p>';
57
- echo '<p>The format of the response from getTweets will either be an array of arrays containing tweet objects, as described on the official Twitter documentation <a href="https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline">here</a>, or an 1D array containing an "error" key, with a value of the error that occurred.</p>';
58
 
59
  echo '<hr />';
60
 
@@ -70,7 +86,9 @@ function tdf_settings_output() {
70
  echo '</tr>';
71
  if ($setting['name'] == 'tdf_user_timeline') {
72
  echo '<tr>';
73
- echo '<td colspan="2" style="font-size:10px; font-style: italic">This option is no longer required and is deprecated. You should define the screen name to load as part of the getTweets() call as detailed above.</td>';
 
 
74
  echo '</tr>';
75
  }
76
  }
@@ -82,7 +100,7 @@ function tdf_settings_output() {
82
 
83
  echo '<hr />';
84
 
85
- echo '<h3>Debug Information</h3>';
86
  $last_error = get_option('tdf_last_error');
87
  if (empty($last_error)) $last_error = "None";
88
  echo 'Last Error: '.$last_error.'</p>';
7
  }
8
 
9
  function tdf_menu() {
10
+ add_options_page(__('Twitter Feed for Developers','oauth-twitter-feed-for-developers'),__('Twitter Feed Auth','oauth-twitter-feed-for-developers'),'manage_options','tdf_settings','tdf_settings_output');
11
  }
12
 
13
  function tdf_settings() {
14
  $tdf = array();
15
+ $tdf[] = array('name'=>'tdf_consumer_key','label'=>__('Twitter Application API Key (Consumer key)','oauth-twitter-feed-for-developers'));
16
+ $tdf[] = array('name'=>'tdf_consumer_secret','label'=>__('Twitter Application API Secret (Consumer secret)','oauth-twitter-feed-for-developers'));
17
+ $tdf[] = array('name'=>'tdf_access_token','label'=>__('Account Access Token','oauth-twitter-feed-for-developers'));
18
+ $tdf[] = array('name'=>'tdf_access_token_secret','label'=>__('Account Access Token Secret','oauth-twitter-feed-for-developers'));
19
+ $tdf[] = array('name'=>'tdf_cache_expire','label'=>__('Cache Duration (Default 3600)','oauth-twitter-feed-for-developers'));
20
+ $tdf[] = array('name'=>'tdf_user_timeline','label'=>__('Twitter Feed Screen Name*','oauth-twitter-feed-for-developers'));
21
  return $tdf;
22
  }
23
 
40
  $reflector = new ReflectionClass('TwitterOAuth');
41
  $file = $reflector->getFileName();
42
 
43
+ echo '<div id="message" class="error"><p>';
44
+
45
+ printf(
46
+ /* translators: %s: The filename and path of the existing twitteroauth class causing a conflict */
47
+ __('<strong>oAuth Twitter Feed for Developers</strong> is using an existing version of the TwitterOAuth class library to provide compatibility with existing plugins.<br />This could lead to conflicts if the plugin is using an different version of the class.</p><p>The class is being loaded at <strong>%s</strong>','oauth-twitter-feed-for-developers'),
48
+ $file
49
+ );
50
+
51
+ echo '</p></div>';
52
  }
53
 
54
  if (defined('TFD_USING_EXISTING_LIBRARY_OAUTH') && TFD_USING_EXISTING_LIBRARY_OAUTH) {
55
  $reflector = new ReflectionClass('OAuthConsumer');
56
  $file = $reflector->getFileName();
57
+
58
+ echo '<div id="message" class="error"><p>';
59
+
60
+ printf(
61
+ /* translators: %s: The filename and path of the PHP OAuth class causing a conflict */
62
+ __('<strong>oAuth Twitter Feed for Developers</strong> is using an existing version of the PHP OAuth library to provide compatibility with existing plugins or your PHP installation.<br />This could lead to conflicts if the plugin, or your PHP installed class is using an different version of the class.</p><p>The class is being loaded at <strong>%s</strong>'),
63
+ $file
64
+ );
65
 
66
+ echo '</p></div>';
67
  }
68
 
69
+ echo '<p>'.__('Most of this configuration can found on the application overview page on the <a href="http://dev.twitter.com/apps">http://dev.twitter.com</a> website.','oauth-twitter-feed-for-developers').'</p>';
70
+ echo '<p>'.__('When creating an application for this plugin, you don\'t need to set a callback location and you only need read access.','oauth-twitter-feed-for-developers').'</p>';
71
+ echo '<p>'.__('You will need to generate an oAuth token once you\'ve created the application. The button for that is on the bottom of the application overview page.','oauth-twitter-feed-for-developers').'</p>';
72
+ echo '<p>'.__('Once configured, you then need to call getTweets() anywhere in your template. getTweets supports 3 parameters - the username of the twitter feed you want to load, the number of tweets to load (max 20), and any additional parameters you want to send to Twitter. An example code usage is shown under the debug information below.','oauth-twitter-feed-for-developers').'</p>';
73
+ echo '<p>'.__('The format of the response from getTweets will either be an array of arrays containing tweet objects, as described on the official Twitter documentation <a href="https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline">here</a>, or an 1D array containing an "error" key, with a value of the error that occurred.','oauth-twitter-feed-for-developers').'</p>';
74
 
75
  echo '<hr />';
76
 
86
  echo '</tr>';
87
  if ($setting['name'] == 'tdf_user_timeline') {
88
  echo '<tr>';
89
+ echo '<td colspan="2" style="font-size:10px; font-style: italic">';
90
+ echo __('This option is no longer required and is deprecated. You should define the screen name to load as part of the getTweets() call as detailed above.','oauth-twitter-feed-for-developers');
91
+ echo '</td>';
92
  echo '</tr>';
93
  }
94
  }
100
 
101
  echo '<hr />';
102
 
103
+ echo '<h3>'.__('Debug Information','oauth-twitter-feed-for-developers').'</h3>';
104
  $last_error = get_option('tdf_last_error');
105
  if (empty($last_error)) $last_error = "None";
106
  echo 'Last Error: '.$last_error.'</p>';
twitter-feed-for-developers.php CHANGED
@@ -2,17 +2,23 @@
2
  /*
3
  Plugin Name: oAuth Twitter Feed for Developers
4
  Description: Twitter API 1.1 compliant plugin that provides a function to get an array of tweets from the auth'd users Twitter feed for use in themes.
5
- Version: 2.2.1
 
6
  License: MIT
7
  License URI: http://opensource.org/licenses/MIT
8
- Author: Storm Consultancy (Liam Gladdy)
9
- Author URI: http://www.stormconsultancy.co.uk
10
  */
11
 
12
 
13
  require('StormTwitter.class.php');
14
  require('twitter-feed-for-developers-settings.php');
15
 
 
 
 
 
 
16
  /* implement getTweets */
17
  function getTweets($username = false, $count = 20, $options = false) {
18
 
2
  /*
3
  Plugin Name: oAuth Twitter Feed for Developers
4
  Description: Twitter API 1.1 compliant plugin that provides a function to get an array of tweets from the auth'd users Twitter feed for use in themes.
5
+ Version: 2.3.0
6
+ Text Domain: oauth-twitter-feed-for-developers
7
  License: MIT
8
  License URI: http://opensource.org/licenses/MIT
9
+ Author: Liam Gladdy (Storm Consultancy)
10
+ Author URI: https://stormconsultancy.co.uk
11
  */
12
 
13
 
14
  require('StormTwitter.class.php');
15
  require('twitter-feed-for-developers-settings.php');
16
 
17
+ add_action('plugins_loaded', 'load_otffd_languages');
18
+ function load_otffd_languages() {
19
+ load_plugin_textdomain('oauth-twitter-feed-for-developers', FALSE, basename(dirname( __FILE__ )).'/languages/');
20
+ }
21
+
22
  /* implement getTweets */
23
  function getTweets($username = false, $count = 20, $options = false) {
24