Custom Facebook Feed - Version 2.0.1

Version Description

  • Tweak: Improved error handling and added an Error Message reference to the website
Download this release

Release Info

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

Code changes from version 2.0 to 2.0.1

Files changed (3) hide show
  1. README.txt +5 -2
  2. css/cff-style.css +10 -0
  3. custom-facebook-feed.php +19 -2
README.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: smashballoon
3
  Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook Like box, Customizable Facebook Feed, custom, customizable, seo, responsive, mobile, social media
4
  Requires at least: 3.0
5
- Tested up to: 3.9.1
6
- Stable tag: 2.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -271,6 +271,9 @@ Credit iMarketing Factory - "The Importance of Facebook for Small Businesses"
271
  9. It's super easy to display your Facebook feed in any page or post
272
 
273
  == Changelog ==
 
 
 
274
  = 2.0 =
275
  * New: Added an option to display the post date immediately below the author name - as it is on Facebook. This is now the default date position.
276
  * New: Added options to add a background color and rounded corners to your posts
2
  Contributors: smashballoon
3
  Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook Like box, Customizable Facebook Feed, custom, customizable, seo, responsive, mobile, social media
4
  Requires at least: 3.0
5
+ Tested up to: 4.0
6
+ Stable tag: 2.0.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
271
  9. It's super easy to display your Facebook feed in any page or post
272
 
273
  == Changelog ==
274
+ = 2.0.1 =
275
+ * Tweak: Improved error handling and added an [Error Message reference](https://smashballoon.com/custom-facebook-feed/docs/errors/) to the website
276
+
277
  = 2.0 =
278
  * New: Added an option to display the post date immediately below the author name - as it is on Facebook. This is now the default date position.
279
  * New: Added options to add a background color and rounded corners to your posts
css/cff-style.css CHANGED
@@ -300,4 +300,14 @@
300
  -webkit-box-sizing: border-box;
301
  -moz-box-sizing: border-box;
302
  box-sizing: border-box;
 
 
 
 
 
 
 
 
 
 
303
  }
300
  -webkit-box-sizing: border-box;
301
  -moz-box-sizing: border-box;
302
  box-sizing: border-box;
303
+ }
304
+
305
+ #cff .cff-error-msg{
306
+ font-size: 12px;
307
+ font-family: sans-serif;
308
+ }
309
+ #cff #cff-error-reason{
310
+ display: none;
311
+ padding: 5px 0 0 0;
312
+ clear: both;
313
  }
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 a completely customizable Facebook feed to your WordPress site
6
- Version: 2.0
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -665,7 +665,24 @@ function display_cff($atts) {
665
 
666
  //If there's no data then show a pretty error message
667
  if( empty($FBdata->data) ) {
668
- $cff_content .= 'Unable to display Facebook posts. For solutions, please refer to the 1st question on our <a href="https://smashballoon.com/custom-facebook-feed/faq/troubleshooting/">Troubleshooting page</a>.';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
669
  return $cff_content;
670
  }
671
 
3
  Plugin Name: Custom Facebook Feed
4
  Plugin URI: http://smashballoon.com/custom-facebook-feed
5
  Description: Add a completely customizable Facebook feed to your WordPress site
6
+ Version: 2.0.1
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
665
 
666
  //If there's no data then show a pretty error message
667
  if( empty($FBdata->data) ) {
668
+ $cff_content .= '<div class="cff-error-msg"><p>Unable to display Facebook posts.<br/><a href="javascript:void(0);" id="cff-show-error" onclick="showError()">Show error</a>';
669
+ $cff_content .= '<script type="text/javascript">function showError() { document.getElementById("cff-error-reason").style.display = "block"; document.getElementById("cff-show-error").style.display = "none"; }</script>';
670
+ $cff_content .= '</p><div id="cff-error-reason">';
671
+
672
+ if( isset($FBdata->error->message) ) $cff_content .= 'Error: ' . $FBdata->error->message;
673
+ if( isset($FBdata->error->type) ) $cff_content .= '<br />Type: ' . $FBdata->error->type;
674
+ if( isset($FBdata->error->code) ) $cff_content .= '<br />Code: ' . $FBdata->error->code;
675
+ if( isset($FBdata->error->error_subcode) ) $cff_content .= '<br />Subcode: ' . $FBdata->error->error_subcode;
676
+
677
+ if( isset($FBdata->error_msg) ) $cff_content .= 'Error: ' . $FBdata->error_msg;
678
+ if( isset($FBdata->error_code) ) $cff_content .= '<br />Code: ' . $FBdata->error_code;
679
+
680
+ if($FBdata == null) $cff_content .= 'Error: Server configuration issue';
681
+
682
+ if( empty($FBdata->error) && empty($FBdata->error_msg) && $FBdata !== null ) $cff_content .= 'Error: No posts available for this Facebook ID';
683
+
684
+ $cff_content .= '<br />Please refer to our <a href="https://smashballoon.com/custom-facebook-feed/docs/errors/" target="_blank">Error Message Reference</a>.</div>';
685
+
686
  return $cff_content;
687
  }
688