Custom Facebook Feed - Version 2.6

Version Description

  • Fix: Fixed an issue connecting to the Facebook API caused by a recent Facebook platform change
  • Tweak: Increased the minimum caching time to be 15 minutes to reduce Facebook API requests
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Custom Facebook Feed
Version 2.6
Comparing to
See all releases

Code changes from version 2.5.2 to 2.6

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon
3
  Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook page
4
  Requires at least: 3.0
5
  Tested up to: 4.9
6
- Stable tag: 2.5.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -265,6 +265,10 @@ You no longer need your own Access Token to use the Custom Facebook Feed Plugin,
265
 
266
  == Changelog ==
267
 
 
 
 
 
268
  = 2.5.2 =
269
  * Important: Due to sudden changes in the Facebook API it is no longer possible to display posts from a Facebook Group. Please [see here](https://smashballoon.com/facebook-api-changes-april-4-2018/) for more information. We apologize for any frustration or inconvenience this has caused.
270
  * Removed: Due to Facebook API restrictions, it is no longer possible to display information about an event when it is posted or shared to your Facebook Page timeline.
3
  Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook page
4
  Requires at least: 3.0
5
  Tested up to: 4.9
6
+ Stable tag: 2.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
265
 
266
  == Changelog ==
267
 
268
+ = 2.6 =
269
+ * Fix: Fixed an issue connecting to the Facebook API caused by a recent Facebook platform change
270
+ * Tweak: Increased the minimum caching time to be 15 minutes to reduce Facebook API requests
271
+
272
  = 2.5.2 =
273
  * Important: Due to sudden changes in the Facebook API it is no longer possible to display posts from a Facebook Group. Please [see here](https://smashballoon.com/facebook-api-changes-april-4-2018/) for more information. We apologize for any frustration or inconvenience this has caused.
274
  * Removed: Due to Facebook API restrictions, it is no longer possible to display information about an event when it is posted or shared to your Facebook Page timeline.
custom-facebook-feed-admin.php CHANGED
@@ -559,7 +559,7 @@ function cff_settings_page() {
559
 
560
  <?php
561
  $access_token = get_option( $access_token );
562
- if ( $access_token == '' || empty($access_token) ) $access_token = '611606915581035|RdRHbHtrHseQw4C7SDUBFWIrJLA';
563
  ?>
564
  <?php $posts_json = cff_fetchUrl("https://graph.facebook.com/".get_option( trim($page_id) )."/feed?access_token=". trim($access_token) ."&limit=1"); ?>
565
 
559
 
560
  <?php
561
  $access_token = get_option( $access_token );
562
+ if ( $access_token == '' || empty($access_token) ) $access_token = '366766273734391|b9894da4ba6d4d75b500d13fda893810';
563
  ?>
564
  <?php $posts_json = cff_fetchUrl("https://graph.facebook.com/".get_option( trim($page_id) )."/feed?access_token=". trim($access_token) ."&limit=1"); ?>
565
 
custom-facebook-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Custom Facebook Feed
4
  Plugin URI: http://smashballoon.com/custom-facebook-feed
5
  Description: Add completely customizable Facebook feeds to your WordPress site
6
- Version: 2.5.2
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -24,7 +24,7 @@ along with this program; if not, write to the Free Software
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
- define('CFFVER', '2.5.2');
28
 
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
  //Include admin
@@ -240,12 +240,12 @@ function display_cff($atts) {
240
  $cff_cache_time = $atts[ 'cachetime' ];
241
  $cff_locale = $atts[ 'locale' ];
242
  if ( empty($cff_locale) || !isset($cff_locale) || $cff_locale == '' ) $cff_locale = 'en_US';
243
- if (!isset($cff_cache_time)) $cff_cache_time = 0;
244
  $cff_cache_time_unit = $atts[ 'cacheunit' ];
245
 
246
- //Don't allow cache time to be zero - set to 1 minute instead to minimize API requests
247
- if(!isset($cff_cache_time) || $cff_cache_time == '0'){
248
- $cff_cache_time = 1;
249
  $cff_cache_time_unit = 'minutes';
250
  }
251
  if($cff_cache_time == 'none') $cff_cache_time = 0;
@@ -672,29 +672,16 @@ function display_cff($atts) {
672
 
673
  //If there's no Access Token then use a default
674
  $access_token_array = array(
675
- '772762049525257|UksMy-gYmk78WNHVEsimaf8uar4',
676
- '1611234219197161|PenH1iYmf3CShpuWiLMrP6_0mro',
677
- '842457575860455|MA2WQAK6MO22mYlD1vAfQmY-jNQ',
678
- '1598576770461963|t3KRNHf1490G8qEopdGoUiMPJ7I',
679
- '1774415812787078|3yGpMpgbH-Nte9YHCfVIQ59RIt8',
680
- '762305090538008|KmVsImjHmaJIPTpII9HyOif3yD0',
681
- '1741187749472232|b1ZfgQ2OSQZzsQN1lqLn4vjrQV4',
682
- '1748310315388907|AMSWRHgAoChtXepfsWU0OxKfVbQ',
683
- '1721409114785415|4dIAXp4_utfqkAJS-9X4OXB6GR4',
684
- '1609030662756868|nCKsZPN4cI-GsIJsi0DESGGtSgw',
685
- '1590773627916704|EbgBWG45AVQZdNrwsAnTl_-CW_A',
686
- '227652200958404|AzHtmm3B080elswwLKJrRCKYpGg',
687
- '1176842909001332|YIQehZhGPWxqkvmiFn4Klt1PA4U',
688
- '217933725249790|h4YSEYX71EO_2el93hiT47uyf5g',
689
- '823681761071502|0oAyJYz-MO-jgr8rI3ftrEcBRiQ',
690
- '360558880785446|4jyruti_VkxxK7gS7JeyX-EuSXs',
691
- '1487072591579718|0KQzP-O2E4mvFCPxTLWP1b87I4Q',
692
- '640861236031365|2rENQzxtWtG12DtlZwqfZ6Vu6BE',
693
- '334487440086538|hI_NNy1NvxQiQxm-TtXsrmoCVaE',
694
- '755471677869105|Jxv8xVDad7vUUTauk8K2o71wG2w',
695
- '518353204973067|dA7YTe-k8eSvgZ8lqa51xSm16DA'
696
  );
697
- if ($access_token == '' || !$cff_show_access_token) $access_token = $access_token_array[rand(0, 20)];
698
 
699
  //Check whether a Page ID has been defined
700
  if ($page_id == '') {
3
  Plugin Name: Custom Facebook Feed
4
  Plugin URI: http://smashballoon.com/custom-facebook-feed
5
  Description: Add completely customizable Facebook feeds to your WordPress site
6
+ Version: 2.6
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
+ define('CFFVER', '2.6');
28
 
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
  //Include admin
240
  $cff_cache_time = $atts[ 'cachetime' ];
241
  $cff_locale = $atts[ 'locale' ];
242
  if ( empty($cff_locale) || !isset($cff_locale) || $cff_locale == '' ) $cff_locale = 'en_US';
243
+ if (!isset($cff_cache_time)) $cff_cache_time = '0';
244
  $cff_cache_time_unit = $atts[ 'cacheunit' ];
245
 
246
+ //Don't allow cache time to be less than 15 minutes in order to minimize API requests
247
+ if(!isset($cff_cache_time) || $cff_cache_time == '0' || (intval($cff_cache_time) < 15 && $cff_cache_time_unit == 'minutes' ) ){
248
+ $cff_cache_time = 15;
249
  $cff_cache_time_unit = 'minutes';
250
  }
251
  if($cff_cache_time == 'none') $cff_cache_time = 0;
672
 
673
  //If there's no Access Token then use a default
674
  $access_token_array = array(
675
+ '1786066011417150|5043eac44ee54731ed404b9db021cdf2',
676
+ '1795317140689602|e25d547c4f12164254f85eead086b0a7',
677
+ '181607922248075|d0787a2cfff89efd23b9fe1ffafa45db',
678
+ '1851314935096786|0de2a9ec77d745d6941850696ce166f9',
679
+ '1983264355330375|e5c100f6d4b768abb560e7df1771ac89',
680
+ '209804229584368|3a2d59f876e0df3d42d829f8a1569636',
681
+ '274376249625432|03d7cc70158f4b720a124c11aad5606e',
682
+ '366766273734391|b9894da4ba6d4d75b500d13fda893810'
 
 
 
 
 
 
 
 
 
 
 
 
 
683
  );
684
+ if ($access_token == '' || !$cff_show_access_token) $access_token = $access_token_array[rand(0, 7)];
685
 
686
  //Check whether a Page ID has been defined
687
  if ($page_id == '') {