Custom Facebook Feed - Version 2.6.2

Version Description

  • Fix: Replaced all HTTP links with HTTPS
  • Fix: Fixed a rare issue which affected the layout of other Facebook widgets
  • Fix: Automatically remove slashes at the end of the Page ID as it caused an error
  • Fix: The API response test in the System Info now only tests with your token if you have the "Use my own Access Token" setting enabled
  • Fix: Fixed an issue which caused an occasional API rate limit error
Download this release

Release Info

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

Code changes from version 2.6.1 to 2.6.2

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.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -265,6 +265,13 @@ You no longer need your own Access Token to use the Custom Facebook Feed Plugin,
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
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.2
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.2 =
269
+ * Fix: Replaced all HTTP links with HTTPS
270
+ * Fix: Fixed a rare issue which affected the layout of other Facebook widgets
271
+ * Fix: Automatically remove slashes at the end of the Page ID as it caused an error
272
+ * Fix: The API response test in the System Info now only tests with your token if you have the "Use my own Access Token" setting enabled
273
+ * Fix: Fixed an issue which caused an occasional API rate limit error
274
+
275
  = 2.6.1 =
276
  * Fix: Removed an unnecessary API call
277
  * Fix: Removed a PHP notice which was displayed under rare circumstances
css/cff-style.css CHANGED
@@ -404,7 +404,7 @@
404
  .cff-likebox .fb_iframe_widget span{
405
  width: 100% !important;
406
  }
