WD Instagram Feed – Instagram Gallery - Version 1.4.33

Version Description

Download this release

Release Info

Developer 10web
Plugin Icon 128x128 WD Instagram Feed – Instagram Gallery
Version 1.4.33
Comparing to
See all releases

Code changes from version 1.4.32 to 1.4.33

admin-functions.php CHANGED
@@ -823,7 +823,7 @@ function wdi_get_auth_urls() {
823
  );
824
  $urls = array();
825
  $urls['personal'] = add_query_arg(array(
826
- 'app_id' => $config['basic_app_id'],
827
  'redirect_uri' => $config['basic_redirect_uri'],
828
  'scope' => $config['basic_scope'],
829
  'response_type' => $config['basic_response_type'],
823
  );
824
  $urls = array();
825
  $urls['personal'] = add_query_arg(array(
826
+ 'client_id' => $config['basic_app_id'],
827
  'redirect_uri' => $config['basic_redirect_uri'],
828
  'scope' => $config['basic_scope'],
829
  'response_type' => $config['basic_response_type'],
admin/views/settings.php CHANGED
@@ -225,7 +225,7 @@ class Settings_view_wdi {
225
  </label>
226
  <span class="wdi_info_text"><?php _e('Used for displaying user feeds from a "Personal"<br class="wdi_desktop"> Instagram account.', 'wd-instagram-feed'); ?></span>
227
  </p>
228
- <p class="wdi-label-business wdi_input_group <?php echo (WDI_IS_FREE)?"wdi_free":"wdi_pro"; ?>">
229
  <label for="wdi-business">
230
  <input type="radio" id="wdi-business" <?php echo (WDI_IS_FREE)?"disabled":""; ?> name="wdi-connect-type" value="<?php echo esc_url($business_href); ?>">
231
  <span class="wdi_account_type"><?php _e('Business', 'wd-instagram-feed'); ?></span>
225
  </label>
226
  <span class="wdi_info_text"><?php _e('Used for displaying user feeds from a "Personal"<br class="wdi_desktop"> Instagram account.', 'wd-instagram-feed'); ?></span>
227
  </p>
228
+ <p class="wdi-label-business wdi_input_group <?php echo (WDI_IS_FREE) ? "wdi_free" : "wdi_pro"; ?>">
229
  <label for="wdi-business">
230
  <input type="radio" id="wdi-business" <?php echo (WDI_IS_FREE)?"disabled":""; ?> name="wdi-connect-type" value="<?php echo esc_url($business_href); ?>">
231
  <span class="wdi_account_type"><?php _e('Business', 'wd-instagram-feed'); ?></span>
config.php CHANGED
@@ -3,7 +3,7 @@ if ( !defined('ABSPATH') ) {
3
  exit;
4
  }
5
 
6
- define('WDI_VERSION', '1.4.32');
7
  define('WDI_IS_FREE', TRUE);
8
  define('WDI_PREFIX', 'wdi');
9
  define('WDI_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
3
  exit;
4
  }
5
 
6
+ define('WDI_VERSION', '1.4.33');
7
  define('WDI_IS_FREE', TRUE);
8
  define('WDI_PREFIX', 'wdi');
9
  define('WDI_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
framework/WDIInstagram.php CHANGED
@@ -181,7 +181,7 @@ class WDIInstagram {
181
 
182
  public function wdi_getHashtagId( $tagname = '', $user_name = '' ) {
183
  $this->account_data = $this->wdi_authenticated_users_list[$user_name];
184
- $url = 'https://graph.facebook.com/v10.0/ig_hashtag_search/?user_id=' . $this->account_data["user_id"] . '&q=' . $tagname . '&access_token=' . $this->account_data["access_token"];
185
  $args = array();
186
  //wp_remote_get is a native WordPress function
187
  /* phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get */
@@ -359,9 +359,9 @@ class WDIInstagram {
359
  private function getMediaChildren( $media_id ) {
360
 
361
  $carousel_media = array();
362
- $api_url = 'https://graph.instagram.com/v1.0/';
363
  if ( $this->account_data["type"] === "business" ) {
364
- $api_url = 'https://graph.facebook.com/v10.0/';
365
  }
366
  $api_url .= $media_id . '/children?access_token=' . $this->account_data["access_token"];
367
  $fields = 'id,media_type,media_url,permalink,thumbnail_url,username,timestamp';
@@ -444,10 +444,10 @@ class WDIInstagram {
444
  $user_id = $this->account_data["user_id"];
445
  $access_token = $this->account_data["access_token"];
446
  if( $tag_id === 'false' ) {
447
- $api_url = 'https://graph.instagram.com/v1.0/';
448
  $media_fields = 'id,media_type,media_url,permalink,thumbnail_url,username,caption,timestamp';
449
  if ( $this->account_data["type"] === "business" ) {
450
- $api_url = 'https://graph.facebook.com/v10.0/';
451
  $media_fields = 'id,media_type,media_url,permalink,thumbnail_url,username,caption,timestamp,ig_id,is_comment_enabled,like_count,comments_count,owner,shortcode';
452
  }
453
  $baseUrl = $api_url . $user_id . '/media/?fields=' . $media_fields . '&limit=100&access_token=' . $access_token;
@@ -472,7 +472,7 @@ class WDIInstagram {
472
  if ( !empty($data['data']) ) {
473
  foreach ($data['data'] as $key => $ig_object) {
474
  if ($ig_object['media_type'] === "VIDEO") {
475
- $oembedApiUrl = "https://graph.facebook.com/v10.0/instagram_oembed?url=" . $ig_object['permalink'] . "&access_token=" . $this->account_data["access_token"];
476
  //wp_remote_get is a native WordPress function
477
  /* phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get */
478
  $oembedData = wp_remote_get($oembedApiUrl, $args);
@@ -492,7 +492,7 @@ class WDIInstagram {
492
  if ( !empty($ig_object['children']['data']) ) {
493
  foreach ( $ig_object['children']['data'] as $carousel_key => $carousel_child ) {
494
  if ( $carousel_child['media_type'] === "VIDEO" ) {
495
- $childOembedApiUrl = "https://graph.facebook.com/v10.0/instagram_oembed?url=" . $carousel_child['permalink'] . "&access_token=" . $this->account_data["access_token"];
496
  //wp_remote_get is a native WordPress function
497
  /* phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get */
498
  $childOembedData = wp_remote_get($childOembedApiUrl, $args);
181
 
182
  public function wdi_getHashtagId( $tagname = '', $user_name = '' ) {
183
  $this->account_data = $this->wdi_authenticated_users_list[$user_name];
184
+ $url = 'https://graph.facebook.com/v12.0/ig_hashtag_search/?user_id=' . $this->account_data["user_id"] . '&q=' . $tagname . '&access_token=' . $this->account_data["access_token"];
185
  $args = array();
186
  //wp_remote_get is a native WordPress function
187
  /* phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get */
359
  private function getMediaChildren( $media_id ) {
360
 
361
  $carousel_media = array();
362
+ $api_url = 'https://graph.instagram.com/v12.0/';
363
  if ( $this->account_data["type"] === "business" ) {
364
+ $api_url = 'https://graph.facebook.com/v12.0/';
365
  }
366
  $api_url .= $media_id . '/children?access_token=' . $this->account_data["access_token"];
367
  $fields = 'id,media_type,media_url,permalink,thumbnail_url,username,timestamp';
444
  $user_id = $this->account_data["user_id"];
445
  $access_token = $this->account_data["access_token"];
446
  if( $tag_id === 'false' ) {
447
+ $api_url = 'https://graph.instagram.com/v12.0/';
448
  $media_fields = 'id,media_type,media_url,permalink,thumbnail_url,username,caption,timestamp';
449
  if ( $this->account_data["type"] === "business" ) {
450
+ $api_url = 'https://graph.facebook.com/v12.0/';
451
  $media_fields = 'id,media_type,media_url,permalink,thumbnail_url,username,caption,timestamp,ig_id,is_comment_enabled,like_count,comments_count,owner,shortcode';
452
  }
453
  $baseUrl = $api_url . $user_id . '/media/?fields=' . $media_fields . '&limit=100&access_token=' . $access_token;
472
  if ( !empty($data['data']) ) {
473
  foreach ($data['data'] as $key => $ig_object) {
474
  if ($ig_object['media_type'] === "VIDEO") {
475
+ $oembedApiUrl = "https://graph.facebook.com/v12.0/instagram_oembed?url=" . $ig_object['permalink'] . "&access_token=" . $this->account_data["access_token"];
476
  //wp_remote_get is a native WordPress function
477
  /* phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get */
478
  $oembedData = wp_remote_get($oembedApiUrl, $args);
492
  if ( !empty($ig_object['children']['data']) ) {
493
  foreach ( $ig_object['children']['data'] as $carousel_key => $carousel_child ) {
494
  if ( $carousel_child['media_type'] === "VIDEO" ) {
495
+ $childOembedApiUrl = "https://graph.facebook.com/v12.0/instagram_oembed?url=" . $carousel_child['permalink'] . "&access_token=" . $this->account_data["access_token"];
496
  //wp_remote_get is a native WordPress function
497
  /* phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get */
498
  $childOembedData = wp_remote_get($childOembedApiUrl, $args);
framework/WDILibrary.php CHANGED
@@ -1135,18 +1135,17 @@ class WDILibrary {
1135
 
1136
  public static function instagram_app_config() {
1137
  $config = array(
1138
- 'graph_app_id' => '356432828483035',
1139
- 'basic_app_id' => '734781953985462',
1140
- 'graph_authorize_url' => 'https://www.facebook.com/dialog/oauth/',
1141
  'basic_authorize_url' => 'https://api.instagram.com/oauth/authorize/',
1142
- 'graph_scope' => 'instagram_basic,pages_show_list,pages_read_engagement',
1143
- 'basic_scope' => 'user_profile,user_media',
1144
  'basic_response_type' => 'code',
1145
-
1146
- 'graph_redirect_uri' => 'https://api.web-dorado.com/instagram/business/',
1147
  'basic_redirect_uri' => 'https://instagram-api.10web.io/instagram/personal/',
1148
  'access_token' => 'https://api.instagram.com/oauth/access_token/',
1149
  'refresh_access_token' => 'https://graph.instagram.com/refresh_access_token/',
 
 
 
 
1150
  );
1151
 
1152
  return $config;
@@ -1191,7 +1190,7 @@ class WDILibrary {
1191
  elseif ($wdi_user_type === "business"){
1192
  //wp_remote_get is a native WordPress function
1193
  /* phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, WordPress.DB.DirectDatabaseQuery.DirectQuery */
1194
- $wdi_user_data = wp_remote_get('https://graph.facebook.com/v9.0/' . $wdi_user_id . '?fields=id,ig_id,username,name,biography,profile_picture_url,followers_count,follows_count,media_count,website&access_token=' . $wdi_user_token);
1195
  if(!is_wp_error( $wdi_user_data ) && isset($wdi_user_data["body"])){
1196
  $wdi_user_data = json_decode($wdi_user_data["body"], TRUE);
1197
  }
1135
 
1136
  public static function instagram_app_config() {
1137
  $config = array(
1138
+ 'basic_app_id' => '1196241780901628',
 
 
1139
  'basic_authorize_url' => 'https://api.instagram.com/oauth/authorize/',
 
 
1140
  'basic_response_type' => 'code',
1141
+ 'basic_scope' => 'user_profile,user_media',
 
1142
  'basic_redirect_uri' => 'https://instagram-api.10web.io/instagram/personal/',
1143
  'access_token' => 'https://api.instagram.com/oauth/access_token/',
1144
  'refresh_access_token' => 'https://graph.instagram.com/refresh_access_token/',
1145
+ 'graph_app_id' => '639261367121596',
1146
+ 'graph_authorize_url' => 'https://www.facebook.com/dialog/oauth/',
1147
+ 'graph_scope' => 'instagram_basic,pages_show_list,pages_read_engagement',
1148
+ 'graph_redirect_uri' => 'https://api.web-dorado.com/instagram/business/',
1149
  );
1150
 
1151
  return $config;
1190
  elseif ($wdi_user_type === "business"){
1191
  //wp_remote_get is a native WordPress function
1192
  /* phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get, WordPress.DB.DirectDatabaseQuery.DirectQuery */
1193
+ $wdi_user_data = wp_remote_get('https://graph.facebook.com/v12.0/' . $wdi_user_id . '?fields=id,ig_id,username,name,biography,profile_picture_url,followers_count,follows_count,media_count,website&access_token=' . $wdi_user_token);
1194
  if(!is_wp_error( $wdi_user_data ) && isset($wdi_user_data["body"])){
1195
  $wdi_user_data = json_decode($wdi_user_data["body"], TRUE);
1196
  }
js/wdi_instagram.js CHANGED
@@ -1282,7 +1282,7 @@ function WDIInstagram(args) {
1282
  statusCode = args['statusCode'];
1283
  }
1284
  }
1285
- var req_url = 'https://graph.facebook.com/v3.2/' + getUserId() + '?fields=id,ig_id,username,name,biography,profile_picture_url,followers_count,follows_count,media_count,website&access_token=' + getAccessToken();
1286
  var wdi_callback = function (cache_data) {
1287
  if (cache_data === false) {
1288
  jQuery.ajax({
1282
  statusCode = args['statusCode'];
1283
  }
1284
  }
1285
+ var req_url = 'https://graph.facebook.com/v12.0/' + getUserId() + '?fields=id,ig_id,username,name,biography,profile_picture_url,followers_count,follows_count,media_count,website&access_token=' + getAccessToken();
1286
  var wdi_callback = function (cache_data) {
1287
  if (cache_data === false) {
1288
  jQuery.ajax({
js/wdi_instagram.min.js CHANGED
@@ -1 +1 @@
1
- function WDIInstagram(e){this.user={},this.access_tokens=[],this.filters=[],void 0!==e&&(void 0!==e.access_tokens&&(this.access_tokens=e.access_tokens),void 0!==e.filters&&(this.filters=e.filters));var _=this;function g(){return void 0!==_.user&&void 0!==_.user.user_name?_.user.user_name:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user?wdi_object.user.user_name:""}function u(){return void 0!==_.user&&void 0!==_.user.access_token?_.user.access_token:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user&&void 0!==wdi_object.user.access_token?wdi_object.user.access_token:""}this.statusCode={429:function(){console.log(" 429: Too many requests. Try after one hour")}},this.getFilter=function(e){var s=_.filters;if(void 0===s)return!1;for(var t=0;t<s.length;t++)if(s[t].where==e)if("object"==typeof s[t].what&&2==s[t].what.length){if(void 0!==window[s[t].what[0]]&&"function"==typeof window[s[t].what[0]][s[t].what[1]])return window[s[t].what[0]][s[t].what[1]]}else{if("string"!=typeof s[t].what)return"function"==typeof s[t].what&&s[t].what;if("function"==typeof window[s[t].what])return window[s[t].what]}return!1},this.addToken=function(e){"string"==typeof e&&_.access_tokens.push(e)},this.resetTokens=function(){_.access_tokens=[]},this.getTagRecentMedia=function(n,i,e,c,a){var s=!1,t=this.statusCode,o=!1,u=(this.getFilter("getTagRecentMedia"),wdi_ajax.feed_id),d=g();c=0===parseInt(c)?"top_media":"recent_media",void 0===i||0===i.length||("success"in i&&(s=!0),"statusCode"in i&&(t=i.statusCode),"error"in i&&(o=!0),"args"in i||(i.args={}),"count"in i?(i.count=parseInt(i.count),(!Number.isInteger(i.count)||i.count<=0)&&(i.count=33)):i.count=33,"feed_id"in i&&(u=i.feed_id),"user_name"in i&&(d=i.user_name));var f=this.getTagId(n);function w(e){void 0===e.data&&(e.data=[]),s&&("object"==typeof i.success&&2==i.success.length?void 0!==window[i.success[0]]&&"function"==typeof window[i.success[0]][i.success[1]]&&window[i.success[0]][i.success[1]](e):"string"==typeof i.success?"function"==typeof window[i.success]&&window[i.success](e):"function"==typeof i.success&&i.success(e))}jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{action:"wdi_getTagRecentMedia",wdi_nonce:wdi_ajax.wdi_nonce,user_name:d,feed_id:u,next_url:e,tagname:n,wdiTagId:f,endpoint:c},success:function(e){var s,t,o=!1,r="";void 0!==e.error&&(o=!0,r=e.error.type),void 0===e.data||void 0!==e.data&&0===e.data.length&&0===a?_.set_cache_data("",d,u,"",0,1,n,f,c,i):(0===e.data.length?e.meta={code:400,error:o,error_type:r}:(!1===f&&(f=""),void 0!==e.tag_data&&(void 0!==(s=e.tag_data).tag_id&&(f=s.tag_id),t=[],void 0!==window.wdi_all_tags&&(t=window.wdi_all_tags),t[s.tag_id]=s,window.wdi_all_tags=t),e.meta={code:200,error:o,error_type:r}),e.tag_id=f,w(e))},error:function(e){o&&("object"==typeof i.error&&2==i.error.length?"function"==typeof window[i.error[0]][i.error[1]]&&window[i.error[0]][i.error[1]](e):"string"==typeof i.error?"function"==typeof window[i.error]&&window[i.error](e):"function"==typeof i.error&&i.error(e))},statusCode:t})},this.getTagId=function(e){var s,t,o=[];if("undefined"!=typeof wdi_controller){if(void 0===(o=wdi_controller.feed_users))return!1;0!==o.length||void 0!==(s=jQuery("#WDI_feed_users").val())&&""!==s&&(o=JSON.parse(s))}else void 0!==window.wdi_all_tags&&(o=window.wdi_all_tags);for(t in o)if(e===o[t].username||"#"+e===o[t].username)return void 0!==o[t].tag_id&&o[t].tag_id;return!1},this.searchForTagsByName=function(e,t){var o=this,r=!1,n=this.statusCode,i=!1;filter=this.getFilter("searchForTagsByName"),void 0===t||0===t.length||("success"in t&&(r=!0),"error"in t&&(i=!0),"statusCode"in t&&(n=t.statusCode));var c="https://api.instagram.com/v1/tags/search?q="+e+"&access_token="+u();_.getDataFromCache(function(e){function s(e){r&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(filter&&(e=filter(e,o.filterArguments)),window[t.success[0]][t.success[1]](e)):"string"==typeof t.success?"function"==typeof window[t.success]&&(filter&&(e=filter(e,o.filterArguments)),window[t.success](e)):"function"==typeof t.success&&(filter&&(e=filter(e,o.filterArguments)),t.success(e)))}!1===e?jQuery.ajax({type:"POST",url:c,dataType:"jsonp",success:function(e){_.setDataToCache(c,e),s(e)},error:function(e){i&&("object"==typeof t.error&&2==t.error.length?"function"==typeof window[t.error[0]][t.error[1]]&&window[t.error[0]][t.error[1]](e):"string"==typeof t.error?"function"==typeof window[t.error]&&window[t.error](e):"function"==typeof t.error&&t.error(e))},statusCode:n}):s(e)},c)},this.searchForUsersByName=function(e,s){var t=this,o=!1,r=(this.statusCode,!1),n=this.getFilter("searchForUsersByName");void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(r=!0),"statusCode"in s&&s.statusCode),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/search?q="+e+"&access_token="+u(),success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(n&&(e=n(e,t.filterArguments)),e.args=s,window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(n&&(e=n(e,t.filterArguments)),e.args=s,window[s.success](e)):"function"==typeof s.success&&(n&&(e=n(e,t.filterArguments)),(e.args=s).success(e)))},error:function(e){r&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:this.statusCode})},this.getRecentLikedMedia=function(s){var t=this,o=!1,e=this.statusCode,r=!1,n=this.getFilter("getRecentLikedMedia"),i="https://api.instagram.com/v1/users/self/media/liked?access_token="+u();void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(r=!0),"statusCode"in s&&(e=s.statusCode),"args"in s?argFlag=!0:s.args={},"count"in s?(s.count=parseInt(s.count),(!Number.isInteger(s.count)||s.count<=0)&&(s.count=20)):s.count=20,i+="&count="+s.count,"next_max_like_id"in s&&(i+="&next_max_like_id="+s.next_max_like_id)),jQuery.ajax({type:"POST",dataType:"jsonp",url:i,success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(n&&(e=n(e,t.filterArguments,s.args)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(n&&(e=n(e,t.filterArguments,s.args)),window[s.success](e)):"function"==typeof s.success&&(n&&(e=n(e,t.filterArguments,s.args)),s.success(e)))},error:function(e){r&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:e})},this.getUserRecentMedia=function(e,s){var t=this,o=!1,r=this.statusCode,n=!1,i=this.getFilter("getUserRecentMedia"),e="https://api.instagram.com/v1/users/"+e+"/media/recent/?access_token="+u();void 0===s||0===s.length||("success"in s&&(o=!0),"statusCode"in s&&(r=s.statusCode),"args"in s||(s.args={}),"error"in s&&(n=!0),"count"in s?(s.count=parseInt(s.count),(!Number.isInteger(s.count)||s.count<=0)&&(s.count=33)):s.count=33,e+="&count="+s.count,"min_id"in s&&(e+="&min_id="+s.min_id),"max_id"in s&&(e+="&max_id="+s.max_id)),jQuery.ajax({type:"POST",dataType:"jsonp",url:e,success:function(e){void 0===e.data&&(e.data=[]),o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(i&&(e=i(e,t.filterArguments,s.args)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(i&&(e=i(e,t.filterArguments,s.args)),window[s.success](e)):"function"==typeof s.success&&(i&&(e=i(e,t.filterArguments,s.args)),s.success(e)))},error:function(e){n&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:r})},this.getUserMedia=function(o,e,r){e=void 0===e?"":e;var n=this,i=!1,s=this.statusCode,t=!1,c=this.getFilter("getUserMedia"),a=g(),u=wdi_ajax.feed_id;void 0===o||0===o.length||("success"in o&&(i=!0),"error"in o&&(t=!0),"statusCode"in o&&(s=o.statusCode),"args"in o||(o.args={}),"count"in o?(o.count=parseInt(o.count),(!Number.isInteger(o.count)||o.count<=0)&&(o.count=20)):o.count=20,"feed_id"in o&&(u=o.feed_id),"user_name"in o&&(a=o.user_name)),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_getUserMedia",user_name:a,feed_id:u,next_url:e},success:function(e){var s=!1,t="";void 0!==e.error&&(s=!0,t=e.error.type),void 0===e.data||void 0!==e.data&&0===e.data.length&&0===r?_.set_cache_data("",a,u,"",0,1,"","","",o):0!==e.data.length?(e.meta={code:200,error:s,error_type:t},i&&("object"==typeof o.success&&2==o.success.length?void 0!==window[o.success[0]]&&"function"==typeof window[o.success[0]][o.success[1]]&&(c&&(e=_.addTags(e),e=c(e,n.filterArguments,o)),window[o.success[0]][o.success[1]](e)):"string"==typeof o.success?"function"==typeof window[o.success]&&(c&&(e=_.addTags(e),e=c(e,n.filterArguments,o)),window[o.success](e)):"function"==typeof o.success&&o.success(e))):(e.meta={code:400,error:s,error_type:t},o.success(e))},error:function(e){t&&("object"==typeof o.error&&2==o.error.length?"function"==typeof window[o.error[0]][o.error[1]]&&window[o.error[0]][o.error[1]](e):"string"==typeof o.error?"function"==typeof window[o.error]&&window[o.error](e):"function"==typeof o.error&&o.error(e))},statusCode:s})},this.set_cache_data=function(s,t,o,r,e,n,i,c,a,u){var d;0===n?(""===t&&(t=jQuery("#WDI_user_name").val()),0===o&&(o=jQuery("#wdi_add_or_edit").val()),""===a&&0!==jQuery("#wdi_feed_users_ajax .wdi_user").length&&(a=jQuery("#WDI_wrap_hashtag_top_recent input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val()),a="0"===a?"top_media":"recent_media",""===c&&"undefined"!=typeof users&&(d=JSON.parse(users),c=d[0].tag_id),""===c&&(c="false")):(c=this.getTagId(i),""===t&&(t=jQuery("#WDI_user_name").val()),0===o&&(o=wdi_ajax.feed_id));var f=10;void 0!==wdi_ajax.wdi_cache_request_count&&""!==wdi_ajax.wdi_cache_request_count&&(f=parseInt(wdi_ajax.wdi_cache_request_count)),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{action:"wdi_set_preload_cache_data",tag_id:c,tagname:i,user_name:t,feed_id:o,endpoint:a,wdi_nonce:wdi_ajax.wdi_nonce,next_url:r,iter:e},success:function(e){""!=e.next_url?(e.iter++,e.iter>=f?1===n?"false"!==c?_.getTagRecentMedia(i,u,r,a,1):_.getUserMedia(u,e.next_url,1):(jQuery("#wdi_save_loading").addClass("wdi_hidden"),window.location=s):_.set_cache_data(s,t,o,e.next_url,e.iter,n,i,c,a,u)):1===n?"false"===c?_.getTagRecentMedia(i,u,r,a,1):_.getUserMedia(u,e.next_url,1):(jQuery("#wdi_save_loading").addClass("wdi_hidden"),jQuery("#wdi_save_loading .caching-process-message").addClass("wdi_hidden"),""!==s&&(window.location=s))},error:function(e,s,t){jQuery("#wdi_save_loading .caching-process-message").addClass("wdi_hidden"),jQuery("#wdi_save_loading").addClass("wdi_hidden")}})},this.getUserInfo=function(e,s){var t=this,o=!1,r=this.statusCode,n=!1,i=this.getFilter("getUserInfo");void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(n=!0),"statusCode"in s&&(r=s.statusCode)),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/"+e+"/?access_token="+u(),success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(i&&(e=i(e,t.filterArguments)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(i&&(e=i(e,t.filterArguments)),window[s.success](e)):"function"==typeof s.success&&(i&&(e=i(e,t.filterArguments)),s.success(e)))},error:function(e){n&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:r})},this.getSelfInfo=function(t){var o=this,r=!1,n=this.statusCode,i=!1,c=this.getFilter("getSelfInfo");void 0===t||0===t.length||("success"in t&&(r=!0),"error"in t&&(i=!0),"statusCode"in t&&(n=t.statusCode));var a="https://graph.facebook.com/v3.2/"+(void 0!==_.user&&void 0!==_.user.user_id?_.user.user_id:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user?wdi_object.user.user_id:"")+"?fields=id,ig_id,username,name,biography,profile_picture_url,followers_count,follows_count,media_count,website&access_token="+u();_.getDataFromCache(function(e){var s;!1===e?jQuery.ajax({type:"POST",dataType:"jsonp",url:a,statusCode:n,success:function(e){_.setDataToCache(a,e),r&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(c&&(e.meta={code:200},e=c(e,o.filterArguments)),window[t.success[0]][t.success[1]](e)):"string"==typeof t.success?"function"==typeof window[t.success]&&(c&&(e.meta={code:200},e=c(e,o.filterArguments)),window[t.success](e)):"function"==typeof t.success&&(c&&(e.meta={code:200},e=c(e,o.filterArguments)),t.success(e)))},error:function(e){i&&("object"==typeof t.error&&2==t.error.length?"function"==typeof window[t.error[0]][t.error[1]]&&window[t.error[0]][t.error[1]](e):"string"==typeof t.error?"function"==typeof window[t.error]&&window[t.error](e):"function"==typeof t.error&&t.error(e))}}):(s=e,r&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(c&&(s=c(s,o.filterArguments)),window[t.success[0]][t.success[1]](s)):"string"==typeof t.success?"function"==typeof window[t.success]&&(c&&(s=c(s,o.filterArguments)),window[t.success](s)):"function"==typeof t.success&&(c&&(s=c(s,o.filterArguments)),t.success(s))))},a)},this.getRecentMediaComments=function(e,s,t){var o=this,r=!1,n=this.statusCode,i=!1,c=this.getFilter("getRecentMediaComments");void 0===s||0===s.length||("success"in s&&(r=!0),"error"in s&&(i=!0),"statusCode"in s&&(n=s.statusCode)),jQuery(".wdi_comment_container #ajax_loading #opacity_div").css("display","block"),jQuery(".wdi_comment_container #ajax_loading #loading_div").css("display","block"),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_getRecentMediaComments",user_name:g(),media_id:e,next:t},success:function(e){e=e,r&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(c&&(e=c(e,o.filterArguments)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(c&&(e=c(e,o.filterArguments)),window[s.success](e)):"function"==typeof s.success&&(c&&(e=c(e,o.filterArguments)),s.success(e)))},complete:function(){jQuery(".wdi_comment_container #ajax_loading #opacity_div").css("display","none"),jQuery(".wdi_comment_container #ajax_loading #loading_div").css("display","none")},error:function(e){i&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:n})},this.getRecentMediaLikes=function(e,s){var t=this,o=!1,r=this.statusCode,n=!1,i=this.getFilter("getRecentMediaLikes");void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(n=!0),"statusCode"in s&&(r=s.statusCode)),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/media/"+e+"/likes?access_token="+u(),success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(i&&(e=i(e,t.filterArguments)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(i&&(e=i(e,t.filterArguments)),window[s.success](e)):"function"==typeof s.success&&(i&&(e=i(e,t.filterArguments)),s.success(e)))},error:function(e){n&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:r})},this.getDataFromCache=function(s,e,t){void 0===t&&(t=!0),jQuery.ajax({type:"POST",async:t,url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:e,wdi_nonce:wdi_ajax.wdi_nonce,WDI_MINIFY:wdi_ajax.WDI_MINIFY,task:"get",action:"wdi_cache"},success:function(e){e.success&&void 0!==e.cache_data&&null!==e.cache_data?(e=JSON.parse(e.cache_data),s(e)):s(!1)}})},this.setDataToCache=function(e,s){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:e,wdi_cache_response:JSON.stringify(s),wdi_nonce:wdi_ajax.wdi_nonce,task:"set",action:"wdi_cache"},success:function(e){}})}}
1
+ function WDIInstagram(e){this.user={},this.access_tokens=[],this.filters=[],void 0!==e&&(void 0!==e.access_tokens&&(this.access_tokens=e.access_tokens),void 0!==e.filters&&(this.filters=e.filters));var _=this;function g(){return void 0!==_.user&&void 0!==_.user.user_name?_.user.user_name:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user?wdi_object.user.user_name:""}function u(){return void 0!==_.user&&void 0!==_.user.access_token?_.user.access_token:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user&&void 0!==wdi_object.user.access_token?wdi_object.user.access_token:""}this.statusCode={429:function(){console.log(" 429: Too many requests. Try after one hour")}},this.getFilter=function(e){var s=_.filters;if(void 0===s)return!1;for(var t=0;t<s.length;t++)if(s[t].where==e)if("object"==typeof s[t].what&&2==s[t].what.length){if(void 0!==window[s[t].what[0]]&&"function"==typeof window[s[t].what[0]][s[t].what[1]])return window[s[t].what[0]][s[t].what[1]]}else{if("string"!=typeof s[t].what)return"function"==typeof s[t].what&&s[t].what;if("function"==typeof window[s[t].what])return window[s[t].what]}return!1},this.addToken=function(e){"string"==typeof e&&_.access_tokens.push(e)},this.resetTokens=function(){_.access_tokens=[]},this.getTagRecentMedia=function(n,i,e,c,a){var s=!1,t=this.statusCode,o=!1,u=(this.getFilter("getTagRecentMedia"),wdi_ajax.feed_id),d=g();c=0===parseInt(c)?"top_media":"recent_media",void 0===i||0===i.length||("success"in i&&(s=!0),"statusCode"in i&&(t=i.statusCode),"error"in i&&(o=!0),"args"in i||(i.args={}),"count"in i?(i.count=parseInt(i.count),(!Number.isInteger(i.count)||i.count<=0)&&(i.count=33)):i.count=33,"feed_id"in i&&(u=i.feed_id),"user_name"in i&&(d=i.user_name));var f=this.getTagId(n);function w(e){void 0===e.data&&(e.data=[]),s&&("object"==typeof i.success&&2==i.success.length?void 0!==window[i.success[0]]&&"function"==typeof window[i.success[0]][i.success[1]]&&window[i.success[0]][i.success[1]](e):"string"==typeof i.success?"function"==typeof window[i.success]&&window[i.success](e):"function"==typeof i.success&&i.success(e))}jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{action:"wdi_getTagRecentMedia",wdi_nonce:wdi_ajax.wdi_nonce,user_name:d,feed_id:u,next_url:e,tagname:n,wdiTagId:f,endpoint:c},success:function(e){var s,t,o=!1,r="";void 0!==e.error&&(o=!0,r=e.error.type),void 0===e.data||void 0!==e.data&&0===e.data.length&&0===a?_.set_cache_data("",d,u,"",0,1,n,f,c,i):(0===e.data.length?e.meta={code:400,error:o,error_type:r}:(!1===f&&(f=""),void 0!==e.tag_data&&(void 0!==(s=e.tag_data).tag_id&&(f=s.tag_id),t=[],void 0!==window.wdi_all_tags&&(t=window.wdi_all_tags),t[s.tag_id]=s,window.wdi_all_tags=t),e.meta={code:200,error:o,error_type:r}),e.tag_id=f,w(e))},error:function(e){o&&("object"==typeof i.error&&2==i.error.length?"function"==typeof window[i.error[0]][i.error[1]]&&window[i.error[0]][i.error[1]](e):"string"==typeof i.error?"function"==typeof window[i.error]&&window[i.error](e):"function"==typeof i.error&&i.error(e))},statusCode:t})},this.getTagId=function(e){var s,t,o=[];if("undefined"!=typeof wdi_controller){if(void 0===(o=wdi_controller.feed_users))return!1;0!==o.length||void 0!==(s=jQuery("#WDI_feed_users").val())&&""!==s&&(o=JSON.parse(s))}else void 0!==window.wdi_all_tags&&(o=window.wdi_all_tags);for(t in o)if(e===o[t].username||"#"+e===o[t].username)return void 0!==o[t].tag_id&&o[t].tag_id;return!1},this.searchForTagsByName=function(e,t){var o=this,r=!1,n=this.statusCode,i=!1;filter=this.getFilter("searchForTagsByName"),void 0===t||0===t.length||("success"in t&&(r=!0),"error"in t&&(i=!0),"statusCode"in t&&(n=t.statusCode));var c="https://api.instagram.com/v1/tags/search?q="+e+"&access_token="+u();_.getDataFromCache(function(e){function s(e){r&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(filter&&(e=filter(e,o.filterArguments)),window[t.success[0]][t.success[1]](e)):"string"==typeof t.success?"function"==typeof window[t.success]&&(filter&&(e=filter(e,o.filterArguments)),window[t.success](e)):"function"==typeof t.success&&(filter&&(e=filter(e,o.filterArguments)),t.success(e)))}!1===e?jQuery.ajax({type:"POST",url:c,dataType:"jsonp",success:function(e){_.setDataToCache(c,e),s(e)},error:function(e){i&&("object"==typeof t.error&&2==t.error.length?"function"==typeof window[t.error[0]][t.error[1]]&&window[t.error[0]][t.error[1]](e):"string"==typeof t.error?"function"==typeof window[t.error]&&window[t.error](e):"function"==typeof t.error&&t.error(e))},statusCode:n}):s(e)},c)},this.searchForUsersByName=function(e,s){var t=this,o=!1,r=(this.statusCode,!1),n=this.getFilter("searchForUsersByName");void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(r=!0),"statusCode"in s&&s.statusCode),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/search?q="+e+"&access_token="+u(),success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(n&&(e=n(e,t.filterArguments)),e.args=s,window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(n&&(e=n(e,t.filterArguments)),e.args=s,window[s.success](e)):"function"==typeof s.success&&(n&&(e=n(e,t.filterArguments)),(e.args=s).success(e)))},error:function(e){r&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:this.statusCode})},this.getRecentLikedMedia=function(s){var t=this,o=!1,e=this.statusCode,r=!1,n=this.getFilter("getRecentLikedMedia"),i="https://api.instagram.com/v1/users/self/media/liked?access_token="+u();void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(r=!0),"statusCode"in s&&(e=s.statusCode),"args"in s?argFlag=!0:s.args={},"count"in s?(s.count=parseInt(s.count),(!Number.isInteger(s.count)||s.count<=0)&&(s.count=20)):s.count=20,i+="&count="+s.count,"next_max_like_id"in s&&(i+="&next_max_like_id="+s.next_max_like_id)),jQuery.ajax({type:"POST",dataType:"jsonp",url:i,success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(n&&(e=n(e,t.filterArguments,s.args)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(n&&(e=n(e,t.filterArguments,s.args)),window[s.success](e)):"function"==typeof s.success&&(n&&(e=n(e,t.filterArguments,s.args)),s.success(e)))},error:function(e){r&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:e})},this.getUserRecentMedia=function(e,s){var t=this,o=!1,r=this.statusCode,n=!1,i=this.getFilter("getUserRecentMedia"),e="https://api.instagram.com/v1/users/"+e+"/media/recent/?access_token="+u();void 0===s||0===s.length||("success"in s&&(o=!0),"statusCode"in s&&(r=s.statusCode),"args"in s||(s.args={}),"error"in s&&(n=!0),"count"in s?(s.count=parseInt(s.count),(!Number.isInteger(s.count)||s.count<=0)&&(s.count=33)):s.count=33,e+="&count="+s.count,"min_id"in s&&(e+="&min_id="+s.min_id),"max_id"in s&&(e+="&max_id="+s.max_id)),jQuery.ajax({type:"POST",dataType:"jsonp",url:e,success:function(e){void 0===e.data&&(e.data=[]),o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(i&&(e=i(e,t.filterArguments,s.args)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(i&&(e=i(e,t.filterArguments,s.args)),window[s.success](e)):"function"==typeof s.success&&(i&&(e=i(e,t.filterArguments,s.args)),s.success(e)))},error:function(e){n&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:r})},this.getUserMedia=function(o,e,r){e=void 0===e?"":e;var n=this,i=!1,s=this.statusCode,t=!1,c=this.getFilter("getUserMedia"),a=g(),u=wdi_ajax.feed_id;void 0===o||0===o.length||("success"in o&&(i=!0),"error"in o&&(t=!0),"statusCode"in o&&(s=o.statusCode),"args"in o||(o.args={}),"count"in o?(o.count=parseInt(o.count),(!Number.isInteger(o.count)||o.count<=0)&&(o.count=20)):o.count=20,"feed_id"in o&&(u=o.feed_id),"user_name"in o&&(a=o.user_name)),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_getUserMedia",user_name:a,feed_id:u,next_url:e},success:function(e){var s=!1,t="";void 0!==e.error&&(s=!0,t=e.error.type),void 0===e.data||void 0!==e.data&&0===e.data.length&&0===r?_.set_cache_data("",a,u,"",0,1,"","","",o):0!==e.data.length?(e.meta={code:200,error:s,error_type:t},i&&("object"==typeof o.success&&2==o.success.length?void 0!==window[o.success[0]]&&"function"==typeof window[o.success[0]][o.success[1]]&&(c&&(e=_.addTags(e),e=c(e,n.filterArguments,o)),window[o.success[0]][o.success[1]](e)):"string"==typeof o.success?"function"==typeof window[o.success]&&(c&&(e=_.addTags(e),e=c(e,n.filterArguments,o)),window[o.success](e)):"function"==typeof o.success&&o.success(e))):(e.meta={code:400,error:s,error_type:t},o.success(e))},error:function(e){t&&("object"==typeof o.error&&2==o.error.length?"function"==typeof window[o.error[0]][o.error[1]]&&window[o.error[0]][o.error[1]](e):"string"==typeof o.error?"function"==typeof window[o.error]&&window[o.error](e):"function"==typeof o.error&&o.error(e))},statusCode:s})},this.set_cache_data=function(s,t,o,r,e,n,i,c,a,u){var d;0===n?(""===t&&(t=jQuery("#WDI_user_name").val()),0===o&&(o=jQuery("#wdi_add_or_edit").val()),""===a&&0!==jQuery("#wdi_feed_users_ajax .wdi_user").length&&(a=jQuery("#WDI_wrap_hashtag_top_recent input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val()),a="0"===a?"top_media":"recent_media",""===c&&"undefined"!=typeof users&&(d=JSON.parse(users),c=d[0].tag_id),""===c&&(c="false")):(c=this.getTagId(i),""===t&&(t=jQuery("#WDI_user_name").val()),0===o&&(o=wdi_ajax.feed_id));var f=10;void 0!==wdi_ajax.wdi_cache_request_count&&""!==wdi_ajax.wdi_cache_request_count&&(f=parseInt(wdi_ajax.wdi_cache_request_count)),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{action:"wdi_set_preload_cache_data",tag_id:c,tagname:i,user_name:t,feed_id:o,endpoint:a,wdi_nonce:wdi_ajax.wdi_nonce,next_url:r,iter:e},success:function(e){""!=e.next_url?(e.iter++,e.iter>=f?1===n?"false"!==c?_.getTagRecentMedia(i,u,r,a,1):_.getUserMedia(u,e.next_url,1):(jQuery("#wdi_save_loading").addClass("wdi_hidden"),window.location=s):_.set_cache_data(s,t,o,e.next_url,e.iter,n,i,c,a,u)):1===n?"false"===c?_.getTagRecentMedia(i,u,r,a,1):_.getUserMedia(u,e.next_url,1):(jQuery("#wdi_save_loading").addClass("wdi_hidden"),jQuery("#wdi_save_loading .caching-process-message").addClass("wdi_hidden"),""!==s&&(window.location=s))},error:function(e,s,t){jQuery("#wdi_save_loading .caching-process-message").addClass("wdi_hidden"),jQuery("#wdi_save_loading").addClass("wdi_hidden")}})},this.getUserInfo=function(e,s){var t=this,o=!1,r=this.statusCode,n=!1,i=this.getFilter("getUserInfo");void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(n=!0),"statusCode"in s&&(r=s.statusCode)),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/users/"+e+"/?access_token="+u(),success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(i&&(e=i(e,t.filterArguments)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(i&&(e=i(e,t.filterArguments)),window[s.success](e)):"function"==typeof s.success&&(i&&(e=i(e,t.filterArguments)),s.success(e)))},error:function(e){n&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:r})},this.getSelfInfo=function(t){var o=this,r=!1,n=this.statusCode,i=!1,c=this.getFilter("getSelfInfo");void 0===t||0===t.length||("success"in t&&(r=!0),"error"in t&&(i=!0),"statusCode"in t&&(n=t.statusCode));var a="https://graph.facebook.com/v12.0/"+(void 0!==_.user&&void 0!==_.user.user_id?_.user.user_id:"undefined"!=typeof wdi_object&&void 0!==wdi_object.user?wdi_object.user.user_id:"")+"?fields=id,ig_id,username,name,biography,profile_picture_url,followers_count,follows_count,media_count,website&access_token="+u();_.getDataFromCache(function(e){var s;!1===e?jQuery.ajax({type:"POST",dataType:"jsonp",url:a,statusCode:n,success:function(e){_.setDataToCache(a,e),r&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(c&&(e.meta={code:200},e=c(e,o.filterArguments)),window[t.success[0]][t.success[1]](e)):"string"==typeof t.success?"function"==typeof window[t.success]&&(c&&(e.meta={code:200},e=c(e,o.filterArguments)),window[t.success](e)):"function"==typeof t.success&&(c&&(e.meta={code:200},e=c(e,o.filterArguments)),t.success(e)))},error:function(e){i&&("object"==typeof t.error&&2==t.error.length?"function"==typeof window[t.error[0]][t.error[1]]&&window[t.error[0]][t.error[1]](e):"string"==typeof t.error?"function"==typeof window[t.error]&&window[t.error](e):"function"==typeof t.error&&t.error(e))}}):(s=e,r&&("object"==typeof t.success&&2==t.success.length?void 0!==window[t.success[0]]&&"function"==typeof window[t.success[0]][t.success[1]]&&(c&&(s=c(s,o.filterArguments)),window[t.success[0]][t.success[1]](s)):"string"==typeof t.success?"function"==typeof window[t.success]&&(c&&(s=c(s,o.filterArguments)),window[t.success](s)):"function"==typeof t.success&&(c&&(s=c(s,o.filterArguments)),t.success(s))))},a)},this.getRecentMediaComments=function(e,s,t){var o=this,r=!1,n=this.statusCode,i=!1,c=this.getFilter("getRecentMediaComments");void 0===s||0===s.length||("success"in s&&(r=!0),"error"in s&&(i=!0),"statusCode"in s&&(n=s.statusCode)),jQuery(".wdi_comment_container #ajax_loading #opacity_div").css("display","block"),jQuery(".wdi_comment_container #ajax_loading #loading_div").css("display","block"),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,action:"wdi_getRecentMediaComments",user_name:g(),media_id:e,next:t},success:function(e){e=e,r&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(c&&(e=c(e,o.filterArguments)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(c&&(e=c(e,o.filterArguments)),window[s.success](e)):"function"==typeof s.success&&(c&&(e=c(e,o.filterArguments)),s.success(e)))},complete:function(){jQuery(".wdi_comment_container #ajax_loading #opacity_div").css("display","none"),jQuery(".wdi_comment_container #ajax_loading #loading_div").css("display","none")},error:function(e){i&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:n})},this.getRecentMediaLikes=function(e,s){var t=this,o=!1,r=this.statusCode,n=!1,i=this.getFilter("getRecentMediaLikes");void 0===s||0===s.length||("success"in s&&(o=!0),"error"in s&&(n=!0),"statusCode"in s&&(r=s.statusCode)),jQuery.ajax({type:"POST",dataType:"jsonp",url:"https://api.instagram.com/v1/media/"+e+"/likes?access_token="+u(),success:function(e){o&&("object"==typeof s.success&&2==s.success.length?void 0!==window[s.success[0]]&&"function"==typeof window[s.success[0]][s.success[1]]&&(i&&(e=i(e,t.filterArguments)),window[s.success[0]][s.success[1]](e)):"string"==typeof s.success?"function"==typeof window[s.success]&&(i&&(e=i(e,t.filterArguments)),window[s.success](e)):"function"==typeof s.success&&(i&&(e=i(e,t.filterArguments)),s.success(e)))},error:function(e){n&&("object"==typeof s.error&&2==s.error.length?"function"==typeof window[s.error[0]][s.error[1]]&&window[s.error[0]][s.error[1]](e):"string"==typeof s.error?"function"==typeof window[s.error]&&window[s.error](e):"function"==typeof s.error&&s.error(e))},statusCode:r})},this.getDataFromCache=function(s,e,t){void 0===t&&(t=!0),jQuery.ajax({type:"POST",async:t,url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:e,wdi_nonce:wdi_ajax.wdi_nonce,WDI_MINIFY:wdi_ajax.WDI_MINIFY,task:"get",action:"wdi_cache"},success:function(e){e.success&&void 0!==e.cache_data&&null!==e.cache_data?(e=JSON.parse(e.cache_data),s(e)):s(!1)}})},this.setDataToCache=function(e,s){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_cache_name:e,wdi_cache_response:JSON.stringify(s),wdi_nonce:wdi_ajax.wdi_nonce,task:"set",action:"wdi_cache"},success:function(e){}})}}
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,10web,progmastery
3
  Requires at least: 4.6
4
  Requires PHP: 5.2
5
  Tested up to: 5.8
6
- Stable tag: 1.4.32
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
3
  Requires at least: 4.6
4
  Requires PHP: 5.2
5
  Tested up to: 5.8
6
+ Stable tag: 1.4.33
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
wd-instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: 10Web Social Photo Feed
4
  * Plugin URI: https://10web.io/plugins/wordpress-instagram-feed/?utm_source=instagram_feed&utm_medium=free_plugin
5
  * Description: 10Web Social Photo Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. You can create feeds with one of the available layouts. It allows displaying image metadata, open up images in lightbox, download them and even share in social networking websites.
6
- * Version: 1.4.32
7
  * Author: 10Web
8
  * Author URI: https://10Web.io/plugins/?utm_source=instagram_feed&utm_medium=free_plugin
9
  * License: GPLv2 or later
3
  * Plugin Name: 10Web Social Photo Feed
4
  * Plugin URI: https://10web.io/plugins/wordpress-instagram-feed/?utm_source=instagram_feed&utm_medium=free_plugin
5
  * Description: 10Web Social Photo Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. You can create feeds with one of the available layouts. It allows displaying image metadata, open up images in lightbox, download them and even share in social networking websites.
6
+ * Version: 1.4.33
7
  * Author: 10Web
8
  * Author URI: https://10Web.io/plugins/?utm_source=instagram_feed&utm_medium=free_plugin
9
  * License: GPLv2 or later