WD Facebook Feed – Custom Facebook Feed Plugin - Version 1.1.30

Version Description

  • Fixed: Token autoupdate.
Download this release

Release Info

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

Code changes from version 1.1.29 to 1.1.30

facebook-feed-wd.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: 10Web Social Feed
5
  * Plugin URI: https://10web.io/plugins/wordpress-facebook-feed/?utm_source=facebook_feed&utm_medium=free_plugin
6
  * Description: 10Web Social Feed is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
7
- * Version: 1.1.29
8
  * Author: 10Web
9
  * Author URI: https://10web.io/plugins/?utm_source=facebook_feed&utm_medium=free_plugin
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -15,7 +15,7 @@ define( 'WD_FFWD_URL', plugins_url( plugin_basename( dirname( __FILE__ ) ) ) );
15
  define( 'WD_FB_PREFIX', 'ffwd' );
16
  define( 'WD_FB_IS_FREE', TRUE );
17
  if (! defined( 'FFWD_VERSION' ) ){
18
- define ('FFWD_VERSION',"1.1.29");
19
  }
20
  add_action( 'admin_init', 'ffwd_init' );
21
 
@@ -1071,6 +1071,14 @@ function wd_fb_update($from_plugin=0) {
1071
  if(($current_time>=$update_time && $from_plugin) || !$from_plugin )
1072
  {
1073
  global $wpdb;
 
 
 
 
 
 
 
 
1074
  $query = "SELECT * FROM " . $wpdb->prefix . "wd_fb_info WHERE `update_mode` <> 'no_update'";
1075
  $rows = $wpdb->get_results( $query );
1076
 
4
  * Plugin Name: 10Web Social Feed
5
  * Plugin URI: https://10web.io/plugins/wordpress-facebook-feed/?utm_source=facebook_feed&utm_medium=free_plugin
6
  * Description: 10Web Social Feed is a completely customizable, responsive solution to help you display your Facebook feed on your WordPress website.
7
+ * Version: 1.1.30
8
  * Author: 10Web
9
  * Author URI: https://10web.io/plugins/?utm_source=facebook_feed&utm_medium=free_plugin
10
  * 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.1.30");
19
  }
20
  add_action( 'admin_init', 'ffwd_init' );
21
 
1071
  if(($current_time>=$update_time && $from_plugin) || !$from_plugin )
1072
  {
1073
  global $wpdb;
1074
+ $ff_wd_options = get_option('ffwd_pages_list');
1075
+ if ( !empty($ff_wd_options) ) {
1076
+ foreach ( $ff_wd_options as $ff_wd_option ) {
1077
+ $token = $ff_wd_option->access_token;
1078
+ $page_id = $ff_wd_option->id;
1079
+ WDFacebookFeed::update_page_access_token($token, $page_id);
1080
+ }
1081
+ }
1082
  $query = "SELECT * FROM " . $wpdb->prefix . "wd_fb_info WHERE `update_mode` <> 'no_update'";
1083
  $rows = $wpdb->get_results( $query );
1084
 
framework/WDFacebookFeed.php CHANGED
@@ -1705,29 +1705,41 @@ $ffwd_info_options[$ffwd_option_db] =((isset($_POST[$ffwd_option_db])) ? sanitiz
1705
  }
1706
  return $facebook_graph_results;
1707
  }
1708
- private static function update_page_access_token($old_access_token){
1709
- global $wpdb;
1710
- $fb_option_data = self::get_fb_option_data();
1711
-
1712
- $return_data = array(
1713
- 'success'=>false,
1714
- 'new_token'=>null,
1715
  );
1716
- if(isset($fb_option_data->app_id) && isset($fb_option_data->app_secret)) {
1717
- $app_id = $fb_option_data->app_id;
1718
- $app_secret = $fb_option_data->app_secret;
1719
- $url = "https://graph.facebook.com/oauth/access_token?client_id=" . $app_id . "&client_secret=" . $app_secret . "&grant_type=fb_exchange_token&fb_exchange_token=" . $old_access_token;
1720
- $response = wp_remote_get($url);
1721
- if (isset($response['body'])) {
1722
- $data = json_decode($response['body'], true);
1723
- if (isset($data["access_token"]) && !empty($data["access_token"])) {
1724
- $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "wd_fb_info SET page_access_token = %s WHERE page_access_token = %s", $data["access_token"], $old_access_token));
1725
- $return_data["success"] = true;
1726
- $return_data["new_token"] = $data["access_token"];
 
 
 
 
 
 
 
 
 
1727
  }
 
 
 
 
 
 
1728
  }
1729
  }
1730
- return $return_data;
1731
  }
1732
  public static function get_autoupdate_interval(){
1733
  global $wpdb;
1705
  }
1706
  return $facebook_graph_results;
1707
  }
