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

Version Description

Download this release

Release Info

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

Code changes from version 2.5.1 to 2.5.2

admin/feed-them-facebook-style-options-page.php CHANGED
@@ -139,16 +139,16 @@ class FTS_facebook_options_page
139
 
140
  if (isset($test_app_token_response->data->error->message) && empty($test_app_token_id) || isset($test_app_token_response->error->message) && empty($test_app_token_id)) {
141
 
142
- echo '<div class="fts-failed-api-token">' . __('To get started, please click the button above to retrieve your Access Token.', 'feed-them-social') . '</div>';
143
 
144
 
145
  }
146
  }
147
 
148
  } else {
149
- if (!isset($_GET['return_long_lived_token']) || isset($_GET['reviews_token'])) {
150
- echo '<div class="fts-failed-api-token">' . __('To get started, please click the button above to retrieve your Access Token.', 'feed-them-social') . '</div>';
151
- }
152
  }
153
  ?>
154
  <div class="clear"></div>
@@ -159,7 +159,7 @@ class FTS_facebook_options_page
159
  if (isset($_GET['return_long_lived_token']) && !isset($_GET['reviews_token'])) {
160
  // Echo our shortcode for the page token list with loadmore button
161
  // These functions are on feed-them-functions.php
162
- echo do_shortcode('[fts_fb_page_token]');
163
 
164
  } ?>
165
  </div>
139
 
140
  if (isset($test_app_token_response->data->error->message) && empty($test_app_token_id) || isset($test_app_token_response->error->message) && empty($test_app_token_id)) {
141
 
142
+ echo '<div class="fts-failed-api-token">' . __('To get started, please click the button above to retrieve your Access Token.', 'feed-them-social') . '</div>';
143
 
144
 
145
  }
146
  }
147
 
148
  } else {
149
+ if (!isset($_GET['return_long_lived_token']) || isset($_GET['reviews_token'])) {
150
+ echo '<div class="fts-failed-api-token">' . __('To get started, please click the button above to retrieve your Access Token.', 'feed-them-social') . '</div>';
151
+ }
152
  }
153
  ?>
154
  <div class="clear"></div>
159
  if (isset($_GET['return_long_lived_token']) && !isset($_GET['reviews_token'])) {
160
  // Echo our shortcode for the page token list with loadmore button
161
  // These functions are on feed-them-functions.php
162
+ echo do_shortcode('[fts_fb_page_token]');
163
 
164
  } ?>
165
  </div>
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.5.1
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 4.9.8
17
- * Stable tag: 2.5.1
18
  * License: GPLv2 or later
19
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
- * @version 2.5.1
22
  * @package FeedThemSocial/Core
23
  * @copyright Copyright (c) 2012-2018 SlickRemix
24
  *
@@ -27,7 +27,7 @@
27
  */
28
 
29
  // Makes sure any js or css changes are reloaded properly. Added to enqued css and js files throughout
30
- define('FTS_CURRENT_VERSION', '2.5.1');
31
 
