Feed Them Social – Facebook, Instagram, Twitter, YouTube, Pinterest - Version 2.7.0

Version Description

Download this release

Release Info

Developer slickremix
Plugin Icon 128x128 Feed Them Social – Facebook, Instagram, Twitter, YouTube, Pinterest
Version 2.7.0
Comparing to
See all releases

Code changes from version 2.6.9 to 2.7.0

admin/class-fts-twitter-options-page.php CHANGED
@@ -144,7 +144,7 @@ class FTS_Twitter_Options_Page {
144
 
145
  <div class="fts-twitter-add-all-keys-click-option">
146
  <label for="fts-custom-tokens-twitter">
147
- <input type="checkbox" id="fts-custom-tokens-twitter" name="fts_twitter_custom_tokens" value="1" <?php echo checked('1', '' === $extra_keys); ?>> <?php echo esc_html( 'Add your own tokens?', 'feed-them-social' ); ?>
148
  </label>
149
  </div>
150
 
@@ -230,10 +230,8 @@ class FTS_Twitter_Options_Page {
230
  }
231
  } else {
232
  echo sprintf(
233
- esc_html( '%1$sYou are using our Default Access tokens for testing purposes. Generate your shortcode on the %2$sSettings Page%3$s to test your feed, but remember to add your own tokens after testing as the default tokens will not always work.%4$s', 'feed-them-social' ),
234
- '<div class="fts-successful-api-token">',
235
- '<a href="' . esc_url( 'admin.php?page=feed-them-settings-page' ) . '">',
236
- '</a>',
237
  '</div>'
238
  );
239
  }
144
 
145
  <div class="fts-twitter-add-all-keys-click-option">
146
  <label for="fts-custom-tokens-twitter">
147
+ <input type="checkbox" id="fts-custom-tokens-twitter" name="fts_twitter_custom_tokens" value="1" <?php echo checked( '1', '' === $extra_keys ); ?>> <?php echo esc_html( 'Add your own tokens?', 'feed-them-social' ); ?>
148
  </label>
149
  </div>
150
 
230
  }
231
  } else {
232
  echo sprintf(
233
+ esc_html( '%1$sTo get started, please click the button above to retrieve your Access Token.%2$s', 'feed-them-social' ),
234
+ '<div class="fts-failed-api-token get-started-message">',
 
 
235
  '</div>'
236
  );
237
  }
feed-them.php CHANGED
@@ -7,18 +7,18 @@
7
  * Plugin Name: Feed Them Social (Facebook, Instagram, Twitter, etc)
8
  * Plugin URI: https://feedthemsocial.com/
9
  * Description: Customize feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
10
- * Version: 2.6.9
11
  * Author: SlickRemix
12
  * Author URI: https://www.slickremix.com/
13
  * Text Domain: feed-them-social
14
  * Domain Path: /languages
15
  * Requires at least: WordPress 4.0.0
16
  * Tested up to: WordPress 5.2
17
- * Stable tag: 2.6.9
18
  * License: GPLv2 or later
19
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
- * @version 2.6.9
22
  * @package FeedThemSocial/Core
23
  * @copyright Copyright (c) 2012-2019 SlickRemix
24
  *
@@ -31,7 +31,7 @@
31
  *
32
  * Makes sure any js or css changes are reloaded properly. Added to enqued css and js files throughout!
33
  */
34
- define( 'FTS_CURRENT_VERSION', '2.6.9' );
35
 
36
  define( 'FEED_THEM_SOCIAL_NOTICE_STATUS', get_option( 'rating_fts_slick_notice', false ) );
37
 
7
  * Plugin Name: Feed Them Social (Facebook, Instagram, Twitter, etc)
8
  * Plugin URI: https://feedthemsocial.com/
9
  * Description: Customize feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
10
+ * Version: 2.7.0
11
  * Author: SlickRemix
12
  * Author URI: https://www.slickremix.com/
13
  * Text Domain: feed-them-social
14
  * Domain Path: /languages
15
  * Requires at least: WordPress 4.0.0
16
  * Tested up to: WordPress 5.2
17
+ * Stable tag: 2.7.0
18
  * License: GPLv2 or later
19
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
+ * @version 2.7.0
22
  * @package FeedThemSocial/Core
23
  * @copyright Copyright (c) 2012-2019 SlickRemix
24
  *
31
  *
32
  * Makes sure any js or css changes are reloaded properly. Added to enqued css and js files throughout!
33
  */
