Custom Facebook Feed - Version 2.4.3

Version Description

  • Fix: Fixed a potential security vulnerability
  • Tested with upcoming WordPress 4.6 update
Download this release

Release Info

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

Code changes from version 2.4.2 to 2.4.3

README.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Custom Facebook Feed ===
2
  Contributors: smashballoon
3
- Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook groups, Facebook fans, Facebook likes, Facebook followers, Facebooks, Face book, posts, Facebook postings, Facebook feeds, Facebook pages, Facebook Like Box, Facebook plugin, Facebook plug-in, Facebook walls, Facebook hashtag, Facebook embed, Customizable Facebook Feed, custom, customizable, seo, responsive, mobile, social media
4
  Requires at least: 3.0
5
- Tested up to: 4.5.3
6
- Stable tag: 2.4.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -361,6 +361,10 @@ Credit iMarketing Factory - "The Importance of Facebook for Small Businesses"
361
  9. It's super easy to display your Facebook feed in any page or post
362
 
363
  == Changelog ==
 
 
 
 
364
  = 2.4.2 =
365
  * Tweak: Group wall feed posts are now ordered based on recent activity, rather than by the date they were created, to better reflect the order on the Facebook Group wall.
366
  * Tweak: The "5 hours ago" date text strings can now be translated directly in the shortcode if you're displaying different feeds in different languages. See the bottom of the [Shortcode Options table](https://smashballoon.com/custom-facebook-feed/docs/shortcodes/) for more information.
1
  === Custom Facebook Feed ===
2
  Contributors: smashballoon
3
+ Tags: Facebook, Facebook feed, Facebook posts, Facebook wall, Facebook events, Facebook page, Facebook group, Facebook fans, Facebook likes, Facebook followers, Face book, Facebook pages, Facebook Like Box, Facebook plugin, Facebook walls, custom, customizable, seo, responsive, mobile, social media
4
  Requires at least: 3.0
5
+ Tested up to: 4.6
6
+ Stable tag: 2.4.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
361
  9. It's super easy to display your Facebook feed in any page or post
362
 
363
  == Changelog ==
364
+ = 2.4.3 =
365
+ * Fix: Fixed a potential security vulnerability
366
+ * Tested with upcoming WordPress 4.6 update
367
+
368
  = 2.4.2 =
369
  * Tweak: Group wall feed posts are now ordered based on recent activity, rather than by the date they were created, to better reflect the order on the Facebook Group wall.
370
  * Tweak: The "5 hours ago" date text strings can now be translated directly in the shortcode if you're displaying different feeds in different languages. See the bottom of the [Shortcode Options table](https://smashballoon.com/custom-facebook-feed/docs/shortcodes/) for more information.
custom-facebook-feed-admin.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
 
