WD Facebook Feed – Custom Facebook Feed Plugin - Version 1.0.16

Version Description

  • Fixed: Conflict with Visual Composer
  • Changed: Data optimization
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 WD Facebook Feed – Custom Facebook Feed Plugin
Version 1.0.16
Comparing to
See all releases

Code changes from version 1.0.15 to 1.0.16

facebook-feed-wd.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Facebook Feed WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-facebook-feed-plugin.html
6
  * Description:Facebook Feed WD is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
7
- * Version: 1.0.15
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -729,7 +729,7 @@ add_action('init', 'ffwd_language_load');
729
  function ffwd_version()
730
  {
731
 
732
- $version = '1.0.15';
733
 
734
  if (get_option('ffwd_version') === false) {
735
  add_option('ffwd_version', $version);
4
  * Plugin Name: Facebook Feed WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-facebook-feed-plugin.html
6
  * Description:Facebook Feed WD is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
7
+ * Version: 1.0.16
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
729
  function ffwd_version()
730
  {
731
 
732
+ $version = '1.0.16';
733
 
734
  if (get_option('ffwd_version') === false) {
735
  add_option('ffwd_version', $version);
frontend/models/FFWDModelBlog_style.php CHANGED
@@ -36,6 +36,8 @@ class FFWDModelBlog_style extends FFWDModelMain {
36
  // Store ids ans object_ids
37
  $id_object_id_json = array();
38
  foreach($results as $row) {
 
 
39
  $object = new stdClass();
40
  $object->id = $row->id;
41
  $object->type = $row->type;
@@ -46,10 +48,18 @@ class FFWDModelBlog_style extends FFWDModelMain {
46
  $object->message_tags = json_decode(str_replace("'", esc_html("'"), $row->message_tags));
47
  $object->with_tags = json_decode(str_replace("'", esc_html("'"), $row->with_tags));
48
  $object->story_tags = json_decode(str_replace("'", esc_html("'"), $row->story_tags));
49
- $object->comments = $row->comments;
50
- $object->attachments = $row->attachments;
51
- $object->shares = $row->shares;
52
- $object->who_post = $row->who_post;
 
 
 
 
 
 
 
 
53
  array_push($id_object_id_json, $object);
54
  }
55
  $this->id_object_id_json = $id_object_id_json;
36
  // Store ids ans object_ids
37
  $id_object_id_json = array();
38
  foreach($results as $row) {
39
+ $attachments=json_decode(str_replace("'", esc_html("'"), $row->attachments));
40
+
41
  $object = new stdClass();
42
  $object->id = $row->id;
43
  $object->type = $row->type;
48
  $object->message_tags = json_decode(str_replace("'", esc_html("'"), $row->message_tags));
49
  $object->with_tags = json_decode(str_replace("'", esc_html("'"), $row->with_tags));
50
  $object->story_tags = json_decode(str_replace("'", esc_html("'"), $row->story_tags));
51
+ $object->comments = json_decode(str_replace("'", esc_html("'"), $row->comments));
52
+ $object->attachments = new stdClass();
53
+
54
+ if(isset($attachments->data[0]->media))
55
+ $object->attachments->media=$attachments->data[0]->media;
56
+ if(isset($attachments->data[0]->subattachments))
57
+ $object->attachments->subattachments=$attachments->data[0]->subattachments;
58
+ if(isset($attachments->data[0]->type))
59
+ $object->attachments->type=$attachments->data[0]->type;
60
+
61
+ $object->shares = json_decode(str_replace("'", esc_html("'"), $row->shares));
62
+ $object->who_post = json_decode(str_replace("'", esc_html("'"), $row->who_post));
63
  array_push($id_object_id_json, $object);
64
  }
65
  $this->id_object_id_json = $id_object_id_json;
js/ffwd_frontend.js CHANGED
@@ -658,23 +658,23 @@ function ffwd_fill_likes_blog_style(id_object_id, ffwd, owner_info, ffwd_params,
658
  id_object_id[i]['shares']='{}';
659
  }
660
 
661
- do_something_with_data_blog_style(jQuery.parseJSON(id_object_id[i]['shares']), id_object_id[i]['id'], ffwd, 'shares', "", ffwd_params, graph_url);
662
 
663
  // jQuery.getJSON(graph_url_for_attachments, createCallback_blog_style(id_object_id[i]['id'], ffwd, 'attachments', "", ffwd_params));
664
 
665
 
666
  if(id_object_id[i]['attachments'])
667
- do_something_with_data_blog_style(jQuery.parseJSON(id_object_id[i]['attachments']), id_object_id[i]['id'], ffwd, 'attachments', "", ffwd_params, graph_url);
668
 
669
  }
670
 
671
  if(id_object_id[i]['comments']);
672
- do_something_with_data_blog_style(jQuery.parseJSON(id_object_id[i]['comments']), id_object_id[i]['id'], ffwd, 'comments', "", ffwd_params, graph_url);
673
 
674
 
675
  // jQuery.getJSON(id_object_id[i]['comments'], createCallback_blog_style(id_object_id[i]['id'], ffwd, 'comments', "", ffwd_params, graph_url));
676
  //jQuery.getJSON(graph_url_for_who_post, createCallback_blog_style(id_object_id[i], ffwd, 'who_post', owner_info, ffwd_params));
677
- do_something_with_data_blog_style(jQuery.parseJSON(id_object_id[i]['who_post']), id_object_id[i], ffwd, 'who_post', owner_info, ffwd_params, graph_url);
678
 
679
 
680
 
@@ -750,26 +750,26 @@ function do_something_with_data_blog_style(result, id, ffwd, type, owner_info, f
750
  jQuery('#ffwd_shares_' + ffwd + '_' + id).html(shares_count);
751
  break;
752
  case 'attachments' :
753
-
754
  var src = '', length = 0, album_id = '';
755
  /*
756
  erb story mej nshaca vor addes photos aranc albumi anun talu hetevabar @ngela timline -i mej
757
  u avtomat et posti subattachmentsneri arkayutayn depqum kberi dranq, ISK ete nshvaca added photos to album esinch
758
  hetevabar petqa albumi id-in vercnel araji media-i targeti urlic u pageID + albumid posti subattamentner@ cuyc tal!!!!!
759
  */
760
- if (result['data'][0]) {
 
761
  /*If exists subattachments*/
762
- if (result['data'][0]['subattachments']) {
763
- length = result['data'][0]['subattachments']['data'].length;
764
- if (typeof result['data'][0]['subattachments']['data'][0]['media'] != "undefined") {
765
- src = result['data'][0]['subattachments']['data'][0]['media']['image']['src'];
766
  }
767
  /*First time add profile picture*/
768
- if (result['data'][0]['type'] == 'gallery') {
769
- src = result['data'][0]['subattachments']['data'][length - 1]['media']['image']['src'];
770
  }
771
  }
772
- else if (result['data'][0]['media']) {
773
  /* Check album containing this photo (compare title)
774
  * If not Timeline photos or Profile Pictures so get photos from that album
775
  */
@@ -781,12 +781,11 @@ function do_something_with_data_blog_style(result, id, ffwd, type, owner_info, f
781
 
782
  }
783
  }*/
784
- src = result['data'][0]['media']['image']['src'];
785
  }
786
- jQuery('#ffwd_blog_style_img_' + id + '_' + ffwd).attr('src', src);
787
-
788
 
789
 
 
790
  if (src == '')
791
  jQuery('#ffwd_blog_style_img_' + id + '_' + ffwd).remove();
792
 
@@ -950,15 +949,15 @@ function ffwd_fill_likes(result, ffwd, id) {
950
  angry_count[ffwd] = parseInt(result['angry']['summary']['total_count']);
951
 
952
  jQuery('#ffwd_likes_' + ffwd + '_' + id).html(total_reactions_count[ffwd]);
953
- if (total_reactions_count[ffwd] >= 3) {
954
  var likes_some_names = '<div class="ffwd_like_name_cont_' + ffwd + '"> <a class="ffwd_like_name_' + ffwd + '" href="https://www.facebook.com/' + result['total_reactions']['data'][0]['id'] + '" target="_blank">' + result['total_reactions']['data'][0]['name'] + ' , </a><a class="ffwd_like_name_' + ffwd + '" href="https://www.facebook.com/' + result['total_reactions']['data'][1]['id'] + '" target="_blank">' + result['total_reactions']['data'][1]['name'] + ' </a></div>';
955
  var likes_count_last_part = '<div class="ffwd_almost_' + ffwd + '"> ' + ffwd_frontend_text.and + ' ' + (total_reactions_count[ffwd] - 2) + ' ' + ffwd_frontend_text.others + ' </div>';
956
  }
957
- else if (total_reactions_count[ffwd] == 2) {
958
  var likes_some_names = '<div class="ffwd_like_name_cont_' + ffwd + '"> <a class="ffwd_like_name_' + ffwd + '" href="https://www.facebook.com/' + result['total_reactions']['data'][0]['id'] + '" target="_blank">' + result['total_reactions']['data'][0]['name'] + ' , </a><a class="ffwd_like_name_' + ffwd + '" href="https://www.facebook.com/' + result['total_reactions']['data'][1]['id'] + '" target="_blank">' + result['total_reactions']['data'][1]['name'] + ' </a></div>';
959
  var likes_count_last_part = '';
960
  }
961
- else if (total_reactions_count[ffwd] == 1) {
962
  var likes_some_names = '<div class="ffwd_like_name_cont_' + ffwd + '"> <a class="ffwd_like_name_' + ffwd + '" href="https://www.facebook.com/' + result['total_reactions']['data'][0]['id'] + '" target="_blank">' + result['total_reactions']['data'][0]['name'] + '</a></div>';
963
  var likes_count_last_part = '';
964
  }
658
  id_object_id[i]['shares']='{}';
659
  }
660
 
661
+ do_something_with_data_blog_style(id_object_id[i]['shares'], id_object_id[i]['id'], ffwd, 'shares', "", ffwd_params, graph_url);
662
 
663
  // jQuery.getJSON(graph_url_for_attachments, createCallback_blog_style(id_object_id[i]['id'], ffwd, 'attachments', "", ffwd_params));
664
 
665
 
666
  if(id_object_id[i]['attachments'])
667
+ do_something_with_data_blog_style(id_object_id[i]['attachments'], id_object_id[i]['id'], ffwd, 'attachments', "", ffwd_params, graph_url);
668
 
669
  }
670
 
671
  if(id_object_id[i]['comments']);
672
+ do_something_with_data_blog_style(id_object_id[i]['comments'], id_object_id[i]['id'], ffwd, 'comments', "", ffwd_params, graph_url);
673
 
674
 
675
  // jQuery.getJSON(id_object_id[i]['comments'], createCallback_blog_style(id_object_id[i]['id'], ffwd, 'comments', "", ffwd_params, graph_url));
676
  //jQuery.getJSON(graph_url_for_who_post, createCallback_blog_style(id_object_id[i], ffwd, 'who_post', owner_info, ffwd_params));
677
+ 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);
678
 
679
 
680
 
750
  jQuery('#ffwd_shares_' + ffwd + '_' + id).html(shares_count);
751
  break;
752
  case 'attachments' :
 
753
  var src = '', length = 0, album_id = '';
754
  /*
755
  erb story mej nshaca vor addes photos aranc albumi anun talu hetevabar @ngela timline -i mej
756
  u avtomat et posti subattachmentsneri arkayutayn depqum kberi dranq, ISK ete nshvaca added photos to album esinch
757
  hetevabar petqa albumi id-in vercnel araji media-i targeti urlic u pageID + albumid posti subattamentner@ cuyc tal!!!!!
758
  */
759
+
760
+ if (result) {
761
  /*If exists subattachments*/
762
+ if (result['subattachments']) {
763
+ length = result['subattachments']['data'].length;
764
+ if (typeof result['subattachments']['data'][0]['media'] != "undefined") {
765
+ src = result['subattachments']['data'][0]['media']['image']['src'];
766
  }
767
  /*First time add profile picture*/
768
+ if (result['type'] == 'gallery') {
769
+ src = result['subattachments']['data'][length - 1]['media']['image']['src'];
770
  }
771
  }
772
+ else if (result['media']) {
773
  /* Check album containing this photo (compare title)
774
  * If not Timeline photos or Profile Pictures so get photos from that album
775
  */
781
 
782
  }
783
  }*/
784
+ src = result['media']['image']['src'];
785
  }
 
 
786
 
787
 
788
+ jQuery('#ffwd_blog_style_img_' + id + '_' + ffwd).attr('src', src);
789
  if (src == '')
790
  jQuery('#ffwd_blog_style_img_' + id + '_' + ffwd).remove();
791
 
949
  angry_count[ffwd] = parseInt(result['angry']['summary']['total_count']);
950
 
951
  jQuery('#ffwd_likes_' + ffwd + '_' + id).html(total_reactions_count[ffwd]);
952
+ if (total_reactions_count[ffwd] >= 3 && result['total_reactions']['data'][0]) {
953
  var likes_some_names = '<div class="ffwd_like_name_cont_' + ffwd + '"> <a class="ffwd_like_name_' + ffwd + '" href="https://www.facebook.com/' + result['total_reactions']['data'][0]['id'] + '" target="_blank">' + result['total_reactions']['data'][0]['name'] + ' , </a><a class="ffwd_like_name_' + ffwd + '" href="https://www.facebook.com/' + result['total_reactions']['data'][1]['id'] + '" target="_blank">' + result['total_reactions']['data'][1]['name'] + ' </a></div>';
954
  var likes_count_last_part = '<div class="ffwd_almost_' + ffwd + '"> ' + ffwd_frontend_text.and + ' ' + (total_reactions_count[ffwd] - 2) + ' ' + ffwd_frontend_text.others + ' </div>';
955
  }
956
+ else if (total_reactions_count[ffwd] == 2 && result['total_reactions']['data'][0]) {
957
  var likes_some_names = '<div class="ffwd_like_name_cont_' + ffwd + '"> <a class="ffwd_like_name_' + ffwd + '" href="https://www.facebook.com/' + result['total_reactions']['data'][0]['id'] + '" target="_blank">' + result['total_reactions']['data'][0]['name'] + ' , </a><a class="ffwd_like_name_' + ffwd + '" href="https://www.facebook.com/' + result['total_reactions']['data'][1]['id'] + '" target="_blank">' + result['total_reactions']['data'][1]['name'] + ' </a></div>';
958
  var likes_count_last_part = '';
959
  }
960
+ else if (total_reactions_count[ffwd] == 1 && result['total_reactions']['data'][0]) {
961
  var likes_some_names = '<div class="ffwd_like_name_cont_' + ffwd + '"> <a class="ffwd_like_name_' + ffwd + '" href="https://www.facebook.com/' + result['total_reactions']['data'][0]['id'] + '" target="_blank">' + result['total_reactions']['data'][0]['name'] + '</a></div>';
962
  var likes_count_last_part = '';
963
  }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Facebook Feed ===
2
- Contributors: webdorado
3
  Donate link: https://web-dorado.com/products/wordpress-facebook-feed-plugin.html
4
  Tags: customizable facebook feed, facebook, facebook events, facebook feed, facebook group, facebook like box, facebook likes, facebook page, facebook photos, facebook plugin, facebook posts, facebook likebox
5
  Requires at least: 3.4
6
  Tested up to: 4.7
7
- Stable tag: 1.0.15
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -66,6 +66,10 @@ Upgrade to [Facebook Feed Pro](https://web-dorado.com/products/wordpress-faceboo
66
 
67
  == Changelog ==
68
 
 
 
 
 
69
  = 1.0.15 =
70
  * Fixed: bug on posts with no shares
71
  * Fixed: bug on showing old events
1
  === Facebook Feed ===
2
+ Contributors: webdorado, wdsupport
3
  Donate link: https://web-dorado.com/products/wordpress-facebook-feed-plugin.html
4
  Tags: customizable facebook feed, facebook, facebook events, facebook feed, facebook group, facebook like box, facebook likes, facebook page, facebook photos, facebook plugin, facebook posts, facebook likebox
5
  Requires at least: 3.4
6
  Tested up to: 4.7
7
+ Stable tag: 1.0.16
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
66
 
67
  == Changelog ==
68
 
69
+ = 1.0.16 =
70
+ * Fixed: Conflict with Visual Composer
71
+ * Changed: Data optimization
72
+
73
  = 1.0.15 =
74
  * Fixed: bug on posts with no shares
75
  * Fixed: bug on showing old events