34
+ define( 'FTS_CURRENT_VERSION', '2.7.0' );
35
 
36
  define( 'FEED_THEM_SOCIAL_NOTICE_STATUS', get_option( 'rating_fts_slick_notice', false ) );
37
 
feeds/twitter/class-fts-twitter-feed.php CHANGED
@@ -136,8 +136,7 @@ class FTS_Twitter_Feed extends feed_them_social_functions {
136
  } elseif ( isset( $post_data->quoted_status->extended_entities->media[0]->video_info->variants[1]->content_type ) && 'video/mp4' === $post_data->quoted_status->extended_entities->media[0]->video_info->variants[1]->content_type ) {
137
  $twitter_final = isset( $post_data->quoted_status->extended_entities->media[0]->video_info->variants[1]->url ) ? $post_data->quoted_status->extended_entities->media[0]->video_info->variants[1]->url : '';
138
  }
139
-
140
-
141
  // Check to see if there is a poster image available.
142
  if ( isset( $post_data->extended_entities->media[0]->media_url_https ) ) {
143
 
@@ -145,8 +144,7 @@ class FTS_Twitter_Feed extends feed_them_social_functions {
145
  } elseif ( isset( $post_data->quoted_status->extended_entities->media[0]->media_url_https ) ) {
146
 
147
  $twitter_final_poster = isset( $post_data->quoted_status->extended_entities->media[0]->media_url_https ) ? $post_data->quoted_status->extended_entities->media[0]->media_url_https : '';
148
- }
149
- elseif ( isset( $post_data->retweeted_status->extended_entities->media[0]->media_url_https ) ) {
150
 
151
  $twitter_final_poster = isset( $post_data->retweeted_status->extended_entities->media[0]->media_url_https ) ? $post_data->retweeted_status->extended_entities->media[0]->media_url_https : '';
152
  }
@@ -422,21 +420,18 @@ class FTS_Twitter_Feed extends feed_them_social_functions {
422
  // Access Token Secret.
423
  $fts_twitter_custom_access_token_secret
424
  );
425
- } else {
426
- // else use default info.
427
- $connection = new TwitterOAuthFTS(
428
-
429
- // Consumer Key.
430
- '4UUpTLglrsvQMjmrfdgdtHEEJ',
431
- // Consumer Secret.
432
- 'ngtRtVKRvcY4e2lZHHkKNc63JPMn8SnOw1bM0jd6Fv8H5C3phP',
433
- // Access Token.
434
- '1561334624-CSmnb3JqhKctSGzYfB5ouf3GmR9Pne1fR2q9PzY',
435
- // Access Token Secret.
436
- 'CH2Ojl5G4sgn8kUaBIEhy6M0UUvBWs1CrYW8sh1fpCQXT'
437
- );
438
  }
439
 
 
 
 
 
 
 
 
 
 
 
440
  // $videosDecode = 'https://api.twitter.com/1.1/statuses/oembed.json?id=507185938620219395';.
441
  // numTimes = get_option('twitter_replies_offset') == TRUE ? get_option('twitter_replies_offset') : '1' ;.
442
  // If excluding replies, we need to fetch more than requested as the total is fetched first, and then replies removed.
@@ -497,10 +492,12 @@ class FTS_Twitter_Feed extends feed_them_social_functions {
497
  $connection_user_array['max_id'] = sanitize_text_field( wp_unslash( $_REQUEST['max_id'] ) ) - 1;
498
  }
499
 
500
- $fetched_tweets = $connection->get(
501
- 'statuses/user_timeline',
502
- $connection_user_array
503
- );
 
 
504
  }
505
 
506
  if ( ! empty( $search ) ) {
@@ -535,13 +532,15 @@ class FTS_Twitter_Feed extends feed_them_social_functions {
535
  }
536
  } elseif ( empty( $fetched_tweets ) && ! isset( $fetched_tweets->errors ) ) {
537
  $error_check = __( ' This account has no tweets. Please Tweet to see this feed. Feed Them Social.', 'feed-them-social' );
 
 
538
  }
539
 
540
  ob_start();
541
 
542
  // IS RATE LIMIT REACHED?
543
  if ( isset( $fetched_tweets->errors ) && '32' !== $fetched_tweets->errors[0]->code && '34' !== $fetched_tweets->errors[0]->code ) {
544
- echo esc_html( 'Rate Limited Exceeded. Please go to the Feed Them Social Plugin then the Twitter Options page and follow the instructions under the header Twitter API Token.', 'feed-them-social' );
545
  }
