WD Facebook Feed – Custom Facebook Feed Plugin - Version 1.2.5

Version Description

Download this release

Release Info

Developer 10web
Plugin Icon 128x128 WD Facebook Feed – Custom Facebook Feed Plugin
Version 1.2.5
Comparing to
See all releases

Code changes from version 1.2.4 to 1.2.5

admin/controllers/FFWDControllerOptions_ffwd.php CHANGED
@@ -64,19 +64,19 @@ class FFWDControllerOptions_ffwd {
64
  if ( !empty($date_timezone) && !empty($timezone_lists) && !in_array($date_timezone, $timezone_lists) ) {
65
  $date_timezone = '';
66
  }
67
- $post_date_format = (isset($_POST[ WD_FB_PREFIX . '_post_date_format']) ? sanitize_text_field(stripslashes($_POST[WD_FB_PREFIX . '_post_date_format'])) : 'ago');
68
- $event_date_format = (isset($_POST[ WD_FB_PREFIX . '_event_date_format']) ? sanitize_text_field(stripslashes($_POST[WD_FB_PREFIX . '_event_date_format'])) : 'F j, Y, g:i a');
69
 
70
- $upd_data = array(
71
  'autoupdate_interval' => $autoupdate_interval,
72
  'app_id' => $facebook_app_id,
73
  'app_secret' => $facebook_app_secret,
74
  'date_timezone' => $date_timezone,
75
  'post_date_format' => $post_date_format,
76
- 'event_date_format' =>$event_date_format,
77
  );
78
- $save = $wpdb->update($wpdb->prefix . 'wd_fb_option', $upd_data, array('id' => 1));
79
- if ($save !== FALSE) {
80
  echo WDW_FFWD_Library::message('Item Succesfully Saved.', 'updated');
81
  /*
82
  * Clear hook for scheduled events,
@@ -84,12 +84,6 @@ class FFWDControllerOptions_ffwd {
84
  * then add new schedule with the same hook name
85
  */
86
  update_option('ffwd_autoupdate_time',$autoupdate_interval*60+current_time('timestamp'));
87
-
88
- wp_clear_scheduled_hook( 'wd_fb_schedule_event_hook' );
89
- remove_filter( 'cron_schedules', 'wd_fb_add_autoupdate_interval' );
90
- add_filter( 'cron_schedules', 'wd_fb_add_autoupdate_interval' );
91
- wp_schedule_event( time(), 'wd_fb_autoupdate_interval', 'wd_fb_schedule_event_hook' );
92
- // $schedule_info = wp_get_schedules();
93
  }
94
  else {
95
  echo WDW_FFWD_Library::message('Error. Please install plugin again.', 'error');
64
  if ( !empty($date_timezone) && !empty($timezone_lists) && !in_array($date_timezone, $timezone_lists) ) {
65
  $date_timezone = '';
66
  }
67
+ $post_date_format = (isset($_POST[WD_FB_PREFIX . '_post_date_format']) ? sanitize_text_field(stripslashes($_POST[WD_FB_PREFIX . '_post_date_format'])) : 'ago');
68
+ $event_date_format = (isset($_POST[WD_FB_PREFIX . '_event_date_format']) ? sanitize_text_field(stripslashes($_POST[WD_FB_PREFIX . '_event_date_format'])) : 'F j, Y, g:i a');
69
 
70
+ $upd_data = array(
71
  'autoupdate_interval' => $autoupdate_interval,
72
  'app_id' => $facebook_app_id,
73
  'app_secret' => $facebook_app_secret,
74
  'date_timezone' => $date_timezone,
75
  'post_date_format' => $post_date_format,
76
+ 'event_date_format' => $event_date_format,
77
  );
78
+ $save = $wpdb->update( $wpdb->prefix . 'wd_fb_option', $upd_data, array('id' => 1) );
79
+ if ( $save !== FALSE ) {
80
  echo WDW_FFWD_Library::message('Item Succesfully Saved.', 'updated');
81
  /*
82
  * Clear hook for scheduled events,
84
  * then add new schedule with the same hook name
85
  */
86
  update_option('ffwd_autoupdate_time',$autoupdate_interval*60+current_time('timestamp'));
 
 
 
 
 
 
87
  }
88
  else {
89
  echo WDW_FFWD_Library::message('Error. Please install plugin again.', 'error');
admin/models/FFWDModelInfo_ffwd.php CHANGED
@@ -302,7 +302,7 @@ class FFWDModelInfo_ffwd {
302
  $row->page_access_token = '';
303
  $row->type = '';
304
  $row->content_type = 'timeline';
305
- $row->content = 'statuses,photos,videos,links,events';
306
  $row->order = 0;
307
  $row->content_url = '';
308
  $row->timeline_type = 'posts';
302
  $row->page_access_token = '';
303
  $row->type = '';
304
  $row->content_type = 'timeline';
305
+ $row->content = 'statuses,photos,albums,videos,links,events';
306
  $row->order = 0;
307
  $row->content_url = '';
308
  $row->timeline_type = 'posts';
admin/models/FFWDModelOptions_ffwd.php CHANGED
@@ -1,15 +1,7 @@
1
  <?php
2
 
3
  class FFWDModelOptions_ffwd {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
  private $facebook_sdk;
14
  private $app_id;
15
  private $app_secret;
@@ -140,14 +132,10 @@ class FFWDModelOptions_ffwd {
140
  "d/m/Y" => " 10/03/2015",
141
  "Y.m.d" => " 2015.03.10",
142
  );
143
- ////////////////////////////////////////////////////////////////////////////////////////
144
- // Constructor & Destructor //
145
- ////////////////////////////////////////////////////////////////////////////////////////
146
  public function __construct() {
147
  }
148
- ////////////////////////////////////////////////////////////////////////////////////////
149
- // Public Methods //
150
- ////////////////////////////////////////////////////////////////////////////////////////
151
  public function get_facebook_data() {
152
  global $wpdb;
153
  //if(!class_exists('Facebook'))
@@ -160,8 +148,6 @@ class FFWDModelOptions_ffwd {
160
  //$this->access_token = $row->user_access_token;
161
 
162
  if($row->app_id!='' and $row->app_secret!='') {
163
-
164
-
165
  $this->facebook_sdk = new Facebook\Facebook( array(
166
  'app_id' => $this->app_id,
167
  'app_secret' => $this->app_secret,
@@ -296,38 +282,34 @@ class FFWDModelOptions_ffwd {
296
  <div style="clear: both;">&nbsp;</div>
297
  <?php
298
  }
299
-
300
- public function get_row_data($reset) {
 
 
 
 
 
 
 
301
  global $wpdb;
302
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wd_fb_option WHERE id="%d"', 1));
303
- if ($reset) {
304
  $row->autoupdate_interval = 90;
305
- $row->app_id = '';
306
- $row->app_secret = '';
307
- $row->post_date_format = 'ago';
308
- $row->date_timezone = '';
309
- $row->event_date_format = '';
310
-
311
- $wpdb->update($wpdb->prefix . 'wd_fb_option', array(
312
- 'autoupdate_interval' => $row->autoupdate_interval,
313
- 'app_id' => $row->app_id,
314
- 'app_secret' => $row->app_secret,
315
- 'date_timezone' => $row->date_timezone,
316
- 'post_date_format' => $row->post_date_format,
317
- 'event_date_format' =>$row->event_date_format,
318
- ), array('id' => 1));
319
-
320
-
321
  }
 
322
  return $row;
323
  }
324
- ////////////////////////////////////////////////////////////////////////////////////////
325
- // Getters & Setters //
326
- ////////////////////////////////////////////////////////////////////////////////////////
327
- ////////////////////////////////////////////////////////////////////////////////////////
328
- // Private Methods //
329
- ////////////////////////////////////////////////////////////////////////////////////////
330
- ////////////////////////////////////////////////////////////////////////////////////////
331
- // Listeners //
332
- ////////////////////////////////////////////////////////////////////////////////////////
333
  }
1
  <?php
2
 
3
  class FFWDModelOptions_ffwd {
4
+
 
 
 
 
 
 
 
 
5
  private $facebook_sdk;
6
  private $app_id;
7
  private $app_secret;
132
  "d/m/Y" => " 10/03/2015",
133
  "Y.m.d" => " 2015.03.10",
134
  );
135
+
 
 
136
  public function __construct() {
137
  }
138
+
 
 
139
  public function get_facebook_data() {
140
  global $wpdb;
141
  //if(!class_exists('Facebook'))
148
  //$this->access_token = $row->user_access_token;
149
 
150
  if($row->app_id!='' and $row->app_secret!='') {
 
 
151
  $this->facebook_sdk = new Facebook\Facebook( array(
152
  'app_id' => $this->app_id,
153
  'app_secret' => $this->app_secret,
282
  <div style="clear: both;">&nbsp;</div>
283
  <?php
284
  }
285
+
286
+ /**
287
+ * Get row data.
288
+ *
289
+ * @param bool $reset
290
+ *
291
+ * @return array|object|void|null
292
+ */
293
+ public function get_row_data( $reset = FALSE ) {
294
  global $wpdb;
295
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wd_fb_option WHERE id="%d"', 1));
296
+ if ( $reset ) {
297
  $row->autoupdate_interval = 90;
298
+ $row->app_id = '';
299
+ $row->app_secret = '';
300
+ $row->post_date_format = 'ago';
301
+ $row->date_timezone = '';
302
+ $row->event_date_format = '';
303
+ $wpdb->update($wpdb->prefix . 'wd_fb_option', array(
304
+ 'autoupdate_interval' => $row->autoupdate_interval,
305
+ 'app_id' => $row->app_id,
306
+ 'app_secret' => $row->app_secret,
307
+ 'date_timezone' => $row->date_timezone,
308
+ 'post_date_format' => $row->post_date_format,
309
+ 'event_date_format' => $row->event_date_format,
310
+ ), array( 'id' => 1 ));
 
 
 
311
  }
312
+
313
  return $row;
314
  }
 
 
 
 
 
 
 
 
 
315
  }
admin/views/FFWDViewInfo_ffwd.php CHANGED
@@ -30,7 +30,7 @@ class FFWDViewInfo_ffwd {
30
  <div style="font-size: 14px; ">
31
  <?php _e('This section allows you to create, edit and delete Facebook Feed by 10Web.', 'ffwd'); ?>
32
  <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank"
33
- href="https://help.10web.io/hc/en-us/articles/360017959512-Getting-Facebook-Access-Token?utm_source=facebook_feed&utm_medium=free_plugin"><?php _e("Read More in User Manual.", "ffwd"); ?></a>
34
  </div>
35
  </div>
36
  </div>
@@ -520,7 +520,7 @@ class FFWDViewInfo_ffwd {
520
  <div style="font-size: 14px;">
521
  <?php _e('This section allows you to create, edit and delete Facebook Feed by 10Web.', 'ffwd'); ?>
522
  <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank"
523
- href="https://help.10web.io/hc/en-us/articles/360017959512-Getting-Facebook-Access-Token?utm_source=facebook_feed&utm_medium=free_plugin"><?php _e("Read More in User Manual.", "ffwd"); ?></a>
524
  </div>
525
  </div>
526
  </div>
@@ -818,6 +818,13 @@ class FFWDViewInfo_ffwd {
818
  <?php echo ( WD_FB_IS_FREE ) ? 'disabled' : ''; ?>>
819
  <label for="<?php echo WD_FB_PREFIX; ?>_timeline_photos">Photos</label>
820
  <br>
 
 
 
 
 
 
 
821
  <input type="checkbox" class="inputbox"
822
  id="<?php echo WD_FB_PREFIX; ?>_timeline_videos"
823
  name="<?php echo WD_FB_PREFIX; ?>_timeline_videos" <?php echo (strpos($row->content, 'videos') !== false) ? 'checked="checked"' : ''; ?>
30
  <div style="font-size: 14px; ">
31
  <?php _e('This section allows you to create, edit and delete Facebook Feed by 10Web.', 'ffwd'); ?>
32
  <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank"
33
+ href="https://help.10web.io/hc/en-us/articles/360018233951-Configuring-Facebook-feed?utm_source=facebook_feed&utm_medium=free_plugin"><?php _e("Read More in User Manual.", "ffwd"); ?></a>
34
  </div>
35
  </div>
36
  </div>
520
  <div style="font-size: 14px;">
521
  <?php _e('This section allows you to create, edit and delete Facebook Feed by 10Web.', 'ffwd'); ?>
522
  <a style="color: #5CAEBD; text-decoration: none;border-bottom: 1px dotted;" target="_blank"
523
+ href="https://help.10web.io/hc/en-us/articles/360018233951-Configuring-Facebook-feed?utm_source=facebook_feed&utm_medium=free_plugin"><?php _e("Read More in User Manual.", "ffwd"); ?></a>
524
  </div>
525
  </div>
526
  </div>
818
  <?php echo ( WD_FB_IS_FREE ) ? 'disabled' : ''; ?>>
819
  <label for="<?php echo WD_FB_PREFIX; ?>_timeline_photos">Photos</label>
820
  <br>
821
+ <input type="checkbox" class="inputbox"
822
+ id="<?php echo WD_FB_PREFIX; ?>_timeline_albums"
823
+ name="<?php echo WD_FB_PREFIX; ?>_timeline_albums" <?php echo (strpos($row->content, 'albums') !== false) ? 'checked="checked"' : ''; ?>
824
+ value="albums"
825
+ <?php echo ( WD_FB_IS_FREE ) ? 'disabled' : ''; ?>>
826
+ <label for="<?php echo WD_FB_PREFIX; ?>_timeline_albums">Albums</label>
827
+ <br>
828
  <input type="checkbox" class="inputbox"
829
  id="<?php echo WD_FB_PREFIX; ?>_timeline_videos"
830
  name="<?php echo WD_FB_PREFIX; ?>_timeline_videos" <?php echo (strpos($row->content, 'videos') !== false) ? 'checked="checked"' : ''; ?>
admin/views/FFWDViewOptions_ffwd.php CHANGED
@@ -94,20 +94,16 @@ class FFWDViewOptions_ffwd {
94
  <tbody>
95
  <tr>
96
  <td class="spider_label_options">
97
- <label>Timezone:</label>
98
  </td>
99
  <td>
100
- <input type="text" value="<?php echo $row->date_timezone; ?>"
101
- name="<?php echo WD_FB_PREFIX; ?>_date_timezone"/>
102
- <div class="spider_description">If left empty, the server timezone will be used. Example
103
- Europe/London.
104
- </div>
105
  </td>
106
  </tr>
107
-
108
  <tr>
109
  <td class="spider_label_options">
110
- <label>Date format for posts:</label>
111
  </td>
112
  <td>
113
  <select name="<?php echo WD_FB_PREFIX; ?>_post_date_format">
@@ -122,12 +118,12 @@ class FFWDViewOptions_ffwd {
122
  }
123
  ?>
124
  </select>
125
- <div class="spider_description">Choose a date type.</div>
126
  </td>
127
  </tr>
128
  <tr style="display: none">
129
  <td class="spider_label_options">
130
- <label>Date format for events:</label>
131
  </td>
132
  <td>
133
  <select name="<?php echo WD_FB_PREFIX; ?>_event_date_format">
@@ -142,38 +138,35 @@ class FFWDViewOptions_ffwd {
142
  }
143
  ?>
144
  </select>
145
- <div class="spider_description">Choose a date type.</div>
146
  </td>
147
  </tr>
148
  <tr>
149
  <td class="spider_label_options">
150
- <label>Reset cache:</label>
151
  </td>
152
  <td>
153
- <a href="#" class="ffwd_reset_cache button">Reset cache</a>
154
  <span class="ffwd_reset_cache_res"></span>
155
- <div class="spider_description">Click to get new data from Facebook</div>
156
  </td>
157
  </tr>
158
  <tr>
159
  <tr>
160
  <td class="spider_label_options">
161
- <label>Uninstall:</label>
162
  </td>
163
  <td>
164
- <a href="admin.php?page=uninstall_ffwd" class="button">Uninstall</a>
165
  </td>
166
  </tr>
167
  </tbody>
168
  </table>
169
  </div>
170
  </div>
171
- <div id="opacity_div"
172
- style="display: none; background-color: rgba(0, 0, 0, 0.2); position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99998;"></div>
173
- <div id="loading_div"
174
- style="display:none; text-align: center; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99999;">
175
- <img src="<?php echo WD_FFWD_URL . '/images/ajax_loader.png'; ?>" class="spider_ajax_loading"
176
- style="margin-top: 200px; width:50px;">
177
  </div>
178
  <input id="task" name="task" type="hidden" value=""/>
179
  <input id="current_id" name="current_id" type="hidden" value="<?php /* echo $row->id; */ ?>"/>
94
  <tbody>
95
  <tr>
96
  <td class="spider_label_options">
97
+ <label><?php _e('Timezone:', 'ffwd'); ?></label>
98
  </td>
99
  <td>
100
+ <input type="text" value="<?php echo $row->date_timezone; ?>" name="<?php echo WD_FB_PREFIX; ?>_date_timezone">
101
+ <div class="spider_description"><?php _e('If left empty, the server timezone will be used. Example Europe/London.', 'ffwd'); ?></div>
 
 
 
102
  </td>
103
  </tr>
 
104
  <tr>
105
  <td class="spider_label_options">
106
+ <label><?php _e('Date format for posts:', 'ffwd'); ?></label>
107
  </td>
108
  <td>
109
  <select name="<?php echo WD_FB_PREFIX; ?>_post_date_format">
118
  }
119
  ?>
120
  </select>
121
+ <div class="spider_description"><?php _e('Choose a date type.', 'ffwd'); ?></div>
122
  </td>
123
  </tr>
124
  <tr style="display: none">
125
  <td class="spider_label_options">
126
+ <label><?php _e('Date format for events:', 'ffwd'); ?></label>
127
  </td>
128
  <td>
129
  <select name="<?php echo WD_FB_PREFIX; ?>_event_date_format">
138
  }
139
  ?>
140
  </select>
141
+ <div class="spider_description"><?php _e('Choose a date type.', 'ffwd'); ?></div>
142
  </td>
143
  </tr>
144
  <tr>
145
  <td class="spider_label_options">
146
+ <label><?php _e('Reset cache:', 'ffwd'); ?></label>
147
  </td>
148
  <td>
149
+ <a href="#" class="ffwd_reset_cache button"><?php _e('Reset cache', 'ffwd'); ?></a>
150
  <span class="ffwd_reset_cache_res"></span>
151
+ <div class="spider_description"><?php _e('Click to get new data from Facebook', 'ffwd'); ?></div>
152
  </td>
153
  </tr>
154
  <tr>
155
  <tr>
156
  <td class="spider_label_options">
157
+ <label><?php _e('Uninstall:', 'ffwd'); ?></label>
158
  </td>
159
  <td>
160
+ <a href="admin.php?page=uninstall_ffwd" class="button"><?php _e('Uninstall', 'ffwd'); ?></a>
161
  </td>
162
  </tr>
163
  </tbody>
164
  </table>
165
  </div>
166
  </div>
167
+ <div id="opacity_div" style="display: none; background-color: rgba(0, 0, 0, 0.2); position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99998;"></div>
168
+ <div id="loading_div" style="display:none; text-align: center; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99999;">
169
+ <img src="<?php echo WD_FFWD_URL . '/images/ajax_loader.png'; ?>" class="spider_ajax_loading" style="margin-top: 200px; width:50px;">
 
 
 
170
  </div>
171
  <input id="task" name="task" type="hidden" value=""/>
172
  <input id="current_id" name="current_id" type="hidden" value="<?php /* echo $row->id; */ ?>"/>
css/ffwd_frontend.css CHANGED
@@ -265,3 +265,29 @@ div[class^="ffwd_title_spun"] a {
265
  position: relative;
266
  top: 18px;
267
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  position: relative;
266
  top: 18px;
267
  }
268
+
269
+ .ffwd_container1 {
270
+ position: relative;
271
+ min-height: 100px;
272
+ }
273
+
274
+ .ffwd-loading-layout {
275
+ position: absolute;
276
+ top: 0;
277
+ left: 0;
278
+ width: 100%;
279
+ height: 100%;
280
+ background: #ffffff;
281
+ z-index: 99;
282
+ }
283
+
284
+ .ffwd-loading-layout img {
285
+ position: absolute;
286
+ width: 30px;
287
+ top: calc( 50% - 15px );
288
+ left: calc( 50% - 15px );
289
+ }
290
+
291
+ .ffwd-hidden {
292
+ display: none!important;
293
+ }
facebook-feed-wd.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: 10Web Social Feed
4
  * Plugin URI: https://10web.io/plugins/wordpress-facebook-feed/?utm_source=facebook_feed&utm_medium=free_plugin
5
  * Description: 10Web Social Feed is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
6
- * Version: 1.2.4
7
  * Author: 10Web
8
  * Author URI: https://10web.io/plugins/?utm_source=facebook_feed&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -14,8 +14,9 @@ define('WD_FFWD_URL', plugins_url(plugin_basename(dirname(__FILE__))));
14
  define('WD_FFWD_MAIN_FILE', plugin_basename(__FILE__));
15
  define('WD_FB_PREFIX', 'ffwd');
16
  define('WD_FB_IS_FREE', true);
 
17
  if ( !defined('FFWD_VERSION') ) {
18
- define('FFWD_VERSION', '1.2.4');
19
  }
20
  add_action( 'admin_init', 'ffwd_init' );
21
 
@@ -237,7 +238,7 @@ Multiple Feeds per Post/Page", "wd_ads"),
237
  ),
238
  "plugin_wd_demo_link" => "https://demo.10web.io/facebook-feed?utm_source=facebook_feed&utm_medium=free_plugin",
239
  "plugin_wd_url" => "https://10web.io/plugins/wordpress-facebook-feed/?utm_source=facebook_feed&utm_medium=free_plugin",
240
- "plugin_wd_docs_link" => "https://help.10web.io/hc/en-us/sections/360002528712-Facebook-Feed-WD?utm_source=facebook_feed&utm_medium=free_plugin",
241
  "after_subscribe" => admin_url('admin.php?page=info_ffwd'),
242
  "plugin_wizard_link" => NULL,
243
  "plugin_menu_title" => "Facebook Feed by 10Web",
@@ -310,18 +311,48 @@ add_action('wp_ajax_check_app', 'ffwd_ajax');
310
  add_action('wp_ajax_nopriv_dropp_objects', 'ffwd_ajax');
311
  add_action('wp_ajax_dropp_objects', 'ffwd_ajax');
312
 
 
 
 
 
 
313
 
314
- // For reset_cache
315
- add_action( 'wp_ajax_ffwd_reset_cache', 'ffwd_reset_cache' );
 
 
 
 
 
316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  function ffwd_reset_cache(){
318
  if ( isset( $_POST['nonce'] ) && wp_verify_nonce( sanitize_text_field($_POST['nonce']), WD_FFWD_URL . '_ajax_nonce' )) {
319
  delete_option("ffwd_autoupdate_time");
320
  require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
321
  WDW_FFWD_Library::remove_feed_data();
322
- echo json_encode(array("success"=>true));die;
 
323
  }
324
- echo json_encode(array("success"=>false));die;
325
  }
326
 
327
  function ffwd_ajax()
@@ -357,6 +388,7 @@ function ffwd_shortcode($params) {
357
  global $wpdb;
358
  require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
359
  $check_fb_feed = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "wd_fb_info WHERE id='%d'", $params['id']));
 
360
  if ( !$check_fb_feed ) {
361
  echo WDW_FFWD_Library::message(__('Feed Doesn\'t exists', 'bwg'), 'error');
362
  return;
@@ -367,13 +399,12 @@ function ffwd_shortcode($params) {
367
 
368
  return str_replace(array("\r\n", "\n", "\r"), '', ob_get_clean());
369
  }
370
-
371
  add_shortcode('WD_FB', 'ffwd_shortcode');
372
 
373
  $ffwd = 0;
374
  function ffwd_front_end($params) {
375
  /* Enqueue css/js in frontend */
376
- do_action("wp_enqueue_ffwd_front_end_scripts");
377
  global $ffwd;
378
  global $wpdb;
379
  require_once(WD_FFWD_DIR . '/frontend/controllers/FFWDControllerMain.php');
@@ -383,6 +414,28 @@ function ffwd_front_end($params) {
383
  return;
384
  }
385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  // Add the Facebook Feed by 10Web button.
387
  function ffwd_add_button($buttons)
388
  {
@@ -501,153 +554,145 @@ add_filter('mce_external_plugins', 'ffwd_register');
501
  add_filter('mce_buttons', 'ffwd_add_button', 0);
502
 
503
  // Activate plugin.
504
- function ffwd_activate()
505
- {
506
- $current_time=current_time('timestamp');
507
- $autoupdate_interval = 60;
508
- update_option('ffwd_autoupdate_time',$autoupdate_interval*60+$current_time);
509
- global $wpdb;
510
-
511
- delete_transient('ffwd_update_check');
512
-
513
- $charset_collate = $wpdb->get_charset_collate();
514
- $wd_fb_shortcode = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_shortcode` (
515
  `id` bigint(20) NOT NULL,
516
  `tagtext` mediumtext NOT NULL,
517
  PRIMARY KEY (`id`)
518
  ) " . $charset_collate . ";";
519
- $wpdb->query($wd_fb_shortcode);
520
-
521
- $wd_fb_info = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_info` (
522
- `id` int(10) NOT NULL AUTO_INCREMENT,
523
- `name` varchar(255) NOT NULL,
524
- `page_access_token` text NOT NULL,
525
- `type` varchar(10) NOT NULL,
526
- `content_type` varchar(15) NOT NULL,
527
- `content` varchar(256) NOT NULL,
528
- `content_url` varchar(512) NOT NULL,
529
- `timeline_type` varchar(16) NOT NULL,
530
- `from` varchar(32) NOT NULL,
531
- `limit` int(11) NOT NULL,
532
- `app_id` varchar(128) NOT NULL,
533
- `app_secret` varchar(256) NOT NULL,
534
- `exist_access` tinyint(1) NOT NULL,
535
- `access_token` varchar(256) NOT NULL,
536
- `order` bigint(20) DEFAULT NULL,
537
- `published` tinyint(1) NOT NULL,
538
- `update_mode` varchar(16) NOT NULL,
539
- `fb_view_type` varchar(25) NOT NULL,
540
- `theme` int(11) DEFAULT NULL,
541
- `masonry_hor_ver` varchar(255) DEFAULT NULL,
542
- `image_max_columns` int(11) DEFAULT NULL,
543
- `thumb_width` int(11) DEFAULT NULL,
544
- `thumb_height` int(11) DEFAULT NULL,
545
- `thumb_comments` int(11) DEFAULT NULL,
546
- `thumb_likes` int(11) DEFAULT NULL,
547
- `thumb_name` int(11) DEFAULT NULL,
548
- `blog_style_width` int(11) DEFAULT NULL,
549
- `blog_style_height` varchar(15) DEFAULT NULL,
550
- `blog_style_view_type` int(11) DEFAULT NULL,
551
- `blog_style_comments` int(11) DEFAULT NULL,
552
- `blog_style_likes` int(11) DEFAULT NULL,
553
- `blog_style_message_desc` int(11) DEFAULT NULL,
554
- `blog_style_shares` int(11) DEFAULT NULL,
555
- `blog_style_shares_butt` int(11) DEFAULT NULL,
556
- `blog_style_facebook` int(11) DEFAULT NULL,
557
- `blog_style_twitter` int(11) DEFAULT NULL,
558
- `blog_style_google` int(11) DEFAULT NULL,
559
- `blog_style_author` int(11) DEFAULT NULL,
560
- `blog_style_name` int(11) DEFAULT NULL,
561
- `blog_style_place_name` int(11) DEFAULT NULL,
562
- `fb_name` int(11) DEFAULT NULL,
563
- `fb_plugin` int(11) DEFAULT NULL,
564
- `album_max_columns` int(11) DEFAULT NULL,
565
- `album_title` varchar(15) DEFAULT NULL,
566
- `album_thumb_width` int(11) DEFAULT NULL,
567
- `album_thumb_height` int(11) DEFAULT NULL,
568
- `album_image_max_columns` int(11) DEFAULT NULL,
569
- `album_image_thumb_width` int(11) DEFAULT NULL,
570
- `album_image_thumb_height` int(11) DEFAULT NULL,
571
- `pagination_type` int(11) DEFAULT NULL,
572
- `objects_per_page` int(11) DEFAULT NULL,
573
- `popup_fullscreen` int(11) DEFAULT NULL,
574
- `popup_width` int(11) NOT NULL,
575
- `popup_height` int(11) DEFAULT NULL,
576
- `popup_effect` varchar(255) DEFAULT NULL,
577
- `popup_autoplay` int(11) DEFAULT NULL,
578
- `open_commentbox` int(11) DEFAULT NULL,
579
- `popup_interval` int(11) DEFAULT NULL,
580
- `popup_enable_filmstrip` int(11) DEFAULT NULL,
581
- `popup_filmstrip_height` int(11) DEFAULT NULL,
582
- `popup_comments` int(11) DEFAULT NULL,
583
- `popup_likes` int(11) DEFAULT NULL,
584
- `popup_shares` int(11) DEFAULT NULL,
585
- `popup_author` int(11) DEFAULT NULL,
586
- `popup_name` int(11) DEFAULT NULL,
587
- `popup_place_name` int(11) DEFAULT NULL,
588
- `popup_enable_ctrl_btn` int(11) DEFAULT NULL,
589
- `popup_enable_fullscreen` int(11) DEFAULT NULL,
590
- `popup_enable_info_btn` int(11) DEFAULT NULL,
591
- `popup_message_desc` int(11) DEFAULT NULL,
592
- `popup_enable_facebook` int(11) DEFAULT NULL,
593
- `popup_enable_twitter` int(11) DEFAULT NULL,
594
- `popup_enable_google` int(11) DEFAULT NULL,
595
- `view_on_fb` tinyint(1) NOT NULL,
596
- `post_text_length` bigint(20) NOT NULL,
597
- `event_street` tinyint(1) NOT NULL,
598
- `event_city` tinyint(1) NOT NULL,
599
- `event_country` tinyint(1) NOT NULL,
600
- `event_zip` tinyint(1) NOT NULL,
601
- `event_map` tinyint(1) NOT NULL,
602
- `event_date` tinyint(1) NOT NULL,
603
- `event_desp_length` bigint(20) NOT NULL,
604
- `comments_replies` tinyint(1) NOT NULL,
605
- `comments_filter` varchar(32) NOT NULL,
606
- `comments_order` varchar(32) NOT NULL,
607
- `page_plugin_pos` varchar(8) NOT NULL,
608
- `page_plugin_fans` tinyint(1) NOT NULL,
609
- `page_plugin_cover` tinyint(1) NOT NULL,
610
- `page_plugin_header` tinyint(1) NOT NULL,
611
- `page_plugin_width` int(4) NOT NULL,
612
- `image_onclick_action` varchar(32) NOT NULL,
613
- `event_order` tinyint(4) NOT NULL,
614
- `upcoming_events` tinyint(4) NOT NULL,
615
- `fb_page_id` varchar(32) NOT NULL,
616
- PRIMARY KEY (`id`)
617
- ) " . $charset_collate . ";";
618
-
619
-
620
- $wpdb->query($wd_fb_info);
621
-
622
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
623
  $old_version = ffwd_get_version();
624
 
625
- if(substr($old_version,0,1) === '1'){
626
- $FFWD_version_compare = version_compare($old_version, '1.1.0','<=');
627
- }else{
628
- $FFWD_version_compare = version_compare($old_version, '5.1.0','<=');
629
  }
630
-
631
- if($FFWD_version_compare){
632
- $wd_fb_info_collation = "ALTER TABLE `" . $wpdb->prefix . "wd_fb_info`
633
- ADD `fb_page_id` varchar(32) NOT NULL AFTER `upcoming_events`";
634
- $wpdb->query($wd_fb_info_collation);
635
  }
636
-
637
- if(substr($old_version,0,1) === '1'){
638
- $FFWD_version_compare = version_compare($old_version, '1.0.37','<=');
639
- }else{
640
- $FFWD_version_compare = version_compare($old_version, '5.0.37','<=');
641
  }
642
-
643
- if($FFWD_version_compare){
 
 
 
 
 
644
  $wd_fb_info_collation = "ALTER TABLE `" . $wpdb->prefix . "wd_fb_info`
645
  ADD `page_access_token` text NOT NULL AFTER `name`";
646
  $wpdb->query($wd_fb_info_collation);
647
  }
648
 
649
- //message-i , description , name encoding --> utf16_bin
650
- $wd_fb_data = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_data` (
651
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
652
  `fb_id` int NOT NULL,
653
  `from` varchar(32) NOT NULL,
@@ -671,38 +716,37 @@ function ffwd_activate()
671
  `created_time` varchar(64) NOT NULL,
672
  `updated_time` varchar(64) NOT NULL,
673
  `created_time_number` bigint(255) NOT NULL,
674
- `reactions` text NOT NULL,
675
- `comments` text NOT NULL,
676
- `shares` text NOT NULL,
677
- `attachments` text NOT NULL,
678
- `who_post` text NOT NULL,
679
  PRIMARY KEY (`id`)
680
- ) " . $charset_collate . ";";
681
- $wpdb->query($wd_fb_data);
682
 
683
- $wd_fb_data_collation = "ALTER TABLE `" . $wpdb->prefix . "wd_fb_data`
684
  MODIFY `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
685
  MODIFY `description` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
686
  MODIFY `message` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin
687
  ";
688
-
689
- $wpdb->query($wd_fb_data_collation);
690
-
691
- $wd_fb_option = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_option` (
692
- `id` bigint(20) NOT NULL,
693
- `autoupdate_interval` int(4) NOT NULL,
694
- `app_id` varchar(255) NOT NULL,
695
- `app_secret` varchar(255) NOT NULL,
696
- `access_token` varchar(255) NOT NULL,
697
- `date_timezone` varchar(64) NOT NULL,
698
- `post_date_format` varchar(64) NOT NULL,
699
- `event_date_format` varchar(64) NOT NULL
700
- ) " . $charset_collate . ";";
701
  $wpdb->query($wd_fb_option);
702
 
703
  /*$ffwd_settings = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "ffwd_settings` (
704
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
705
- `autoupdate_interval` int(4) NOT NULL,
706
  `app_id` varchar(255) NOT NULL,
707
  `app_secret` varchar(255) NOT NULL,
708
  `date_timezone` varchar(64) NOT NULL,
@@ -710,73 +754,59 @@ function ffwd_activate()
710
  ) DEFAULT CHARSET=utf8;";
711
  $wpdb->query($ffwd_settings);*/
712
 
713
- $wd_fb_theme = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_theme` (
714
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
715
- `name` varchar(255) NOT NULL,
716
- `params` longtext,
717
- `default_theme` tinyint(1) NOT NULL,
718
- PRIMARY KEY (`id`)
719
- ) " . $charset_collate . ";";
720
- $wpdb->query($wd_fb_theme);
721
-
722
- $exists_default = $wpdb->get_var('SELECT count(id) FROM ' . $wpdb->prefix . 'wd_fb_option');
723
- if (!$exists_default) {
724
- $save = $wpdb->insert($wpdb->prefix . 'wd_fb_option', array(
725
- 'id' => 1,
726
- 'autoupdate_interval' => 90,
727
- 'app_id' => '',
728
- 'date_timezone' => '',
729
- 'access_token' => '',
730
- 'post_date_format' => 'ago',
731
- 'event_date_format' => 'F j, Y, g:i a',
732
-
733
-
734
- ));
735
- }
736
-
737
- $exists_default = $wpdb->get_var('SELECT count(id) FROM ' . $wpdb->prefix . 'wd_fb_theme');
738
-
739
- if (!$exists_default) {
740
- $wpdb->insert($wpdb->prefix . 'wd_fb_theme', array(
741
- 'name' => 'Theme 1',
742
- 'default_theme' => 1,
743
- 'params' => '{"thumb_margin":"10","thumb_padding":"2","thumb_border_radius":"0","thumb_border_width":"1","thumb_border_style":"none","thumb_border_color":"000000","thumb_bg_color":"FFFFFF","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":"100","thumb_box_shadow":"0px 0px 0px #000000","thumb_transparent":"100","thumb_align":"center","thumb_hover_effect":"scale","thumb_hover_effect_value":"2deg","thumb_transition":"1","thumb_title_font_color":"797979","thumb_title_font_style":"inherit","thumb_title_pos":"bottom","thumb_title_font_size":"14","thumb_title_font_weight":"normal","thumb_title_margin":"5","thumb_title_shadow":"","thumb_like_comm_pos":"bottom","thumb_like_comm_font_size":"14","thumb_like_comm_font_color":"FFFFFF","thumb_like_comm_font_style":"inherit","thumb_like_comm_font_weight":"normal","thumb_like_comm_shadow":"0px 0px 1px #000000","masonry_thumb_padding":"10","masonry_thumb_border_radius":"2px","masonry_thumb_border_width":"1","masonry_thumb_border_style":"solid","masonry_thumb_border_color":"FFFFFF","masonry_thumbs_bg_color":"FFFFFF","masonry_thumb_bg_transparent":"100","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"none","masonry_thumb_hover_effect_value":"1.1","masonry_thumb_transition":"1","masonry_description_font_size":"14","masonry_description_color":"A3A3A3","masonry_description_font_style":"inherit","masonry_like_comm_pos":"bottom","masonry_like_comm_font_size":"14","masonry_like_comm_font_color":"FFFFFF","masonry_like_comm_font_style":"inherit","masonry_like_comm_font_weight":"normal","masonry_like_comm_shadow":"0px 0px 1px #000000","blog_style_align":"center","blog_style_bg_color":"FFFFFF","blog_style_fd_name_bg_color":"FFFFFF","blog_style_fd_name_align":"left","blog_style_fd_name_padding":"10","blog_style_fd_name_color":"1C1C1C","blog_style_fd_name_size":"24","blog_style_fd_name_font_weight":"normal","blog_style_fd_icon":"","blog_style_fd_icon_color":"","blog_style_fd_icon_size":"","blog_style_transparent":"100","blog_style_obj_img_align":"left","blog_style_margin":"16","blog_style_box_shadow":"","blog_style_border_width":"1","blog_style_border_style":"solid","blog_style_border_color":"EBEBEB","blog_style_border_type":"top","blog_style_border_radius":"","blog_style_obj_icons_color":"gray","blog_style_obj_date_pos":"after","blog_style_obj_font_family":"inherit","blog_style_obj_info_bg_color":"FFFFFF","blog_style_page_name_color":"1C1C1C","blog_style_obj_page_name_size":"20","blog_style_obj_page_name_font_weight":"normal","blog_style_obj_story_color":"1C1C1C","blog_style_obj_story_size":"16","blog_style_obj_story_font_weight":"normal","blog_style_obj_place_color":"1C1C1C","blog_style_obj_place_size":"14","blog_style_obj_place_font_weight":"normal","blog_style_obj_name_color":"1C1C1C","blog_style_obj_name_size":"18","blog_style_obj_name_font_weight":"bold","blog_style_obj_message_color":"1C1C1C","blog_style_obj_message_size":"16","blog_style_obj_message_font_weight":"normal","blog_style_obj_hashtags_color":"000000","blog_style_obj_hashtags_size":"12","blog_style_obj_hashtags_font_weight":"normal","blog_style_obj_likes_social_bg_color":"FFFFFF","blog_style_obj_likes_social_color":"1C1C1C","blog_style_obj_likes_social_size":"14","blog_style_obj_likes_social_font_weight":"normal","blog_style_obj_comments_bg_color":"FFFFFF","blog_style_obj_comments_color":"000000","blog_style_obj_comments_font_family":"inherit","blog_style_obj_comments_font_size":"14","blog_style_obj_users_font_color":"000000","blog_style_obj_comments_social_font_weight":"normal","blog_style_obj_comment_border_width":"10","blog_style_obj_comment_border_style":"solid","blog_style_obj_comment_border_color":"FCFCFC","blog_style_obj_comment_border_type":"top","blog_style_evt_str_color":"1C1C1C","blog_style_evt_str_size":"16","blog_style_evt_str_font_weight":"normal","blog_style_evt_ctzpcn_color":"CFCFCF","blog_style_evt_ctzpcn_size":"14","blog_style_evt_ctzpcn_font_weight":"normal","blog_style_evt_map_color":"1C1C1C","blog_style_evt_map_size":"14","blog_style_evt_map_font_weight":"normal","blog_style_evt_date_color":"CFCFCF","blog_style_evt_date_size":"14","blog_style_evt_date_font_weight":"normal","blog_style_evt_info_font_family":"inherit","album_compact_back_font_color":"000000","album_compact_back_font_style":"inherit","album_compact_back_font_size":"16","album_compact_back_font_weight":"bold","album_compact_back_padding":"0","album_compact_title_font_color":"797979","album_compact_title_font_style":"inherit","album_compact_thumb_title_pos":"bottom","album_compact_title_font_size":"13","album_compact_title_font_weight":"normal","album_compact_title_margin":"2px","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_margin":"4","album_compact_thumb_padding":"0","album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":"0","album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"FFFFFF","album_compact_thumbs_bg_color":"FFFFFF","album_compact_thumb_bg_transparent":"0","album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transparent":"100","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"none","album_compact_thumb_hover_effect_value":"1.1","album_compact_thumb_transition":"0","lightbox_overlay_bg_color":"000000","lightbox_overlay_bg_transparent":"60","lightbox_bg_color":"1B1B1B","lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":"16","lightbox_ctrl_btn_margin_top":"24","lightbox_ctrl_btn_margin_left":"10","lightbox_ctrl_btn_transparent":"100","lightbox_ctrl_btn_color":"ffffff","lightbox_toggle_btn_height":"14","lightbox_toggle_btn_width":"100","lightbox_ctrl_cont_bg_color":"0A0A0A","lightbox_ctrl_cont_transparent":"100","lightbox_ctrl_cont_border_radius":"4","lightbox_close_btn_transparent":"100","lightbox_close_btn_bg_color":"000000","lightbox_close_btn_border_width":"14","lightbox_close_btn_border_radius":"24px","lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"","lightbox_close_btn_size":"12","lightbox_close_btn_width":"24","lightbox_close_btn_height":"24","lightbox_close_btn_top":"0","lightbox_close_btn_right":"-30","lightbox_close_btn_full_color":"","lightbox_rl_btn_bg_color":"000000","lightbox_rl_btn_transparent":"70","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":"0","lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"","lightbox_rl_btn_height":"36","lightbox_rl_btn_width":"36","lightbox_rl_btn_size":"16","lightbox_close_rl_btn_hover_color":"","lightbox_obj_pos":"right","lightbox_obj_width":"350","lightbox_obj_icons_color":"gray","lightbox_obj_date_pos":"after","lightbox_obj_font_family":"inherit","lightbox_obj_info_bg_color":"FFFFFF","lightbox_page_name_color":"4B4B4B","lightbox_obj_page_name_size":"18","lightbox_obj_page_name_font_weight":"bold","lightbox_obj_story_color":"4B4B4B","lightbox_obj_story_size":"16","lightbox_obj_story_font_weight":"normal","lightbox_obj_place_color":"4B4B4B","lightbox_obj_place_size":"14","lightbox_obj_place_font_weight":"normal","lightbox_obj_name_color":"4B4B4B","lightbox_obj_name_size":"14","lightbox_obj_name_font_weight":"bold","lightbox_obj_message_color":"000000","lightbox_obj_message_size":"16","lightbox_obj_message_font_weight":"normal","lightbox_obj_hashtags_color":"000000","lightbox_obj_hashtags_size":"12","lightbox_obj_hashtags_font_weight":"normal","lightbox_obj_likes_social_bg_color":"F4F5F7","lightbox_obj_likes_social_color":"000000","lightbox_obj_likes_social_size":"12","lightbox_obj_likes_social_font_weight":"normal","lightbox_obj_comments_bg_color":"FFFFFF","lightbox_obj_comments_color":"4A4A4A","lightbox_obj_comments_font_family":"inherit","lightbox_obj_comments_font_size":"16","lightbox_obj_users_font_color":"4B4B4B","lightbox_obj_comments_social_font_weight":"normal","lightbox_obj_comment_border_width":"1","lightbox_obj_comment_border_style":"none","lightbox_obj_comment_border_color":"000000","lightbox_obj_comment_border_type":"top","lightbox_filmstrip_pos":"bottom","lightbox_filmstrip_rl_bg_color":"3B3B3B","lightbox_filmstrip_rl_btn_size":"20","lightbox_filmstrip_rl_btn_color":"ffffff","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":"1","lightbox_filmstrip_thumb_border_style":"solid","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":"80","lightbox_filmstrip_thumb_active_border_width":"0","lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_rl_btn_style":"","lightbox_evt_str_color":"000000","lightbox_evt_str_size":"16","lightbox_evt_str_font_weight":"normal","lightbox_evt_ctzpcn_color":"000000","lightbox_evt_ctzpcn_size":"14","lightbox_evt_ctzpcn_font_weight":"normal","lightbox_evt_map_color":"000000","lightbox_evt_map_size":"14","lightbox_evt_map_font_weight":"normal","lightbox_evt_date_color":"000000","lightbox_evt_date_size":"14","lightbox_evt_date_font_weight":"normal","lightbox_evt_info_font_family":"inherit","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":"0","page_nav_font_size":"12","page_nav_font_style":"inherit","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":"1","page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":"100","page_nav_box_shadow":"0","page_nav_button_transition":"1","page_nav_button_text":"0","lightbox_obj_icons_color_likes_comments_count":"white"}',
744
- ));
745
-
746
- $wpdb->insert($wpdb->prefix . 'wd_fb_theme', array(
747
- 'name' => 'Theme 2',
748
- 'default_theme' => 0,
749
- 'params' => '{"thumb_margin":"10","thumb_padding":"2","thumb_border_radius":"0px","thumb_border_width":"0","thumb_border_style":"none","thumb_border_color":"000000","thumb_bg_color":"BBCED4","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":"100","thumb_box_shadow":"0px 0px 0px #000000","thumb_transparent":"100","thumb_align":"center","thumb_hover_effect":"rotate","thumb_hover_effect_value":"1deg","thumb_transition":"1","thumb_title_font_color":"1F1F1F","thumb_title_font_style":"inherit","thumb_title_pos":"bottom","thumb_title_font_size":"14","thumb_title_font_weight":"normal","thumb_title_margin":"10","thumb_title_shadow":"","thumb_like_comm_pos":"bottom","thumb_like_comm_font_size":"14","thumb_like_comm_font_color":"FFFFFF","thumb_like_comm_font_style":"inherit","thumb_like_comm_font_weight":"normal","thumb_like_comm_shadow":"0px 0px 1px #000000","masonry_thumb_padding":"4","masonry_thumb_border_radius":"2px","masonry_thumb_border_width":"1","masonry_thumb_border_style":"solid","masonry_thumb_border_color":"FFFFFF","masonry_thumbs_bg_color":"BBCED2","masonry_thumb_bg_transparent":"100","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"scale","masonry_thumb_hover_effect_value":"1.1","masonry_thumb_transition":"1","masonry_description_font_size":"14","masonry_description_color":"1F1F1F","masonry_description_font_style":"inherit","masonry_like_comm_pos":"bottom","masonry_like_comm_font_size":"14","masonry_like_comm_font_color":"FFFFFF","masonry_like_comm_font_style":"inherit","masonry_like_comm_font_weight":"normal","masonry_like_comm_shadow":"0px 0px 1px #000000","blog_style_align":"left","blog_style_bg_color":"FFFFFF","blog_style_fd_name_bg_color":"000000","blog_style_fd_name_align":"center","blog_style_fd_name_padding":"10","blog_style_fd_name_color":"FFFFFF","blog_style_fd_name_size":"15","blog_style_fd_name_font_weight":"normal","blog_style_fd_icon":"","blog_style_fd_icon_color":"","blog_style_fd_icon_size":"","blog_style_transparent":"100","blog_style_obj_img_align":"center","blog_style_margin":"10","blog_style_box_shadow":"","blog_style_border_width":"1","blog_style_border_style":"solid","blog_style_border_color":"C9C9C9","blog_style_border_type":"top","blog_style_border_radius":"","blog_style_obj_icons_color":"gray","blog_style_obj_date_pos":"after","blog_style_obj_font_family":"inherit","blog_style_obj_info_bg_color":"FFFFFF","blog_style_page_name_color":"000000","blog_style_obj_page_name_size":"13","blog_style_obj_page_name_font_weight":"bold","blog_style_obj_story_color":"000000","blog_style_obj_story_size":"14","blog_style_obj_story_font_weight":"normal","blog_style_obj_place_color":"000000","blog_style_obj_place_size":"13","blog_style_obj_place_font_weight":"normal","blog_style_obj_name_color":"000000","blog_style_obj_name_size":"13","blog_style_obj_name_font_weight":"bold","blog_style_obj_message_color":"000000","blog_style_obj_message_size":"14","blog_style_obj_message_font_weight":"normal","blog_style_obj_hashtags_color":"000000","blog_style_obj_hashtags_size":"12","blog_style_obj_hashtags_font_weight":"normal","blog_style_obj_likes_social_bg_color":"BBCED4","blog_style_obj_likes_social_color":"656565","blog_style_obj_likes_social_size":"14","blog_style_obj_likes_social_font_weight":"normal","blog_style_obj_comments_bg_color":"FFFFFF","blog_style_obj_comments_color":"000000","blog_style_obj_comments_font_family":"inherit","blog_style_obj_comments_font_size":"14","blog_style_obj_users_font_color":"000000","blog_style_obj_comments_social_font_weight":"normal","blog_style_obj_comment_border_width":"1","blog_style_obj_comment_border_style":"solid","blog_style_obj_comment_border_color":"C9C9C9","blog_style_obj_comment_border_type":"top","blog_style_evt_str_color":"000000","blog_style_evt_str_size":"14","blog_style_evt_str_font_weight":"normal","blog_style_evt_ctzpcn_color":"000000","blog_style_evt_ctzpcn_size":"14","blog_style_evt_ctzpcn_font_weight":"normal","blog_style_evt_map_color":"000000","blog_style_evt_map_size":"14","blog_style_evt_map_font_weight":"normal","blog_style_evt_date_color":"000000","blog_style_evt_date_size":"14","blog_style_evt_date_font_weight":"normal","blog_style_evt_info_font_family":"inherit","album_compact_back_font_color":"000000","album_compact_back_font_style":"inherit","album_compact_back_font_size":"16","album_compact_back_font_weight":"bold","album_compact_back_padding":"0","album_compact_title_font_color":"797979","album_compact_title_font_style":"inherit","album_compact_thumb_title_pos":"bottom","album_compact_title_font_size":"13","album_compact_title_font_weight":"normal","album_compact_title_margin":"2px","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_margin":"0","album_compact_thumb_padding":"0","album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":"0","album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"BBCED4","album_compact_thumbs_bg_color":"FFFFFF","album_compact_thumb_bg_transparent":"0","album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transparent":"100","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"scale","album_compact_thumb_hover_effect_value":"1.1","album_compact_thumb_transition":"0","lightbox_overlay_bg_color":"000000","lightbox_overlay_bg_transparent":"70","lightbox_bg_color":"000000","lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":"20","lightbox_ctrl_btn_margin_top":"10","lightbox_ctrl_btn_margin_left":"7","lightbox_ctrl_btn_transparent":"100","lightbox_ctrl_btn_color":"ffffff","lightbox_toggle_btn_height":"14","lightbox_toggle_btn_width":"100","lightbox_ctrl_cont_bg_color":"000000","lightbox_ctrl_cont_transparent":"65","lightbox_ctrl_cont_border_radius":"4","lightbox_close_btn_transparent":"100","lightbox_close_btn_bg_color":"000000","lightbox_close_btn_border_width":"2","lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"","lightbox_close_btn_size":"10","lightbox_close_btn_width":"20","lightbox_close_btn_height":"20","lightbox_close_btn_top":"-10","lightbox_close_btn_right":"-10","lightbox_close_btn_full_color":"","lightbox_rl_btn_bg_color":"000000","lightbox_rl_btn_transparent":"80","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":"0","lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"","lightbox_rl_btn_height":"40","lightbox_rl_btn_width":"40","lightbox_rl_btn_size":"20","lightbox_close_rl_btn_hover_color":"","lightbox_obj_pos":"left","lightbox_obj_width":"350","lightbox_obj_icons_color":"gray","lightbox_obj_date_pos":"after","lightbox_obj_font_family":"inherit","lightbox_obj_info_bg_color":"E2E2E2","lightbox_page_name_color":"000000","lightbox_obj_page_name_size":"14","lightbox_obj_page_name_font_weight":"bold","lightbox_obj_story_color":"4B4B4B","lightbox_obj_story_size":"14","lightbox_obj_story_font_weight":"normal","lightbox_obj_place_color":"000000","lightbox_obj_place_size":"13","lightbox_obj_place_font_weight":"normal","lightbox_obj_name_color":"4B4B4B","lightbox_obj_name_size":"14","lightbox_obj_name_font_weight":"bold","lightbox_obj_message_color":"000000","lightbox_obj_message_size":"14","lightbox_obj_message_font_weight":"normal","lightbox_obj_hashtags_color":"000000","lightbox_obj_hashtags_size":"12","lightbox_obj_hashtags_font_weight":"normal","lightbox_obj_likes_social_bg_color":"BBCED4","lightbox_obj_likes_social_color":"FFFFFF","lightbox_obj_likes_social_size":"14","lightbox_obj_likes_social_font_weight":"normal","lightbox_obj_comments_bg_color":"EAEAEA","lightbox_obj_comments_color":"4A4A4A","lightbox_obj_comments_font_family":"inherit","lightbox_obj_comments_font_size":"14","lightbox_obj_users_font_color":"4B4B4B","lightbox_obj_comments_social_font_weight":"normal","lightbox_obj_comment_border_width":"1","lightbox_obj_comment_border_style":"solid","lightbox_obj_comment_border_color":"C9C9C9","lightbox_obj_comment_border_type":"top","lightbox_filmstrip_pos":"top","lightbox_filmstrip_rl_bg_color":"3B3B3B","lightbox_filmstrip_rl_btn_size":"20","lightbox_filmstrip_rl_btn_color":"ffffff","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":"1","lightbox_filmstrip_thumb_border_style":"solid","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":"80","lightbox_filmstrip_thumb_active_border_width":"0","lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_rl_btn_style":"","lightbox_evt_str_color":"000000","lightbox_evt_str_size":"14","lightbox_evt_str_font_weight":"normal","lightbox_evt_ctzpcn_color":"000000","lightbox_evt_ctzpcn_size":"14","lightbox_evt_ctzpcn_font_weight":"normal","lightbox_evt_map_color":"000000","lightbox_evt_map_size":"14","lightbox_evt_map_font_weight":"normal","lightbox_evt_date_color":"000000","lightbox_evt_date_size":"14","lightbox_evt_date_font_weight":"normal","lightbox_evt_info_font_family":"inherit","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":"0","page_nav_font_size":"12","page_nav_font_style":"inherit","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":"1","page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":"100","page_nav_box_shadow":"0","page_nav_button_transition":"1","page_nav_button_text":"0","lightbox_obj_icons_color_likes_comments_count":"white"}',
750
- ));
751
-
752
- $wpdb->insert($wpdb->prefix . 'wd_fb_theme', array(
753
- 'name' => 'Theme 3',
754
- 'default_theme' => 0,
755
- 'params' => '{"thumb_margin":"10","thumb_padding":"2","thumb_border_radius":"2px","thumb_border_width":"1","thumb_border_style":"none","thumb_border_color":"000000","thumb_bg_color":"C3E0CE","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":"100","thumb_box_shadow":"0px 0px 1px #000000","thumb_transparent":"100","thumb_align":"center","thumb_hover_effect":"rotate","thumb_hover_effect_value":"2deg","thumb_transition":"1","thumb_title_font_color":"191919","thumb_title_font_style":"inherit","thumb_title_pos":"bottom","thumb_title_font_size":"14","thumb_title_font_weight":"normal","thumb_title_margin":"10","thumb_title_shadow":"","thumb_like_comm_pos":"bottom","thumb_like_comm_font_size":"14","thumb_like_comm_font_color":"FFFFFF","thumb_like_comm_font_style":"inherit","thumb_like_comm_font_weight":"normal","thumb_like_comm_shadow":"0px 0px 1px #000000","masonry_thumb_padding":"4","masonry_thumb_border_radius":"2px","masonry_thumb_border_width":"1","masonry_thumb_border_style":"solid","masonry_thumb_border_color":"FFFFFF","masonry_thumbs_bg_color":"C3E0CE","masonry_thumb_bg_transparent":"100","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"scale","masonry_thumb_hover_effect_value":"1.1","masonry_thumb_transition":"1","masonry_description_font_size":"14","masonry_description_color":"191919","masonry_description_font_style":"inherit","masonry_like_comm_pos":"bottom","masonry_like_comm_font_size":"14","masonry_like_comm_font_color":"FFFFFF","masonry_like_comm_font_style":"inherit","masonry_like_comm_font_weight":"normal","masonry_like_comm_shadow":"0px 0px 1px #000000","blog_style_align":"left","blog_style_bg_color":"FFFFFF","blog_style_fd_name_bg_color":"000000","blog_style_fd_name_align":"center","blog_style_fd_name_padding":"10","blog_style_fd_name_color":"FFFFFF","blog_style_fd_name_size":"15","blog_style_fd_name_font_weight":"normal","blog_style_fd_icon":"","blog_style_fd_icon_color":"","blog_style_fd_icon_size":"","blog_style_transparent":"100","blog_style_obj_img_align":"center","blog_style_margin":"10","blog_style_box_shadow":"","blog_style_border_width":"1","blog_style_border_style":"solid","blog_style_border_color":"C9C9C9","blog_style_border_type":"top","blog_style_border_radius":"","blog_style_obj_icons_color":"gray","blog_style_obj_date_pos":"after","blog_style_obj_font_family":"inherit","blog_style_obj_info_bg_color":"FFFFFF","blog_style_page_name_color":"000000","blog_style_obj_page_name_size":"13","blog_style_obj_page_name_font_weight":"bold","blog_style_obj_story_color":"000000","blog_style_obj_story_size":"14","blog_style_obj_story_font_weight":"normal","blog_style_obj_place_color":"000000","blog_style_obj_place_size":"13","blog_style_obj_place_font_weight":"normal","blog_style_obj_name_color":"000000","blog_style_obj_name_size":"13","blog_style_obj_name_font_weight":"bold","blog_style_obj_message_color":"000000","blog_style_obj_message_size":"14","blog_style_obj_message_font_weight":"normal","blog_style_obj_hashtags_color":"000000","blog_style_obj_hashtags_size":"12","blog_style_obj_hashtags_font_weight":"normal","blog_style_obj_likes_social_bg_color":"C3E0CE","blog_style_obj_likes_social_color":"656565","blog_style_obj_likes_social_size":"14","blog_style_obj_likes_social_font_weight":"normal","blog_style_obj_comments_bg_color":"FFFFFF","blog_style_obj_comments_color":"000000","blog_style_obj_comments_font_family":"inherit","blog_style_obj_comments_font_size":"14","blog_style_obj_users_font_color":"000000","blog_style_obj_comments_social_font_weight":"normal","blog_style_obj_comment_border_width":"1","blog_style_obj_comment_border_style":"solid","blog_style_obj_comment_border_color":"C9C9C9","blog_style_obj_comment_border_type":"top","blog_style_evt_str_color":"000000","blog_style_evt_str_size":"14","blog_style_evt_str_font_weight":"normal","blog_style_evt_ctzpcn_color":"000000","blog_style_evt_ctzpcn_size":"14","blog_style_evt_ctzpcn_font_weight":"normal","blog_style_evt_map_color":"000000","blog_style_evt_map_size":"14","blog_style_evt_map_font_weight":"normal","blog_style_evt_date_color":"000000","blog_style_evt_date_size":"14","blog_style_evt_date_font_weight":"normal","blog_style_evt_info_font_family":"inherit","album_compact_back_font_color":"000000","album_compact_back_font_style":"inherit","album_compact_back_font_size":"16","album_compact_back_font_weight":"bold","album_compact_back_padding":"0","album_compact_title_font_color":"191919","album_compact_title_font_style":"inherit","album_compact_thumb_title_pos":"bottom","album_compact_title_font_size":"13","album_compact_title_font_weight":"normal","album_compact_title_margin":"2px","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_margin":"4","album_compact_thumb_padding":"0","album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":"0","album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"C3E0CE","album_compact_thumbs_bg_color":"FFFFFF","album_compact_thumb_bg_transparent":"0","album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transparent":"100","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"scale","album_compact_thumb_hover_effect_value":"1.1","album_compact_thumb_transition":"0","lightbox_overlay_bg_color":"000000","lightbox_overlay_bg_transparent":"70","lightbox_bg_color":"000000","lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":"20","lightbox_ctrl_btn_margin_top":"10","lightbox_ctrl_btn_margin_left":"7","lightbox_ctrl_btn_transparent":"100","lightbox_ctrl_btn_color":"ffffff","lightbox_toggle_btn_height":"14","lightbox_toggle_btn_width":"100","lightbox_ctrl_cont_bg_color":"000000","lightbox_ctrl_cont_transparent":"65","lightbox_ctrl_cont_border_radius":"4","lightbox_close_btn_transparent":"100","lightbox_close_btn_bg_color":"000000","lightbox_close_btn_border_width":"2","lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"","lightbox_close_btn_size":"10","lightbox_close_btn_width":"20","lightbox_close_btn_height":"20","lightbox_close_btn_top":"-10","lightbox_close_btn_right":"-10","lightbox_close_btn_full_color":"","lightbox_rl_btn_bg_color":"000000","lightbox_rl_btn_transparent":"80","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":"0","lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"","lightbox_rl_btn_height":"40","lightbox_rl_btn_width":"40","lightbox_rl_btn_size":"20","lightbox_close_rl_btn_hover_color":"","lightbox_obj_pos":"left","lightbox_obj_width":"350","lightbox_obj_icons_color":"gray","lightbox_obj_date_pos":"after","lightbox_obj_font_family":"inherit","lightbox_obj_info_bg_color":"E2E2E2","lightbox_page_name_color":"4B4B4B","lightbox_obj_page_name_size":"14","lightbox_obj_page_name_font_weight":"bold","lightbox_obj_story_color":"4B4B4B","lightbox_obj_story_size":"14","lightbox_obj_story_font_weight":"normal","lightbox_obj_place_color":"000000","lightbox_obj_place_size":"13","lightbox_obj_place_font_weight":"normal","lightbox_obj_name_color":"4B4B4B","lightbox_obj_name_size":"14","lightbox_obj_name_font_weight":"bold","lightbox_obj_message_color":"000000","lightbox_obj_message_size":"14","lightbox_obj_message_font_weight":"normal","lightbox_obj_hashtags_color":"000000","lightbox_obj_hashtags_size":"12","lightbox_obj_hashtags_font_weight":"normal","lightbox_obj_likes_social_bg_color":"C3E0CE","lightbox_obj_likes_social_color":"FFFFFF","lightbox_obj_likes_social_size":"14","lightbox_obj_likes_social_font_weight":"normal","lightbox_obj_comments_bg_color":"EAEAEA","lightbox_obj_comments_color":"4A4A4A","lightbox_obj_comments_font_family":"inherit","lightbox_obj_comments_font_size":"14","lightbox_obj_users_font_color":"4B4B4B","lightbox_obj_comments_social_font_weight":"normal","lightbox_obj_comment_border_width":"1","lightbox_obj_comment_border_style":"solid","lightbox_obj_comment_border_color":"C9C9C9","lightbox_obj_comment_border_type":"top","lightbox_filmstrip_pos":"top","lightbox_filmstrip_rl_bg_color":"3B3B3B","lightbox_filmstrip_rl_btn_size":"20","lightbox_filmstrip_rl_btn_color":"ffffff","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":"1","lightbox_filmstrip_thumb_border_style":"solid","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":"80","lightbox_filmstrip_thumb_active_border_width":"0","lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_rl_btn_style":"","lightbox_evt_str_color":"000000","lightbox_evt_str_size":"14","lightbox_evt_str_font_weight":"normal","lightbox_evt_ctzpcn_color":"000000","lightbox_evt_ctzpcn_size":"14","lightbox_evt_ctzpcn_font_weight":"normal","lightbox_evt_map_color":"000000","lightbox_evt_map_size":"14","lightbox_evt_map_font_weight":"normal","lightbox_evt_date_color":"000000","lightbox_evt_date_size":"14","lightbox_evt_date_font_weight":"normal","lightbox_evt_info_font_family":"inherit","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":"0","page_nav_font_size":"12","page_nav_font_style":"inherit","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":"1","page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":"100","page_nav_box_shadow":"0","page_nav_button_transition":"1","page_nav_button_text":"0","lightbox_obj_icons_color_likes_comments_count":"white"}',
756
-
757
- ));
758
-
759
- $wpdb->insert($wpdb->prefix . 'wd_fb_theme', array(
760
- 'name' => 'Theme 4',
761
- 'default_theme' => 0,
762
- 'params' => '{"thumb_margin":"10","thumb_padding":"2","thumb_border_radius":"2px","thumb_border_width":"1","thumb_border_style":"none","thumb_border_color":"000000","thumb_bg_color":"CFC3DB","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":"100","thumb_box_shadow":"0px 0px 1px #000000","thumb_transparent":"100","thumb_align":"center","thumb_hover_effect":"rotate","thumb_hover_effect_value":"2deg","thumb_transition":"1","thumb_title_font_color":"191919","thumb_title_font_style":"inherit","thumb_title_pos":"bottom","thumb_title_font_size":"14","thumb_title_font_weight":"normal","thumb_title_margin":"10","thumb_title_shadow":"","thumb_like_comm_pos":"bottom","thumb_like_comm_font_size":"14","thumb_like_comm_font_color":"FFFFFF","thumb_like_comm_font_style":"inherit","thumb_like_comm_font_weight":"normal","thumb_like_comm_shadow":"0px 0px 1px #000000","masonry_thumb_padding":"4","masonry_thumb_border_radius":"2px","masonry_thumb_border_width":"1","masonry_thumb_border_style":"solid","masonry_thumb_border_color":"FFFFFF","masonry_thumbs_bg_color":"CFC3DB","masonry_thumb_bg_transparent":"100","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"scale","masonry_thumb_hover_effect_value":"1.1","masonry_thumb_transition":"1","masonry_description_font_size":"14","masonry_description_color":"191919","masonry_description_font_style":"inherit","masonry_like_comm_pos":"bottom","masonry_like_comm_font_size":"14","masonry_like_comm_font_color":"FFFFFF","masonry_like_comm_font_style":"inherit","masonry_like_comm_font_weight":"normal","masonry_like_comm_shadow":"0px 0px 1px #000000","blog_style_align":"left","blog_style_bg_color":"FFFFFF","blog_style_fd_name_bg_color":"000000","blog_style_fd_name_align":"center","blog_style_fd_name_padding":"10","blog_style_fd_name_color":"FFFFFF","blog_style_fd_name_size":"15","blog_style_fd_name_font_weight":"normal","blog_style_fd_icon":"","blog_style_fd_icon_color":"","blog_style_fd_icon_size":"","blog_style_transparent":"100","blog_style_obj_img_align":"center","blog_style_margin":"10","blog_style_box_shadow":"","blog_style_border_width":"1","blog_style_border_style":"solid","blog_style_border_color":"C9C9C9","blog_style_border_type":"top","blog_style_border_radius":"","blog_style_obj_icons_color":"gray","blog_style_obj_date_pos":"after","blog_style_obj_font_family":"inherit","blog_style_obj_info_bg_color":"FFFFFF","blog_style_page_name_color":"000000","blog_style_obj_page_name_size":"13","blog_style_obj_page_name_font_weight":"bold","blog_style_obj_story_color":"000000","blog_style_obj_story_size":"14","blog_style_obj_story_font_weight":"normal","blog_style_obj_place_color":"000000","blog_style_obj_place_size":"13","blog_style_obj_place_font_weight":"normal","blog_style_obj_name_color":"000000","blog_style_obj_name_size":"13","blog_style_obj_name_font_weight":"bold","blog_style_obj_message_color":"000000","blog_style_obj_message_size":"14","blog_style_obj_message_font_weight":"normal","blog_style_obj_hashtags_color":"000000","blog_style_obj_hashtags_size":"12","blog_style_obj_hashtags_font_weight":"normal","blog_style_obj_likes_social_bg_color":"CFC3DB","blog_style_obj_likes_social_color":"656565","blog_style_obj_likes_social_size":"14","blog_style_obj_likes_social_font_weight":"normal","blog_style_obj_comments_bg_color":"FFFFFF","blog_style_obj_comments_color":"000000","blog_style_obj_comments_font_family":"inherit","blog_style_obj_comments_font_size":"14","blog_style_obj_users_font_color":"000000","blog_style_obj_comments_social_font_weight":"normal","blog_style_obj_comment_border_width":"1","blog_style_obj_comment_border_style":"solid","blog_style_obj_comment_border_color":"C9C9C9","blog_style_obj_comment_border_type":"top","blog_style_evt_str_color":"000000","blog_style_evt_str_size":"14","blog_style_evt_str_font_weight":"normal","blog_style_evt_ctzpcn_color":"000000","blog_style_evt_ctzpcn_size":"14","blog_style_evt_ctzpcn_font_weight":"normal","blog_style_evt_map_color":"000000","blog_style_evt_map_size":"14","blog_style_evt_map_font_weight":"normal","blog_style_evt_date_color":"000000","blog_style_evt_date_size":"14","blog_style_evt_date_font_weight":"normal","blog_style_evt_info_font_family":"inherit","album_compact_back_font_color":"000000","album_compact_back_font_style":"inherit","album_compact_back_font_size":"16","album_compact_back_font_weight":"bold","album_compact_back_padding":"0","album_compact_title_font_color":"191919","album_compact_title_font_style":"inherit","album_compact_thumb_title_pos":"bottom","album_compact_title_font_size":"13","album_compact_title_font_weight":"normal","album_compact_title_margin":"2px","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_margin":"0","album_compact_thumb_padding":"0","album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":"0","album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"CFC3DB","album_compact_thumbs_bg_color":"FFFFFF","album_compact_thumb_bg_transparent":"0","album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transparent":"100","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"scale","album_compact_thumb_hover_effect_value":"1.1","album_compact_thumb_transition":"0","lightbox_overlay_bg_color":"000000","lightbox_overlay_bg_transparent":"70","lightbox_bg_color":"000000","lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":"20","lightbox_ctrl_btn_margin_top":"10","lightbox_ctrl_btn_margin_left":"7","lightbox_ctrl_btn_transparent":"100","lightbox_ctrl_btn_color":"ffffff","lightbox_toggle_btn_height":"14","lightbox_toggle_btn_width":"100","lightbox_ctrl_cont_bg_color":"000000","lightbox_ctrl_cont_transparent":"65","lightbox_ctrl_cont_border_radius":"4","lightbox_close_btn_transparent":"100","lightbox_close_btn_bg_color":"000000","lightbox_close_btn_border_width":"2","lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"","lightbox_close_btn_size":"10","lightbox_close_btn_width":"20","lightbox_close_btn_height":"20","lightbox_close_btn_top":"-10","lightbox_close_btn_right":"-10","lightbox_close_btn_full_color":"","lightbox_rl_btn_bg_color":"000000","lightbox_rl_btn_transparent":"80","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":"0","lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"","lightbox_rl_btn_height":"40","lightbox_rl_btn_width":"40","lightbox_rl_btn_size":"20","lightbox_close_rl_btn_hover_color":"","lightbox_obj_pos":"left","lightbox_obj_width":"350","lightbox_obj_icons_color":"gray","lightbox_obj_date_pos":"after","lightbox_obj_font_family":"inherit","lightbox_obj_info_bg_color":"E2E2E2","lightbox_page_name_color":"4B4B4B","lightbox_obj_page_name_size":"14","lightbox_obj_page_name_font_weight":"bold","lightbox_obj_story_color":"4B4B4B","lightbox_obj_story_size":"14","lightbox_obj_story_font_weight":"normal","lightbox_obj_place_color":"000000","lightbox_obj_place_size":"13","lightbox_obj_place_font_weight":"normal","lightbox_obj_name_color":"4B4B4B","lightbox_obj_name_size":"14","lightbox_obj_name_font_weight":"bold","lightbox_obj_message_color":"000000","lightbox_obj_message_size":"14","lightbox_obj_message_font_weight":"normal","lightbox_obj_hashtags_color":"000000","lightbox_obj_hashtags_size":"12","lightbox_obj_hashtags_font_weight":"normal","lightbox_obj_likes_social_bg_color":"CFC3DB","lightbox_obj_likes_social_color":"FFFFFF","lightbox_obj_likes_social_size":"14","lightbox_obj_likes_social_font_weight":"normal","lightbox_obj_comments_bg_color":"EAEAEA","lightbox_obj_comments_color":"4A4A4A","lightbox_obj_comments_font_family":"inherit","lightbox_obj_comments_font_size":"14","lightbox_obj_users_font_color":"4B4B4B","lightbox_obj_comments_social_font_weight":"normal","lightbox_obj_comment_border_width":"1","lightbox_obj_comment_border_style":"solid","lightbox_obj_comment_border_color":"C9C9C9","lightbox_obj_comment_border_type":"top","lightbox_filmstrip_pos":"top","lightbox_filmstrip_rl_bg_color":"3B3B3B","lightbox_filmstrip_rl_btn_size":"20","lightbox_filmstrip_rl_btn_color":"ffffff","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":"1","lightbox_filmstrip_thumb_border_style":"solid","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":"80","lightbox_filmstrip_thumb_active_border_width":"0","lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_rl_btn_style":"","lightbox_evt_str_color":"000000","lightbox_evt_str_size":"14","lightbox_evt_str_font_weight":"normal","lightbox_evt_ctzpcn_color":"000000","lightbox_evt_ctzpcn_size":"14","lightbox_evt_ctzpcn_font_weight":"normal","lightbox_evt_map_color":"000000","lightbox_evt_map_size":"14","lightbox_evt_map_font_weight":"normal","lightbox_evt_date_color":"000000","lightbox_evt_date_size":"14","lightbox_evt_date_font_weight":"normal","lightbox_evt_info_font_family":"inherit","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":"0","page_nav_font_size":"12","page_nav_font_style":"inherit","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":"1","page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":"100","page_nav_box_shadow":"0","page_nav_button_transition":"1","page_nav_button_text":"0","lightbox_obj_icons_color_likes_comments_count":"white"}',
763
- ));
764
-
765
- }
766
-
767
- wp_schedule_event(time(), 'wd_fb_autoupdate_interval', 'wd_fb_schedule_event_hook');
768
-
769
- ffwd_version();
770
-
771
  }
772
 
773
  register_activation_hook(__FILE__, 'ffwd_activate');
774
 
775
-
776
  /* On deactivation, remove all functions from the scheduled action hook.*/
777
- function ffwd_deactivate()
778
- {
779
- wp_clear_scheduled_hook('wd_fb_schedule_event_hook');
780
  }
781
 
782
  register_deactivation_hook(__FILE__, 'ffwd_deactivate');
@@ -790,200 +820,206 @@ function ffwd_styles() {
790
  }
791
 
792
  // Plugin scripts.
793
- function ffwd_scripts()
794
- {
795
- wp_enqueue_script('thickbox');
796
- wp_enqueue_script('ffwd_admin', WD_FFWD_URL . '/js/ffwd.js', array(), ffwd_get_version());
797
-
798
- global $wp_scripts;
799
- if (isset($wp_scripts->registered['jquery'])) {
800
- $jquery = $wp_scripts->registered['jquery'];
801
- if (!isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<')) {
802
- wp_deregister_script('jquery');
803
- wp_register_script('jquery', false, array('jquery-core', 'jquery-migrate'), '1.10.2');
804
- }
 
 
 
 
 
805
  }
806
- wp_enqueue_script('jquery');
807
- wp_enqueue_script('jquery-ui-sortable');
 
808
  }
809
 
810
  /* Add pagination to gallery admin pages.*/
811
- function ffwd_add_ffwd_info_per_page_option()
812
- {
813
- $option = 'per_page';
814
- $args_galleries = array(
815
- 'label' => 'Items',
816
- 'default' => 20,
817
- 'option' => 'ffwd_info_per_page'
818
- );
819
- add_screen_option($option, $args_galleries);
820
  }
821
 
822
- function ffwd_add_themes_per_page_option()
823
- {
824
- $option = 'per_page';
825
- $args_themes = array(
826
- 'label' => 'Themes',
827
- 'default' => 20,
828
- 'option' => 'ffwd_themes_per_page'
829
- );
830
- add_screen_option($option, $args_themes);
831
  }
832
 
833
  add_filter('set-screen-option', 'ffwd_set_option_galleries', 10, 3);
834
  add_filter('set-screen-option', 'ffwd_set_option_themes', 10, 3);
 
 
 
 
835
 
836
- function ffwd_set_option_galleries($status, $option, $value)
837
- {
838
- if ('ffwd_info_per_page' == $option) {
839
- return $value;
840
- }
841
-
842
- return $status;
843
  }
844
 
845
- function ffwd_set_option_themes($status, $option, $value)
846
- {
847
- if ('ffwd_themes_per_page' == $option) {
848
- return $value;
849
- }
850
 
851
- return $status;
852
  }
 
853
  function ffwd_enqueue__admin_scripts(){
854
  wp_enqueue_script( 'ffwd_jquery_form_js', WD_FFWD_URL . '/js/jquery.form.js', array(), ffwd_get_version() );
855
  }
856
 
857
- function ffwd_admin_scripts()
858
- {
859
-
860
- wp_enqueue_script('thickbox');
861
- wp_enqueue_script('ffwd_admin', WD_FFWD_URL . '/js/ffwd.js', array(), ffwd_get_version());
862
-
863
- wp_localize_script('ffwd_admin', 'ffwd_ajax', array(
864
- 'ajaxurl' => admin_url('admin-ajax.php'),
865
- 'ajaxnonce' => wp_create_nonce(WD_FFWD_URL . '_ajax_nonce'),
866
- ));
867
-
868
- global $wp_scripts;
869
- if (isset($wp_scripts->registered['jquery'])) {
870
- $jquery = $wp_scripts->registered['jquery'];
871
- if (!isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<')) {
872
- wp_deregister_script('jquery');
873
- wp_register_script('jquery', false, array('jquery-core', 'jquery-migrate'), '1.10.2');
874
- }
 
 
 
 
 
 
875
  }
876
- wp_enqueue_script('jquery');
877
- wp_enqueue_script('jscolor', WD_FFWD_URL . '/js/jscolor/jscolor.js', array(), '1.3.9');
 
878
  }
879
 
880
- function ffwd_front_end_scripts()
881
- {
882
- $version = ffwd_get_version();
883
- global $wp_scripts;
884
- if (isset($wp_scripts->registered['jquery'])) {
885
- $jquery = $wp_scripts->registered['jquery'];
886
- if (!isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<')) {
887
- wp_deregister_script('jquery');
888
- wp_register_script('jquery', false, array('jquery-core', 'jquery-migrate'), '1.10.2');
889
- }
890
  }
891
- wp_enqueue_script('jquery');
892
- wp_enqueue_script('ffwd_frontend', WD_FFWD_FRONT_URL . '/js/ffwd_frontend.js', array(), $version);
893
- /*wp_localize_script('ffwd_frontend', 'wd_ffwd',
894
- array(
895
- 'ajax_url' => admin_url('admin-ajax.php'),
896
-
897
- ));*/
898
-
899
- wp_enqueue_style('ffwd_frontend', WD_FFWD_FRONT_URL . '/css/ffwd_frontend.css', array(), $version);
900
- // Styles/Scripts for popup.
901
- wp_enqueue_style('ffwd_fonts', WD_FFWD_FRONT_URL . '/css/fonts.css', array(), $version);
902
- wp_enqueue_script('ffwd_jquery_mobile', WD_FFWD_FRONT_URL . '/js/jquery.mobile.js', array(), $version);
903
- wp_enqueue_script('ffwd_mCustomScrollbar', WD_FFWD_FRONT_URL . '/js/jquery.mCustomScrollbar.concat.min.js', array(), $version);
904
- wp_enqueue_style('ffwd_mCustomScrollbar', WD_FFWD_FRONT_URL . '/css/jquery.mCustomScrollbar.css', array(), $version);
905
- wp_enqueue_script('jquery-fullscreen', WD_FFWD_FRONT_URL . '/js/jquery.fullscreen-0.4.1.js', array(), '0.4.1');
906
- wp_enqueue_script('ffwd_gallery_box', WD_FFWD_FRONT_URL . '/js/ffwd_gallery_box.js', array(), $version);
907
- wp_localize_script('ffwd_gallery_box', 'ffwd_objectL10n', array(
908
- 'ffwd_field_required' => __('field is required.', 'bwg'),
909
- 'ffwd_mail_validation' => __('This is not a valid email address.', 'bwg'),
910
- 'ffwd_search_result' => __('There are no images matching your search.', 'bwg'),
911
- ));
912
-
913
- wp_localize_script('ffwd_frontend', 'ffwd_frontend_text', array(
914
- 'comment_reply' => __('Reply', 'ffwd'),
915
- 'view' => __('View', 'ffwd'),
916
- 'more_comments' => __('more comments', 'ffwd'),
917
-
918
- 'year' => __('year', 'ffwd'),
919
- 'years' => __('years', 'ffwd'),
920
- 'hour' => __('hour', 'ffwd'),
921
- 'hours' => __('hours', 'ffwd'),
922
- 'months' => __('months', 'ffwd'),
923
- 'month' => __('month', 'ffwd'),
924
- 'weeks' => __('weeks', 'ffwd'),
925
- 'week' => __('week', 'ffwd'),
926
- 'days' => __('days', 'ffwd'),
927
- 'day' => __('day', 'ffwd'),
928
- 'minutes' => __('minutes', 'ffwd'),
929
- 'minute' => __('minute', 'ffwd'),
930
- 'seconds' => __('seconds', 'ffwd'),
931
- 'second' => __('second', 'ffwd'),
932
- 'ago' => __('ago', 'ffwd'),
933
- 'ajax_url' => admin_url('admin-ajax.php'),
934
- 'and' => __('and', 'ffwd'),
935
- 'others' => __('others', 'ffwd'),
936
-
937
- ));
938
  }
939
 
940
- add_action('wp_enqueue_ffwd_front_end_scripts', 'ffwd_front_end_scripts');
941
  add_action( 'admin_enqueue_scripts', 'ffwd_enqueue__admin_scripts' );
942
- add_action('wp_ajax_ffwd_autoupdate', 'wd_fb_update');
943
- add_action('wp_ajax_nopriv_ffwd_autoupdate', 'wd_fb_update');
944
- /* Add bwg scheduled event for autoupdatable galleries.*/
945
- function wd_fb_add_autoupdate_interval($schedules)
946
- {
947
- require_once(WD_FFWD_DIR . '/framework/WDFacebookFeed.php');
948
- $autoupdate_interval = WDFacebookFeed::get_autoupdate_interval();
949
- $schedules['wd_fb_autoupdate_interval'] = array(
950
- 'interval' => 86400,// 60 * $autoupdate_interval,
951
- 'display' => __('WD Facebook plugin autoupdate interval.')
952
- );
953
-
954
- return $schedules;
955
- }
956
 
957
- add_filter('cron_schedules', 'wd_fb_add_autoupdate_interval');
958
-
959
- add_action('wd_fb_schedule_event_hook', 'wd_fb_update');
960
- // wd_fb_update();
961
- function wd_fb_update($from_plugin = 0)
962
- {
963
- require_once(WD_FFWD_DIR . '/framework/WDFacebookFeed.php');
964
-
965
- $current_time = current_time('timestamp');
966
- $update_time = get_option('ffwd_autoupdate_time');
967
- $autoupdate_interval = 60; //WDFacebookFeed::get_autoupdate_interval();
968
  update_option('ffwd_autoupdate_time', $autoupdate_interval * 60 + $current_time);
969
- if (($current_time >= $update_time && $from_plugin) || !$from_plugin) {
970
- global $wpdb;
971
- $ff_wd_options = get_option('ffwd_pages_list');
972
-
973
  if ( !empty($ff_wd_options) ) {
974
- foreach ( $ff_wd_options as $ff_wd_option ) {
975
- $token = $ff_wd_option->access_token;
976
- $page_id = $ff_wd_option->id;
977
- WDFacebookFeed::update_page_access_token($token, $page_id);
978
- }
979
  }
980
  $query = "SELECT * FROM " . $wpdb->prefix . "wd_fb_info WHERE `update_mode` <> 'no_update'";
981
  $rows = $wpdb->get_results($query);
982
- WDFacebookFeed::update_from_shedule($rows);
983
- update_option('ffwd_autoupdate_time', $autoupdate_interval * 60 + current_time('timestamp'));
984
- }
985
- //die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
986
  }
 
987
 
988
  // Check Valid Token and show message
989
  $ffwd_token_error_flag = get_option("ffwd_token_error_flag");
@@ -1028,49 +1064,42 @@ function ffwd_register_widget(){
1028
  return register_widget("FFWDControllerWidget");
1029
  }
1030
 
1031
-
1032
  // Languages localization.
1033
- function ffwd_language_load()
1034
- {
1035
- load_plugin_textdomain('ffwd', false, basename(dirname(__FILE__)) . '/languages');
1036
  }
1037
 
1038
  add_action('init', 'ffwd_language_load');
 
 
 
 
 
 
 
 
1039
 
1040
- function ffwd_version()
1041
- {
1042
- $version = FFWD_VERSION;
1043
-
1044
- if (get_option('ffwd_version') === false) {
1045
- add_option('ffwd_version', $version);
1046
- } else {
1047
- update_option('ffwd_version', $version);
1048
- }
1049
-
1050
- return $version;
1051
-
1052
  }
1053
 
1054
- function ffwd_get_version()
1055
- {
1056
- if (get_option('ffwd_version') === false) {
1057
- ffwd_version();
1058
- }
1059
 
1060
- return get_option('ffwd_version');
1061
  }
1062
 
1063
- if (!class_exists('Linkify')) {
1064
- include_once WD_FFWD_DIR . '/framework/linkify/LinkifyInterface.php';
1065
- include_once WD_FFWD_DIR . '/framework/linkify/Linkify.php';
1066
  }
1067
 
1068
  /*ELEMENTOR*/
1069
  add_action('plugins_loaded', 'ffwd_elementor');
1070
- function ffwd_elementor(){
1071
- if(defined('ELEMENTOR_VERSION')) {
1072
  include_once 'elementor/elementor.php';
1073
  FFWDElementor::get_instance();
1074
  }
1075
  }
1076
- ?>
3
  * Plugin Name: 10Web Social Feed
4
  * Plugin URI: https://10web.io/plugins/wordpress-facebook-feed/?utm_source=facebook_feed&utm_medium=free_plugin
5
  * Description: 10Web Social Feed is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
6
+ * Version: 1.2.5
7
  * Author: 10Web
8
  * Author URI: https://10web.io/plugins/?utm_source=facebook_feed&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
14
  define('WD_FFWD_MAIN_FILE', plugin_basename(__FILE__));
15
  define('WD_FB_PREFIX', 'ffwd');
16
  define('WD_FB_IS_FREE', true);
17
+ define('WD_FB_TIMELINE_MAX_CALL_COUNT', 5);
18
  if ( !defined('FFWD_VERSION') ) {
19
+ define('FFWD_VERSION', '1.2.5');
20
  }
21
  add_action( 'admin_init', 'ffwd_init' );
22
 
238
  ),
239
  "plugin_wd_demo_link" => "https://demo.10web.io/facebook-feed?utm_source=facebook_feed&utm_medium=free_plugin",
240
  "plugin_wd_url" => "https://10web.io/plugins/wordpress-facebook-feed/?utm_source=facebook_feed&utm_medium=free_plugin",
241
+ "plugin_wd_docs_link" => "https://help.10web.io/hc/en-us/sections/4403737033874?utm_source=facebook_feed&utm_medium=free_plugin",
242
  "after_subscribe" => admin_url('admin.php?page=info_ffwd'),
243
  "plugin_wizard_link" => NULL,
244
  "plugin_menu_title" => "Facebook Feed by 10Web",
311
  add_action('wp_ajax_nopriv_dropp_objects', 'ffwd_ajax');
312
  add_action('wp_ajax_dropp_objects', 'ffwd_ajax');
313
 
314
+ /* Insert FB data media data to DB */
315
+ function ffwd_set_cache_data()
316
+ {
317
+ require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
318
+ $content_type = WDW_FFWD_Library::get('content_type', 'timeline');
319
 
320
+ require_once(WD_FFWD_DIR . '/framework/WDFacebookFeed.php');
321
+ if ( $content_type === 'timeline' ) {
322
+ WDFacebookFeed::set_timeline_cache_data();
323
+ }
324
+ }
325
+ add_action('wp_ajax_set_cache_data', 'ffwd_set_cache_data');
326
+ add_action('wp_ajax_nopriv_set_cache_data', 'ffwd_set_cache_data');
327
 
328
+ /* Update FB media data */
329
+ function ffwd_update_cache_data()
330
+ {
331
+ require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
332
+ $content_type = WDW_FFWD_Library::get('content_type', 'timeline');
333
+ require_once(WD_FFWD_DIR . '/framework/WDFacebookFeed.php');
334
+
335
+ if ( $content_type === 'timeline' ) {
336
+ WDFacebookFeed::update_timeline_cache_data();
337
+ } else {
338
+ WDFacebookFeed::set_specific_cache_data();
339
+ }
340
+ }
341
+ add_action('wp_ajax_update_cache_data', 'ffwd_update_cache_data');
342
+ add_action('wp_ajax_nopriv_update_cache_data', 'ffwd_update_cache_data');
343
+
344
+
345
+ // For reset_cache
346
+ add_action('wp_ajax_ffwd_reset_cache', 'ffwd_reset_cache');
347
  function ffwd_reset_cache(){
348
  if ( isset( $_POST['nonce'] ) && wp_verify_nonce( sanitize_text_field($_POST['nonce']), WD_FFWD_URL . '_ajax_nonce' )) {
349
  delete_option("ffwd_autoupdate_time");
350
  require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
351
  WDW_FFWD_Library::remove_feed_data();
352
+ echo json_encode(array("success"=>true));
353
+ die;
354
  }
355
+ echo json_encode(array("success"=>false)); die;
356
  }
357
 
358
  function ffwd_ajax()
388
  global $wpdb;
389
  require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
390
  $check_fb_feed = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "wd_fb_info WHERE id='%d'", $params['id']));
391
+ require_once(WD_FFWD_DIR . '/framework/WDFacebookFeed.php');
392
  if ( !$check_fb_feed ) {
393
  echo WDW_FFWD_Library::message(__('Feed Doesn\'t exists', 'bwg'), 'error');
394
  return;
399
 
400
  return str_replace(array("\r\n", "\n", "\r"), '', ob_get_clean());
401
  }
 
402
  add_shortcode('WD_FB', 'ffwd_shortcode');
403
 
404
  $ffwd = 0;
405
  function ffwd_front_end($params) {
406
  /* Enqueue css/js in frontend */
407
+ add_action('wp_enqueue_scripts', 'ffwd_front_end_scripts');
408
  global $ffwd;
409
  global $wpdb;
410
  require_once(WD_FFWD_DIR . '/frontend/controllers/FFWDControllerMain.php');
414
  return;
415
  }
416
 
417
+ /* Function called to print feed from js after update */
418
+ function ffwd_ajax_front_end() {
419
+ require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
420
+ $params['fb_id'] = WDW_FFWD_Library::get('fb_id', 0);
421
+ if( $params['fb_id'] == 0 ) {
422
+ echo '';
423
+ die;
424
+ }
425
+ /* Enqueue css/js in frontend */
426
+ add_action('wp_enqueue_scripts', 'ffwd_front_end_scripts');
427
+ global $ffwd;
428
+ global $wpdb;
429
+ require_once(WD_FFWD_DIR . '/frontend/controllers/FFWDControllerMain.php');
430
+ $fb_view_type = $wpdb->get_var($wpdb->prepare("SELECT fb_view_type FROM " . $wpdb->prefix . "wd_fb_info WHERE id='%s'", $params['fb_id']));
431
+ $controller = new FFWDControllerMain($params, 1, $ffwd, ucfirst($fb_view_type));
432
+ $ffwd++;
433
+ return;
434
+ }
435
+ add_action('wp_ajax_ffwd_ajax_front_end', 'ffwd_ajax_front_end');
436
+ add_action('wp_ajax_nopriv_ffwd_ajax_front_end', 'ffwd_ajax_front_end');
437
+
438
+
439
  // Add the Facebook Feed by 10Web button.
440
  function ffwd_add_button($buttons)
441
  {
554
  add_filter('mce_buttons', 'ffwd_add_button', 0);
555
 
556
  // Activate plugin.
557
+ function ffwd_activate() {
558
+ global $wpdb;
559
+ $current_time=current_time('timestamp');
560
+ $autoupdate_interval = 60;
561
+ update_option('ffwd_autoupdate_time',$autoupdate_interval*60+$current_time);
562
+ delete_transient('ffwd_update_check');
563
+ $charset_collate = $wpdb->get_charset_collate();
564
+ $wd_fb_shortcode = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_shortcode` (
 
 
 
565
  `id` bigint(20) NOT NULL,
566
  `tagtext` mediumtext NOT NULL,
567
  PRIMARY KEY (`id`)
568
  ) " . $charset_collate . ";";
569
+ $wpdb->query($wd_fb_shortcode);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
570
 
571
+ $wd_fb_info = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_info` (
572
+ `id` int(10) NOT NULL AUTO_INCREMENT,
573
+ `name` varchar(255) NOT NULL,
574
+ `page_access_token` text NOT NULL,
575
+ `type` varchar(10) NOT NULL,
576
+ `content_type` varchar(15) NOT NULL,
577
+ `content` varchar(256) NOT NULL,
578
+ `content_url` varchar(512) NOT NULL,
579
+ `timeline_type` varchar(16) NOT NULL,
580
+ `from` varchar(32) NOT NULL,
581
+ `limit` int(11) NOT NULL,
582
+ `app_id` varchar(128) NOT NULL,
583
+ `app_secret` varchar(256) NOT NULL,
584
+ `exist_access` tinyint(1) NOT NULL,
585
+ `access_token` varchar(256) NOT NULL,
586
+ `order` bigint(20) DEFAULT NULL,
587
+ `published` tinyint(1) NOT NULL,
588
+ `update_mode` varchar(16) NOT NULL,
589
+ `fb_view_type` varchar(25) NOT NULL,
590
+ `theme` int(11) DEFAULT NULL,
591
+ `masonry_hor_ver` varchar(255) DEFAULT NULL,
592
+ `image_max_columns` int(11) DEFAULT NULL,
593
+ `thumb_width` int(11) DEFAULT NULL,
594
+ `thumb_height` int(11) DEFAULT NULL,
595
+ `thumb_comments` int(11) DEFAULT NULL,
596
+ `thumb_likes` int(11) DEFAULT NULL,
597
+ `thumb_name` int(11) DEFAULT NULL,
598
+ `blog_style_width` int(11) DEFAULT NULL,
599
+ `blog_style_height` varchar(15) DEFAULT NULL,
600
+ `blog_style_view_type` int(11) DEFAULT NULL,
601
+ `blog_style_comments` int(11) DEFAULT NULL,
602
+ `blog_style_likes` int(11) DEFAULT NULL,
603
+ `blog_style_message_desc` int(11) DEFAULT NULL,
604
+ `blog_style_shares` int(11) DEFAULT NULL,
605
+ `blog_style_shares_butt` int(11) DEFAULT NULL,
606
+ `blog_style_facebook` int(11) DEFAULT NULL,
607
+ `blog_style_twitter` int(11) DEFAULT NULL,
608
+ `blog_style_google` int(11) DEFAULT NULL,
609
+ `blog_style_author` int(11) DEFAULT NULL,
610
+ `blog_style_name` int(11) DEFAULT NULL,
611
+ `blog_style_place_name` int(11) DEFAULT NULL,
612
+ `fb_name` int(11) DEFAULT NULL,
613
+ `fb_plugin` int(11) DEFAULT NULL,
614
+ `album_max_columns` int(11) DEFAULT NULL,
615
+ `album_title` varchar(15) DEFAULT NULL,
616
+ `album_thumb_width` int(11) DEFAULT NULL,
617
+ `album_thumb_height` int(11) DEFAULT NULL,
618
+ `album_image_max_columns` int(11) DEFAULT NULL,
619
+ `album_image_thumb_width` int(11) DEFAULT NULL,
620
+ `album_image_thumb_height` int(11) DEFAULT NULL,
621
+ `pagination_type` int(11) DEFAULT NULL,
622
+ `objects_per_page` int(11) DEFAULT NULL,
623
+ `popup_fullscreen` int(11) DEFAULT NULL,
624
+ `popup_width` int(11) NOT NULL,
625
+ `popup_height` int(11) DEFAULT NULL,
626
+ `popup_effect` varchar(255) DEFAULT NULL,
627
+ `popup_autoplay` int(11) DEFAULT NULL,
628
+ `open_commentbox` int(11) DEFAULT NULL,
629
+ `popup_interval` int(11) DEFAULT NULL,
630
+ `popup_enable_filmstrip` int(11) DEFAULT NULL,
631
+ `popup_filmstrip_height` int(11) DEFAULT NULL,
632
+ `popup_comments` int(11) DEFAULT NULL,
633
+ `popup_likes` int(11) DEFAULT NULL,
634
+ `popup_shares` int(11) DEFAULT NULL,
635
+ `popup_author` int(11) DEFAULT NULL,
636
+ `popup_name` int(11) DEFAULT NULL,
637
+ `popup_place_name` int(11) DEFAULT NULL,
638
+ `popup_enable_ctrl_btn` int(11) DEFAULT NULL,
639
+ `popup_enable_fullscreen` int(11) DEFAULT NULL,
640
+ `popup_enable_info_btn` int(11) DEFAULT NULL,
641
+ `popup_message_desc` int(11) DEFAULT NULL,
642
+ `popup_enable_facebook` int(11) DEFAULT NULL,
643
+ `popup_enable_twitter` int(11) DEFAULT NULL,
644
+ `popup_enable_google` int(11) DEFAULT NULL,
645
+ `view_on_fb` tinyint(1) NOT NULL,
646
+ `post_text_length` bigint(20) NOT NULL,
647
+ `event_street` tinyint(1) NOT NULL,
648
+ `event_city` tinyint(1) NOT NULL,
649
+ `event_country` tinyint(1) NOT NULL,
650
+ `event_zip` tinyint(1) NOT NULL,
651
+ `event_map` tinyint(1) NOT NULL,
652
+ `event_date` tinyint(1) NOT NULL,
653
+ `event_desp_length` bigint(20) NOT NULL,
654
+ `comments_replies` tinyint(1) NOT NULL,
655
+ `comments_filter` varchar(32) NOT NULL,
656
+ `comments_order` varchar(32) NOT NULL,
657
+ `page_plugin_pos` varchar(8) NOT NULL,
658
+ `page_plugin_fans` tinyint(1) NOT NULL,
659
+ `page_plugin_cover` tinyint(1) NOT NULL,
660
+ `page_plugin_header` tinyint(1) NOT NULL,
661
+ `page_plugin_width` int(4) NOT NULL,
662
+ `image_onclick_action` varchar(32) NOT NULL,
663
+ `event_order` tinyint(4) NOT NULL,
664
+ `upcoming_events` tinyint(4) NOT NULL,
665
+ `fb_page_id` varchar(32) NOT NULL,
666
+ PRIMARY KEY (`id`)
667
+ ) " . $charset_collate . ";";
668
+
669
+ $wpdb->query($wd_fb_info);
670
  $old_version = ffwd_get_version();
671
 
672
+ if ( substr($old_version, 0, 1) === '1' ) {
673
+ $FFWD_version_compare = version_compare($old_version, '1.1.0', '<=');
 
 
674
  }
675
+ else {
676
+ $FFWD_version_compare = version_compare($old_version, '5.1.0', '<=');
 
 
 
677
  }
678
+ if ( $FFWD_version_compare ) {
679
+ $wd_fb_info_collation = "ALTER TABLE `" . $wpdb->prefix . "wd_fb_info` ADD `fb_page_id` varchar(32) NOT NULL AFTER `upcoming_events`";
680
+ $wpdb->query($wd_fb_info_collation);
 
 
681
  }
682
+ if ( substr($old_version, 0, 1) === '1' ) {
683
+ $FFWD_version_compare = version_compare($old_version, '1.0.37', '<=');
684
+ }
685
+ else {
686
+ $FFWD_version_compare = version_compare($old_version, '5.0.37', '<=');
687
+ }
688
+ if ( $FFWD_version_compare ) {
689
  $wd_fb_info_collation = "ALTER TABLE `" . $wpdb->prefix . "wd_fb_info`
690
  ADD `page_access_token` text NOT NULL AFTER `name`";
691
  $wpdb->query($wd_fb_info_collation);
692
  }
693
 
694
+ //message-i , description , name encoding --> utf16_bin
695
+ $wd_fb_data = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_data` (
696
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
697
  `fb_id` int NOT NULL,
698
  `from` varchar(32) NOT NULL,
716
  `created_time` varchar(64) NOT NULL,
717
  `updated_time` varchar(64) NOT NULL,
718
  `created_time_number` bigint(255) NOT NULL,
719
+ `reactions` text NOT NULL,
720
+ `comments` text NOT NULL,
721
+ `shares` text NOT NULL,
722
+ `attachments` text NOT NULL,
723
+ `who_post` text NOT NULL,
724
  PRIMARY KEY (`id`)
725
+ ) " . $charset_collate . ";";
726
+ $wpdb->query($wd_fb_data);
727
 
728
+ $wd_fb_data_collation = "ALTER TABLE `" . $wpdb->prefix . "wd_fb_data`
729
  MODIFY `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
730
  MODIFY `description` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin,
731
  MODIFY `message` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin
732
  ";
733
+ $wpdb->query($wd_fb_data_collation);
734
+
735
+ $wd_fb_option = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_option` (
736
+ `id` bigint(20) NOT NULL,
737
+ `autoupdate_interval` int(4) NOT NULL,
738
+ `app_id` varchar(255) NOT NULL,
739
+ `app_secret` varchar(255) NOT NULL,
740
+ `access_token` varchar(255) NOT NULL,
741
+ `date_timezone` varchar(64) NOT NULL,
742
+ `post_date_format` varchar(64) NOT NULL,
743
+ `event_date_format` varchar(64) NOT NULL
744
+ ) " . $charset_collate . ";";
 
745
  $wpdb->query($wd_fb_option);
746
 
747
  /*$ffwd_settings = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "ffwd_settings` (
748
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
749
+ `autoupdate_interval` int(4) NOT NULL,
750
  `app_id` varchar(255) NOT NULL,
751
  `app_secret` varchar(255) NOT NULL,
752
  `date_timezone` varchar(64) NOT NULL,
754
  ) DEFAULT CHARSET=utf8;";
755
  $wpdb->query($ffwd_settings);*/
756
 
757
+ $wd_fb_theme = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "wd_fb_theme` (
758
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
759
+ `name` varchar(255) NOT NULL,
760
+ `params` longtext,
761
+ `default_theme` tinyint(1) NOT NULL,
762
+ PRIMARY KEY (`id`)
763
+ ) " . $charset_collate . ";";
764
+ $wpdb->query($wd_fb_theme);
765
+
766
+ $exists_default = $wpdb->get_var('SELECT count(id) FROM ' . $wpdb->prefix . 'wd_fb_option');
767
+ if ( !$exists_default ) {
768
+ $save = $wpdb->insert($wpdb->prefix . 'wd_fb_option', array(
769
+ 'id' => 1,
770
+ 'autoupdate_interval' => 90,
771
+ 'app_id' => '',
772
+ 'date_timezone' => '',
773
+ 'access_token' => '',
774
+ 'post_date_format' => 'ago',
775
+ 'event_date_format' => 'F j, Y, g:i a',
776
+ ));
777
+ }
778
+ $exists_default = $wpdb->get_var('SELECT count(id) FROM ' . $wpdb->prefix . 'wd_fb_theme');
779
+ if ( !$exists_default ) {
780
+ $wpdb->insert($wpdb->prefix . 'wd_fb_theme', array(
781
+ 'name' => 'Theme 1',
782
+ 'default_theme' => 1,
783
+ 'params' => '{"thumb_margin":"10","thumb_padding":"2","thumb_border_radius":"0","thumb_border_width":"1","thumb_border_style":"none","thumb_border_color":"000000","thumb_bg_color":"FFFFFF","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":"100","thumb_box_shadow":"0px 0px 0px #000000","thumb_transparent":"100","thumb_align":"center","thumb_hover_effect":"scale","thumb_hover_effect_value":"2deg","thumb_transition":"1","thumb_title_font_color":"797979","thumb_title_font_style":"inherit","thumb_title_pos":"bottom","thumb_title_font_size":"14","thumb_title_font_weight":"normal","thumb_title_margin":"5","thumb_title_shadow":"","thumb_like_comm_pos":"bottom","thumb_like_comm_font_size":"14","thumb_like_comm_font_color":"FFFFFF","thumb_like_comm_font_style":"inherit","thumb_like_comm_font_weight":"normal","thumb_like_comm_shadow":"0px 0px 1px #000000","masonry_thumb_padding":"10","masonry_thumb_border_radius":"2px","masonry_thumb_border_width":"1","masonry_thumb_border_style":"solid","masonry_thumb_border_color":"FFFFFF","masonry_thumbs_bg_color":"FFFFFF","masonry_thumb_bg_transparent":"100","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"none","masonry_thumb_hover_effect_value":"1.1","masonry_thumb_transition":"1","masonry_description_font_size":"14","masonry_description_color":"A3A3A3","masonry_description_font_style":"inherit","masonry_like_comm_pos":"bottom","masonry_like_comm_font_size":"14","masonry_like_comm_font_color":"FFFFFF","masonry_like_comm_font_style":"inherit","masonry_like_comm_font_weight":"normal","masonry_like_comm_shadow":"0px 0px 1px #000000","blog_style_align":"center","blog_style_bg_color":"FFFFFF","blog_style_fd_name_bg_color":"FFFFFF","blog_style_fd_name_align":"left","blog_style_fd_name_padding":"10","blog_style_fd_name_color":"1C1C1C","blog_style_fd_name_size":"24","blog_style_fd_name_font_weight":"normal","blog_style_fd_icon":"","blog_style_fd_icon_color":"","blog_style_fd_icon_size":"","blog_style_transparent":"100","blog_style_obj_img_align":"left","blog_style_margin":"16","blog_style_box_shadow":"","blog_style_border_width":"1","blog_style_border_style":"solid","blog_style_border_color":"EBEBEB","blog_style_border_type":"top","blog_style_border_radius":"","blog_style_obj_icons_color":"gray","blog_style_obj_date_pos":"after","blog_style_obj_font_family":"inherit","blog_style_obj_info_bg_color":"FFFFFF","blog_style_page_name_color":"1C1C1C","blog_style_obj_page_name_size":"20","blog_style_obj_page_name_font_weight":"normal","blog_style_obj_story_color":"1C1C1C","blog_style_obj_story_size":"16","blog_style_obj_story_font_weight":"normal","blog_style_obj_place_color":"1C1C1C","blog_style_obj_place_size":"14","blog_style_obj_place_font_weight":"normal","blog_style_obj_name_color":"1C1C1C","blog_style_obj_name_size":"18","blog_style_obj_name_font_weight":"bold","blog_style_obj_message_color":"1C1C1C","blog_style_obj_message_size":"16","blog_style_obj_message_font_weight":"normal","blog_style_obj_hashtags_color":"000000","blog_style_obj_hashtags_size":"12","blog_style_obj_hashtags_font_weight":"normal","blog_style_obj_likes_social_bg_color":"FFFFFF","blog_style_obj_likes_social_color":"1C1C1C","blog_style_obj_likes_social_size":"14","blog_style_obj_likes_social_font_weight":"normal","blog_style_obj_comments_bg_color":"FFFFFF","blog_style_obj_comments_color":"000000","blog_style_obj_comments_font_family":"inherit","blog_style_obj_comments_font_size":"14","blog_style_obj_users_font_color":"000000","blog_style_obj_comments_social_font_weight":"normal","blog_style_obj_comment_border_width":"10","blog_style_obj_comment_border_style":"solid","blog_style_obj_comment_border_color":"FCFCFC","blog_style_obj_comment_border_type":"top","blog_style_evt_str_color":"1C1C1C","blog_style_evt_str_size":"16","blog_style_evt_str_font_weight":"normal","blog_style_evt_ctzpcn_color":"CFCFCF","blog_style_evt_ctzpcn_size":"14","blog_style_evt_ctzpcn_font_weight":"normal","blog_style_evt_map_color":"1C1C1C","blog_style_evt_map_size":"14","blog_style_evt_map_font_weight":"normal","blog_style_evt_date_color":"CFCFCF","blog_style_evt_date_size":"14","blog_style_evt_date_font_weight":"normal","blog_style_evt_info_font_family":"inherit","album_compact_back_font_color":"000000","album_compact_back_font_style":"inherit","album_compact_back_font_size":"16","album_compact_back_font_weight":"bold","album_compact_back_padding":"0","album_compact_title_font_color":"797979","album_compact_title_font_style":"inherit","album_compact_thumb_title_pos":"bottom","album_compact_title_font_size":"13","album_compact_title_font_weight":"normal","album_compact_title_margin":"2px","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_margin":"4","album_compact_thumb_padding":"0","album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":"0","album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"FFFFFF","album_compact_thumbs_bg_color":"FFFFFF","album_compact_thumb_bg_transparent":"0","album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transparent":"100","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"none","album_compact_thumb_hover_effect_value":"1.1","album_compact_thumb_transition":"0","lightbox_overlay_bg_color":"000000","lightbox_overlay_bg_transparent":"60","lightbox_bg_color":"1B1B1B","lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":"16","lightbox_ctrl_btn_margin_top":"24","lightbox_ctrl_btn_margin_left":"10","lightbox_ctrl_btn_transparent":"100","lightbox_ctrl_btn_color":"ffffff","lightbox_toggle_btn_height":"14","lightbox_toggle_btn_width":"100","lightbox_ctrl_cont_bg_color":"0A0A0A","lightbox_ctrl_cont_transparent":"100","lightbox_ctrl_cont_border_radius":"4","lightbox_close_btn_transparent":"100","lightbox_close_btn_bg_color":"000000","lightbox_close_btn_border_width":"14","lightbox_close_btn_border_radius":"24px","lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"","lightbox_close_btn_size":"12","lightbox_close_btn_width":"24","lightbox_close_btn_height":"24","lightbox_close_btn_top":"0","lightbox_close_btn_right":"-30","lightbox_close_btn_full_color":"","lightbox_rl_btn_bg_color":"000000","lightbox_rl_btn_transparent":"70","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":"0","lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"","lightbox_rl_btn_height":"36","lightbox_rl_btn_width":"36","lightbox_rl_btn_size":"16","lightbox_close_rl_btn_hover_color":"","lightbox_obj_pos":"right","lightbox_obj_width":"350","lightbox_obj_icons_color":"gray","lightbox_obj_date_pos":"after","lightbox_obj_font_family":"inherit","lightbox_obj_info_bg_color":"FFFFFF","lightbox_page_name_color":"4B4B4B","lightbox_obj_page_name_size":"18","lightbox_obj_page_name_font_weight":"bold","lightbox_obj_story_color":"4B4B4B","lightbox_obj_story_size":"16","lightbox_obj_story_font_weight":"normal","lightbox_obj_place_color":"4B4B4B","lightbox_obj_place_size":"14","lightbox_obj_place_font_weight":"normal","lightbox_obj_name_color":"4B4B4B","lightbox_obj_name_size":"14","lightbox_obj_name_font_weight":"bold","lightbox_obj_message_color":"000000","lightbox_obj_message_size":"16","lightbox_obj_message_font_weight":"normal","lightbox_obj_hashtags_color":"000000","lightbox_obj_hashtags_size":"12","lightbox_obj_hashtags_font_weight":"normal","lightbox_obj_likes_social_bg_color":"F4F5F7","lightbox_obj_likes_social_color":"000000","lightbox_obj_likes_social_size":"12","lightbox_obj_likes_social_font_weight":"normal","lightbox_obj_comments_bg_color":"FFFFFF","lightbox_obj_comments_color":"4A4A4A","lightbox_obj_comments_font_family":"inherit","lightbox_obj_comments_font_size":"16","lightbox_obj_users_font_color":"4B4B4B","lightbox_obj_comments_social_font_weight":"normal","lightbox_obj_comment_border_width":"1","lightbox_obj_comment_border_style":"none","lightbox_obj_comment_border_color":"000000","lightbox_obj_comment_border_type":"top","lightbox_filmstrip_pos":"bottom","lightbox_filmstrip_rl_bg_color":"3B3B3B","lightbox_filmstrip_rl_btn_size":"20","lightbox_filmstrip_rl_btn_color":"ffffff","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":"1","lightbox_filmstrip_thumb_border_style":"solid","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":"80","lightbox_filmstrip_thumb_active_border_width":"0","lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_rl_btn_style":"","lightbox_evt_str_color":"000000","lightbox_evt_str_size":"16","lightbox_evt_str_font_weight":"normal","lightbox_evt_ctzpcn_color":"000000","lightbox_evt_ctzpcn_size":"14","lightbox_evt_ctzpcn_font_weight":"normal","lightbox_evt_map_color":"000000","lightbox_evt_map_size":"14","lightbox_evt_map_font_weight":"normal","lightbox_evt_date_color":"000000","lightbox_evt_date_size":"14","lightbox_evt_date_font_weight":"normal","lightbox_evt_info_font_family":"inherit","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":"0","page_nav_font_size":"12","page_nav_font_style":"inherit","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":"1","page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":"100","page_nav_box_shadow":"0","page_nav_button_transition":"1","page_nav_button_text":"0","lightbox_obj_icons_color_likes_comments_count":"white"}',
784
+ ));
785
+ $wpdb->insert($wpdb->prefix . 'wd_fb_theme', array(
786
+ 'name' => 'Theme 2',
787
+ 'default_theme' => 0,
788
+ 'params' => '{"thumb_margin":"10","thumb_padding":"2","thumb_border_radius":"0px","thumb_border_width":"0","thumb_border_style":"none","thumb_border_color":"000000","thumb_bg_color":"BBCED4","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":"100","thumb_box_shadow":"0px 0px 0px #000000","thumb_transparent":"100","thumb_align":"center","thumb_hover_effect":"rotate","thumb_hover_effect_value":"1deg","thumb_transition":"1","thumb_title_font_color":"1F1F1F","thumb_title_font_style":"inherit","thumb_title_pos":"bottom","thumb_title_font_size":"14","thumb_title_font_weight":"normal","thumb_title_margin":"10","thumb_title_shadow":"","thumb_like_comm_pos":"bottom","thumb_like_comm_font_size":"14","thumb_like_comm_font_color":"FFFFFF","thumb_like_comm_font_style":"inherit","thumb_like_comm_font_weight":"normal","thumb_like_comm_shadow":"0px 0px 1px #000000","masonry_thumb_padding":"4","masonry_thumb_border_radius":"2px","masonry_thumb_border_width":"1","masonry_thumb_border_style":"solid","masonry_thumb_border_color":"FFFFFF","masonry_thumbs_bg_color":"BBCED2","masonry_thumb_bg_transparent":"100","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"scale","masonry_thumb_hover_effect_value":"1.1","masonry_thumb_transition":"1","masonry_description_font_size":"14","masonry_description_color":"1F1F1F","masonry_description_font_style":"inherit","masonry_like_comm_pos":"bottom","masonry_like_comm_font_size":"14","masonry_like_comm_font_color":"FFFFFF","masonry_like_comm_font_style":"inherit","masonry_like_comm_font_weight":"normal","masonry_like_comm_shadow":"0px 0px 1px #000000","blog_style_align":"left","blog_style_bg_color":"FFFFFF","blog_style_fd_name_bg_color":"000000","blog_style_fd_name_align":"center","blog_style_fd_name_padding":"10","blog_style_fd_name_color":"FFFFFF","blog_style_fd_name_size":"15","blog_style_fd_name_font_weight":"normal","blog_style_fd_icon":"","blog_style_fd_icon_color":"","blog_style_fd_icon_size":"","blog_style_transparent":"100","blog_style_obj_img_align":"center","blog_style_margin":"10","blog_style_box_shadow":"","blog_style_border_width":"1","blog_style_border_style":"solid","blog_style_border_color":"C9C9C9","blog_style_border_type":"top","blog_style_border_radius":"","blog_style_obj_icons_color":"gray","blog_style_obj_date_pos":"after","blog_style_obj_font_family":"inherit","blog_style_obj_info_bg_color":"FFFFFF","blog_style_page_name_color":"000000","blog_style_obj_page_name_size":"13","blog_style_obj_page_name_font_weight":"bold","blog_style_obj_story_color":"000000","blog_style_obj_story_size":"14","blog_style_obj_story_font_weight":"normal","blog_style_obj_place_color":"000000","blog_style_obj_place_size":"13","blog_style_obj_place_font_weight":"normal","blog_style_obj_name_color":"000000","blog_style_obj_name_size":"13","blog_style_obj_name_font_weight":"bold","blog_style_obj_message_color":"000000","blog_style_obj_message_size":"14","blog_style_obj_message_font_weight":"normal","blog_style_obj_hashtags_color":"000000","blog_style_obj_hashtags_size":"12","blog_style_obj_hashtags_font_weight":"normal","blog_style_obj_likes_social_bg_color":"BBCED4","blog_style_obj_likes_social_color":"656565","blog_style_obj_likes_social_size":"14","blog_style_obj_likes_social_font_weight":"normal","blog_style_obj_comments_bg_color":"FFFFFF","blog_style_obj_comments_color":"000000","blog_style_obj_comments_font_family":"inherit","blog_style_obj_comments_font_size":"14","blog_style_obj_users_font_color":"000000","blog_style_obj_comments_social_font_weight":"normal","blog_style_obj_comment_border_width":"1","blog_style_obj_comment_border_style":"solid","blog_style_obj_comment_border_color":"C9C9C9","blog_style_obj_comment_border_type":"top","blog_style_evt_str_color":"000000","blog_style_evt_str_size":"14","blog_style_evt_str_font_weight":"normal","blog_style_evt_ctzpcn_color":"000000","blog_style_evt_ctzpcn_size":"14","blog_style_evt_ctzpcn_font_weight":"normal","blog_style_evt_map_color":"000000","blog_style_evt_map_size":"14","blog_style_evt_map_font_weight":"normal","blog_style_evt_date_color":"000000","blog_style_evt_date_size":"14","blog_style_evt_date_font_weight":"normal","blog_style_evt_info_font_family":"inherit","album_compact_back_font_color":"000000","album_compact_back_font_style":"inherit","album_compact_back_font_size":"16","album_compact_back_font_weight":"bold","album_compact_back_padding":"0","album_compact_title_font_color":"797979","album_compact_title_font_style":"inherit","album_compact_thumb_title_pos":"bottom","album_compact_title_font_size":"13","album_compact_title_font_weight":"normal","album_compact_title_margin":"2px","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_margin":"0","album_compact_thumb_padding":"0","album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":"0","album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"BBCED4","album_compact_thumbs_bg_color":"FFFFFF","album_compact_thumb_bg_transparent":"0","album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transparent":"100","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"scale","album_compact_thumb_hover_effect_value":"1.1","album_compact_thumb_transition":"0","lightbox_overlay_bg_color":"000000","lightbox_overlay_bg_transparent":"70","lightbox_bg_color":"000000","lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":"20","lightbox_ctrl_btn_margin_top":"10","lightbox_ctrl_btn_margin_left":"7","lightbox_ctrl_btn_transparent":"100","lightbox_ctrl_btn_color":"ffffff","lightbox_toggle_btn_height":"14","lightbox_toggle_btn_width":"100","lightbox_ctrl_cont_bg_color":"000000","lightbox_ctrl_cont_transparent":"65","lightbox_ctrl_cont_border_radius":"4","lightbox_close_btn_transparent":"100","lightbox_close_btn_bg_color":"000000","lightbox_close_btn_border_width":"2","lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"","lightbox_close_btn_size":"10","lightbox_close_btn_width":"20","lightbox_close_btn_height":"20","lightbox_close_btn_top":"-10","lightbox_close_btn_right":"-10","lightbox_close_btn_full_color":"","lightbox_rl_btn_bg_color":"000000","lightbox_rl_btn_transparent":"80","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":"0","lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"","lightbox_rl_btn_height":"40","lightbox_rl_btn_width":"40","lightbox_rl_btn_size":"20","lightbox_close_rl_btn_hover_color":"","lightbox_obj_pos":"left","lightbox_obj_width":"350","lightbox_obj_icons_color":"gray","lightbox_obj_date_pos":"after","lightbox_obj_font_family":"inherit","lightbox_obj_info_bg_color":"E2E2E2","lightbox_page_name_color":"000000","lightbox_obj_page_name_size":"14","lightbox_obj_page_name_font_weight":"bold","lightbox_obj_story_color":"4B4B4B","lightbox_obj_story_size":"14","lightbox_obj_story_font_weight":"normal","lightbox_obj_place_color":"000000","lightbox_obj_place_size":"13","lightbox_obj_place_font_weight":"normal","lightbox_obj_name_color":"4B4B4B","lightbox_obj_name_size":"14","lightbox_obj_name_font_weight":"bold","lightbox_obj_message_color":"000000","lightbox_obj_message_size":"14","lightbox_obj_message_font_weight":"normal","lightbox_obj_hashtags_color":"000000","lightbox_obj_hashtags_size":"12","lightbox_obj_hashtags_font_weight":"normal","lightbox_obj_likes_social_bg_color":"BBCED4","lightbox_obj_likes_social_color":"FFFFFF","lightbox_obj_likes_social_size":"14","lightbox_obj_likes_social_font_weight":"normal","lightbox_obj_comments_bg_color":"EAEAEA","lightbox_obj_comments_color":"4A4A4A","lightbox_obj_comments_font_family":"inherit","lightbox_obj_comments_font_size":"14","lightbox_obj_users_font_color":"4B4B4B","lightbox_obj_comments_social_font_weight":"normal","lightbox_obj_comment_border_width":"1","lightbox_obj_comment_border_style":"solid","lightbox_obj_comment_border_color":"C9C9C9","lightbox_obj_comment_border_type":"top","lightbox_filmstrip_pos":"top","lightbox_filmstrip_rl_bg_color":"3B3B3B","lightbox_filmstrip_rl_btn_size":"20","lightbox_filmstrip_rl_btn_color":"ffffff","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":"1","lightbox_filmstrip_thumb_border_style":"solid","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":"80","lightbox_filmstrip_thumb_active_border_width":"0","lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_rl_btn_style":"","lightbox_evt_str_color":"000000","lightbox_evt_str_size":"14","lightbox_evt_str_font_weight":"normal","lightbox_evt_ctzpcn_color":"000000","lightbox_evt_ctzpcn_size":"14","lightbox_evt_ctzpcn_font_weight":"normal","lightbox_evt_map_color":"000000","lightbox_evt_map_size":"14","lightbox_evt_map_font_weight":"normal","lightbox_evt_date_color":"000000","lightbox_evt_date_size":"14","lightbox_evt_date_font_weight":"normal","lightbox_evt_info_font_family":"inherit","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":"0","page_nav_font_size":"12","page_nav_font_style":"inherit","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":"1","page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":"100","page_nav_box_shadow":"0","page_nav_button_transition":"1","page_nav_button_text":"0","lightbox_obj_icons_color_likes_comments_count":"white"}',
789
+ ));
790
+ $wpdb->insert($wpdb->prefix . 'wd_fb_theme', array(
791
+ 'name' => 'Theme 3',
792
+ 'default_theme' => 0,
793
+ 'params' => '{"thumb_margin":"10","thumb_padding":"2","thumb_border_radius":"2px","thumb_border_width":"1","thumb_border_style":"none","thumb_border_color":"000000","thumb_bg_color":"C3E0CE","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":"100","thumb_box_shadow":"0px 0px 1px #000000","thumb_transparent":"100","thumb_align":"center","thumb_hover_effect":"rotate","thumb_hover_effect_value":"2deg","thumb_transition":"1","thumb_title_font_color":"191919","thumb_title_font_style":"inherit","thumb_title_pos":"bottom","thumb_title_font_size":"14","thumb_title_font_weight":"normal","thumb_title_margin":"10","thumb_title_shadow":"","thumb_like_comm_pos":"bottom","thumb_like_comm_font_size":"14","thumb_like_comm_font_color":"FFFFFF","thumb_like_comm_font_style":"inherit","thumb_like_comm_font_weight":"normal","thumb_like_comm_shadow":"0px 0px 1px #000000","masonry_thumb_padding":"4","masonry_thumb_border_radius":"2px","masonry_thumb_border_width":"1","masonry_thumb_border_style":"solid","masonry_thumb_border_color":"FFFFFF","masonry_thumbs_bg_color":"C3E0CE","masonry_thumb_bg_transparent":"100","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"scale","masonry_thumb_hover_effect_value":"1.1","masonry_thumb_transition":"1","masonry_description_font_size":"14","masonry_description_color":"191919","masonry_description_font_style":"inherit","masonry_like_comm_pos":"bottom","masonry_like_comm_font_size":"14","masonry_like_comm_font_color":"FFFFFF","masonry_like_comm_font_style":"inherit","masonry_like_comm_font_weight":"normal","masonry_like_comm_shadow":"0px 0px 1px #000000","blog_style_align":"left","blog_style_bg_color":"FFFFFF","blog_style_fd_name_bg_color":"000000","blog_style_fd_name_align":"center","blog_style_fd_name_padding":"10","blog_style_fd_name_color":"FFFFFF","blog_style_fd_name_size":"15","blog_style_fd_name_font_weight":"normal","blog_style_fd_icon":"","blog_style_fd_icon_color":"","blog_style_fd_icon_size":"","blog_style_transparent":"100","blog_style_obj_img_align":"center","blog_style_margin":"10","blog_style_box_shadow":"","blog_style_border_width":"1","blog_style_border_style":"solid","blog_style_border_color":"C9C9C9","blog_style_border_type":"top","blog_style_border_radius":"","blog_style_obj_icons_color":"gray","blog_style_obj_date_pos":"after","blog_style_obj_font_family":"inherit","blog_style_obj_info_bg_color":"FFFFFF","blog_style_page_name_color":"000000","blog_style_obj_page_name_size":"13","blog_style_obj_page_name_font_weight":"bold","blog_style_obj_story_color":"000000","blog_style_obj_story_size":"14","blog_style_obj_story_font_weight":"normal","blog_style_obj_place_color":"000000","blog_style_obj_place_size":"13","blog_style_obj_place_font_weight":"normal","blog_style_obj_name_color":"000000","blog_style_obj_name_size":"13","blog_style_obj_name_font_weight":"bold","blog_style_obj_message_color":"000000","blog_style_obj_message_size":"14","blog_style_obj_message_font_weight":"normal","blog_style_obj_hashtags_color":"000000","blog_style_obj_hashtags_size":"12","blog_style_obj_hashtags_font_weight":"normal","blog_style_obj_likes_social_bg_color":"C3E0CE","blog_style_obj_likes_social_color":"656565","blog_style_obj_likes_social_size":"14","blog_style_obj_likes_social_font_weight":"normal","blog_style_obj_comments_bg_color":"FFFFFF","blog_style_obj_comments_color":"000000","blog_style_obj_comments_font_family":"inherit","blog_style_obj_comments_font_size":"14","blog_style_obj_users_font_color":"000000","blog_style_obj_comments_social_font_weight":"normal","blog_style_obj_comment_border_width":"1","blog_style_obj_comment_border_style":"solid","blog_style_obj_comment_border_color":"C9C9C9","blog_style_obj_comment_border_type":"top","blog_style_evt_str_color":"000000","blog_style_evt_str_size":"14","blog_style_evt_str_font_weight":"normal","blog_style_evt_ctzpcn_color":"000000","blog_style_evt_ctzpcn_size":"14","blog_style_evt_ctzpcn_font_weight":"normal","blog_style_evt_map_color":"000000","blog_style_evt_map_size":"14","blog_style_evt_map_font_weight":"normal","blog_style_evt_date_color":"000000","blog_style_evt_date_size":"14","blog_style_evt_date_font_weight":"normal","blog_style_evt_info_font_family":"inherit","album_compact_back_font_color":"000000","album_compact_back_font_style":"inherit","album_compact_back_font_size":"16","album_compact_back_font_weight":"bold","album_compact_back_padding":"0","album_compact_title_font_color":"191919","album_compact_title_font_style":"inherit","album_compact_thumb_title_pos":"bottom","album_compact_title_font_size":"13","album_compact_title_font_weight":"normal","album_compact_title_margin":"2px","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_margin":"4","album_compact_thumb_padding":"0","album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":"0","album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"C3E0CE","album_compact_thumbs_bg_color":"FFFFFF","album_compact_thumb_bg_transparent":"0","album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transparent":"100","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"scale","album_compact_thumb_hover_effect_value":"1.1","album_compact_thumb_transition":"0","lightbox_overlay_bg_color":"000000","lightbox_overlay_bg_transparent":"70","lightbox_bg_color":"000000","lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":"20","lightbox_ctrl_btn_margin_top":"10","lightbox_ctrl_btn_margin_left":"7","lightbox_ctrl_btn_transparent":"100","lightbox_ctrl_btn_color":"ffffff","lightbox_toggle_btn_height":"14","lightbox_toggle_btn_width":"100","lightbox_ctrl_cont_bg_color":"000000","lightbox_ctrl_cont_transparent":"65","lightbox_ctrl_cont_border_radius":"4","lightbox_close_btn_transparent":"100","lightbox_close_btn_bg_color":"000000","lightbox_close_btn_border_width":"2","lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"","lightbox_close_btn_size":"10","lightbox_close_btn_width":"20","lightbox_close_btn_height":"20","lightbox_close_btn_top":"-10","lightbox_close_btn_right":"-10","lightbox_close_btn_full_color":"","lightbox_rl_btn_bg_color":"000000","lightbox_rl_btn_transparent":"80","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":"0","lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"","lightbox_rl_btn_height":"40","lightbox_rl_btn_width":"40","lightbox_rl_btn_size":"20","lightbox_close_rl_btn_hover_color":"","lightbox_obj_pos":"left","lightbox_obj_width":"350","lightbox_obj_icons_color":"gray","lightbox_obj_date_pos":"after","lightbox_obj_font_family":"inherit","lightbox_obj_info_bg_color":"E2E2E2","lightbox_page_name_color":"4B4B4B","lightbox_obj_page_name_size":"14","lightbox_obj_page_name_font_weight":"bold","lightbox_obj_story_color":"4B4B4B","lightbox_obj_story_size":"14","lightbox_obj_story_font_weight":"normal","lightbox_obj_place_color":"000000","lightbox_obj_place_size":"13","lightbox_obj_place_font_weight":"normal","lightbox_obj_name_color":"4B4B4B","lightbox_obj_name_size":"14","lightbox_obj_name_font_weight":"bold","lightbox_obj_message_color":"000000","lightbox_obj_message_size":"14","lightbox_obj_message_font_weight":"normal","lightbox_obj_hashtags_color":"000000","lightbox_obj_hashtags_size":"12","lightbox_obj_hashtags_font_weight":"normal","lightbox_obj_likes_social_bg_color":"C3E0CE","lightbox_obj_likes_social_color":"FFFFFF","lightbox_obj_likes_social_size":"14","lightbox_obj_likes_social_font_weight":"normal","lightbox_obj_comments_bg_color":"EAEAEA","lightbox_obj_comments_color":"4A4A4A","lightbox_obj_comments_font_family":"inherit","lightbox_obj_comments_font_size":"14","lightbox_obj_users_font_color":"4B4B4B","lightbox_obj_comments_social_font_weight":"normal","lightbox_obj_comment_border_width":"1","lightbox_obj_comment_border_style":"solid","lightbox_obj_comment_border_color":"C9C9C9","lightbox_obj_comment_border_type":"top","lightbox_filmstrip_pos":"top","lightbox_filmstrip_rl_bg_color":"3B3B3B","lightbox_filmstrip_rl_btn_size":"20","lightbox_filmstrip_rl_btn_color":"ffffff","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":"1","lightbox_filmstrip_thumb_border_style":"solid","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":"80","lightbox_filmstrip_thumb_active_border_width":"0","lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_rl_btn_style":"","lightbox_evt_str_color":"000000","lightbox_evt_str_size":"14","lightbox_evt_str_font_weight":"normal","lightbox_evt_ctzpcn_color":"000000","lightbox_evt_ctzpcn_size":"14","lightbox_evt_ctzpcn_font_weight":"normal","lightbox_evt_map_color":"000000","lightbox_evt_map_size":"14","lightbox_evt_map_font_weight":"normal","lightbox_evt_date_color":"000000","lightbox_evt_date_size":"14","lightbox_evt_date_font_weight":"normal","lightbox_evt_info_font_family":"inherit","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":"0","page_nav_font_size":"12","page_nav_font_style":"inherit","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":"1","page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":"100","page_nav_box_shadow":"0","page_nav_button_transition":"1","page_nav_button_text":"0","lightbox_obj_icons_color_likes_comments_count":"white"}',
794
+ ));
795
+ $wpdb->insert($wpdb->prefix . 'wd_fb_theme', array(
796
+ 'name' => 'Theme 4',
797
+ 'default_theme' => 0,
798
+ 'params' => '{"thumb_margin":"10","thumb_padding":"2","thumb_border_radius":"2px","thumb_border_width":"1","thumb_border_style":"none","thumb_border_color":"000000","thumb_bg_color":"CFC3DB","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":"100","thumb_box_shadow":"0px 0px 1px #000000","thumb_transparent":"100","thumb_align":"center","thumb_hover_effect":"rotate","thumb_hover_effect_value":"2deg","thumb_transition":"1","thumb_title_font_color":"191919","thumb_title_font_style":"inherit","thumb_title_pos":"bottom","thumb_title_font_size":"14","thumb_title_font_weight":"normal","thumb_title_margin":"10","thumb_title_shadow":"","thumb_like_comm_pos":"bottom","thumb_like_comm_font_size":"14","thumb_like_comm_font_color":"FFFFFF","thumb_like_comm_font_style":"inherit","thumb_like_comm_font_weight":"normal","thumb_like_comm_shadow":"0px 0px 1px #000000","masonry_thumb_padding":"4","masonry_thumb_border_radius":"2px","masonry_thumb_border_width":"1","masonry_thumb_border_style":"solid","masonry_thumb_border_color":"FFFFFF","masonry_thumbs_bg_color":"CFC3DB","masonry_thumb_bg_transparent":"100","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"scale","masonry_thumb_hover_effect_value":"1.1","masonry_thumb_transition":"1","masonry_description_font_size":"14","masonry_description_color":"191919","masonry_description_font_style":"inherit","masonry_like_comm_pos":"bottom","masonry_like_comm_font_size":"14","masonry_like_comm_font_color":"FFFFFF","masonry_like_comm_font_style":"inherit","masonry_like_comm_font_weight":"normal","masonry_like_comm_shadow":"0px 0px 1px #000000","blog_style_align":"left","blog_style_bg_color":"FFFFFF","blog_style_fd_name_bg_color":"000000","blog_style_fd_name_align":"center","blog_style_fd_name_padding":"10","blog_style_fd_name_color":"FFFFFF","blog_style_fd_name_size":"15","blog_style_fd_name_font_weight":"normal","blog_style_fd_icon":"","blog_style_fd_icon_color":"","blog_style_fd_icon_size":"","blog_style_transparent":"100","blog_style_obj_img_align":"center","blog_style_margin":"10","blog_style_box_shadow":"","blog_style_border_width":"1","blog_style_border_style":"solid","blog_style_border_color":"C9C9C9","blog_style_border_type":"top","blog_style_border_radius":"","blog_style_obj_icons_color":"gray","blog_style_obj_date_pos":"after","blog_style_obj_font_family":"inherit","blog_style_obj_info_bg_color":"FFFFFF","blog_style_page_name_color":"000000","blog_style_obj_page_name_size":"13","blog_style_obj_page_name_font_weight":"bold","blog_style_obj_story_color":"000000","blog_style_obj_story_size":"14","blog_style_obj_story_font_weight":"normal","blog_style_obj_place_color":"000000","blog_style_obj_place_size":"13","blog_style_obj_place_font_weight":"normal","blog_style_obj_name_color":"000000","blog_style_obj_name_size":"13","blog_style_obj_name_font_weight":"bold","blog_style_obj_message_color":"000000","blog_style_obj_message_size":"14","blog_style_obj_message_font_weight":"normal","blog_style_obj_hashtags_color":"000000","blog_style_obj_hashtags_size":"12","blog_style_obj_hashtags_font_weight":"normal","blog_style_obj_likes_social_bg_color":"CFC3DB","blog_style_obj_likes_social_color":"656565","blog_style_obj_likes_social_size":"14","blog_style_obj_likes_social_font_weight":"normal","blog_style_obj_comments_bg_color":"FFFFFF","blog_style_obj_comments_color":"000000","blog_style_obj_comments_font_family":"inherit","blog_style_obj_comments_font_size":"14","blog_style_obj_users_font_color":"000000","blog_style_obj_comments_social_font_weight":"normal","blog_style_obj_comment_border_width":"1","blog_style_obj_comment_border_style":"solid","blog_style_obj_comment_border_color":"C9C9C9","blog_style_obj_comment_border_type":"top","blog_style_evt_str_color":"000000","blog_style_evt_str_size":"14","blog_style_evt_str_font_weight":"normal","blog_style_evt_ctzpcn_color":"000000","blog_style_evt_ctzpcn_size":"14","blog_style_evt_ctzpcn_font_weight":"normal","blog_style_evt_map_color":"000000","blog_style_evt_map_size":"14","blog_style_evt_map_font_weight":"normal","blog_style_evt_date_color":"000000","blog_style_evt_date_size":"14","blog_style_evt_date_font_weight":"normal","blog_style_evt_info_font_family":"inherit","album_compact_back_font_color":"000000","album_compact_back_font_style":"inherit","album_compact_back_font_size":"16","album_compact_back_font_weight":"bold","album_compact_back_padding":"0","album_compact_title_font_color":"191919","album_compact_title_font_style":"inherit","album_compact_thumb_title_pos":"bottom","album_compact_title_font_size":"13","album_compact_title_font_weight":"normal","album_compact_title_margin":"2px","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_margin":"0","album_compact_thumb_padding":"0","album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":"0","album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"CFC3DB","album_compact_thumbs_bg_color":"FFFFFF","album_compact_thumb_bg_transparent":"0","album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transparent":"100","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"scale","album_compact_thumb_hover_effect_value":"1.1","album_compact_thumb_transition":"0","lightbox_overlay_bg_color":"000000","lightbox_overlay_bg_transparent":"70","lightbox_bg_color":"000000","lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":"20","lightbox_ctrl_btn_margin_top":"10","lightbox_ctrl_btn_margin_left":"7","lightbox_ctrl_btn_transparent":"100","lightbox_ctrl_btn_color":"ffffff","lightbox_toggle_btn_height":"14","lightbox_toggle_btn_width":"100","lightbox_ctrl_cont_bg_color":"000000","lightbox_ctrl_cont_transparent":"65","lightbox_ctrl_cont_border_radius":"4","lightbox_close_btn_transparent":"100","lightbox_close_btn_bg_color":"000000","lightbox_close_btn_border_width":"2","lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"","lightbox_close_btn_size":"10","lightbox_close_btn_width":"20","lightbox_close_btn_height":"20","lightbox_close_btn_top":"-10","lightbox_close_btn_right":"-10","lightbox_close_btn_full_color":"","lightbox_rl_btn_bg_color":"000000","lightbox_rl_btn_transparent":"80","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":"0","lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"","lightbox_rl_btn_height":"40","lightbox_rl_btn_width":"40","lightbox_rl_btn_size":"20","lightbox_close_rl_btn_hover_color":"","lightbox_obj_pos":"left","lightbox_obj_width":"350","lightbox_obj_icons_color":"gray","lightbox_obj_date_pos":"after","lightbox_obj_font_family":"inherit","lightbox_obj_info_bg_color":"E2E2E2","lightbox_page_name_color":"4B4B4B","lightbox_obj_page_name_size":"14","lightbox_obj_page_name_font_weight":"bold","lightbox_obj_story_color":"4B4B4B","lightbox_obj_story_size":"14","lightbox_obj_story_font_weight":"normal","lightbox_obj_place_color":"000000","lightbox_obj_place_size":"13","lightbox_obj_place_font_weight":"normal","lightbox_obj_name_color":"4B4B4B","lightbox_obj_name_size":"14","lightbox_obj_name_font_weight":"bold","lightbox_obj_message_color":"000000","lightbox_obj_message_size":"14","lightbox_obj_message_font_weight":"normal","lightbox_obj_hashtags_color":"000000","lightbox_obj_hashtags_size":"12","lightbox_obj_hashtags_font_weight":"normal","lightbox_obj_likes_social_bg_color":"CFC3DB","lightbox_obj_likes_social_color":"FFFFFF","lightbox_obj_likes_social_size":"14","lightbox_obj_likes_social_font_weight":"normal","lightbox_obj_comments_bg_color":"EAEAEA","lightbox_obj_comments_color":"4A4A4A","lightbox_obj_comments_font_family":"inherit","lightbox_obj_comments_font_size":"14","lightbox_obj_users_font_color":"4B4B4B","lightbox_obj_comments_social_font_weight":"normal","lightbox_obj_comment_border_width":"1","lightbox_obj_comment_border_style":"solid","lightbox_obj_comment_border_color":"C9C9C9","lightbox_obj_comment_border_type":"top","lightbox_filmstrip_pos":"top","lightbox_filmstrip_rl_bg_color":"3B3B3B","lightbox_filmstrip_rl_btn_size":"20","lightbox_filmstrip_rl_btn_color":"ffffff","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":"1","lightbox_filmstrip_thumb_border_style":"solid","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":"80","lightbox_filmstrip_thumb_active_border_width":"0","lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_rl_btn_style":"","lightbox_evt_str_color":"000000","lightbox_evt_str_size":"14","lightbox_evt_str_font_weight":"normal","lightbox_evt_ctzpcn_color":"000000","lightbox_evt_ctzpcn_size":"14","lightbox_evt_ctzpcn_font_weight":"normal","lightbox_evt_map_color":"000000","lightbox_evt_map_size":"14","lightbox_evt_map_font_weight":"normal","lightbox_evt_date_color":"000000","lightbox_evt_date_size":"14","lightbox_evt_date_font_weight":"normal","lightbox_evt_info_font_family":"inherit","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":"0","page_nav_font_size":"12","page_nav_font_style":"inherit","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":"1","page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":"100","page_nav_box_shadow":"0","page_nav_button_transition":"1","page_nav_button_text":"0","lightbox_obj_icons_color_likes_comments_count":"white"}',
799
+ ));
800
+ }
801
+ wp_schedule_event(time(), 'wd_fb_autoupdate_interval', 'wd_fb_schedule_event_hook');
802
+ ffwd_version();
 
 
 
 
 
 
 
 
 
 
 
 
803
  }
804
 
805
  register_activation_hook(__FILE__, 'ffwd_activate');
806
 
 
807
  /* On deactivation, remove all functions from the scheduled action hook.*/
808
+ function ffwd_deactivate() {
809
+ wp_clear_scheduled_hook('wd_fb_schedule_event_hook');
 
810
  }
811
 
812
  register_deactivation_hook(__FILE__, 'ffwd_deactivate');
820
  }
821
 
822
  // Plugin scripts.
823
+ function ffwd_scripts() {
824
+ wp_enqueue_script('thickbox');
825
+ wp_enqueue_script('ffwd_cache', WD_FFWD_URL . '/js/ffwd_cache.js', array(), ffwd_get_version());
826
+ wp_localize_script('ffwd_cache', 'ffwd_cache', array(
827
+ 'ajax_url' => admin_url('admin-ajax.php'),
828
+ 'update_data' => defined('FFWD_FEED_DATA') ? FFWD_FEED_DATA : '',
829
+ 'need_update' => FFWD_NEED_UPDATE_CACHE
830
+ ));
831
+
832
+ wp_enqueue_script('ffwd_admin', WD_FFWD_URL . '/js/ffwd.js', array(), ffwd_get_version());
833
+
834
+ global $wp_scripts;
835
+ if ( isset($wp_scripts->registered['jquery']) ) {
836
+ $jquery = $wp_scripts->registered['jquery'];
837
+ if ( !isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<') ) {
838
+ wp_deregister_script('jquery');
839
+ wp_register_script('jquery', FALSE, array( 'jquery-core', 'jquery-migrate' ), '1.10.2');
840
  }
841
+ }
842
+ wp_enqueue_script('jquery');
843
+ wp_enqueue_script('jquery-ui-sortable');
844
  }
845
 
846
  /* Add pagination to gallery admin pages.*/
847
+ function ffwd_add_ffwd_info_per_page_option() {
848
+ $option = 'per_page';
849
+ $args_galleries = array(
850
+ 'label' => 'Items',
851
+ 'default' => 20,
852
+ 'option' => 'ffwd_info_per_page',
853
+ );
854
+ add_screen_option($option, $args_galleries);
 
855
  }
856
 
857
+ function ffwd_add_themes_per_page_option() {
858
+ $option = 'per_page';
859
+ $args_themes = array(
860
+ 'label' => 'Themes',
861
+ 'default' => 20,
862
+ 'option' => 'ffwd_themes_per_page',
863
+ );
864
+ add_screen_option($option, $args_themes);
 
865
  }
866
 
867
  add_filter('set-screen-option', 'ffwd_set_option_galleries', 10, 3);
868
  add_filter('set-screen-option', 'ffwd_set_option_themes', 10, 3);
869
+ function ffwd_set_option_galleries( $status, $option, $value ) {
870
+ if ( 'ffwd_info_per_page' == $option ) {
871
+ return $value;
872
+ }
873
 
874
+ return $status;
 
 
 
 
 
 
875
  }
876
 
877
+ function ffwd_set_option_themes( $status, $option, $value ) {
878
+ if ( 'ffwd_themes_per_page' == $option ) {
879
+ return $value;
880
+ }
 
881
 
882
+ return $status;
883
  }
884
+
885
  function ffwd_enqueue__admin_scripts(){
886
  wp_enqueue_script( 'ffwd_jquery_form_js', WD_FFWD_URL . '/js/jquery.form.js', array(), ffwd_get_version() );
887
  }
888
 
889
+ function ffwd_admin_scripts() {
890
+ wp_enqueue_script('thickbox');
891
+
892
+ /*TODO no need as called from ffwd_scripts() function the same */
893
+ wp_enqueue_script('ffwd_cache', WD_FFWD_URL . '/js/ffwd_cache.js', array(), ffwd_get_version());
894
+ wp_localize_script('ffwd_cache', 'ffwd_cache', array(
895
+ 'ajax_url' => admin_url('admin-ajax.php'),
896
+ 'update_data' => defined('FFWD_FEED_DATA') ? FFWD_FEED_DATA : '',
897
+ 'need_update' => FFWD_NEED_UPDATE_CACHE
898
+ ));
899
+
900
+ wp_enqueue_script('ffwd_admin', WD_FFWD_URL . '/js/ffwd.js', array(), ffwd_get_version());
901
+ wp_localize_script('ffwd_admin', 'ffwd_ajax', array(
902
+ 'ajax_url' => admin_url('admin-ajax.php'),
903
+ 'ajaxnonce' => wp_create_nonce(WD_FFWD_URL . '_ajax_nonce'),
904
+ ));
905
+
906
+
907
+ global $wp_scripts;
908
+ if ( isset($wp_scripts->registered['jquery']) ) {
909
+ $jquery = $wp_scripts->registered['jquery'];
910
+ if ( !isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<') ) {
911
+ wp_deregister_script('jquery');
912
+ wp_register_script('jquery', FALSE, array( 'jquery-core', 'jquery-migrate' ), '1.10.2');
913
  }
914
+ }
915
+ wp_enqueue_script('jquery');
916
+ wp_enqueue_script('jscolor', WD_FFWD_URL . '/js/jscolor/jscolor.js', array(), '1.3.9');
917
  }
918
 
919
+ function ffwd_front_end_scripts() {
920
+ $version = ffwd_get_version();
921
+ global $wp_scripts;
922
+ if ( isset($wp_scripts->registered['jquery']) ) {
923
+ $jquery = $wp_scripts->registered['jquery'];
924
+ if ( !isset($jquery->ver) OR version_compare($jquery->ver, '1.8.2', '<') ) {
925
+ wp_deregister_script('jquery');
926
+ wp_register_script('jquery', FALSE, array( 'jquery-core', 'jquery-migrate' ), '1.10.2');
 
 
927
  }
928
+ }
929
+ wp_enqueue_script('jquery');
930
+ wp_enqueue_script('ffwd_cache', WD_FFWD_URL . '/js/ffwd_cache.js', array(), ffwd_get_version());
931
+ wp_localize_script('ffwd_cache', 'ffwd_cache', array(
932
+ 'ajax_url' => admin_url('admin-ajax.php'),
933
+ 'update_data' => defined('FFWD_FEED_DATA') ? FFWD_FEED_DATA : '',
934
+ 'need_update' => FFWD_NEED_UPDATE_CACHE
935
+ ));
936
+
937
+ wp_enqueue_script('ffwd_frontend', WD_FFWD_FRONT_URL . '/js/ffwd_frontend.js', array(), $version);
938
+ wp_enqueue_style('ffwd_frontend', WD_FFWD_FRONT_URL . '/css/ffwd_frontend.css', array(), $version);
939
+ // Styles/Scripts for popup.
940
+ wp_enqueue_style('ffwd_fonts', WD_FFWD_FRONT_URL . '/css/fonts.css', array(), $version);
941
+ wp_enqueue_script('ffwd_jquery_mobile', WD_FFWD_FRONT_URL . '/js/jquery.mobile.js', array(), $version);
942
+ wp_enqueue_script('ffwd_mCustomScrollbar', WD_FFWD_FRONT_URL . '/js/jquery.mCustomScrollbar.concat.min.js', array(), $version);
943
+ wp_enqueue_style('ffwd_mCustomScrollbar', WD_FFWD_FRONT_URL . '/css/jquery.mCustomScrollbar.css', array(), $version);
944
+ wp_enqueue_script('jquery-fullscreen', WD_FFWD_FRONT_URL . '/js/jquery.fullscreen-0.4.1.js', array(), '0.4.1');
945
+ wp_enqueue_script('ffwd_gallery_box', WD_FFWD_FRONT_URL . '/js/ffwd_gallery_box.js', array(), $version);
946
+ wp_localize_script('ffwd_gallery_box', 'ffwd_objectL10n', array(
947
+ 'ffwd_field_required' => __('field is required.', 'bwg'),
948
+ 'ffwd_mail_validation' => __('This is not a valid email address.', 'bwg'),
949
+ 'ffwd_search_result' => __('There are no images matching your search.', 'bwg'),
950
+ ));
951
+ wp_localize_script('ffwd_frontend', 'ffwd_frontend_text', array(
952
+ 'comment_reply' => __('Reply', 'ffwd'),
953
+ 'view' => __('View', 'ffwd'),
954
+ 'more_comments' => __('more comments', 'ffwd'),
955
+ 'year' => __('year', 'ffwd'),
956
+ 'years' => __('years', 'ffwd'),
957
+ 'hour' => __('hour', 'ffwd'),
958
+ 'hours' => __('hours', 'ffwd'),
959
+ 'months' => __('months', 'ffwd'),
960
+ 'month' => __('month', 'ffwd'),
961
+ 'weeks' => __('weeks', 'ffwd'),
962
+ 'week' => __('week', 'ffwd'),
963
+ 'days' => __('days', 'ffwd'),
964
+ 'day' => __('day', 'ffwd'),
965
+ 'minutes' => __('minutes', 'ffwd'),
966
+ 'minute' => __('minute', 'ffwd'),
967
+ 'seconds' => __('seconds', 'ffwd'),
968
+ 'second' => __('second', 'ffwd'),
969
+ 'ago' => __('ago', 'ffwd'),
970
+ 'ajax_url' => admin_url('admin-ajax.php'),
971
+ 'and' => __('and', 'ffwd'),
972
+ 'others' => __('others', 'ffwd'),
973
+ ));
 
974
  }
975
 
 
976
  add_action( 'admin_enqueue_scripts', 'ffwd_enqueue__admin_scripts' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
977
 
978
+ /* Check every time from frontend and backend if need update token/data */
979
+ function ffwd_check_cache_update() {
980
+ global $wpdb;
981
+ require_once(WD_FFWD_DIR . '/framework/WDFacebookFeed.php');
982
+ $current_time = current_time('timestamp');
983
+ $update_time = get_option('ffwd_autoupdate_time');
984
+ $autoupdate_interval = WDFacebookFeed::get_autoupdate_interval();
985
+ if ( $current_time >= $update_time ) {
 
 
 
986
  update_option('ffwd_autoupdate_time', $autoupdate_interval * 60 + $current_time);
987
+ $ff_wd_options = get_option('ffwd_pages_list');
 
 
 
988
  if ( !empty($ff_wd_options) ) {
989
+ foreach ( $ff_wd_options as $ff_wd_option ) {
990
+ $token = $ff_wd_option->access_token;
991
+ $page_id = $ff_wd_option->id;
992
+ WDFacebookFeed::update_page_access_token($token, $page_id);
993
+ }
994
  }
995
  $query = "SELECT * FROM " . $wpdb->prefix . "wd_fb_info WHERE `update_mode` <> 'no_update'";
996
  $rows = $wpdb->get_results($query);
997
+ if ( !defined('FFWD_FEED_DATA') ) {
998
+ define('FFWD_FEED_DATA', json_encode($rows));
999
+ }
1000
+ if ( !defined('FFWD_NEED_UPDATE_CACHE') ) {
1001
+ define('FFWD_NEED_UPDATE_CACHE', 'true');
1002
+ }
1003
+ return;
1004
+ } else {
1005
+ if ( !defined('FFWD_NEED_UPDATE_CACHE') ) {
1006
+ define('FFWD_NEED_UPDATE_CACHE', 'false');
1007
+ }
1008
+ }
1009
+
1010
+ $query = "SELECT * FROM " . $wpdb->prefix . "wd_fb_info";
1011
+ $rows = $wpdb->get_results($query, ARRAY_A);
1012
+ foreach ( $rows as $key => $val ) {
1013
+ $query = "SELECT count(`id`) FROM " . $wpdb->prefix . "wd_fb_data WHERE `fb_id` = ".$val['id'];
1014
+ $count = $wpdb->get_var($query);
1015
+ $rows[$key]['data_count'] = $count;
1016
+ }
1017
+ if ( !defined('FFWD_FEED_DATA') ) {
1018
+ define('FFWD_FEED_DATA', json_encode($rows));
1019
+ }
1020
+ return;
1021
  }
1022
+ add_action('init', 'ffwd_check_cache_update');
1023
 
1024
  // Check Valid Token and show message
1025
  $ffwd_token_error_flag = get_option("ffwd_token_error_flag");
1064
  return register_widget("FFWDControllerWidget");
1065
  }
1066
 
 
1067
  // Languages localization.
1068
+ function ffwd_language_load() {
1069
+ load_plugin_textdomain('ffwd', false, basename(dirname(__FILE__)) . '/languages');
 
1070
  }
1071
 
1072
  add_action('init', 'ffwd_language_load');
1073
+ function ffwd_version() {
1074
+ $version = FFWD_VERSION;
1075
+ if ( get_option('ffwd_version') === FALSE ) {
1076
+ add_option('ffwd_version', $version);
1077
+ }
1078
+ else {
1079
+ update_option('ffwd_version', $version);
1080
+ }
1081
 
1082
+ return $version;
 
 
 
 
 
 
 
 
 
 
 
1083
  }
1084
 
1085
+ function ffwd_get_version() {
1086
+ if ( get_option('ffwd_version') === FALSE ) {
1087
+ ffwd_version();
1088
+ }
 
1089
 
1090
+ return get_option('ffwd_version');
1091
  }
1092
 
1093
+ if ( !class_exists('Linkify') ) {
1094
+ include_once WD_FFWD_DIR . '/framework/linkify/LinkifyInterface.php';
1095
+ include_once WD_FFWD_DIR . '/framework/linkify/Linkify.php';
1096
  }
1097
 
1098
  /*ELEMENTOR*/
1099
  add_action('plugins_loaded', 'ffwd_elementor');
1100
+ function ffwd_elementor() {
1101
+ if ( defined('ELEMENTOR_VERSION') ) {
1102
  include_once 'elementor/elementor.php';
1103
  FFWDElementor::get_instance();
1104
  }
1105
  }
 
framework/WDFacebookFeed.php CHANGED
@@ -18,7 +18,8 @@ class WDFacebookFeed {
18
  // For collapse timeline data matching content requirements
19
  protected static $complite_timeline_data = array();
20
  // Maximum graph call integer for timeline type
21
- protected static $timeline_max_call_count = 10;
 
22
  protected static $valid_content = array('statuses', 'photos', 'videos', 'links', 'events', 'albums');
23
  protected static $access_token;
24
  protected static $event_order;
@@ -27,9 +28,15 @@ class WDFacebookFeed {
27
  protected static $auto_update_feed = 0;
28
  protected static $updateOnVersionChange = false;
29
 
 
 
 
 
 
30
  // Existing app ids and app secrets
31
  protected static $access_tokens = array();
32
  private static $ffwd_fb_massage = true;
 
33
  protected static $save = true;
34
  protected static $edit_feed = false;
35
  protected static $update_mode = 'keep_old';
@@ -38,9 +45,6 @@ class WDFacebookFeed {
38
 
39
  public static $client_side_check = array();
40
 
41
- public function __construct() {
42
- }
43
-
44
  public static function execute() {
45
  if (function_exists('current_user_can')) {
46
  if (!current_user_can('manage_options')) {
@@ -209,24 +213,21 @@ class WDFacebookFeed {
209
  $delete_query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'wd_fb_data WHERE fb_id="%d"', self::$fb_id);
210
  $delete = $wpdb->query($delete_query);
211
  if ( $delete === FALSE ) {
212
- self::wd_fb_massage('error', 'Something went wrong (trying delete wd_fb_data)');
213
- }
214
- else {
215
- $data = self::$data['data'];
216
- self::insert_wd_fb_data($data);
217
  }
218
  }
219
- self::wd_fb_massage('success', self::$fb_id);
 
220
  }
221
  else {
222
- self::wd_fb_massage('error', 'Something went wrong (trying edit feed)');
 
223
  }
224
  }
225
 
226
- function insert_wd_fb_info_options($options) {
227
- global $wpdb;
228
- }
229
-
230
  /**
231
  * Update Facebook Feed Options
232
  *
@@ -316,7 +317,6 @@ class WDFacebookFeed {
316
  }
317
 
318
  // Prepare to delete
319
-
320
  public static function prepare_to_delete($rows = array()) {
321
  foreach ($rows as $row) {
322
  self::$fb_id = isset($row->id) ? $row->id : '';
@@ -358,140 +358,123 @@ class WDFacebookFeed {
358
  }
359
 
360
  // Auto update
361
- public static function update_from_shedule($rows = array())
362
- {
363
- self::$save = false;
364
- self::$edit_feed = false;
365
- self::$auto_update_feed = 1;
366
- foreach ($rows as $row) {
367
- self::$fb_id = isset($row->id) ? $row->id : '';
368
- self::$fb_type = isset($row->type) ? $row->type : '';
369
- self::$content_type = isset($row->content_type) ? $row->content_type : '';
370
- self::$content = isset($row->content) ? explode(",", $row->content) : array();
371
- self::$content_url = isset($row->content_url) ? $row->content_url : '';
372
- self::$timeline_type = isset($row->timeline_type) ? $row->timeline_type : 'posts';
373
- self::$limit = isset($row->limit) ? $row->limit : '';
374
- self::$id = isset($row->from) ? $row->from : '';
375
- self::$access_token = isset($row->page_access_token) ? $row->page_access_token : '';
376
- self::$update_mode = isset($row->update_mode) ? $row->update_mode : self::$update_mode;
377
- $function_name = self::$content_type;
378
- self::$function_name();
379
- }
380
  }
 
381
 
382
  // updateOnVersionChange
383
- public static function updateOnVersionChange($rows = array())
384
- {
385
-
386
- self::$save = false;
387
- self::$edit_feed = false;
388
- self::$auto_update_feed = 0;
389
- self::$updateOnVersionChange = true;
390
-
391
- foreach ($rows as $row) {
392
- self::$fb_id = isset($row->id) ? $row->id : '';
393
- self::$fb_type = isset($row->type) ? $row->type : '';
394
- self::$content_type = isset($row->content_type) ? $row->content_type : '';
395
- self::$content = isset($row->content) ? explode(",", $row->content) : array();
396
- self::$content_url = isset($row->content_url) ? $row->content_url : '';
397
- self::$timeline_type = isset($row->timeline_type) ? $row->timeline_type : 'posts';
398
- self::$limit = isset($row->limit) ? $row->limit : '';
399
- self::$id = isset($row->from) ? $row->from : '';
400
- self::$access_token = isset($row->page_access_token) ? $row->page_access_token : '';
401
- self::$update_mode = isset($row->update_mode) ? $row->update_mode : self::$update_mode;
402
- $function_name = self::$content_type;
403
- self::$function_name();
404
-
405
 
406
- }
 
 
407
  }
 
 
 
 
 
 
 
 
 
408
 
409
- public static function update_db()
410
- {
411
- if(!isset(self::$data['data'])){
412
- return;
 
 
 
 
 
 
413
  }
414
- global $wpdb;
415
- $data = self::$data['data'];
416
- $id = self::$fb_id;
417
-
418
-
419
- $rows = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wd_fb_data WHERE fb_id="%d" ORDER BY `created_time_number` ASC ', $id));
420
- $to_drop = array();
421
- $to_insert = array();
422
- $del_count = 0;
423
- // Store content array as string.
424
-
425
- $content = implode(",", self::$content);
426
- foreach ($data as $next) {
427
- // @todo API v10.0
428
- $next['type'] = 'photo';
429
-
430
- $exists = false;
431
- $is_newer_then_any_of_olds = true;
432
- $created_time = array_key_exists('created_time', $next) ? strtotime($next['created_time']) : '';
433
- $created_time = ($created_time == '' && array_key_exists('start_time', $next)) ? strtotime($next['start_time']) : $created_time;
434
- foreach ($rows as $row) {
435
- if ($row->object_id == $next['id']) {
436
- $exists = true;
437
- }
438
-
439
- if ($created_time < $row->created_time_number) {
440
- $is_newer_then_any_of_olds = false;
441
- }
442
- }
443
-
444
- if (!$exists && $is_newer_then_any_of_olds) {
445
- if (self::$content_type == 'timeline') {
446
- $from = array_key_exists('from', $next) ? $next['from']['id'] : '';
447
- if (strpos($content, $next['type']) === false) {
448
- continue;
449
- }
450
-
451
- if (self::$timeline_type == "posts" && self::$fb_type != 'group') {
452
- if ($from != self::$id) {
453
- continue;
454
- }
455
- }
456
- else if (self::$timeline_type == "others") {
457
- if ($from == self::$id) {
458
- continue;
459
- }
460
- }
461
- }
462
- array_push($to_insert, $next);
463
- }
464
  }
465
- $exist_count = count($rows);
466
- $insert_count = count($to_insert);
467
- if ((self::$update_mode == 'remove_old') && ($insert_count + $exist_count) > self::$limit) {
468
- $del_count = ($insert_count + $exist_count) - self::$limit;
469
- $ids = array();
470
- $results = $wpdb->get_results($wpdb->prepare('SELECT `id` FROM `' . $wpdb->prefix . 'wd_fb_data` WHERE `fb_id` = "%d" ORDER BY `created_time_number` ASC LIMIT ' . $del_count, self::$fb_id));
471
- foreach ($results as $row) {
472
- array_push($ids, $row->id);
 
 
473
  }
474
- $ids = implode(',', $ids);
475
- $delete = $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'wd_fb_data WHERE `id` IN (' . $ids . ') AND `fb_id` = "%d"', self::$fb_id));
 
 
 
 
 
 
476
  }
477
 
478
- if ($insert_count) {
479
-
480
- self::insert_wd_fb_data($to_insert);
481
- }
482
  }
483
-
484
- public static function update_version()
485
- {
486
- global $wpdb;
487
- $data = self::$data['data'];
488
- $id = self::$fb_id;
489
- $delete = $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'wd_fb_data WHERE `fb_id` = "%d"', self::$fb_id));
490
-
491
-
492
- self::insert_wd_fb_data($data);
493
-
 
 
 
494
  }
 
 
 
 
 
 
 
 
495
 
496
  public static function page() {
497
  $page_id = isset($_POST['fb_page_id']) ? sanitize_text_field($_POST['fb_page_id']) : 0;
@@ -521,173 +504,203 @@ class WDFacebookFeed {
521
  self::$function_name();
522
  }
523
 
524
- public static function group()
525
- {
526
- self::$content_url = ((isset($_POST['content_url'])) ? sanitize_text_field(stripslashes($_POST['content_url'])) : '');
527
- self::$limit = ((isset($_POST['limit'])) ? sanitize_text_field(stripslashes($_POST['limit'])) : '');
528
- self::check_fb_group_url();
529
- self::set_content();
530
- self::set_access_token();
531
- self::timeline();
532
 
533
- }
 
 
 
 
 
 
 
 
534
 
535
- public static function profile()
536
- {
537
- self::$content_url = '';
538
- self::$limit = ((isset($_POST['limit'])) ? sanitize_text_field(stripslashes($_POST['limit'])) : '');
539
- self::check_fb_user();
540
- self::set_content();
541
- self::set_access_token();
542
- $function_name = self::$content_type;
543
- self::$function_name();
 
 
 
 
544
  }
 
 
 
 
 
 
 
 
 
 
545
 
546
- public static function check_fb_user()
547
- {
548
- //if (!class_exists('Facebook'))
549
- include WD_FFWD_DIR . "/framework/facebook-sdk/src/Facebook/autoload.php";
550
- global $wpdb;
551
- $fb_option_data = self::get_fb_option_data();
552
- $app_id = $fb_option_data->app_id;
553
- $app_secret = $fb_option_data->app_secret;
554
- self::$facebook_sdk = new Facebook\Facebook(array(
555
- 'app_id' => $app_id,
556
- 'app_secret' => $app_secret,
557
- ));
558
-
559
- $user_profile = 0;
560
- if (isset($_SESSION['facebook_access_token'])) {
561
- $user_profile = self::$facebook_sdk->get('/me', $_SESSION['facebook_access_token']);
562
- $user_profile = $user_profile->getDecodedBody();
563
-
564
- }
565
-
566
- //$user = self::$facebook_sdk->getUser();
567
- if ($user_profile)
568
- $user_id = $user_profile['id'];
569
-
570
 
571
- if (!$user_id) {
572
- self::wd_fb_massage('error', 'Please login first');
573
- } else {
574
 
575
- self::$id = $user_id;
576
- }
 
 
 
 
 
 
 
577
  }
 
 
 
 
578
 
579
- public static function get_fb_option_data()
580
- {
581
- global $wpdb;
582
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wd_fb_option WHERE id="%d"', 1));
583
-
584
- return $row;
585
  }
 
 
 
 
 
 
 
586
 
587
- public static function set_content() {
588
- $content_type = ((isset($_POST['content_type'])) ? sanitize_text_field(stripslashes($_POST['content_type'])) : '');
589
- $content = (isset($_POST['content'])) ? $_POST['content'] : array();
590
- self::$event_order = ((isset($_POST['event_order'])) ? sanitize_text_field(stripslashes($_POST['event_order'])) : 0);
591
- self::$upcoming_events = ((isset($_POST['upcoming_events'])) ? sanitize_text_field(stripslashes($_POST['upcoming_events'])) : 0);
592
- self::$content_type = in_array($content_type, self::$valid_content_types) ? $content_type : false;
593
- // If right content type
594
- if (self::$content_type) {
595
- self::$content = $content;
 
 
 
 
 
 
 
 
 
596
  }
597
  else {
598
- self::wd_fb_massage('error', 'Invalid content type');
599
  }
600
- }
601
-
602
- public static function set_access_token()
603
- {
604
- if(isset($_POST["page_access_token"]) && $_POST["page_access_token"] != ""){
605
- self::$access_token = $_POST["page_access_token"];
606
- self::$exist_access = true;
607
- }else{
608
- if(!isset(self::$access_token) || empty(self::$access_token)){
609
  $rand_key = array_rand(self::$access_tokens);
610
- self::$access_token = self::$access_tokens[$rand_key];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
611
  }
612
  }
613
  }
614
-
615
- public static function check_fb_page_url()
616
- {
617
- $first_token = strtok(self::$content_url, '/');
618
- $second_token = strtok('/');
619
- $third_token = strtok('/');
620
- $fourth = strtok('/');
621
- $fifth = strtok('/');
622
- // Check if it's facebook url
623
- if ($second_token === 'www.facebook.com') {
624
- if ($third_token == 'pages') {
625
- $fifth = explode('?', $fifth);
626
- self::$id = $fifth[0];
627
- } else {
628
- // If page's id not showing in url (trying to get id by it's name)
629
- $third_token = explode('-', $third_token);
630
- if (count($third_token) > 0) {
631
- $last = count($third_token) - 1;
632
- $name_id = $third_token[$last];
633
- } else
634
- $name_id = $third_token[0];
635
- // If not set access token , get random from our's
636
- if (empty(self::$access_token)) {
637
- $rand_key = array_rand(self::$access_tokens);
638
- $access_token = self::$access_tokens[$rand_key];
639
- } else {
640
- $access_token = self::$access_token;
641
- }
642
-
643
- // Get data (including page id) by graph url
644
- $fb_graph_url = str_replace(
645
- array('{FB_ID}', '{EDGE}', '{ACCESS_TOKEN}', '{FIELDS}', '{LIMIT}', '{OTHER}'),
646
- array($name_id, '', 'access_token=' . $access_token . '&', 'fields=id&', 'limit=10', ''),
647
- self::$graph_url
648
- );
649
-
650
- $data = self::decap_do_curl($fb_graph_url);
651
- // Check id existing
652
- if (array_key_exists("id", $data)) {
653
- self::$id = $data['id'];
654
- } // Check if exist error
655
- else if (array_key_exists("error", $data)) {
656
- if ($data['error']['code'] == 4)
657
- update_option('ffwd_limit_notice', 1);
658
- self::wd_fb_massage('error', $data['error']['message']);
659
- }
660
- }
661
- } else
662
- self::wd_fb_massage('error', 'not Facebook url');
663
  }
 
664
 
665
- public static function check_fb_group_url()
666
- {
667
- // Help tool for find your group id http://lookup-id.com/
668
- $first_token = strtok(self::$content_url, '/');
669
- $id = $first_token;
670
- // If not set access token , get random from our's
671
- $rand_key = array_rand(self::$access_tokens);
672
- $access_token = self::$access_tokens[$rand_key];
673
- $fb_graph_url = str_replace(
674
- array('{FB_ID}', '{EDGE}', '{ACCESS_TOKEN}', '{FIELDS}', '{LIMIT}', '{OTHER}'),
675
- array($id, '', 'access_token=' . $access_token . '&', '', '', ''),
676
- self::$graph_url
677
- );
678
- // Check if no errors with that id
679
- $data = self::decap_do_curl($fb_graph_url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
 
681
- if (array_key_exists("error", $data)) {
682
- if ($data['error']['code'] == 4)
683
- update_option('ffwd_limit_notice', 1);
684
- self::wd_fb_massage('error', $data['error']['message']);
685
- } else {
686
- self::$id = $id;
687
 
688
- return;
689
- }
 
 
 
 
 
 
 
 
 
 
690
  }
 
 
691
 
692
  /**
693
  * Set timeline type.
@@ -697,101 +710,199 @@ class WDFacebookFeed {
697
  * Replace params in graph url.
698
  */
699
  public static function timeline() {
700
- global $wpdb;
 
 
 
 
701
  self::set_timeline_type();
702
  self::$complite_timeline_data = array();
703
- $data = array();
704
  self::set_access_token();
705
- $edge = (self::$fb_type == 'group') ? 'feed' : ((self::$timeline_type == 'feed' || self::$timeline_type == 'others') ? 'feed' : 'posts');
706
- // @todo v3.3 api
707
- // $fields = 'fields=event,comments.limit(25).summary(true){parent.fields(id),created_time,from,like_count,message,comment_count},attachments,shares,id,name,story,link,created_time,updated_time,from{picture,name,link},message,type,source,place,message_tags,story_tags,status_type,privacy&';
708
- $fields = 'fields=id,status_type,message,message_tags,shares,place,story,story_tags,privacy,attachments{media_type,media,url},from{picture,name,link},event,comments.limit(25).summary(true){parent.fields(id),created_time,from,like_count,comment_count},created_time,updated_time&';
709
- $fb_graph_url = str_replace(
710
- array(
711
- '{FB_ID}',
712
- '{EDGE}',
713
- '{ACCESS_TOKEN}',
714
- '{FIELDS}',
715
- '{LIMIT}',
716
- '{OTHER}'
717
- ),
718
- array(
719
- self::$id,
720
- $edge,
721
- 'access_token=' . self::$access_token . '&',
722
- $fields,
723
- 'locale=' . get_locale() . '&limit=100&',
724
- ''
725
- ),
726
- self::$graph_url
727
- );
728
-
729
- if ( self::$auto_update_feed == 1 ) {
730
- $id = self::$fb_id;
731
- $update_ids = array();
732
- $rows = $wpdb->get_results($wpdb->prepare('SELECT object_id, id FROM ' . $wpdb->prefix . 'wd_fb_data WHERE fb_id="%d" ORDER BY `created_time_number` ASC ', $id));
733
- foreach ( $rows as $row ) {
734
- $update_ids[$row->object_id] = $row->id;
735
- }
736
- $fb_graph_url_update = $fb_graph_url;
737
- $update_data = self::decap_do_curl($fb_graph_url_update);
738
- self::update_wd_fb_data($update_data, $update_ids);
739
- }
740
-
741
- $data['data'] = self::complite_timeline($fb_graph_url);
742
-
743
- self::$data = $data;
744
  if ( self::$save ) {
745
- self::save_db();
746
  }
747
  else {
748
  if ( self::$edit_feed ) {
749
- self::edit_feed();
750
  }
751
  else {
752
  if ( self::$updateOnVersionChange ) {
753
- self::update_version();
754
  }
755
  else {
756
- self::update_db();
 
757
  }
758
  }
759
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
760
  }
761
 
762
  /**
763
- * Getting count of posts which are have media type link and not available
764
- *
765
- * @param $datas array posts which we got from endpoint
766
- *
767
- * @return int
768
  */
769
- public static function get_link_type_count( $datas ) {
770
- if( !empty($datas) ) {
771
- $count = 0;
772
- foreach ( $datas as $data ) {
773
- if ( !empty($data['attachments']) && !empty($data['attachments']['data'][0]) && $data['attachments']['data'][0]['media_type'] == 'link' && empty($data['attachments']['data'][0]['media']) ) {
774
- $count++;
775
- }
776
- }
 
 
777
  }
778
- return $count;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
779
  }
780
 
781
- public static function complite_timeline( $fb_graph_url ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
782
  $content = implode(',', self::$content);
783
  if ( !empty(self::$content) ) {
 
784
  $content = '';
785
  foreach ( self::$content as $val ) {
786
  if ( $val == 'photos') {
787
- $content .= 'photo,album,';
788
  }
789
  if ( $val == 'videos') {
790
  $content .= 'video,';
791
  }
792
  if ( $val == 'links') {
793
  $content .= 'link,';
794
- }
 
 
 
795
  }
796
  $content = trim($content, ',');
797
  }
@@ -818,7 +929,7 @@ class WDFacebookFeed {
818
  // Set next page if it exists
819
  $paging = array_key_exists('paging', $data) ? $data['paging'] : array();
820
  $next_page = array_key_exists('next', $paging) ? $paging['next'] : 0;
821
-
822
  foreach ( $post_data as $next ) {
823
  // @todo v10.0 api new logic.
824
  if ( !empty($next['attachments']['data']) && !empty($next['attachments']['data'][0]) ) {
@@ -849,25 +960,46 @@ class WDFacebookFeed {
849
  array_push(self::$complite_timeline_data, $next);
850
  // }
851
  }
 
852
  // @todo what was this for?
853
  // intval(count(self::$complite_timeline_data)) <= intval(self::$limit) &&
854
- if ( self::$timeline_max_call_count > 0 && $next_page ) {
855
  self::$timeline_max_call_count--;
856
 
857
  return self::complite_timeline($next_page);
858
  }
859
  else {
860
  return self::$complite_timeline_data;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
861
  }
862
  }
863
  }
 
864
  }
865
 
866
  public static function update_wd_fb_data( $data, $ids ) {
867
  global $wpdb;
868
- $content = implode(",", self::$content);
869
- $success = 'no_data';
870
  if ( !empty($data['data']) ) {
 
 
 
871
  foreach ( $data['data'] as $key => $next ) {
872
  $object_id = $next['id'];
873
  // @TODO type is deprecated V3.3
@@ -895,7 +1027,6 @@ class WDFacebookFeed {
895
  $width = '';
896
  $height = '';
897
  $attachments = (!empty($next['attachments']['data'][0])) ? $next['attachments']['data'][0] : array();
898
-
899
  if( !self::check_post_type( self::$content, $next ) ) {
900
  continue;
901
  }
@@ -1102,6 +1233,10 @@ class WDFacebookFeed {
1102
  * @return bool
1103
  */
1104
  public static function check_post_type( $post_types, $post_data ) {
 
 
 
 
1105
  $media_type = (!empty($post_data['attachments']['data'][0])) ? $post_data['attachments']['data'][0]['media_type'] : '';
1106
  foreach ( $post_types as $post_type ) {
1107
  if ( $post_type == "statuses" ) {
@@ -1124,6 +1259,11 @@ class WDFacebookFeed {
1124
  return true;
1125
  }
1126
  }
 
 
 
 
 
1127
  }
1128
  return FALSE;
1129
  }
@@ -1139,14 +1279,10 @@ class WDFacebookFeed {
1139
  }
1140
 
1141
  public static function filter_upcoming_events( $data ) {
1142
-
1143
  foreach ( $data['data'] as $key => $event ) {
1144
-
1145
  $event_start_time = strtotime($event['start_time']);
1146
- $now = strtotime(date("Y-m-d H:i:s"));
1147
  if ( $event_start_time < $now ) {
1148
-
1149
-
1150
  unset($data['data'][$key]);
1151
  }
1152
  }
@@ -1187,11 +1323,6 @@ class WDFacebookFeed {
1187
  // Collapse content types (multiple when content type is timeline, one when specific)
1188
  $content = implode(",", self::$content);
1189
  $from = self::$id;
1190
- $data = self::$data['data'];
1191
- // If there is no data
1192
- if ( ! count($data) ) {
1193
- self::wd_fb_massage('error', 'There is no data matching your choice.');
1194
- }
1195
 
1196
  $ffwd_info_options = array();
1197
  $ffwd_info_options['theme'] = ((isset($_POST['theme'])) ? sanitize_text_field(stripslashes($_POST['theme'])) : '');
@@ -1380,17 +1511,30 @@ class WDFacebookFeed {
1380
  * first and only value of self::$content array.
1381
  * Escape paging in self::data
1382
  */
1383
- self::$fb_id = $wpdb->insert_id;
1384
- if ( $save_fb_info !== false ) {
1385
 
1386
- self::insert_wd_fb_data($data);
1387
- self::insert_wd_fb_info_options($ffwd_info_options);
 
 
1388
  }
1389
  else {
1390
- self::wd_fb_massage('error', 'Problem with save fb feed');
 
1391
  }
1392
  }
1393
 
 
 
 
 
 
 
 
 
 
 
 
 
1394
  /**
1395
  * Insert data from facebook response to DataBase
1396
  *
@@ -1400,7 +1544,6 @@ class WDFacebookFeed {
1400
 
1401
  global $wpdb;
1402
  $success = 'no_data';
1403
- $content = implode(',', self::$content);
1404
  if ( self::$content_type == 'specific' && self::$content[0] == 'events' ) {
1405
  $start_time = array();
1406
  foreach ($data as $key => $event) {
@@ -1421,6 +1564,7 @@ class WDFacebookFeed {
1421
  }
1422
  array_multisort($start_time, SORT_DESC, $data);
1423
  }
 
1424
  foreach ( $data as $key => $next ) {
1425
  $type = '';
1426
  $source = '';
@@ -1609,8 +1753,8 @@ class WDFacebookFeed {
1609
  $created_time_number = ($created_time != '') ? strtotime($created_time) : 0;
1610
  $insert_data = array(
1611
  'fb_id' => self::$fb_id,
1612
- 'object_id' => $object_id,
1613
- 'from' => $from,
1614
  'name' => $name,
1615
  'description' => $description,
1616
  'type' => $type,
@@ -1794,15 +1938,10 @@ class WDFacebookFeed {
1794
  public static function wd_fb_massage($mood, $massage)
1795
  {
1796
  if(self::$ffwd_fb_massage){
1797
- echo json_encode(array($mood, $massage, self::$non_public_share_count));
1798
  self::$ffwd_fb_massage = false;
1799
-
1800
- if ( is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX )
1801
- {
1802
- wp_die();
1803
- }
1804
  }else{
1805
- return;
1806
  }
1807
  }
1808
 
@@ -1897,11 +2036,9 @@ class WDFacebookFeed {
1897
  $data->access_token = $ffwd_user_access_token;
1898
  }
1899
  }
1900
-
1901
-
1902
  update_option('ffwd_pages_list', $datas);
1903
  update_option("ffwd_pages_list_success", "1");
1904
- update_option('ffwd_token_error_flag', "0");
1905
  self::update_access_tokens();
1906
 
1907
  }
18
  // For collapse timeline data matching content requirements
19
  protected static $complite_timeline_data = array();
20
  // Maximum graph call integer for timeline type
21
+ protected static $timeline_max_call_count = WD_FB_TIMELINE_MAX_CALL_COUNT;
22
+ protected static $next_page = '';
23
  protected static $valid_content = array('statuses', 'photos', 'videos', 'links', 'events', 'albums');
24
  protected static $access_token;
25
  protected static $event_order;
28
  protected static $auto_update_feed = 0;
29
  protected static $updateOnVersionChange = false;
30
 
31
+
32
+ protected static $wd_fb_error_massage = '';
33
+ protected static $ajax_cache_action = '';
34
+
35
+
36
  // Existing app ids and app secrets
37
  protected static $access_tokens = array();
38
  private static $ffwd_fb_massage = true;
39
+ private static $ffwd_fb_massage_response = '';
40
  protected static $save = true;
41
  protected static $edit_feed = false;
42
  protected static $update_mode = 'keep_old';
45
 
46
  public static $client_side_check = array();
47
 
 
 
 
48
  public static function execute() {
49
  if (function_exists('current_user_can')) {
50
  if (!current_user_can('manage_options')) {
213
  $delete_query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'wd_fb_data WHERE fb_id="%d"', self::$fb_id);
214
  $delete = $wpdb->query($delete_query);
215
  if ( $delete === FALSE ) {
216
+ self::$wd_fb_error_massage = json_encode(array('status'=>'error','msg'=>'Something went wrong (trying delete wd_fb_data)'));
217
+ return false;
218
+ } else {
219
+ self::$ajax_cache_action = "set_cache_data";
 
220
  }
221
  }
222
+ self::$ajax_cache_action = "set_cache_data";
223
+ return self::$fb_id;
224
  }
225
  else {
226
+ self::$wd_fb_error_massage = json_encode(array('status'=>'error','msg'=>'Something went wrong (trying edit feed)'));
227
+ return false;
228
  }
229
  }
230
 
 
 
 
 
231
  /**
232
  * Update Facebook Feed Options
233
  *
317
  }
318
 
319
  // Prepare to delete
 
320
  public static function prepare_to_delete($rows = array()) {
321
  foreach ($rows as $row) {
322
  self::$fb_id = isset($row->id) ? $row->id : '';
358
  }
359
 
360
  // Auto update
361
+ public static function update_from_shedule( $rows = array() ) {
362
+ self::$save = FALSE;
363
+ self::$edit_feed = FALSE;
364
+ self::$auto_update_feed = 1;
365
+ foreach ( $rows as $row ) {
366
+ self::$fb_id = isset($row->id) ? $row->id : '';
367
+ self::$fb_type = isset($row->type) ? $row->type : '';
368
+ self::$content_type = isset($row->content_type) ? $row->content_type : '';
369
+ self::$content = isset($row->content) ? explode(",", $row->content) : array();
370
+ self::$content_url = isset($row->content_url) ? $row->content_url : '';
371
+ self::$timeline_type = isset($row->timeline_type) ? $row->timeline_type : 'posts';
372
+ self::$limit = isset($row->limit) ? $row->limit : '';
373
+ self::$id = isset($row->from) ? $row->from : '';
374
+ self::$access_token = isset($row->page_access_token) ? $row->page_access_token : '';
375
+ self::$update_mode = isset($row->update_mode) ? $row->update_mode : self::$update_mode;
376
+ $function_name = self::$content_type;
377
+ self::$function_name();
 
 
378
  }
379
+ }
380
 
381
  // updateOnVersionChange
382
+ public static function updateOnVersionChange( $rows = array() ) {
383
+ self::$save = FALSE;
384
+ self::$edit_feed = FALSE;
385
+ self::$auto_update_feed = 0;
386
+ self::$updateOnVersionChange = TRUE;
387
+ foreach ( $rows as $row ) {
388
+ self::$fb_id = isset($row->id) ? $row->id : '';
389
+ self::$fb_type = isset($row->type) ? $row->type : '';
390
+ self::$content_type = isset($row->content_type) ? $row->content_type : '';
391
+ self::$content = isset($row->content) ? explode(",", $row->content) : array();
392
+ self::$content_url = isset($row->content_url) ? $row->content_url : '';
393
+ self::$timeline_type = isset($row->timeline_type) ? $row->timeline_type : 'posts';
394
+ self::$limit = isset($row->limit) ? $row->limit : '';
395
+ self::$id = isset($row->from) ? $row->from : '';
396
+ self::$access_token = isset($row->page_access_token) ? $row->page_access_token : '';
397
+ self::$update_mode = isset($row->update_mode) ? $row->update_mode : self::$update_mode;
398
+ $function_name = self::$content_type;
399
+ self::$function_name();
400
+ }
401
+ }
 
 
402
 
403
+ public static function update_db() {
404
+ if ( !isset(self::$data['data']) ) {
405
+ return;
406
  }
407
+ global $wpdb;
408
+ $data = self::$data['data'];
409
+ $id = self::$fb_id;
410
+ $rows = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wd_fb_data WHERE fb_id="%d" ORDER BY `created_time_number` ASC ', $id));
411
+ $to_drop = array();
412
+ $to_insert = array();
413
+ $del_count = 0;
414
+ // Store content array as string.
415
+ $content = implode(",", self::$content);
416
 
417
+ foreach ( $data as $next ) {
418
+ // @todo API v10.0
419
+ $next['type'] = 'photos';
420
+ $exists = FALSE;
421
+ $is_newer_then_any_of_olds = TRUE;
422
+ $created_time = array_key_exists('created_time', $next) ? strtotime($next['created_time']) : '';
423
+ $created_time = ($created_time == '' && array_key_exists('start_time', $next)) ? strtotime($next['start_time']) : $created_time;
424
+ foreach ( $rows as $row ) {
425
+ if ( $row->object_id == $next['id'] ) {
426
+ $exists = TRUE;
427
  }
428
+ if ( $exists && $created_time < $row->created_time_number ) {
429
+ $is_newer_then_any_of_olds = FALSE;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
430
  }
431
+ }
432
+ if ( !$exists && $is_newer_then_any_of_olds ) {
433
+ if ( self::$content_type == 'timeline' ) {
434
+ $from = array_key_exists('from', $next) ? $next['from']['id'] : '';
435
+ if ( strpos($content, $next['type']) === FALSE ) {
436
+ continue;
437
+ }
438
+ if ( self::$timeline_type == "posts" && self::$fb_type != 'group' ) {
439
+ if ( $from != self::$id ) {
440
+ continue;
441
  }
442
+ }
443
+ else {
444
+ if ( self::$timeline_type == "others" ) {
445
+ if ( $from == self::$id ) {
446
+ continue;
447
+ }
448
+ }
449
+ }
450
  }
451
 
452
+ array_push($to_insert, $next);
453
+ }
 
 
454
  }
455
+ $exist_count = count($rows);
456
+ $insert_count = count($to_insert);
457
+ if ( (self::$update_mode == 'remove_old') && ($insert_count + $exist_count) > self::$limit ) {
458
+ $del_count = ($insert_count + $exist_count) - self::$limit;
459
+ $ids = array();
460
+ $results = $wpdb->get_results($wpdb->prepare('SELECT `id` FROM `' . $wpdb->prefix . 'wd_fb_data` WHERE `fb_id` = "%d" ORDER BY `created_time_number` ASC LIMIT ' . $del_count, self::$fb_id));
461
+ foreach ( $results as $row ) {
462
+ array_push($ids, $row->id);
463
+ }
464
+ $ids = implode(',', $ids);
465
+ $delete = $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'wd_fb_data WHERE `id` IN (' . $ids . ') AND `fb_id` = "%d"', self::$fb_id));
466
+ }
467
+ if ( $insert_count ) {
468
+ self::insert_wd_fb_data($to_insert);
469
  }
470
+ }
471
+
472
+ public static function update_version() {
473
+ global $wpdb;
474
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'wd_fb_data WHERE `fb_id` = "%d"', self::$fb_id));
475
+ self::$ajax_cache_action = "set_cache_data";
476
+ return self::$fb_id;
477
+ }
478
 
479
  public static function page() {
480
  $page_id = isset($_POST['fb_page_id']) ? sanitize_text_field($_POST['fb_page_id']) : 0;
504
  self::$function_name();
505
  }
506
 
507
+ public static function group() {
508
+ self::$content_url = ((isset($_POST['content_url'])) ? sanitize_text_field(stripslashes($_POST['content_url'])) : '');
509
+ self::$limit = ((isset($_POST['limit'])) ? sanitize_text_field(stripslashes($_POST['limit'])) : '');
510
+ self::check_fb_group_url();
511
+ self::set_content();
512
+ self::set_access_token();
513
+ self::timeline();
514
+ }
515
 
516
+ public static function profile() {
517
+ self::$content_url = '';
518
+ self::$limit = ((isset($_POST['limit'])) ? sanitize_text_field(stripslashes($_POST['limit'])) : '');
519
+ self::check_fb_user();
520
+ self::set_content();
521
+ self::set_access_token();
522
+ $function_name = self::$content_type;
523
+ self::$function_name();
524
+ }
525
 
526
+ public static function check_fb_user() {
527
+ include WD_FFWD_DIR . '/framework/facebook-sdk/src/Facebook/autoload.php';
528
+ $fb_option_data = self::get_fb_option_data();
529
+ $app_id = $fb_option_data->app_id;
530
+ $app_secret = $fb_option_data->app_secret;
531
+ self::$facebook_sdk = new Facebook\Facebook(array(
532
+ 'app_id' => $app_id,
533
+ 'app_secret' => $app_secret,
534
+ ));
535
+ $user_profile = 0;
536
+ if ( isset($_SESSION['facebook_access_token']) ) {
537
+ $user_profile = self::$facebook_sdk->get('/me', $_SESSION['facebook_access_token']);
538
+ $user_profile = $user_profile->getDecodedBody();
539
  }
540
+ if ( $user_profile ) {
541
+ $user_id = $user_profile['id'];
542
+ }
543
+ if ( !$user_id ) {
544
+ self::wd_fb_massage('error', 'Please login first');
545
+ }
546
+ else {
547
+ self::$id = $user_id;
548
+ }
549
+ }
550
 
551
+ public static function get_fb_option_data() {
552
+ global $wpdb;
553
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wd_fb_option WHERE id="%d"', 1));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
 
555
+ return $row;
556
+ }
 
557
 
558
+ public static function set_content() {
559
+ $content_type = ((isset($_POST['content_type'])) ? sanitize_text_field(stripslashes($_POST['content_type'])) : '');
560
+ $content = (isset($_POST['content'])) ? $_POST['content'] : array();
561
+ self::$event_order = ((isset($_POST['event_order'])) ? sanitize_text_field(stripslashes($_POST['event_order'])) : 0);
562
+ self::$upcoming_events = ((isset($_POST['upcoming_events'])) ? sanitize_text_field(stripslashes($_POST['upcoming_events'])) : 0);
563
+ self::$content_type = in_array($content_type, self::$valid_content_types) ? $content_type : FALSE;
564
+ // If right content type
565
+ if ( self::$content_type ) {
566
+ self::$content = $content;
567
  }
568
+ else {
569
+ self::wd_fb_massage('error', 'Invalid content type');
570
+ }
571
+ }
572
 
573
+ public static function set_access_token() {
574
+ if ( isset($_POST["page_access_token"]) && $_POST["page_access_token"] != "" ) {
575
+ self::$access_token = $_POST["page_access_token"];
576
+ self::$exist_access = TRUE;
 
 
577
  }
578
+ else {
579
+ if ( !isset(self::$access_token) || empty(self::$access_token) ) {
580
+ $rand_key = array_rand(self::$access_tokens);
581
+ self::$access_token = self::$access_tokens[$rand_key];
582
+ }
583
+ }
584
+ }
585
 
586
+ public static function check_fb_page_url() {
587
+ $first_token = strtok(self::$content_url, '/');
588
+ $second_token = strtok('/');
589
+ $third_token = strtok('/');
590
+ $fourth = strtok('/');
591
+ $fifth = strtok('/');
592
+ // Check if it's facebook url
593
+ if ( $second_token === 'www.facebook.com' ) {
594
+ if ( $third_token == 'pages' ) {
595
+ $fifth = explode('?', $fifth);
596
+ self::$id = $fifth[0];
597
+ }
598
+ else {
599
+ // If page's id not showing in url (trying to get id by it's name)
600
+ $third_token = explode('-', $third_token);
601
+ if ( count($third_token) > 0 ) {
602
+ $last = count($third_token) - 1;
603
+ $name_id = $third_token[$last];
604
  }
605
  else {
606
+ $name_id = $third_token[0];
607
  }
608
+ // If not set access token , get random from our's
609
+ if ( empty(self::$access_token) ) {
 
 
 
 
 
 
 
610
  $rand_key = array_rand(self::$access_tokens);
611
+ $access_token = self::$access_tokens[$rand_key];
612
+ }
613
+ else {
614
+ $access_token = self::$access_token;
615
+ }
616
+ // Get data (including page id) by graph url
617
+ $fb_graph_url = str_replace(array(
618
+ '{FB_ID}',
619
+ '{EDGE}',
620
+ '{ACCESS_TOKEN}',
621
+ '{FIELDS}',
622
+ '{LIMIT}',
623
+ '{OTHER}',
624
+ ), array(
625
+ $name_id,
626
+ '',
627
+ 'access_token=' . $access_token . '&',
628
+ 'fields=id&',
629
+ 'limit=10',
630
+ '',
631
+ ), self::$graph_url);
632
+ $data = self::decap_do_curl($fb_graph_url);
633
+ // Check id existing
634
+ if ( array_key_exists("id", $data) ) {
635
+ self::$id = $data['id'];
636
+ } // Check if exist error
637
+ else {
638
+ if ( array_key_exists("error", $data) ) {
639
+ if ( $data['error']['code'] == 4 ) {
640
+ update_option('ffwd_limit_notice', 1);
641
+ }
642
+ self::wd_fb_massage('error', $data['error']['message']);
643
+ }
644
  }
645
  }
646
  }
647
+ else {
648
+ self::wd_fb_massage('error', 'not Facebook url');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
649
  }
650
+ }
651
 
652
+ public static function check_fb_group_url() {
653
+ // Help tool for find your group id http://lookup-id.com/
654
+ $first_token = strtok(self::$content_url, '/');
655
+ $id = $first_token;
656
+ // If not set access token , get random from our's
657
+ $rand_key = array_rand(self::$access_tokens);
658
+ $access_token = self::$access_tokens[$rand_key];
659
+ $fb_graph_url = str_replace(array(
660
+ '{FB_ID}',
661
+ '{EDGE}',
662
+ '{ACCESS_TOKEN}',
663
+ '{FIELDS}',
664
+ '{LIMIT}',
665
+ '{OTHER}',
666
+ ), array(
667
+ $id,
668
+ '',
669
+ 'access_token=' . $access_token . '&',
670
+ '',
671
+ '',
672
+ '',
673
+ ), self::$graph_url);
674
+ // Check if no errors with that id
675
+ $data = self::decap_do_curl($fb_graph_url);
676
+ if ( array_key_exists("error", $data) ) {
677
+ if ( $data['error']['code'] == 4 ) {
678
+ update_option('ffwd_limit_notice', 1);
679
+ }
680
+ self::wd_fb_massage('error', $data['error']['message']);
681
+ }
682
+ else {
683
+ self::$id = $id;
684
 
685
+ return;
686
+ }
687
+ }
 
 
 
688
 
689
+ /**
690
+ * Check if data exists for feed in DB
691
+ *
692
+ * @param $feed_id int feed id
693
+ *
694
+ * @return bool
695
+ */
696
+ public static function check_cache_exists( $feed_id ) {
697
+ global $wpdb;
698
+ $count = $wpdb->get_var($wpdb->prepare('SELECT count(id) FROM ' . $wpdb->prefix . 'wd_fb_data WHERE fb_id="%d"', intval($feed_id)));
699
+ if(intval($count) !== 0) {
700
+ return true;
701
  }
702
+ return false;
703
+ }
704
 
705
  /**
706
  * Set timeline type.
710
  * Replace params in graph url.
711
  */
712
  public static function timeline() {
713
+
714
+ if(!class_exists('WDW_FFWD_Library')) {
715
+ require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
716
+ }
717
+ self::$timeline_max_call_count = WD_FB_TIMELINE_MAX_CALL_COUNT;
718
  self::set_timeline_type();
719
  self::$complite_timeline_data = array();
 
720
  self::set_access_token();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
721
  if ( self::$save ) {
722
+ $save_db = self::save_db();
723
  }
724
  else {
725
  if ( self::$edit_feed ) {
726
+ $save_db = self::edit_feed();
727
  }
728
  else {
729
  if ( self::$updateOnVersionChange ) {
730
+ $save_db = self::update_version();
731
  }
732
  else {
733
+ $save_db = self::$fb_id;
734
+ self::$ajax_cache_action = 'update_cache_data';
735
  }
736
  }
737
  }
738
+ if(!self::check_cache_exists( $save_db )) {
739
+ self::$ajax_cache_action = 'set_cache_data';
740
+ }
741
+ if ( $save_db === 'false' ) {
742
+ echo self::$wd_fb_error_massage;
743
+ } else {
744
+ echo json_encode(array(
745
+ "status" => "success",
746
+ "feed_id" => $save_db,
747
+ "token"=>self::$access_token,
748
+ "user_id" => self::$id,
749
+ "ajax_action" => self::$ajax_cache_action,
750
+ "content_type" => 'timeline'));
751
+ }
752
+ die;
753
  }
754
 
755
  /**
756
+ * Update timeline cache data
 
 
 
 
757
  */
758
+ public static function update_timeline_cache_data() {
759
+ require_once(WD_FFWD_DIR . '/framework/WDW_FFWD_Library.php');
760
+ $iter = WDW_FFWD_Library::get('iter', 0);
761
+ $fb_graph_url = isset($_POST['graph_url']) ? $_POST['graph_url']: '';
762
+ $user_id = WDW_FFWD_Library::get('user_id');
763
+ self::$id = $user_id;
764
+ self::$fb_id = WDW_FFWD_Library::get('fb_id');
765
+ if( !self::check_cache_exists(self::$fb_id) && $iter == 0 ) {
766
+ self::set_timeline_cache_data();
767
+ die;
768
  }
769
+
770
+ self::$content = explode(',', self::get_content(self::$fb_id));
771
+ self::$content_type = self::get_content_type(self::$fb_id);
772
+
773
+ self::$timeline_max_call_count = WD_FB_TIMELINE_MAX_CALL_COUNT;
774
+ self::set_timeline_type();
775
+ self::$complite_timeline_data = array();
776
+ $data = array();
777
+ self::set_access_token();
778
+
779
+ if ( $fb_graph_url == '' ) {
780
+ $edge = (self::$fb_type == 'group') ? 'feed' : ((self::$timeline_type == 'feed' || self::$timeline_type == 'others') ? 'feed' : 'posts');
781
+ // @todo v3.3 api
782
+ $fields = 'fields=id,status_type,message,message_tags,shares,place,story,story_tags,privacy,attachments{media_type,media,url},from{picture,name,link},event,comments.limit(25).summary(true){parent.fields(id),created_time,from,like_count,comment_count},created_time,updated_time&';
783
+ $fb_graph_url = str_replace(array(
784
+ '{FB_ID}',
785
+ '{EDGE}',
786
+ '{ACCESS_TOKEN}',
787
+ '{FIELDS}',
788
+ '{LIMIT}',
789
+ '{OTHER}'
790
+ ), array(
791
+ $user_id,
792
+ $edge,
793
+ 'access_token=' . self::$access_token . '&',
794
+ $fields,
795
+ 'locale=' . get_locale() . '&limit=10&',
796
+ ''
797
+ ), self::$graph_url);
798
+ }
799
+
800
+ $data['data'] = self::complite_timeline($fb_graph_url, $iter);
801
+ self::$data = $data;
802
+ self::update_db();
803
+
804
+ if ( self::$timeline_max_call_count > intval($iter) && self::$next_page ) {
805
+ self::$timeline_max_call_count--;
806
+ echo json_encode(array("status" => "success", "next_page" => self::$next_page, "iter" => $iter, "fb_id" => self::$fb_id));
807
+ } else {
808
+ echo json_encode(array( "status" => "success", "next_page" => '', "iter" => $iter, "fb_id" => self::$fb_id ));
809
+ }
810
+
811
+ die;
812
  }
813
 
814
+ /**
815
+ * Insert timeline cache data
816
+ */
817
+ public static function set_timeline_cache_data() {
818
+ global $wpdb;
819
+ $iter = WDW_FFWD_Library::get('iter', 0);
820
+ $fb_graph_url = isset($_POST['graph_url']) ? $_POST['graph_url']: '';
821
+ $user_id = WDW_FFWD_Library::get('user_id');
822
+ self::$fb_id = WDW_FFWD_Library::get('fb_id');
823
+ self::$content = explode(',', self::get_content(self::$fb_id));
824
+ self::$content_type = self::get_content_type(self::$fb_id);
825
+
826
+ self::$timeline_max_call_count = WD_FB_TIMELINE_MAX_CALL_COUNT;
827
+ self::set_timeline_type();
828
+ self::$complite_timeline_data = array();
829
+ $data = array();
830
+ self::set_access_token();
831
+ if ( $fb_graph_url == '' ) {
832
+ $edge = (self::$fb_type == 'group') ? 'feed' : ((self::$timeline_type == 'feed' || self::$timeline_type == 'others') ? 'feed' : 'posts');
833
+ // @todo v3.3 api
834
+ $fields = 'fields=id,status_type,message,message_tags,shares,place,story,story_tags,privacy,attachments{media_type,media,url},from{picture,name,link},event,comments.limit(25).summary(true){parent.fields(id),created_time,from,like_count,comment_count},created_time,updated_time&';
835
+ $fb_graph_url = str_replace(array(
836
+ '{FB_ID}',
837
+ '{EDGE}',
838
+ '{ACCESS_TOKEN}',
839
+ '{FIELDS}',
840
+ '{LIMIT}',
841
+ '{OTHER}'
842
+ ), array(
843
+ $user_id,
844
+ $edge,
845
+ 'access_token=' . self::$access_token . '&',
846
+ $fields,
847
+ 'locale=' . get_locale() . '&limit=10&',
848
+ ''
849
+ ), self::$graph_url);
850
+ }
851
+ if( defined('FFWD_NEED_UPDATE_CACHE') && FFWD_NEED_UPDATE_CACHE ) {
852
+ self::$auto_update_feed = 1;
853
+ }
854
+ if ( self::$auto_update_feed == 1 ) {
855
+ $id = self::$fb_id;
856
+ $update_ids = array();
857
+ $rows = $wpdb->get_results($wpdb->prepare('SELECT object_id, id FROM ' . $wpdb->prefix . 'wd_fb_data WHERE fb_id="%d" ORDER BY `created_time_number` ASC ', $id));
858
+ foreach ( $rows as $row ) {
859
+ $update_ids[$row->object_id] = $row->id;
860
+ }
861
+ $fb_graph_url_update = $fb_graph_url;
862
+ $update_data = self::decap_do_curl($fb_graph_url_update);
863
+ self::update_wd_fb_data($update_data, $update_ids);
864
+ }
865
+ else {
866
+ /* When update schedule no need and cache exists */
867
+ if( self::check_cache_exists(self::$fb_id) && $iter == 0 ) {
868
+ echo json_encode(array("status" => "success", "next_page" => '', "iter" => 0, "fb_id" => self::$fb_id));
869
+ die;
870
+ }
871
+
872
+ $data['data'] = self::complite_timeline($fb_graph_url, $iter);
873
+ self::$data = $data;
874
+ self::insert_wd_fb_data($data['data']);
875
+ }
876
+ if ( self::$timeline_max_call_count > intval($iter) && self::$next_page ) {
877
+ self::$timeline_max_call_count--;
878
+ echo json_encode(array("status" => "success", "next_page" => self::$next_page, "iter" => $iter, "fb_id" => self::$fb_id, "non_public_share_count" => self::$non_public_share_count));
879
+ } else {
880
+ echo json_encode(array( "status" => "success", "next_page" => '', "iter" => $iter, "fb_id" => self::$fb_id, "non_public_share_count" => self::$non_public_share_count ));
881
+ }
882
+ die;
883
+
884
+ }
885
+
886
+ /* TODO need to understand how does it work, currently no result */
887
+ public static function complite_timeline( $fb_graph_url, $iter = 0 ) {
888
+ self::$non_public_share_count = WDW_FFWD_Library::get('non_public_share_count', 0);
889
  $content = implode(',', self::$content);
890
  if ( !empty(self::$content) ) {
891
+
892
  $content = '';
893
  foreach ( self::$content as $val ) {
894
  if ( $val == 'photos') {
895
+ $content .= 'photo';
896
  }
897
  if ( $val == 'videos') {
898
  $content .= 'video,';
899
  }
900
  if ( $val == 'links') {
901
  $content .= 'link,';
902
+ }
903
+ if ( $val == 'albums') {
904
+ $content .= 'album,';
905
+ }
906
  }
907
  $content = trim($content, ',');
908
  }
929
  // Set next page if it exists
930
  $paging = array_key_exists('paging', $data) ? $data['paging'] : array();
931
  $next_page = array_key_exists('next', $paging) ? $paging['next'] : 0;
932
+ self::$next_page = array_key_exists('next', $paging) ? $paging['next'] : 0;
933
  foreach ( $post_data as $next ) {
934
  // @todo v10.0 api new logic.
935
  if ( !empty($next['attachments']['data']) && !empty($next['attachments']['data'][0]) ) {
960
  array_push(self::$complite_timeline_data, $next);
961
  // }
962
  }
963
+ return self::$complite_timeline_data;
964
  // @todo what was this for?
965
  // intval(count(self::$complite_timeline_data)) <= intval(self::$limit) &&
966
+ /* if ( self::$timeline_max_call_count > 0 && $next_page ) {
967
  self::$timeline_max_call_count--;
968
 
969
  return self::complite_timeline($next_page);
970
  }
971
  else {
972
  return self::$complite_timeline_data;
973
+ }*/
974
+ }
975
+ }
976
+ }
977
+
978
+ /**
979
+ * Getting count of posts which are have media type link and not available
980
+ *
981
+ * @param $datas array posts which we got from endpoint
982
+ *
983
+ * @return int
984
+ */
985
+ public static function get_link_type_count( $datas ) {
986
+ if( !empty($datas) ) {
987
+ $count = 0;
988
+ foreach ( $datas as $data ) {
989
+ if ( !empty($data['attachments']) && !empty($data['attachments']['data'][0]) && $data['attachments']['data'][0]['media_type'] == 'link' && empty($data['attachments']['data'][0]['media']) ) {
990
+ $count++;
991
  }
992
  }
993
  }
994
+ return $count;
995
  }
996
 
997
  public static function update_wd_fb_data( $data, $ids ) {
998
  global $wpdb;
 
 
999
  if ( !empty($data['data']) ) {
1000
+ // Set next page if it exists
1001
+ $paging = array_key_exists('paging', $data) ? $data['paging'] : array();
1002
+ self::$next_page = array_key_exists('next', $paging) ? $paging['next'] : 0;
1003
  foreach ( $data['data'] as $key => $next ) {
1004
  $object_id = $next['id'];
1005
  // @TODO type is deprecated V3.3
1027
  $width = '';
1028
  $height = '';
1029
  $attachments = (!empty($next['attachments']['data'][0])) ? $next['attachments']['data'][0] : array();
 
1030
  if( !self::check_post_type( self::$content, $next ) ) {
1031
  continue;
1032
  }
1233
  * @return bool
1234
  */
1235
  public static function check_post_type( $post_types, $post_data ) {
1236
+ /* In specific album and video we are getting only albums or videos from endpoint, so no need to check post type */
1237
+ if(self::$content_type === 'specific' && isset(self::$content[0]) && (self::$content[0] === 'albums' || self::$content[0] === 'videos')) {
1238
+ return true;
1239
+ }
1240
  $media_type = (!empty($post_data['attachments']['data'][0])) ? $post_data['attachments']['data'][0]['media_type'] : '';
1241
  foreach ( $post_types as $post_type ) {
1242
  if ( $post_type == "statuses" ) {
1259
  return true;
1260
  }
1261
  }
1262
+ if ( $post_type == "albums" ) {
1263
+ if( !empty($media_type) && $media_type == 'album') {
1264
+ return true;
1265
+ }
1266
+ }
1267
  }
1268
  return FALSE;
1269
  }
1279
  }
1280
 
1281
  public static function filter_upcoming_events( $data ) {
 
1282
  foreach ( $data['data'] as $key => $event ) {
 
1283
  $event_start_time = strtotime($event['start_time']);
1284
+ $now = strtotime(date('Y-m-d H:i:s'));
1285
  if ( $event_start_time < $now ) {
 
 
1286
  unset($data['data'][$key]);
1287
  }
1288
  }
1323
  // Collapse content types (multiple when content type is timeline, one when specific)
1324
  $content = implode(",", self::$content);
1325
  $from = self::$id;
 
 
 
 
 
1326
 
1327
  $ffwd_info_options = array();
1328
  $ffwd_info_options['theme'] = ((isset($_POST['theme'])) ? sanitize_text_field(stripslashes($_POST['theme'])) : '');
1511
  * first and only value of self::$content array.
1512
  * Escape paging in self::data
1513
  */
 
 
1514
 
1515
+ if ( $save_fb_info !== false ) {
1516
+ self::$fb_id = $wpdb->insert_id;
1517
+ self::$ajax_cache_action = "set_cache_data";
1518
+ return self::$fb_id;
1519
  }
1520
  else {
1521
+ self::$wd_fb_error_massage = json_encode(array('status'=>'error','msg'=>'Problem with save fb feed'));
1522
+ return false;
1523
  }
1524
  }
1525
 
1526
+ public static function get_content( $id ) {
1527
+ global $wpdb;
1528
+ $var = $wpdb->get_var($wpdb->prepare('SELECT content FROM ' . $wpdb->prefix . 'wd_fb_info WHERE id="%d"', $id));
1529
+ return $var;
1530
+ }
1531
+
1532
+ public static function get_content_type( $id ) {
1533
+ global $wpdb;
1534
+ $var = $wpdb->get_var($wpdb->prepare('SELECT content_type FROM ' . $wpdb->prefix . 'wd_fb_info WHERE id="%d"', $id));
1535
+ return $var;
1536
+ }
1537
+
1538
  /**
1539
  * Insert data from facebook response to DataBase
1540
  *
1544
 
1545
  global $wpdb;
1546
  $success = 'no_data';
 
1547
  if ( self::$content_type == 'specific' && self::$content[0] == 'events' ) {
1548
  $start_time = array();
1549
  foreach ($data as $key => $event) {
1564
  }
1565
  array_multisort($start_time, SORT_DESC, $data);
1566
  }
1567
+
1568
  foreach ( $data as $key => $next ) {
1569
  $type = '';
1570
  $source = '';
1753
  $created_time_number = ($created_time != '') ? strtotime($created_time) : 0;
1754
  $insert_data = array(
1755
  'fb_id' => self::$fb_id,
1756
+ 'object_id' => $object_id,
1757
+ 'from' => $from,
1758
  'name' => $name,
1759
  'description' => $description,
1760
  'type' => $type,
1938
  public static function wd_fb_massage($mood, $massage)
1939
  {
1940
  if(self::$ffwd_fb_massage){
1941
+ self::$ffwd_fb_massage_response = json_encode(array($mood, $massage, self::$non_public_share_count));
1942
  self::$ffwd_fb_massage = false;
 
 
 
 
 
1943
  }else{
1944
+ return '';
1945
  }
1946
  }
1947
 
2036
  $data->access_token = $ffwd_user_access_token;
2037
  }
2038
  }
 
 
2039
  update_option('ffwd_pages_list', $datas);
2040
  update_option("ffwd_pages_list_success", "1");
2041
+ update_option('ffwd_token_error_flag', "0");
2042
  self::update_access_tokens();
2043
 
2044
  }
framework/WDW_FFWD_Library.php CHANGED
@@ -949,4 +949,5 @@ class WDW_FFWD_Library {
949
  global $wpdb;
950
  return $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'wd_fb_data');
951
  }
 
952
  }
949
  global $wpdb;
950
  return $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'wd_fb_data');
951
  }
952
+
953
  }
frontend/controllers/FFWDControllerMain.php CHANGED
@@ -6,7 +6,6 @@ class FFWDControllerMain {
6
 
7
  public function __construct($params = array(), $from_shortcode = 0, $ffwd = 0, $view = '') {
8
  $this->view = $view;
9
- wd_fb_update(1);
10
  $this->display($params, $from_shortcode, $ffwd);
11
  }
12
 
6
 
7
  public function __construct($params = array(), $from_shortcode = 0, $ffwd = 0, $view = '') {
8
  $this->view = $view;
 
9
  $this->display($params, $from_shortcode, $ffwd);
10
  }
11
 
frontend/views/FFWDViewBlog_style.php CHANGED
@@ -35,9 +35,6 @@ class FFWDViewBlog_style {
35
  }
36
 
37
  $ffwd_data = $this->model->get_ffwd_data($params['fb_id'], $ffwd_info['objects_per_page'], '', $ffwd, $ffwd_info['limit']);
38
- if (!$ffwd_data) {
39
- echo WDW_FFWD_Library::message(__('There are no objects in this facebook feed.', 'ffwd'), 'error');
40
- }
41
 
42
  if ($ffwd_info['pagination_type'] && $ffwd_info['objects_per_page']) {
43
  $page_nav = $this->model->page_nav($params['fb_id'], $ffwd_info['objects_per_page'], $ffwd);
@@ -82,6 +79,7 @@ class FFWDViewBlog_style {
82
  );
83
  $linkify=new \Misd\Linkify\Linkify();
84
  ?>
 
85
  <style>
86
  #ffwd_container1_<?php echo $ffwd; ?> {
87
  margin: 0px auto 10px auto;
@@ -999,15 +997,6 @@ class FFWDViewBlog_style {
999
  transition-delay: 0s, 0s, 0.3s;
1000
 
1001
  }
1002
-
1003
-
1004
-
1005
-
1006
-
1007
-
1008
-
1009
-
1010
-
1011
  </style>
1012
  <script>
1013
  var client_side_today = new Date(),
@@ -1031,8 +1020,14 @@ class FFWDViewBlog_style {
1031
  fjs.parentNode.insertBefore(js, fjs);
1032
  }(document, 'script', 'facebook-jssdk'));
1033
  </script>
1034
- <div id="ffwd_container1_<?php echo $ffwd; ?>">
1035
- <div id="ffwd_container2_<?php echo $ffwd; ?>">
 
 
 
 
 
 
1036
  <?php if($ffwd_info['type'] == "page" && $ffwd_info["fb_plugin"] && $ffwd_info['page_plugin_pos'] == "top") { ?>
1037
  <div class="ffwd_page_plugin_<?php echo $ffwd; ?>">
1038
  <div class="fb-page" data-href="https://www.facebook.com/<?php echo $ffwd_info['from']; ?>" data-width="<?php echo $ffwd_info['page_plugin_width']; ?>" data-small-header="<?php echo $ffwd_info['page_plugin_header']; ?>" data-adapt-container-width="true" data-hide-cover="<?php echo $ffwd_info['page_plugin_cover']; ?>" data-show-facepile="<?php echo $ffwd_info['page_plugin_fans']; ?>" data-show-posts="false">
@@ -1386,6 +1381,7 @@ class FFWDViewBlog_style {
1386
  });
1387
  });
1388
  </script>
 
1389
  <?php
1390
  if ($from_shortcode) {
1391
  return;
35
  }
36
 
37
  $ffwd_data = $this->model->get_ffwd_data($params['fb_id'], $ffwd_info['objects_per_page'], '', $ffwd, $ffwd_info['limit']);
 
 
 
38
 
39
  if ($ffwd_info['pagination_type'] && $ffwd_info['objects_per_page']) {
40
  $page_nav = $this->model->page_nav($params['fb_id'], $ffwd_info['objects_per_page'], $ffwd);
79
  );
80
  $linkify=new \Misd\Linkify\Linkify();
81
  ?>
82
+ <div id="ffwd_container_<?php echo $ffwd; ?>">
83
  <style>
84
  #ffwd_container1_<?php echo $ffwd; ?> {
85
  margin: 0px auto 10px auto;
997
  transition-delay: 0s, 0s, 0.3s;
998
 
999
  }
 
 
 
 
 
 
 
 
 
1000
  </style>
1001
  <script>
1002
  var client_side_today = new Date(),
1020
  fjs.parentNode.insertBefore(js, fjs);
1021
  }(document, 'script', 'facebook-jssdk'));
1022
  </script>
1023
+ <div id="ffwd_container1_<?php echo $ffwd; ?>" class="ffwd_container1" data-feed_id="<?php echo $params['fb_id']; ?>">
1024
+ <div class="ffwd-loading-layout"><img src="<?php echo WD_FFWD_URL . '/images/loading.gif'; ?>"></div>
1025
+ <?php
1026
+ if (!$ffwd_data) {
1027
+ echo WDW_FFWD_Library::message(__('There are no objects in this facebook feed.', 'ffwd'), 'error');
1028
+ }
1029
+ ?>
1030
+ <div id="ffwd_container2_<?php echo $ffwd; ?>" class="ffwd_container2 ffwd-hidden">
1031
  <?php if($ffwd_info['type'] == "page" && $ffwd_info["fb_plugin"] && $ffwd_info['page_plugin_pos'] == "top") { ?>
1032
  <div class="ffwd_page_plugin_<?php echo $ffwd; ?>">
1033
  <div class="fb-page" data-href="https://www.facebook.com/<?php echo $ffwd_info['from']; ?>" data-width="<?php echo $ffwd_info['page_plugin_width']; ?>" data-small-header="<?php echo $ffwd_info['page_plugin_header']; ?>" data-adapt-container-width="true" data-hide-cover="<?php echo $ffwd_info['page_plugin_cover']; ?>" data-show-facepile="<?php echo $ffwd_info['page_plugin_fans']; ?>" data-show-posts="false">
1381
  });
1382
  });
1383
  </script>
1384
+ </div>
1385
  <?php
1386
  if ($from_shortcode) {
1387
  return;
images/loading.gif ADDED
Binary file
js/ffwd.js CHANGED
@@ -134,6 +134,7 @@ function spider_ajax_save(wd_fb_prefix) {
134
  else {
135
  if (jQuery("#" + wd_fb_prefix + "_timeline_statuses").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_statuses").val());
136
  if (jQuery("#" + wd_fb_prefix + "_timeline_photos").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_photos").val());
 
137
  if (jQuery("#" + wd_fb_prefix + "_timeline_videos").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_videos").val());
138
  if (jQuery("#" + wd_fb_prefix + "_timeline_links").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_links").val());
139
  // if (jQuery("#" + wd_fb_prefix + "_timeline_events").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_events").val());
@@ -213,30 +214,31 @@ function spider_ajax_save(wd_fb_prefix) {
213
  data["popup_enable_twitter"] = popup_enable_twitter;
214
 
215
 
216
- data['view_on_fb'] = view_on_fb
217
- data['post_text_length'] = post_text_length
218
- data['post_date_format'] = post_date_format
219
- data['date_timezone'] = date_timezone
220
- data['event_street'] = event_street
221
- data['event_city'] = event_city
222
- data['event_country'] = event_country
223
- data['event_zip'] = event_zip
224
- data['event_map'] = event_map
225
- data['event_date'] = event_date
226
- data['event_date_format'] = event_date_format
227
- data['event_desp_length'] = event_desp_length
228
- data['comments_replies'] = comments_replies
229
- data['comments_filter'] = comments_filter
230
- data['comments_order'] = comments_order
231
- data['page_plugin_pos'] = page_plugin_pos
232
- data['page_plugin_fans'] = page_plugin_fans
233
- data['page_plugin_cover'] = page_plugin_cover
234
- data['page_plugin_header'] = page_plugin_header
235
- data['page_plugin_width'] = page_plugin_width
236
- data['image_onclick_action'] = image_onclick_action
237
-
238
- data['event_order'] = event_order
239
- data['upcoming_events'] = upcoming_events
 
240
 
241
  // Loading.
242
  jQuery('#opacity_div').show();
@@ -247,41 +249,31 @@ function spider_ajax_save(wd_fb_prefix) {
247
  url: ajax_url,
248
  data: data,
249
  success: function (result) {
250
- var task = jQuery("#task").val();
251
- console.log(result);
252
  result = JSON.parse(result);
253
- if (result[0] == "success") {
254
- jQuery(".ffwd_notice").html("");
255
- if (current_id == 0) {
256
- jQuery("#current_id").val(result[1]);
257
  }
258
- switch (task) {
259
- case "apply":
260
- var non_visible_post_msg = '';
261
- if( typeof result[2] !== "undefined" && 0 !== parseInt(result[2])) {
262
- non_visible_post_msg = "<p>"+parseInt(result[2])+" posts are not available, probably they are not public.</p>";
263
- non_visible_post_msg = "<p>The data of "+parseInt(result[2])+" posts will not be displayed on your site. This is because, most likely the owner of the post did not set the post to public and/or shared the post to a specific page, or has deleted the post.</p>";
264
- }
265
- jQuery("#task").val("");
266
- jQuery('#message_div').html("<strong><p>Items Succesfully Saved.</p>"+non_visible_post_msg+"</strong>");
267
- jQuery('#message_div').show();
268
- jQuery('#ffwd_page_url,#page_access_token,#name').removeAttr("style");
269
- break;
270
- case "save":
271
- if( typeof result[2] !== "undefined" && 0 !== parseInt(result[2])) {
272
- jQuery("#ffwd_info_form").append("<input type='hidden' name='non_public_posts_count' value='"+parseInt(result[2])+"'>")
273
- }
274
 
275
- jQuery("#ffwd_info_form").submit();
276
- break;
277
- default:
278
- jQuery("#task").val("");
279
- break;
 
 
 
 
 
 
 
 
280
  }
281
  }
282
  else {
283
  jQuery(".ffwd_notice").html('<div class="notice notice-error is-dismissible">\n' +
284
- ' <p>'+result[0]+' : '+result[1]+'.</p>\n' +
285
  ' </div>');
286
  //confirm(result[0] + " : " + result[1] + ".");
287
  }
@@ -820,7 +812,7 @@ jQuery(document).ready(function () {
820
  jQuery(".ffwd_reset_cache_res").html("");
821
  e.preventDefault();
822
  jQuery.ajax({
823
- url: ffwd_ajax.ajaxurl,
824
  type: "POST",
825
  dataType: 'json',
826
  data: {
134
  else {
135
  if (jQuery("#" + wd_fb_prefix + "_timeline_statuses").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_statuses").val());
136
  if (jQuery("#" + wd_fb_prefix + "_timeline_photos").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_photos").val());
137
+ if (jQuery("#" + wd_fb_prefix + "_timeline_albums").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_albums").val());
138
  if (jQuery("#" + wd_fb_prefix + "_timeline_videos").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_videos").val());
139
  if (jQuery("#" + wd_fb_prefix + "_timeline_links").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_links").val());
140
  // if (jQuery("#" + wd_fb_prefix + "_timeline_events").is(':checked')) content.push(jQuery("#" + wd_fb_prefix + "_timeline_events").val());
214
  data["popup_enable_twitter"] = popup_enable_twitter;
215
 
216
 
217
+ data['view_on_fb'] = view_on_fb;
218
+ data['post_text_length'] = post_text_length;
219
+ data['post_date_format'] = post_date_format;
220
+ data['date_timezone'] = date_timezone;
221
+ data['event_street'] = event_street;
222
+ data['event_city'] = event_city;
223
+ data['event_country'] = event_country;
224
+ data['event_zip'] = event_zip;
225
+ data['event_map'] = event_map;
226
+ data['event_date'] = event_date;
227
+ data['event_date_format'] = event_date_format;
228
+ data['event_desp_length'] = event_desp_length;
229
+ data['comments_replies'] = comments_replies;
230
+ data['comments_filter'] = comments_filter;
231
+ data['comments_order'] = comments_order;
232
+ data['page_plugin_pos'] = page_plugin_pos;
233
+ data['page_plugin_fans'] = page_plugin_fans;
234
+ data['page_plugin_cover'] = page_plugin_cover;
235
+ data['page_plugin_header'] = page_plugin_header;
236
+ data['page_plugin_width'] = page_plugin_width;
237
+ data['image_onclick_action'] = image_onclick_action;
238
+
239
+ data['event_order'] = event_order;
240
+ data['upcoming_events'] = upcoming_events;
241
+ data['iter'] = 0;
242
 
243
  // Loading.
244
  jQuery('#opacity_div').show();
249
  url: ajax_url,
250
  data: data,
251
  success: function (result) {
 
 
252
  result = JSON.parse(result);
253
+ if (result['status'] === "success" ) {
254
+ var non_public_share_count = 0;
255
+ if( typeof result['non_public_share_count'] !== 'undefined' ) {
256
+ non_public_share_count = result['non_public_share_count'];
257
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
 
259
+ if(result['ajax_action'] === 'set_cache_data') {
260
+ set_cache_data(result['feed_id'], 0, '', result['token'], result['user_id'], content_type, non_public_share_count);
261
+ }
262
+ else if(result['ajax_action'] === 'update_cache_data') {
263
+ update_cache_data(result['feed_id'], 0, '', result['token'], result['user_id'], content_type, non_public_share_count);
264
+ } else {
265
+ return_json = {
266
+ 0:'success',
267
+ 1: fb_id,
268
+ 2: non_public_share_count
269
+ };
270
+
271
+ apply_save_ajax_message( return_json )
272
  }
273
  }
274
  else {
275
  jQuery(".ffwd_notice").html('<div class="notice notice-error is-dismissible">\n' +
276
+ ' <p>'+result['status']+' : '+result['msg']+'.</p>\n' +
277
  ' </div>');
278
  //confirm(result[0] + " : " + result[1] + ".");
279
  }
812
  jQuery(".ffwd_reset_cache_res").html("");
813
  e.preventDefault();
814
  jQuery.ajax({
815
+ url: ffwd_ajax.ajax_url,
816
  type: "POST",
817
  dataType: 'json',
818
  data: {
js/ffwd_cache.js ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(window).load(function() {
2
+ var feed_ids = {};
3
+ jQuery(".ffwd_container1").each(function (key) {
4
+ feed_ids[key] = jQuery(this).attr("data-feed_id");
5
+ });
6
+ if (Object.keys(feed_ids).length === 0) {
7
+ feed_ids = 0;
8
+ }
9
+ var datas;
10
+ /* Case when need update all feeds data */
11
+ if(ffwd_cache.need_update === 'true') {
12
+ if( ffwd_cache.update_data === '' ) {
13
+ wdi_hide_loading();
14
+ return;
15
+ }
16
+ datas = JSON.parse(ffwd_cache.update_data);
17
+ jQuery.each( datas, function( key, value ) {
18
+ var data = value;
19
+ update_cache_data(data['id'], 0, '', data['page_access_token'], data['from'], data['content_type']);
20
+ });
21
+ }
22
+ /* Case when request from admin part and no need to run cron */
23
+ else if( ffwd_cache.need_update === 'false' && feed_ids === 0) { // need to remove
24
+ wdi_hide_loading();
25
+ }
26
+ /* case frontend when media data count is 0 */
27
+ else if( ffwd_cache.need_update === 'false' && feed_ids !== 0 ) {
28
+ datas = JSON.parse(ffwd_cache.update_data);
29
+ var zeroDataCount = 0;
30
+ jQuery.each( datas, function( key, value ) {
31
+ var data = value;
32
+ if( parseInt(data['data_count']) === 0 && Object.values(feed_ids).includes(data['id']) ) {
33
+ zeroDataCount++;
34
+ set_cache_data(data['id'], 0, '', data['page_access_token'], data['from'], data['content_type']);
35
+ }
36
+ });
37
+ if( zeroDataCount === 0 ) {
38
+ wdi_hide_loading();
39
+ }
40
+ }
41
+
42
+ });
43
+
44
+ /* Using for frontend hide loading and show hidden container */
45
+ function wdi_hide_loading() {
46
+ jQuery(".ffwd_container2").removeClass("ffwd-hidden"); // create function for this
47
+ jQuery(".ffwd-loading-layout").remove();
48
+ }
49
+
50
+ function set_cache_data( fb_id, iter, fb_graph_url, page_access_token, user_id, content_type, non_public_share_count ) {
51
+ var data = {
52
+ 'action' : 'set_cache_data',
53
+ 'fb_id' : fb_id,
54
+ 'user_id' : user_id,
55
+ 'content_type': content_type,
56
+ 'graph_url': fb_graph_url,
57
+ 'iter': iter,
58
+ 'page_access_token' : page_access_token,
59
+ 'non_public_share_count' : non_public_share_count,
60
+ };
61
+ jQuery.ajax({
62
+ method: "POST",
63
+ url: ffwd_cache.ajax_url,
64
+ data: data,
65
+ success: function (result) {
66
+ result = JSON.parse(result);
67
+ var return_json = '';
68
+ if( result['status'] === 'success' && result['next_page'] !== '') {
69
+ iter = parseInt(result['iter']) + 1;
70
+ set_cache_data( fb_id, iter, result['next_page'], page_access_token, user_id, content_type, result['non_public_share_count'] );
71
+ }
72
+ else if( result['status'] === 'error' ) {
73
+ return_json = {
74
+ 0 : result['status'],
75
+ 1 : result['msg'],
76
+ };
77
+ apply_save_ajax_message( return_json );
78
+ } else {
79
+ return_json = {
80
+ 0:'success',
81
+ 1: fb_id,
82
+ 2: result['non_public_share_count'],
83
+ };
84
+ apply_save_ajax_message( return_json );
85
+ get_shortcode_html(fb_id);
86
+ }
87
+ },
88
+ error: function (xhr, ajaxOptions, thrownError) {
89
+ console.log(xhr.status);
90
+ console.log(thrownError);
91
+ }
92
+ });
93
+ }
94
+
95
+ function get_shortcode_html( fb_id ) {
96
+ var frontend = 0;
97
+ jQuery(".ffwd_container1").each(function (key) {
98
+ if(jQuery(this).attr("data-feed_id") === fb_id) {
99
+ frontend = 1;
100
+ }
101
+ });
102
+ if( frontend === 0 ) {
103
+ return;
104
+ }
105
+
106
+ var data = {
107
+ 'action' : 'ffwd_ajax_front_end',
108
+ 'fb_id' : fb_id
109
+ };
110
+ jQuery.ajax({
111
+ method: "POST",
112
+ url: ffwd_cache.ajax_url,
113
+ data: data,
114
+ // dataType: 'html',
115
+ success: function (result) {
116
+ var html = jQuery(result).find(".ffwd_container1[data-feed_id='" + fb_id + "']").html();
117
+ jQuery(document).find(".ffwd_container1[data-feed_id='" + fb_id + "']").html(html);
118
+ jQuery(document).find(".ffwd_container1[data-feed_id='" + fb_id + "'] .ffwd-loading-layout").remove();
119
+ jQuery(document).find(".ffwd_container1[data-feed_id='" + fb_id + "'] .ffwd_container2").removeClass('ffwd-hidden');
120
+
121
+ /* Using to reset click action after content replace (problem in album click) */
122
+ jQuery(".ffwd_container1").each(function () {
123
+ var id = jQuery(this).attr("id");
124
+ if( typeof id !== 'undefined' ) {
125
+ var ind = id.replace('ffwd_container1_', '');
126
+ window["ffwd_document_ready_" + ind]();
127
+ }
128
+ });
129
+ },
130
+ error: function (xhr, ajaxOptions, thrownError) {
131
+ console.log(xhr.status);
132
+ console.log(thrownError);
133
+ }
134
+ });
135
+ }
136
+
137
+ function update_cache_data( fb_id, iter, fb_graph_url, page_access_token, user_id, content_type, non_public_share_count ) {
138
+ var data = {
139
+ 'action' : 'update_cache_data',
140
+ 'fb_id' : fb_id,
141
+ 'user_id' : user_id,
142
+ 'content_type': content_type,
143
+ 'graph_url': fb_graph_url,
144
+ 'iter': iter,
145
+ 'page_access_token' : page_access_token,
146
+ 'non_public_share_count' : non_public_share_count,
147
+ };
148
+ jQuery.ajax({
149
+ method: "POST",
150
+ url: ffwd_cache.ajax_url,
151
+ data: data,
152
+ success: function (result) {
153
+ result = JSON.parse(result);
154
+ var return_json = '';
155
+ fb_id = result['fb_id'];
156
+ if( result['status'] === 'success' && result['next_page'] !== '') {
157
+ iter = parseInt(result['iter'])+1;
158
+ update_cache_data( fb_id, iter, result['next_page'], page_access_token, user_id, content_type, result['non_public_share_count'] );
159
+ }
160
+ else if( result['status'] === 'error' ) {
161
+ return_json = {
162
+ 0 : result['status'],
163
+ 1 : result['msg'],
164
+ };
165
+ apply_save_ajax_message( return_json );
166
+ } else {
167
+ return_json = {
168
+ 0:'success',
169
+ 1: fb_id,
170
+ 2: result['non_public_share_count'],
171
+ };
172
+ get_shortcode_html(fb_id);
173
+ apply_save_ajax_message( return_json );
174
+ }
175
+ },
176
+ error: function (xhr, ajaxOptions, thrownError) {
177
+ console.log(xhr.status);
178
+ console.log(thrownError);
179
+ }
180
+ });
181
+ }
182
+ /* Save feed ajax message printing in success */
183
+ function apply_save_ajax_message( result ) {
184
+ var task = jQuery("#task").val();
185
+ jQuery(".ffwd_notice").html("");
186
+ if (result[1] !== 0) {
187
+ jQuery("#current_id").val(result[1]);
188
+ }
189
+ switch (task) {
190
+ case "apply":
191
+ var non_visible_post_msg = '';
192
+ if( typeof result[2] !== "undefined" && 0 !== parseInt(result[2])) {
193
+ non_visible_post_msg = "<p>"+parseInt(result[2])+" posts are not available, probably they are not public.</p>";
194
+ non_visible_post_msg = "<p>The data of "+parseInt(result[2])+" posts will not be displayed on your site. This is because, most likely the owner of the post did not set the post to public and/or shared the post to a specific page, or has deleted the post.</p>";
195
+ }
196
+ jQuery("#task").val("");
197
+ jQuery('#message_div').html("<strong><p>Items Succesfully Saved.</p>"+non_visible_post_msg+"</strong>");
198
+ jQuery('#message_div').show();
199
+ jQuery('#ffwd_page_url,#page_access_token,#name').removeAttr("style");
200
+ break;
201
+ case "save":
202
+ if( typeof result[2] !== "undefined" && 0 !== parseInt(result[2])) {
203
+ jQuery("#ffwd_info_form").append("<input type='hidden' name='non_public_posts_count' value='"+parseInt(result[2])+"'>")
204
+ }
205
+
206
+ jQuery("#ffwd_info_form").submit();
207
+ break;
208
+ default:
209
+ jQuery("#task").val("");
210
+ break;
211
+ }
212
+
213
+ }
readme.txt CHANGED
@@ -4,534 +4,6 @@ Tags: customizable facebook feed, facebook, facebook feed, facebook group, faceb
4
  Requires at least: 3.4
5
  Requires PHP: 5.2
6
  Tested up to: 5.8
7
- Stable tag: 1.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
-
11
- Formerly "10Web Facebook Feed". 10Web Social Feed is the ultimate plugin to display custom Facebook feeds of Facebook page on your website.
12
-
13
- == Description ==
14
-
15
- 10Web Social Feed (Formerly "10Web Facebook Feed") is the ultimate plugin to display custom Facebook feeds on your website.
16
-
17
- = Useful Links: =
18
-
19
- [Live Demo](https://demo.10web.io/facebook-feed/)
20
-
21
-
22
- [Premium 10Web Social Feed](https://10web.io/plugins/wordpress-facebook-feed/)
23
-
24
-
25
- [Special Offer for all Premium Plugins](https://10web.io/wordpress-plugins/)
26
-
27
- Integrating customized content to your WordPress website from Facebook can't be any easier when using 10Web Facebook Feed plugin. It provides features to display a wide range of content from any page with full control over the content length, type and styling.
28
-
29
- Whether you want to display an entire timeline of the feed with all its content, or just specific photos, videos, links and statuses from it, you can easily do that by choosing the desired post type you want to display. Each of the content type has its display views available and its own set of settings that you can fully customize.
30
-
31
- The plugin features a powerful lightbox which supports filmstrip display (Premium version), 15 transition effects and can display the feed photos in a pop-up window. Configure the settings for lightbox and comments in just a few clicks.The feeds are inserted into the posts and pages with a shortcode and are mobile responsive.
32
-
33
- **Benefits**
34
-
35
- * **No feed limitations** - 10Web Facebook Feed lets you display unlimited number of feeds on every post and page. You can have different feeds based Facebook pages within the same page or post.
36
- * **User engagement** - Facebook is a social media giant and most probably a great majority of your site visitors uses it on a daily basis. Displaying feeds with relevant content is definitely going to increase user engagement of your posts and have your visitors stay on your website way longer.
37
- * **Go social** - Your posts might be really interesting and engaging, but a little bit of content from Facebook won't do any harm. You can support your posts with relevant content from Facebook and actually make your posts and pages look more interesting and fun.
38
- * **Filter out desired content** - Facebook is a great source of information, but sometimes there is just too much of the stuff that's not relevant to your website or you simply don't want to show in your posts. With the premium version of 10Web Facebook Feed you can choose specific content types you want your visitors to see and engage with, such as photos, videos, albums.
39
- * **Customization** - There are wide range of feed customizing options in the plugin to make sure your feeds don't look boring. Depending on the content type you want to display you can choose between different layout options. Also if you're using the premium version of the plugin there are various themes available that you can apply to the feeds.
40
- * **Be in Charge** - 10Web Facebook Feed is giving you full control over the content you want to display. You can choose posts' user roles, the number of the posts displayed on the page, the length of the posts, feed update option, enable social sharing buttons, and many more.
41
- * **Awesome support at your disposal** - The team behind 10Web Facebook Feed provides timely and effective support to all its users. We keep standards high and response time low.
42
-
43
- **What&#39;s in it**
44
-
45
- **RESPONSIVE LAYOUT**
46
-
47
- Displayed feeds are responsive and scale perfectly to any screen.
48
-
49
- **UNLIMITED FEEDS**
50
-
51
- You can display as many feeds within the same post or page. Moreover, the feeds can be based on different Facebook pages.
52
-
53
- **FEED AUTO UPDATE**
54
-
55
- Specify the feed update interval, and the feed content will be automatically updated within the provided time period. You can also choose feed update option, whether the old posts are removed when the new ones are added, or the old ones are displayed together with the new ones.
56
-
57
- **FACEBOOK WIDGET**
58
-
59
- You can insert the feeds into your posts or pages using the provided shortcode, or display the feeds with the widget on the sidebar areas of your website. All the feed options, including feed view, number of posts,and the theme can be configured for the widget as well.
60
-
61
- **MULTIPLE FEED LAYOUTS**
62
-
63
- 10Web Facebook Feed comes with a number of feed display layouts - Album view for albums, Masonry and Thumbnail views for Facebook videos and photos. The view options are available in the premium version, and vary depending on the content type you want to display.
64
-
65
- **THEMES**
66
-
67
- The users of the premium version will find four themes that they can apply to the feeds. The free version uses the default theme. All the parameters of the themes can be configured and reset any time.
68
-
69
- **POWERFUL LIGHTBOX**
70
-
71
- The plugin features an advanced lightbox which supports full-width view and 15 transition effects. The premium version of the plugin also support filsmtrip view within the widget.
72
-
73
- **SOCIAL SHARING**
74
-
75
- Social sharing feature is available in the premium version of the plugin, and it will let your site visitors share the feeds on Google+, Twitter and Facebook.
76
-
77
-
78
-
79
- **SETTINGS/CUSTOMIZATION**
80
- *Some customizations described here are available in Premium version. Please refer to premium feature summary below.*
81
-
82
- To have 10Web Facebook Feed plugin up and running you have to create an app on Facebook. This is a required step by Facebook, but it's pretty easy once you check the plugin's user guide. Under the plugin's general options you provide Facebook app ID and secret, and then you can specify the feed auto update interval, choose the date format for posts.
83
-
84
- Adding feeds is just a matter of a few clicks. You just click on the **Add new** button from the feeds section of the plugin, and a new window with four setting tabs will open, including settings for the feed, lightbox, comments. From the main feed settings you set the page to create a feed with. Under the main settings you can also choose whether you display the whole timeline of the feed, or choose to display only specific content, such as only photos, videos, links.
85
-
86
- With a Facebook page feed, you can filter out the content based on user roles, and show posts and updates only from the page owner or other users from the group, or both. There is a long list of the lightbox settings you can enable, including social share buttons, showing comments, playing filmstrip, and more. The comments settings mainly include choosing comment filtering option, whether its top level or stream, with the former being the same structure as in Facebook and the latter including all-level comments. Here you can also enable showing the comment replies and choose commenting order.
87
-
88
-
89
- **[Premium version adds](https://10web.io/plugins/wordpress-facebook-feed/)**
90
-
91
- * Specific content feeds, where you can choose to display only single type of content from your Facebook wall (photos, videos, albums)
92
- * Show Facebook share buttons
93
- * Advanced lightbox with comments
94
- * Filmstrip for lightbox
95
- * Themes to change styles and colors for each view
96
- * Multiple layouts – album view for albums, masonry and thumbnail views for Facebook videos and photos
97
- * Social sharing for feed to Google Plus, Twitter and Facebook
98
-
99
-
100
- ###IMPORTANT:
101
- If you think you found a bug in 10Web Facebook Feed or have any problem/question concerning this plugin, please check out [Support Forum](https://wordpress.org/support/plugin/wd-facebook-feed) .
102
-
103
- == Privacy Policy =
104
- The plugin uses Facebook API to get public data from Facebook. All the received data is cached in WordPress database for some short customizable period to provide optimization. You can delete or update cached data. You can optionally enable like button for Facebook page. If you do so, Facebook will load some JS and embedded content which may track visitors. Facebook embeds are regulated under terms of Facebook privacy policy https://www.facebook.com/policy.php.
105
-
106
- == Changelog ==
107
- = 1.2.4 =
108
- * Fixed: XSS vulnerability.
109
- * Fixed: Statuses data in timeline is not available.
110
- * Fixed: "Image Onclick" option not working properly.
111
- * Fixed: Error when connecting pages.
112
- * Fixed: Delete data from DB on reset cache.
113
-
114
- = 1.2.3 =
115
- * Fixed: Broken images on album view.
116
- * Fixed: Comments and likes count.
117
- * Fixed: Show message for non available posts.
118
- * Fixed: Statuses and links for Timeline feed.
119
- * Fixed: Show play button on video thumbnails in Timeline view.
120
- * Fixed: Number of posts option.
121
- * Fixed: Broken images in Specific photos.
122
-
123
- = 1.2.2 =
124
- * Fixed: Duplicate Facebook posts on auto-update.
125
-
126
- = 1.2.1 =
127
- * Fixed: Facebook page connection.
128
-
129
- = 1.2.0 =
130
- * Changed: Facebook Graph API v10.0 integration․
131
-
132
- = 1.1.34 =
133
- * Added: PO file for Polish.
134
- * Fixed: Title with quote in it.
135
-
136
- = 1.1.33 =
137
- * Fixed: Compatibility with PHP8.
138
-
139
- = 1.1.32 =
140
- * Fixed: Messages in backend.
141
-
142
- = 1.1.31 =
143
- * Fixed: Open settings page after activation.
144
- * Fixed: Border radius in Blog style view.
145
- * Fixed: Expired token issue.
146
-
147
- = 1.1.30 =
148
- * Fixed: Token autoupdate.
149
-
150
- = 1.1.29 =
151
- * Fixed: JS deprications.
152
-
153
- = 1.1.28 =
154
- * Fixed: Widget.
155
-
156
- = 1.1.27 =
157
- * Fixed: Conflict with WP 5.5 version.
158
- * Fixed: Security issue.
159
-
160
- = 1.1.26 =
161
- * Fixed: Conflict with PHP version.
162
-
163
- = 1.1.25 =
164
- * Fixed: Include plugin css/js if feed exists.
165
- * Fixed: implode function arguments for php 7.4.
166
-
167
- = 1.1.24 =
168
- * Fixed: Compatibility with IE.
169
-
170
- = 1.1.23 =
171
- * Fixed: Issue with feed image.
172
-
173
- = 1.1.22 =
174
- * Fixed: Structure of 'Privacy policy' text.
175
- * Fixed: Conflict with Photo gallery.
176
-
177
- = 1.1.21 =
178
- * Fixed: Facebook api changes
179
-
180
- = 1.1.20 =
181
- * Improved: Do not limit images count.
182
-
183
- = 1.1.19 =
184
- * Fixed: Double quote in the feed title.
185
- * Fixed: Issue with hash in post URL.
186
-
187
- = 1.1.18 =
188
- * Removed: Banner to install Image optimizer.
189
-
190
- = 1.1.17 =
191
- * Fixed: Styles with Twenty Twenty theme.
192
-
193
- = 1.1.16 =
194
- * Improved: Do not use Font Awesome.
195
- * Added: Like button to Blog style view.
196
-
197
- = 1.1.15 =
198
- * Added: Ask a question button.
199
-
200
- = 1.1.14 =
201
- * Fixed: Minor bug
202
-
203
- = 1.1.13 =
204
- * Fixed: Security issues
205
-
206
- = 1.1.11 =
207
- * Fixed: Single quote in owner info broke the lightbox.
208
-
209
- = 1.1.10 =
210
- * Fixed: Cannot add Facebook feed if the page title contains slash
211
-
212
- = 1.1.9 =
213
- * Added: Feed edit links for Elementor widget.
214
-
215
- = 1.1.8 =
216
- * Fixed: Notice on creating a feed.
217
-
218
- = 1.1.7 =
219
- * Added: Banner to install 10Web manager.
220
-
221
- = 1.1.6 =
222
- * Fixed: Minor bug.
223
-
224
- = 1.1.5 =
225
- * Changed: Links to 10Web.io.
226
-
227
- = 1.1.4 =
228
- * New: Gutenberg block
229
- * Fixed: Replace curl calls by wp_remote_get and wp_remote_post
230
- * Fixed: Failing to save theme (Premium)
231
- * Fixed: Compatibility with some plugins
232
-
233
- = 1.1.3 =
234
- * Added: Facebook widget in 10Web Builder
235
-
236
- = 1.1.2 =
237
- * Fixed: Inserting shortcode when when no feed is selected
238
- * Fixed: Events features are removed because Facebook events API was shut down
239
-
240
- = 1.1.1 =
241
- * Improved: Simplified Facebook login. No need to enter app ID and get page tokens manually. This is a new Facebook app, so reauthentication is required.
242
- * Fixed: Elementor compatibility
243
-
244
- = 1.1.0 =
245
- * **Important: Breaking change. Obtaining page access token is required to display your page content with 10Web Facebook Feed plugin.
246
- * Fixed: Error on PHP 7.2
247
- * Fixed: Notices when feed is unpublished
248
- * Changed: Deactivation popup
249
-
250
- = 1.0.38 =
251
- * New: Using page access token
252
- * New: Reset and update cached Facebook data
253
- * Changed: Uninstall page moved from separate menu to settings page
254
- * Changed: Session usage removed
255
- * Fixed: WordPress loopback request error because of sessions
256
- * Fixed: PHP notices in widget
257
-
258
- = 1.0.37 =
259
- * Changed: API requests reduced from frontend
260
- * Changed: Use another token if API returns any kind of error
261
- * Removed: Likes temporarily not displayed
262
- * Fixed: Unnecessary requests from feeds list admin screen
263
-
264
- = 1.0.36 =
265
- * Changed: Use built-in access tokens if user's token has expired rate limit
266
-
267
- = 1.0.35 =
268
- * Fixed: Crash on front end when API returns error
269
- * Improved: Use another access token if API request limit of current token is exceeded
270
-
271
- = 1.0.34 =
272
- * Fixed: Bug on video post
273
-
274
- = 1.0.33 =
275
- * Fixed: Empty post bug
276
- * Changed: Default API keys
277
- * Fixed: Bug on setting API keys from options
278
-
279
- = 1.0.32 =
280
- * Important: Facebook API has been changed on without any warning, and now it does not allow bringing posts from public groups.
281
-
282
- = 1.0.31 =
283
- * Fixed: Bug on autoupdate
284
- * Fixed: Bug on comments
285
-
286
- = 1.0.30 =
287
- * Changed: Deactivation popup
288
-
289
- = 1.0.29 =
290
- Added: Support forum and Review links.
291
-
292
- = 1.0.28 =
293
- * Fixed: Spinning icon
294
-
295
- = 1.0.27 =
296
- * Changed: Show notification to install Backup WD plugin only on plugin pages.
297
-
298
- = 1.0.26 =
299
- * Fixed: Unexpected error when saving feed
300
- * Added: Notice to install Backup WD plugin
301
-
302
- = 1.0.25 =
303
- * Fixed: Updated library to prevent conflict with PHP version 7
304
-
305
- = 1.0.24 =
306
- * Changed: Default tokens
307
-
308
- = 1.0.23 =
309
- * Fixed: Translations
310
-
311
- = 1.0.22 =
312
- * Fixed: shortcode styles and tinymce errors on WP 4.8
313
-
314
- = 1.0.21 =
315
- * Fixed: Bug on autoupdate
316
- * Fixed: Event ordering
317
-
318
- = 1.0.19 =
319
- * Changed: Autoupdate
320
-
321
- = 1.0.18 =
322
- * Added: Support Forum links
323
-
324
- = 1.0.17 =
325
- * Added: Overview page
326
- * Changed: Deactivation
327
-
328
- = 1.0.16 =
329
- * Fixed: Conflict with Visual Composer
330
- * Changed: Data optimization
331
-
332
- = 1.0.15 =
333
- * Fixed: bug on posts with no shares
334
- * Fixed: bug on showing old events
335
-
336
- = 1.0.14 =
337
- * Fixed: Bug on reactions
338
- * Fixed: Bug on multiple Feeds
339
- * Fixed: Bug on widget dimension
340
-
341
- = 1.0.13 =
342
- * Changed: Featured plugins
343
- * Fixed: Bug with albums
344
-
345
- = 1.0.12 =
346
- * Fixed: Changes in database after plugin version update via FTP or AJAX requests with silent activation
347
-
348
- = 1.0.11 =
349
- * Added: Reactions
350
- * Changed: Graph api calls
351
- * Fixed: Minor bugs
352
-
353
- = 1.0.10 =
354
- * Added: Notice for appID and access token
355
- * Changed: Default tokens
356
-
357
- = 1.0.9 =
358
- * Fixed: Maximum Post message(description) Length option bug
359
- * Fixed: Minor bug
360
-
361
- = 1.0.8 =
362
- * Fixed: Minor bug
363
-
364
- = 1.0.7 =
365
- * Fixed: Bug in creating tables
366
-
367
- = 1.0.6 =
368
- * Fixed: Broken image in Firefox
369
- * Fixed: Post with quotes
370
-
371
- = 1.0.5 =
372
- * Added: Review, User guide notices
373
-
374
- = 1.0.4 =
375
- * Fixed: Bug in Autoupdate
376
-
377
- = 1.0.3 =
378
- * Added: Event ordering by event date
379
- * Added: Languages
380
-
381
- = 1.0.2 =
382
- * Minor bug fixed
383
-
384
- = 1.0.1 =
385
- * Minor bug fixed
386
-
387
- = 1.0.0 =
388
- * Initial version
389
-
390
- == Screenshots ==
391
- 1. 10Web Facebook Feed - Timeline
392
- 2. 10Web Facebook Feed - Videos
393
- 3. 10Web Facebook Feed - Albums view
394
- 4. 10Web Facebook Feed - Mansory View
395
- 5. 10Web Facebook Feed - Edit Facebook Feed
396
- 6. 10Web Facebook Feed - Edit Theme
397
- 7. 10Web Facebook Feed - Edit Options
398
-
399
- == Installation ==
400
-
401
- #### Thank you for your interest in 10Web Facebook Feed.
402
-
403
- ### Minimum requirements.
404
- * Wordpress 3.4+
405
- * PHP 5.x
406
- * MySQL 5.x
407
-
408
- ### Perform a new installation
409
-
410
- After downloading the ZIP file of the plugin,
411
-
412
- 1. Log in to the administrator panel.
413
- 2. Go to Plugins Add > New > Upload.
414
- 3. Click "Choose file" ("Browse") and select the downloaded zip file of the plugin.
415
- 4. Click "Install Now" button.
416
- 5. Click "Activate Plugin" button for activating 10Web Facebook Feed.
417
-
418
- If the installation does not succeed, please contact us at [support@10web.io](mailto:support@10web.io).
419
-
420
- == Frequently Asked Questions ==
421
-
422
- = What does Facebook Feed plugin do? =
423
-
424
- **10Web Facebook Feed** is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
425
-
426
- The plugin comes with a number of great features and functionality. Add as many feeds as you want and easily display content from your Facebook page in any posts or pages using shortcodes.
427
-
428
- = How can I create a Facebook feed with this plugin? =
429
-
430
- To configure a feed with 10Web Facebook Feed plugin, navigate to **10Web Facebook Feed > Feeds** page.
431
-
432
- Each feed includes various options which are grouped in tabs:
433
- * Main,
434
- * Lightbox Settings,
435
- * Comments,
436
-
437
- First, name your feed and set the **URL** of your Facebook page, for example:
438
-
439
- *https://www.facebook.com/examplepage*
440
-
441
- While creating feeds, you can display the full timeline of all posts, or with specific type of data:
442
-
443
- * Photos,
444
- * Videos,
445
- * Statuses,
446
- * Links,
447
-
448
-
449
- = What kind of content can I display with my Facebook feed? =
450
-
451
- Using 10Web Facebook Feed plugin, you can display full **Timeline** of your Facebook page, as well as **Specific** data, such as only photos or videos. Use **Content Type** option under **Feed Settings** to select this.
452
-
453
- **Timeline**
454
- With this content type, you can display all posts from the page. Set the number of posts to be displayed. You can choose not to update the feed, and just import selected number of posts once.
455
-
456
- Furthermore, you can configure auto-update to sync your feeds with new posts from your Facebook page.
457
-
458
- Using Timeline content type, you are able to showcase your posts using stunning **Blog Style layout** of 10Web Facebook Feed plugin.
459
-
460
- **Specific**
461
- Display only photos or videos, albums of your Facebook page, using **Specific** content type. You can choose one of the following four options:
462
-
463
- * Photos,
464
- * Videos,
465
- * Albums,
466
-
467
-
468
- The layouts you can use for Specific feeds differ depending on content type.
469
-
470
- * **Photos** and **Videos** can be showcased with **Thumbnails** and **Masonry** layouts,
471
- * For **Albums** you can use **Album** layout,
472
-
473
-
474
- = How do I publish Facebook Feed on my website? =
475
-
476
- You can publish Facebook Feed on a **post** or **page,** as well as with a **widget.**
477
-
478
- **Publishing on Pages and Posts**
479
- To showcase the created feeds on a page or post, you need to use the **shortcode** of 10Web Facebook Feed. Add or edit the page or post, where you need to have your Facebook feed. Press **Add Facebook Feed** button and select the feed.
480
-
481
- After pressing **Insert** button, the shortcode will be added to the content of your page or post.
482
-
483
- **Publishing as a Widget**
484
- Navigate to **Appearance > Widgets** page to begin configuring a Facebook feed widget. Find **10Web Facebook Feed widget** and drag it to the necessary widget area. Fill in the following settings and press **Save.**
485
-
486
- * **Title.** Set a title for your Facebook feed widget.
487
- * **Feed.** Select the feed which you wish to showcase.
488
- * **View.** Choose the layout for the feed. Depending on feed content type, this can be set to Blog Style, Album, Masonry and Thumbnails.
489
- * **Count.** Set a constant number of posts which will be displayed with the widget.
490
- * **Dimensions.** Define the dimensions of Facebook feed widget.
491
- * **Theme.** Select the theme for the widget.
492
-
493
- = How can I change the appearance of Facebook feeds? =
494
-
495
- **Premium** version of 10Web Facebook Feed plugin lets you change the appearance of the feeds using its **Themes.** Navigate to **10Web Facebook Feed > Themes** page to make modifications.
496
-
497
- WordPress Facebook Feed plugin includes **7 built-in themes,** one of which is set to be the default. You can modify these themes or create a new one. You have the option to reset the theme options to their defaults anytime.
498
-
499
- Each theme provided by 10Web Facebook Feed plugin consists of the following sections:
500
-
501
- * **Thumbnails.** Configure options for thumbnail border, hover effect, transition, margin, padding, view and thumbnail background colors and transparency level, image alignment, image title options, like and comment box options.
502
- * **Masonry.** Configure options for masonry thumbnail border, padding, view and thumbnail background colors and transparency level, like and comment box options, hover effects, image description options.
503
- * **Compact Album.** Configure options for thumbnail border, hover effect, transition, margin, shadow, padding, view and thumbnail background colors and transparency level, image title options, back button options.
504
- * **Blog Style.** Configure options for comments box, Like, share, comment display, hashtags, image captions, location and dates, page, profile name and feed overall settings.
505
- * **Lightbox Page.** Configure options for lightbox background, control, toggle, close and navigation buttons, filmstrip options, story options,Like, share, comment display, hashtags and comments options.
506
- * **Navigation.** Configure navigation button options, which will be used for masonry, thumbnail, compact album and blog style views.
507
-
508
- = How can I display comments in the feed? =
509
-
510
- Comments can appear with the standard structure of Facebook, which displays only **Top level** comments without replies, as well as **Stream,** which shows both the comments and their replies.
511
-
512
- If you want to use Top level but give a function to show all replies then enable **Show replies** option. Comment feed can be set either in chronological or reverse chronological order.
513
-
514
-
515
- = Can I modify the appearance of the lightbox? =
516
-
517
- Lightbox of 10Web Facebook Feed plugin can be used for albums, images, videos. You can change the style of the lightbox from **10Web Facebook Feed > Themes** page.
518
-
519
- Furthermore, you can modify the features of it using **Lightbox Settings** tab inside your feed.
520
-
521
- * **Full width lightbox.** The output of the full width lightbox will be a large lightbox covering entire display of the used device.
522
- * **Lightbox dimensions.** If you opt for fixed-size lightbox you need to configure its dimensions.
523
- * **Lightbox effect.** There are 15 lightbox effects for image transitions. You can choose one of them or skip it, setting lightbox effect to **None.**
524
- * **Lightbox autoplay.** Autoplay will change images within given time interval.
525
- * **Time interval.** Set time which will be applied for shifting images in lightbox.
526
- * **Open comment box.** Choose whether to display comments of the image/video in lightbox or not.
527
- * **Show filmstrip in lightbox.** By enabling filmstrip you will display small thumbnails of images/videos included in album/timeline. When hitting a filmstrip thumbnail the user will get a chance to open up the corresponding image/video and continue lightbox navigation from there.
528
-
529
- In addition, you can display comments on the lightbox, likes, author, post name, and much more.
530
-
531
- = My Facebook page feed doesn't display anything. How can this be fixed? =
532
-
533
- The feed might not be working correctly because the page you are trying to display with 10Web Facebook Feed plugin has **age** or **country restrictions.**
534
-
535
- Unfortunately, this cannot be controlled by 10Web Facebook Feed, since Facebook API does not provide data about pages with restrictions.
536
-
537
- Therefore, please make sure to remove the restrictions, and try again.
4
  Requires at least: 3.4
5
  Requires PHP: 5.2
6
  Tested up to: 5.8
7
+ Stable tag: 1.2.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html