Custom Twitter Feeds - Version 2.0.2

Version Description

  • Fix: Added code to help with debugging issues.
  • Fix: The descriptions of feed types were incorrect.
Download this release

Release Info

Developer Craig at Smash Balloon
Plugin Icon 128x128 Custom Twitter Feeds
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

README.txt CHANGED
@@ -5,7 +5,7 @@ Support Website: http://smashballoon/custom-twitter-feeds/
5
  Tags: Twitter, Twitter feed, Twitter Tweets, Twitter widget, Custom Twitter Feed
6
  Requires at least: 4.1
7
  Tested up to: 6.0
8
- Stable tag: 2.0.1
9
  Requires PHP: 5.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -234,6 +234,10 @@ If you're still having trouble displaying your Tweets after trying the common is
234
  7. To display a Twitter feed just copy and paste the shortcode into a Twitter widget or page
235
 
236
  == Changelog ==
 
 
 
 
237
  = 2.0.1 =
238
  * Fix: When GDPR features were active, avatars would not display even after consent had been given.
239
  * Fix: Fixed a PHP error that would occur with specific kinds of tweets being displayed.
5
  Tags: Twitter, Twitter feed, Twitter Tweets, Twitter widget, Custom Twitter Feed
6
  Requires at least: 4.1
7
  Tested up to: 6.0
8
+ Stable tag: 2.0.2
9
  Requires PHP: 5.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
234
  7. To display a Twitter feed just copy and paste the shortcode into a Twitter widget or page
235
 
236
  == Changelog ==
237
+ = 2.0.2 =
238
+ * Fix: Added code to help with debugging issues.
239
+ * Fix: The descriptions of feed types were incorrect.
240
+
241
  = 2.0.1 =
242
  * Fix: When GDPR features were active, avatars would not display even after consent had been given.
243
  * Fix: Fixed a PHP error that would occur with specific kinds of tweets being displayed.
custom-twitter-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Custom Twitter Feeds
4
  Plugin URI: http://smashballoon.com/custom-twitter-feeds
5
  Description: Customizable Twitter feeds for your website
6
- Version: 2.0.1
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  Text Domain: custom-twitter-feeds
@@ -23,7 +23,7 @@ along with this program; if not, write to the Free Software
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
  define( 'CTF_URL', plugin_dir_path( __FILE__ ) );
26
- define( 'CTF_VERSION', '2.0.1' );
27
  define( 'CTF_TITLE', 'Custom Twitter Feeds' );
28
  define( 'CTF_JS_URL', plugins_url( '/js/ctf-scripts.min.js?ver=' . CTF_VERSION , __FILE__ ) );
29
  define( 'OAUTH_PROCESSOR_URL', 'https://api.smashballoon.com/twitter-login.php?return_uri=' );
3
  Plugin Name: Custom Twitter Feeds
4
  Plugin URI: http://smashballoon.com/custom-twitter-feeds
5
  Description: Customizable Twitter feeds for your website
6
+ Version: 2.0.2
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  Text Domain: custom-twitter-feeds
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
  define( 'CTF_URL', plugin_dir_path( __FILE__ ) );
26
+ define( 'CTF_VERSION', '2.0.2' );
27
  define( 'CTF_TITLE', 'Custom Twitter Feeds' );
28
  define( 'CTF_JS_URL', plugins_url( '/js/ctf-scripts.min.js?ver=' . CTF_VERSION , __FILE__ ) );
29
  define( 'OAUTH_PROCESSOR_URL', 'https://api.smashballoon.com/twitter-login.php?return_uri=' );
inc/Admin/CTF_Admin_Notices.php CHANGED
@@ -115,6 +115,7 @@ class CTF_Admin_Notices
115
  // Check the API
116
  $ctf_api_params = array(
117
  'edd_action'=> 'check_license',
 
118
  'license' => $ctf_license,
119
  'item_name' => urlencode( CTF_PLUGIN_NAME ) // the name of our product in EDD
120
  );
@@ -207,6 +208,7 @@ class CTF_Admin_Notices
207
  // data to send in our API request
208
  $ctf_api_params = array(
209
  'edd_action'=> 'check_license',
 
210
  'license' => $ctf_license,
211
  'item_name' => urlencode( CTF_PLUGIN_NAME ) // the name of our product in EDD
212
  );
115
  // Check the API
116
  $ctf_api_params = array(
117
  'edd_action'=> 'check_license',
118
+ 'nocache' => '1',
119
  'license' => $ctf_license,
120
  'item_name' => urlencode( CTF_PLUGIN_NAME ) // the name of our product in EDD
121
  );