546
  // Did the fetch fail?
547
  if ( isset( $error_check ) ) {
@@ -600,7 +599,7 @@ class FTS_Twitter_Feed extends feed_them_social_functions {
600
 
601
  // here we add a , for all numbers below 9,999.
602
  if ( isset( $statuses_count ) && $statuses_count <= 9999 ) {
603
- $statuses_count = number_format( $statuses_count );
604
  }
605
  // here we convert the number for the like count like 1,200,000 to 1.2m if the number goes into the millions.
606
  if ( isset( $statuses_count ) && $statuses_count >= 1000000 ) {
@@ -613,7 +612,7 @@ class FTS_Twitter_Feed extends feed_them_social_functions {
613
 
614
  // here we add a , for all numbers below 9,999.
615
  if ( isset( $followers_count ) && $followers_count <= 9999 ) {
616
- $followers_count = number_format( $followers_count );
617
  }
618
  // here we convert the number for the comment count like 1,200,000 to 1.2m if the number goes into the millions.
619
  if ( isset( $followers_count ) && $followers_count >= 1000000 ) {
@@ -634,9 +633,9 @@ class FTS_Twitter_Feed extends feed_them_social_functions {
634
  // option to allow the followers plus count to show.
635
  echo '<div class="fts-twitter-followers-wrap">';
636
  echo '<div class="twitter-followers-fts fts-tweets-first"><a href="' . esc_url( $user_permalink ) . '" target="_blank">' . esc_html( 'Tweets', 'feed-them-social' ) . '</a> ' . esc_html( $statuses_count ) . '</div>';
637
- echo '<div class="twitter-followers-fts fts-following-link-div"><a href="' . esc_url( $user_permalink ) . '" target="_blank">' . esc_html( 'Following', 'feed-them-social' ) . '</a> ' . number_format( $friends_count ) . '</div>';
638
  echo '<div class="twitter-followers-fts fts-followers-link-div"><a href="' . esc_url( $user_permalink ) . '" target="_blank">' . esc_html( 'Followers', 'feed-them-social' ) . '</a> ' . esc_html( $followers_count ) . '</div>';
639
- echo '<div class="twitter-followers-fts fts-likes-link-div"><a href="' . esc_url( $user_permalink ) . '" target="_blank">' . esc_html( 'Likes', 'feed-them-social' ) . '</a> ' . number_format( $favourites_count ) . '</div>';
640
  echo '</div>';
641
 
642
  }
@@ -674,10 +673,9 @@ class FTS_Twitter_Feed extends feed_them_social_functions {
674
  <?php
675
  }
676
 
677
- // echo'<pre>';
678
- // print_r($fetched_tweets->data);
679
  // echo'</pre>';
680
-
681
  $i = 0;
682
  foreach ( $fetched_tweets->data as $post_data ) {
683
 
136
  } elseif ( isset( $post_data->quoted_status->extended_entities->media[0]->video_info->variants[1]->content_type ) && 'video/mp4' === $post_data->quoted_status->extended_entities->media[0]->video_info->variants[1]->content_type ) {
137
  $twitter_final = isset( $post_data->quoted_status->extended_entities->media[0]->video_info->variants[1]->url ) ? $post_data->quoted_status->extended_entities->media[0]->video_info->variants[1]->url : '';
138
  }
139
+
 
140
  // Check to see if there is a poster image available.
141
  if ( isset( $post_data->extended_entities->media[0]->media_url_https ) ) {
142
 
144
  } elseif ( isset( $post_data->quoted_status->extended_entities->media[0]->media_url_https ) ) {
145
 
146
  $twitter_final_poster = isset( $post_data->quoted_status->extended_entities->media[0]->media_url_https ) ? $post_data->quoted_status->extended_entities->media[0]->media_url_https : '';
147
+ } elseif ( isset( $post_data->retweeted_status->extended_entities->media[0]->media_url_https ) ) {
 
148
 
149
  $twitter_final_poster = isset( $post_data->retweeted_status->extended_entities->media[0]->media_url_https ) ? $post_data->retweeted_status->extended_entities->media[0]->media_url_https : '';
150
  }
420
  // Access Token Secret.
421
  $fts_twitter_custom_access_token_secret
422
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
423
  }
424
 
425
+ /*
426
+ $fetch_api_limit = $connection->get(
427
+ 'application/rate_limit_status',
428
+ array(
429
+ 'resources' => 'help,users,search,statuses',
430
+ )
431
+ );
432
+
433
+ error_log( print_r( $fetch_api_limit, true ) );*/
434
+
435
  // $videosDecode = 'https://api.twitter.com/1.1/statuses/oembed.json?id=507185938620219395';.
436
  // numTimes = get_option('twitter_replies_offset') == TRUE ? get_option('twitter_replies_offset') : '1' ;.
437
  // If excluding replies, we need to fetch more than requested as the total is fetched first, and then replies removed.
492
  $connection_user_array['max_id'] = sanitize_text_field( wp_unslash( $_REQUEST['max_id'] ) ) - 1;
493
  }
494
 
495
+ if ( null !== $connection ) {
496
+ $fetched_tweets = $connection->get(
497
+ 'statuses/user_timeline',
498
+ $connection_user_array
499
+ );
500
+ }
501
  }
502
 
503
  if ( ! empty( $search ) ) {
532
  }
533
  } elseif ( empty( $fetched_tweets ) && ! isset( $fetched_tweets->errors ) ) {
534
  $error_check = __( ' This account has no tweets. Please Tweet to see this feed. Feed Them Social.', 'feed-them-social' );
535
+ } elseif ( null === $connection ) {
536
+ $error_check = __( 'No Access Tokens have been set. Please retrieve Twitter API tokens on the Twitter Options page of Feed Them Social.', 'feed-them-social' );
537
  }
538
 
539
  ob_start();
540
 
541
  // IS RATE LIMIT REACHED?
542
  if ( isset( $fetched_tweets->errors ) && '32' !== $fetched_tweets->errors[0]->code && '34' !== $fetched_tweets->errors[0]->code ) {
543
+ echo esc_html( 'Rate Limited Exceeded. Please go to the Feed Them Social Plugin then the Twitter Options page for Feed Them Social and follow the instructions under the header Twitter API Token.', 'feed-them-social' );
544
  }
545
  // Did the fetch fail?
546
  if ( isset( $error_check ) ) {
599
 
600
  // here we add a , for all numbers below 9,999.
601
  if ( isset( $statuses_count ) && $statuses_count <= 9999 ) {
602
+ $statuses_count = number_format( (float) $statuses_count );
603
  }
604
  // here we convert the number for the like count like 1,200,000 to 1.2m if the number goes into the millions.
605
  if ( isset( $statuses_count ) && $statuses_count >= 1000000 ) {
612
 
613
  // here we add a , for all numbers below 9,999.
614
  if ( isset( $followers_count ) && $followers_count <= 9999 ) {
615
+ $followers_count = number_format( (float) $followers_count );
616
  }
617
  // here we convert the number for the comment count like 1,200,000 to 1.2m if the number goes into the millions.
618
  if ( isset( $followers_count ) && $followers_count >= 1000000 ) {
633
  // option to allow the followers plus count to show.
634
  echo '<div class="fts-twitter-followers-wrap">';
635
  echo '<div class="twitter-followers-fts fts-tweets-first"><a href="' . esc_url( $user_permalink ) . '" target="_blank">' . esc_html( 'Tweets', 'feed-them-social' ) . '</a> ' . esc_html( $statuses_count ) . '</div>';
636
+ echo '<div class="twitter-followers-fts fts-following-link-div"><a href="' . esc_url( $user_permalink ) . '" target="_blank">' . esc_html( 'Following', 'feed-them-social' ) . '</a> ' . number_format( (float) $friends_count ) . '</div>';
637
  echo '<div class="twitter-followers-fts fts-followers-link-div"><a href="' . esc_url( $user_permalink ) . '" target="_blank">' . esc_html( 'Followers', 'feed-them-social' ) . '</a> ' . esc_html( $followers_count ) . '</div>';
638
+ echo '<div class="twitter-followers-fts fts-likes-link-div"><a href="' . esc_url( $user_permalink ) . '" target="_blank">' . esc_html( 'Likes', 'feed-them-social' ) . '</a> ' . number_format( (float) $favourites_count ) . '</div>';
639
  echo '</div>';
640
 
641
  }
673
  <?php
674
  }
675
 
676
+ // echo'<pre>';
677
+ // print_r($fetched_tweets->data);
678
  // echo'</pre>';
 
679
  $i = 0;
680
  foreach ( $fetched_tweets->data as $post_data ) {
681
 
includes/feed-them-functions.php CHANGED
@@ -3090,6 +3090,9 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3090
  } else {
3091
  $custom_date_check = 'F jS, Y \a\t g:ia';
3092
  }
 
 
 
3093
  if ( !empty( $fts_timezone ) ) {
3094
  date_default_timezone_set( $fts_timezone );
3095
  }
@@ -3104,6 +3107,7 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3104
  $u_time = !empty( $custom_date_check ) ? date_i18n( $custom_date_check, $fts_twitter_offset_time_final ) : $this->fts_ago( $created_time );
3105
  }
3106
  }
 