32
  final class Feed_Them_Social {
33
 
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.5.2
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 4.9.8
17
+ * Stable tag: 2.5.2
18
  * License: GPLv2 or later
19
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
+ * @version 2.5.2
22
  * @package FeedThemSocial/Core
23
  * @copyright Copyright (c) 2012-2018 SlickRemix
24
  *
27
  */
28
 
29
  // Makes sure any js or css changes are reloaded properly. Added to enqued css and js files throughout
30
+ define('FTS_CURRENT_VERSION', '2.5.2');
31
 
32
  final class Feed_Them_Social {
33
 
includes/feed-them-functions.php CHANGED
@@ -187,18 +187,19 @@ class feed_them_social_functions
187
  ob_start();
188
 
189
  if(!isset($_GET['locations'])){
190
- $fb_token_response = isset($_REQUEST['next_url']) ? wp_remote_fopen($_REQUEST['next_url']) : wp_remote_fopen('https://graph.facebook.com/me/accounts?fields=locations{name,id,page_username,locations,store_number,store_location_descriptor,access_token},name,id,link,access_token&access_token=' . $_GET['access_token'] . '&limit=25');
191
  $test_fb_app_token_response = json_decode($fb_token_response);
192
  $_REQUEST['next_url'] = isset($test_fb_app_token_response->paging->next) ? $test_fb_app_token_response->paging->next : '';
193
  }
194
  else{
195
  $fb_token_response = isset($_REQUEST['next_location_url']) ? wp_remote_fopen($_REQUEST['next_location_url']) : '';
196
  $test_fb_app_token_response = json_decode($fb_token_response);
197
- // echo'<pre>';
198
- // print_r($test_fb_app_token_response);
199
- // echo'</pre>';
200
  }
201
 
 
 
 
 
202
  //Make sure it's not ajaxing
203
  if (!isset($_GET['load_more_ajaxing'])) {
204
  //******************
@@ -210,15 +211,15 @@ class feed_them_social_functions
210
 
211
  $build_shortcode = 'fts_fb_page_token';
212
 
213
- //Make sure it's not ajaxing
214
- if (!isset($_GET['load_more_ajaxing'])) {
215
 
216
- $reviews_token = isset($_GET['reviews_token']) ? 'yes' : 'no';
217
- ?>
218
- <div id="fb-list-wrap">
219
- <div class="fts-pages-info"> <?php _e('Click on a page in the list below and it will add the Page ID and Access Token above, then click save.', 'feed-them-social'); ?></div>
220
- <ul class="fb-page-list fb-page-master-list">
221
- <?php } //End make sure it's not ajaxing
222
 
223
  foreach ($test_fb_app_token_response->data as $data) {?>
224
  <li class="fts-fb-main-page-li">
@@ -241,122 +242,122 @@ class feed_them_social_functions
241
  <?php } ?>
242
  <div class="fts-clear"></div>
243
  </div>
244
- <?php
245
- $_REQUEST['next_location_url'] = isset($data->locations->paging->next) ? $data->locations->paging->next : '';
246
- $remove_class_or_not = isset($data->locations->paging->next) ? 'fb-sublist-page-id-' . $data->id : '';
247
- if(isset($data->locations->data)){
248
- $location_count = count($data->locations->data);
249
- $location_plus_sign = isset($data->locations->paging->next) ? '+' : '';
250
- $location_text = $location_count === 1 ? $location_count .' '.__('Location for', 'feed-them-social') : $location_count.$location_plus_sign.' '.__('Locations for', 'feed-them-social');
251
- // if the locations equal 3 or less we will set the location container height to auto so the scroll loadmore does not fire.
252
- $location_scroll_loadmore_needed_check = $location_count <= 3 ? 'style="height:auto !important"' : '';
253
- }
254
 
255
- if(!isset($_GET['locations']) && isset($data->locations->data)) { ?>
256
- <div class="fts-fb-location-text-wrap"><?php print $location_text ?> <?php print $data->name ?></div>
257
- <ul class="fb-page-list fb-sublist <?php print $remove_class_or_not ?>" <?php echo $location_scroll_loadmore_needed_check?> style="height: 200px !important;">
258
- <?php foreach ($data->locations->data as $location) { ?>
259
- <li>
260
- <div class="fb-click-wrapper">
261
- <div class="fb-image">
262
- <img border="0" height="50" width="50" src="https://graph.facebook.com/<?php print $location->id ?>/picture"/>
263
- </div>
264
- <div class="fb-name-wrap"><span class="fb-name"><?php print $location->name ?> <?php if(isset($location->store_location_descriptor)){ print '('.$location->store_location_descriptor.')'; } ?></span></div>
265
- <div class="fb-other-wrap"><small><?php _e('ID: ', 'feed-them-social'); print '<span class="fts-api-facebook-id">'; print $location->id; print '</span>'; ?> <?php if(isset($location->store_number)){ print '| '; _e('Location:', 'feed-them-social'); print ' '.$location->store_number; } ?></small></div>
266
-
267
- <div class="page-token"><?php print $location->access_token ?></div>
268
- <?php
269
- $facebook_input_token = get_option('fts_facebook_custom_api_token');
270
- $facebook_access_token = $location->access_token;
271
- if ($facebook_input_token == $facebook_access_token) {
272
- ?>
273
- <div class="feed-them-social-admin-submit-btn " style="display: block !important;">Active
274
- </div>
275
- <?php } else { ?>
276
- <div class="feed-them-social-admin-submit-btn fts-token-save">Save</div>
277
- <?php } ?>
278
- <div class="fts-clear"></div>
279
- </div>
280
- </li>
281
  <?php } ?>
282
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
 
284
- <?php
285
- //Make sure it's not ajaxing locations
286
- if (!isset($_GET['locations']) && isset($data->locations->paging->next)) {
287
- print '<div id="loadMore_' . $data->id . '_location" class="fts-fb-load-more" style="background:none !Important;">' . __('Scroll to view more Locations', 'feed-them-instagram') . '</div>';
288
- }//End Check
289
-
290
- //Make sure it's not ajaxing locations
291
- if (!isset($_GET['locations'])) {
292
- $time = time();
293
- $nonce = wp_create_nonce($time . "load-more-nonce");
294
- $fbPageID = $data->id;
295
- ?>
296
- <script>
297
- jQuery(document).ready(function () {
298
- jQuery(".fb-sublist-page-id-<?php echo $fbPageID ?>").bind("scroll", function () {
299
- if (jQuery(this).scrollTop() + jQuery(this).innerHeight() >= jQuery(this)[0].scrollHeight) {
300
- if(!jQuery('.fts-no-more-locations-<?php echo $fbPageID ?>').length){
301
- jQuery("#loadMore_<?php echo $fbPageID ?>_location").addClass('fts-fb-spinner');
302
- var button = jQuery('#loadMore_<?php echo $fbPageID ?>_location').html('<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>');
303
- console.log(button);
304
- var build_shortcode = "<?php print $build_shortcode;?>";
305
- var yes_ajax = "yes";
306
- var fts_d_name = "<?php echo $fbPageID;?>";
307
- var fts_security = "<?php echo $nonce;?>";
308
- var fts_time = "<?php echo $time;?>";
309
- var fts_reviews_feed = "<?php print $reviews_token;?>";
310
- jQuery.ajax({
311
- data: {
312
- action: "my_fts_fb_load_more",
313
- next_location_url: nextURL_location_<?php echo $fbPageID ?>,
314
- fts_dynamic_name: fts_d_name,
315
- rebuilt_shortcode: build_shortcode,
316
- load_more_ajaxing: yes_ajax,
317
- fts_security: fts_security,
318
- fts_time: fts_time,
319
- feed_name: build_shortcode,
320
- fts_reviews_feed: fts_reviews_feed,
321
- locations: 'yes'
322
- },
323
- type: 'GET',
324
- url: ajaxurl,
325
- success: function (data) {
326
- console.log('Well Done and got this from sever: ' + data);
327
- jQuery('.fb-sublist-page-id-<?php echo $fbPageID;?>').append(data).filter('.fb-sublist-page-id-<?php echo $fbPageID;?>').html();
328
- jQuery('.fb-sublist-page-id-<?php echo $fbPageID?>').animate({scrollTop: '+=100px'}, 800); // scroll down a 100px after new items are added
329
-
330
-
331
-
332
- <?php if(isset($data->locations->paging->next) && $data->locations->paging->next == $_REQUEST['next_location_url']) { ?>
333
- jQuery('#loadMore_<?php echo $fbPageID ?>_location').replaceWith('<div class="fts-fb-load-more no-more-posts-fts-fb fts-no-more-locations-<?php echo $fbPageID ?>" style="background:none !important"><?php _e('All Locations loaded', 'feed-them-social') ?></div>');
334
- jQuery('#loadMore_<?php echo $fbPageID ?>_location').removeAttr('id');
335
- <?php } ?>
336
- // jQuery('#loadMore_<?php echo $fbPageID ?>_location').html('<?php _e('Keep Scrolling to view more Locations', 'feed-them-social') ?>');
337
- // jQuery('#loadMore_< ?php echo $fbPageID ?>').removeClass('flip360-fts-load-more');
338
- jQuery("#loadMore_<?php echo $fbPageID ?>_location").removeClass('fts-fb-spinner');
339
- }
340
- }); // end of ajax()
341
- return false;
342
-
343
- } //stop ajax from submitting again if the fts-no-more-locations class is found
344
-
345
- }
346
- }); // end of form.submit
347
-
348
- }); // end of document.ready
349
- </script>
350
- <?php
351
- } //END Make sure it's not ajaxing locations ?>
352
- <script>var nextURL_location_<?php echo $fbPageID; ?>= "<?php echo isset($data->locations->paging->next) ? $data->locations->paging->next : ''?>";</script>
353
- <?php } ?>
354
  </li>
355
 
356
  <?php } // foreach loop of locations
357
 
358
- //Make sure it's not ajaxing
359
- if (!isset($_GET['load_more_ajaxing'])) { ?>
360
  </ul>
361
  <div class="fts-clear"></div>
362
  </div>
@@ -421,9 +422,9 @@ class feed_them_social_functions
421
  ?>
422
  <script>
423
  <?php if(!isset($_GET['locations'])) {?>
424
- var nextURL_<?php echo $_REQUEST['fts_dynamic_name']; ?>= "<?php echo $_REQUEST['next_url']; ?>";
425
- // alert('nextURL_<?php echo $_REQUEST['fts_dynamic_name']; ?>');
426
- <?php } ?>
427
 
428
 
429
  if (document.querySelector('#fts-fb-token-wrap .fts-pages-info') !== null) {
@@ -487,10 +488,10 @@ class feed_them_social_functions
487
 
488
  // Lastly if we can't find a next url we unset the next url from the page to not let the loadmore button be active.
489
  if(!isset($_GET['locations'])) {
490
- unset($_REQUEST['next_url']);
491
  }
492
  else {
493
- unset($_REQUEST['next_location_url']);
494
  }
495
  return ob_get_clean();
496
  }
@@ -635,8 +636,17 @@ class feed_them_social_functions
635
  exit('Sorry, You can\'t do that!');
636
  } else {
637
 
 
 
 
 
 
 
 
 
 
 
638
  if (
639
- $_REQUEST['feed_name'] == 'fts_fb_page_token' ||
640
  $_REQUEST['feed_name'] == 'fts_fb_page_token' ||
641
  $_REQUEST['feed_name'] == 'fts_twitter' ||
642
  $_REQUEST['feed_name'] == 'fts_youtube' ||
187
  ob_start();
188
 
189
  if(!isset($_GET['locations'])){
190
+ $fb_token_response = isset($_REQUEST['next_url']) ? wp_remote_fopen($_REQUEST['next_url']) : wp_remote_fopen('https://graph.facebook.com/me/accounts?fields=locations{name,id,page_username,locations,store_number,store_location_descriptor,access_token},name,id,link,access_token&access_token=' . $_GET['access_token'] . '&limit=2');
191
  $test_fb_app_token_response = json_decode($fb_token_response);
192
  $_REQUEST['next_url'] = isset($test_fb_app_token_response->paging->next) ? $test_fb_app_token_response->paging->next : '';
193
  }
194
  else{
195
  $fb_token_response = isset($_REQUEST['next_location_url']) ? wp_remote_fopen($_REQUEST['next_location_url']) : '';
196
  $test_fb_app_token_response = json_decode($fb_token_response);
 
 
 
197
  }
198
 
199
+ // echo'<pre>';
200
+ // print_r($test_fb_app_token_response);
201
+ // echo'</pre>';
202
+
203
  //Make sure it's not ajaxing
204
  if (!isset($_GET['load_more_ajaxing'])) {
205
  //******************
211
 
212
  $build_shortcode = 'fts_fb_page_token';
213
 
214
+ //Make sure it's not ajaxing
215
+ if (!isset($_GET['load_more_ajaxing'])) {
216
 
217
+ $reviews_token = isset($_GET['reviews_token']) ? 'yes' : 'no';
218
+ ?>
219
+ <div id="fb-list-wrap">
220
+ <div class="fts-pages-info"> <?php _e('Click on a page in the list below and it will add the Page ID and Access Token above, then click save.', 'feed-them-social'); ?></div>
221
+ <ul class="fb-page-list fb-page-master-list">
222
+ <?php } //End make sure it's not ajaxing
223
 
224
  foreach ($test_fb_app_token_response->data as $data) {?>
225
  <li class="fts-fb-main-page-li">
242
  <?php } ?>
243
  <div class="fts-clear"></div>
244
  </div>
245
+ <?php
246
+ $_REQUEST['next_location_url'] = isset($data->locations->paging->next) ? $data->locations->paging->next : '';
247
+ $remove_class_or_not = isset($data->locations->paging->next) ? 'fb-sublist-page-id-' . $data->id : '';
248
+ if(isset($data->locations->data)){
249
+ $location_count = count($data->locations->data);
250
+ $location_plus_sign = isset($data->locations->paging->next) ? '+' : '';
251
+ $location_text = $location_count === 1 ? $location_count .' '.__('Location for', 'feed-them-social') : $location_count.$location_plus_sign.' '.__('Locations for', 'feed-them-social');
252
+ // if the locations equal 3 or less we will set the location container height to auto so the scroll loadmore does not fire.
253
+ $location_scroll_loadmore_needed_check = $location_count <= 3 ? 'style="height:auto !important"' : '';
254
+ }
255
 
256
+ if(!isset($_GET['locations']) && isset($data->locations->data)) { ?>
257
+ <div class="fts-fb-location-text-wrap"><?php print $location_text ?> <?php print $data->name ?></div>
258
+ <ul class="fb-page-list fb-sublist <?php print $remove_class_or_not ?>" <?php echo $location_scroll_loadmore_needed_check?> style="height: 200px !important;">
259
+ <?php foreach ($data->locations->data as $location) { ?>
260
+ <li>
261
+ <div class="fb-click-wrapper">
262
+ <div class="fb-image">
263
+ <img border="0" height="50" width="50" src="https://graph.facebook.com/<?php print $location->id ?>/picture"/>
264
+ </div>
265
+ <div class="fb-name-wrap"><span class="fb-name"><?php print $location->name ?> <?php if(isset($location->store_location_descriptor)){ print '('.$location->store_location_descriptor.')'; } ?></span></div>
266
+ <div class="fb-other-wrap"><small><?php _e('ID: ', 'feed-them-social'); print '<span class="fts-api-facebook-id">'; print $location->id; print '</span>'; ?> <?php if(isset($location->store_number)){ print '| '; _e('Location:', 'feed-them-social'); print ' '.$location->store_number; } ?></small></div>
267
+
268
+ <div class="page-token"><?php print $location->access_token ?></div>
269
+ <?php
270
+ $facebook_input_token = get_option('fts_facebook_custom_api_token');
271
+ $facebook_access_token = $location->access_token;
272
+ if ($facebook_input_token == $facebook_access_token) {
273
+ ?>
274
+ <div class="feed-them-social-admin-submit-btn " style="display: block !important;">Active
275
+ </div>
276
+ <?php } else { ?>
277
+ <div class="feed-them-social-admin-submit-btn fts-token-save">Save</div>
 
 
 
 
278
  <?php } ?>
279
+ <div class="fts-clear"></div>
280
+ </div>
281
+ </li>
282
+ <?php } ?>
283
+ </ul>
284
+
285
+ <?php
286
+ //Make sure it's not ajaxing locations
287
+ if (!isset($_GET['locations']) && isset($data->locations->paging->next)) {
288
+ print '<div id="loadMore_' . $data->id . '_location" class="fts-fb-load-more" style="background:none !Important;">' . __('Scroll to view more Locations', 'feed-them-instagram') . '</div>';
289
+ }//End Check
290
+
291
+ //Make sure it's not ajaxing locations
292
+ if (!isset($_GET['locations'])) {
293
+ $time = time();
294
+ $nonce = wp_create_nonce($time . "load-more-nonce");
295
+ $fbPageID = $data->id;
296
+ ?>
297
+ <script>
298
+ jQuery(document).ready(function () {
299
+ jQuery(".fb-sublist-page-id-<?php echo $fbPageID ?>").bind("scroll", function () {
300
+ if (jQuery(this).scrollTop() + jQuery(this).innerHeight() >= jQuery(this)[0].scrollHeight) {
301
+ if(!jQuery('.fts-no-more-locations-<?php echo $fbPageID ?>').length){
302
+ jQuery("#loadMore_<?php echo $fbPageID ?>_location").addClass('fts-fb-spinner');
303
+ var button = jQuery('#loadMore_<?php echo $fbPageID ?>_location').html('<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>');
304
+ console.log(button);
305
+ var build_shortcode = "<?php print $build_shortcode;?>";
306
+ var yes_ajax = "yes";
307
+ var fts_d_name = "<?php echo $fbPageID;?>";
308
+ var fts_security = "<?php echo $nonce;?>";
309
+ var fts_time = "<?php echo $time;?>";
310
+ var fts_reviews_feed = "<?php print $reviews_token;?>";
311
+ jQuery.ajax({
312
+ data: {
313
+ action: "my_fts_fb_load_more",
314
+ next_location_url: nextURL_location_<?php echo $fbPageID ?>,
315
+ fts_dynamic_name: fts_d_name,
316
+ rebuilt_shortcode: build_shortcode,
317
+ load_more_ajaxing: yes_ajax,
318
+ fts_security: fts_security,
319
+ fts_time: fts_time,
320
+ feed_name: build_shortcode,
321
+ fts_reviews_feed: fts_reviews_feed,
322
+ locations: 'yes'
323
+ },
324
+ type: 'GET',
325
+ url: ajaxurl,
326
+ success: function (data) {
327
+ console.log('Well Done and got this from sever: ' + data);
328
+ jQuery('.fb-sublist-page-id-<?php echo $fbPageID;?>').append(data).filter('.fb-sublist-page-id-<?php echo $fbPageID;?>').html();
329
+ jQuery('.fb-sublist-page-id-<?php echo $fbPageID?>').animate({scrollTop: '+=100px'}, 800); // scroll down a 100px after new items are added
330
+
331
+
332
+
333
+ <?php if(isset($data->locations->paging->next) && $data->locations->paging->next == $_REQUEST['next_location_url']) { ?>
334
+ jQuery('#loadMore_<?php echo $fbPageID ?>_location').replaceWith('<div class="fts-fb-load-more no-more-posts-fts-fb fts-no-more-locations-<?php echo $fbPageID ?>" style="background:none !important"><?php _e('All Locations loaded', 'feed-them-social') ?></div>');
335
+ jQuery('#loadMore_<?php echo $fbPageID ?>_location').removeAttr('id');
336
+ <?php } ?>
337
+ // jQuery('#loadMore_<?php echo $fbPageID ?>_location').html('<?php _e('Keep Scrolling to view more Locations', 'feed-them-social') ?>');
338
+ // jQuery('#loadMore_< ?php echo $fbPageID ?>').removeClass('flip360-fts-load-more');
339
+ jQuery("#loadMore_<?php echo $fbPageID ?>_location").removeClass('fts-fb-spinner');
340
+ }
341
+ }); // end of ajax()
342
+ return false;
343
+
344
+ } //stop ajax from submitting again if the fts-no-more-locations class is found
345
 
346
+ }
347
+ }); // end of form.submit
348
+
349
+ }); // end of document.ready
350
+ </script>
351
+ <?php
352
+ } //END Make sure it's not ajaxing locations ?>
353
+ <script>var nextURL_location_<?php echo $fbPageID; ?>= "<?php echo isset($data->locations->paging->next) ? $data->locations->paging->next : ''?>";</script>
354
+ <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  </li>
356
 
357
  <?php } // foreach loop of locations
358
 
359
+ //Make sure it's not ajaxing
360
+ if (!isset($_GET['load_more_ajaxing'])) { ?>
361
  </ul>
362
  <div class="fts-clear"></div>
363
  </div>
422
  ?>
423
  <script>
424
  <?php if(!isset($_GET['locations'])) {?>
425
+ var nextURL_<?php echo $_REQUEST['fts_dynamic_name']; ?>= "<?php echo $_REQUEST['next_url']; ?>";
426
+ // alert('nextURL_<?php echo $_REQUEST['fts_dynamic_name']; ?>');
427
+ <?php } ?>
428
 
429
 
430
  if (document.querySelector('#fts-fb-token-wrap .fts-pages-info') !== null) {
488
 
489
  // Lastly if we can't find a next url we unset the next url from the page to not let the loadmore button be active.
490
  if(!isset($_GET['locations'])) {
491
+ unset($_REQUEST['next_url']);
492
  }
493
  else {
494
+ unset($_REQUEST['next_location_url']);
495
  }
496
  return ob_get_clean();
497
  }
636
  exit('Sorry, You can\'t do that!');
637
  } else {
638
 
639
+ if($_REQUEST['feed_name'] == 'fts_fb_page_token') {
640
+ if(isset($_REQUEST['next_url']) && strpos($_REQUEST['next_url'],'https://graph.facebook.com/v3.1') === false ||
641
+ isset($_REQUEST['next_location_url']) && strpos($_REQUEST['next_location_url'],'https://graph.facebook.com/v3.1') === false ||
642
+ isset($_REQUEST['next_url']) && esc_url_raw($_REQUEST['next_url']) !== $_REQUEST['next_url'] ||
643
+ isset($_REQUEST['next_location_url']) && esc_url_raw($_REQUEST['next_location_url']) !== $_REQUEST['next_location_url']) {
644
+
645
+ exit('That is not an FTS shortcode!');
646
+ }
647
+ }
648
+
649
  if (
 
650
  $_REQUEST['feed_name'] == 'fts_fb_page_token' ||
651
  $_REQUEST['feed_name'] == 'fts_twitter' ||
652
  $_REQUEST['feed_name'] == 'fts_youtube' ||
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: 4.9.8
6
- Stable tag: 2.5.1
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.
@@ -76,6 +76,9 @@ Feed Them Social was Developed By SlickRemix --> [https://www.slickremix.com/](h
76
  * Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
77
 
78
  == Changelog ==
 
 
 
79
  = Version 2.5.1 Friday, September 21st, 2018 =
80
  * NEW: Facebook Options: If you have Location pages you can get an access token for each one now when clicking the get access token button on the Facebook Options page of our plugin.
81
  * FIX: Facebook Feed: warning notice coming up for $FBpost_single_id
3
  Tags: Facebook, Instagram, Twitter, YouTube, Feed
4
  Requires at least: 3.6.0
5
  Tested up to: 4.9.8
6
+ Stable tag: 2.5.2
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.
76
  * Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
77
 
78
  == Changelog ==
79
+ = Version 2.5.2 Thursday, September 27th, 2018 =
80
+ * FIX: Facebook Options: Additional check to make sure the next url does not contain malicious code.
81
+
82
  = Version 2.5.1 Friday, September 21st, 2018 =
83
  * NEW: Facebook Options: If you have Location pages you can get an access token for each one now when clicking the get access token button on the Facebook Options page of our plugin.
84
  * FIX: Facebook Feed: warning notice coming up for $FBpost_single_id