WD Facebook Feed – Custom Facebook Feed Plugin - Version 1.2.3

Version Description

  • Fixed: Broken images on album view.
  • Fixed: Comments and likes count.
  • Fixed: Show message for non available posts.
  • Fixed: Statuses and links for Timeline feed.
  • Fixed: Show play button on video thumbnails in Timeline view.
  • Fixed: Number of posts option.
  • Fixed: Broken images in Specific photos.
Download this release

Release Info

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

Code changes from version 1.2.2 to 1.2.3

admin/controllers/FFWDControllerInfo_ffwd.php CHANGED
@@ -67,7 +67,12 @@ class FFWDControllerInfo_ffwd {
67
 
68
  public function save() {
69
  $this->display();
70
- echo WDW_FFWD_Library::message('Item Succesfully Saved.', 'updated');
 
 
 
 
 
71
  }
72
 
73
  public function bwg_get_unique_name($name, $id) {
67
 
68
  public function save() {
69
  $this->display();
70
+ if( isset($_POST['non_public_posts_count']) && intval($_POST['non_public_posts_count']) !== 0 ) {
71
+ echo WDW_FFWD_Library::message('Item Succesfully Saved.<br>The data of '.intval($_POST['non_public_posts_count']).' 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.', 'updated');
72
+ }
73
+ else {
74
+ echo WDW_FFWD_Library::message('Item Succesfully Saved.', 'updated');
75
+ }
76
  }
77
 
78
  public function bwg_get_unique_name($name, $id) {
admin/controllers/FFWDControllerOptions_ffwd.php CHANGED
@@ -8,24 +8,16 @@ class FFWDControllerOptions_ffwd {
8
  public function execute() {
9
  $task = ((isset($_POST['task'])) ? sanitize_text_field(stripslashes($_POST['task'])) : '');
10
  $id = ((isset($_POST['current_id'])) ? sanitize_text_field(stripslashes($_POST['current_id'])) : 0);
11
- if($task != ''){
12
- if(!WDW_FFWD_Library::verify_nonce('options_ffwd')){
13
  die('Sorry, your nonce did not verify.');
14
  }
15
  }
16
-
17
- if(!empty($_GET['ffwd_code'])){
18
- $save_pages = WDFacebookFeed::save_pages($_GET['ffwd_code']);
19
- if ( $save_pages ) {
20
- die('<script>window.location.href="admin.php?page=options_ffwd&success=1"</script>');
21
- }
22
- else{
23
- die('<script>window.location.href="admin.php?page=options_ffwd&success=0"</script>');
24
- }
25
-
26
  }
27
-
28
- if (method_exists($this, $task)) {
29
  $this->$task($id);
30
  }
31
  else {
8
  public function execute() {
9
  $task = ((isset($_POST['task'])) ? sanitize_text_field(stripslashes($_POST['task'])) : '');
10
  $id = ((isset($_POST['current_id'])) ? sanitize_text_field(stripslashes($_POST['current_id'])) : 0);
11
+ if ( $task != '' ) {
12
+ if ( !WDW_FFWD_Library::verify_nonce('options_ffwd') ) {
13
  die('Sorry, your nonce did not verify.');
14
  }
15
  }
16
+ if ( !empty($_GET['ffwd_code']) ) {
17
+ $message_id = WDFacebookFeed::save_pages($_GET['ffwd_code']);
18
+ die('<script>window.location.href="admin.php?page=options_ffwd&success=' . $message_id . '"</script>');
 
 
 
 
 
 
 
19
  }
20
+ if ( method_exists($this, $task) ) {
 
21
  $this->$task($id);
22
  }
23
  else {
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.2
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
@@ -15,7 +15,7 @@ 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.2');
19
  }
20
  add_action( 'admin_init', 'ffwd_init' );
21
 
@@ -986,35 +986,35 @@ function wd_fb_update($from_plugin = 0)
986
  // Check Valid Token and show message
987
  $ffwd_token_error_flag = get_option("ffwd_token_error_flag");
988
  $ffwd_option_reauth_success = ((isset($_GET['success'])) ? $_GET["success"] : '');
989
-
990
- if($ffwd_token_error_flag === "1" || $ffwd_option_reauth_success!=""){
991
  add_action('admin_notices', 'ffwd_token_error_flag_notice');
992
  }
993
 
994
- function ffwd_token_error_flag_notice(){
995
  global $ffwd_token_error_flag, $ffwd_option_reauth_success;
996
  $screen_base = get_current_screen()->base;
997
- if($ffwd_token_error_flag === "1"){
998
- if($screen_base === "dashboard" || $screen_base === "toplevel_page_info_ffwd" || $screen_base === "facebook-feed_page_options_ffwd" || $screen_base === "facebook-feed_page_themes_ffwd" || $screen_base === "facebook-feed_page_uninstall_ffwd" ){
999
- $link_to_reset = "<a href='".site_url()."/wp-admin/admin.php?page=options_ffwd' >reset token</a>";
1000
- if($screen_base === "facebook-feed_page_options_ffwd"){
1001
- $link_to_reset = "reset token";
1002
- }
1003
- echo "<div class='notice notice-error'><p>Facebook token is invalid or expired. Please ". $link_to_reset ." and sign-in again to get new one.</p></div>";
1004
- }
 
 
 
 
 
 
 
 
 
 
 
1005
  }
1006
- if($screen_base === "facebook-feed_page_options_ffwd" && $ffwd_option_reauth_success !=""){
1007
- if($ffwd_option_reauth_success==1){
1008
- echo "<div class='notice notice-success'><p>The Access Token Successfully saved.</p></div>";
1009
- }
1010
- else{
1011
- echo "<div class='notice notice-error'><p>Something wrong. Please try again.</p></div>";
1012
- }
1013
- }
1014
  }
1015
 
1016
-
1017
-
1018
  // Facebook Feed by 10Web Widget.
1019
  if (class_exists('WP_Widget')) {
1020
  add_action('wp_enqueue_scripts', 'ffwd_front_end_scripts');
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.3
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
15
  define('WD_FB_PREFIX', 'ffwd');
16
  define('WD_FB_IS_FREE', true);
17
  if ( !defined('FFWD_VERSION') ) {
18
+ define('FFWD_VERSION', '1.2.3');
19
  }
20
  add_action( 'admin_init', 'ffwd_init' );
21
 
986
  // Check Valid Token and show message
987
  $ffwd_token_error_flag = get_option("ffwd_token_error_flag");
988
  $ffwd_option_reauth_success = ((isset($_GET['success'])) ? $_GET["success"] : '');
989
+ if ( $ffwd_token_error_flag === '1' || $ffwd_option_reauth_success != '' ) {
 
990
  add_action('admin_notices', 'ffwd_token_error_flag_notice');
991
  }
992
 
993
+ function ffwd_token_error_flag_notice() {
994
  global $ffwd_token_error_flag, $ffwd_option_reauth_success;
995
  $screen_base = get_current_screen()->base;
996
+ if ( $ffwd_token_error_flag === '1' ) {
997
+ if ( $screen_base === 'dashboard' || $screen_base === 'toplevel_page_info_ffwd' || $screen_base === 'facebook-feed_page_options_ffwd' || $screen_base === 'facebook-feed_page_themes_ffwd' || $screen_base === 'facebook-feed_page_uninstall_ffwd' ) {
998
+ $link_to_reset = "<a href='" . site_url() . "/wp-admin/admin.php?page=options_ffwd' >reset token</a>";
999
+ if ( $screen_base === "facebook-feed_page_options_ffwd" ) {
1000
+ $link_to_reset = "reset token";
1001
+ }
1002
+ echo "<div class='notice notice-error'><p>" . sprintf(__('Facebook token is invalid or expired. Please %s and sign-in again to get new one.', 'ffwd'), $link_to_reset) . "</p></div>";
1003
+ }
1004
+ }
1005
+ if ( !empty($ffwd_option_reauth_success) ) {
1006
+ if ( $ffwd_option_reauth_success == 1 ) {
1007
+ echo "<div class='notice notice-success'><p>" . __('The Access Token Successfully saved.', 'ffwd') . "</p></div>";
1008
+ }
1009
+ elseif ( $ffwd_option_reauth_success == 2 ) {
1010
+ echo "<div class='notice notice-error'><p>" . sprintf(__('No business pages were selected. Please uninstall the %s app from %s section and reinstall. Then choose the business page/s and re-connect.', 'ffwd'), '<b>10Web Social Feed</b>', '<b>Facebook > Settings > Security and login > Business integrations or Apps and websites</b>') . "</p></div>";
1011
+ }
1012
+ else {
1013
+ echo "<div class='notice notice-error'><p>" . __('Something wrong. Please try again.', 'ffwd') . "</p></div>";
1014
+ }
1015
  }
 
 
 
 
 
 
 
 
1016
  }
1017
 
 
 
1018
  // Facebook Feed by 10Web Widget.
1019
  if (class_exists('WP_Widget')) {
1020
  add_action('wp_enqueue_scripts', 'ffwd_front_end_scripts');
framework/WDFacebookFeed.php CHANGED
@@ -34,11 +34,11 @@ class WDFacebookFeed {
34
  protected static $edit_feed = false;
35
  protected static $update_mode = 'keep_old';
36
  protected static $fb_id;
 
37
 
38
  public static $client_side_check = array();
39
 
40
  public function __construct() {
41
-
42
  }
43
 
44
  public static function execute() {
@@ -721,7 +721,7 @@ class WDFacebookFeed {
721
  $edge,
722
  'access_token=' . self::$access_token . '&',
723
  $fields,
724
- 'limit=' . self::$fb_limit . '&locale=' . get_locale() . '&',
725
  ''
726
  ),
727
  self::$graph_url
@@ -740,6 +740,7 @@ class WDFacebookFeed {
740
  }
741
 
742
  $data['data'] = self::complite_timeline($fb_graph_url);
 
743
  self::$data = $data;
744
  if ( self::$save ) {
745
  self::save_db();
@@ -759,6 +760,25 @@ class WDFacebookFeed {
759
  }
760
  }
761
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
762
  public static function complite_timeline( $fb_graph_url ) {
763
  $content = implode(',', self::$content);
764
  if ( !empty(self::$content) ) {
@@ -771,9 +791,8 @@ class WDFacebookFeed {
771
  $content .= 'video,';
772
  }
773
  if ( $val == 'links') {
774
- // @todo this a new endpoint https://developers.facebook.com/docs/graph-api/reference/page-post/sharedposts/
775
- // $content .= 'link,';
776
- }
777
  }
778
  $content = trim($content, ',');
779
  }
@@ -793,19 +812,26 @@ class WDFacebookFeed {
793
  }
794
  else {
795
  $post_data = !empty($data['data']) ? $data['data'] : array();
 
 
 
 
796
  // Set next page if it exists
797
  $paging = array_key_exists('paging', $data) ? $data['paging'] : array();
798
  $next_page = array_key_exists('next', $paging) ? $paging['next'] : 0;
799
 
800
  foreach ( $post_data as $next ) {
801
  // @todo v10.0 api new logic.
802
- if ( !empty($next['attachments']['data']) && !empty(!empty($next['attachments']['data'][0])) ) {
803
  $attachments = $next['attachments']['data'][0];
804
  $media_type = $attachments['media_type'];
805
- if ( strpos($content, $media_type) === FALSE ) {
806
  continue;
807
  }
808
  }
 
 
 
809
  /* @TODO v3.3 deprecated
810
  * if (strpos($content, $next['type']) === false) {
811
  * continue;
@@ -879,6 +905,10 @@ class WDFacebookFeed {
879
  if ( self::$content_type == 'specific' && self::$content[0] == 'photos' && $type != 'photo' ) {
880
  continue;
881
  }
 
 
 
 
882
  $link = !empty($attachments['url']) ? $attachments['url'] : '';
883
  if ( !empty($attachments['media']) ) {
884
  $media = $attachments['media'];
@@ -1317,6 +1347,7 @@ class WDFacebookFeed {
1317
  */
1318
  self::$fb_id = $wpdb->insert_id;
1319
  if ( $save_fb_info !== false ) {
 
1320
  self::insert_wd_fb_data($data);
1321
  self::insert_wd_fb_info_options($ffwd_info_options);
1322
  }
@@ -1331,6 +1362,7 @@ class WDFacebookFeed {
1331
  * @param $data
1332
  */
1333
  public static function insert_wd_fb_data($data) {
 
1334
  global $wpdb;
1335
  $success = 'no_data';
1336
  $content = implode(',', self::$content);
@@ -1364,7 +1396,7 @@ class WDFacebookFeed {
1364
  $width = '';
1365
  $height = '';
1366
  $attachments = (!empty($next['attachments']['data'][0])) ? $next['attachments']['data'][0] : array();
1367
- if ( self::$content_type == 'timeline' && empty($attachments) ) {
1368
  continue;
1369
  }
1370
  if ( !empty($attachments) ) {
@@ -1626,7 +1658,6 @@ class WDFacebookFeed {
1626
  array($app_id, '', 'access_token=' . self::$access_token . '&', 'fields=roles&', '', ''),
1627
  self::$graph_url
1628
  );
1629
-
1630
  $data = self::decap_do_curl($fb_graph_url);
1631
 
1632
  //check if exists app with such app_id and app_secret
@@ -1726,7 +1757,7 @@ class WDFacebookFeed {
1726
  public static function wd_fb_massage($mood, $massage)
1727
  {
1728
  if(self::$ffwd_fb_massage){
1729
- echo json_encode(array($mood, $massage));
1730
  self::$ffwd_fb_massage = false;
1731
 
1732
  if ( is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX )
@@ -1867,30 +1898,35 @@ class WDFacebookFeed {
1867
  $fb_url = add_query_arg(array(
1868
  'client_id' => $app_id,
1869
  'redirect_uri' => $redirect_uri,
1870
- 'scope' => '',
1871
  ), "https://www.facebook.com/dialog/oauth");
1872
 
1873
  $fb_url .= '&scope=pages_read_engagement,pages_manage_metadata,pages_read_user_content&state=' . base64_encode(json_encode($state));
 
1874
  return $fb_url;
1875
  }
1876
 
1877
- public static function save_pages($access_token){
1878
-
1879
  $url = 'https://graph.facebook.com/me/accounts?limit=500&access_token=' . $access_token;
1880
  $response = wp_remote_get($url);
1881
-
1882
- if(!is_wp_error($response) && wp_remote_retrieve_response_code($response) == 200) {
1883
-
1884
- $pages = json_decode($response['body']);
1885
- update_option('ffwd_pages_list', $pages->data);
1886
- update_option("ffwd_pages_list_success", "1");
1887
- update_option('ffwd_token_error_flag', "0");
1888
-
1889
- self::update_access_tokens();
1890
- return true;
 
 
 
 
1891
  }
1892
 
1893
- return false;
1894
  }
1895
 
1896
  private static function update_access_tokens(){
34
  protected static $edit_feed = false;
35
  protected static $update_mode = 'keep_old';
36
  protected static $fb_id;
37
+ protected static $non_public_share_count = 0;
38
 
39
  public static $client_side_check = array();
40
 
41
  public function __construct() {
 
42
  }
43
 
44
  public static function execute() {
721
  $edge,
722
  'access_token=' . self::$access_token . '&',
723
  $fields,
724
+ 'locale=' . get_locale() . '&',
725
  ''
726
  ),
727
  self::$graph_url
740
  }
741
 
742
  $data['data'] = self::complite_timeline($fb_graph_url);
743
+
744
  self::$data = $data;
745
  if ( self::$save ) {
746
  self::save_db();
760
  }
761
  }
762
 
763
+ /**
764
+ * Getting count of posts which are have media type link and not available
765
+ *
766
+ * @param $datas array posts which we got from endpoint
767
+ *
768
+ * @return int
769
+ */
770
+ public static function get_link_type_count( $datas ) {
771
+ if( !empty($datas) ) {
772
+ $count = 0;
773
+ foreach ( $datas as $data ) {
774
+ if ( !empty($data['attachments']) && !empty($data['attachments']['data'][0]) && $data['attachments']['data'][0]['media_type'] == 'link' && empty($data['attachments']['data'][0]['media']) ) {
775
+ $count++;
776
+ }
777
+ }
778
+ }
779
+ return $count;
780
+ }
781
+
782
  public static function complite_timeline( $fb_graph_url ) {
783
  $content = implode(',', self::$content);
784
  if ( !empty(self::$content) ) {
791
  $content .= 'video,';
792
  }
793
  if ( $val == 'links') {
794
+ $content .= 'link,';
795
+ }
 
796
  }
797
  $content = trim($content, ',');
798
  }
812
  }
813
  else {
814
  $post_data = !empty($data['data']) ? $data['data'] : array();
815
+ if ( strpos($content, 'link') !== FALSE ){
816
+ self::$non_public_share_count += self::get_link_type_count($post_data);
817
+ }
818
+
819
  // Set next page if it exists
820
  $paging = array_key_exists('paging', $data) ? $data['paging'] : array();
821
  $next_page = array_key_exists('next', $paging) ? $paging['next'] : 0;
822
 
823
  foreach ( $post_data as $next ) {
824
  // @todo v10.0 api new logic.
825
+ if ( !empty($next['attachments']['data']) && !empty($next['attachments']['data'][0]) ) {
826
  $attachments = $next['attachments']['data'][0];
827
  $media_type = $attachments['media_type'];
828
+ if ( strpos($content, $media_type) === FALSE) {
829
  continue;
830
  }
831
  }
832
+ if ( !empty($next['attachments']['data']) && $next['attachments']['data'][0]['media_type'] === "link" && empty($next['attachments']['data'][0]['media']) ) {
833
+ continue;
834
+ }
835
  /* @TODO v3.3 deprecated
836
  * if (strpos($content, $next['type']) === false) {
837
  * continue;
905
  if ( self::$content_type == 'specific' && self::$content[0] == 'photos' && $type != 'photo' ) {
906
  continue;
907
  }
908
+ if ( !empty($next['attachments']['data']) && $next['attachments']['data'][0]['media_type'] === "link" && empty($next['attachments']['data'][0]['media']) ) {
909
+ continue;
910
+ }
911
+
912
  $link = !empty($attachments['url']) ? $attachments['url'] : '';
913
  if ( !empty($attachments['media']) ) {
914
  $media = $attachments['media'];
1347
  */
1348
  self::$fb_id = $wpdb->insert_id;
1349
  if ( $save_fb_info !== false ) {
1350
+
1351
  self::insert_wd_fb_data($data);
1352
  self::insert_wd_fb_info_options($ffwd_info_options);
1353
  }
1362
  * @param $data
1363
  */
1364
  public static function insert_wd_fb_data($data) {
1365
+
1366
  global $wpdb;
1367
  $success = 'no_data';
1368
  $content = implode(',', self::$content);
1396
  $width = '';
1397
  $height = '';
1398
  $attachments = (!empty($next['attachments']['data'][0])) ? $next['attachments']['data'][0] : array();
1399
+ if ( self::$content_type == 'timeline' && empty($attachments) && !in_array("statuses", self::$content) ) {
1400
  continue;
1401
  }
1402
  if ( !empty($attachments) ) {
1658
  array($app_id, '', 'access_token=' . self::$access_token . '&', 'fields=roles&', '', ''),
1659
  self::$graph_url
1660
  );
 
1661
  $data = self::decap_do_curl($fb_graph_url);
1662
 
1663
  //check if exists app with such app_id and app_secret
1757
  public static function wd_fb_massage($mood, $massage)
1758
  {
1759
  if(self::$ffwd_fb_massage){
1760
+ echo json_encode(array($mood, $massage, self::$non_public_share_count));
1761
  self::$ffwd_fb_massage = false;
1762
 
1763
  if ( is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX )
1898
  $fb_url = add_query_arg(array(
1899
  'client_id' => $app_id,
1900
  'redirect_uri' => $redirect_uri,
1901
+ 'scope' => 'pages_show_list,pages_read_engagement',
1902
  ), "https://www.facebook.com/dialog/oauth");
1903
 
1904
  $fb_url .= '&scope=pages_read_engagement,pages_manage_metadata,pages_read_user_content&state=' . base64_encode(json_encode($state));
1905
+
1906
  return $fb_url;
1907
  }
1908
 
1909
+ public static function save_pages( $access_token ) {
1910
+ $message_id = 0;
1911
  $url = 'https://graph.facebook.com/me/accounts?limit=500&access_token=' . $access_token;
1912
  $response = wp_remote_get($url);
1913
+ if ( !is_wp_error($response) && wp_remote_retrieve_response_code($response) == 200 ) {
1914
+ if ( !empty($response['body']) ) {
1915
+ $pages = json_decode($response['body']);
1916
+ if ( !empty($pages) && !empty($pages->data) ) {
1917
+ update_option('ffwd_pages_list', $pages->data);
1918
+ update_option("ffwd_pages_list_success", "1");
1919
+ update_option('ffwd_token_error_flag', "0");
1920
+ self::update_access_tokens();
1921
+ $message_id = 1;
1922
+ }
1923
+ else {
1924
+ $message_id = 2;
1925
+ }
1926
+ }
1927
  }
1928
 
1929
+ return $message_id;
1930
  }
1931
 
1932
  private static function update_access_tokens(){
frontend/models/FFWDModelBlog_style.php CHANGED
@@ -5,8 +5,10 @@ class FFWDModelBlog_style extends FFWDModelMain {
5
  public function __construct() {
6
  }
7
 
8
- public function get_ffwd_data($id, $objects_per_page, $sort_by, $ffwd, $sort_direction = ' DESC ') {
9
-
 
 
10
  global $wpdb;
11
  $sort_direction=' DESC ';
12
  if (isset($_REQUEST['page_number_' . $ffwd]) && $_REQUEST['page_number_' . $ffwd]) {
@@ -15,6 +17,8 @@ class FFWDModelBlog_style extends FFWDModelMain {
15
  else {
16
  $limit = 0;
17
  }
 
 
18
  if ($objects_per_page) {
19
  $limit_str = 'LIMIT ' . $limit . ',' . $objects_per_page;
20
  }
5
  public function __construct() {
6
  }
7
 
8
+ /**
9
+ * @param $max_limit int maximum number of posts
10
+ */
11
+ public function get_ffwd_data($id, $objects_per_page, $sort_by, $ffwd, $max_limit, $sort_direction = ' DESC ') {
12
  global $wpdb;
13
  $sort_direction=' DESC ';
14
  if (isset($_REQUEST['page_number_' . $ffwd]) && $_REQUEST['page_number_' . $ffwd]) {
17
  else {
18
  $limit = 0;
19
  }
20
+ $objects_per_page = (($limit+$objects_per_page) < $max_limit) ? $objects_per_page : ($max_limit-$limit);
21
+
22
  if ($objects_per_page) {
23
  $limit_str = 'LIMIT ' . $limit . ',' . $objects_per_page;
24
  }
frontend/views/FFWDViewBlog_style.php CHANGED
@@ -34,7 +34,7 @@ class FFWDViewBlog_style {
34
  return;
35
  }
36
 
37
- $ffwd_data = $this->model->get_ffwd_data($params['fb_id'], $ffwd_info['objects_per_page'], /*$ffwd_info['sort_by']*/'', $ffwd, /*$order_by*/ 'DESC');
38
  if (!$ffwd_data) {
39
  echo WDW_FFWD_Library::message(__('There are no objects in this facebook feed.', 'ffwd'), 'error');
40
  }
@@ -189,7 +189,7 @@ class FFWDViewBlog_style {
189
  }
190
 
191
  #ffwd_container1_<?php echo $ffwd; ?> #ffwd_container2_<?php echo $ffwd; ?> .ffwd_play_icon_<?php echo $ffwd; ?>:hover {
192
- background: url('<?php echo WD_FFWD_URL . '/images/feed/play.png' ?>') no-repeat center center;
193
  background-size: 40px;
194
  cursor: pointer;
195
  }
@@ -1063,7 +1063,8 @@ class FFWDViewBlog_style {
1063
  </div>
1064
  <?php
1065
  if ($ffwd_info['pagination_type'] && $ffwd_info['objects_per_page'] && $theme_row->page_nav_position == 'top') {
1066
- WDW_FFWD_Library::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'ffwd_front_form_' . $ffwd, $ffwd_info['objects_per_page'], $ffwd, 'ffwd_standart_objects_' . $ffwd, 0, 'album', /*$options_row->enable_seo*/true, $ffwd_info['pagination_type']);
 
1067
  }
1068
  ?>
1069
  <div class="blog_style_objects_<?php echo $ffwd; ?>" id="ffwd_standart_objects_<?php echo $ffwd; ?>" >
@@ -1125,7 +1126,7 @@ class FFWDViewBlog_style {
1125
  ?>
1126
  </div>
1127
  <?php if($ffwd_data_row->type != 'status') :
1128
- $src = ($ffwd_data_row->type != 'events') ? '' : $ffwd_data_row->source;
1129
  $class_name = ($ffwd_data_row->type == 'link') ? 'ffwd_link_' . $ffwd : 'ffwd_lightbox_' . $ffwd;
1130
  $href = ($ffwd_data_row->type == 'link') ? $ffwd_data_row->link : "";
1131
  $link_to_facebook = ($ffwd_data_row->link != "" && $ffwd_data_row->type != "link" && $ffwd_data_row->type != "video") ? $ffwd_data_row->link : "https://www.facebook.com/".$ffwd_data_row->object_id;
@@ -1149,7 +1150,7 @@ class FFWDViewBlog_style {
1149
  <a style="position:relative;" class="<?php echo $class_name; ?>" href="<?php echo $href; ?>" target="_blank" <?php echo $ffwd_data_row->type == 'video' ? 'data-type="video"' : '' ?> data-id="<?php echo $ffwd_data_row->id; ?>" >
1150
  <div class="bwg_blog_style_img_cont_<?php echo $ffwd; ?>">
1151
  <img id="ffwd_blog_style_img_<?php echo $ffwd_data_row->id; ?>_<?php echo $ffwd; ?>" class="ffwd_blog_style_img_<?php echo $ffwd; ?>" src="<?php echo $src; ?>" />
1152
- <?php if($ffwd_data_row->type == 'video'): ?>
1153
  <div class="ffwd_play_icon_<?php echo $ffwd; ?>" data-type="video" data-id="<?php echo $ffwd_data_row->id; ?>" >
1154
  </div>
1155
  <?php endif; ?>
@@ -1162,7 +1163,7 @@ class FFWDViewBlog_style {
1162
  <div style="clear:both">
1163
  </div>
1164
  <?php
1165
- if ( $show_comments || $show_likes || $show_shares ) { ?>
1166
  <div class="ffwd_title_spun1_<?php echo $ffwd; ?>">
1167
  <?php
1168
  if($show_comments || $show_likes || $show_shares) { ?>
@@ -1279,7 +1280,8 @@ class FFWDViewBlog_style {
1279
  </div>
1280
  <?php
1281
  if ($ffwd_info['pagination_type'] && $ffwd_info['objects_per_page'] && ($theme_row->page_nav_position == 'bottom')) {
1282
- WDW_FFWD_Library::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'ffwd_front_form_' . $ffwd, $ffwd_info['objects_per_page'], $ffwd, 'ffwd_standart_objcets_cont_' . $ffwd, 0, 'album', /*$options_row->enable_seo*/true, $ffwd_info['pagination_type']);
 
1283
  }
1284
  ?>
1285
  </div>
34
  return;
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
  }
189
  }
190
 
191
  #ffwd_container1_<?php echo $ffwd; ?> #ffwd_container2_<?php echo $ffwd; ?> .ffwd_play_icon_<?php echo $ffwd; ?>:hover {
192
+ background: url('<?php echo WD_FFWD_URL . '/images/feed/play.png' ?>') no-repeat center center, rgba(0, 0, 0, 0.46);
193
  background-size: 40px;
194
  cursor: pointer;
195
  }
1063
  </div>
1064
  <?php
1065
  if ($ffwd_info['pagination_type'] && $ffwd_info['objects_per_page'] && $theme_row->page_nav_position == 'top') {
1066
+ $page_nav['total'] = ($page_nav['total'] <= $ffwd_info['limit']) ? $page_nav['total'] : $ffwd_info['limit'];
1067
+ WDW_FFWD_Library::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'ffwd_front_form_' . $ffwd, $ffwd_info['objects_per_page'], $ffwd, 'ffwd_standart_objects_' . $ffwd, 0, 'album', /*$options_row->enable_seo*/true, $ffwd_info['pagination_type']);
1068
  }
1069
  ?>
1070
  <div class="blog_style_objects_<?php echo $ffwd; ?>" id="ffwd_standart_objects_<?php echo $ffwd; ?>" >
1126
  ?>
1127
  </div>
1128
  <?php if($ffwd_data_row->type != 'status') :
1129
+ $src = ($ffwd_data_row->type != 'events') ? WD_FFWD_URL . '/images/no-image.png' : $ffwd_data_row->source;
1130
  $class_name = ($ffwd_data_row->type == 'link') ? 'ffwd_link_' . $ffwd : 'ffwd_lightbox_' . $ffwd;
1131
  $href = ($ffwd_data_row->type == 'link') ? $ffwd_data_row->link : "";
1132
  $link_to_facebook = ($ffwd_data_row->link != "" && $ffwd_data_row->type != "link" && $ffwd_data_row->type != "video") ? $ffwd_data_row->link : "https://www.facebook.com/".$ffwd_data_row->object_id;
1150
  <a style="position:relative;" class="<?php echo $class_name; ?>" href="<?php echo $href; ?>" target="_blank" <?php echo $ffwd_data_row->type == 'video' ? 'data-type="video"' : '' ?> data-id="<?php echo $ffwd_data_row->id; ?>" >
1151
  <div class="bwg_blog_style_img_cont_<?php echo $ffwd; ?>">
1152
  <img id="ffwd_blog_style_img_<?php echo $ffwd_data_row->id; ?>_<?php echo $ffwd; ?>" class="ffwd_blog_style_img_<?php echo $ffwd; ?>" src="<?php echo $src; ?>" />
1153
+ <?php if($ffwd_data_row->type == 'video' || $ffwd_data_row->type == 'videos'): ?>
1154
  <div class="ffwd_play_icon_<?php echo $ffwd; ?>" data-type="video" data-id="<?php echo $ffwd_data_row->id; ?>" >
1155
  </div>
1156
  <?php endif; ?>
1163
  <div style="clear:both">
1164
  </div>
1165
  <?php
1166
+ if($show_comments || $show_likes || $show_shares || $show_shares_butt) { ?>
1167
  <div class="ffwd_title_spun1_<?php echo $ffwd; ?>">
1168
  <?php
1169
  if($show_comments || $show_likes || $show_shares) { ?>
1280
  </div>
1281
  <?php
1282
  if ($ffwd_info['pagination_type'] && $ffwd_info['objects_per_page'] && ($theme_row->page_nav_position == 'bottom')) {
1283
+ $page_nav['total'] = ($page_nav['total'] <= $ffwd_info['limit']) ? $page_nav['total'] : $ffwd_info['limit'];
1284
+ WDW_FFWD_Library::ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'ffwd_front_form_' . $ffwd, $ffwd_info['objects_per_page'], $ffwd, 'ffwd_standart_objcets_cont_' . $ffwd, 0, 'album', /*$options_row->enable_seo*/true, $ffwd_info['pagination_type']);
1285
  }
1286
  ?>
1287
  </div>
js/ffwd.js CHANGED
@@ -257,12 +257,21 @@ function spider_ajax_save(wd_fb_prefix) {
257
  }
258
  switch (task) {
259
  case "apply":
 
 
 
 
 
260
  jQuery("#task").val("");
261
- jQuery('#message_div').html("<strong><p>Items Succesfully Saved.</p></strong>");
262
  jQuery('#message_div').show();
263
  jQuery('#ffwd_page_url,#page_access_token,#name').removeAttr("style");
264
  break;
265
  case "save":
 
 
 
 
266
  jQuery("#ffwd_info_form").submit();
267
  break;
268
  default:
@@ -803,7 +812,6 @@ function bwg_change_theme_type(type) {
803
  }
804
 
805
  jQuery(document).ready(function () {
806
- choose_fb_content_type('ffwd', 'timeline');
807
  jQuery(".ffwd_reset_cache").click(function ( e ) {
808
  jQuery(".ffwd_reset_cache_res").html("");
809
  e.preventDefault();
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:
812
  }
813
 
814
  jQuery(document).ready(function () {
 
815
  jQuery(".ffwd_reset_cache").click(function ( e ) {
816
  jQuery(".ffwd_reset_cache_res").html("");
817
  e.preventDefault();
js/ffwd_frontend.js CHANGED
@@ -67,10 +67,6 @@ function ffwd_frontend_ajax(form_id, current_view, id, album_id, enter_or_back,
67
  }
68
  /* For thumnail amd masonry view */
69
  function ffwd_fill_likes_thumnail(id_object_id, ffwd, graph_url) {
70
- /*
71
- TODO: Need to change endpoint
72
- */
73
- return;
74
  var ids_array_count=Math.ceil(id_object_id.length/50);
75
  var ids_array=[];
76
  var img_ids=[];
@@ -84,7 +80,7 @@ function ffwd_fill_likes_thumnail(id_object_id, ffwd, graph_url) {
84
  break;
85
 
86
  ids_array[i][k]=[];
87
- var object_id = id_object_id[i]['from']+'_'+id_object_id[j]['object_id']
88
 
89
 
90
  ids_array[i][k]=object_id;
@@ -482,10 +478,8 @@ function do_something_with_data_album(result, id, ffwd, type, graph_url, ffwd_al
482
  jQuery.getJSON(graph_url_for_comments,
483
  function(result)
484
  {
485
-
486
  for(var j in result)
487
  {
488
-
489
  ffwd_fill_likes_comments_c_gallery(result[j],ffwd,img_ids[j]);
490
  // console.log(result[j]);
491
 
@@ -560,128 +554,88 @@ function ffwd_get_passed_time(time) {
560
  }
561
  }
562
 
563
- function ffwd_fill_likes_blog_style(id_object_id, ffwd, owner_info, ffwd_params, graph_url) {
564
-
565
-
566
-
567
- var ids_array_count=Math.ceil(id_object_id.length/50);
568
- var ids_array=[];
569
- var img_ids=[];
570
- for(var i = 0; i < ids_array_count; i++)
571
- {
572
- ids_array[i]=[];
573
- k=0;
574
- for(var j = i*50; j < (i+1)*50; j++ )
575
- {
576
- if(!id_object_id[j])
577
  break;
578
-
579
- ids_array[i][k]=[];
580
  var object_id = id_object_id[j]['object_id'];
581
-
582
-
583
- ids_array[i][k]=object_id;
584
- img_ids[object_id]=id_object_id[j]['id'];
585
  k++;
586
  }
587
-
588
  }
589
-
590
- var reactions_array={};
591
-
592
-
593
- for(var i = 0; i < ids_array.length; i++)
594
- {
595
- ids=ids_array[i].join(',');
596
- url_for_cur_id_likes_blog = graph_url.replace('{FB_ID}',''),
597
  graph_url_for_likes = url_for_cur_id_likes_blog.replace('{EDGE}', '');
598
- graph_url_for_likes = graph_url_for_likes.replace('{FIELDS}', 'ids='+ids+'&fields=comments.summary(true).limit(0),likes.summary(true).limit(0)&');
599
  graph_url_for_likes = graph_url_for_likes.replace('{OTHER}', '');
600
-
601
  jQuery.getJSON(graph_url_for_likes,
602
- function(result)
603
- {
604
-
605
- for(var j in result)
606
- {
607
- var likes_count = (typeof result[j]['likes']['summary'] != 'undefined') ? parseInt(result[j]['likes']['summary']['total_count']) : '0';
608
- jQuery('#ffwd_likes_' + ffwd + '_' + img_ids[j] + ' span').html(likes_count);
609
-
610
- }
611
-
612
- }
613
  );
614
  }
615
-
616
- for (var i = 0; i < id_object_id.length; i++) {
617
-
618
-
619
  /*For likes*/
620
-
621
- var object_id = id_object_id[i]['object_id'].replace(id_object_id[i]['from'], owner_info['id']);
622
- url_for_cur_id = graph_url.replace('{FB_ID}', object_id);
623
- graph_url_for_likes = url_for_cur_id.replace('{EDGE}', '');
624
  graph_url_for_likes = graph_url_for_likes.replace('{FIELDS}', 'fields=reactions.type(LIKE).limit(0).summary(true).as(like),reactions.type(LOVE).limit(0).summary(true).as(love),reactions.type(WOW).limit(0).summary(true).as(wow),reactions.type(HAHA).limit(0).summary(true).as(haha),reactions.type(SAD).limit(0).summary(true).as(sad),reactions.type(ANGRY).limit(0).summary(true).as(angry),reactions.limit(5).summary(true).as(total_reactions)&');
625
  graph_url_for_likes = graph_url_for_likes.replace('{OTHER}', 'summary=true');
626
-
627
  /*For comments*/
628
-
629
-
630
-
631
-
632
  var graph_url_for_comments = url_for_cur_id.replace('{EDGE}', 'comments');
633
  graph_url_for_comments = graph_url_for_comments.replace('{FIELDS}', 'fields=created_time,from,like_count,message,comment_count&');
634
  graph_url_for_comments = graph_url_for_comments.replace('{OTHER}', 'summary=true&filter=' + ffwd_params["comments_filter"] + '&order=' + ffwd_params["comments_order"] + '&limit=25');
635
-
636
  /*For future (attachment message_tags fields)*/
637
  /*console.log(graph_url_for_comments);*/
638
  /*For shares*/
639
  var graph_url_for_shares = url_for_cur_id.replace('{EDGE}', '');
640
  graph_url_for_shares = graph_url_for_shares.replace('{FIELDS}', 'fields=shares&');
641
  graph_url_for_shares = graph_url_for_shares.replace('{OTHER}', '');
642
-
643
  /*For attachments*/
644
  var graph_url_for_attachments = url_for_cur_id.replace('{EDGE}', 'attachments'),
645
- graph_url_for_attachments = graph_url_for_attachments.replace('{FIELDS}', '');
646
  graph_url_for_attachments = graph_url_for_attachments.replace('{OTHER}', '');
647
-
648
  /*For who post*/
649
-
650
  var url_for_who_post = graph_url.replace('{FB_ID}', id_object_id[i]['from']),
651
-
652
- graph_url_for_who_post = url_for_who_post.replace('{EDGE}', ''),
653
- graph_url_for_who_post = graph_url_for_who_post.replace('{FIELDS}', 'fields=picture,name,link&');
654
  graph_url_for_who_post = graph_url_for_who_post.replace('{OTHER}', '');
655
-
656
- if (id_object_id[i]['type'] != 'events') {
657
  //jQuery.getJSON(graph_url_for_likes, createCallback_blog_style(id_object_id[i]['id'], ffwd, 'likes'));
658
  //jQuery.getJSON(graph_url_for_shares, createCallback_blog_style(id_object_id[i]['id'], ffwd, 'shares'));
659
-
660
-
661
- //do_something_with_data_blog_style(reactions_array[object_id], id_object_id[i]['id'], ffwd, 'likes', "", ffwd_params, graph_url);
662
-
663
- if(!id_object_id[i]['shares'])
664
- {
665
- id_object_id[i]['shares']='{}';
666
  }
667
-
668
  do_something_with_data_blog_style(id_object_id[i]['shares'], id_object_id[i]['id'], ffwd, 'shares', "", ffwd_params, graph_url);
669
-
670
  // jQuery.getJSON(graph_url_for_attachments, createCallback_blog_style(id_object_id[i]['id'], ffwd, 'attachments', "", ffwd_params));
671
- if(id_object_id[i]['attachments'])
672
- do_something_with_data_blog_style(id_object_id[i]['attachments'], id_object_id[i]['id'], ffwd, 'attachments', "", ffwd_params, graph_url);
673
-
 
 
 
 
 
 
 
674
  }
675
-
676
- if(id_object_id[i]['comments']);
677
- do_something_with_data_blog_style(id_object_id[i]['comments'], id_object_id[i]['id'], ffwd, 'comments', "", ffwd_params, graph_url);
678
-
679
- // jQuery.getJSON(id_object_id[i]['comments'], createCallback_blog_style(id_object_id[i]['id'], ffwd, 'comments', "", ffwd_params, graph_url));
680
- //jQuery.getJSON(graph_url_for_who_post, createCallback_blog_style(id_object_id[i], ffwd, 'who_post', owner_info, ffwd_params));
681
  do_something_with_data_blog_style(id_object_id[i]['who_post'], id_object_id[i], ffwd, 'who_post', owner_info, ffwd_params, graph_url);
682
-
683
-
684
-
685
  }
686
  }
687
 
@@ -930,7 +884,6 @@ jQuery( document ).ready(function() {
930
  //}
931
 
932
 
933
-
934
  //var ffwd_result = jQuery(this).data("next_url");
935
  jQuery.getJSON(ffwd_graph_url, function (result) {
936
 
@@ -965,14 +918,13 @@ function ffwd_get_comments_replies(comment_id,graph_url,ffwd_params,ffwd) {
965
  url_for_cur_id_comm_rep_user_pic = url_for_cur_id_comm_rep_user_pic.replace('{FIELDS}', 'fields=picture&');
966
  url_for_cur_id_comm_rep_user_pic = url_for_cur_id_comm_rep_user_pic.replace('{OTHER}', '');
967
 
968
- var comment_reply_author_pic = '<div style="float:left" class="ffwd_comment_reply_author_pic_' + ffwd + '" > <img class="reply_user_' + result['data'][k]['from']['id'] + '" src="https://graph.facebook.com/'+result['data'][k]['from']['id']+'/picture" > </div>',
969
- comment_reply_author_name = '<a href="https://www.facebook.com/' + result['data'][k]['from']['id'] + '" class="ffwd_comment_reply_author_name_' + ffwd + '" > ' + result['data'][k]['from']['name'] + ' </a>',
970
  comment_reply_message = '<span class="ffwd_comment_reply_message_' + ffwd + '" > ' + result['data'][k]['message'] + ' </span>',
971
  comment_reply_date = '<span class="ffwd_comment_reply_date_' + ffwd + '" > ' + ffwd_get_passed_time(result['data'][k]['created_time']) + '</span>',
972
  comment_reply_likes_count = '<span class="ffwd_comment_reply_likes_count_' + ffwd + '" > ' + result['data'][k]['like_count'] + ' </span>',
973
  comments_reply_date_likes = '<div>' + comment_reply_date + comment_reply_likes_count + '</div>',
974
  comment_reply_div_cont = '<div class="ffwd_comment_reply_content_' + ffwd + '" >' + comment_reply_author_name + comment_reply_message + comments_reply_date_likes + '<div style="clear:both"></div></div>',
975
- comment_reply = '<div id="ffwd_comment_reply_' + ffwd + '_' + comment_reply_id + '" class="ffwd_comment_reply_' + ffwd + '">' + comment_reply_author_pic + comment_reply_div_cont + '<div style="clear:both" > </div></div>';
976
  jQuery('#ffwd_comment_' + ffwd + '_' + parent_comm_id + ' .ffwd_comment_replies_content_' + ffwd).append(comment_reply);
977
 
978
  }
67
  }
68
  /* For thumnail amd masonry view */
69
  function ffwd_fill_likes_thumnail(id_object_id, ffwd, graph_url) {
 
 
 
 
70
  var ids_array_count=Math.ceil(id_object_id.length/50);
71
  var ids_array=[];
72
  var img_ids=[];
80
  break;
81
 
82
  ids_array[i][k]=[];
83
+ var object_id = id_object_id[j]['object_id']
84
 
85
 
86
  ids_array[i][k]=object_id;
478
  jQuery.getJSON(graph_url_for_comments,
479
  function(result)
480
  {
 
481
  for(var j in result)
482
  {
 
483
  ffwd_fill_likes_comments_c_gallery(result[j],ffwd,img_ids[j]);
484
  // console.log(result[j]);
485
 
554
  }
555
  }
556
 
557
+ function ffwd_fill_likes_blog_style( id_object_id, ffwd, owner_info, ffwd_params, graph_url ) {
558
+ var ids_array_count = Math.ceil(id_object_id.length / 50);
559
+ var ids_array = [];
560
+ var img_ids = [];
561
+ for ( var i = 0; i < ids_array_count; i++ ) {
562
+ ids_array[i] = [];
563
+ k = 0;
564
+ for ( var j = i * 50; j < (i + 1) * 50; j++ ) {
565
+ if ( !id_object_id[j] ) {
 
 
 
 
 
566
  break;
567
+ }
568
+ ids_array[i][k] = [];
569
  var object_id = id_object_id[j]['object_id'];
570
+ ids_array[i][k] = object_id;
571
+ img_ids[object_id] = id_object_id[j]['id'];
 
 
572
  k++;
573
  }
 
574
  }
575
+ var reactions_array = {};
576
+ for ( var i = 0; i < ids_array.length; i++ ) {
577
+ ids = ids_array[i].join(',');
578
+ url_for_cur_id_likes_blog = graph_url.replace('{FB_ID}', ''),
 
 
 
 
579
  graph_url_for_likes = url_for_cur_id_likes_blog.replace('{EDGE}', '');
580
+ graph_url_for_likes = graph_url_for_likes.replace('{FIELDS}', 'ids=' + ids + '&fields=comments.summary(true).limit(0),likes.summary(true).limit(0)&');
581
  graph_url_for_likes = graph_url_for_likes.replace('{OTHER}', '');
 
582
  jQuery.getJSON(graph_url_for_likes,
583
+ function ( result ) {
584
+ for ( var j in result ) {
585
+ var likes_count = (typeof result[j]['likes']['summary'] != 'undefined') ? parseInt(result[j]['likes']['summary']['total_count']) : '0';
586
+ jQuery('#ffwd_likes_' + ffwd + '_' + img_ids[j] + ' span').html(likes_count);
587
+ }
588
+ }
 
 
 
 
 
589
  );
590
  }
591
+ for ( var i = 0; i < id_object_id.length; i++ ) {
 
 
 
592
  /*For likes*/
593
+ //var object_id = id_object_id[i]['object_id'].replace(id_object_id[i]['from'], owner_info['id']);
594
+ var object_id = id_object_id[i]['object_id'];
595
+ url_for_cur_id = graph_url.replace('{FB_ID}', object_id);
596
+ graph_url_for_likes = url_for_cur_id.replace('{EDGE}', '');
597
  graph_url_for_likes = graph_url_for_likes.replace('{FIELDS}', 'fields=reactions.type(LIKE).limit(0).summary(true).as(like),reactions.type(LOVE).limit(0).summary(true).as(love),reactions.type(WOW).limit(0).summary(true).as(wow),reactions.type(HAHA).limit(0).summary(true).as(haha),reactions.type(SAD).limit(0).summary(true).as(sad),reactions.type(ANGRY).limit(0).summary(true).as(angry),reactions.limit(5).summary(true).as(total_reactions)&');
598
  graph_url_for_likes = graph_url_for_likes.replace('{OTHER}', 'summary=true');
 
599
  /*For comments*/
 
 
 
 
600
  var graph_url_for_comments = url_for_cur_id.replace('{EDGE}', 'comments');
601
  graph_url_for_comments = graph_url_for_comments.replace('{FIELDS}', 'fields=created_time,from,like_count,message,comment_count&');
602
  graph_url_for_comments = graph_url_for_comments.replace('{OTHER}', 'summary=true&filter=' + ffwd_params["comments_filter"] + '&order=' + ffwd_params["comments_order"] + '&limit=25');
 
603
  /*For future (attachment message_tags fields)*/
604
  /*console.log(graph_url_for_comments);*/
605
  /*For shares*/
606
  var graph_url_for_shares = url_for_cur_id.replace('{EDGE}', '');
607
  graph_url_for_shares = graph_url_for_shares.replace('{FIELDS}', 'fields=shares&');
608
  graph_url_for_shares = graph_url_for_shares.replace('{OTHER}', '');
 
609
  /*For attachments*/
610
  var graph_url_for_attachments = url_for_cur_id.replace('{EDGE}', 'attachments'),
611
+ graph_url_for_attachments = graph_url_for_attachments.replace('{FIELDS}', '');
612
  graph_url_for_attachments = graph_url_for_attachments.replace('{OTHER}', '');
 
613
  /*For who post*/
 
614
  var url_for_who_post = graph_url.replace('{FB_ID}', id_object_id[i]['from']),
615
+ graph_url_for_who_post = url_for_who_post.replace('{EDGE}', ''),
616
+ graph_url_for_who_post = graph_url_for_who_post.replace('{FIELDS}', 'fields=picture,name,link&');
 
617
  graph_url_for_who_post = graph_url_for_who_post.replace('{OTHER}', '');
618
+ if ( id_object_id[i]['type'] != 'events' ) {
 
619
  //jQuery.getJSON(graph_url_for_likes, createCallback_blog_style(id_object_id[i]['id'], ffwd, 'likes'));
620
  //jQuery.getJSON(graph_url_for_shares, createCallback_blog_style(id_object_id[i]['id'], ffwd, 'shares'));
621
+ //do_something_with_data_blog_style(reactions_array[object_id], id_object_id[i]['id'], ffwd, 'likes', "", ffwd_params, graph_url);
622
+ if ( !id_object_id[i]['shares'] ) {
623
+ id_object_id[i]['shares'] = '{}';
 
 
 
 
624
  }
 
625
  do_something_with_data_blog_style(id_object_id[i]['shares'], id_object_id[i]['id'], ffwd, 'shares', "", ffwd_params, graph_url);
 
626
  // jQuery.getJSON(graph_url_for_attachments, createCallback_blog_style(id_object_id[i]['id'], ffwd, 'attachments', "", ffwd_params));
627
+ if ( id_object_id[i]['attachments'] ) {
628
+ do_something_with_data_blog_style(id_object_id[i]['attachments'], id_object_id[i]['id'], ffwd, 'attachments', "", ffwd_params, graph_url);
629
+ }
630
+ }
631
+ if ( id_object_id[i]['comments'] && id_object_id[i]['comments'].data.length > 0 ) {
632
+ jQuery.getJSON(graph_url_for_comments, createCallback_blog_style(id_object_id[i]['id'], ffwd, 'comments', "", ffwd_params, graph_url));
633
+ // do_something_with_data_blog_style(id_object_id[i]['comments'], id_object_id[i]['id'], ffwd, 'comments', "", ffwd_params, graph_url);
634
+ //jQuery.getJSON(id_object_id[i]['comments'], createCallback_blog_style(id_object_id[i]['id'], ffwd, 'comments', "", ffwd_params, graph_url));
635
+ //jQuery.getJSON(graph_url_for_who_post, createCallback_blog_style(id_object_id[i], ffwd, 'who_post', owner_info, ffwd_params));
636
+ //
637
  }
 
 
 
 
 
 
638
  do_something_with_data_blog_style(id_object_id[i]['who_post'], id_object_id[i], ffwd, 'who_post', owner_info, ffwd_params, graph_url);
 
 
 
639
  }
640
  }
641
 
884
  //}
885
 
886
 
 
887
  //var ffwd_result = jQuery(this).data("next_url");
888
  jQuery.getJSON(ffwd_graph_url, function (result) {
889
 
918
  url_for_cur_id_comm_rep_user_pic = url_for_cur_id_comm_rep_user_pic.replace('{FIELDS}', 'fields=picture&');
919
  url_for_cur_id_comm_rep_user_pic = url_for_cur_id_comm_rep_user_pic.replace('{OTHER}', '');
920
 
921
+ var comment_reply_author_name = '<a href="https://www.facebook.com/' + result['data'][k]['from']['id'] + '" class="ffwd_comment_reply_author_name_' + ffwd + '" > ' + result['data'][k]['from']['name'] + ' </a>',
 
922
  comment_reply_message = '<span class="ffwd_comment_reply_message_' + ffwd + '" > ' + result['data'][k]['message'] + ' </span>',
923
  comment_reply_date = '<span class="ffwd_comment_reply_date_' + ffwd + '" > ' + ffwd_get_passed_time(result['data'][k]['created_time']) + '</span>',
924
  comment_reply_likes_count = '<span class="ffwd_comment_reply_likes_count_' + ffwd + '" > ' + result['data'][k]['like_count'] + ' </span>',
925
  comments_reply_date_likes = '<div>' + comment_reply_date + comment_reply_likes_count + '</div>',
926
  comment_reply_div_cont = '<div class="ffwd_comment_reply_content_' + ffwd + '" >' + comment_reply_author_name + comment_reply_message + comments_reply_date_likes + '<div style="clear:both"></div></div>',
927
+ comment_reply = '<div id="ffwd_comment_reply_' + ffwd + '_' + comment_reply_id + '" class="ffwd_comment_reply_' + ffwd + '">' + comment_reply_div_cont + '<div style="clear:both" > </div></div>';
928
  jQuery('#ffwd_comment_' + ffwd + '_' + parent_comm_id + ' .ffwd_comment_replies_content_' + ffwd).append(comment_reply);
929
 
930
  }
js/ffwd_gallery_box.js CHANGED
@@ -818,7 +818,6 @@ function ffwd_fill_likes_comments(key)
818
  }
819
  var gallery_box_comments_key = null;
820
  function gallery_box_comments(result, key) {
821
- console.log("aaaaaaaaaaaaa");
822
  var likes_count = (typeof result['likes']['summary'] != 'undefined') ? parseInt(result['likes']['summary']['total_count']) : 0;
823
  jQuery('#ffwd_likes span').html(likes_count);
824
  if(likes_count >= 3) {
818
  }
819
  var gallery_box_comments_key = null;
820
  function gallery_box_comments(result, key) {
 
821
  var likes_count = (typeof result['likes']['summary'] != 'undefined') ? parseInt(result['likes']['summary']['total_count']) : 0;
822
  jQuery('#ffwd_likes span').html(likes_count);
823
  if(likes_count >= 3) {
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webdorado,10web,wdsupport
3
  Tags: customizable facebook feed, facebook, facebook feed, facebook group, facebook like box, facebook likes, facebook page, facebook photos, facebook plugin, facebook posts, facebook likebox
4
  Requires at least: 3.4
5
  Requires PHP: 5.2
6
- Tested up to: 5.7
7
- Stable tag: 1.2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -104,6 +104,15 @@ If you think you found a bug in 10Web Facebook Feed or have any problem/question
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.2 =
108
  * Fixed: Duplicate Facebook posts on auto-update.
109
 
3
  Tags: customizable facebook feed, facebook, facebook feed, facebook group, facebook like box, facebook likes, facebook page, facebook photos, facebook plugin, facebook posts, facebook likebox
4
  Requires at least: 3.4
5
  Requires PHP: 5.2
6
+ Tested up to: 5.8
7
+ Stable tag: 1.2.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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.3 =
108
+ * Fixed: Broken images on album view.
109
+ * Fixed: Comments and likes count.
110
+ * Fixed: Show message for non available posts.
111
+ * Fixed: Statuses and links for Timeline feed.
112
+ * Fixed: Show play button on video thumbnails in Timeline view.
113
+ * Fixed: Number of posts option.
114
+ * Fixed: Broken images in Specific photos.
115
+
116
  = 1.2.2 =
117
  * Fixed: Duplicate Facebook posts on auto-update.
118