Custom Facebook Feed - Version 2.6.1

Version Description

  • Fix: Removed an unnecessary API call
  • Fix: Removed a PHP notice which was displayed under rare circumstances
  • Fix: Minor bug fixes
Download this release

Release Info

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

Code changes from version 2.6 to 2.6.1

Files changed (2) hide show
  1. README.txt +6 -1
  2. custom-facebook-feed.php +24 -8
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.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -265,6 +265,11 @@ You no longer need your own Access Token to use the Custom Facebook Feed Plugin,
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
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.1
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.1 =
269
+ * Fix: Removed an unnecessary API call
270
+ * Fix: Removed a PHP notice which was displayed under rare circumstances
271
+ * Fix: Minor bug fixes
272
+
273
  = 2.6 =
274
  * Fix: Fixed an issue connecting to the Facebook API caused by a recent Facebook platform change
275
  * Tweak: Increased the minimum caching time to be 15 minutes to reduce Facebook API requests
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.6
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.6');
28
 
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
  //Include admin
@@ -679,9 +679,17 @@ function display_cff($atts) {
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 == '') {
@@ -854,6 +862,12 @@ function display_cff($atts) {
854
 
855
  $cff_posts_json_url = 'https://graph.facebook.com/' . $page_id . '/' . $graph_query . '?fields=id,from,message,message_tags,story,story_tags,link,source,name,caption,description,type,status_type,object_id,created_time&access_token=' . $access_token . '&limit=' . $cff_post_limit . '&locale=' . $cff_locale . $cff_ssl;
856
 
 
 
 
 
 
 
857
  //Don't use caching if the cache time is set to zero
858
  if ($cff_cache_time != 0){
859
 
@@ -980,12 +994,14 @@ function display_cff($atts) {
980
  //ONLY show posts by others
981
  if ( $cff_show_only_others ) {
982
  //Get the numeric ID of the page
983
- $page_object = cff_fetchUrl('https://graph.facebook.com/' . $page_id . '?fields=name,id&access_token=' . $access_token);
984
- $page_object = json_decode($page_object);
985
- $numeric_page_id = $page_object->id;
986
 
987
  //If the post author's ID is the same as the page ID then don't show the post
988
- if ( $numeric_page_id == $news->from->id ) $cff_show_post = false;
 
 
989
  }
990
 
991
 
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.1
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.1');
28
 
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
  //Include admin
679
  '1983264355330375|e5c100f6d4b768abb560e7df1771ac89',
680
  '209804229584368|3a2d59f876e0df3d42d829f8a1569636',
681
  '274376249625432|03d7cc70158f4b720a124c11aad5606e',
682
+ '366766273734391|b9894da4ba6d4d75b500d13fda893810',
683
+ '157849737751172|1wgUYn-UwVvoiZkvROi7yi2aIRw',
684
+ '140081703552|rtuoT3AGRIzb-z_PPUlOnN9iYA0',
685
+ '322095208287051|pbCTS6jPuhjR18sl2UPhKQw7eyY',
686
+ '997699293639941|RSjkTO49QlpW3allK2Xqb87wmnc',
687
+ '1042396375891598|gn2HiZgDgjTbCMcXsSb6VK91PqM',
688
+ '2025362117734029|_Y9UZU0qE-EYJrDpgLTvuD9EcVw',
689
+ '502797619766223|fuoqcs_7_9HPokY0C296S4VtB0o',
690
+ '1399391236784002|zx6bKxr-c8xfOPvCc0ZxP6vyGXs'
691
  );
692
+ if ($access_token == '' || !$cff_show_access_token) $access_token = $access_token_array[rand(0, 15)];
693
 
694
  //Check whether a Page ID has been defined
695
  if ($page_id == '') {
862
 
863
  $cff_posts_json_url = 'https://graph.facebook.com/' . $page_id . '/' . $graph_query . '?fields=id,from,message,message_tags,story,story_tags,link,source,name,caption,description,type,status_type,object_id,created_time&access_token=' . $access_token . '&limit=' . $cff_post_limit . '&locale=' . $cff_locale . $cff_ssl;
864
 
865
+ //Temporarily set caching time to be minimum of 30 minutes
866
+ if( $cache_seconds < 1800 || !isset($cache_seconds) ) $cache_seconds = 1800;
867
+
868
+ //Temporarily increase default caching time to be 2 hours
869
+ if( $cache_seconds == 3600 ) $cache_seconds = 7200;
870
+
871
  //Don't use caching if the cache time is set to zero
872
  if ($cff_cache_time != 0){
873
 
994
  //ONLY show posts by others
995
  if ( $cff_show_only_others ) {
996
  //Get the numeric ID of the page
997
+ $fbdata_string = $FBdata->data;
998
+ $first_post_id = explode("_", $fbdata_string[0]->id);
999
+ $numeric_page_id = $first_post_id[0];
1000
 
1001
  //If the post author's ID is the same as the page ID then don't show the post
1002
+ if( isset($news->from->id) ){
1003
+ if ( $numeric_page_id == $news->from->id ) $cff_show_post = false;
1004
+ }
1005
  }
1006
 
1007