Custom Facebook Feed - Version 2.3.2

Version Description

  • Fix: Fixed some stray PHP notices which were inadvertently introduced in a recent update
  • Tweak: Added an option to not load the icon font included in the plugin
Download this release

Release Info

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

Code changes from version 2.3.1 to 2.3.2

README.txt CHANGED
@@ -3,7 +3,7 @@ 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.1.1
6
- Stable tag: 2.3.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -271,6 +271,10 @@ 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.3.1 =
275
  * New: Added a shortcode option to allow you to offset the number of posts to be shown. Eg: offset=2
276
  * New: Added an email link to the sharing icons
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.1.1
6
+ Stable tag: 2.3.2
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.3.2 =
275
+ * Fix: Fixed some stray PHP notices which were inadvertently introduced in a recent update
276
+ * Tweak: Added an option to not load the icon font included in the plugin
277
+
278
  = 2.3.1 =
279
  * New: Added a shortcode option to allow you to offset the number of posts to be shown. Eg: offset=2
280
  * New: Added an email link to the sharing icons
custom-facebook-feed-admin.php CHANGED
@@ -67,16 +67,16 @@ function cff_settings_page() {
67
  // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
68
  if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) {
69
  // Read their posted value
70
- $show_access_token_val = $_POST[ $show_access_token ];
71
- $access_token_val = $_POST[ $access_token ];
72
- $page_id_val = $_POST[ $page_id ];
73
- $cff_page_type_val = $_POST[ $cff_page_type ];
74
- $num_show_val = $_POST[ $num_show ];
75
- $cff_post_limit_val = $_POST[ $cff_post_limit ];
76
- $cff_show_others_val = $_POST[ $cff_show_others ];
77
- $cff_cache_time_val = $_POST[ $cff_cache_time ];
78
- $cff_cache_time_unit_val = $_POST[ $cff_cache_time_unit ];
79
- $cff_locale_val = $_POST[ $cff_locale ];
80
  if (isset($_POST[ 'cff_timezone' ]) ) $cff_timezone = $_POST[ 'cff_timezone' ];
81
 
82
  // Save the posted value in the database
@@ -1211,7 +1211,7 @@ function cff_style_page() {
1211
  if (isset($_POST[ 'cff_app_id' ])) $cff_app_id = $_POST[ 'cff_app_id' ];
1212
  (isset($_POST[ 'cff_show_credit' ])) ? $cff_show_credit = $_POST[ 'cff_show_credit' ] : $cff_show_credit = '';
1213
  (isset($_POST[ 'cff_font_source' ])) ? $cff_font_source = $_POST[ 'cff_font_source' ] : $cff_font_source = '';
1214
- $cff_preserve_settings_val = $_POST[ $cff_preserve_settings ];
1215
 
1216
  //Meta
1217
  $options[ 'cff_icon_style' ] = $cff_icon_style;
@@ -2653,6 +2653,7 @@ function cff_style_page() {
2653
  <select name="cff_font_source">
2654
  <option value="cdn" <?php if($cff_font_source == "cdn") echo 'selected="selected"' ?> ><?php _e('CDN'); ?></option>
2655
  <option value="local" <?php if($cff_font_source == "local") echo 'selected="selected"' ?> ><?php _e('Local copy'); ?></option>
 
2656
  </select>
2657
  </td>
2658
  </tr>
67
  // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
68
  if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) {
69
  // Read their posted value
70
+ isset( $_POST[ $show_access_token ] ) ? $show_access_token_val = $_POST[ $show_access_token ] : $show_access_token_val = '';
71
+ isset( $_POST[ $access_token ] ) ? $access_token_val = $_POST[ $access_token ] : $access_token_val = '';
72
+ isset( $_POST[ $page_id ] ) ? $page_id_val = $_POST[ $page_id ] : $page_id_val = '';
73
+ isset( $_POST[ $cff_page_type ] ) ? $cff_page_type_val = $_POST[ $cff_page_type ] : $cff_page_type_val = '';
74
+ isset( $_POST[ $num_show ] ) ? $num_show_val = $_POST[ $num_show ] : $num_show_val = '';
75
+ isset( $_POST[ $cff_post_limit ] ) ? $cff_post_limit_val = $_POST[ $cff_post_limit ] : $cff_post_limit_val = '';
76
+ isset( $_POST[ $cff_show_others ] ) ? $cff_show_others_val = $_POST[ $cff_show_others ] : $cff_show_others_val = '';
77
+ isset( $_POST[ $cff_cache_time ] ) ? $cff_cache_time_val = $_POST[ $cff_cache_time ] : $cff_cache_time_val = '';
78
+ isset( $_POST[ $cff_cache_time_unit ] ) ? $cff_cache_time_unit_val = $_POST[ $cff_cache_time_unit ] : $cff_cache_time_unit_val = '';
79
+ isset( $_POST[ $cff_locale ] ) ? $cff_locale_val = $_POST[ $cff_locale ] : $cff_locale_val = '';
80
  if (isset($_POST[ 'cff_timezone' ]) ) $cff_timezone = $_POST[ 'cff_timezone' ];
81
 
82
  // Save the posted value in the database
1211
  if (isset($_POST[ 'cff_app_id' ])) $cff_app_id = $_POST[ 'cff_app_id' ];
1212
  (isset($_POST[ 'cff_show_credit' ])) ? $cff_show_credit = $_POST[ 'cff_show_credit' ] : $cff_show_credit = '';
1213
  (isset($_POST[ 'cff_font_source' ])) ? $cff_font_source = $_POST[ 'cff_font_source' ] : $cff_font_source = '';
1214
+ (isset($_POST[ $cff_preserve_settings ])) ? $cff_preserve_settings_val = $_POST[ 'cff_preserve_settings' ] : $cff_preserve_settings_val = '';
1215
 
1216
  //Meta
1217
  $options[ 'cff_icon_style' ] = $cff_icon_style;
2653
  <select name="cff_font_source">
2654
  <option value="cdn" <?php if($cff_font_source == "cdn") echo 'selected="selected"' ?> ><?php _e('CDN'); ?></option>
2655
  <option value="local" <?php if($cff_font_source == "local") echo 'selected="selected"' ?> ><?php _e('Local copy'); ?></option>
2656
+ <option value="none" <?php if($cff_font_source == "none") echo 'selected="selected"' ?> ><?php _e("Don't load"); ?></option>
2657
  </select>
2658
  </td>
2659
  </tr>
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.3.1
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  //Include admin
26
  include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
27
 
28
- define('CFFVER', '2.3.1');
29
 
30
  // Add shortcodes
31
  add_shortcode('custom-facebook-feed', 'display_cff');
@@ -875,9 +875,11 @@ function display_cff($atts) {
875
  }
876
 
877
  //If it's an event then check whether the URL contains facebook.com
878
- if( stripos($news->link, "events/") && $cff_post_type == 'event' ){
879
- //Facebook changed the event link from absolute to relative, and so if the link isn't absolute then add facebook.com to front
880
- ( stripos($link, 'facebook.com') ) ? $link = $link : $link = 'https://facebook.com' . $link;
 
 
881
  }
882
 
883
  //Is it an album?
@@ -885,9 +887,9 @@ function display_cff($atts) {
885
 
886
  if( $news->status_type == 'added_photos' ){
887
  //Check 'story' to see whether it contains a number
888
- $str = $news->story;
889
  preg_match('!\d+!', $str, $matches);
890
- $num_photos = $matches[0];
891
 
892
  if ( $num_photos > 1 ) {
893
  $cff_album = true;
@@ -1023,7 +1025,7 @@ function display_cff($atts) {
1023
  array(
1024
  'id' => $message_tag[0]->id,
1025
  'name' => $message_tag[0]->name,
1026
- 'type' => $message_tag[0]->type,
1027
  'offset' => $message_tag[0]->offset,
1028
  'length' => $message_tag[0]->length
1029
  )
@@ -1786,12 +1788,13 @@ function cff_add_my_stylesheet() {
1786
  wp_enqueue_style( 'cff' );
1787
 
1788
  $options = get_option('cff_style_settings');
1789
- if( $options[ 'cff_font_source' ] == 'local' ){
 
 
1790
  wp_enqueue_style( 'cff-font-awesome', plugins_url('css/font-awesome.min.css', __FILE__), array(), '4.3.0' );
1791
  } else {
1792
  wp_enqueue_style( 'cff-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', array(), '4.2.0' );
1793
  }
1794
-
1795
  }
1796
  //Enqueue scripts
1797
  add_action( 'wp_enqueue_scripts', 'cff_scripts_method' );
@@ -2225,6 +2228,7 @@ function cff_autolink_email($text, $tagfill=''){
2225
  ####################################################################
2226
 
2227
 
2228
- //Comment out the line below to view errors
2229
- //error_reporting(0);
 
2230
  ?>
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.3.2
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
25
  //Include admin
26
  include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
27
 
28
+ define('CFFVER', '2.3.2');
29
 
30
  // Add shortcodes
31
  add_shortcode('custom-facebook-feed', 'display_cff');
875
  }
876
 
877
  //If it's an event then check whether the URL contains facebook.com
878
+ if(isset($news->link)){
879
+ if( stripos($news->link, "events/") && $cff_post_type == 'event' ){
880
+ //Facebook changed the event link from absolute to relative, and so if the link isn't absolute then add facebook.com to front
881
+ ( stripos($link, 'facebook.com') ) ? $link = $link : $link = 'https://facebook.com' . $link;
882
+ }
883
  }
884
 
885
  //Is it an album?
887
 
888
  if( $news->status_type == 'added_photos' ){
889
  //Check 'story' to see whether it contains a number
890
+ (isset($news->story)) ? $str = $news->story : $str = '';
891
  preg_match('!\d+!', $str, $matches);
892
+ (isset($matches[0])) ? $num_photos = $matches[0] : $num_photos = 0;
893
 
894
  if ( $num_photos > 1 ) {
895
  $cff_album = true;
1025
  array(
1026
  'id' => $message_tag[0]->id,
1027
  'name' => $message_tag[0]->name,
1028
+ 'type' => isset($message_tag[0]->type) ? $message_tag[0]->type : '',
1029
  'offset' => $message_tag[0]->offset,
1030
  'length' => $message_tag[0]->length
1031
  )
1788
  wp_enqueue_style( 'cff' );
1789
 
1790
  $options = get_option('cff_style_settings');
1791
+ if( $options[ 'cff_font_source' ] == 'none' ){
1792
+ //Do nothing
1793
+ } else if( $options[ 'cff_font_source' ] == 'local' ){
1794
  wp_enqueue_style( 'cff-font-awesome', plugins_url('css/font-awesome.min.css', __FILE__), array(), '4.3.0' );
1795
  } else {
1796
  wp_enqueue_style( 'cff-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', array(), '4.2.0' );
1797
  }
 
1798
  }
1799
  //Enqueue scripts
1800
  add_action( 'wp_enqueue_scripts', 'cff_scripts_method' );
2228
  ####################################################################
2229
 
2230
 
2231
+ //Comment out the lines below to view PHP notices and errors
2232
+ // ini_set('display_errors', 1);
2233
+ // error_reporting(~0);
2234
  ?>