407
- .cff-likebox iframe{
408
  margin: 0;
409
  position: relative;
410
  top: 0;
404
  .cff-likebox .fb_iframe_widget span{
405
  width: 100% !important;
406
  }
407
+ .cff-likebox .fb_iframe_widget iframe{
408
  margin: 0;
409
  position: relative;
410
  top: 0;
custom-facebook-feed-admin.php CHANGED
@@ -558,8 +558,9 @@ function cff_settings_page() {
558
  <h3><?php _e('System Info &nbsp; <i style="color: #666; font-size: 11px; font-weight: normal;">Click the text below to select all</i>', 'custom-facebook-feed'); ?></h3>
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
 
558
  <h3><?php _e('System Info &nbsp; <i style="color: #666; font-size: 11px; font-weight: normal;">Click the text below to select all</i>', 'custom-facebook-feed'); ?></h3>
559
 
560
  <?php
561
+ $cff_use_own_token = get_option( 'cff_show_access_token' );
562
  $access_token = get_option( $access_token );
563
+ if ( $access_token == '' || empty($access_token) || ( !isset($cff_use_own_token) || empty($cff_use_own_token) ) ) $access_token = '297576260660946|iCDRJNnG9EAJplgB-vkMR2q2ob0';
564
  ?>
565
  <?php $posts_json = cff_fetchUrl("https://graph.facebook.com/".get_option( trim($page_id) )."/feed?access_token=". trim($access_token) ."&limit=1"); ?>
566
 
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.1
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.1');
28
 
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
  //Include admin
@@ -662,6 +662,9 @@ function display_cff($atts) {
662
  //If the Page ID contains a query string at the end then remove it
663
  if ( stripos( $page_id, '?') !== false ) $page_id = substr($page_id, 0, strrpos($page_id, '?'));
664
 
 
 
 
665
  //Get show posts attribute. If not set then default to 25
666
  $show_posts = $atts['num'];
667
  if (empty($show_posts)) $show_posts = 25;
@@ -679,17 +682,31 @@ function display_cff($atts) {
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 == '') {
@@ -927,7 +944,7 @@ function display_cff($atts) {
927
 
928
  if( empty($FBdata->error) && empty($FBdata->error_msg) && $FBdata !== null ) $cff_content .= 'Error: No posts available for this Facebook ID';
929
 
930
- $cff_content .= '<br />Please refer to our <a href="http://smashballoon.com/custom-facebook-feed/docs/errors/" target="_blank">Error Message Reference</a>.';
931
 
932
  }
933
 
@@ -1114,7 +1131,7 @@ function display_cff($atts) {
1114
  if (empty($news->link)) {
1115
  if ($cff_link_to_timeline == true){
1116
  //Link to page
1117
- $link = 'http://facebook.com/' . $page_id;
1118
  } else {
1119
  //Link to status
1120
  $link = "https://www.facebook.com/" . $page_id . "/posts/" . $PostID[1];
@@ -1175,7 +1192,7 @@ function display_cff($atts) {
1175
  ( isset($message_tag->id) ) ? $message_tag = $message_tag : $message_tag = $message_tag[0];
1176
 
1177
  $tag_name = $message_tag->name;
1178
- $tag_link = '<a href="http://facebook.com/' . $message_tag->id . '">' . $message_tag->name . '</a>';
1179
 
1180
  $post_text_story = str_replace($tag_name, $tag_link, $post_text_story);
1181
  }
@@ -1231,7 +1248,7 @@ function display_cff($atts) {
1231
  //Don't use the story tag in this case otherwise it changes '__ created an event' to '__ created an Name Of Event'
1232
  //Don't use the story tag if it's a page as it causes an issue when sharing a page: Smash Balloon Dev shared a Smash Balloon.
1233
  } else {
1234
- $b = '<a href="http://facebook.com/' . $message_tags_arr[$tag]['id'] . '" target="_blank">' . $message_tags_arr[$tag]['name'] . '</a>';
1235
  $c = $message_tags_arr[$tag]['offset'];
1236
  $d = $message_tags_arr[$tag]['length'];
1237
  $post_text_story = cff_mb_substr_replace( $post_text_story, $b, $c, $d);
@@ -1334,7 +1351,7 @@ function display_cff($atts) {
1334
  ( isset($message_tag->id) ) ? $message_tag = $message_tag : $message_tag = $message_tag[0];
1335
 
1336
  $tag_name = $message_tag->name;
1337
- $tag_link = '<a href="http://facebook.com/' . $message_tag->id . '">' . $message_tag->name . '</a>';
1338
 
1339
  $post_text_message = str_replace($tag_name, $tag_link, $post_text_message);
1340
  }
@@ -1384,7 +1401,7 @@ function display_cff($atts) {
1384
  if( $message_tags_arr[$tag]['offset'] == $cff_msg_duplicate_offset ){
1385
  //If it has the same offset as another tag then don't display it
1386
  } else {
1387
- $b = '<a href="http://facebook.com/' . $message_tags_arr[$tag]['id'] . '">' . $message_tags_arr[$tag]['name'] . '</a>';
1388
  $c = $message_tags_arr[$tag]['offset'];
1389
  $d = $message_tags_arr[$tag]['length'];
1390
  $post_text_message = cff_mb_substr_replace( $post_text_message, $b, $c, $d);
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.2
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.2');
28
 
29
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
  //Include admin
662
  //If the Page ID contains a query string at the end then remove it
663
  if ( stripos( $page_id, '?') !== false ) $page_id = substr($page_id, 0, strrpos($page_id, '?'));
664
 
665
+ //Always remove slash from end of Page ID
666
+ $page_id = preg_replace('{/$}', '', $page_id);
667
+
668
  //Get show posts attribute. If not set then default to 25
669
  $show_posts = $atts['num'];
670
  if (empty($show_posts)) $show_posts = 25;
682
  '1983264355330375|e5c100f6d4b768abb560e7df1771ac89',
683
  '209804229584368|3a2d59f876e0df3d42d829f8a1569636',
684
  '274376249625432|03d7cc70158f4b720a124c11aad5606e',
685
+ '927474184059774|ekzzwIV9JnvG-ELYWut9wIvf4Y0',
686
  '157849737751172|1wgUYn-UwVvoiZkvROi7yi2aIRw',
687
  '140081703552|rtuoT3AGRIzb-z_PPUlOnN9iYA0',
688
  '322095208287051|pbCTS6jPuhjR18sl2UPhKQw7eyY',
689
+ '1439406912938596|4JDCXisJ2d-1EWeObBt27DybH5c',
690
  '1042396375891598|gn2HiZgDgjTbCMcXsSb6VK91PqM',
691
+ '348613608818294|d4gRX7tNppCrI-DrOGof_O8gwvg',
692
  '502797619766223|fuoqcs_7_9HPokY0C296S4VtB0o',
693
+ '1591407604237466|cHUFs9XDDJa7LDUW9zBxirwGAHE',
694
+ '277269689412168|o3k5mzmHsT-prqc2qizxk_DoXEQ',
695
+ '386881278380301|NW_PiECD9TLVe0UNMsB5H9HkPEo',
696
+ '697312047120344|p8ST5dkrub6IoBZsClmyRBTScB0',
697
+ '1134584793234186|763Jh88I-PuO8_slARazfgucxFg',
698
+ '257106408010811|MwCorr7qsyIeU_GjdPFIEw3-_P8',
699
+ '1693018934313805|VYDjx69NpsgkDEAm79cYD0fxJBk',
700
+ '1298990730176646|rU4QhoOaYPWQng6-k_QdxRoVNaA',
701
+ '1788677371359317|UU7yeB5dsKOT8xLsLA9xSNu4OMQ',
702
+ '1876405409266356|VT8hdBxkbAf6-PCq-TosrtiMilU',
703
+ '128947497630881|rlgLr8wtMUWRw7hbcLcsgoa01-k',
704
+ '963645750343660|1mgCt1EhXAI0o51tYpZ7O6dThKM',
705
+ '177899259380474|JgdlhmU-J0dq55bKng0xywDIgIo',
706
+ '1106367462776766|Pj4xBlwzMH53yCQw7-h_prMExQg',
707
+ '131153380694449|jxU6_J0SobvxNG-pzJW8MKsI0w8'
708
  );
709
+ if ($access_token == '' || !$cff_show_access_token) $access_token = $access_token_array[rand(0, 29)];
710
 
711
  //Check whether a Page ID has been defined
712
  if ($page_id == '') {
944
 
945
  if( empty($FBdata->error) && empty($FBdata->error_msg) && $FBdata !== null ) $cff_content .= 'Error: No posts available for this Facebook ID';
946
 
947
+ $cff_content .= '<br />Please refer to our <a href="https://smashballoon.com/custom-facebook-feed/docs/errors/" target="_blank">Error Message Reference</a>.';
948
 
949
  }
950
 
1131
  if (empty($news->link)) {
1132
  if ($cff_link_to_timeline == true){
1133
  //Link to page
1134
+ $link = 'https://facebook.com/' . $page_id;
1135
  } else {
1136
  //Link to status
1137
  $link = "https://www.facebook.com/" . $page_id . "/posts/" . $PostID[1];
1192
  ( isset($message_tag->id) ) ? $message_tag = $message_tag : $message_tag = $message_tag[0];
1193
 
1194
  $tag_name = $message_tag->name;
1195
+ $tag_link = '<a href="https://facebook.com/' . $message_tag->id . '">' . $message_tag->name . '</a>';
1196
 
1197
  $post_text_story = str_replace($tag_name, $tag_link, $post_text_story);
1198
  }
1248
  //Don't use the story tag in this case otherwise it changes '__ created an event' to '__ created an Name Of Event'
1249
  //Don't use the story tag if it's a page as it causes an issue when sharing a page: Smash Balloon Dev shared a Smash Balloon.
1250
  } else {
1251
+ $b = '<a href="https://facebook.com/' . $message_tags_arr[$tag]['id'] . '" target="_blank">' . $message_tags_arr[$tag]['name'] . '</a>';
1252
  $c = $message_tags_arr[$tag]['offset'];
1253
  $d = $message_tags_arr[$tag]['length'];
1254
  $post_text_story = cff_mb_substr_replace( $post_text_story, $b, $c, $d);
1351
  ( isset($message_tag->id) ) ? $message_tag = $message_tag : $message_tag = $message_tag[0];
1352
 
1353
  $tag_name = $message_tag->name;
1354
+ $tag_link = '<a href="https://facebook.com/' . $message_tag->id . '">' . $message_tag->name . '</a>';
1355
 
1356
  $post_text_message = str_replace($tag_name, $tag_link, $post_text_message);
1357
  }
1401
  if( $message_tags_arr[$tag]['offset'] == $cff_msg_duplicate_offset ){
1402
  //If it has the same offset as another tag then don't display it
1403
  } else {
1404
+ $b = '<a href="https://facebook.com/' . $message_tags_arr[$tag]['id'] . '">' . $message_tags_arr[$tag]['name'] . '</a>';
1405
  $c = $message_tags_arr[$tag]['offset'];
1406
  $d = $message_tags_arr[$tag]['length'];
1407
  $post_text_message = cff_mb_substr_replace( $post_text_message, $b, $c, $d);