208
  // data to send in our API request
209
  $ctf_api_params = array(
210
  'edd_action'=> 'check_license',
211
+ 'nocache' => '1',
212
  'license' => $ctf_license,
213
  'item_name' => urlencode( CTF_PLUGIN_NAME ) // the name of our product in EDD
214
  );
inc/Admin/CTF_Upgrader.php CHANGED
@@ -63,6 +63,7 @@ class CTF_Upgrader {
63
  'author' => 'SmashBalloon',
64
  'url' => home_url(),
65
  'beta' => false,
 
66
  );
67
 
68
  $api_url = trailingslashit( self::STORE_URL );
63
  'author' => 'SmashBalloon',
64
  'url' => home_url(),
65
  'beta' => false,
66
+ 'nocache' => '1'
67
  );
68
 
69
  $api_url = trailingslashit( self::STORE_URL );
inc/Builder/CTF_Feed_Builder.php CHANGED
@@ -1042,15 +1042,15 @@ class CTF_Feed_Builder {
1042
  'usertimeline' => [
1043
  'heading' => __( 'User Timeline', 'custom-twitter-feeds' ),
1044
  'icon' => 'user',
1045
- 'description' => __( 'Add one or more Twitter handles separated by comma', 'custom-twitter-feeds' ),
1046
- 'placeHolder' => __( '@gopro, @wpbeginner', 'custom-twitter-feeds' ),
1047
  'actionType' => 'inputField'
1048
  ],
1049
  'hashtag' => [
1050
  'heading' => __( 'Hashtag', 'custom-twitter-feeds' ),
1051
  'icon' => 'hashtag',
1052
- 'description' => __( 'Add one or more hashtag separated by comma.', 'custom-twitter-feeds' ),
1053
- 'placeHolder' => __( '#hashtag1, #hashtag2', 'custom-twitter-feeds' ),
1054
  'actionType' => 'inputField'
1055
  ],
1056
  'hometimeline' => [
@@ -1982,19 +1982,19 @@ class CTF_Feed_Builder {
1982
  [
1983
  'type' => 'usertimeline',
1984
  'title'=> __( 'User Timeline', 'custom-twitter-feeds' ),
1985
- 'description'=> __( 'A brief description about the feed type', 'custom-twitter-feeds' ),
1986
  'icon' => 'usertimelineIcon'
1987
  ],
1988
  [
1989
  'type' => 'hashtag',
1990
  'title' => __( 'Hashtag', 'custom-twitter-feeds' ),
1991
- 'description'=> __( 'A brief description about the feed type', 'custom-twitter-feeds' ),
1992
  'icon' => 'hashtagIcon'
1993
  ],
1994
  [
1995
  'type' => 'hometimeline',
1996
  'title' => __( 'Home Timeline', 'custom-twitter-feeds' ),
1997
- 'description'=> __( 'A brief description about the feed type', 'custom-twitter-feeds' ),
1998
  'icon' => 'homeTimelineIcon'
1999
  ],
2000
  /*
1042
  'usertimeline' => [
1043
  'heading' => __( 'User Timeline', 'custom-twitter-feeds' ),
1044
  'icon' => 'user',
1045
+ 'description' => __( 'Add a Twitter handle for any account', 'custom-twitter-feeds' ),
1046
+ 'placeHolder' => __( '@wpbeginner', 'custom-twitter-feeds' ),
1047
  'actionType' => 'inputField'
1048
  ],
1049
  'hashtag' => [
1050
  'heading' => __( 'Hashtag', 'custom-twitter-feeds' ),
1051
  'icon' => 'hashtag',
1052
+ 'description' => __( 'Add any hashtag found on Twitter.', 'custom-twitter-feeds' ),
1053
+ 'placeHolder' => __( '#hashtag', 'custom-twitter-feeds' ),
1054
  'actionType' => 'inputField'
1055
  ],
1056
  'hometimeline' => [
1982
  [
1983
  'type' => 'usertimeline',
1984
  'title'=> __( 'User Timeline', 'custom-twitter-feeds' ),
1985
+ 'description'=> __( 'A timeline of Tweets from any Twitter user', 'custom-twitter-feeds' ),
1986
  'icon' => 'usertimelineIcon'
1987
  ],
1988
  [
1989
  'type' => 'hashtag',
1990
  'title' => __( 'Hashtag', 'custom-twitter-feeds' ),
1991
+ 'description'=> __( 'Public Tweets which contain a specific hashtag', 'custom-twitter-feeds' ),
1992
  'icon' => 'hashtagIcon'
1993
  ],
1994
  [
1995
  'type' => 'hometimeline',
1996
  'title' => __( 'Home Timeline', 'custom-twitter-feeds' ),
1997
+ 'description'=> __( 'The home timeline from your Twitter account', 'custom-twitter-feeds' ),
1998
  'icon' => 'homeTimelineIcon'
1999
  ],
2000
  /*
inc/CTF_GDPR_Integrations.php CHANGED
@@ -121,4 +121,11 @@ class CTF_GDPR_Integrations {
121
  return array();
122
  }
123
 
124
- }
 
 
 
 
 
 
 
121
  return array();
122
  }
123
 
124
+ public static function statuses() {
125
+ $statuses_option = get_option( 'ctf_statuses', array() );
126
+
127
+ $return = isset( $statuses_option['gdpr'] ) ? $statuses_option['gdpr'] : array();
128
+ return $return;
129
+ }
130
+
131
+ }
inc/ctf-functions.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  use TwitterFeed\CTF_Feed;
4
  use TwitterFeed\CtfFeed;
 
 
5
  /**
6
  * May include support for templates in theme folders in the future
7
  *
@@ -240,3 +242,82 @@ function ctf_maybe_ajax_theme_html( $twitter_feed, $feed_id ) {
240
  }
241
  }
242
  add_action( 'ctf_before_feed_end', 'ctf_maybe_ajax_theme_html', 10, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  use TwitterFeed\CTF_Feed;
4
  use TwitterFeed\CtfFeed;
5
+ use TwitterFeed\CTF_Settings;
6
+ use TwitterFeed\CTF_GDPR_Integrations;
7
  /**
8
  * May include support for templates in theme folders in the future
9
  *
242
  }
243
  }
244
  add_action( 'ctf_before_feed_end', 'ctf_maybe_ajax_theme_html', 10, 2 );
245
+
246
+ /**
247
+ * Debug report added at the end of the feed when sbi_debug query arg is added to a page
248
+ * that has the feed on it.
249
+ *
250
+ * @param object $twitter_feed
251
+ * @param string $feed_id
252
+ */
253
+ function ctf_debug_report( $twitter_feed, $feed_id ) {
254
+
255
+ if ( ! isset( $_GET['sbi_debug'] ) && ! isset( $_GET['sb_debug'] ) ) {
256
+ return;
257
+ }
258
+
259
+ $settings_obj = new CTF_Settings( array(), array() );
260
+
261
+ $settings = $twitter_feed->feed_options;
262
+
263
+ $public_settings_keys = CTF_Settings::get_public_db_settings_keys();
264
+ ?>
265
+
266
+ <p>Status</p>
267
+ <ul>
268
+ <li>Time: <?php echo esc_html( date( 'Y-m-d H:i:s', time() ) ); ?></li>
269
+
270
+ </ul>
271
+ <p>Settings</p>
272
+ <ul>
273
+ <?php
274
+ foreach ( $public_settings_keys as $key ) :
275
+ if ( isset( $settings[ $key ] ) ) :
276
+ ?>
277
+ <li>
278
+ <small><?php echo esc_html( $key ); ?>:</small>
279
+ <?php
280
+ if ( ! is_array( $settings[ $key ] ) ) :
281
+ echo esc_html( $settings[ $key ] );
282
+ else :
283
+ ?>
284
+ <ul>
285
+ <?php
286
+ foreach ( $settings[ $key ] as $sub_key => $value ) {
287
+ echo '<li><small>' . esc_html( $sub_key ) . ':</small> ' . esc_html( $value ) . '</li>';
288
+ }
289
+ ?>
290
+ </ul>
291
+ <?php endif; ?>
292
+ </li>
293
+
294
+ <?php
295
+ endif;
296
+ endforeach;
297
+ ?>
298
+ </ul>
299
+ <p>GDPR</p>
300
+ <ul>
301
+ <?php
302
+ $statuses = CTF_GDPR_Integrations::statuses();
303
+ foreach ( $statuses as $status_key => $value ) :
304
+ ?>
305
+ <li>
306
+ <small><?php echo esc_html( $status_key ); ?>:</small>
307
+ <?php
308
+ if ( $value == 1 ) {
309
+ echo 'success';
310
+ } else {
311
+ echo 'failed'; }
312
+ ?>
313
+ </li>
314
+
315
+ <?php endforeach; ?>
316
+ <li>
317
+ <small>Enabled:</small>
318
+ <?php echo CTF_GDPR_Integrations::doing_gdpr( $settings ); ?>
319
+ </li>
320
+ </ul>
321
+ <?php
322
+ }
323
+ add_action( 'ctf_before_feed_end', 'ctf_debug_report', 99, 2 );