3107
  // Instagram date time!
3108
  if ( 'instagram' === $feed_type ) {
3109
  if ( 'one-day-ago' === $custom_date_check ) {
@@ -3148,6 +3152,10 @@ if ( ! empty( $youtube_loadmore_text_color ) ) {
3148
  $u_time = !empty( $custom_date_check ) ? date_i18n( $custom_date_check, strtotime( $created_time ) ) : $this->fts_ago( $created_time );
3149
  }
3150
  }
 
 
 
 
3151
  // Return the time!
3152
  return $u_time;
3153
  }
3090
  } else {
3091
  $custom_date_check = 'F jS, Y \a\t g:ia';
3092
  }
3093
+
3094
+ // Always store the current timezone so that it can be restored later
3095
+ $fts_old_timezone = date_default_timezone_get();
3096
  if ( !empty( $fts_timezone ) ) {
3097
  date_default_timezone_set( $fts_timezone );
3098
  }
3107
  $u_time = !empty( $custom_date_check ) ? date_i18n( $custom_date_check, $fts_twitter_offset_time_final ) : $this->fts_ago( $created_time );
3108
  }
3109
  }
3110
+
3111
  // Instagram date time!
3112
  if ( 'instagram' === $feed_type ) {
3113
  if ( 'one-day-ago' === $custom_date_check ) {
3152
  $u_time = !empty( $custom_date_check ) ? date_i18n( $custom_date_check, strtotime( $created_time ) ) : $this->fts_ago( $created_time );
3153
  }
3154
  }