3
  function cff_menu() {
4
  add_menu_page(
@@ -64,58 +65,65 @@ function cff_settings_page() {
64
  $options = wp_parse_args(get_option('cff_style_settings'), $defaults);
65
  $cff_timezone = $options[ 'cff_timezone' ];
66
 
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
83
- update_option( $show_access_token, $show_access_token_val );
84
- update_option( $access_token, $access_token_val );
85
- update_option( $page_id, $page_id_val );
86
- update_option( $cff_page_type, $cff_page_type_val );
87
- update_option( $num_show, $num_show_val );
88
- update_option( $cff_post_limit, $cff_post_limit_val );
89
- update_option( $cff_show_others, $cff_show_others_val );
90
- update_option( $cff_cache_time, $cff_cache_time_val );
91
- update_option( $cff_cache_time_unit, $cff_cache_time_unit_val );
92
- update_option( $cff_locale, $cff_locale_val );
93
-
94
- $options[ 'cff_timezone' ] = $cff_timezone;
95
- update_option( 'cff_style_settings', $options );
96
-
97
- //Delete ALL transients
98
- global $wpdb;
99
- $table_name = $wpdb->prefix . "options";
100
- $wpdb->query( "
101
- DELETE
102
- FROM $table_name
103
- WHERE `option_name` LIKE ('%\_transient\_cff\_%')
104
- " );
105
- $wpdb->query( "
106
- DELETE
107
- FROM $table_name
108
- WHERE `option_name` LIKE ('%\_transient\_cff\_tle\_%')
109
- " );
110
- $wpdb->query( "
111
- DELETE
112
- FROM $table_name
113
- WHERE `option_name` LIKE ('%\_transient\_timeout\_cff\_%')
114
- " );
115
- // Put an settings updated message on the screen
116
- ?>
117
- <div class="updated"><p><strong><?php _e('Settings saved.', 'custom-facebook-feed' ); ?></strong></p></div>
118
- <?php } ?>
 
 
 
 
 
 
 
119
 
120
  <div id="cff-admin" class="wrap">
121
  <div id="header">
@@ -135,6 +143,8 @@ function cff_settings_page() {
135
 
136
  <form name="form1" method="post" action="">
137
  <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">
 
 
138
  <br />
139
  <h3><?php _e('Configuration', 'custom-facebook-feed'); ?></h3>
140
  <table class="form-table">
@@ -936,444 +946,452 @@ function cff_style_page() {
936
  $cff_ajax = 'cff_ajax';
937
  $cff_ajax_val = get_option( $cff_ajax );
938
 
939
- // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
940
- if( isset($_POST[ $style_hidden_field_name ]) && $_POST[ $style_hidden_field_name ] == 'Y' ) {
941
- //Update the General options
942
- if( isset($_POST[ $style_general_hidden_field_name ]) && $_POST[ $style_general_hidden_field_name ] == 'Y' ) {
943
- //General
944
- if (isset($_POST[ 'cff_feed_width' ]) ) $cff_feed_width = $_POST[ 'cff_feed_width' ];
945
- (isset($_POST[ 'cff_feed_width_resp' ]) ) ? $cff_feed_width_resp = $_POST[ 'cff_feed_width_resp' ] : $cff_feed_width_resp = '';
946
- if (isset($_POST[ 'cff_feed_height' ]) ) $cff_feed_height = $_POST[ 'cff_feed_height' ];
947
- if (isset($_POST[ 'cff_feed_padding' ]) ) $cff_feed_padding = $_POST[ 'cff_feed_padding' ];
948
- if (isset($_POST[ 'cff_bg_color' ]) ) $cff_bg_color = $_POST[ 'cff_bg_color' ];
949
- if (isset($_POST[ 'cff_class' ]) ) $cff_class = $_POST[ 'cff_class' ];
950
- (isset($_POST[ 'cff_show_header' ])) ? $cff_show_header = $_POST[ 'cff_show_header' ] : $cff_show_header = '';
951
-
952
- //Post types
953
- if (isset($_POST[ 'cff_show_links_type' ]) ) $cff_show_links_type = $_POST[ 'cff_show_links_type' ];
954
- if (isset($_POST[ 'cff_show_event_type' ]) ) $cff_show_event_type = $_POST[ 'cff_show_event_type' ];
955
- if (isset($_POST[ 'cff_show_video_type' ]) ) $cff_show_video_type = $_POST[ 'cff_show_video_type' ];
956
- if (isset($_POST[ 'cff_show_photos_type' ]) ) $cff_show_photos_type = $_POST[ 'cff_show_photos_type' ];
957
- if (isset($_POST[ 'cff_show_status_type' ]) ) $cff_show_status_type = $_POST[ 'cff_show_status_type' ];
958
- //General
959
- $options[ 'cff_feed_width' ] = $cff_feed_width;
960
- $options[ 'cff_feed_width_resp' ] = $cff_feed_width_resp;
961
- $options[ 'cff_feed_height' ] = $cff_feed_height;
962
- $options[ 'cff_feed_padding' ] = $cff_feed_padding;
963
- $options[ 'cff_bg_color' ] = $cff_bg_color;
964
- $options[ 'cff_class' ] = $cff_class;
965
- $options[ 'cff_show_header' ] = $cff_show_header;
966
-
967
- //Post types
968
- $options[ 'cff_show_links_type' ] = $cff_show_links_type;
969
- $options[ 'cff_show_event_type' ] = $cff_show_event_type;
970
- $options[ 'cff_show_video_type' ] = $cff_show_video_type;
971
- $options[ 'cff_show_photos_type' ] = $cff_show_photos_type;
972
- $options[ 'cff_show_status_type' ] = $cff_show_status_type;
973
- }
974
- //Update the Post Layout options
975
- if( isset($_POST[ $style_post_layout_hidden_field_name ]) && $_POST[ $style_post_layout_hidden_field_name ] == 'Y' ) {
976
- //Layout
977
- if (isset($_POST[ 'cff_preset_layout' ]) ) $cff_preset_layout = $_POST[ 'cff_preset_layout' ];
978
- //Include
979
- (isset($_POST[ 'cff_show_author' ]) ) ? $cff_show_author = $_POST[ 'cff_show_author' ] : $cff_show_author = '';
980
- (isset($_POST[ 'cff_show_text' ]) ) ? $cff_show_text = $_POST[ 'cff_show_text' ] : $cff_show_text = '';
981
- (isset($_POST[ 'cff_show_desc' ]) ) ? $cff_show_desc = $_POST[ 'cff_show_desc' ] : $cff_show_desc = '';
982
- (isset($_POST[ 'cff_show_shared_links' ]) ) ? $cff_show_shared_links = $_POST[ 'cff_show_shared_links' ] : $cff_show_shared_links = '';
983
- (isset($_POST[ 'cff_show_date' ]) ) ? $cff_show_date = $_POST[ 'cff_show_date' ] : $cff_show_date = '';
984
- (isset($_POST[ 'cff_show_media' ]) ) ? $cff_show_media = $_POST[ 'cff_show_media' ] : $cff_show_media = '';
985
- (isset($_POST[ 'cff_show_media_link' ]) ) ? $cff_show_media_link = $_POST[ 'cff_show_media_link' ] : $cff_show_media_link = '';
986
- (isset($_POST[ 'cff_show_event_title' ]) ) ? $cff_show_event_title = $_POST[ 'cff_show_event_title' ] : $cff_show_event_title = '';
987
- (isset($_POST[ 'cff_show_event_details' ]) ) ? $cff_show_event_details = $_POST[ 'cff_show_event_details' ] : $cff_show_event_details = '';
988
- (isset($_POST[ 'cff_show_meta' ]) ) ? $cff_show_meta = $_POST[ 'cff_show_meta' ] : $cff_show_meta = '';
989
- (isset($_POST[ 'cff_show_link' ]) ) ? $cff_show_link = $_POST[ 'cff_show_link' ] : $cff_show_link = '';
990
- //Post Style
991
- (isset($_POST[ 'cff_post_bg_color' ]) ) ? $cff_post_bg_color = $_POST[ 'cff_post_bg_color' ] : $cff_post_bg_color = '';
992
- (isset($_POST[ 'cff_post_rounded' ]) ) ? $cff_post_rounded = $_POST[ 'cff_post_rounded' ] : $cff_post_rounded = '';
993
- if (isset($_POST[ 'cff_sep_color' ])) $cff_sep_color = $_POST[ 'cff_sep_color' ];
994
- if (isset($_POST[ 'cff_sep_size' ])) $cff_sep_size = $_POST[ 'cff_sep_size' ];
995
-
996
- //Layout
997
- $options[ 'cff_preset_layout' ] = $cff_preset_layout;
998
- //Include
999
- $options[ 'cff_show_author' ] = $cff_show_author;
1000
- $options[ 'cff_show_text' ] = $cff_show_text;
1001
- $options[ 'cff_show_desc' ] = $cff_show_desc;
1002
- $options[ 'cff_show_shared_links' ] = $cff_show_shared_links;
1003
- $options[ 'cff_show_date' ] = $cff_show_date;
1004
- $options[ 'cff_show_media' ] = $cff_show_media;
1005
- $options[ 'cff_show_media_link' ] = $cff_show_media_link;
1006
- $options[ 'cff_show_event_title' ] = $cff_show_event_title;
1007
- $options[ 'cff_show_event_details' ] = $cff_show_event_details;
1008
- $options[ 'cff_show_meta' ] = $cff_show_meta;
1009
- $options[ 'cff_show_link' ] = $cff_show_link;
1010
- //Post Style
1011
- $options[ 'cff_post_bg_color' ] = $cff_post_bg_color;
1012
- $options[ 'cff_post_rounded' ] = $cff_post_rounded;
1013
- $options[ 'cff_sep_color' ] = $cff_sep_color;
1014
- $options[ 'cff_sep_size' ] = $cff_sep_size;
1015
 
1016
- }
1017
- //Update the Typography options
1018
- if( isset($_POST[ $style_typography_hidden_field_name ]) && $_POST[ $style_typography_hidden_field_name ] == 'Y' ) {
1019
- //Character limits
1020
- if (isset($_POST[ 'cff_title_length' ]) ) $cff_title_length_val = $_POST[ $cff_title_length ];
1021
- if (isset($_POST[ 'cff_body_length' ]) ) $cff_body_length_val = $_POST[ $cff_body_length ];
1022
-
1023
- //Page Header
1024
- (isset($_POST[ 'cff_header_outside' ])) ? $cff_header_outside = $_POST[ 'cff_header_outside' ] : $cff_header_outside = '';
1025
- if (isset($_POST[ 'cff_header_text' ])) $cff_header_text = $_POST[ 'cff_header_text' ];
1026
- if (isset($_POST[ 'cff_header_bg_color' ])) $cff_header_bg_color = $_POST[ 'cff_header_bg_color' ];
1027
- if (isset($_POST[ 'cff_header_padding' ])) $cff_header_padding = $_POST[ 'cff_header_padding' ];
1028
- if (isset($_POST[ 'cff_header_text_size' ])) $cff_header_text_size = $_POST[ 'cff_header_text_size' ];
1029
- if (isset($_POST[ 'cff_header_text_weight' ])) $cff_header_text_weight = $_POST[ 'cff_header_text_weight' ];
1030
- if (isset($_POST[ 'cff_header_text_color' ])) $cff_header_text_color = $_POST[ 'cff_header_text_color' ];
1031
- if (isset($_POST[ 'cff_header_icon' ])) $cff_header_icon = $_POST[ 'cff_header_icon' ];
1032
- if (isset($_POST[ 'cff_header_icon_color' ])) $cff_header_icon_color = $_POST[ 'cff_header_icon_color' ];
1033
- if (isset($_POST[ 'cff_header_icon_size' ])) $cff_header_icon_size = $_POST[ 'cff_header_icon_size' ];
1034
-
1035
- //Author
1036
- if (isset($_POST[ 'cff_author_size' ])) $cff_author_size = $_POST[ 'cff_author_size' ];
1037
- if (isset($_POST[ 'cff_author_color' ])) $cff_author_color = $_POST[ 'cff_author_color' ];
1038
-
1039
- //Typography
1040
- if (isset($_POST[ 'cff_title_format' ]) ) $cff_title_format = $_POST[ 'cff_title_format' ];
1041
- if (isset($_POST[ 'cff_title_size' ]) ) $cff_title_size = $_POST[ 'cff_title_size' ];
1042
- if (isset($_POST[ 'cff_title_weight' ]) ) $cff_title_weight = $_POST[ 'cff_title_weight' ];
1043
- if (isset($_POST[ 'cff_title_color' ]) ) $cff_title_color = $_POST[ 'cff_title_color' ];
1044
- if (isset($_POST[ 'cff_posttext_link_color' ]) ) $cff_posttext_link_color = $_POST[ 'cff_posttext_link_color' ];
1045
-
1046
- (isset($_POST[ 'cff_title_link' ]) ) ? $cff_title_link = $_POST[ 'cff_title_link' ] : $cff_title_link = '';
1047
- (isset($_POST[ 'cff_post_tags' ]) ) ? $cff_post_tags = $_POST[ 'cff_post_tags' ] : $cff_post_tags = '';
1048
- (isset($_POST[ 'cff_link_hashtags' ]) ) ? $cff_link_hashtags = $_POST[ 'cff_link_hashtags' ] : $cff_link_hashtags = '';
1049
-
1050
- $cff_body_size = $_POST[ 'cff_body_size' ];
1051
- if (isset($_POST[ 'cff_body_weight' ]) ) $cff_body_weight = $_POST[ 'cff_body_weight' ];
1052
- if (isset($_POST[ 'cff_body_color' ]) ) $cff_body_color = $_POST[ 'cff_body_color' ];
1053
- if (isset($_POST[ 'cff_link_title_format' ]) ) $cff_link_title_format = $_POST[ 'cff_link_title_format' ];
1054
- if (isset($_POST[ 'cff_link_title_size' ]) ) $cff_link_title_size = $_POST[ 'cff_link_title_size' ];
1055
- if (isset($_POST[ 'cff_link_title_color' ]) ) $cff_link_title_color = $_POST[ 'cff_link_title_color' ];
1056
- if (isset($_POST[ 'cff_link_url_color' ]) ) $cff_link_url_color = $_POST[ 'cff_link_url_color' ];
1057
- if (isset($_POST[ 'cff_link_bg_color' ]) ) $cff_link_bg_color = $_POST[ 'cff_link_bg_color' ];
1058
- if (isset($_POST[ 'cff_link_border_color' ]) ) $cff_link_border_color = $_POST[ 'cff_link_border_color' ];
1059
- (isset($_POST[ 'cff_disable_link_box' ]) ) ? $cff_disable_link_box = $_POST[ 'cff_disable_link_box' ] : $cff_disable_link_box = '';
1060
-
1061
-
1062
- //Event title
1063
- if (isset($_POST[ 'cff_event_title_format' ]) ) $cff_event_title_format = $_POST[ 'cff_event_title_format' ];
1064
- if (isset($_POST[ 'cff_event_title_size' ]) ) $cff_event_title_size = $_POST[ 'cff_event_title_size' ];
1065
- if (isset($_POST[ 'cff_event_title_weight' ]) ) $cff_event_title_weight = $_POST[ 'cff_event_title_weight' ];
1066
- if (isset($_POST[ 'cff_event_title_color' ]) ) $cff_event_title_color = $_POST[ 'cff_event_title_color' ];
1067
- (isset($_POST[ 'cff_event_title_link' ]) ) ? $cff_event_title_link = $_POST[ 'cff_event_title_link' ] : $cff_event_title_link = '';
1068
- //Event date
1069
- if (isset($_POST[ 'cff_event_date_size' ]) ) $cff_event_date_size = $_POST[ 'cff_event_date_size' ];
1070
- if (isset($_POST[ 'cff_event_date_weight' ]) ) $cff_event_date_weight = $_POST[ 'cff_event_date_weight' ];
1071
- if (isset($_POST[ 'cff_event_date_color' ]) ) $cff_event_date_color = $_POST[ 'cff_event_date_color' ];
1072
- if (isset($_POST[ 'cff_event_date_position' ]) ) $cff_event_date_position = $_POST[ 'cff_event_date_position' ];
1073
- if (isset($_POST[ 'cff_event_date_formatting' ]) ) $cff_event_date_formatting = $_POST[ 'cff_event_date_formatting' ];
1074
- if (isset($_POST[ 'cff_event_date_custom' ]) ) $cff_event_date_custom = $_POST[ 'cff_event_date_custom' ];
1075
- //Event details
1076
- if (isset($_POST[ 'cff_event_details_size' ]) ) $cff_event_details_size = $_POST[ 'cff_event_details_size' ];
1077
- if (isset($_POST[ 'cff_event_details_weight' ]) ) $cff_event_details_weight = $_POST[ 'cff_event_details_weight' ];
1078
- if (isset($_POST[ 'cff_event_details_color' ]) ) $cff_event_details_color = $_POST[ 'cff_event_details_color' ];
1079
- if (isset($_POST[ 'cff_event_link_color' ]) ) $cff_event_link_color = $_POST[ 'cff_event_link_color' ];
1080
- //Date
1081
- if (isset($_POST[ 'cff_date_position' ]) ) $cff_date_position = $_POST[ 'cff_date_position' ];
1082
- if (isset($_POST[ 'cff_date_size' ]) ) $cff_date_size = $_POST[ 'cff_date_size' ];
1083
- if (isset($_POST[ 'cff_date_weight' ]) ) $cff_date_weight = $_POST[ 'cff_date_weight' ];
1084
- if (isset($_POST[ 'cff_date_color' ]) ) $cff_date_color = $_POST[ 'cff_date_color' ];
1085
- if (isset($_POST[ 'cff_date_formatting' ]) ) $cff_date_formatting = $_POST[ 'cff_date_formatting' ];
1086
- if (isset($_POST[ 'cff_date_custom' ]) ) $cff_date_custom = $_POST[ 'cff_date_custom' ];
1087
- if (isset($_POST[ 'cff_date_before' ]) ) $cff_date_before = $_POST[ 'cff_date_before' ];
1088
- if (isset($_POST[ 'cff_date_after' ]) ) $cff_date_after = $_POST[ 'cff_date_after' ];
1089
- if (isset($_POST[ 'cff_timezone' ]) ) $cff_timezone = $_POST[ 'cff_timezone' ];
1090
-
1091
- //Date translate
1092
- if (isset($_POST[ 'cff_translate_second' ]) ) $cff_translate_second = $_POST[ 'cff_translate_second' ];
1093
- if (isset($_POST[ 'cff_translate_seconds' ]) ) $cff_translate_seconds = $_POST[ 'cff_translate_seconds' ];
1094
- if (isset($_POST[ 'cff_translate_minute' ]) ) $cff_translate_minute = $_POST[ 'cff_translate_minute' ];
1095
- if (isset($_POST[ 'cff_translate_minutes' ]) ) $cff_translate_minutes = $_POST[ 'cff_translate_minutes' ];
1096
- if (isset($_POST[ 'cff_translate_hour' ]) ) $cff_translate_hour = $_POST[ 'cff_translate_hour' ];
1097
- if (isset($_POST[ 'cff_translate_hours' ]) ) $cff_translate_hours = $_POST[ 'cff_translate_hours' ];
1098
- if (isset($_POST[ 'cff_translate_day' ]) ) $cff_translate_day = $_POST[ 'cff_translate_day' ];
1099
- if (isset($_POST[ 'cff_translate_days' ]) ) $cff_translate_days = $_POST[ 'cff_translate_days' ];
1100
- if (isset($_POST[ 'cff_translate_week' ]) ) $cff_translate_week = $_POST[ 'cff_translate_week' ];
1101
- if (isset($_POST[ 'cff_translate_weeks' ]) ) $cff_translate_weeks = $_POST[ 'cff_translate_weeks' ];
1102
- if (isset($_POST[ 'cff_translate_month' ]) ) $cff_translate_month = $_POST[ 'cff_translate_month' ];
1103
- if (isset($_POST[ 'cff_translate_months' ]) ) $cff_translate_months = $_POST[ 'cff_translate_months' ];
1104
- if (isset($_POST[ 'cff_translate_year' ]) ) $cff_translate_year = $_POST[ 'cff_translate_year' ];
1105
- if (isset($_POST[ 'cff_translate_years' ]) ) $cff_translate_years = $_POST[ 'cff_translate_years' ];
1106
- if (isset($_POST[ 'cff_translate_ago' ]) ) $cff_translate_ago = $_POST[ 'cff_translate_ago' ];
1107
-
1108
- //View on Facebook link
1109
- if (isset($_POST[ 'cff_link_size' ]) ) $cff_link_size = $_POST[ 'cff_link_size' ];
1110
- if (isset($_POST[ 'cff_link_weight' ]) ) $cff_link_weight = $_POST[ 'cff_link_weight' ];
1111
- if (isset($_POST[ 'cff_link_color' ]) ) $cff_link_color = $_POST[ 'cff_link_color' ];
1112
- if (isset($_POST[ 'cff_facebook_link_text' ]) ) $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
1113
- if (isset($_POST[ 'cff_facebook_share_text' ]) ) $cff_facebook_share_text = $_POST[ 'cff_facebook_share_text' ];
1114
- (isset($_POST[ 'cff_show_facebook_link' ]) ) ? $cff_show_facebook_link = $_POST[ 'cff_show_facebook_link' ] : $cff_show_facebook_link = '';
1115
- (isset($_POST[ 'cff_show_facebook_share' ]) ) ? $cff_show_facebook_share = $_POST[ 'cff_show_facebook_share' ] : $cff_show_facebook_share = '';
1116
- if (isset($_POST[ 'cff_view_link_text' ]) ) $cff_view_link_text = $_POST[ 'cff_view_link_text' ];
1117
- if (isset($_POST[ 'cff_link_to_timeline' ]) ) $cff_link_to_timeline = $_POST[ 'cff_link_to_timeline' ];
1118
-
1119
- //Character limits
1120
- update_option( $cff_title_length, $cff_title_length_val );
1121
- update_option( $cff_body_length, $cff_body_length_val );
1122
- //Page Header
1123
- $options[ 'cff_header_outside' ] = $cff_header_outside;
1124
- $options[ 'cff_header_text' ] = $cff_header_text;
1125
- $options[ 'cff_header_bg_color' ] = $cff_header_bg_color;
1126
- $options[ 'cff_header_padding' ] = $cff_header_padding;
1127
- $options[ 'cff_header_text_size' ] = $cff_header_text_size;
1128
- $options[ 'cff_header_text_weight' ] = $cff_header_text_weight;
1129
- $options[ 'cff_header_text_color' ] = $cff_header_text_color;
1130
- $options[ 'cff_header_icon' ] = $cff_header_icon;
1131
- $options[ 'cff_header_icon_color' ] = $cff_header_icon_color;
1132
- $options[ 'cff_header_icon_size' ] = $cff_header_icon_size;
1133
- //Author
1134
- $options[ 'cff_author_size' ] = $cff_author_size;
1135
- $options[ 'cff_author_color' ] = $cff_author_color;
1136
- //Typography
1137
- $options[ 'cff_title_format' ] = $cff_title_format;
1138
- $options[ 'cff_title_size' ] = $cff_title_size;
1139
- $options[ 'cff_title_weight' ] = $cff_title_weight;
1140
- $options[ 'cff_title_color' ] = $cff_title_color;
1141
- $options[ 'cff_posttext_link_color' ] = $cff_posttext_link_color;
1142
- $options[ 'cff_title_link' ] = $cff_title_link;
1143
- $options[ 'cff_post_tags' ] = $cff_post_tags;
1144
- $options[ 'cff_link_hashtags' ] = $cff_link_hashtags;
1145
- $options[ 'cff_body_size' ] = $cff_body_size;
1146
- $options[ 'cff_body_weight' ] = $cff_body_weight;
1147
- $options[ 'cff_body_color' ] = $cff_body_color;
1148
- $options[ 'cff_link_title_format' ] = $cff_link_title_format;
1149
- $options[ 'cff_link_title_size' ] = $cff_link_title_size;
1150
- $options[ 'cff_link_title_color' ] = $cff_link_title_color;
1151
- $options[ 'cff_link_url_color' ] = $cff_link_url_color;
1152
- $options[ 'cff_link_bg_color' ] = $cff_link_bg_color;
1153
- $options[ 'cff_link_border_color' ] = $cff_link_border_color;
1154
- $options[ 'cff_disable_link_box' ] = $cff_disable_link_box;
1155
-
1156
- //Event title
1157
- $options[ 'cff_event_title_format' ] = $cff_event_title_format;
1158
- $options[ 'cff_event_title_size' ] = $cff_event_title_size;
1159
- $options[ 'cff_event_title_weight' ] = $cff_event_title_weight;
1160
- $options[ 'cff_event_title_color' ] = $cff_event_title_color;
1161
- $options[ 'cff_event_title_link' ] = $cff_event_title_link;
1162
- //Event date
1163
- $options[ 'cff_event_date_size' ] = $cff_event_date_size;
1164
- $options[ 'cff_event_date_weight' ] = $cff_event_date_weight;
1165
- $options[ 'cff_event_date_color' ] = $cff_event_date_color;
1166
- $options[ 'cff_event_date_position' ] = $cff_event_date_position;
1167
- $options[ 'cff_event_date_formatting' ] = $cff_event_date_formatting;
1168
- $options[ 'cff_event_date_custom' ] = $cff_event_date_custom;
1169
- //Event details
1170
- $options[ 'cff_event_details_size' ] = $cff_event_details_size;
1171
- $options[ 'cff_event_details_weight' ] = $cff_event_details_weight;
1172
- $options[ 'cff_event_details_color' ] = $cff_event_details_color;
1173
- $options[ 'cff_event_link_color' ] = $cff_event_link_color;
1174
- //Date
1175
- $options[ 'cff_date_position' ] = $cff_date_position;
1176
- $options[ 'cff_date_size' ] = $cff_date_size;
1177
- $options[ 'cff_date_weight' ] = $cff_date_weight;
1178
- $options[ 'cff_date_color' ] = $cff_date_color;
1179
- $options[ 'cff_date_formatting' ] = $cff_date_formatting;
1180
- $options[ 'cff_date_custom' ] = $cff_date_custom;
1181
- $options[ 'cff_date_before' ] = $cff_date_before;
1182
- $options[ 'cff_date_after' ] = $cff_date_after;
1183
- $options[ 'cff_timezone' ] = $cff_timezone;
1184
 
1185
- //Date translate
1186
- $options[ 'cff_translate_second' ] = $cff_translate_second;
1187
- $options[ 'cff_translate_seconds' ] = $cff_translate_seconds;
1188
- $options[ 'cff_translate_minute' ] = $cff_translate_minute;
1189
- $options[ 'cff_translate_minutes' ] = $cff_translate_minutes;
1190
- $options[ 'cff_translate_hour' ] = $cff_translate_hour;
1191
- $options[ 'cff_translate_hours' ] = $cff_translate_hours;
1192
- $options[ 'cff_translate_day' ] = $cff_translate_day;
1193
- $options[ 'cff_translate_days' ] = $cff_translate_days;
1194
- $options[ 'cff_translate_week' ] = $cff_translate_week;
1195
- $options[ 'cff_translate_weeks' ] = $cff_translate_weeks;
1196
- $options[ 'cff_translate_month' ] = $cff_translate_month;
1197
- $options[ 'cff_translate_months' ] = $cff_translate_months;
1198
- $options[ 'cff_translate_year' ] = $cff_translate_year;
1199
- $options[ 'cff_translate_years' ] = $cff_translate_years;
1200
- $options[ 'cff_translate_ago' ] = $cff_translate_ago;
1201
-
1202
- //View on Facebook link
1203
- $options[ 'cff_link_size' ] = $cff_link_size;
1204
- $options[ 'cff_link_weight' ] = $cff_link_weight;
1205
- $options[ 'cff_link_color' ] = $cff_link_color;
1206
- $options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
1207
- $options[ 'cff_facebook_share_text' ] = $cff_facebook_share_text;
1208
- $options[ 'cff_show_facebook_link' ] = $cff_show_facebook_link;
1209
- $options[ 'cff_show_facebook_share' ] = $cff_show_facebook_share;
1210
- $options[ 'cff_view_link_text' ] = $cff_view_link_text;
1211
- $options[ 'cff_link_to_timeline' ] = $cff_link_to_timeline;
1212
- }
1213
- //Update the Misc options
1214
- if( isset($_POST[ $style_misc_hidden_field_name ]) && $_POST[ $style_misc_hidden_field_name ] == 'Y' ) {
1215
- //Meta
1216
- if (isset($_POST[ 'cff_icon_style' ])) $cff_icon_style = $_POST[ 'cff_icon_style' ];
1217
- if (isset($_POST[ 'cff_meta_text_color' ])) $cff_meta_text_color = $_POST[ 'cff_meta_text_color' ];
1218
- if (isset($_POST[ 'cff_meta_bg_color' ])) $cff_meta_bg_color = $_POST[ 'cff_meta_bg_color' ];
1219
- if (isset($_POST[ 'cff_nocomments_text' ])) $cff_nocomments_text = $_POST[ 'cff_nocomments_text' ];
1220
- if (isset($_POST[ 'cff_hide_comments' ])) $cff_hide_comments = $_POST[ 'cff_hide_comments' ];
1221
- //Custom CSS
1222
- if (isset($_POST[ 'cff_custom_css' ])) $cff_custom_css = $_POST[ 'cff_custom_css' ];
1223
- if (isset($_POST[ 'cff_custom_js' ])) $cff_custom_js = $_POST[ 'cff_custom_js' ];
1224
- //Misc
1225
- (isset($_POST[ 'cff_show_like_box' ])) ? $cff_show_like_box = $_POST[ 'cff_show_like_box' ] : $cff_show_like_box = '';
1226
- if (isset($_POST[ 'cff_like_box_position' ])) $cff_like_box_position = $_POST[ 'cff_like_box_position' ];
1227
- (isset($_POST[ 'cff_like_box_outside' ])) ? $cff_like_box_outside = $_POST[ 'cff_like_box_outside' ] : $cff_like_box_outside = '';
1228
- if (isset($_POST[ 'cff_likebox_bg_color' ])) $cff_likebox_bg_color = $_POST[ 'cff_likebox_bg_color' ];
1229
- if (isset($_POST[ 'cff_like_box_text_color' ])) $cff_like_box_text_color = $_POST[ 'cff_like_box_text_color' ];
1230
-
1231
- if (isset($_POST[ 'cff_likebox_width' ])) $cff_likebox_width = $_POST[ 'cff_likebox_width' ];
1232
- if (isset($_POST[ 'cff_likebox_height' ])) $cff_likebox_height = $_POST[ 'cff_likebox_height' ];
1233
- (isset($_POST[ 'cff_like_box_faces' ])) ? $cff_like_box_faces = $_POST[ 'cff_like_box_faces' ] : $cff_like_box_faces = '';
1234
- (isset($_POST[ 'cff_like_box_border' ])) ? $cff_like_box_border = $_POST[ 'cff_like_box_border' ] : $cff_like_box_border = '';
1235
- (isset($_POST[ 'cff_like_box_cover' ])) ? $cff_like_box_cover = $_POST[ 'cff_like_box_cover' ] : $cff_like_box_cover = '';
1236
- (isset($_POST[ 'cff_like_box_small_header' ])) ? $cff_like_box_small_header = $_POST[ 'cff_like_box_small_header' ] : $cff_like_box_small_header = '';
1237
- (isset($_POST[ 'cff_like_box_hide_cta' ])) ? $cff_like_box_hide_cta = $_POST[ 'cff_like_box_hide_cta' ] : $cff_like_box_hide_cta = '';
1238
-
1239
-
1240
- if (isset($_POST[ 'cff_video_height' ])) $cff_video_height = $_POST[ 'cff_video_height' ];
1241
- if (isset($_POST[ 'cff_video_action' ])) $cff_video_action = $_POST[ 'cff_video_action' ];
1242
- if (isset($_POST[ 'cff_open_links' ])) $cff_open_links = $_POST[ 'cff_open_links' ];
1243
-
1244
- (isset($_POST[ $cff_ajax ])) ? $cff_ajax_val = $_POST[ 'cff_ajax' ] : $cff_ajax_val = '';
1245
- if (isset($_POST[ 'cff_app_id' ])) $cff_app_id = $_POST[ 'cff_app_id' ];
1246
- (isset($_POST[ 'cff_show_credit' ])) ? $cff_show_credit = $_POST[ 'cff_show_credit' ] : $cff_show_credit = '';
1247
- (isset($_POST[ 'cff_font_source' ])) ? $cff_font_source = $_POST[ 'cff_font_source' ] : $cff_font_source = '';
1248
- (isset($_POST[ $cff_preserve_settings ])) ? $cff_preserve_settings_val = $_POST[ 'cff_preserve_settings' ] : $cff_preserve_settings_val = '';
1249
- if (isset($_POST[ 'cff_cron' ])) $cff_cron = $_POST[ 'cff_cron' ];
1250
- if (isset($_POST[ 'cff_request_method' ])) $cff_request_method = $_POST[ 'cff_request_method' ];
1251
- (isset($_POST[ 'cff_disable_styles' ])) ? $cff_disable_styles = $_POST[ 'cff_disable_styles' ] : $cff_disable_styles = '';
1252
-
1253
- //Meta
1254
- $options[ 'cff_icon_style' ] = $cff_icon_style;
1255
- $options[ 'cff_meta_text_color' ] = $cff_meta_text_color;
1256
- $options[ 'cff_meta_bg_color' ] = $cff_meta_bg_color;
1257
- $options[ 'cff_nocomments_text' ] = $cff_nocomments_text;
1258
- $options[ 'cff_hide_comments' ] = $cff_hide_comments;
1259
- //Custom CSS
1260
- $options[ 'cff_custom_css' ] = $cff_custom_css;
1261
- $options[ 'cff_custom_js' ] = $cff_custom_js;
1262
- //Misc
1263
- $options[ 'cff_show_like_box' ] = $cff_show_like_box;
1264
- $options[ 'cff_like_box_position' ] = $cff_like_box_position;
1265
- $options[ 'cff_like_box_outside' ] = $cff_like_box_outside;
1266
- $options[ 'cff_likebox_bg_color' ] = $cff_likebox_bg_color;
1267
- $options[ 'cff_like_box_text_color' ] = $cff_like_box_text_color;
1268
-
1269
- $options[ 'cff_likebox_width' ] = $cff_likebox_width;
1270
- $options[ 'cff_likebox_height' ] = $cff_likebox_height;
1271
- $options[ 'cff_like_box_faces' ] = $cff_like_box_faces;
1272
- $options[ 'cff_like_box_border' ] = $cff_like_box_border;
1273
- $options[ 'cff_like_box_cover' ] = $cff_like_box_cover;
1274
- $options[ 'cff_like_box_small_header' ] = $cff_like_box_small_header;
1275
- $options[ 'cff_like_box_hide_cta' ] = $cff_like_box_hide_cta;
1276
-
1277
-
1278
- $options[ 'cff_video_height' ] = $cff_video_height;
1279
- $options[ 'cff_video_action' ] = $cff_video_action;
1280
- $options[ 'cff_open_links' ] = $cff_open_links;
1281
-
1282
- update_option( $cff_ajax, $cff_ajax_val );
1283
- $options[ 'cff_app_id' ] = $cff_app_id;
1284
- $options[ 'cff_show_credit' ] = $cff_show_credit;
1285
- $options[ 'cff_font_source' ] = $cff_font_source;
1286
- update_option( $cff_preserve_settings, $cff_preserve_settings_val );
1287
-
1288
- $options[ 'cff_cron' ] = $cff_cron;
1289
- $options[ 'cff_request_method' ] = $cff_request_method;
1290
- $options[ 'cff_disable_styles' ] = $cff_disable_styles;
1291
-
1292
- if( $cff_cron == 'no' ) wp_clear_scheduled_hook('cff_cron_job');
1293
-
1294
- //Run cron when Misc settings are saved
1295
- if( $cff_cron == 'yes' ){
1296
- //Clear the existing cron event
1297
- wp_clear_scheduled_hook('cff_cron_job');
1298
-
1299
- $cff_cache_time = get_option( 'cff_cache_time' );
1300
- $cff_cache_time_unit = get_option( 'cff_cache_time_unit' );
1301
-
1302
- //Set the event schedule based on what the caching time is set to
1303
- $cff_cron_schedule = 'hourly';
1304
- if( $cff_cache_time_unit == 'hours' && $cff_cache_time > 5 ) $cff_cron_schedule = 'twicedaily';
1305
- if( $cff_cache_time_unit == 'days' ) $cff_cron_schedule = 'daily';
1306
-
1307
- wp_schedule_event(time(), $cff_cron_schedule, 'cff_cron_job');
1308
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1309
 
1310
- }
1311
- //Update the Custom Text / Translate options
1312
- if( isset($_POST[ $style_custom_text_hidden_field_name ]) && $_POST[ $style_custom_text_hidden_field_name ] == 'Y' ) {
1313
-
1314
- //Translate
1315
- if (isset($_POST[ 'cff_see_more_text' ])) $cff_see_more_text = $_POST[ 'cff_see_more_text' ];
1316
- if (isset($_POST[ 'cff_see_less_text' ])) $cff_see_less_text = $_POST[ 'cff_see_less_text' ];
1317
- if (isset($_POST[ 'cff_facebook_link_text' ])) $cff_facebook_link_text = $_POST[ 'cff_facebook_link_text' ];
1318
- if (isset($_POST[ 'cff_facebook_share_text' ])) $cff_facebook_share_text = $_POST[ 'cff_facebook_share_text' ];
1319
-
1320
- //Social translate
1321
- if (isset($_POST[ 'cff_translate_photos_text' ])) $cff_translate_photos_text = $_POST[ 'cff_translate_photos_text' ];
1322
- if (isset($_POST[ 'cff_translate_photo_text' ])) $cff_translate_photo_text = $_POST[ 'cff_translate_photo_text' ];
1323
- if (isset($_POST[ 'cff_translate_video_text' ])) $cff_translate_video_text = $_POST[ 'cff_translate_video_text' ];
1324
-
1325
- //Date translate
1326
- if (isset($_POST[ 'cff_translate_second' ])) $cff_translate_second = $_POST[ 'cff_translate_second' ];
1327
- if (isset($_POST[ 'cff_translate_seconds' ])) $cff_translate_seconds = $_POST[ 'cff_translate_seconds' ];
1328
- if (isset($_POST[ 'cff_translate_minute' ])) $cff_translate_minute = $_POST[ 'cff_translate_minute' ];
1329
- if (isset($_POST[ 'cff_translate_minutes' ])) $cff_translate_minutes = $_POST[ 'cff_translate_minutes' ];
1330
- if (isset($_POST[ 'cff_translate_hour' ])) $cff_translate_hour = $_POST[ 'cff_translate_hour' ];
1331
- if (isset($_POST[ 'cff_translate_hours' ])) $cff_translate_hours = $_POST[ 'cff_translate_hours' ];
1332
- if (isset($_POST[ 'cff_translate_day' ])) $cff_translate_day = $_POST[ 'cff_translate_day' ];
1333
- if (isset($_POST[ 'cff_translate_days' ])) $cff_translate_days = $_POST[ 'cff_translate_days' ];
1334
- if (isset($_POST[ 'cff_translate_week' ])) $cff_translate_week = $_POST[ 'cff_translate_week' ];
1335
- if (isset($_POST[ 'cff_translate_weeks' ])) $cff_translate_weeks = $_POST[ 'cff_translate_weeks' ];
1336
- if (isset($_POST[ 'cff_translate_month' ])) $cff_translate_month = $_POST[ 'cff_translate_month' ];
1337
- if (isset($_POST[ 'cff_translate_months' ])) $cff_translate_months = $_POST[ 'cff_translate_months' ];
1338
- if (isset($_POST[ 'cff_translate_year' ])) $cff_translate_year = $_POST[ 'cff_translate_year' ];
1339
- if (isset($_POST[ 'cff_translate_years' ])) $cff_translate_years = $_POST[ 'cff_translate_years' ];
1340
- if (isset($_POST[ 'cff_translate_ago' ])) $cff_translate_ago = $_POST[ 'cff_translate_ago' ];
1341
-
1342
- //Translate
1343
- $options[ 'cff_see_more_text' ] = $cff_see_more_text;
1344
- $options[ 'cff_see_less_text' ] = $cff_see_less_text;
1345
- $options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
1346
- $options[ 'cff_facebook_share_text' ] = $cff_facebook_share_text;
1347
-
1348
- //Social translate
1349
- $options[ 'cff_translate_photos_text' ] = $cff_translate_photos_text;
1350
- $options[ 'cff_translate_photo_text' ] = $cff_translate_photo_text;
1351
- $options[ 'cff_translate_video_text' ] = $cff_translate_video_text;
1352
-
1353
- //Date translate
1354
- $options[ 'cff_translate_second' ] = $cff_translate_second;
1355
- $options[ 'cff_translate_seconds' ] = $cff_translate_seconds;
1356
- $options[ 'cff_translate_minute' ] = $cff_translate_minute;
1357
- $options[ 'cff_translate_minutes' ] = $cff_translate_minutes;
1358
- $options[ 'cff_translate_hour' ] = $cff_translate_hour;
1359
- $options[ 'cff_translate_hours' ] = $cff_translate_hours;
1360
- $options[ 'cff_translate_day' ] = $cff_translate_day;
1361
- $options[ 'cff_translate_days' ] = $cff_translate_days;
1362
- $options[ 'cff_translate_week' ] = $cff_translate_week;
1363
- $options[ 'cff_translate_weeks' ] = $cff_translate_weeks;
1364
- $options[ 'cff_translate_month' ] = $cff_translate_month;
1365
- $options[ 'cff_translate_months' ] = $cff_translate_months;
1366
- $options[ 'cff_translate_year' ] = $cff_translate_year;
1367
- $options[ 'cff_translate_years' ] = $cff_translate_years;
1368
- $options[ 'cff_translate_ago' ] = $cff_translate_ago;
 
 
 
 
 
 
 
 
 
 
1369
 
1370
- }
1371
- //Update the array
1372
- update_option( 'cff_style_settings', $options );
1373
- // Put an settings updated message on the screen
1374
- ?>
1375
- <div class="updated"><p><strong><?php _e('Settings saved.', 'custom-facebook-feed' ); ?></strong></p></div>
1376
- <?php } ?>
1377
 
1378
  <div id="cff-admin" class="wrap">
1379
  <div id="header">
@@ -1381,6 +1399,8 @@ function cff_style_page() {
1381
  </div>
1382
  <form name="form1" method="post" action="">
1383
  <input type="hidden" name="<?php echo $style_hidden_field_name; ?>" value="Y">
 
 
1384
  <?php
1385
  $cff_active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general';
1386
  ?>
@@ -2724,7 +2744,7 @@ function cff_style_page() {
2724
  </tr>
2725
  <tr valign="top" id="js"><!-- Quick link -->
2726
  <td>
2727
- <textarea name="cff_custom_css" id="cff_custom_css" style="width: 70%;" rows="7"><?php esc_attr_e( $cff_custom_css, 'custom-facebook-feed' ); ?></textarea>
2728
  </td>
2729
  </tr>
2730
  </tbody>
@@ -2740,7 +2760,7 @@ function cff_style_page() {
2740
  </tr>
2741
  <tr valign="top">
2742
  <td>
2743
- <textarea name="cff_custom_js" id="cff_custom_js" style="width: 70%;" rows="7"><?php esc_attr_e( stripslashes($cff_custom_js), 'custom-facebook-feed' ); ?></textarea>
2744
  </td>
2745
  </tr>
2746
  <tr id="misc"><!-- Quick link --></tr>
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  function cff_menu() {
5
  add_menu_page(
65
  $options = wp_parse_args(get_option('cff_style_settings'), $defaults);
66
  $cff_timezone = $options[ 'cff_timezone' ];
67
 
68
+
69
+ //Check nonce before saving data
70
+ if ( ! isset( $_POST['cff_settings_nonce'] ) || ! wp_verify_nonce( $_POST['cff_settings_nonce'], 'cff_saving_settings' ) ) {
71
+ //Nonce did not verify
72
+ } else {
73
+ // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
74
+ if( isset($_POST[ $hidden_field_name ]) && $_POST[ $hidden_field_name ] == 'Y' ) {
75
+ // Read their posted value
76
+ isset( $_POST[ $show_access_token ] ) ? $show_access_token_val = sanitize_text_field( $_POST[ $show_access_token ] ) : $show_access_token_val = '';
77
+ isset( $_POST[ $access_token ] ) ? $access_token_val = sanitize_text_field( $_POST[ $access_token ] ) : $access_token_val = '';
78
+ isset( $_POST[ $page_id ] ) ? $page_id_val = sanitize_text_field( $_POST[ $page_id ] ) : $page_id_val = '';
79
+ isset( $_POST[ $cff_page_type ] ) ? $cff_page_type_val = sanitize_text_field( $_POST[ $cff_page_type ] ) : $cff_page_type_val = '';
80
+ isset( $_POST[ $num_show ] ) ? $num_show_val = sanitize_text_field( $_POST[ $num_show ] ) : $num_show_val = '';
81
+ isset( $_POST[ $cff_post_limit ] ) ? $cff_post_limit_val = sanitize_text_field( $_POST[ $cff_post_limit ] ) : $cff_post_limit_val = '';
82
+ isset( $_POST[ $cff_show_others ] ) ? $cff_show_others_val = sanitize_text_field( $_POST[ $cff_show_others ] ) : $cff_show_others_val = '';
83
+ isset( $_POST[ $cff_cache_time ] ) ? $cff_cache_time_val = sanitize_text_field( $_POST[ $cff_cache_time ] ) : $cff_cache_time_val = '';
84
+ isset( $_POST[ $cff_cache_time_unit ] ) ? $cff_cache_time_unit_val = sanitize_text_field( $_POST[ $cff_cache_time_unit ] ) : $cff_cache_time_unit_val = '';
85
+ isset( $_POST[ $cff_locale ] ) ? $cff_locale_val = sanitize_text_field( $_POST[ $cff_locale ] ) : $cff_locale_val = '';
86
+ if (isset($_POST[ 'cff_timezone' ]) ) $cff_timezone = sanitize_text_field( $_POST[ 'cff_timezone' ] );
87
+
88
+ // Save the posted value in the database
89
+ update_option( $show_access_token, $show_access_token_val );
90
+ update_option( $access_token, $access_token_val );
91
+ update_option( $page_id, $page_id_val );
92
+ update_option( $cff_page_type, $cff_page_type_val );
93
+ update_option( $num_show, $num_show_val );
94
+ update_option( $cff_post_limit, $cff_post_limit_val );
95
+ update_option( $cff_show_others, $cff_show_others_val );
96
+ update_option( $cff_cache_time, $cff_cache_time_val );
97
+ update_option( $cff_cache_time_unit, $cff_cache_time_unit_val );
98
+ update_option( $cff_locale, $cff_locale_val );
99
+
100
+ $options[ 'cff_timezone' ] = $cff_timezone;
101
+ update_option( 'cff_style_settings', $options );
102
+
103
+ //Delete ALL transients
104
+ global $wpdb;
105
+ $table_name = $wpdb->prefix . "options";
106
+ $wpdb->query( "
107
+ DELETE
108
+ FROM $table_name
109
+ WHERE `option_name` LIKE ('%\_transient\_cff\_%')
110
+ " );
111
+ $wpdb->query( "
112
+ DELETE
113
+ FROM $table_name
114
+ WHERE `option_name` LIKE ('%\_transient\_cff\_tle\_%')
115
+ " );
116
+ $wpdb->query( "
117
+ DELETE
118
+ FROM $table_name
119
+ WHERE `option_name` LIKE ('%\_transient\_timeout\_cff\_%')
120
+ " );
121
+ // Put an settings updated message on the screen
122
+ ?>
123
+ <div class="updated"><p><strong><?php _e('Settings saved.', 'custom-facebook-feed' ); ?></strong></p></div>
124
+ <?php } ?>
125
+
126
+ <?php } //End nonce check ?>
127
 
128
  <div id="cff-admin" class="wrap">
129
  <div id="header">
143
 
144
  <form name="form1" method="post" action="">
145
  <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">
146
+ <?php wp_nonce_field( 'cff_saving_settings', 'cff_settings_nonce' ); ?>
147
+
148
  <br />
149
  <h3><?php _e('Configuration', 'custom-facebook-feed'); ?></h3>
150
  <table class="form-table">
946
  $cff_ajax = 'cff_ajax';
947
  $cff_ajax_val = get_option( $cff_ajax );
948
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
949
 
950
+ //Check nonce before saving data
951
+ if ( ! isset( $_POST['cff_customize_nonce'] ) || ! wp_verify_nonce( $_POST['cff_customize_nonce'], 'cff_saving_customize' ) ) {
952
+ //Nonce did not verify
953
+ } else {
954
+ // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
955
+ if( isset($_POST[ $style_hidden_field_name ]) && $_POST[ $style_hidden_field_name ] == 'Y' ) {
956
+ //Update the General options
957
+ if( isset($_POST[ $style_general_hidden_field_name ]) && $_POST[ $style_general_hidden_field_name ] == 'Y' ) {
958
+ //General
959
+ if (isset($_POST[ 'cff_feed_width' ]) ) $cff_feed_width = sanitize_text_field( $_POST[ 'cff_feed_width' ] );
960
+ (isset($_POST[ 'cff_feed_width_resp' ]) ) ? $cff_feed_width_resp = sanitize_text_field( $_POST[ 'cff_feed_width_resp' ] ) : $cff_feed_width_resp = '';
961
+ if (isset($_POST[ 'cff_feed_height' ]) ) $cff_feed_height = sanitize_text_field( $_POST[ 'cff_feed_height' ] );
962
+ if (isset($_POST[ 'cff_feed_padding' ]) ) $cff_feed_padding = sanitize_text_field( $_POST[ 'cff_feed_padding' ] );
963
+ if (isset($_POST[ 'cff_bg_color' ]) ) $cff_bg_color = sanitize_text_field( $_POST[ 'cff_bg_color' ] );
964
+ if (isset($_POST[ 'cff_class' ]) ) $cff_class = sanitize_text_field( $_POST[ 'cff_class' ] );
965
+ (isset($_POST[ 'cff_show_header' ])) ? $cff_show_header = sanitize_text_field( $_POST[ 'cff_show_header' ] ) : $cff_show_header = '';
966
+
967
+ //Post types
968
+ if (isset($_POST[ 'cff_show_links_type' ]) ) $cff_show_links_type = sanitize_text_field( $_POST[ 'cff_show_links_type' ] );
969
+ if (isset($_POST[ 'cff_show_event_type' ]) ) $cff_show_event_type = sanitize_text_field( $_POST[ 'cff_show_event_type' ] );
970
+ if (isset($_POST[ 'cff_show_video_type' ]) ) $cff_show_video_type = sanitize_text_field( $_POST[ 'cff_show_video_type' ] );
971
+ if (isset($_POST[ 'cff_show_photos_type' ]) ) $cff_show_photos_type = sanitize_text_field( $_POST[ 'cff_show_photos_type' ] );
972
+ if (isset($_POST[ 'cff_show_status_type' ]) ) $cff_show_status_type = sanitize_text_field( $_POST[ 'cff_show_status_type' ] );
973
+ //General
974
+ $options[ 'cff_feed_width' ] = $cff_feed_width;
975
+ $options[ 'cff_feed_width_resp' ] = $cff_feed_width_resp;
976
+ $options[ 'cff_feed_height' ] = $cff_feed_height;
977
+ $options[ 'cff_feed_padding' ] = $cff_feed_padding;
978
+ $options[ 'cff_bg_color' ] = $cff_bg_color;
979
+ $options[ 'cff_class' ] = $cff_class;
980
+ $options[ 'cff_show_header' ] = $cff_show_header;
981
+
982
+ //Post types
983
+ $options[ 'cff_show_links_type' ] = $cff_show_links_type;
984
+ $options[ 'cff_show_event_type' ] = $cff_show_event_type;
985
+ $options[ 'cff_show_video_type' ] = $cff_show_video_type;
986
+ $options[ 'cff_show_photos_type' ] = $cff_show_photos_type;
987
+ $options[ 'cff_show_status_type' ] = $cff_show_status_type;
988
+ }
989
+ //Update the Post Layout options
990
+ if( isset($_POST[ $style_post_layout_hidden_field_name ]) && $_POST[ $style_post_layout_hidden_field_name ] == 'Y' ) {
991
+ //Layout
992
+ if (isset($_POST[ 'cff_preset_layout' ]) ) $cff_preset_layout = sanitize_text_field( $_POST[ 'cff_preset_layout' ] );
993
+ //Include
994
+ (isset($_POST[ 'cff_show_author' ]) ) ? $cff_show_author = sanitize_text_field( $_POST[ 'cff_show_author' ] ) : $cff_show_author = '';
995
+ (isset($_POST[ 'cff_show_text' ]) ) ? $cff_show_text = sanitize_text_field( $_POST[ 'cff_show_text' ] ) : $cff_show_text = '';
996
+ (isset($_POST[ 'cff_show_desc' ]) ) ? $cff_show_desc = sanitize_text_field( $_POST[ 'cff_show_desc' ] ) : $cff_show_desc = '';
997
+ (isset($_POST[ 'cff_show_shared_links' ]) ) ? $cff_show_shared_links = sanitize_text_field( $_POST[ 'cff_show_shared_links' ] ) : $cff_show_shared_links = '';
998
+ (isset($_POST[ 'cff_show_date' ]) ) ? $cff_show_date = sanitize_text_field( $_POST[ 'cff_show_date' ] ) : $cff_show_date = '';
999
+ (isset($_POST[ 'cff_show_media' ]) ) ? $cff_show_media = sanitize_text_field( $_POST[ 'cff_show_media' ] ) : $cff_show_media = '';
1000
+ (isset($_POST[ 'cff_show_media_link' ]) ) ? $cff_show_media_link = sanitize_text_field( $_POST[ 'cff_show_media_link' ] ) : $cff_show_media_link = '';
1001
+ (isset($_POST[ 'cff_show_event_title' ]) ) ? $cff_show_event_title = sanitize_text_field( $_POST[ 'cff_show_event_title' ] ) : $cff_show_event_title = '';
1002
+ (isset($_POST[ 'cff_show_event_details' ]) ) ? $cff_show_event_details = sanitize_text_field( $_POST[ 'cff_show_event_details' ] ) : $cff_show_event_details = '';
1003
+ (isset($_POST[ 'cff_show_meta' ]) ) ? $cff_show_meta = sanitize_text_field( $_POST[ 'cff_show_meta' ] ) : $cff_show_meta = '';
1004
+ (isset($_POST[ 'cff_show_link' ]) ) ? $cff_show_link = sanitize_text_field( $_POST[ 'cff_show_link' ] ) : $cff_show_link = '';
1005
+ //Post Style
1006
+ (isset($_POST[ 'cff_post_bg_color' ]) ) ? $cff_post_bg_color = sanitize_text_field( $_POST[ 'cff_post_bg_color' ] ) : $cff_post_bg_color = '';
1007
+ (isset($_POST[ 'cff_post_rounded' ]) ) ? $cff_post_rounded = sanitize_text_field( $_POST[ 'cff_post_rounded' ] ) : $cff_post_rounded = '';
1008
+ if (isset($_POST[ 'cff_sep_color' ])) $cff_sep_color = sanitize_text_field( $_POST[ 'cff_sep_color' ] );
1009
+ if (isset($_POST[ 'cff_sep_size' ])) $cff_sep_size = sanitize_text_field( $_POST[ 'cff_sep_size' ] );
1010
+
1011
+ //Layout
1012
+ $options[ 'cff_preset_layout' ] = $cff_preset_layout;
1013
+ //Include
1014
+ $options[ 'cff_show_author' ] = $cff_show_author;
1015
+ $options[ 'cff_show_text' ] = $cff_show_text;
1016
+ $options[ 'cff_show_desc' ] = $cff_show_desc;
1017
+ $options[ 'cff_show_shared_links' ] = $cff_show_shared_links;
1018
+ $options[ 'cff_show_date' ] = $cff_show_date;
1019
+ $options[ 'cff_show_media' ] = $cff_show_media;
1020
+ $options[ 'cff_show_media_link' ] = $cff_show_media_link;
1021
+ $options[ 'cff_show_event_title' ] = $cff_show_event_title;
1022
+ $options[ 'cff_show_event_details' ] = $cff_show_event_details;
1023
+ $options[ 'cff_show_meta' ] = $cff_show_meta;
1024
+ $options[ 'cff_show_link' ] = $cff_show_link;
1025
+ //Post Style
1026
+ $options[ 'cff_post_bg_color' ] = $cff_post_bg_color;
1027
+ $options[ 'cff_post_rounded' ] = $cff_post_rounded;
1028
+ $options[ 'cff_sep_color' ] = $cff_sep_color;
1029
+ $options[ 'cff_sep_size' ] = $cff_sep_size;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1030
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1031
  }
1032
+ //Update the Typography options
1033
+ if( isset($_POST[ $style_typography_hidden_field_name ]) && $_POST[ $style_typography_hidden_field_name ] == 'Y' ) {
1034
+ //Character limits
1035
+ if (isset($_POST[ 'cff_title_length' ]) ) $cff_title_length_val = sanitize_text_field( $_POST[ $cff_title_length ] );
1036
+ if (isset($_POST[ 'cff_body_length' ]) ) $cff_body_length_val = sanitize_text_field( $_POST[ $cff_body_length ] );
1037
+
1038
+ //Page Header
1039
+ (isset($_POST[ 'cff_header_outside' ])) ? $cff_header_outside = sanitize_text_field( $_POST[ 'cff_header_outside' ] ) : $cff_header_outside = '';
1040
+ if (isset($_POST[ 'cff_header_text' ])) $cff_header_text = sanitize_text_field( $_POST[ 'cff_header_text' ] );
1041
+ if (isset($_POST[ 'cff_header_bg_color' ])) $cff_header_bg_color = sanitize_text_field( $_POST[ 'cff_header_bg_color' ] );
1042
+ if (isset($_POST[ 'cff_header_padding' ])) $cff_header_padding = sanitize_text_field( $_POST[ 'cff_header_padding' ] );
1043
+ if (isset($_POST[ 'cff_header_text_size' ])) $cff_header_text_size = sanitize_text_field( $_POST[ 'cff_header_text_size' ] );
1044
+ if (isset($_POST[ 'cff_header_text_weight' ])) $cff_header_text_weight = sanitize_text_field( $_POST[ 'cff_header_text_weight' ] );
1045
+ if (isset($_POST[ 'cff_header_text_color' ])) $cff_header_text_color = sanitize_text_field( $_POST[ 'cff_header_text_color' ] );
1046
+ if (isset($_POST[ 'cff_header_icon' ])) $cff_header_icon = sanitize_text_field( $_POST[ 'cff_header_icon' ] );
1047
+ if (isset($_POST[ 'cff_header_icon_color' ])) $cff_header_icon_color = sanitize_text_field( $_POST[ 'cff_header_icon_color' ] );
1048
+ if (isset($_POST[ 'cff_header_icon_size' ])) $cff_header_icon_size = sanitize_text_field( $_POST[ 'cff_header_icon_size' ] );
1049
+
1050
+ //Author
1051
+ if (isset($_POST[ 'cff_author_size' ])) $cff_author_size = sanitize_text_field( $_POST[ 'cff_author_size' ] );
1052
+ if (isset($_POST[ 'cff_author_color' ])) $cff_author_color = sanitize_text_field( $_POST[ 'cff_author_color' ] );
1053
+
1054
+ //Typography
1055
+ if (isset($_POST[ 'cff_title_format' ]) ) $cff_title_format = sanitize_text_field( $_POST[ 'cff_title_format' ] );
1056
+ if (isset($_POST[ 'cff_title_size' ]) ) $cff_title_size = sanitize_text_field( $_POST[ 'cff_title_size' ] );
1057
+ if (isset($_POST[ 'cff_title_weight' ]) ) $cff_title_weight = sanitize_text_field( $_POST[ 'cff_title_weight' ] );
1058
+ if (isset($_POST[ 'cff_title_color' ]) ) $cff_title_color = sanitize_text_field( $_POST[ 'cff_title_color' ] );
1059
+ if (isset($_POST[ 'cff_posttext_link_color' ]) ) $cff_posttext_link_color = sanitize_text_field( $_POST[ 'cff_posttext_link_color' ] );
1060
+
1061
+ (isset($_POST[ 'cff_title_link' ]) ) ? $cff_title_link = sanitize_text_field( $_POST[ 'cff_title_link' ] ) : $cff_title_link = '';
1062
+ (isset($_POST[ 'cff_post_tags' ]) ) ? $cff_post_tags = sanitize_text_field( $_POST[ 'cff_post_tags' ] ) : $cff_post_tags = '';
1063
+ (isset($_POST[ 'cff_link_hashtags' ]) ) ? $cff_link_hashtags = sanitize_text_field( $_POST[ 'cff_link_hashtags' ] ) : $cff_link_hashtags = '';
1064
+
1065
+ $cff_body_size = $_POST[ 'cff_body_size' ];
1066
+ if (isset($_POST[ 'cff_body_weight' ]) ) $cff_body_weight = sanitize_text_field( $_POST[ 'cff_body_weight' ] );
1067
+ if (isset($_POST[ 'cff_body_color' ]) ) $cff_body_color = sanitize_text_field( $_POST[ 'cff_body_color' ] );
1068
+ if (isset($_POST[ 'cff_link_title_format' ]) ) $cff_link_title_format = sanitize_text_field( $_POST[ 'cff_link_title_format' ] );
1069
+ if (isset($_POST[ 'cff_link_title_size' ]) ) $cff_link_title_size = sanitize_text_field( $_POST[ 'cff_link_title_size' ] );
1070
+ if (isset($_POST[ 'cff_link_title_color' ]) ) $cff_link_title_color = sanitize_text_field( $_POST[ 'cff_link_title_color' ] );
1071
+ if (isset($_POST[ 'cff_link_url_color' ]) ) $cff_link_url_color = sanitize_text_field( $_POST[ 'cff_link_url_color' ] );
1072
+ if (isset($_POST[ 'cff_link_bg_color' ]) ) $cff_link_bg_color = sanitize_text_field( $_POST[ 'cff_link_bg_color' ] );
1073
+ if (isset($_POST[ 'cff_link_border_color' ]) ) $cff_link_border_color = sanitize_text_field( $_POST[ 'cff_link_border_color' ] );
1074
+ (isset($_POST[ 'cff_disable_link_box' ]) ) ? $cff_disable_link_box = sanitize_text_field( $_POST[ 'cff_disable_link_box' ] ) : $cff_disable_link_box = '';
1075
+
1076
+
1077
+ //Event title
1078
+ if (isset($_POST[ 'cff_event_title_format' ]) ) $cff_event_title_format = sanitize_text_field( $_POST[ 'cff_event_title_format' ] );
1079
+ if (isset($_POST[ 'cff_event_title_size' ]) ) $cff_event_title_size = sanitize_text_field( $_POST[ 'cff_event_title_size' ] );
1080
+ if (isset($_POST[ 'cff_event_title_weight' ]) ) $cff_event_title_weight = sanitize_text_field( $_POST[ 'cff_event_title_weight' ] );
1081
+ if (isset($_POST[ 'cff_event_title_color' ]) ) $cff_event_title_color = sanitize_text_field( $_POST[ 'cff_event_title_color' ] );
1082
+ (isset($_POST[ 'cff_event_title_link' ]) ) ? $cff_event_title_link = sanitize_text_field( $_POST[ 'cff_event_title_link' ] ) : $cff_event_title_link = '';
1083
+ //Event date
1084
+ if (isset($_POST[ 'cff_event_date_size' ]) ) $cff_event_date_size = sanitize_text_field( $_POST[ 'cff_event_date_size' ] );
1085
+ if (isset($_POST[ 'cff_event_date_weight' ]) ) $cff_event_date_weight = sanitize_text_field( $_POST[ 'cff_event_date_weight' ] );
1086
+ if (isset($_POST[ 'cff_event_date_color' ]) ) $cff_event_date_color = sanitize_text_field( $_POST[ 'cff_event_date_color' ] );
1087
+ if (isset($_POST[ 'cff_event_date_position' ]) ) $cff_event_date_position = sanitize_text_field( $_POST[ 'cff_event_date_position' ] );
1088
+ if (isset($_POST[ 'cff_event_date_formatting' ]) ) $cff_event_date_formatting = sanitize_text_field( $_POST[ 'cff_event_date_formatting' ] );
1089
+ if (isset($_POST[ 'cff_event_date_custom' ]) ) $cff_event_date_custom = sanitize_text_field( $_POST[ 'cff_event_date_custom' ] );
1090
+ //Event details
1091
+ if (isset($_POST[ 'cff_event_details_size' ]) ) $cff_event_details_size = sanitize_text_field( $_POST[ 'cff_event_details_size' ] );
1092
+ if (isset($_POST[ 'cff_event_details_weight' ]) ) $cff_event_details_weight = sanitize_text_field( $_POST[ 'cff_event_details_weight' ] );
1093
+ if (isset($_POST[ 'cff_event_details_color' ]) ) $cff_event_details_color = sanitize_text_field( $_POST[ 'cff_event_details_color' ] );
1094
+ if (isset($_POST[ 'cff_event_link_color' ]) ) $cff_event_link_color = sanitize_text_field( $_POST[ 'cff_event_link_color' ] );
1095
+ //Date
1096
+ if (isset($_POST[ 'cff_date_position' ]) ) $cff_date_position = sanitize_text_field( $_POST[ 'cff_date_position' ] );
1097
+ if (isset($_POST[ 'cff_date_size' ]) ) $cff_date_size = sanitize_text_field( $_POST[ 'cff_date_size' ] );
1098
+ if (isset($_POST[ 'cff_date_weight' ]) ) $cff_date_weight = sanitize_text_field( $_POST[ 'cff_date_weight' ] );
1099
+ if (isset($_POST[ 'cff_date_color' ]) ) $cff_date_color = sanitize_text_field( $_POST[ 'cff_date_color' ] );
1100
+ if (isset($_POST[ 'cff_date_formatting' ]) ) $cff_date_formatting = sanitize_text_field( $_POST[ 'cff_date_formatting' ] );
1101
+ if (isset($_POST[ 'cff_date_custom' ]) ) $cff_date_custom = sanitize_text_field( $_POST[ 'cff_date_custom' ] );
1102
+ if (isset($_POST[ 'cff_date_before' ]) ) $cff_date_before = sanitize_text_field( $_POST[ 'cff_date_before' ] );
1103
+ if (isset($_POST[ 'cff_date_after' ]) ) $cff_date_after = sanitize_text_field( $_POST[ 'cff_date_after' ] );
1104
+ if (isset($_POST[ 'cff_timezone' ]) ) $cff_timezone = sanitize_text_field( $_POST[ 'cff_timezone' ] );
1105
+
1106
+ //Date translate
1107
+ if (isset($_POST[ 'cff_translate_second' ]) ) $cff_translate_second = sanitize_text_field( $_POST[ 'cff_translate_second' ] );
1108
+ if (isset($_POST[ 'cff_translate_seconds' ]) ) $cff_translate_seconds = sanitize_text_field( $_POST[ 'cff_translate_seconds' ] );
1109
+ if (isset($_POST[ 'cff_translate_minute' ]) ) $cff_translate_minute = sanitize_text_field( $_POST[ 'cff_translate_minute' ] );
1110
+ if (isset($_POST[ 'cff_translate_minutes' ]) ) $cff_translate_minutes = sanitize_text_field( $_POST[ 'cff_translate_minutes' ] );
1111
+ if (isset($_POST[ 'cff_translate_hour' ]) ) $cff_translate_hour = sanitize_text_field( $_POST[ 'cff_translate_hour' ] );
1112
+ if (isset($_POST[ 'cff_translate_hours' ]) ) $cff_translate_hours = sanitize_text_field( $_POST[ 'cff_translate_hours' ] );
1113
+ if (isset($_POST[ 'cff_translate_day' ]) ) $cff_translate_day = sanitize_text_field( $_POST[ 'cff_translate_day' ] );
1114
+ if (isset($_POST[ 'cff_translate_days' ]) ) $cff_translate_days = sanitize_text_field( $_POST[ 'cff_translate_days' ] );
1115
+ if (isset($_POST[ 'cff_translate_week' ]) ) $cff_translate_week = sanitize_text_field( $_POST[ 'cff_translate_week' ] );
1116
+ if (isset($_POST[ 'cff_translate_weeks' ]) ) $cff_translate_weeks = sanitize_text_field( $_POST[ 'cff_translate_weeks' ] );
1117
+ if (isset($_POST[ 'cff_translate_month' ]) ) $cff_translate_month = sanitize_text_field( $_POST[ 'cff_translate_month' ] );
1118
+ if (isset($_POST[ 'cff_translate_months' ]) ) $cff_translate_months = sanitize_text_field( $_POST[ 'cff_translate_months' ] );
1119
+ if (isset($_POST[ 'cff_translate_year' ]) ) $cff_translate_year = sanitize_text_field( $_POST[ 'cff_translate_year' ] );
1120
+ if (isset($_POST[ 'cff_translate_years' ]) ) $cff_translate_years = sanitize_text_field( $_POST[ 'cff_translate_years' ] );
1121
+ if (isset($_POST[ 'cff_translate_ago' ]) ) $cff_translate_ago = sanitize_text_field( $_POST[ 'cff_translate_ago' ] );
1122
+
1123
+ //View on Facebook link
1124
+ if (isset($_POST[ 'cff_link_size' ]) ) $cff_link_size = sanitize_text_field( $_POST[ 'cff_link_size' ] );
1125
+ if (isset($_POST[ 'cff_link_weight' ]) ) $cff_link_weight = sanitize_text_field( $_POST[ 'cff_link_weight' ] );
1126
+ if (isset($_POST[ 'cff_link_color' ]) ) $cff_link_color = sanitize_text_field( $_POST[ 'cff_link_color' ] );
1127
+ if (isset($_POST[ 'cff_facebook_link_text' ]) ) $cff_facebook_link_text = sanitize_text_field( $_POST[ 'cff_facebook_link_text' ] );
1128
+ if (isset($_POST[ 'cff_facebook_share_text' ]) ) $cff_facebook_share_text = sanitize_text_field( $_POST[ 'cff_facebook_share_text' ] );
1129
+ (isset($_POST[ 'cff_show_facebook_link' ]) ) ? $cff_show_facebook_link = sanitize_text_field( $_POST[ 'cff_show_facebook_link' ] ) : $cff_show_facebook_link = '';
1130
+ (isset($_POST[ 'cff_show_facebook_share' ]) ) ? $cff_show_facebook_share = sanitize_text_field( $_POST[ 'cff_show_facebook_share' ] ) : $cff_show_facebook_share = '';
1131
+ if (isset($_POST[ 'cff_view_link_text' ]) ) $cff_view_link_text = sanitize_text_field( $_POST[ 'cff_view_link_text' ] );
1132
+ if (isset($_POST[ 'cff_link_to_timeline' ]) ) $cff_link_to_timeline = sanitize_text_field( $_POST[ 'cff_link_to_timeline' ] );
1133
+
1134
+ //Character limits
1135
+ update_option( $cff_title_length, $cff_title_length_val );
1136
+ update_option( $cff_body_length, $cff_body_length_val );
1137
+ //Page Header
1138
+ $options[ 'cff_header_outside' ] = $cff_header_outside;
1139
+ $options[ 'cff_header_text' ] = $cff_header_text;
1140
+ $options[ 'cff_header_bg_color' ] = $cff_header_bg_color;
1141
+ $options[ 'cff_header_padding' ] = $cff_header_padding;
1142
+ $options[ 'cff_header_text_size' ] = $cff_header_text_size;
1143
+ $options[ 'cff_header_text_weight' ] = $cff_header_text_weight;
1144
+ $options[ 'cff_header_text_color' ] = $cff_header_text_color;
1145
+ $options[ 'cff_header_icon' ] = $cff_header_icon;
1146
+ $options[ 'cff_header_icon_color' ] = $cff_header_icon_color;
1147
+ $options[ 'cff_header_icon_size' ] = $cff_header_icon_size;
1148
+ //Author
1149
+ $options[ 'cff_author_size' ] = $cff_author_size;
1150
+ $options[ 'cff_author_color' ] = $cff_author_color;
1151
+ //Typography
1152
+ $options[ 'cff_title_format' ] = $cff_title_format;
1153
+ $options[ 'cff_title_size' ] = $cff_title_size;
1154
+ $options[ 'cff_title_weight' ] = $cff_title_weight;
1155
+ $options[ 'cff_title_color' ] = $cff_title_color;
1156
+ $options[ 'cff_posttext_link_color' ] = $cff_posttext_link_color;
1157
+ $options[ 'cff_title_link' ] = $cff_title_link;
1158
+ $options[ 'cff_post_tags' ] = $cff_post_tags;
1159
+ $options[ 'cff_link_hashtags' ] = $cff_link_hashtags;
1160
+ $options[ 'cff_body_size' ] = $cff_body_size;
1161
+ $options[ 'cff_body_weight' ] = $cff_body_weight;
1162
+ $options[ 'cff_body_color' ] = $cff_body_color;
1163
+ $options[ 'cff_link_title_format' ] = $cff_link_title_format;
1164
+ $options[ 'cff_link_title_size' ] = $cff_link_title_size;
1165
+ $options[ 'cff_link_title_color' ] = $cff_link_title_color;
1166
+ $options[ 'cff_link_url_color' ] = $cff_link_url_color;
1167
+ $options[ 'cff_link_bg_color' ] = $cff_link_bg_color;
1168
+ $options[ 'cff_link_border_color' ] = $cff_link_border_color;
1169
+ $options[ 'cff_disable_link_box' ] = $cff_disable_link_box;
1170
+
1171
+ //Event title
1172
+ $options[ 'cff_event_title_format' ] = $cff_event_title_format;
1173
+ $options[ 'cff_event_title_size' ] = $cff_event_title_size;
1174
+ $options[ 'cff_event_title_weight' ] = $cff_event_title_weight;
1175
+ $options[ 'cff_event_title_color' ] = $cff_event_title_color;
1176
+ $options[ 'cff_event_title_link' ] = $cff_event_title_link;
1177
+ //Event date
1178
+ $options[ 'cff_event_date_size' ] = $cff_event_date_size;
1179
+ $options[ 'cff_event_date_weight' ] = $cff_event_date_weight;
1180
+ $options[ 'cff_event_date_color' ] = $cff_event_date_color;
1181
+ $options[ 'cff_event_date_position' ] = $cff_event_date_position;
1182
+ $options[ 'cff_event_date_formatting' ] = $cff_event_date_formatting;
1183
+ $options[ 'cff_event_date_custom' ] = $cff_event_date_custom;
1184
+ //Event details
1185
+ $options[ 'cff_event_details_size' ] = $cff_event_details_size;
1186
+ $options[ 'cff_event_details_weight' ] = $cff_event_details_weight;
1187
+ $options[ 'cff_event_details_color' ] = $cff_event_details_color;
1188
+ $options[ 'cff_event_link_color' ] = $cff_event_link_color;
1189
+ //Date
1190
+ $options[ 'cff_date_position' ] = $cff_date_position;
1191
+ $options[ 'cff_date_size' ] = $cff_date_size;
1192
+ $options[ 'cff_date_weight' ] = $cff_date_weight;
1193
+ $options[ 'cff_date_color' ] = $cff_date_color;
1194
+ $options[ 'cff_date_formatting' ] = $cff_date_formatting;
1195
+ $options[ 'cff_date_custom' ] = $cff_date_custom;
1196
+ $options[ 'cff_date_before' ] = $cff_date_before;
1197
+ $options[ 'cff_date_after' ] = $cff_date_after;
1198
+ $options[ 'cff_timezone' ] = $cff_timezone;
1199
+
1200
+ //Date translate
1201
+ $options[ 'cff_translate_second' ] = $cff_translate_second;
1202
+ $options[ 'cff_translate_seconds' ] = $cff_translate_seconds;
1203
+ $options[ 'cff_translate_minute' ] = $cff_translate_minute;
1204
+ $options[ 'cff_translate_minutes' ] = $cff_translate_minutes;
1205
+ $options[ 'cff_translate_hour' ] = $cff_translate_hour;
1206
+ $options[ 'cff_translate_hours' ] = $cff_translate_hours;
1207
+ $options[ 'cff_translate_day' ] = $cff_translate_day;
1208
+ $options[ 'cff_translate_days' ] = $cff_translate_days;
1209
+ $options[ 'cff_translate_week' ] = $cff_translate_week;
1210
+ $options[ 'cff_translate_weeks' ] = $cff_translate_weeks;
1211
+ $options[ 'cff_translate_month' ] = $cff_translate_month;
1212
+ $options[ 'cff_translate_months' ] = $cff_translate_months;
1213
+ $options[ 'cff_translate_year' ] = $cff_translate_year;
1214
+ $options[ 'cff_translate_years' ] = $cff_translate_years;
1215
+ $options[ 'cff_translate_ago' ] = $cff_translate_ago;
1216
+
1217
+ //View on Facebook link
1218
+ $options[ 'cff_link_size' ] = $cff_link_size;
1219
+ $options[ 'cff_link_weight' ] = $cff_link_weight;
1220
+ $options[ 'cff_link_color' ] = $cff_link_color;
1221
+ $options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
1222
+ $options[ 'cff_facebook_share_text' ] = $cff_facebook_share_text;
1223
+ $options[ 'cff_show_facebook_link' ] = $cff_show_facebook_link;
1224
+ $options[ 'cff_show_facebook_share' ] = $cff_show_facebook_share;
1225
+ $options[ 'cff_view_link_text' ] = $cff_view_link_text;
1226
+ $options[ 'cff_link_to_timeline' ] = $cff_link_to_timeline;
1227
+ }
1228
+ //Update the Misc options
1229
+ if( isset($_POST[ $style_misc_hidden_field_name ]) && $_POST[ $style_misc_hidden_field_name ] == 'Y' ) {
1230
+ //Meta
1231
+ if (isset($_POST[ 'cff_icon_style' ])) $cff_icon_style = sanitize_text_field( $_POST[ 'cff_icon_style' ] );
1232
+ if (isset($_POST[ 'cff_meta_text_color' ])) $cff_meta_text_color = sanitize_text_field( $_POST[ 'cff_meta_text_color' ] );
1233
+ if (isset($_POST[ 'cff_meta_bg_color' ])) $cff_meta_bg_color = sanitize_text_field( $_POST[ 'cff_meta_bg_color' ] );
1234
+ if (isset($_POST[ 'cff_nocomments_text' ])) $cff_nocomments_text = sanitize_text_field( $_POST[ 'cff_nocomments_text' ] );
1235
+ if (isset($_POST[ 'cff_hide_comments' ])) $cff_hide_comments = sanitize_text_field( $_POST[ 'cff_hide_comments' ] );
1236
+ //Custom CSS
1237
+ if (isset($_POST[ 'cff_custom_css' ])) $cff_custom_css = $_POST[ 'cff_custom_css' ];
1238
+ if (isset($_POST[ 'cff_custom_js' ])) $cff_custom_js = $_POST[ 'cff_custom_js' ];
1239
+ //Misc
1240
+ (isset($_POST[ 'cff_show_like_box' ])) ? $cff_show_like_box = sanitize_text_field( $_POST[ 'cff_show_like_box' ] ) : $cff_show_like_box = '';
1241
+ if (isset($_POST[ 'cff_like_box_position' ])) $cff_like_box_position = sanitize_text_field( $_POST[ 'cff_like_box_position' ] );
1242
+ (isset($_POST[ 'cff_like_box_outside' ])) ? $cff_like_box_outside = sanitize_text_field( $_POST[ 'cff_like_box_outside' ] ) : $cff_like_box_outside = '';
1243
+ if (isset($_POST[ 'cff_likebox_bg_color' ])) $cff_likebox_bg_color = sanitize_text_field( $_POST[ 'cff_likebox_bg_color' ] );
1244
+ if (isset($_POST[ 'cff_like_box_text_color' ])) $cff_like_box_text_color = sanitize_text_field( $_POST[ 'cff_like_box_text_color' ] );
1245
+
1246
+ if (isset($_POST[ 'cff_likebox_width' ])) $cff_likebox_width = sanitize_text_field( $_POST[ 'cff_likebox_width' ] );
1247
+ if (isset($_POST[ 'cff_likebox_height' ])) $cff_likebox_height = sanitize_text_field( $_POST[ 'cff_likebox_height' ] );
1248
+ (isset($_POST[ 'cff_like_box_faces' ])) ? $cff_like_box_faces = sanitize_text_field( $_POST[ 'cff_like_box_faces' ] ) : $cff_like_box_faces = '';
1249
+ (isset($_POST[ 'cff_like_box_border' ])) ? $cff_like_box_border = sanitize_text_field( $_POST[ 'cff_like_box_border' ] ) : $cff_like_box_border = '';
1250
+ (isset($_POST[ 'cff_like_box_cover' ])) ? $cff_like_box_cover = sanitize_text_field( $_POST[ 'cff_like_box_cover' ] ) : $cff_like_box_cover = '';
1251
+ (isset($_POST[ 'cff_like_box_small_header' ])) ? $cff_like_box_small_header = sanitize_text_field( $_POST[ 'cff_like_box_small_header' ] ) : $cff_like_box_small_header = '';
1252
+ (isset($_POST[ 'cff_like_box_hide_cta' ])) ? $cff_like_box_hide_cta = sanitize_text_field( $_POST[ 'cff_like_box_hide_cta' ] ) : $cff_like_box_hide_cta = '';
1253
+
1254
+
1255
+ if (isset($_POST[ 'cff_video_height' ])) $cff_video_height = sanitize_text_field( $_POST[ 'cff_video_height' ] );
1256
+ if (isset($_POST[ 'cff_video_action' ])) $cff_video_action = sanitize_text_field( $_POST[ 'cff_video_action' ] );
1257
+ if (isset($_POST[ 'cff_open_links' ])) $cff_open_links = sanitize_text_field( $_POST[ 'cff_open_links' ] );
1258
+
1259
+ (isset($_POST[ $cff_ajax ])) ? $cff_ajax_val = sanitize_text_field( $_POST[ 'cff_ajax' ] ) : $cff_ajax_val = '';
1260
+ if (isset($_POST[ 'cff_app_id' ])) $cff_app_id = sanitize_text_field( $_POST[ 'cff_app_id' ] );
1261
+ (isset($_POST[ 'cff_show_credit' ])) ? $cff_show_credit = sanitize_text_field( $_POST[ 'cff_show_credit' ] ) : $cff_show_credit = '';
1262
+ (isset($_POST[ 'cff_font_source' ])) ? $cff_font_source = sanitize_text_field( $_POST[ 'cff_font_source' ] ) : $cff_font_source = '';
1263
+ (isset($_POST[ $cff_preserve_settings ])) ? $cff_preserve_settings_val = sanitize_text_field( $_POST[ 'cff_preserve_settings' ] ) : $cff_preserve_settings_val = '';
1264
+ if (isset($_POST[ 'cff_cron' ])) $cff_cron = sanitize_text_field( $_POST[ 'cff_cron' ] );
1265
+ if (isset($_POST[ 'cff_request_method' ])) $cff_request_method = sanitize_text_field( $_POST[ 'cff_request_method' ] );
1266
+ (isset($_POST[ 'cff_disable_styles' ])) ? $cff_disable_styles = sanitize_text_field( $_POST[ 'cff_disable_styles' ] ) : $cff_disable_styles = '';
1267
+
1268
+ //Meta
1269
+ $options[ 'cff_icon_style' ] = $cff_icon_style;
1270
+ $options[ 'cff_meta_text_color' ] = $cff_meta_text_color;
1271
+ $options[ 'cff_meta_bg_color' ] = $cff_meta_bg_color;
1272
+ $options[ 'cff_nocomments_text' ] = $cff_nocomments_text;
1273
+ $options[ 'cff_hide_comments' ] = $cff_hide_comments;
1274
+ //Custom CSS
1275
+ $options[ 'cff_custom_css' ] = $cff_custom_css;
1276
+ $options[ 'cff_custom_js' ] = $cff_custom_js;
1277
+ //Misc
1278
+ $options[ 'cff_show_like_box' ] = $cff_show_like_box;
1279
+ $options[ 'cff_like_box_position' ] = $cff_like_box_position;
1280
+ $options[ 'cff_like_box_outside' ] = $cff_like_box_outside;
1281
+ $options[ 'cff_likebox_bg_color' ] = $cff_likebox_bg_color;
1282
+ $options[ 'cff_like_box_text_color' ] = $cff_like_box_text_color;
1283
+
1284
+ $options[ 'cff_likebox_width' ] = $cff_likebox_width;
1285
+ $options[ 'cff_likebox_height' ] = $cff_likebox_height;
1286
+ $options[ 'cff_like_box_faces' ] = $cff_like_box_faces;
1287
+ $options[ 'cff_like_box_border' ] = $cff_like_box_border;
1288
+ $options[ 'cff_like_box_cover' ] = $cff_like_box_cover;
1289
+ $options[ 'cff_like_box_small_header' ] = $cff_like_box_small_header;
1290
+ $options[ 'cff_like_box_hide_cta' ] = $cff_like_box_hide_cta;
1291
+
1292
+
1293
+ $options[ 'cff_video_height' ] = $cff_video_height;
1294
+ $options[ 'cff_video_action' ] = $cff_video_action;
1295
+ $options[ 'cff_open_links' ] = $cff_open_links;
1296
+
1297
+ update_option( $cff_ajax, $cff_ajax_val );
1298
+ $options[ 'cff_app_id' ] = $cff_app_id;
1299
+ $options[ 'cff_show_credit' ] = $cff_show_credit;
1300
+ $options[ 'cff_font_source' ] = $cff_font_source;
1301
+ update_option( $cff_preserve_settings, $cff_preserve_settings_val );
1302
+
1303
+ $options[ 'cff_cron' ] = $cff_cron;
1304
+ $options[ 'cff_request_method' ] = $cff_request_method;
1305
+ $options[ 'cff_disable_styles' ] = $cff_disable_styles;
1306
+
1307
+ if( $cff_cron == 'no' ) wp_clear_scheduled_hook('cff_cron_job');
1308
+
1309
+ //Run cron when Misc settings are saved
1310
+ if( $cff_cron == 'yes' ){
1311
+ //Clear the existing cron event
1312
+ wp_clear_scheduled_hook('cff_cron_job');
1313
+
1314
+ $cff_cache_time = get_option( 'cff_cache_time' );
1315
+ $cff_cache_time_unit = get_option( 'cff_cache_time_unit' );
1316
+
1317
+ //Set the event schedule based on what the caching time is set to
1318
+ $cff_cron_schedule = 'hourly';
1319
+ if( $cff_cache_time_unit == 'hours' && $cff_cache_time > 5 ) $cff_cron_schedule = 'twicedaily';
1320
+ if( $cff_cache_time_unit == 'days' ) $cff_cron_schedule = 'daily';
1321
+
1322
+ wp_schedule_event(time(), $cff_cron_schedule, 'cff_cron_job');
1323
+ }
1324
 
1325
+ }
1326
+ //Update the Custom Text / Translate options
1327
+ if( isset($_POST[ $style_custom_text_hidden_field_name ]) && $_POST[ $style_custom_text_hidden_field_name ] == 'Y' ) {
1328
+
1329
+ //Translate
1330
+ if (isset($_POST[ 'cff_see_more_text' ])) $cff_see_more_text = sanitize_text_field( $_POST[ 'cff_see_more_text' ] );
1331
+ if (isset($_POST[ 'cff_see_less_text' ])) $cff_see_less_text = sanitize_text_field( $_POST[ 'cff_see_less_text' ] );
1332
+ if (isset($_POST[ 'cff_facebook_link_text' ])) $cff_facebook_link_text = sanitize_text_field( $_POST[ 'cff_facebook_link_text' ] );
1333
+ if (isset($_POST[ 'cff_facebook_share_text' ])) $cff_facebook_share_text = sanitize_text_field( $_POST[ 'cff_facebook_share_text' ] );
1334
+
1335
+ //Social translate
1336
+ if (isset($_POST[ 'cff_translate_photos_text' ])) $cff_translate_photos_text = sanitize_text_field( $_POST[ 'cff_translate_photos_text' ] );
1337
+ if (isset($_POST[ 'cff_translate_photo_text' ])) $cff_translate_photo_text = sanitize_text_field( $_POST[ 'cff_translate_photo_text' ] );
1338
+ if (isset($_POST[ 'cff_translate_video_text' ])) $cff_translate_video_text = sanitize_text_field( $_POST[ 'cff_translate_video_text' ] );
1339
+
1340
+ //Date translate
1341
+ if (isset($_POST[ 'cff_translate_second' ])) $cff_translate_second = sanitize_text_field( $_POST[ 'cff_translate_second' ] );
1342
+ if (isset($_POST[ 'cff_translate_seconds' ])) $cff_translate_seconds = sanitize_text_field( $_POST[ 'cff_translate_seconds' ] );
1343
+ if (isset($_POST[ 'cff_translate_minute' ])) $cff_translate_minute = sanitize_text_field( $_POST[ 'cff_translate_minute' ] );
1344
+ if (isset($_POST[ 'cff_translate_minutes' ])) $cff_translate_minutes = sanitize_text_field( $_POST[ 'cff_translate_minutes' ] );
1345
+ if (isset($_POST[ 'cff_translate_hour' ])) $cff_translate_hour = sanitize_text_field( $_POST[ 'cff_translate_hour' ] );
1346
+ if (isset($_POST[ 'cff_translate_hours' ])) $cff_translate_hours = sanitize_text_field( $_POST[ 'cff_translate_hours' ] );
1347
+ if (isset($_POST[ 'cff_translate_day' ])) $cff_translate_day = sanitize_text_field( $_POST[ 'cff_translate_day' ] );
1348
+ if (isset($_POST[ 'cff_translate_days' ])) $cff_translate_days = sanitize_text_field( $_POST[ 'cff_translate_days' ] );
1349
+ if (isset($_POST[ 'cff_translate_week' ])) $cff_translate_week = sanitize_text_field( $_POST[ 'cff_translate_week' ] );
1350
+ if (isset($_POST[ 'cff_translate_weeks' ])) $cff_translate_weeks = sanitize_text_field( $_POST[ 'cff_translate_weeks' ] );
1351
+ if (isset($_POST[ 'cff_translate_month' ])) $cff_translate_month = sanitize_text_field( $_POST[ 'cff_translate_month' ] );
1352
+ if (isset($_POST[ 'cff_translate_months' ])) $cff_translate_months = sanitize_text_field( $_POST[ 'cff_translate_months' ] );
1353
+ if (isset($_POST[ 'cff_translate_year' ])) $cff_translate_year = sanitize_text_field( $_POST[ 'cff_translate_year' ] );
1354
+ if (isset($_POST[ 'cff_translate_years' ])) $cff_translate_years = sanitize_text_field( $_POST[ 'cff_translate_years' ] );
1355
+ if (isset($_POST[ 'cff_translate_ago' ])) $cff_translate_ago = sanitize_text_field( $_POST[ 'cff_translate_ago' ] );
1356
+
1357
+ //Translate
1358
+ $options[ 'cff_see_more_text' ] = $cff_see_more_text;
1359
+ $options[ 'cff_see_less_text' ] = $cff_see_less_text;
1360
+ $options[ 'cff_facebook_link_text' ] = $cff_facebook_link_text;
1361
+ $options[ 'cff_facebook_share_text' ] = $cff_facebook_share_text;
1362
+
1363
+ //Social translate
1364
+ $options[ 'cff_translate_photos_text' ] = $cff_translate_photos_text;
1365
+ $options[ 'cff_translate_photo_text' ] = $cff_translate_photo_text;
1366
+ $options[ 'cff_translate_video_text' ] = $cff_translate_video_text;
1367
+
1368
+ //Date translate
1369
+ $options[ 'cff_translate_second' ] = $cff_translate_second;
1370
+ $options[ 'cff_translate_seconds' ] = $cff_translate_seconds;
1371
+ $options[ 'cff_translate_minute' ] = $cff_translate_minute;
1372
+ $options[ 'cff_translate_minutes' ] = $cff_translate_minutes;
1373
+ $options[ 'cff_translate_hour' ] = $cff_translate_hour;
1374
+ $options[ 'cff_translate_hours' ] = $cff_translate_hours;
1375
+ $options[ 'cff_translate_day' ] = $cff_translate_day;
1376
+ $options[ 'cff_translate_days' ] = $cff_translate_days;
1377
+ $options[ 'cff_translate_week' ] = $cff_translate_week;
1378
+ $options[ 'cff_translate_weeks' ] = $cff_translate_weeks;
1379
+ $options[ 'cff_translate_month' ] = $cff_translate_month;
1380
+ $options[ 'cff_translate_months' ] = $cff_translate_months;
1381
+ $options[ 'cff_translate_year' ] = $cff_translate_year;
1382
+ $options[ 'cff_translate_years' ] = $cff_translate_years;
1383
+ $options[ 'cff_translate_ago' ] = $cff_translate_ago;
1384
+
1385
+ }
1386
+ //Update the array
1387
+ update_option( 'cff_style_settings', $options );
1388
+ // Put an settings updated message on the screen
1389
+ ?>
1390
+ <div class="updated"><p><strong><?php _e('Settings saved.', 'custom-facebook-feed' ); ?></strong></p></div>
1391
+ <?php } ?>
1392
+
1393
+ <?php } //End nonce check ?>
1394
 
 
 
 
 
 
 
 
1395
 
1396
  <div id="cff-admin" class="wrap">
1397
  <div id="header">
1399
  </div>
1400
  <form name="form1" method="post" action="">
1401
  <input type="hidden" name="<?php echo $style_hidden_field_name; ?>" value="Y">
1402
+ <?php wp_nonce_field( 'cff_saving_customize', 'cff_customize_nonce' ); ?>
1403
+
1404
  <?php
1405
  $cff_active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general';
1406
  ?>
2744
  </tr>
2745
  <tr valign="top" id="js"><!-- Quick link -->
2746
  <td>
2747
+ <textarea name="cff_custom_css" id="cff_custom_css" style="width: 70%;" rows="7"><?php echo esc_textarea( stripslashes($cff_custom_css), 'custom-facebook-feed' ); ?></textarea>
2748
  </td>
2749
  </tr>
2750
  </tbody>
2760
  </tr>
2761
  <tr valign="top">
2762
  <td>
2763
+ <textarea name="cff_custom_js" id="cff_custom_js" style="width: 70%;" rows="7"><?php echo esc_textarea( stripslashes($cff_custom_js), 'custom-facebook-feed' ); ?></textarea>
2764
  </td>
2765
  </tr>
2766
  <tr id="misc"><!-- Quick link --></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 completely customizable Facebook feeds to your WordPress site
6
- Version: 2.4.2
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
@@ -23,11 +23,13 @@ You should have received a copy of the GNU General Public License
23
  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
  //Include admin
27
  include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
28
 
29
- define('CFFVER', '2.4.2');
30
-
31
  // Add shortcodes
32
  add_shortcode('custom-facebook-feed', 'display_cff');
33
  function display_cff($atts) {
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.4.3
7
  Author: Smash Balloon
8
  Author URI: http://smashballoon.com/
9
  License: GPLv2 or later
23
  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.4.3');
28
+
29
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
30
  //Include admin
31
  include dirname( __FILE__ ) .'/custom-facebook-feed-admin.php';
32
 
 
 
33
  // Add shortcodes
34
  add_shortcode('custom-facebook-feed', 'display_cff');
35
  function display_cff($atts) {