1708
+ public static function update_page_access_token($old_access_token, $page_id = ''){
1709
+ $redirect_uri = 'https://api.web-dorado.com/fb/';
1710
+ $admin_url = urlencode(admin_url('admin.php?page=options_ffwd'));
1711
+ $state = array(
1712
+ 'wp_site_url' => $admin_url
 
 
1713
  );
1714
+ $base_url = add_query_arg(array(
1715
+ 'action' => 'ff_wd_exchange_token',
1716
+ 'ff_wd_user_token' => $old_access_token,
1717
+ 'scope' => 'manage_pages',
1718
+ 'code' => '200',
1719
+ ), $redirect_uri);
1720
+
1721
+ $base_url .= '&state=' . base64_encode(json_encode($state));
1722
+ $response = wp_remote_post($base_url);
1723
+
1724
+ if(!is_wp_error( $response ) && isset($response["body"])) {
1725
+ $ffwd_user_access_token = json_decode($response["body"], TRUE);
1726
+
1727
+ if ( isset($ffwd_user_access_token["access_token"]) ) {
1728
+ $ffwd_user_access_token = sanitize_text_field($ffwd_user_access_token["access_token"]);
1729
+ $datas = get_option('ffwd_pages_list');
1730
+ foreach ( $datas as $data ) {
1731
+ if( $data->id == $page_id ) {
1732
+ $data->access_token = $ffwd_user_access_token;
1733
+ }
1734
  }
1735
+
1736
+
1737
+ update_option('ffwd_pages_list', $datas);
1738
+ update_option("ffwd_pages_list_success", "1");
1739
+ self::update_access_tokens();
1740
+
1741
  }
1742
  }
 
1743
  }
1744
  public static function get_autoupdate_interval(){
1745
  global $wpdb;
frontend/views/FFWDViewPopupBox.php CHANGED
@@ -1395,19 +1395,6 @@ if ($theme_row->lightbox_ctrl_btn_pos == 'top') {
1395
  <?php
1396
  }
1397
  }
1398
- elseif(strpos($type, "video") !== false) { /*Videos*/
1399
- ?>
1400
- <span class="ffwd_video">
1401
- <?php
1402
- if($ffwd_info->content_type != 'timeline'):
1403
- if($status_type == 'shared_story') { ?>
1404
- <iframe class="ffwd_popup_iframe" src="<?php echo $source. '&enablejsapi=1&wmode=transparent'; ?>" style="width: inherit; height: inherit; margin:0;" frameborder="0" scrolling="no" allowtransparency="false" allowfullscreen></iframe>
1405
- <?php } else { ?>
1406
- <video class="ffwd_popup_image" src="<?php echo $source; ?>" controls autoplay="autoplay"></video>
1407
- <?php } endif; ?>
1408
- </span>
1409
- <?php
1410
- }
1411
  ?>
1412
  </span>
1413
  </span>
@@ -1757,24 +1744,6 @@ if ($theme_row->lightbox_ctrl_btn_pos == 'top') {
1757
  if (!is_video) {
1758
  innhtml += '<img style="max-height: ' + cur_height + 'px; max-width: ' + cur_width + 'px;" class="ffwd_popup_image" src="'+ jQuery('<div />').html(data[key]["main_url"]).text() + '" alt="' + data[key]["alt"] + '" />';
1759
  }
1760
- else { /*videos*/
1761
- innhtml += '<span style="height: ' + cur_height + 'px; width: ' + cur_width + 'px;" class="ffwd_video">';
1762
- if(data[key]['status_type'] == 'shared_story') {
1763
- innhtml += '<iframe src="'+data[key]['source']+'&enablejsapi=1&wmode=transparent"' +
1764
- 'style="'+
1765
- 'max-width:'+'100%'+" !important; "+
1766
- 'max-height:'+'100%'+" !important; "+
1767
- 'width:'+'100%; '+
1768
- 'height:'+ '100%; ' +
1769
- 'margin:0; '+
1770
- 'display:table-cell; vertical-align:middle;"'+
1771
- 'frameborder="0" scrolling="no" allowtransparency="false" allowfullscreen'+
1772
- ' class="ffwd_popup_iframe"></iframe>';
1773
- }else {
1774
- innhtml += '<video class="ffwd_popup_image" src="'+data[key]['source']+'" controls autoplay="autoplay"></video>';
1775
- }
1776
- innhtml += "</span>";
1777
- }
1778
  innhtml += '</span></span>';
1779
  jQuery(next_image_class).html(innhtml);
1780
 
1395
  <?php
1396
  }
1397
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1398
  ?>
1399
  </span>
1400
  </span>
1744
  if (!is_video) {
1745
  innhtml += '<img style="max-height: ' + cur_height + 'px; max-width: ' + cur_width + 'px;" class="ffwd_popup_image" src="'+ jQuery('<div />').html(data[key]["main_url"]).text() + '" alt="' + data[key]["alt"] + '" />';
1746
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1747
  innhtml += '</span></span>';
1748
  jQuery(next_image_class).html(innhtml);
1749
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === 10Web Social Post Feed===
2
  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.6
7
- Stable tag: 1.1.29
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -104,6 +104,9 @@ 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.1.29 =
108
  * Fixed: JS deprications.
109
 
1
+ === 10Web Social Post Feed===
2
  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.6
7
+ Stable tag: 1.1.30
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.1.30 =
108
+ * Fixed: Token autoupdate.
109
+
110
  = 1.1.29 =
111
  * Fixed: JS deprications.
112