3155
+
3156
+ // Restore the timezone to its value when entering this function to avoid side-effects
3157
+ date_default_timezone_set( $fts_old_timezone );
3158
+
3159
  // Return the time!
3160
  return $u_time;
3161
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: slickremix
3
  Tags: Facebook, Instagram, Twitter, YouTube, Feed
4
  Requires at least: 3.6.0
5
  Tested up to: 5.2
6
- Stable tag: 2.6.9
7
  License: GPLv2 or later
8
 
9
  Custom feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
@@ -75,6 +75,11 @@ Feed Them Social was Developed By SlickRemix --> [https://www.slickremix.com/](h
75
  * Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
76
 
77
  == Changelog ==
 
 
 
 
 
78
  = Version 2.6.9 Wednesday, May 17th, 2019 =
79
  * FIX: Twitter Feed: Fixed links with underscores to work proper, such as; #my_hashtag or @my_name.
80
  * FIX: Feeds Stylesheet: CSS value errors. Thanks to [@malae](https://wordpress.org/support/topic/errors-in-feeds-css-styles-cssver2-6-8/#post-11543949) for pointing out these errors.
3
  Tags: Facebook, Instagram, Twitter, YouTube, Feed
4
  Requires at least: 3.6.0
5
  Tested up to: 5.2
6
+ Stable tag: 2.7.0
7
  License: GPLv2 or later
8
 
9
  Custom feeds for Facebook Pages, Album Photos, Videos & Covers, Instagram, Twitter, Pinterest & YouTube on pages, posts or widgets.
75
  * Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
76
 
77
  == Changelog ==
78
+ = Version 2.7.0 Thursday, July 11th, 2019 =
79
+ * REMOVE: Remove Twitter Feed default options. This change will break all users trying to use Feed Them Socials past default tokens which are no longer available. You must retrieve your own tokens for the plugin to work.
80
+ * ADD: Message to Twitter options if no token is set.
81
+ * FIX: date_default_timezone_set to be set and not change other plugins set time.
82
+
83
  = Version 2.6.9 Wednesday, May 17th, 2019 =
84
  * FIX: Twitter Feed: Fixed links with underscores to work proper, such as; #my_hashtag or @my_name.
85
  * FIX: Feeds Stylesheet: CSS value errors. Thanks to [@malae](https://wordpress.org/support/topic/errors-in-feeds-css-styles-cssver2-6-8/#post-11543949) for pointing out these errors.