Instagram Gallery - Version 2.9.3

Version Description

  • Fix. premium compatibility
Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 Instagram Gallery
Version 2.9.3
Comparing to
See all releases

Code changes from version 2.9.2 to 2.9.3

assets/backend/js/qligg-admin-feed.js CHANGED
@@ -41,10 +41,27 @@
41
  initialize: function (e) {
42
  var $button = $(e.target),
43
  feed_id = $button.closest('[data-feed_position]').data('feed_id');
 
44
  var model = new FeedModel();
 
 
 
 
 
 
 
 
 
45
  model.set({
46
- id: feed_id
47
  });
 
 
 
 
 
 
 
48
  new FeedView({
49
  model: model
50
  }).render();
@@ -80,7 +97,7 @@
80
  view.setElement(this.$(selector)).render();
81
  },
82
  updateModel: function (e) {
83
- e.preventDefault();
84
  var modal = this,
85
  $form = modal.$el.find('#qligg_modal').find('form');
86
 
@@ -148,26 +165,15 @@
148
  open: function (e) {
149
  var modal = this;
150
  $('body').addClass('modal-open').append(this.$el);
151
-
152
- if (modal.model.attributes.id == undefined) {
153
-
154
- modal.model.set({
155
- username: Object.keys(qligg_feed.accounts)[0]
156
- });
157
-
158
- _.delay(function () {
159
- unblock();
160
- }, 100);
161
-
162
- return;
163
- }
164
-
165
  this.load();
166
  },
167
  load: function () {
168
  var modal = this;
169
  if (modal.model.attributes.id == undefined) {
170
  modal.render();
 
 
 
171
  return;
172
  }
173
  $.ajax({
@@ -179,9 +185,11 @@
179
  },
180
  dataType: 'json',
181
  type: 'POST',
182
- // beforeSend: function () {
183
- // },
184
  complete: function () {
 
 
 
 
185
  unblock();
186
  },
187
  error: function () {
41
  initialize: function (e) {
42
  var $button = $(e.target),
43
  feed_id = $button.closest('[data-feed_position]').data('feed_id');
44
+
45
  var model = new FeedModel();
46
+
47
+ if (!Object.keys(qligg_feed.accounts).length) {
48
+ var c = confirm(qligg_feed.message.confirm_username);
49
+ if (c) {
50
+ window.location.href = qligg_feed.redirect.accounts;
51
+ }
52
+ return;
53
+ }
54
+
55
  model.set({
56
+ id: feed_id,
57
  });
58
+
59
+ if (!feed_id) {
60
+ model.set({
61
+ username: Object.keys(qligg_feed.accounts)[0],
62
+ });
63
+ }
64
+
65
  new FeedView({
66
  model: model
67
  }).render();
97
  view.setElement(this.$(selector)).render();
98
  },
99
  updateModel: function (e) {
100
+ e && e.preventDefault();
101
  var modal = this,
102
  $form = modal.$el.find('#qligg_modal').find('form');
103
 
165
  open: function (e) {
166
  var modal = this;
167
  $('body').addClass('modal-open').append(this.$el);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  this.load();
169
  },
170
  load: function () {
171
  var modal = this;
172
  if (modal.model.attributes.id == undefined) {
173
  modal.render();
174
+ _.delay(function () {
175
+ unblock();
176
+ }, 300);
177
  return;
178
  }
179
  $.ajax({
185
  },
186
  dataType: 'json',
187
  type: 'POST',
 
 
188
  complete: function () {
189
+ if (!qligg_feed.accounts[modal.model.attributes.username]) {
190
+ modal.enableSave();
191
+ alert(qligg_feed.message.save);
192
+ }
193
  unblock();
194
  },
195
  error: function () {
assets/backend/js/qligg-admin-feed.min.js CHANGED
@@ -1 +1 @@
1
- !function($){var count=0,timer,is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function(){$("#qligg_modal").addClass("processing")},unblock=function(){$("#qligg_modal").removeClass("processing")};_.mixin({escapeHtml:function(attribute){return attribute.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")},getFormData:function($form){return $form.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:!0,parseNulls:!0})}});var FeedModel=Backbone.Model.extend({defaults:qligg_feed.args}),FeedModal=Backbone.View.extend({initialize:function(e){var $button,feed_id=$(e.target).closest("[data-feed_position]").data("feed_id"),model=new FeedModel;model.set({id:feed_id}),new FeedView({model:model}).render()}}),FeedView=Backbone.View.extend({events:{"change input":"enableSave","change textarea":"enableSave","change select":"enableSave","click .media-modal-image":"setLayout","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","click .media-modal-tab":"tab","change .media-modal-render-tabs":"renderTabs","change .media-modal-render-panels":"renderPanels","submit .media-modal-form":"submit","qligg.color.change input":"enableSave"},templates:{},initialize:function(){_.bindAll(this,"open","tab","edit","load","render","close","submit"),this.init(),this.open()},init:function(){this.templates.window=wp.template("qligg-modal-main")},assign:function(view,selector){view.setElement(this.$(selector)).render()},updateModel:function(e){e.preventDefault();var modal=this,$form=this.$el.find("#qligg_modal").find("form"),model=_.getFormData($form);this.model.set(model)},reload:function(e){this.$el.find("#qligg_modal").hasClass("reload")?location.reload():this.remove()},close:function(e){e.preventDefault(),this.undelegateEvents(),$(document).off("focusin"),$("body").removeClass("modal-open"),this.$el.find("#qligg_modal").addClass("reload"),this.reload(e)},enableSave:function(e){$(".media-modal-submit").removeProp("disabled"),this.updateModel(e)},disableSave:function(e){$(".media-modal-submit").prop("disabled",!0)},tab:function(e){e.preventDefault();var modal=this,$modal=this.$el.find("#qligg_modal"),$tab=$(e.currentTarget),$tabs=$modal.find("ul.qligg-tabs"),panel=$tab.find("a").attr("href").replace("#","");$tabs.find(".active").removeClass("active"),$tab.addClass("active"),this.model.attributes.panel=panel,this.model.changed.panel=panel,this.renderPanels(e)},renderTabs:function(e){this.renderPanels(e),this.tabs.render()},renderPanels:function(e){this.updateModel(e),this.panels.render()},render:function(){var modal=this;modal.$el.html(modal.templates.window(modal.model.attributes)),this.tabs=new FeedViewTabs({model:modal.model}),this.panels=new FeedViewPanels({model:modal.model}),this.assign(this.tabs,"#qligg-modal-tabs"),this.assign(this.panels,"#qligg-modal-panels"),_.delay((function(){modal.$el.trigger("qligg-enhanced-color")}),100)},open:function(e){var modal=this;if($("body").addClass("modal-open").append(this.$el),null==this.model.attributes.id)return this.model.set({username:Object.keys(qligg_feed.accounts)[0]}),void _.delay((function(){unblock()}),100);this.load()},load:function(){var modal=this;null!=modal.model.attributes.id?$.ajax({url:ajaxurl,data:{action:"qligg_edit_feed",nonce:qligg_feed.nonce.qligg_edit_feed,feed_id:this.model.attributes.id},dataType:"json",type:"POST",complete:function(){unblock()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.set(response.data),modal.render()):alert(response.data)}}):modal.render()},edit:function(e){e.preventDefault();var modal=this,$button=$(e.target),feed_count=parseInt($("#qligg_feeds_table tr[data-feed_id]").length),feed_position=parseInt($("#qligg_feeds_table tr[data-feed_id="+modal.model.get("id")+"]").data("feed_position"));count++,timer&&clearTimeout(timer),timer=setTimeout((function(){feed_position=$button.hasClass("media-modal-next")?Math.min(feed_position+count,feed_count):Math.max(feed_position-count,1),modal.model.set({id:parseInt($("#qligg_feeds_table tr[data-feed_position="+feed_position+"]").data("feed_id"))}),count=0,modal.load()}),300)},submit:function(e){e.preventDefault();var modal=this,$modal=modal.$el.find("#qligg_modal"),$spinner=$modal.find(".settings-save-status .spinner"),$saved=$modal.find(".settings-save-status .saved");return $.ajax({url:ajaxurl,data:{action:"qligg_save_feed",nonce:qligg_feed.nonce.qligg_save_feed,feed:JSON.stringify(modal.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){$(".media-modal-submit").prop("disabled",!0),$spinner.addClass("is-active")},complete:function(){$saved.addClass("is-active"),$spinner.removeClass("is-active"),_.delay((function(){$saved.removeClass("is-active")}),1e3)},error:function(response){alert("Error!")},success:function(response){console.log(response),response.success?null==modal.model.attributes.id&&($modal.addClass("reload"),modal.reload(e),modal.close(e)):alert(response.data)}}),!1},setLayout:function(e){e.preventDefault(),e.stopPropagation(),$(e.target).find("input[type=radio]").prop("checked",!0),$(e.target).siblings().find("input[type=radio]").prop("checked",!1),this.updateModel(e),this.renderPanels(e),this.renderTabs(e),this.enableSave(e)}}),FeedViewTabs=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("qligg-modal-tabs")},render:function(){this.model.attributes.panel="tab_panel_feed",this.$el.html(this.templates.window(this.model.attributes))}}),FeedViewPanels=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("qligg-modal-panels")},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.$el.trigger("qligg-enhanced-color")}});$(document).on("qligg-enhanced-color",(function(e){$(".color-picker").filter(":not(.enhanced)").each((function(){$(this).is("[readonly]")&&$(this).parent(".form-field").addClass("disabled-field"),$(this).wpColorPicker({change:function(event,ui){console.log("wpColorPicker"),$(event.target).trigger("qligg.color.change")},clear:function(event,ui){},hide:function(event,ui){aler("!!!!")}})}))})),$("#qligg-add-feed").on("click",(function(e){e.preventDefault(),new FeedModal(e)}));var exist_modal=!1;$(".qligg_edit_feed").on("click",(function(e){e.preventDefault(),exist_modal||(new FeedModal(e),exist_modal=!0)})),$(".qligg_delete_feed").on("click",(function(e){var c;if(e.preventDefault(),!confirm(qligg_feed.message.confirm_delete))return!1;var $button=$(e.target),$spinner=$button.parent().find(".spinner"),feed_id=$button.closest("[data-feed_id]").data("feed_id");$.ajax({url:ajaxurl,data:{action:"qligg_delete_feed",nonce:qligg_feed.nonce.qligg_delete_feed,feed_id:feed_id},dataType:"json",type:"POST",beforeSend:function(){$spinner.addClass("is-active")},complete:function(){$spinner.removeClass("is-active")},error:function(response){},success:function(response){response.data?(console.log(response.data),location.reload()):alert(response.data)}})})),$(".qligg_clear_cache").on("click",(function(e){var c;if(e.preventDefault(),!confirm(qligg_feed.message.confirm_clear_cache))return!1;var $button=$(e.target),$spinner=$button.parent().find(".spinner"),feed_id=$button.closest("[data-feed_id]").data("feed_id");$.ajax({url:ajaxurl,type:"post",data:{action:"qligg_clear_cache",feed_id:feed_id,nonce:qligg_feed.nonce.qligg_clear_cache},beforeSend:function(){$spinner.addClass("is-active")},success:function(response){response.success?setTimeout((function(){$spinner.removeClass("is-active")}),300):alert(response.data)},complete:function(){setTimeout((function(){$spinner.removeClass("is-active")}),600)},error:function(jqXHR,textStatus){console.log(textStatus)}})})),$(document).on("click",".upload_image_button",(function(e){e.preventDefault();var send_attachment_bkp=wp.media.editor.send.attachment,button=$(this);return wp.media.editor.send.attachment=function(props,attachment){$(button).parent().prev().attr("src",attachment.url),$(button).prev().val(attachment.url).trigger("change"),wp.media.editor.send.attachment=send_attachment_bkp},wp.media.editor.open(button),!1})),$(document).on("click",".remove_image_button",(function(e){e.preventDefault();var src=$(this).parent().prev().attr("data-src");return $(this).parent().prev().attr("src",src),$(this).prev().prev().val("").trigger("change"),!1})),$(document).on("click","[data-qligg-copy-feed-shortcode]",(function(e){e.preventDefault(),$($(this).data("qligg-copy-feed-shortcode")).select(),document.execCommand("copy")}))}(jQuery);
1
+ !function($){var count=0,timer,is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function(){$("#qligg_modal").addClass("processing")},unblock=function(){$("#qligg_modal").removeClass("processing")};_.mixin({escapeHtml:function(attribute){return attribute.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")},getFormData:function($form){return $form.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:!0,parseNulls:!0})}});var FeedModel=Backbone.Model.extend({defaults:qligg_feed.args}),FeedModal=Backbone.View.extend({initialize:function(e){var $button,feed_id=$(e.target).closest("[data-feed_position]").data("feed_id"),model=new FeedModel,c;Object.keys(qligg_feed.accounts).length?(model.set({id:feed_id}),feed_id||model.set({username:Object.keys(qligg_feed.accounts)[0]}),new FeedView({model:model}).render()):confirm(qligg_feed.message.confirm_username)&&(window.location.href=qligg_feed.redirect.accounts)}}),FeedView=Backbone.View.extend({events:{"change input":"enableSave","change textarea":"enableSave","change select":"enableSave","click .media-modal-image":"setLayout","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","click .media-modal-tab":"tab","change .media-modal-render-tabs":"renderTabs","change .media-modal-render-panels":"renderPanels","submit .media-modal-form":"submit","qligg.color.change input":"enableSave"},templates:{},initialize:function(){_.bindAll(this,"open","tab","edit","load","render","close","submit"),this.init(),this.open()},init:function(){this.templates.window=wp.template("qligg-modal-main")},assign:function(view,selector){view.setElement(this.$(selector)).render()},updateModel:function(e){e&&e.preventDefault();var modal=this,$form=this.$el.find("#qligg_modal").find("form"),model=_.getFormData($form);this.model.set(model)},reload:function(e){this.$el.find("#qligg_modal").hasClass("reload")?location.reload():this.remove()},close:function(e){e.preventDefault(),this.undelegateEvents(),$(document).off("focusin"),$("body").removeClass("modal-open"),this.$el.find("#qligg_modal").addClass("reload"),this.reload(e)},enableSave:function(e){$(".media-modal-submit").removeProp("disabled"),this.updateModel(e)},disableSave:function(e){$(".media-modal-submit").prop("disabled",!0)},tab:function(e){e.preventDefault();var modal=this,$modal=this.$el.find("#qligg_modal"),$tab=$(e.currentTarget),$tabs=$modal.find("ul.qligg-tabs"),panel=$tab.find("a").attr("href").replace("#","");$tabs.find(".active").removeClass("active"),$tab.addClass("active"),this.model.attributes.panel=panel,this.model.changed.panel=panel,this.renderPanels(e)},renderTabs:function(e){this.renderPanels(e),this.tabs.render()},renderPanels:function(e){this.updateModel(e),this.panels.render()},render:function(){var modal=this;modal.$el.html(modal.templates.window(modal.model.attributes)),this.tabs=new FeedViewTabs({model:modal.model}),this.panels=new FeedViewPanels({model:modal.model}),this.assign(this.tabs,"#qligg-modal-tabs"),this.assign(this.panels,"#qligg-modal-panels"),_.delay((function(){modal.$el.trigger("qligg-enhanced-color")}),100)},open:function(e){var modal=this;$("body").addClass("modal-open").append(this.$el),this.load()},load:function(){var modal=this;if(null==modal.model.attributes.id)return modal.render(),void _.delay((function(){unblock()}),300);$.ajax({url:ajaxurl,data:{action:"qligg_edit_feed",nonce:qligg_feed.nonce.qligg_edit_feed,feed_id:this.model.attributes.id},dataType:"json",type:"POST",complete:function(){qligg_feed.accounts[modal.model.attributes.username]||(modal.enableSave(),alert(qligg_feed.message.save)),unblock()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.set(response.data),modal.render()):alert(response.data)}})},edit:function(e){e.preventDefault();var modal=this,$button=$(e.target),feed_count=parseInt($("#qligg_feeds_table tr[data-feed_id]").length),feed_position=parseInt($("#qligg_feeds_table tr[data-feed_id="+modal.model.get("id")+"]").data("feed_position"));count++,timer&&clearTimeout(timer),timer=setTimeout((function(){feed_position=$button.hasClass("media-modal-next")?Math.min(feed_position+count,feed_count):Math.max(feed_position-count,1),modal.model.set({id:parseInt($("#qligg_feeds_table tr[data-feed_position="+feed_position+"]").data("feed_id"))}),count=0,modal.load()}),300)},submit:function(e){e.preventDefault();var modal=this,$modal=modal.$el.find("#qligg_modal"),$spinner=$modal.find(".settings-save-status .spinner"),$saved=$modal.find(".settings-save-status .saved");return $.ajax({url:ajaxurl,data:{action:"qligg_save_feed",nonce:qligg_feed.nonce.qligg_save_feed,feed:JSON.stringify(modal.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){$(".media-modal-submit").prop("disabled",!0),$spinner.addClass("is-active")},complete:function(){$saved.addClass("is-active"),$spinner.removeClass("is-active"),_.delay((function(){$saved.removeClass("is-active")}),1e3)},error:function(response){alert("Error!")},success:function(response){console.log(response),response.success?null==modal.model.attributes.id&&($modal.addClass("reload"),modal.reload(e),modal.close(e)):alert(response.data)}}),!1},setLayout:function(e){e.preventDefault(),e.stopPropagation(),$(e.target).find("input[type=radio]").prop("checked",!0),$(e.target).siblings().find("input[type=radio]").prop("checked",!1),this.updateModel(e),this.renderPanels(e),this.renderTabs(e),this.enableSave(e)}}),FeedViewTabs=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("qligg-modal-tabs")},render:function(){this.model.attributes.panel="tab_panel_feed",this.$el.html(this.templates.window(this.model.attributes))}}),FeedViewPanels=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("qligg-modal-panels")},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.$el.trigger("qligg-enhanced-color")}});$(document).on("qligg-enhanced-color",(function(e){$(".color-picker").filter(":not(.enhanced)").each((function(){$(this).is("[readonly]")&&$(this).parent(".form-field").addClass("disabled-field"),$(this).wpColorPicker({change:function(event,ui){console.log("wpColorPicker"),$(event.target).trigger("qligg.color.change")},clear:function(event,ui){},hide:function(event,ui){aler("!!!!")}})}))})),$("#qligg-add-feed").on("click",(function(e){e.preventDefault(),new FeedModal(e)}));var exist_modal=!1;$(".qligg_edit_feed").on("click",(function(e){e.preventDefault(),exist_modal||(new FeedModal(e),exist_modal=!0)})),$(".qligg_delete_feed").on("click",(function(e){var c;if(e.preventDefault(),!confirm(qligg_feed.message.confirm_delete))return!1;var $button=$(e.target),$spinner=$button.parent().find(".spinner"),feed_id=$button.closest("[data-feed_id]").data("feed_id");$.ajax({url:ajaxurl,data:{action:"qligg_delete_feed",nonce:qligg_feed.nonce.qligg_delete_feed,feed_id:feed_id},dataType:"json",type:"POST",beforeSend:function(){$spinner.addClass("is-active")},complete:function(){$spinner.removeClass("is-active")},error:function(response){},success:function(response){response.data?(console.log(response.data),location.reload()):alert(response.data)}})})),$(".qligg_clear_cache").on("click",(function(e){var c;if(e.preventDefault(),!confirm(qligg_feed.message.confirm_clear_cache))return!1;var $button=$(e.target),$spinner=$button.parent().find(".spinner"),feed_id=$button.closest("[data-feed_id]").data("feed_id");$.ajax({url:ajaxurl,type:"post",data:{action:"qligg_clear_cache",feed_id:feed_id,nonce:qligg_feed.nonce.qligg_clear_cache},beforeSend:function(){$spinner.addClass("is-active")},success:function(response){response.success?setTimeout((function(){$spinner.removeClass("is-active")}),300):alert(response.data)},complete:function(){setTimeout((function(){$spinner.removeClass("is-active")}),600)},error:function(jqXHR,textStatus){console.log(textStatus)}})})),$(document).on("click",".upload_image_button",(function(e){e.preventDefault();var send_attachment_bkp=wp.media.editor.send.attachment,button=$(this);return wp.media.editor.send.attachment=function(props,attachment){$(button).parent().prev().attr("src",attachment.url),$(button).prev().val(attachment.url).trigger("change"),wp.media.editor.send.attachment=send_attachment_bkp},wp.media.editor.open(button),!1})),$(document).on("click",".remove_image_button",(function(e){e.preventDefault();var src=$(this).parent().prev().attr("data-src");return $(this).parent().prev().attr("src",src),$(this).prev().prev().val("").trigger("change"),!1})),$(document).on("click","[data-qligg-copy-feed-shortcode]",(function(e){e.preventDefault(),$($(this).data("qligg-copy-feed-shortcode")).select(),document.execCommand("copy")}))}(jQuery);
includes/apiFacebook.php CHANGED
@@ -18,7 +18,6 @@ class QLIGG_API_Facebook
18
  {
19
 
20
  $state = admin_url('admin.php');
21
- //$scope = 'manage_pages,instagram_basic,instagram_manage_insights,instagram_manage_comments';
22
  $scope = 'instagram_basic,instagram_manage_insights,instagram_manage_comments,manage_pages,pages_read_engagement';
23
 
24
 
@@ -27,7 +26,6 @@ class QLIGG_API_Facebook
27
 
28
  function getUserProfile($account_id, $access_token)
29
  {
30
- //'fields' => 'id,follow_count,followed_by_count,has_profile_picture,is_private,is_published,media_count,profile_pic,username,account_type',
31
  $response = $this->remoteGet("https://graph.facebook.com/{$account_id}", array(
32
  'fields' => 'id,username,website,biography,name,followers_count,media_count,profile_picture_url',
33
  'access_token' => $access_token
@@ -39,7 +37,7 @@ class QLIGG_API_Facebook
39
  function getUserMedia($account_id, $access_token, $after = null)
40
  {
41
 
42
- $limit = 60; //$num = min( $num, 200 );
43
 
44
  $response = $this->remoteGet("{$this->facebook_graph_url}/{$account_id}/media", array(
45
  'after' => $after,
@@ -123,6 +121,7 @@ class QLIGG_API_Facebook
123
  if (isset($response['data'][0]['id'])) {
124
  return $response['data'][0]['id'];
125
  }
 
126
  }
127
 
128
  function getTagMedia($account_id, $hashtag = null, $after = null)
18
  {
19
 
20
  $state = admin_url('admin.php');
 
21
  $scope = 'instagram_basic,instagram_manage_insights,instagram_manage_comments,manage_pages,pages_read_engagement';
22
 
23
 
26
 
27
  function getUserProfile($account_id, $access_token)
28
  {
 
29
  $response = $this->remoteGet("https://graph.facebook.com/{$account_id}", array(
30
  'fields' => 'id,username,website,biography,name,followers_count,media_count,profile_picture_url',
31
  'access_token' => $access_token
37
  function getUserMedia($account_id, $access_token, $after = null)
38
  {
39
 
40
+ $limit = 30; //$num = min( $num, 200 );
41
 
42
  $response = $this->remoteGet("{$this->facebook_graph_url}/{$account_id}/media", array(
43
  'after' => $after,
121
  if (isset($response['data'][0]['id'])) {
122
  return $response['data'][0]['id'];
123
  }
124
+
125
  }
126
 
127
  function getTagMedia($account_id, $hashtag = null, $after = null)
includes/controllers/AccountController.php CHANGED
@@ -56,8 +56,6 @@ class QLIGG_Account_Controller extends QLIGG_Controller
56
 
57
  parse_str(parse_url(urldecode($_REQUEST['account_data']), PHP_URL_QUERY), $account_data);
58
 
59
- var_dump($account_data);
60
-
61
  if (empty($account_data['id'])) {
62
  parent::error_ajax(esc_html__('Empty access account', 'insta-gallery'));
63
  }
56
 
57
  parse_str(parse_url(urldecode($_REQUEST['account_data']), PHP_URL_QUERY), $account_data);
58
 
 
 
59
  if (empty($account_data['id'])) {
60
  parent::error_ajax(esc_html__('Empty access account', 'insta-gallery'));
61
  }
includes/controllers/FeedController.php CHANGED
@@ -90,6 +90,14 @@ class QLIGG_Feed_Controller extends QLIGG_Controller
90
 
91
  $feed = $feed_model->delete_feed($feed_id);
92
 
 
 
 
 
 
 
 
 
93
  if ($feed_id) {
94
  return parent::success_ajax($feed);
95
  }
@@ -152,11 +160,16 @@ class QLIGG_Feed_Controller extends QLIGG_Controller
152
  'qligg_clear_cache' => wp_create_nonce('qligg_clear_cache'),
153
  ),
154
  'message' => array(
 
155
  'confirm_delete' => __('Do you want to delete the feed?', 'insta-gallery'),
156
- 'confirm_clear_cache' => __('Do you want to delete the feed?', 'insta-gallery')
 
157
  ),
158
  'accounts' => $account_model->get_accounts(),
159
- 'args' => $feed_model->get_args()
 
 
 
160
  ));
161
  }
162
  }
90
 
91
  $feed = $feed_model->delete_feed($feed_id);
92
 
93
+ if ($feed['type'] == 'username') {
94
+ $tk = "%%insta_gallery_v2_user_media_{$feed['username']}_%%";
95
+ } else {
96
+ $tk = "%%insta_gallery_v2_tag_media_{$feed['tag']}_%%";
97
+ }
98
+
99
+ $feed_model->clear_cache($tk);
100
+
101
  if ($feed_id) {
102
  return parent::success_ajax($feed);
103
  }
160
  'qligg_clear_cache' => wp_create_nonce('qligg_clear_cache'),
161
  ),
162
  'message' => array(
163
+ 'save' => __('Please save feed settings to update user account.', 'insta-gallery'),
164
  'confirm_delete' => __('Do you want to delete the feed?', 'insta-gallery'),
165
+ 'confirm_clear_cache' => __('Do you want to delete the feed?', 'insta-gallery'),
166
+ 'confirm_username' => __('You need to create token before creating a feed.', 'insta-gallery'),
167
  ),
168
  'accounts' => $account_model->get_accounts(),
169
+ 'args' => $feed_model->get_args(),
170
+ 'redirect' => array(
171
+ 'accounts' => admin_url('admin.php?page=qligg_account')
172
+ )
173
  ));
174
  }
175
  }
includes/models/Feed.php CHANGED
@@ -164,8 +164,17 @@ class QLIGG_Feed extends QLIGG_Model
164
  $feeds = $this->get_all();
165
  if ($feeds) {
166
  if (count($feeds) > 0) {
167
- unset($feeds[$id]);
168
- return $this->save_all($feeds);
 
 
 
 
 
 
 
 
 
169
  }
170
  }
171
  }
164
  $feeds = $this->get_all();
165
  if ($feeds) {
166
  if (count($feeds) > 0) {
167
+
168
+ if (isset($feeds[$id])) {
169
+
170
+ $deleted_feed = $feeds[$id];
171
+
172
+ unset($feeds[$id]);
173
+
174
+ $this->save_all($feeds);
175
+
176
+ return $deleted_feed;
177
+ }
178
  }
179
  }
180
  }
includes/view/backend/pages/feeds.php CHANGED
@@ -29,11 +29,13 @@
29
  if (!isset($feed['type']))
30
  continue;
31
 
32
- //$profile = qligg_get_user_profile($feed['username']);
33
 
34
- //$profile = array_merge($profile, array_filter($feed['profile']));
 
 
35
 
36
- $profile = $feed['profile'];
37
 
38
  ?>
39
  <tr data-feed_id="<?php echo esc_attr($id) ?>" data-feed_position="<?php echo esc_attr($position) ?>">
29
  if (!isset($feed['type']))
30
  continue;
31
 
32
+ $profile = qligg_get_user_profile($feed['username']);
33
 
34
+ unset($profile['profile_picture_url']);
35
+
36
+ $profile = array_merge($profile, array_filter($feed['profile']));
37
 
38
+ //$profile = $feed['profile'];
39
 
40
  ?>
41
  <tr data-feed_id="<?php echo esc_attr($id) ?>" data-feed_position="<?php echo esc_attr($position) ?>">
includes/view/backend/pages/modals/feed/panel-feed.php CHANGED
@@ -20,8 +20,7 @@
20
  </p>
21
 
22
 
23
-
24
- <# if (!data.username || !qligg_feed.accounts[data.username]){ #>
25
  <p class="form-field">
26
  <span class="notice error" style="margin-left:0; margin-right:0; padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
27
  <strong>
20
  </p>
21
 
22
 
23
+ <# if (data.username && !qligg_feed.accounts[data.username]){ #>
 
24
  <p class="form-field">
25
  <span class="notice error" style="margin-left:0; margin-right:0; padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
26
  <strong>
insta-gallery.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Social Feed Gallery
5
  * Plugin URI: https://quadlayers.com/portfolio/instagram-feed-gallery/
6
  * Description: Display beautiful and responsive galleries on your website from your Instagram feed account.
7
- * Version: 2.9.2
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
@@ -19,7 +19,7 @@ if (!defined('QLIGG_PLUGIN_NAME')) {
19
  define('QLIGG_PLUGIN_NAME', 'Social Feed Gallery');
20
  }
21
  if (!defined('QLIGG_PLUGIN_VERSION')) {
22
- define('QLIGG_PLUGIN_VERSION', '2.9.2');
23
  }
24
  if (!defined('QLIGG_PLUGIN_FILE')) {
25
  define('QLIGG_PLUGIN_FILE', __FILE__);
4
  * Plugin Name: Social Feed Gallery
5
  * Plugin URI: https://quadlayers.com/portfolio/instagram-feed-gallery/
6
  * Description: Display beautiful and responsive galleries on your website from your Instagram feed account.
7
+ * Version: 2.9.3
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
19
  define('QLIGG_PLUGIN_NAME', 'Social Feed Gallery');
20
  }
21
  if (!defined('QLIGG_PLUGIN_VERSION')) {
22
+ define('QLIGG_PLUGIN_VERSION', '2.9.3');
23
  }
24
  if (!defined('QLIGG_PLUGIN_FILE')) {
25
  define('QLIGG_PLUGIN_FILE', __FILE__);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://quadlayers.com/portfolio/instagram-gallery/
4
  Tags: Instagram, Instagram feed, Instagram gallery, Instagram photos, Instagram widget, Instagram pictures
5
  Requires at least: 3.4
6
  Tested up to: 5.4.2
7
- Stable tag: 2.9.2
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -105,6 +105,9 @@ There may be some other plugins(like: fancybox, elementor) which also uses image
105
 
106
  == Changelog ==
107
 
 
 
 
108
  = 2.9.2 =
109
  * Fix. premium compatibility
110
 
4
  Tags: Instagram, Instagram feed, Instagram gallery, Instagram photos, Instagram widget, Instagram pictures
5
  Requires at least: 3.4
6
  Tested up to: 5.4.2
7
+ Stable tag: 2.9.3
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
105
 
106
  == Changelog ==
107
 
108
+ = 2.9.3 =
109
+ * Fix. premium compatibility
110
+
111
  = 2.9.2 =
112
  * Fix. premium compatibility
113