Instagram Gallery - Version 2.5.3

Version Description

  • Improvement. Instagram Account disconnet alert
  • Improvement. Instagram Feeds clear feeds cache button
Download this release

Release Info

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

Code changes from version 2.5.2 to 2.5.3

assets/css/qligg-admin.css CHANGED
@@ -242,10 +242,17 @@ li.premium:before {
242
  text-decoration: none;
243
  vertical-align: middle;
244
  height: initial;
245
- padding-right: 5px;
246
- font-size: 14px;
247
- line-height: 12px;
248
  position: relative;
 
 
 
 
 
 
 
 
249
  }
250
  .btn-instagram.secondary {
251
  background: #e23565;
242
  text-decoration: none;
243
  vertical-align: middle;
244
  height: initial;
245
+ font-size: 13px;
246
+ line-height: 13px;
 
247
  position: relative;
248
+ margin: 0 5px 0 -5px;
249
+ width: auto;
250
+ }
251
+ .btn-instagram .dashicons:not(.dashicons-plus) {
252
+ top: -1px;
253
+ }
254
+ .btn-instagram .dashicons.dashicons-update {
255
+ font-size: 14px;
256
  }
257
  .btn-instagram.secondary {
258
  background: #e23565;
assets/css/qligg-admin.min.css CHANGED
@@ -1,2 +1,2 @@
1
 
2
- @-moz-keyframes "igspin"{100%{-moz-transform:rotate(360deg)}}@-webkit-keyframes "igspin"{100%{-webkit-transform:rotate(360deg)}}@keyframes "igspin"{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.qlwrap .nav-tab i{line-height:26px}.qlwrap hr{margin:3em 0 1em 0}div.premium,tr.premium,li.premium{position:relative;pointer-events:none;opacity:.5}div.premium:before,tr.premium:before,li.premium:before{content:'';position:absolute;top:0;bottom:-1px;left:0;right:0;background-color:#eee;opacity:.25}.ig-table h4{margin:5px 0 10px 0}.ig-table .iris-picker .iris-slider{margin-left:8px!important}.ig-table tr.premium{display:block!important}.ig-table tr.premium td p.description{display:none}.ig-table td{vertical-align:middle}.ig-table td.profile-picture img{width:46px;border-radius:50%}.ig-table td p.premium,.ig-table td span.premium{font-size:11px;font-weight:600;font-style:italic;color:#747474}.ig-table input[type="text"]:read-only{font-weight:bold;font-size:110%;padding:3px 10px;background:#f7f7f7;color:#72777c;cursor:copy;border-color:transparent;box-shadow:none}.ig-table input[type="text"]:read-only:focus{border-color:transparent;box-shadow:none}.ig-list-images{display:inline-block;margin:0}.ig-list-images li{display:inline-block;margin:0 10px 0 0;margin-bottom:0;vertical-align:middle;color:#aaa;position:relative;border:1px solid #f1f1f1;border-radius:3px;padding:10px;background-color:#fff;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,0.07)}.ig-list-images li:before{content:'';position:absolute;top:0;bottom:0;left:0;right:0;background-color:#eee;opacity:.2}.ig-list-images li.active:before,.ig-list-images li:hover:before{opacity:0}.ig-list-images li.active label,.ig-list-images li:hover label{color:#e23565}.ig-list-images label{display:block;position:relative;line-height:2em;z-index:9;cursor:pointer;transition:all .25s linear;text-align:center;font-weight:bold;color:#23282d}.ig-list-images input[type=radio]{display:none}.ig-list-buttons{display:inline-block;margin:0}.ig-list-buttons li{display:inline-block;margin-right:20px;margin-bottom:0;vertical-align:middle;color:#aaa;position:relative}.ig-list-buttons li:hover label{color:#e23565}.ig-list-buttons li:hover .check{border-color:#e23565}.ig-list-buttons li .check{display:block;position:absolute;border:5px solid #aaa;border-radius:50%;height:25px;width:25px;top:5px;z-index:5;-webkit-transition:border .25s linear;transition:border .25s linear}.ig-list-buttons li .check::before{display:block;position:absolute;content:'';border-radius:100%;height:15px;width:15px;top:5px;left:5px;margin:auto;-webkit-transition:background .25s linear;transition:background .25s linear}.ig-list-buttons input[type=radio]{position:absolute;visibility:hidden}.ig-list-buttons input[type=radio]:checked ~ .check{border-color:#e23565}.ig-list-buttons input[type=radio]:checked ~ .check::before{background:#e23565}.ig-list-buttons input[type=radio]:checked ~ label{color:#e23565}.ig-list-buttons label{display:block;position:relative;font-size:1.35em;padding:10px 5px 10px 50px;z-index:9;cursor:pointer;-webkit-transition:all .25s linear;transition:all .25s linear}.btn-instagram-account{padding:0 24px 0 120px;height:44px;line-height:44px;text-transform:uppercase;color:rgba(255,255,255,0.8)!important;text-decoration:none;border-radius:3px;transition:all .5s ease-in-out;font-weight:600;display:inline-block;background:#408bd1 url(../img/instagram.png) no-repeat 16px 13.5px;background-size:auto 20px}.btn-instagram-account:focus,.btn-instagram-account:hover{box-shadow:inset 0 0 20px 20px rgba(255,255,255,0.2)}.btn-instagram,.btn-instagram:focus{display:inline-block;height:auto;box-shadow:none;text-shadow:none;border:0;text-transform:uppercase;cursor:pointer;padding:8px 24px;border-radius:3px;transition:all .5s;text-decoration:none;background:#972dbe;color:#fff;font-size:12px;font-weight:600}.btn-instagram:focus{background:#feb547}.btn-instagram:hover{background:#feb547;color:#fff}.btn-instagram .dashicons{text-decoration:none;vertical-align:middle;height:initial;padding-right:5px;font-size:14px;line-height:12px;position:relative}.btn-instagram.secondary{background:#e23565}.btn-instagram.secondary:focus{background:#feb547;color:#fff}.btn-instagram.secondary:hover{background:#feb547;color:#fff}.ig-tab-content-row{display:none;border-bottom:1px solid #f1f1f1}.ig-tab-content-row.active{display:table-row}#ig-save-settings .insta-gallery-spinner{position:relative;height:45px;width:45px}#ig-save-settings .insta-gallery-spinner .ig-spin{max-width:100%;max-height:100%;height:auto;width:auto}
1
 
2
+ @-moz-keyframes "igspin"{100%{-moz-transform:rotate(360deg)}}@-webkit-keyframes "igspin"{100%{-webkit-transform:rotate(360deg)}}@keyframes "igspin"{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.qlwrap .nav-tab i{line-height:26px}.qlwrap hr{margin:3em 0 1em 0}div.premium,tr.premium,li.premium{position:relative;pointer-events:none;opacity:.5}div.premium:before,tr.premium:before,li.premium:before{content:'';position:absolute;top:0;bottom:-1px;left:0;right:0;background-color:#eee;opacity:.25}.ig-table h4{margin:5px 0 10px 0}.ig-table .iris-picker .iris-slider{margin-left:8px!important}.ig-table tr.premium{display:block!important}.ig-table tr.premium td p.description{display:none}.ig-table td{vertical-align:middle}.ig-table td.profile-picture img{width:46px;border-radius:50%}.ig-table td p.premium,.ig-table td span.premium{font-size:11px;font-weight:600;font-style:italic;color:#747474}.ig-table input[type="text"]:read-only{font-weight:bold;font-size:110%;padding:3px 10px;background:#f7f7f7;color:#72777c;cursor:copy;border-color:transparent;box-shadow:none}.ig-table input[type="text"]:read-only:focus{border-color:transparent;box-shadow:none}.ig-list-images{display:inline-block;margin:0}.ig-list-images li{display:inline-block;margin:0 10px 0 0;margin-bottom:0;vertical-align:middle;color:#aaa;position:relative;border:1px solid #f1f1f1;border-radius:3px;padding:10px;background-color:#fff;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,0.07)}.ig-list-images li:before{content:'';position:absolute;top:0;bottom:0;left:0;right:0;background-color:#eee;opacity:.2}.ig-list-images li.active:before,.ig-list-images li:hover:before{opacity:0}.ig-list-images li.active label,.ig-list-images li:hover label{color:#e23565}.ig-list-images label{display:block;position:relative;line-height:2em;z-index:9;cursor:pointer;transition:all .25s linear;text-align:center;font-weight:bold;color:#23282d}.ig-list-images input[type=radio]{display:none}.ig-list-buttons{display:inline-block;margin:0}.ig-list-buttons li{display:inline-block;margin-right:20px;margin-bottom:0;vertical-align:middle;color:#aaa;position:relative}.ig-list-buttons li:hover label{color:#e23565}.ig-list-buttons li:hover .check{border-color:#e23565}.ig-list-buttons li .check{display:block;position:absolute;border:5px solid #aaa;border-radius:50%;height:25px;width:25px;top:5px;z-index:5;-webkit-transition:border .25s linear;transition:border .25s linear}.ig-list-buttons li .check::before{display:block;position:absolute;content:'';border-radius:100%;height:15px;width:15px;top:5px;left:5px;margin:auto;-webkit-transition:background .25s linear;transition:background .25s linear}.ig-list-buttons input[type=radio]{position:absolute;visibility:hidden}.ig-list-buttons input[type=radio]:checked ~ .check{border-color:#e23565}.ig-list-buttons input[type=radio]:checked ~ .check::before{background:#e23565}.ig-list-buttons input[type=radio]:checked ~ label{color:#e23565}.ig-list-buttons label{display:block;position:relative;font-size:1.35em;padding:10px 5px 10px 50px;z-index:9;cursor:pointer;-webkit-transition:all .25s linear;transition:all .25s linear}.btn-instagram-account{padding:0 24px 0 120px;height:44px;line-height:44px;text-transform:uppercase;color:rgba(255,255,255,0.8)!important;text-decoration:none;border-radius:3px;transition:all .5s ease-in-out;font-weight:600;display:inline-block;background:#408bd1 url(../img/instagram.png) no-repeat 16px 13.5px;background-size:auto 20px}.btn-instagram-account:focus,.btn-instagram-account:hover{box-shadow:inset 0 0 20px 20px rgba(255,255,255,0.2)}.btn-instagram,.btn-instagram:focus{display:inline-block;height:auto;box-shadow:none;text-shadow:none;border:0;text-transform:uppercase;cursor:pointer;padding:8px 24px;border-radius:3px;transition:all .5s;text-decoration:none;background:#972dbe;color:#fff;font-size:12px;font-weight:600}.btn-instagram:focus{background:#feb547}.btn-instagram:hover{background:#feb547;color:#fff}.btn-instagram .dashicons{text-decoration:none;vertical-align:middle;height:initial;font-size:13px;line-height:13px;position:relative;margin:0 5px 0 -5px;width:auto}.btn-instagram .dashicons:not(.dashicons-plus){top:-1px}.btn-instagram .dashicons.dashicons-update{font-size:14px}.btn-instagram.secondary{background:#e23565}.btn-instagram.secondary:focus{background:#feb547;color:#fff}.btn-instagram.secondary:hover{background:#feb547;color:#fff}.ig-tab-content-row{display:none;border-bottom:1px solid #f1f1f1}.ig-tab-content-row.active{display:table-row}#ig-save-settings .insta-gallery-spinner{position:relative;height:45px;width:45px}#ig-save-settings .insta-gallery-spinner .ig-spin{max-width:100%;max-height:100%;height:auto;width:auto}
assets/js/qligg-admin.js CHANGED
@@ -442,7 +442,7 @@
442
  $('.ig-form-item-delete').on('click', function (e) {
443
  e.preventDefault();
444
 
445
- var c = confirm(qligg.remove_gallery);
446
 
447
  if (!c) {
448
  return false;
@@ -457,8 +457,8 @@
457
  type: 'post',
458
  data: {
459
  action: 'qligg_form_item_delete',
460
- item_id: $item.data('item_id'),
461
- ig_nonce: $item.data('item_nonce'),
462
  },
463
  beforeSend: function () {
464
  $spinner.addClass('is-active');
@@ -471,11 +471,6 @@
471
  } else {
472
  alert(response.data);
473
  }
474
- //if (response.success) {
475
- // $tr.fadeOut();
476
- //} else {
477
- // alert(response.data);
478
- //}
479
  },
480
  complete: function () {
481
  setTimeout(function () {
@@ -488,6 +483,53 @@
488
  });
489
  });
490
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
  $(document).on('ready', function () {
492
  $('.color-picker').wpColorPicker();
493
  });
442
  $('.ig-form-item-delete').on('click', function (e) {
443
  e.preventDefault();
444
 
445
+ var c = confirm(qligg.remove_item);
446
 
447
  if (!c) {
448
  return false;
457
  type: 'post',
458
  data: {
459
  action: 'qligg_form_item_delete',
460
+ item_id: $tr.data('item_id'),
461
+ ig_nonce: $tr.data('item_nonce'),
462
  },
463
  beforeSend: function () {
464
  $spinner.addClass('is-active');
471
  } else {
472
  alert(response.data);
473
  }
 
 
 
 
 
474
  },
475
  complete: function () {
476
  setTimeout(function () {
483
  });
484
  });
485
 
486
+ $('.ig-form-item-cache').on('click', function (e) {
487
+ e.preventDefault();
488
+
489
+ var c = confirm(qligg.remove_cache);
490
+
491
+ if (!c) {
492
+ return false;
493
+ }
494
+
495
+ var $item = $(this),
496
+ $tr = $item.closest('tr'),
497
+ $spinner = $tr.find('.spinner');
498
+
499
+ $.ajax({
500
+ url: ajaxurl,
501
+ type: 'post',
502
+ data: {
503
+ action: 'qligg_form_item_cache',
504
+ item_id: $tr.data('item_id'),
505
+ ig_nonce: $tr.data('item_nonce'),
506
+ },
507
+ beforeSend: function () {
508
+ $spinner.addClass('is-active');
509
+ },
510
+ success: function (response) {
511
+ if (response.success) {
512
+
513
+ console.log(response.data);
514
+
515
+ setTimeout(function () {
516
+ $spinner.removeClass('is-active');
517
+ }, 300);
518
+ } else {
519
+ alert(response.data);
520
+ }
521
+ },
522
+ complete: function () {
523
+ setTimeout(function () {
524
+ $spinner.removeClass('is-active');
525
+ }, 600);
526
+ },
527
+ error: function (jqXHR, textStatus) {
528
+ console.log(textStatus);
529
+ },
530
+ });
531
+ });
532
+
533
  $(document).on('ready', function () {
534
  $('.color-picker').wpColorPicker();
535
  });
assets/js/qligg-admin.min.js CHANGED
@@ -1 +1 @@
1
- (function(c){c.fn.serializeArrayAll=function(){var g={};var f=this.serializeArray();c.each(f,function(){if(g[this.name]!==undefined){if(!g[this.name].push){g[this.name]=[g[this.name]]}g[this.name].push(this.value||"")}else{g[this.name]=this.value||""}});var e=c("input[type=radio],input[type=checkbox]",this);c.each(e,function(){if(!g.hasOwnProperty(this.name)){g[this.name]=""}});return g};c(".ig-list-images > li").on("click",function(f){c(this).addClass("active");c(this).siblings().removeClass("active");c(this).find("input[type=radio]").prop("checked",true).trigger("change");c(this).siblings().find("input[type=radio]").prop("checked",false)});c("input[name=insta_source]").on("change",function(f){if(this.value=="username"){c("#ig-select-tag-wrap").hide(500,function(g){c("#ig-select-username-wrap").show().addClass("active")}).removeClass("active")}else{c("#ig-select-username-wrap").hide(500,function(g){c("#ig-select-tag-wrap").show().addClass("active")}).removeClass("active")}});c("input[name=insta_box]").on("change",function(f){if(this.checked){c("#ig-section-box").show("slow").addClass("active")}else{c("#ig-section-box").hide("slow").removeClass("active")}});c("input[name=insta_layout]").on("change",function(f){if(this.value=="carousel"){c("#ig-section-gallery, #ig-section-masonry").hide(500,function(g){c("#ig-section-carousel").show().addClass("active")}).removeClass("active")}else{if(this.value=="gallery"){c("#ig-section-carousel, #ig-section-masonry").hide(500,function(g){c("#ig-section-gallery").show().addClass("active")}).removeClass("active")}else{c("#ig-section-carousel").hide(500,function(g){c("#ig-section-masonry").show().addClass("active");c("#ig-section-gallery").show().addClass("active")}).removeClass("active")}}});c("input[name=insta_button]").on("change",function(f){if(this.checked){c("#ig-section-button").show("slow").addClass("active")}else{c("#ig-section-button").hide("slow").removeClass("active")}});c("input[name=insta_button_load]").on("change",function(f){if(this.checked){c("#ig-section-button_load").show("slow").addClass("active")}else{c("#ig-section-button_load").hide("slow").removeClass("active")}});c("input[name=insta_hover]").on("change",function(f){if(this.checked){c("#ig-section-hover").show("slow").addClass("active")}else{c("#ig-section-hover").hide("slow").removeClass("active")}});c("input[name=insta_popup]").on("change",function(f){if(this.checked){c("#ig-section-popup").show("slow").addClass("active")}else{c("#ig-section-popup").hide("slow").removeClass("active")}});c("input[name=insta_card]").on("change",function(f){if(this.checked){c("#ig-section-card").show("slow").addClass("active")}else{c("#ig-section-card").hide("slow").removeClass("active")}});function b(f){if(f){if(!c("#ig-save-settings .insta-gallery-spinner img").length){var e='<img src="'+f+'" class="ig-spin" />';c("#ig-save-settings .insta-gallery-spinner").append(e)}else{c("#ig-save-settings .insta-gallery-spinner img").attr("src",f)}c("#ig-save-settings .insta-gallery-spinner .ig-spin").hide();c("#ig-save-settings .insta-gallery-spinner img").show()}else{c("#ig-save-settings .insta-gallery-spinner .ig-spin").show();c("#ig-save-settings .insta-gallery-spinner img").remove()}}var d=c("input[name=insta_spinner_image_id]"),a=c("#ig-spinner-reset");c("#ig-save-settings").on("submit",function(h){h.preventDefault();var f=c(this),g=f.find(".spinner");c.ajax({url:ajaxurl,type:"post",dataType:"JSON",data:c.param(f.serializeArrayAll())+"&"+c.param({action:"qligg_save_settings"}),beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){window.location.reload()}},complete:function(){g.removeClass("is-active")},error:function(e,i){console.log(i)}})});a.click(function(){d.val("");b();c(this).hide()});if(d.val()==""){a.hide()}if(d.data("misrc")!=""){b(d.data("misrc"))}c("#ig-spinner-upload").click(function(g){g.preventDefault();var f;if(f){f.open()}f=wp.media({title:"Select Media",multiple:false,library:{type:"image",}});f.on("close",function(){var k=f.state().get("selection");if(k.length){var e=new Array();var h=0,l;k.each(function(i){e[h]=i.id;l=i.attributes.url;h++});var j=e.join(",");d.val(j);b(l)}if(d.val()==""){a.hide()}else{a.show()}});f.on("open",function(){var h=f.state().get("selection");var e=d.val().split(",");e.forEach(function(i){attachment=wp.media.attachment(i);attachment.fetch();h.add(attachment?[attachment]:[])})});f.open()});c(document).on("click","[data-qligg-toggle]",function(f){f.preventDefault();c(c(this).data("qligg-toggle")).slideToggle()});c(document).on("click","[data-qligg-copy]",function(f){f.preventDefault();c(c(this).data("qligg-copy")).select();document.execCommand("copy")});c("#ig-remove-data").on("click",function(g){var f=c(this).is(":checked");if(f){var h=confirm(qligg.remove_data);if(!h){return false}}});c(document).on("ready",function(i){var h=window.location.hash,j=h.substring(14);if(j.length>40){var g=c("#ig-generate-token").find(".btn-instagram"),f=c("#ig-generate-token").find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_generate_token",ig_access_token:j,ig_nonce:qligg.nonce},beforeSend:function(){g.css({opacity:".5","pointer-events":"none"});f.addClass("is-active")},success:function(e){if(e.success){setTimeout(function(){window.location.reload()},300)}else{alert(e.data)}},complete:function(){g.removeAttr("style");f.removeClass("is-active");window.location.hash="";window.location.href.split("#")[0]},error:function(e,k){console.log(k)}})}});c("#ig-update-token").on("submit",function(h){h.preventDefault();var f=c(this),g=f.find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_generate_token",ig_access_token:f.find("input[name=ig_access_token]").val(),ig_nonce:qligg.nonce},beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){setTimeout(function(){window.location.reload()},300)}else{alert(e.data)}},complete:function(){g.removeClass("is-active")},error:function(e,i){console.log(i)},})});c(".ig-remove-token").on("click",function(i){i.preventDefault();var j=confirm(qligg.remove_token);if(!j){return false}var f=c(this),h=f.closest("tr"),g=h.find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_remove_token",item_id:f.data("item_id"),ig_nonce:qligg.nonce},beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){h.fadeOut();setTimeout(function(){window.location.reload()},300)}else{alert(e.data)}},complete:function(){g.removeClass("is-active")},error:function(e,k){console.log(k)}})});c("#ig-update-form").on("submit",function(h){h.preventDefault();var f=c(this),g=f.find(".spinner");c.ajax({url:ajaxurl,type:"post",data:c.param(f.serializeArrayAll())+"&"+c.param({action:"qligg_update_form"}),beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){setTimeout(function(){window.location.href=e.data},300)}else{alert(e.data)}},complete:function(){g.removeClass("is-active")},error:function(e,i){console.log(i)},})});c(".ig-form-item-delete").on("click",function(i){i.preventDefault();var j=confirm(qligg.remove_gallery);if(!j){return false}var f=c(this),h=f.closest("tr"),g=h.find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_form_item_delete",item_id:f.data("item_id"),ig_nonce:f.data("item_nonce"),},beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){setTimeout(function(){window.location.href=e.data},300)}else{alert(e.data)}},complete:function(){setTimeout(function(){h.remove()},600)},error:function(e,k){console.log(k)},})});c(document).on("ready",function(){c(".color-picker").wpColorPicker()})})(jQuery);
1
+ (function(c){c.fn.serializeArrayAll=function(){var g={};var f=this.serializeArray();c.each(f,function(){if(g[this.name]!==undefined){if(!g[this.name].push){g[this.name]=[g[this.name]]}g[this.name].push(this.value||"")}else{g[this.name]=this.value||""}});var e=c("input[type=radio],input[type=checkbox]",this);c.each(e,function(){if(!g.hasOwnProperty(this.name)){g[this.name]=""}});return g};c(".ig-list-images > li").on("click",function(f){c(this).addClass("active");c(this).siblings().removeClass("active");c(this).find("input[type=radio]").prop("checked",true).trigger("change");c(this).siblings().find("input[type=radio]").prop("checked",false)});c("input[name=insta_source]").on("change",function(f){if(this.value=="username"){c("#ig-select-tag-wrap").hide(500,function(g){c("#ig-select-username-wrap").show().addClass("active")}).removeClass("active")}else{c("#ig-select-username-wrap").hide(500,function(g){c("#ig-select-tag-wrap").show().addClass("active")}).removeClass("active")}});c("input[name=insta_box]").on("change",function(f){if(this.checked){c("#ig-section-box").show("slow").addClass("active")}else{c("#ig-section-box").hide("slow").removeClass("active")}});c("input[name=insta_layout]").on("change",function(f){if(this.value=="carousel"){c("#ig-section-gallery, #ig-section-masonry").hide(500,function(g){c("#ig-section-carousel").show().addClass("active")}).removeClass("active")}else{if(this.value=="gallery"){c("#ig-section-carousel, #ig-section-masonry").hide(500,function(g){c("#ig-section-gallery").show().addClass("active")}).removeClass("active")}else{c("#ig-section-carousel").hide(500,function(g){c("#ig-section-masonry").show().addClass("active");c("#ig-section-gallery").show().addClass("active")}).removeClass("active")}}});c("input[name=insta_button]").on("change",function(f){if(this.checked){c("#ig-section-button").show("slow").addClass("active")}else{c("#ig-section-button").hide("slow").removeClass("active")}});c("input[name=insta_button_load]").on("change",function(f){if(this.checked){c("#ig-section-button_load").show("slow").addClass("active")}else{c("#ig-section-button_load").hide("slow").removeClass("active")}});c("input[name=insta_hover]").on("change",function(f){if(this.checked){c("#ig-section-hover").show("slow").addClass("active")}else{c("#ig-section-hover").hide("slow").removeClass("active")}});c("input[name=insta_popup]").on("change",function(f){if(this.checked){c("#ig-section-popup").show("slow").addClass("active")}else{c("#ig-section-popup").hide("slow").removeClass("active")}});c("input[name=insta_card]").on("change",function(f){if(this.checked){c("#ig-section-card").show("slow").addClass("active")}else{c("#ig-section-card").hide("slow").removeClass("active")}});function b(f){if(f){if(!c("#ig-save-settings .insta-gallery-spinner img").length){var e='<img src="'+f+'" class="ig-spin" />';c("#ig-save-settings .insta-gallery-spinner").append(e)}else{c("#ig-save-settings .insta-gallery-spinner img").attr("src",f)}c("#ig-save-settings .insta-gallery-spinner .ig-spin").hide();c("#ig-save-settings .insta-gallery-spinner img").show()}else{c("#ig-save-settings .insta-gallery-spinner .ig-spin").show();c("#ig-save-settings .insta-gallery-spinner img").remove()}}var d=c("input[name=insta_spinner_image_id]"),a=c("#ig-spinner-reset");c("#ig-save-settings").on("submit",function(h){h.preventDefault();var f=c(this),g=f.find(".spinner");c.ajax({url:ajaxurl,type:"post",dataType:"JSON",data:c.param(f.serializeArrayAll())+"&"+c.param({action:"qligg_save_settings"}),beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){window.location.reload()}},complete:function(){g.removeClass("is-active")},error:function(e,i){console.log(i)}})});a.click(function(){d.val("");b();c(this).hide()});if(d.val()==""){a.hide()}if(d.data("misrc")!=""){b(d.data("misrc"))}c("#ig-spinner-upload").click(function(g){g.preventDefault();var f;if(f){f.open()}f=wp.media({title:"Select Media",multiple:false,library:{type:"image",}});f.on("close",function(){var k=f.state().get("selection");if(k.length){var e=new Array();var h=0,l;k.each(function(i){e[h]=i.id;l=i.attributes.url;h++});var j=e.join(",");d.val(j);b(l)}if(d.val()==""){a.hide()}else{a.show()}});f.on("open",function(){var h=f.state().get("selection");var e=d.val().split(",");e.forEach(function(i){attachment=wp.media.attachment(i);attachment.fetch();h.add(attachment?[attachment]:[])})});f.open()});c(document).on("click","[data-qligg-toggle]",function(f){f.preventDefault();c(c(this).data("qligg-toggle")).slideToggle()});c(document).on("click","[data-qligg-copy]",function(f){f.preventDefault();c(c(this).data("qligg-copy")).select();document.execCommand("copy")});c("#ig-remove-data").on("click",function(g){var f=c(this).is(":checked");if(f){var h=confirm(qligg.remove_data);if(!h){return false}}});c(document).on("ready",function(i){var h=window.location.hash,j=h.substring(14);if(j.length>40){var g=c("#ig-generate-token").find(".btn-instagram"),f=c("#ig-generate-token").find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_generate_token",ig_access_token:j,ig_nonce:qligg.nonce},beforeSend:function(){g.css({opacity:".5","pointer-events":"none"});f.addClass("is-active")},success:function(e){if(e.success){setTimeout(function(){window.location.reload()},300)}else{alert(e.data)}},complete:function(){g.removeAttr("style");f.removeClass("is-active");window.location.hash="";window.location.href.split("#")[0]},error:function(e,k){console.log(k)}})}});c("#ig-update-token").on("submit",function(h){h.preventDefault();var f=c(this),g=f.find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_generate_token",ig_access_token:f.find("input[name=ig_access_token]").val(),ig_nonce:qligg.nonce},beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){setTimeout(function(){window.location.reload()},300)}else{alert(e.data)}},complete:function(){g.removeClass("is-active")},error:function(e,i){console.log(i)},})});c(".ig-remove-token").on("click",function(i){i.preventDefault();var j=confirm(qligg.remove_token);if(!j){return false}var f=c(this),h=f.closest("tr"),g=h.find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_remove_token",item_id:f.data("item_id"),ig_nonce:qligg.nonce},beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){h.fadeOut();setTimeout(function(){window.location.reload()},300)}else{alert(e.data)}},complete:function(){g.removeClass("is-active")},error:function(e,k){console.log(k)}})});c("#ig-update-form").on("submit",function(h){h.preventDefault();var f=c(this),g=f.find(".spinner");c.ajax({url:ajaxurl,type:"post",data:c.param(f.serializeArrayAll())+"&"+c.param({action:"qligg_update_form"}),beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){setTimeout(function(){window.location.href=e.data},300)}else{alert(e.data)}},complete:function(){g.removeClass("is-active")},error:function(e,i){console.log(i)},})});c(".ig-form-item-delete").on("click",function(i){i.preventDefault();var j=confirm(qligg.remove_item);if(!j){return false}var f=c(this),h=f.closest("tr"),g=h.find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_form_item_delete",item_id:h.data("item_id"),ig_nonce:h.data("item_nonce"),},beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){setTimeout(function(){window.location.href=e.data},300)}else{alert(e.data)}},complete:function(){setTimeout(function(){h.remove()},600)},error:function(e,k){console.log(k)},})});c(".ig-form-item-cache").on("click",function(i){i.preventDefault();var j=confirm(qligg.remove_cache);if(!j){return false}var f=c(this),h=f.closest("tr"),g=h.find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_form_item_cache",item_id:h.data("item_id"),ig_nonce:h.data("item_nonce"),},beforeSend:function(){g.addClass("is-active")},success:function(e){if(e.success){console.log(e.data);setTimeout(function(){g.removeClass("is-active")},300)}else{alert(e.data)}},complete:function(){setTimeout(function(){g.removeClass("is-active")},600)},error:function(e,k){console.log(k)},})});c(document).on("ready",function(){c(".color-picker").wpColorPicker()})})(jQuery);
includes/ajax.php CHANGED
@@ -77,6 +77,11 @@ if (!class_exists('QLIGG_AJAX')) {
77
  }
78
 
79
  if (isset($qligg_token[$access_token_id[0]]) && $qligg_token[$access_token_id[0]] == $access_token) {
 
 
 
 
 
80
  wp_send_json_error(esc_html__('Account already connected. To connect a new account logout from Instagram in this browser.', 'insta-gallery'));
81
  }
82
 
@@ -197,7 +202,7 @@ if (!class_exists('QLIGG_AJAX')) {
197
 
198
  if (current_user_can('manage_options')) {
199
 
200
- if (!empty($_REQUEST) && check_admin_referer('qligg_form_item_delete', 'ig_nonce')) {
201
 
202
  if (isset($_REQUEST['item_id'])) {
203
 
@@ -220,6 +225,43 @@ if (!class_exists('QLIGG_AJAX')) {
220
  wp_send_json_error(esc_html__('Invalid Request', 'insta-gallery'));
221
  }
222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  function init() {
224
  // Settings
225
  add_action('wp_ajax_qligg_save_settings', array($this, 'save_settings'));
@@ -233,6 +275,7 @@ if (!class_exists('QLIGG_AJAX')) {
233
  // -----------------------------------------------------------------------
234
  add_action('wp_ajax_qligg_update_form', array($this, 'update_form'));
235
  add_action('wp_ajax_qligg_form_item_delete', array($this, 'form_item_delete'));
 
236
 
237
 
238
  //add_action('admin_init', array($this, 'admin_init'));
77
  }
78
 
79
  if (isset($qligg_token[$access_token_id[0]]) && $qligg_token[$access_token_id[0]] == $access_token) {
80
+
81
+ if ($profile_info = qligg_get_user_profile($access_token_id[0])) {
82
+ wp_send_json_error(sprintf(esc_html__('The %s account is already connected. To connect a new account logout from Instagram in this browser.', 'insta-gallery'), @$profile_info['user']));
83
+ }
84
+
85
  wp_send_json_error(esc_html__('Account already connected. To connect a new account logout from Instagram in this browser.', 'insta-gallery'));
86
  }
87
 
202
 
203
  if (current_user_can('manage_options')) {
204
 
205
+ if (!empty($_REQUEST) && check_admin_referer('qligg_form_item', 'ig_nonce')) {
206
 
207
  if (isset($_REQUEST['item_id'])) {
208
 
225
  wp_send_json_error(esc_html__('Invalid Request', 'insta-gallery'));
226
  }
227
 
228
+ function form_item_cache() {
229
+
230
+ global $wpdb;
231
+
232
+ if (current_user_can('manage_options')) {
233
+
234
+ if (!empty($_REQUEST) && check_admin_referer('qligg_form_item', 'ig_nonce')) {
235
+
236
+ if (isset($_REQUEST['item_id'])) {
237
+
238
+ $instagram_feeds = get_option('insta_gallery_items');
239
+
240
+ $item_id = absint($_REQUEST['item_id']);
241
+
242
+ if (isset($instagram_feeds[$item_id]) && $instagram_feed = $instagram_feeds[$item_id]) {
243
+
244
+ if ($instagram_feed['insta_source'] == 'username') {
245
+ $tk = "%%insta_gallery_user_items_{$instagram_feed['insta_username']}_%%";
246
+ } else {
247
+ $tk = "%%insta_gallery_tag_items_{$instagram_feed['insta_tag']}_%%";
248
+ }
249
+
250
+ if ($tks = $wpdb->get_row($wpdb->prepare("SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE %s", $tk))) {
251
+ foreach ($tks as $key => $name) {
252
+ delete_transient(str_replace('_transient_', '', $name));
253
+ }
254
+
255
+ wp_send_json_success(esc_html__('Feed caches cleared', 'insta-gallery'));
256
+ }
257
+ }
258
+ }
259
+ }
260
+ }
261
+
262
+ wp_send_json_error(esc_html__('Invalid Request', 'insta-gallery'));
263
+ }
264
+
265
  function init() {
266
  // Settings
267
  add_action('wp_ajax_qligg_save_settings', array($this, 'save_settings'));
275
  // -----------------------------------------------------------------------
276
  add_action('wp_ajax_qligg_update_form', array($this, 'update_form'));
277
  add_action('wp_ajax_qligg_form_item_delete', array($this, 'form_item_delete'));
278
+ add_action('wp_ajax_qligg_form_item_cache', array($this, 'form_item_cache'));
279
 
280
 
281
  //add_action('admin_init', array($this, 'admin_init'));
includes/pages/token.php CHANGED
@@ -82,7 +82,7 @@ if (!defined('ABSPATH'))
82
  <table>
83
  <tbody>
84
  <tr>
85
- <th scope="row"><?php esc_html_e('Reset feeds', 'insta-gallery'); ?></th>
86
  <td>
87
  <input name="insta_reset" type="number" min="1" max="168" value="<?php echo esc_attr($qligg['insta_reset']); ?>" />
88
  <span class="description">
82
  <table>
83
  <tbody>
84
  <tr>
85
+ <th scope="row"><?php esc_html_e('Feeds cache', 'insta-gallery'); ?></th>
86
  <td>
87
  <input name="insta_reset" type="number" min="1" max="168" value="<?php echo esc_attr($qligg['insta_reset']); ?>" />
88
  <span class="description">
includes/pages/views/list.php CHANGED
@@ -35,7 +35,7 @@ if (!defined('ABSPATH'))
35
  $profile_info = qligg_get_tag_profile($instagram_feed['insta_tag']);
36
  }
37
  ?>
38
- <tr>
39
  <td class="profile-picture"><img src="<?php echo esc_url($profile_info['picture']); ?>" width="30" /></td>
40
  <td>
41
  <?php echo esc_html($profile_info['user']); ?>
@@ -50,9 +50,12 @@ if (!defined('ABSPATH'))
50
  <a href="<?php echo admin_url("admin.php?page=qligg_feeds&tab=edit&item_id={$id}"); ?>" class="btn-instagram">
51
  <span class="dashicons dashicons-edit"></span><?php esc_html_e('Edit', 'insta-gallery'); ?>
52
  </a>
53
- <a href="#" data-item_nonce="<?php echo wp_create_nonce('qligg_form_item_delete'); ?>" data-item_id="<?php echo esc_attr($id); ?>" class="btn-instagram ig-form-item-delete">
54
  <span class="dashicons dashicons-trash"></span><?php esc_html_e('Delete', 'insta-gallery'); ?>
55
  </a>
 
 
 
56
  <span class="spinner"></span>
57
  </td>
58
  </tr>
35
  $profile_info = qligg_get_tag_profile($instagram_feed['insta_tag']);
36
  }
37
  ?>
38
+ <tr data-item_nonce="<?php echo wp_create_nonce('qligg_form_item'); ?>" data-item_id="<?php echo esc_attr($id); ?>">
39
  <td class="profile-picture"><img src="<?php echo esc_url($profile_info['picture']); ?>" width="30" /></td>
40
  <td>
41
  <?php echo esc_html($profile_info['user']); ?>
50
  <a href="<?php echo admin_url("admin.php?page=qligg_feeds&tab=edit&item_id={$id}"); ?>" class="btn-instagram">
51
  <span class="dashicons dashicons-edit"></span><?php esc_html_e('Edit', 'insta-gallery'); ?>
52
  </a>
53
+ <a href="#" class="btn-instagram ig-form-item-delete">
54
  <span class="dashicons dashicons-trash"></span><?php esc_html_e('Delete', 'insta-gallery'); ?>
55
  </a>
56
+ <a href="#" class="btn-instagram secondary ig-form-item-cache">
57
+ <span class="dashicons dashicons dashicons-update"></span><?php esc_html_e('Cache', 'insta-gallery'); ?>
58
+ </a>
59
  <span class="spinner"></span>
60
  </td>
61
  </tr>
includes/settings.php CHANGED
@@ -146,7 +146,8 @@ if (!class_exists('QLIGG_Settings')) {
146
  wp_enqueue_script('qligg-admin', plugins_url('/assets/js/qligg-admin.min.js', QLIGG_PLUGIN_FILE), array('jquery', 'wp-color-picker-alpha'), QLIGG_PLUGIN_VERSION, true);
147
  wp_localize_script('qligg-admin', 'qligg', array(
148
  'nonce' => wp_create_nonce('qligg_generate_token'),
149
- 'remove_gallery' => esc_html__('Are you sure want to delete this item?', 'insta-gallery'),
 
150
  'remove_token' => esc_html__('Are you sure want to delete this access token?', 'insta-gallery'),
151
  'remove_data' => esc_html__('Are you sure want to delete all settings on plugin uninstall?', 'insta-gallery')
152
  ));
146
  wp_enqueue_script('qligg-admin', plugins_url('/assets/js/qligg-admin.min.js', QLIGG_PLUGIN_FILE), array('jquery', 'wp-color-picker-alpha'), QLIGG_PLUGIN_VERSION, true);
147
  wp_localize_script('qligg-admin', 'qligg', array(
148
  'nonce' => wp_create_nonce('qligg_generate_token'),
149
+ 'remove_cache' => esc_html__('Are you sure want to clear this item cache?', 'insta-gallery'),
150
+ 'remove_item' => esc_html__('Are you sure want to delete this item?', 'insta-gallery'),
151
  'remove_token' => esc_html__('Are you sure want to delete this access token?', 'insta-gallery'),
152
  'remove_data' => esc_html__('Are you sure want to delete all settings on plugin uninstall?', 'insta-gallery')
153
  ));
insta-gallery.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Instagram Feed Gallery
4
  * Plugin URI: https://quadlayers.com/portfolio/instagram-gallery/
5
  * Description: Display beautifull and responsive galleries on your website from your Instagram feed account.
6
- * Version: 2.5.2
7
  * Author: Quadlayers
8
  * Author URI: https://quadlayers.com
9
  * License: GPL-2.0+
@@ -18,7 +18,7 @@ if (!defined('QLIGG_PLUGIN_NAME')) {
18
  define('QLIGG_PLUGIN_NAME', 'Instagram Feed Gallery');
19
  }
20
  if (!defined('QLIGG_PLUGIN_VERSION')) {
21
- define('QLIGG_PLUGIN_VERSION', '2.5.2');
22
  }
23
  if (!defined('QLIGG_PLUGIN_FILE')) {
24
  define('QLIGG_PLUGIN_FILE', __FILE__);
3
  * Plugin Name: Instagram Feed Gallery
4
  * Plugin URI: https://quadlayers.com/portfolio/instagram-gallery/
5
  * Description: Display beautifull and responsive galleries on your website from your Instagram feed account.
6
+ * Version: 2.5.3
7
  * Author: Quadlayers
8
  * Author URI: https://quadlayers.com
9
  * License: GPL-2.0+
18
  define('QLIGG_PLUGIN_NAME', 'Instagram Feed Gallery');
19
  }
20
  if (!defined('QLIGG_PLUGIN_VERSION')) {
21
+ define('QLIGG_PLUGIN_VERSION', '2.5.3');
22
  }
23
  if (!defined('QLIGG_PLUGIN_FILE')) {
24
  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 widget, instagram gallery, instagram pictures, gallery widget, pictures, carousel slider, image gallery, image slider
5
  Requires at least: 4.6
6
  Tested up to: 5.2.2
7
- Stable tag: 2.5.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -91,6 +91,10 @@ There may be some other plugins(like: fancybox, elementor) which also uses image
91
 
92
  == Changelog ==
93
 
 
 
 
 
94
  = 2.5.2 =
95
  * Fix. Instagram Feed Gallery admin menu capability
96
 
4
  Tags: instagram, instagram feed, instagram widget, instagram gallery, instagram pictures, gallery widget, pictures, carousel slider, image gallery, image slider
5
  Requires at least: 4.6
6
  Tested up to: 5.2.2
7
+ Stable tag: 2.5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
91
 
92
  == Changelog ==
93
 
94
+ = 2.5.3 =
95
+ * Improvement. Instagram Account disconnet alert
96
+ * Improvement. Instagram Feeds clear feeds cache button
97
+
98
  = 2.5.2 =
99
  * Fix. Instagram Feed Gallery admin menu capability
100