Instagram Gallery - Version 2.7.0

Version Description

  • Fix. instagram refactoring
Download this release

Release Info

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

Code changes from version 2.6.6 to 2.7.0

Files changed (102) hide show
  1. assets/backend/css/qligg-admin.css +348 -0
  2. assets/backend/css/qligg-admin.css.map +1 -0
  3. assets/backend/css/qligg-admin.min.css +2 -0
  4. assets/{img → backend/img}/carousel.png +0 -0
  5. assets/{img → backend/img}/gallery.png +0 -0
  6. assets/{img → backend/img}/grid.png +0 -0
  7. assets/{img → backend/img}/highlight.png +0 -0
  8. assets/{img → backend/img}/instagram-feed-accounts.png +0 -0
  9. assets/{img → backend/img}/instagram-feed-load-more.png +0 -0
  10. assets/{img → backend/img}/instagram-feed-masonry.png +0 -0
  11. assets/{img → backend/img}/instagram-feed-popup-macbook.png +0 -0
  12. assets/{img → backend/img}/instagram-feed-popup.png +0 -0
  13. assets/{img → backend/img}/instagram-feed.png +0 -0
  14. assets/{img → backend/img}/instagram.png +0 -0
  15. assets/{img → backend/img}/logo.jpg +0 -0
  16. assets/{img → backend/img}/masonry.png +0 -0
  17. assets/{img → backend/img}/mobile.png +0 -0
  18. assets/{img → backend/img}/quadlayers.jpg +0 -0
  19. assets/backend/jquery-serializejson/jquery-serializejson.js +393 -0
  20. assets/backend/jquery-serializejson/jquery-serializejson.min.js +10 -0
  21. assets/backend/js/qligg-admin-account.js +235 -0
  22. assets/backend/js/qligg-admin-account.min.js +2 -0
  23. assets/backend/js/qligg-admin-feed.js +463 -0
  24. assets/backend/js/qligg-admin-feed.min.js +2 -0
  25. assets/backend/js/qligg-admin-settings.js +149 -0
  26. assets/backend/js/qligg-admin-settings.min.js +2 -0
  27. assets/{rgba → backend/rgba}/wp-color-picker-alpha.js +0 -0
  28. assets/{rgba → backend/rgba}/wp-color-picker-alpha.min.js +0 -0
  29. assets/css/qligg-admin.css +0 -286
  30. assets/css/qligg-admin.min.css +0 -2
  31. assets/{css → frontend/css}/qligg.css +0 -0
  32. assets/frontend/css/qligg.css.map +1 -0
  33. assets/{css → frontend/css}/qligg.min.css +0 -0
  34. assets/{js → frontend/js}/qligg.js +10 -7
  35. assets/frontend/js/qligg.min.js +2 -0
  36. assets/{magnific-popup → frontend/magnific-popup}/jquery.magnific-popup.min.js +0 -0
  37. assets/{magnific-popup → frontend/magnific-popup}/magnific-popup.css +0 -0
  38. assets/{magnific-popup → frontend/magnific-popup}/magnific-popup.min.css +0 -0
  39. assets/{masonry → frontend/masonry}/masonry.pkgd.min.js +0 -0
  40. assets/{swiper → frontend/swiper}/swiper.min.css +0 -0
  41. assets/{swiper → frontend/swiper}/swiper.min.js +0 -0
  42. assets/{swiper → frontend/swiper}/swiper.min.js.map +0 -0
  43. assets/js/qligg-admin.js +0 -537
  44. assets/js/qligg-admin.min.js +0 -1
  45. assets/js/qligg.min.js +0 -2
  46. includes/ajax.php +0 -295
  47. includes/api.php +1 -1
  48. includes/backend.php +60 -0
  49. includes/compatibility.php +326 -0
  50. includes/controllers/AccountController.php +114 -0
  51. includes/controllers/FeedController.php +163 -0
  52. includes/controllers/PremiumController.php +52 -0
  53. includes/controllers/QLIGG_Controller.php +21 -0
  54. includes/controllers/SettingController.php +68 -0
  55. includes/controllers/SuggestionsController.php +59 -0
  56. includes/controllers/WelcomeController.php +32 -0
  57. includes/defaults.php +0 -240
  58. includes/frontend.php +141 -140
  59. includes/{utis.php → helpers.php} +62 -23
  60. includes/models/Feed.php +153 -0
  61. includes/models/QLIGG_Model.php +74 -0
  62. includes/models/Setting.php +30 -0
  63. includes/{suggestions.php → models/Suggestions.php} +131 -132
  64. includes/models/Token.php +41 -0
  65. includes/notices.php +93 -0
  66. includes/pages/premium.php +0 -82
  67. includes/pages/token.php +0 -146
  68. includes/pages/views/edit.php +0 -636
  69. includes/pages/views/list.php +0 -65
  70. includes/pages/welcome.php +0 -39
  71. includes/qligg.php +63 -0
  72. includes/settings.php +0 -219
  73. includes/view/backend/pages/accounts.php +67 -0
  74. includes/view/backend/pages/feeds.php +73 -0
  75. includes/view/backend/pages/modals/account/main.php +47 -0
  76. includes/view/backend/pages/modals/feed/main.php +56 -0
  77. includes/view/backend/pages/modals/feed/panel-feed-box.php +50 -0
  78. includes/view/backend/pages/modals/feed/panel-feed-button-load.php +28 -0
  79. includes/view/backend/pages/modals/feed/panel-feed-button.php +28 -0
  80. includes/view/backend/pages/modals/feed/panel-feed-carousel.php +53 -0
  81. includes/view/backend/pages/modals/feed/panel-feed-image-mask.php +36 -0
  82. includes/view/backend/pages/modals/feed/panel-feed-image-popup.php +53 -0
  83. includes/view/backend/pages/modals/feed/panel-feed-image.php +77 -0
  84. includes/view/backend/pages/modals/feed/panel-feed.php +116 -0
  85. includes/view/backend/pages/modals/feed/panel-tabs.php +28 -0
  86. includes/view/backend/pages/modals/template-scripts-account.php +4 -0
  87. includes/view/backend/pages/modals/template-scripts-feed.php +19 -0
  88. includes/view/backend/pages/parts/header.php +48 -0
  89. includes/view/backend/pages/premium.php +84 -0
  90. includes/view/backend/pages/settings.php +70 -0
  91. includes/{pages → view/backend/pages}/suggestions.php +0 -0
  92. includes/view/backend/pages/welcome.php +37 -0
  93. includes/widget.php +20 -17
  94. insta-gallery.php +24 -137
  95. readme.txt +38 -21
  96. templates/carousel.php +13 -13
  97. templates/gallery.php +2 -2
  98. templates/item/item-image-mask.php +3 -3
  99. templates/item/item-image.php +1 -1
  100. templates/item/item.php +4 -1
  101. templates/parts/actions.php +4 -4
  102. uninstall.php +1 -0
assets/backend/css/qligg-admin.css ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #qligg_account_table td,
2
+ #qligg_feeds_table td,
3
+ #qligg_account_table th,
4
+ #qligg_feeds_table th {
5
+ padding: 1em!important;
6
+ vertical-align: top;
7
+ line-height: 1.75em;
8
+ }
9
+ #qligg_account_table td img.qligg-avatar,
10
+ #qligg_feeds_table td img.qligg-avatar {
11
+ width: 50px;
12
+ height: 50px;
13
+ }
14
+ #qligg_account_table .button > i,
15
+ #qligg_feeds_table .button > i {
16
+ margin: 6.5px 2px 0 0;
17
+ font-size: 16px;
18
+ opacity: 0.8;
19
+ }
20
+ #qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav button {
21
+ position: relative;
22
+ overflow: hidden;
23
+ float: left;
24
+ display: block;
25
+ width: 24px;
26
+ height: 24px;
27
+ margin: 0;
28
+ background: 0 0;
29
+ border: none;
30
+ box-shadow: none;
31
+ color: #82878c;
32
+ text-indent: -9999px;
33
+ cursor: pointer;
34
+ outline: 0;
35
+ }
36
+ #qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav button::before {
37
+ display: inline-block;
38
+ position: absolute;
39
+ top: 0;
40
+ right: 0;
41
+ width: 100%;
42
+ height: 100%;
43
+ font: normal 20px/23px dashicons;
44
+ text-align: center;
45
+ text-indent: 0;
46
+ -webkit-font-smoothing: antialiased;
47
+ -moz-osx-font-smoothing: grayscale;
48
+ }
49
+ #qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav button.wc-move-up::before {
50
+ content: "\f343";
51
+ }
52
+ #qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav button.wc-move-down::before {
53
+ content: "\f347";
54
+ }
55
+ #qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav button.wc-move-disabled {
56
+ color: #d5d5d5!important;
57
+ cursor: default;
58
+ pointer-events: none;
59
+ }
60
+ #qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav::before {
61
+ content: "\f333";
62
+ font-family: Dashicons;
63
+ text-align: center;
64
+ line-height: 1;
65
+ color: #999;
66
+ display: block;
67
+ width: 24px;
68
+ float: left;
69
+ height: 100%;
70
+ line-height: 24px;
71
+ cursor: move;
72
+ }
73
+ #qligg_modal {
74
+ max-width: 890px;
75
+ max-height: 560px;
76
+ margin: auto;
77
+ }
78
+ #qligg_modal .wp-color-result-text {
79
+ z-index: 1;
80
+ position: relative;
81
+ }
82
+ #qligg_modal select[readonly],
83
+ #qligg_modal input[type="checkbox"][readonly] {
84
+ pointer-events: none !important;
85
+ }
86
+ #qligg_modal .panel .options_group {
87
+ overflow: hidden;
88
+ border-bottom: 1px solid #eee;
89
+ }
90
+ #qligg_modal .panel .options_group:first-child {
91
+ border-top: 0;
92
+ }
93
+ #qligg_modal .panel div.form-field,
94
+ #qligg_modal .panel p.form-field {
95
+ font-size: 12px;
96
+ padding: 7.5px 15px;
97
+ line-height: 24px;
98
+ }
99
+ #qligg_modal .panel div.form-field > label,
100
+ #qligg_modal .panel p.form-field > label {
101
+ display: inline-block;
102
+ }
103
+ #qligg_modal .panel div.form-field > label:first-child,
104
+ #qligg_modal .panel p.form-field > label:first-child {
105
+ width: 120px;
106
+ }
107
+ #qligg_modal .panel div.form-field > .select2-container:nth-of-type(1),
108
+ #qligg_modal .panel p.form-field > .select2-container:nth-of-type(1) {
109
+ width: 80px!important;
110
+ }
111
+ #qligg_modal .panel div.form-field > .select2-container:nth-of-type(2),
112
+ #qligg_modal .panel p.form-field > .select2-container:nth-of-type(2) {
113
+ width: calc(100% - 171px) !important;
114
+ }
115
+ #qligg_modal .panel div.form-field > .select2-container:only-of-type,
116
+ #qligg_modal .panel p.form-field > .select2-container:only-of-type {
117
+ width: calc(100% - 88px) !important;
118
+ }
119
+ #qligg_modal .panel div > input,
120
+ #qligg_modal .panel p > input {
121
+ width: auto;
122
+ }
123
+ #qligg_modal .panel div > input:not([type=checkbox]):not([type=radio]),
124
+ #qligg_modal .panel p > input:not([type=checkbox]):not([type=radio]) {
125
+ min-width: 120px;
126
+ }
127
+ #qligg_modal .panel ul.list-images {
128
+ display: flex;
129
+ padding: 0;
130
+ margin: 0;
131
+ }
132
+ #qligg_modal .panel ul.list-images li {
133
+ display: inline-block;
134
+ margin: 0 10px 0 0;
135
+ margin-bottom: 0;
136
+ vertical-align: middle;
137
+ color: #aaa;
138
+ position: relative;
139
+ border: 1px solid #f1f1f1;
140
+ border-radius: 3px;
141
+ padding: 10px;
142
+ background-color: #fff;
143
+ cursor: pointer;
144
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
145
+ }
146
+ #qligg_modal .panel ul.list-images li:before {
147
+ content: '';
148
+ position: absolute;
149
+ top: 0;
150
+ bottom: 0;
151
+ left: 0;
152
+ right: 0;
153
+ background-color: #eee;
154
+ opacity: 0.2;
155
+ }
156
+ #qligg_modal .panel ul.list-images li:last-child {
157
+ margin-right: 0;
158
+ }
159
+ #qligg_modal .panel ul.list-images li.active:before,
160
+ #qligg_modal .panel ul.list-images li:hover:before {
161
+ opacity: 0;
162
+ }
163
+ #qligg_modal .panel ul.list-images li.active label,
164
+ #qligg_modal .panel ul.list-images li:hover label {
165
+ color: #e23565;
166
+ }
167
+ #qligg_modal .panel ul.list-images label {
168
+ pointer-events: none;
169
+ display: block;
170
+ position: relative;
171
+ line-height: 2em;
172
+ z-index: 9;
173
+ cursor: pointer;
174
+ transition: all .25s linear;
175
+ text-align: center;
176
+ font-weight: bold;
177
+ color: #23282d;
178
+ }
179
+ #qligg_modal .panel ul.list-images input[type=radio] {
180
+ display: none;
181
+ }
182
+ #qligg_modal.processing {
183
+ pointer-events: none;
184
+ }
185
+ #qligg_modal.processing:before {
186
+ content: '';
187
+ position: absolute;
188
+ top: 0;
189
+ bottom: 0;
190
+ left: 0;
191
+ right: 0;
192
+ background-color: #ffffff;
193
+ z-index: 999;
194
+ opacity: 0.8;
195
+ }
196
+ #qligg_modal.qligg-modal-token {
197
+ max-width: 560px;
198
+ max-height: 210px;
199
+ }
200
+ #qligg_modal.qligg-modal-feed {
201
+ max-width: 990px;
202
+ max-height: 560px;
203
+ }
204
+ #qligg_modal.qligg-modal-feed table {
205
+ padding: 15px;
206
+ border-width: 1px 0 0 0;
207
+ box-shadow: none;
208
+ table-layout: fixed;
209
+ }
210
+ #qligg_modal.qligg-modal-feed table th {
211
+ width: 70px;
212
+ }
213
+ #qligg_modal.qligg-modal-feed table td {
214
+ width: calc(50% - 70px);
215
+ }
216
+ #qligg_modal.qligg-modal-feed .edit-attachment-frame {
217
+ /* .attachment-info {
218
+ width:25%;*/
219
+ /*}*/
220
+ }
221
+ #qligg_modal.qligg-modal-feed .edit-attachment-frame .attachment-media-view-all {
222
+ width: 100% ;
223
+ }
224
+ #qligg_modal.qligg-modal-feed .edit-attachment-frame .attachment-media-view {
225
+ width: 100% ;
226
+ }
227
+ #qligg_modal.qligg-modal-feed .edit-attachment-frame .attachment-details {
228
+ overflow: hidden;
229
+ }
230
+ #qligg_modal.qligg-modal-feed input[type=time] {
231
+ height: 30px;
232
+ }
233
+ #qligg_modal.qligg-modal-feed .panel-wrap {
234
+ overflow: hidden;
235
+ }
236
+ #qligg_modal.qligg-modal-feed .disabled-color-picker {
237
+ color: #d5d5d5!important;
238
+ cursor: default;
239
+ pointer-events: none;
240
+ opacity: 0.8;
241
+ }
242
+ #qligg_modal.qligg-modal-feed .disabled-color-picker input,
243
+ #qligg_modal.qligg-modal-feed .disabled-color-picker select,
244
+ #qligg_modal.qligg-modal-feed .disabled-color-picker textarea,
245
+ #qligg_modal.qligg-modal-feed .disabled-color-picker .wp-picker-container {
246
+ opacity: 0.5;
247
+ }
248
+ #qligg_modal.qligg-modal-feed .ig-list-buttons input[type=radio] {
249
+ position: absolute;
250
+ visibility: visible;
251
+ }
252
+ #qligg_modal.qligg-modal-feed ul.qligg-tabs {
253
+ margin: 0;
254
+ width: 20%;
255
+ float: left;
256
+ line-height: 1em;
257
+ padding: 0 0 10px;
258
+ position: relative;
259
+ background-color: #fafafa;
260
+ border-right: 1px solid #eee;
261
+ box-sizing: border-box;
262
+ }
263
+ #qligg_modal.qligg-modal-feed ul.qligg-tabs:after {
264
+ content: "";
265
+ display: block;
266
+ width: 100%;
267
+ height: 9999em;
268
+ position: absolute;
269
+ bottom: -9999em;
270
+ left: 0;
271
+ background-color: #fafafa;
272
+ border-right: 1px solid #eee;
273
+ }
274
+ #qligg_modal.qligg-modal-feed ul.qligg-tabs li {
275
+ margin: 0;
276
+ padding: 0;
277
+ display: block;
278
+ position: relative;
279
+ }
280
+ #qligg_modal.qligg-modal-feed ul.qligg-tabs li a {
281
+ margin: 0;
282
+ padding: 10px;
283
+ display: block;
284
+ box-shadow: none;
285
+ text-decoration: none;
286
+ line-height: 20px!important;
287
+ border-bottom: 1px solid #eee;
288
+ }
289
+ #qligg_modal.qligg-modal-feed ul.qligg-tabs li a span {
290
+ margin-left: .618em;
291
+ margin-right: .618em;
292
+ }
293
+ #qligg_modal.qligg-modal-feed ul.qligg-tabs li a:before {
294
+ content: "\f107";
295
+ font-family: Dashicons;
296
+ speak: none;
297
+ font-weight: 400;
298
+ text-transform: none;
299
+ line-height: 1;
300
+ -webkit-font-smoothing: antialiased;
301
+ font-variant: normal;
302
+ text-decoration: none;
303
+ }
304
+ #qligg_modal.qligg-modal-feed ul.qligg-tabs li.active a {
305
+ background-color: #eee;
306
+ }
307
+ #qligg_modal.qligg-modal-feed .qligg-input,
308
+ #qligg_modal.qligg-modal-feed .qligg-select2 {
309
+ width: 350px;
310
+ max-width: 100%;
311
+ }
312
+ #qligg_modal.qligg-modal-feed .qligg-input {
313
+ margin: 0;
314
+ padding: 6px;
315
+ box-sizing: border-box;
316
+ vertical-align: top;
317
+ }
318
+ .settings-save-status .spinner {
319
+ float: none;
320
+ display: inline-block;
321
+ margin: 0 10px;
322
+ }
323
+ .settings-save-status .saved {
324
+ font-size: 12px;
325
+ display: none;
326
+ }
327
+ .settings-save-status .saved.is-active {
328
+ display: inline-block;
329
+ }
330
+ #qligg-generate-token {
331
+ padding: 0 24px 0 120px;
332
+ height: 44px;
333
+ line-height: 44px;
334
+ text-transform: uppercase;
335
+ color: rgba(255, 255, 255, 0.8) !important;
336
+ text-decoration: none;
337
+ border-radius: 3px;
338
+ transition: all 0.5s ease-in-out;
339
+ font-weight: 600;
340
+ display: inline-block;
341
+ background: #408bd1 url(../img/instagram.png) no-repeat 16px 13.5px;
342
+ background-size: auto 20px;
343
+ }
344
+ #qligg-generate-token:focus,
345
+ #qligg-generate-token:hover {
346
+ box-shadow: inset 0 0 20px 20px rgba(255, 255, 255, 0.2);
347
+ }
348
+ /*# sourceMappingURL=qligg-admin.css.map */
assets/backend/css/qligg-admin.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["../../less/qligg-admin.less"],"names":[],"mappings":"AAAA,oBAGE;AAFF,kBAEE;AAHF,oBAIE;AAHF,kBAGE;EACE,sBAAA;EACA,mBAAA;EACA,mBAAA;;AAPJ,oBAUE,GAAG,IAAG;AATR,kBASE,GAAG,IAAG;EACJ,WAAA;EACA,YAAA;;AAZJ,oBAeE,QAAQ;AAdV,kBAcE,QAAQ;EACN,qBAAA;EACA,eAAA;EACA,YAAA;;AAQA,kBADF,MACG,YACC,qBACE;EACE,kBAAA;EACA,gBAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,SAAA;EACA,eAAA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,oBAAA;EACA,eAAA;EACA,UAAA;;AACA,kBAlBR,MACG,YACC,qBACE,OAeG;EACC,qBAAA;EACA,kBAAA;EACA,MAAA;EACA,QAAA;EACA,WAAA;EACA,YAAA;EACA,gCAAA;EACA,kBAAA;EACA,cAAA;EACA,mCAAA;EACA,kCAAA;;AAEF,kBA/BR,MACG,YACC,qBACE,OA4BG,WAAW;EACV,SAAS,OAAT;;AAEF,kBAlCR,MACG,YACC,qBACE,OA+BG,aAAa;EACZ,SAAS,OAAT;;AAEF,kBArCR,MACG,YACC,qBACE,OAkCG;EACC,wBAAA;EACA,eAAA;EACA,oBAAA;;AAGJ,kBA3CN,MACG,YACC,qBAyCG;EACC,SAAS,OAAT;EACA,sBAAA;EACA,kBAAA;EACA,cAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,YAAA;;AAQV;EAEE,gBAAA;EACA,iBAAA;EACA,YAAA;;AAJF,YAME;EACE,UAAA;EACA,kBAAA;;AARJ,YAWE,OAAM;AAXR,YAYE,MAAK,iBAAiB;EACpB,+BAAA;;AAbJ,YAgBE,OAEE;EACE,gBAAA;EACA,6BAAA;;AAEA,YANJ,OAEE,eAIG;EACC,aAAA;;AAMF,YAbJ,OAWE,IAEG;AAAD,YAbJ,OAYE,EACG;EACC,eAAA;EACA,mBAAA;EACA,iBAAA;;AAHF,YAbJ,OAWE,IAEG,WAKC;AALF,YAbJ,OAYE,EACG,WAKC;EACE,qBAAA;;AACA,YApBR,OAWE,IAEG,WAKC,QAEG;AAAD,YApBR,OAYE,EACG,WAKC,QAEG;EAEC,YAAA;;AAKF,YA3BR,OAWE,IAEG,WAaC,qBACG,YAAY;AAAb,YA3BR,OAYE,EACG,WAaC,qBACG,YAAY;EACX,qBAAA;;AAEF,YA9BR,OAWE,IAEG,WAaC,qBAIG,YAAY;AAAb,YA9BR,OAYE,EACG,WAaC,qBAIG,YAAY;EAEX,yBAAA;;AAEF,YAlCR,OAWE,IAEG,WAaC,qBAQG;AAAD,YAlCR,OAYE,EACG,WAaC,qBAQG;EAEC,wBAAA;;AApDZ,YAgBE,OAWE,IA8BE;AAzDN,YAgBE,OAYE,EA6BE;EACE,WAAA;;AACA,YA3CN,OAWE,IA8BE,QAEG,IAAI,iBAAiB,IAAI;AAA1B,YA3CN,OAYE,EA6BE,QAEG,IAAI,iBAAiB,IAAI;EACxB,gBAAA;;AAMJ,YAlDJ,OAiDE,GACG;EACC,aAAA;EACA,UAAA;EACA,SAAA;;AAHF,YAlDJ,OAiDE,GACG,YAKC;EACE,qBAAA;EACA,kBAAA;EACA,gBAAA;EACA,sBAAA;EACA,WAAA;EACA,kBAAA;EACA,yBAAA;EACA,kBAAA;EACA,aAAA;EACA,sBAAA;EACA,eAAA;EACA,yCAAA;;AAEA,YArER,OAiDE,GACG,YAKC,GAcG;EACC,SAAS,EAAT;EACA,kBAAA;EACA,MAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;EACA,sBAAA;EACA,YAAA;;AAGF,YAhFR,OAiDE,GACG,YAKC,GAyBG;EACC,eAAA;;AAMA,YAvFV,OAiDE,GACG,YAKC,GA6BG,OAGE;AAAD,YAvFV,OAiDE,GACG,YAKC,GA8BG,MAEE;EACC,UAAA;;AAJJ,YApFR,OAiDE,GACG,YAKC,GA6BG,OAOC;AANF,YArFR,OAiDE,GACG,YAKC,GA8BG,MAMC;EACE,cAAA;;AA1CR,YAlDJ,OAiDE,GACG,YAgDC;EACE,oBAAA;EACA,cAAA;EACA,kBAAA;EACA,gBAAA;EACA,UAAA;EACA,eAAA;EACA,2BAAA;EACA,kBAAA;EACA,iBAAA;EACA,cAAA;;AA1DJ,YAlDJ,OAiDE,GACG,YA6DC,MAAK;EACH,aAAA;;AAQR,YAAC;EACC,oBAAA;;AACA,YAFD,WAEE;EACC,SAAS,EAAT;EACA,kBAAA;EACA,MAAA;EAAO,SAAA;EAAW,OAAA;EAAS,QAAA;EAC3B,yBAAA;EACA,YAAA;EACA,YAAA;;AAIJ,YAAC;EACC,gBAAA;EACA,iBAAA;;AAGF,YAAC;EACC,gBAAA;EACA,iBAAA;;AAFF,YAAC,iBAIC;EACE,aAAA;EACA,uBAAA;EACA,gBAAA;EACA,mBAAA;;AARJ,YAAC,iBAIC,MAME;EACE,WAAA;;AAXN,YAAC,iBAIC,MAUE;EACE,uBAAA;;AAfN,YAAC,iBAmBC;;;;;AAnBF,YAAC,iBAmBC,uBACE;EACE,YAAA;;AArBN,YAAC,iBAmBC,uBAIE;EACE,YAAA;;AAxBN,YAAC,iBAmBC,uBAUE;EACE,gBAAA;;AA9BN,YAAC,iBAkCC,MAAK;EACH,YAAA;;AAnCJ,YAAC,iBAsCC;EACE,gBAAA;;AAvCJ,YAAC,iBA0CC;EACE,wBAAA;EACA,eAAA;EACA,oBAAA;EACA,YAAA;;AA9CJ,YAAC,iBA0CC,uBAME;AAhDJ,YAAC,iBA0CC,uBAOE;AAjDJ,YAAC,iBA0CC,uBAQE;AAlDJ,YAAC,iBA0CC,uBASE;EACE,YAAA;;AApDN,YAAC,iBAwDC,iBAAiB,MAAK;EACpB,kBAAA;EACA,mBAAA;;AA1DJ,YAAC,iBA6DC,GAAE;EACA,SAAA;EACA,UAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;EACA,kBAAA;EACA,yBAAA;EACA,4BAAA;EACA,sBAAA;;AAEA,YAxEH,iBA6DC,GAAE,WAWC;EACC,SAAS,EAAT;EACA,cAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;EACA,eAAA;EACA,OAAA;EACA,yBAAA;EACA,4BAAA;;AAjFN,YAAC,iBA6DC,GAAE,WAuBA;EACE,SAAA;EACA,UAAA;EACA,cAAA;EACA,kBAAA;;AAxFN,YAAC,iBA6DC,GAAE,WAuBA,GAME;EACE,SAAA;EACA,aAAA;EACA,cAAA;EACA,gBAAA;EACA,qBAAA;EACA,2BAAA;EACA,6BAAA;;AAjGR,YAAC,iBA6DC,GAAE,WAuBA,GAME,EASE;EACE,mBAAA;EACA,oBAAA;;AAGF,YAxGP,iBA6DC,GAAE,WAuBA,GAME,EAcG;EACC,SAAS,OAAT;EACA,sBAAA;EACA,WAAA;EACA,gBAAA;EACA,oBAAA;EACA,cAAA;EACA,mCAAA;EACA,oBAAA;EACA,qBAAA;;AAIJ,YArHL,iBA6DC,GAAE,WAuBA,GAiCG,OACC;EACE,sBAAA;;AAvHV,YAAC,iBA6HC;AA7HF,YAAC,iBA8HC;EACE,YAAA;EACA,eAAA;;AAhIJ,YAAC,iBAmIC;EACE,SAAA;EACA,YAAA;EACA,sBAAA;EACA,mBAAA;;AAKN,qBACE;EACE,WAAA;EACA,qBAAA;EACA,cAAA;;AAJJ,qBAME;EACE,eAAA;EACA,aAAA;;AACA,qBAHF,OAGG;EACC,qBAAA;;AAKN;EACE,uBAAA;EACA,YAAA;EACA,iBAAA;EACA,yBAAA;EACA,+BAAA;EACA,qBAAA;EACA,kBAAA;EACA,gCAAA;EACA,gBAAA;EACA,qBAAA;EACA,mEAAA;EACA,0BAAA;;AAEA,qBAAC;AACC,qBAAC;EACD,wDAAA","file":"qligg-admin.css"}
assets/backend/css/qligg-admin.min.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+
2
+ #qligg_account_table td,#qligg_feeds_table td,#qligg_account_table th,#qligg_feeds_table th{padding:1em!important;vertical-align:top;line-height:1.75em}#qligg_account_table td img.qligg-avatar,#qligg_feeds_table td img.qligg-avatar{width:50px;height:50px}#qligg_account_table .button>i,#qligg_feeds_table .button>i{margin:6.5px 2px 0 0;font-size:16px;opacity:.8}#qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav button{position:relative;overflow:hidden;float:left;display:block;width:24px;height:24px;margin:0;background:0;border:0;box-shadow:none;color:#82878c;text-indent:-9999px;cursor:pointer;outline:0}#qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav button::before{display:inline-block;position:absolute;top:0;right:0;width:100%;height:100%;font:normal 20px/23px dashicons;text-align:center;text-indent:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav button.wc-move-up::before{content:"\f343"}#qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav button.wc-move-down::before{content:"\f347"}#qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav button.wc-move-disabled{color:#d5d5d5!important;cursor:default;pointer-events:none}#qligg_feeds_table tbody.ui-sortable .wc-item-reorder-nav::before{content:"\f333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:24px;float:left;height:100%;line-height:24px;cursor:move}#qligg_modal{max-width:890px;max-height:560px;margin:auto}#qligg_modal .wp-color-result-text{z-index:1;position:relative}#qligg_modal select[readonly],#qligg_modal input[type="checkbox"][readonly]{pointer-events:none!important}#qligg_modal .panel .options_group{overflow:hidden;border-bottom:1px solid #eee}#qligg_modal .panel .options_group:first-child{border-top:0}#qligg_modal .panel div.form-field,#qligg_modal .panel p.form-field{font-size:12px;padding:7.5px 15px;line-height:24px}#qligg_modal .panel div.form-field>label,#qligg_modal .panel p.form-field>label{display:inline-block}#qligg_modal .panel div.form-field>label:first-child,#qligg_modal .panel p.form-field>label:first-child{width:120px}#qligg_modal .panel div.form-field>.select2-container:nth-of-type(1),#qligg_modal .panel p.form-field>.select2-container:nth-of-type(1){width:80px!important}#qligg_modal .panel div.form-field>.select2-container:nth-of-type(2),#qligg_modal .panel p.form-field>.select2-container:nth-of-type(2){width:calc(100% - 171px)!important}#qligg_modal .panel div.form-field>.select2-container:only-of-type,#qligg_modal .panel p.form-field>.select2-container:only-of-type{width:calc(100% - 88px)!important}#qligg_modal .panel div>input,#qligg_modal .panel p>input{width:auto}#qligg_modal .panel div>input:not([type=checkbox]):not([type=radio]),#qligg_modal .panel p>input:not([type=checkbox]):not([type=radio]){min-width:120px}#qligg_modal .panel ul.list-images{display:flex;padding:0;margin:0}#qligg_modal .panel ul.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)}#qligg_modal .panel ul.list-images li:before{content:'';position:absolute;top:0;bottom:0;left:0;right:0;background-color:#eee;opacity:.2}#qligg_modal .panel ul.list-images li:last-child{margin-right:0}#qligg_modal .panel ul.list-images li.active:before,#qligg_modal .panel ul.list-images li:hover:before{opacity:0}#qligg_modal .panel ul.list-images li.active label,#qligg_modal .panel ul.list-images li:hover label{color:#e23565}#qligg_modal .panel ul.list-images label{pointer-events:none;display:block;position:relative;line-height:2em;z-index:9;cursor:pointer;transition:all .25s linear;text-align:center;font-weight:bold;color:#23282d}#qligg_modal .panel ul.list-images input[type=radio]{display:none}#qligg_modal.processing{pointer-events:none}#qligg_modal.processing:before{content:'';position:absolute;top:0;bottom:0;left:0;right:0;background-color:#fff;z-index:999;opacity:.8}#qligg_modal.qligg-modal-token{max-width:560px;max-height:210px}#qligg_modal.qligg-modal-feed{max-width:990px;max-height:560px}#qligg_modal.qligg-modal-feed table{padding:15px;border-width:1px 0 0 0;box-shadow:none;table-layout:fixed}#qligg_modal.qligg-modal-feed table th{width:70px}#qligg_modal.qligg-modal-feed table td{width:calc(50% - 70px)}#qligg_modal.qligg-modal-feed .edit-attachment-frame .attachment-media-view-all{width:100%}#qligg_modal.qligg-modal-feed .edit-attachment-frame .attachment-media-view{width:100%}#qligg_modal.qligg-modal-feed .edit-attachment-frame .attachment-details{overflow:hidden}#qligg_modal.qligg-modal-feed input[type=time]{height:30px}#qligg_modal.qligg-modal-feed .panel-wrap{overflow:hidden}#qligg_modal.qligg-modal-feed .disabled-color-picker{color:#d5d5d5!important;cursor:default;pointer-events:none;opacity:.8}#qligg_modal.qligg-modal-feed .disabled-color-picker input,#qligg_modal.qligg-modal-feed .disabled-color-picker select,#qligg_modal.qligg-modal-feed .disabled-color-picker textarea,#qligg_modal.qligg-modal-feed .disabled-color-picker .wp-picker-container{opacity:.5}#qligg_modal.qligg-modal-feed .ig-list-buttons input[type=radio]{position:absolute;visibility:visible}#qligg_modal.qligg-modal-feed ul.qligg-tabs{margin:0;width:20%;float:left;line-height:1em;padding:0 0 10px;position:relative;background-color:#fafafa;border-right:1px solid #eee;box-sizing:border-box}#qligg_modal.qligg-modal-feed ul.qligg-tabs:after{content:"";display:block;width:100%;height:9999em;position:absolute;bottom:-9999em;left:0;background-color:#fafafa;border-right:1px solid #eee}#qligg_modal.qligg-modal-feed ul.qligg-tabs li{margin:0;padding:0;display:block;position:relative}#qligg_modal.qligg-modal-feed ul.qligg-tabs li a{margin:0;padding:10px;display:block;box-shadow:none;text-decoration:none;line-height:20px!important;border-bottom:1px solid #eee}#qligg_modal.qligg-modal-feed ul.qligg-tabs li a span{margin-left:.618em;margin-right:.618em}#qligg_modal.qligg-modal-feed ul.qligg-tabs li a:before{content:"\f107";font-family:Dashicons;speak:none;font-weight:400;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;font-variant:normal;text-decoration:none}#qligg_modal.qligg-modal-feed ul.qligg-tabs li.active a{background-color:#eee}#qligg_modal.qligg-modal-feed .qligg-input,#qligg_modal.qligg-modal-feed .qligg-select2{width:350px;max-width:100%}#qligg_modal.qligg-modal-feed .qligg-input{margin:0;padding:6px;box-sizing:border-box;vertical-align:top}.settings-save-status .spinner{float:none;display:inline-block;margin:0 10px}.settings-save-status .saved{font-size:12px;display:none}.settings-save-status .saved.is-active{display:inline-block}#qligg-generate-token{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}#qligg-generate-token:focus,#qligg-generate-token:hover{box-shadow:inset 0 0 20px 20px rgba(255,255,255,0.2)}
assets/{img → backend/img}/carousel.png RENAMED
File without changes
assets/{img → backend/img}/gallery.png RENAMED
File without changes
assets/{img → backend/img}/grid.png RENAMED
File without changes
assets/{img → backend/img}/highlight.png RENAMED
File without changes
assets/{img → backend/img}/instagram-feed-accounts.png RENAMED
File without changes
assets/{img → backend/img}/instagram-feed-load-more.png RENAMED
File without changes
assets/{img → backend/img}/instagram-feed-masonry.png RENAMED
File without changes
assets/{img → backend/img}/instagram-feed-popup-macbook.png RENAMED
File without changes
assets/{img → backend/img}/instagram-feed-popup.png RENAMED
File without changes
assets/{img → backend/img}/instagram-feed.png RENAMED
File without changes
assets/{img → backend/img}/instagram.png RENAMED
File without changes
assets/{img → backend/img}/logo.jpg RENAMED
File without changes
assets/{img → backend/img}/masonry.png RENAMED
File without changes
assets/{img → backend/img}/mobile.png RENAMED
File without changes
assets/{img → backend/img}/quadlayers.jpg RENAMED
File without changes
assets/backend/jquery-serializejson/jquery-serializejson.js ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ SerializeJSON jQuery plugin.
3
+ https://github.com/marioizquierdo/jquery.serializeJSON
4
+ version 2.9.0 (Jan, 2018)
5
+ Copyright (c) 2012-2018 Mario Izquierdo
6
+ Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
7
+ and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
8
+ */
9
+ (function (factory) {
10
+ if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module.
11
+ define(['jquery'], factory);
12
+ } else if (typeof exports === 'object') { // Node/CommonJS
13
+ var jQuery = require('jquery');
14
+ module.exports = factory(jQuery);
15
+ } else { // Browser globals (zepto supported)
16
+ factory(window.jQuery || window.Zepto || window.$); // Zepto supported on browsers as well
17
+ }
18
+
19
+ }(function ($) {
20
+ "use strict";
21
+
22
+ // jQuery('form').serializeJSON()
23
+ $.fn.serializeJSON = function (options) {
24
+ var f, $form, opts, formAsArray, serializedObject, name, value, parsedValue, _obj, nameWithNoType, type, keys, skipFalsy;
25
+ f = $.serializeJSON;
26
+ $form = this; // NOTE: the set of matched elements is most likely a form, but it could also be a group of inputs
27
+ opts = f.setupOpts(options); // calculate values for options {parseNumbers, parseBoolens, parseNulls, ...} with defaults
28
+
29
+ // Use native `serializeArray` function to get an array of {name, value} objects.
30
+ formAsArray = $form.serializeArray();
31
+ f.readCheckboxUncheckedValues(formAsArray, opts, $form); // add objects to the array from unchecked checkboxes if needed
32
+
33
+ // Convert the formAsArray into a serializedObject with nested keys
34
+ serializedObject = {};
35
+ $.each(formAsArray, function (i, obj) {
36
+ name = obj.name; // original input name
37
+ value = obj.value; // input value
38
+ _obj = f.extractTypeAndNameWithNoType(name);
39
+ nameWithNoType = _obj.nameWithNoType; // input name with no type (i.e. "foo:string" => "foo")
40
+ type = _obj.type; // type defined from the input name in :type colon notation
41
+ if (!type)
42
+ type = f.attrFromInputWithName($form, name, 'data-value-type');
43
+ f.validateType(name, type, opts); // make sure that the type is one of the valid types if defined
44
+
45
+ if (type !== 'skip') { // ignore inputs with type 'skip'
46
+ keys = f.splitInputNameIntoKeysArray(nameWithNoType);
47
+ parsedValue = f.parseValue(value, name, type, opts); // convert to string, number, boolean, null or customType
48
+
49
+ skipFalsy = !parsedValue && f.shouldSkipFalsy($form, name, nameWithNoType, type, opts); // ignore falsy inputs if specified
50
+ if (!skipFalsy) {
51
+ f.deepSet(serializedObject, keys, parsedValue, opts);
52
+ }
53
+ }
54
+ });
55
+ return serializedObject;
56
+ };
57
+
58
+ // Use $.serializeJSON as namespace for the auxiliar functions
59
+ // and to define defaults
60
+ $.serializeJSON = {
61
+
62
+ defaultOptions: {
63
+ checkboxUncheckedValue: undefined, // to include that value for unchecked checkboxes (instead of ignoring them)
64
+
65
+ parseNumbers: false, // convert values like "1", "-2.33" to 1, -2.33
66
+ parseBooleans: false, // convert "true", "false" to true, false
67
+ parseNulls: false, // convert "null" to null
68
+ parseAll: false, // all of the above
69
+ parseWithFunction: null, // to use custom parser, a function like: function(val){ return parsed_val; }
70
+
71
+ skipFalsyValuesForTypes: [], // skip serialization of falsy values for listed value types
72
+ skipFalsyValuesForFields: [], // skip serialization of falsy values for listed field names
73
+
74
+ customTypes: {}, // override defaultTypes
75
+ defaultTypes: {
76
+ "string": function (str) {
77
+ return String(str);
78
+ },
79
+ "number": function (str) {
80
+ return Number(str);
81
+ },
82
+ "boolean": function (str) {
83
+ var falses = ["false", "null", "undefined", "", "0"];
84
+ return falses.indexOf(str) === -1;
85
+ },
86
+ "null": function (str) {
87
+ var falses = ["false", "null", "undefined", "", "0"];
88
+ return falses.indexOf(str) === -1 ? str : null;
89
+ },
90
+ "array": function (str) {
91
+ return JSON.parse(str);
92
+ },
93
+ "object": function (str) {
94
+ return JSON.parse(str);
95
+ },
96
+ "auto": function (str) {
97
+ return $.serializeJSON.parseValue(str, null, null, {parseNumbers: true, parseBooleans: true, parseNulls: true});
98
+ }, // try again with something like "parseAll"
99
+ "skip": null // skip is a special type that makes it easy to ignore elements
100
+ },
101
+
102
+ useIntKeysAsArrayIndex: false // name="foo[2]" value="v" => {foo: [null, null, "v"]}, instead of {foo: ["2": "v"]}
103
+ },
104
+
105
+ // Merge option defaults into the options
106
+ setupOpts: function (options) {
107
+ var opt, validOpts, defaultOptions, optWithDefault, parseAll, f;
108
+ f = $.serializeJSON;
109
+
110
+ if (options == null) {
111
+ options = {};
112
+ } // options ||= {}
113
+ defaultOptions = f.defaultOptions || {}; // defaultOptions
114
+
115
+ // Make sure that the user didn't misspell an option
116
+ validOpts = ['checkboxUncheckedValue', 'parseNumbers', 'parseBooleans', 'parseNulls', 'parseAll', 'parseWithFunction', 'skipFalsyValuesForTypes', 'skipFalsyValuesForFields', 'customTypes', 'defaultTypes', 'useIntKeysAsArrayIndex']; // re-define because the user may override the defaultOptions
117
+ for (opt in options) {
118
+ if (validOpts.indexOf(opt) === -1) {
119
+ throw new Error("serializeJSON ERROR: invalid option '" + opt + "'. Please use one of " + validOpts.join(', '));
120
+ }
121
+ }
122
+
123
+ // Helper to get the default value for this option if none is specified by the user
124
+ optWithDefault = function (key) {
125
+ return (options[key] !== false) && (options[key] !== '') && (options[key] || defaultOptions[key]);
126
+ };
127
+
128
+ // Return computed options (opts to be used in the rest of the script)
129
+ parseAll = optWithDefault('parseAll');
130
+ return {
131
+ checkboxUncheckedValue: optWithDefault('checkboxUncheckedValue'),
132
+
133
+ parseNumbers: parseAll || optWithDefault('parseNumbers'),
134
+ parseBooleans: parseAll || optWithDefault('parseBooleans'),
135
+ parseNulls: parseAll || optWithDefault('parseNulls'),
136
+ parseWithFunction: optWithDefault('parseWithFunction'),
137
+
138
+ skipFalsyValuesForTypes: optWithDefault('skipFalsyValuesForTypes'),
139
+ skipFalsyValuesForFields: optWithDefault('skipFalsyValuesForFields'),
140
+ typeFunctions: $.extend({}, optWithDefault('defaultTypes'), optWithDefault('customTypes')),
141
+
142
+ useIntKeysAsArrayIndex: optWithDefault('useIntKeysAsArrayIndex')
143
+ };
144
+ },
145
+
146
+ // Given a string, apply the type or the relevant "parse" options, to return the parsed value
147
+ parseValue: function (valStr, inputName, type, opts) {
148
+ var f, parsedVal;
149
+ f = $.serializeJSON;
150
+ parsedVal = valStr; // if no parsing is needed, the returned value will be the same
151
+
152
+ if (opts.typeFunctions && type && opts.typeFunctions[type]) { // use a type if available
153
+ parsedVal = opts.typeFunctions[type](valStr);
154
+ } else if (opts.parseNumbers && f.isNumeric(valStr)) { // auto: number
155
+ parsedVal = Number(valStr);
156
+ } else if (opts.parseBooleans && (valStr === "true" || valStr === "false")) { // auto: boolean
157
+ parsedVal = (valStr === "true");
158
+ } else if (opts.parseNulls && valStr == "null") { // auto: null
159
+ parsedVal = null;
160
+ } else if (opts.typeFunctions && opts.typeFunctions["string"]) { // make sure to apply :string type if it was re-defined
161
+ parsedVal = opts.typeFunctions["string"](valStr);
162
+ }
163
+
164
+ // Custom parse function: apply after parsing options, unless there's an explicit type.
165
+ if (opts.parseWithFunction && !type) {
166
+ parsedVal = opts.parseWithFunction(parsedVal, inputName);
167
+ }
168
+
169
+ return parsedVal;
170
+ },
171
+
172
+ isObject: function (obj) {
173
+ return obj === Object(obj);
174
+ }, // is it an Object?
175
+ isUndefined: function (obj) {
176
+ return obj === void 0;
177
+ }, // safe check for undefined values
178
+ isValidArrayIndex: function (val) {
179
+ return /^[0-9]+$/.test(String(val));
180
+ }, // 1,2,3,4 ... are valid array indexes
181
+ isNumeric: function (obj) {
182
+ return obj - parseFloat(obj) >= 0;
183
+ }, // taken from jQuery.isNumeric implementation. Not using jQuery.isNumeric to support old jQuery and Zepto versions
184
+
185
+ optionKeys: function (obj) {
186
+ if (Object.keys) {
187
+ return Object.keys(obj);
188
+ } else {
189
+ var key, keys = [];
190
+ for (key in obj) {
191
+ keys.push(key);
192
+ }
193
+ return keys;
194
+ }
195
+ }, // polyfill Object.keys to get option keys in IE<9
196
+
197
+
198
+ // Fill the formAsArray object with values for the unchecked checkbox inputs,
199
+ // using the same format as the jquery.serializeArray function.
200
+ // The value of the unchecked values is determined from the opts.checkboxUncheckedValue
201
+ // and/or the data-unchecked-value attribute of the inputs.
202
+ readCheckboxUncheckedValues: function (formAsArray, opts, $form) {
203
+ var selector, $uncheckedCheckboxes, $el, uncheckedValue, f, name;
204
+ if (opts == null) {
205
+ opts = {};
206
+ }
207
+ f = $.serializeJSON;
208
+
209
+ selector = 'input[type=checkbox][name]:not(:checked):not([disabled])';
210
+ $uncheckedCheckboxes = $form.find(selector).add($form.filter(selector));
211
+ $uncheckedCheckboxes.each(function (i, el) {
212
+ // Check data attr first, then the option
213
+ $el = $(el);
214
+ uncheckedValue = $el.attr('data-unchecked-value');
215
+ if (uncheckedValue == null) {
216
+ uncheckedValue = opts.checkboxUncheckedValue;
217
+ }
218
+
219
+ // If there's an uncheckedValue, push it into the serialized formAsArray
220
+ if (uncheckedValue != null) {
221
+ if (el.name && el.name.indexOf("[][") !== -1) { // identify a non-supported
222
+ throw new Error("serializeJSON ERROR: checkbox unchecked values are not supported on nested arrays of objects like '" + el.name + "'. See https://github.com/marioizquierdo/jquery.serializeJSON/issues/67");
223
+ }
224
+ formAsArray.push({name: el.name, value: uncheckedValue});
225
+ }
226
+ });
227
+ },
228
+
229
+ // Returns and object with properties {name_without_type, type} from a given name.
230
+ // The type is null if none specified. Example:
231
+ // "foo" => {nameWithNoType: "foo", type: null}
232
+ // "foo:boolean" => {nameWithNoType: "foo", type: "boolean"}
233
+ // "foo[bar]:null" => {nameWithNoType: "foo[bar]", type: "null"}
234
+ extractTypeAndNameWithNoType: function (name) {
235
+ var match;
236
+ if (match = name.match(/(.*):([^:]+)$/)) {
237
+ return {nameWithNoType: match[1], type: match[2]};
238
+ } else {
239
+ return {nameWithNoType: name, type: null};
240
+ }
241
+ },
242
+
243
+ // Check if this input should be skipped when it has a falsy value,
244
+ // depending on the options to skip values by name or type, and the data-skip-falsy attribute.
245
+ shouldSkipFalsy: function ($form, name, nameWithNoType, type, opts) {
246
+ var f = $.serializeJSON;
247
+
248
+ var skipFromDataAttr = f.attrFromInputWithName($form, name, 'data-skip-falsy');
249
+ if (skipFromDataAttr != null) {
250
+ return skipFromDataAttr !== 'false'; // any value is true, except if explicitly using 'false'
251
+ }
252
+
253
+ var optForFields = opts.skipFalsyValuesForFields;
254
+ if (optForFields && (optForFields.indexOf(nameWithNoType) !== -1 || optForFields.indexOf(name) !== -1)) {
255
+ return true;
256
+ }
257
+
258
+ var optForTypes = opts.skipFalsyValuesForTypes;
259
+ if (type == null)
260
+ type = 'string'; // assume fields with no type are targeted as string
261
+ if (optForTypes && optForTypes.indexOf(type) !== -1) {
262
+ return true
263
+ }
264
+
265
+ return false;
266
+ },
267
+
268
+ // Finds the first input in $form with this name, and get the given attr from it.
269
+ // Returns undefined if no input or no attribute was found.
270
+ attrFromInputWithName: function ($form, name, attrName) {
271
+ var escapedName, selector, $input, attrValue;
272
+ escapedName = name.replace(/(:|\.|\[|\]|\s)/g, '\\$1'); // every non-standard character need to be escaped by \\
273
+ selector = '[name="' + escapedName + '"]';
274
+ $input = $form.find(selector).add($form.filter(selector)); // NOTE: this returns only the first $input element if multiple are matched with the same name (i.e. an "array[]"). So, arrays with different element types specified through the data-value-type attr is not supported.
275
+ return $input.attr(attrName);
276
+ },
277
+
278
+ // Raise an error if the type is not recognized.
279
+ validateType: function (name, type, opts) {
280
+ var validTypes, f;
281
+ f = $.serializeJSON;
282
+ validTypes = f.optionKeys(opts ? opts.typeFunctions : f.defaultOptions.defaultTypes);
283
+ if (!type || validTypes.indexOf(type) !== -1) {
284
+ return true;
285
+ } else {
286
+ throw new Error("serializeJSON ERROR: Invalid type " + type + " found in input name '" + name + "', please use one of " + validTypes.join(', '));
287
+ }
288
+ },
289
+
290
+ // Split the input name in programatically readable keys.
291
+ // Examples:
292
+ // "foo" => ['foo']
293
+ // "[foo]" => ['foo']
294
+ // "foo[inn][bar]" => ['foo', 'inn', 'bar']
295
+ // "foo[inn[bar]]" => ['foo', 'inn', 'bar']
296
+ // "foo[inn][arr][0]" => ['foo', 'inn', 'arr', '0']
297
+ // "arr[][val]" => ['arr', '', 'val']
298
+ splitInputNameIntoKeysArray: function (nameWithNoType) {
299
+ var keys, f;
300
+ f = $.serializeJSON;
301
+ keys = nameWithNoType.split('['); // split string into array
302
+ keys = $.map(keys, function (key) {
303
+ return key.replace(/\]/g, '');
304
+ }); // remove closing brackets
305
+ if (keys[0] === '') {
306
+ keys.shift();
307
+ } // ensure no opening bracket ("[foo][inn]" should be same as "foo[inn]")
308
+ return keys;
309
+ },
310
+
311
+ // Set a value in an object or array, using multiple keys to set in a nested object or array:
312
+ //
313
+ // deepSet(obj, ['foo'], v) // obj['foo'] = v
314
+ // deepSet(obj, ['foo', 'inn'], v) // obj['foo']['inn'] = v // Create the inner obj['foo'] object, if needed
315
+ // deepSet(obj, ['foo', 'inn', '123'], v) // obj['foo']['arr']['123'] = v //
316
+ //
317
+ // deepSet(obj, ['0'], v) // obj['0'] = v
318
+ // deepSet(arr, ['0'], v, {useIntKeysAsArrayIndex: true}) // arr[0] = v
319
+ // deepSet(arr, [''], v) // arr.push(v)
320
+ // deepSet(obj, ['arr', ''], v) // obj['arr'].push(v)
321
+ //
322
+ // arr = [];
323
+ // deepSet(arr, ['', v] // arr => [v]
324
+ // deepSet(arr, ['', 'foo'], v) // arr => [v, {foo: v}]
325
+ // deepSet(arr, ['', 'bar'], v) // arr => [v, {foo: v, bar: v}]
326
+ // deepSet(arr, ['', 'bar'], v) // arr => [v, {foo: v, bar: v}, {bar: v}]
327
+ //
328
+ deepSet: function (o, keys, value, opts) {
329
+ var key, nextKey, tail, lastIdx, lastVal, f;
330
+ if (opts == null) {
331
+ opts = {};
332
+ }
333
+ f = $.serializeJSON;
334
+ if (f.isUndefined(o)) {
335
+ throw new Error("ArgumentError: param 'o' expected to be an object or array, found undefined");
336
+ }
337
+ if (!keys || keys.length === 0) {
338
+ throw new Error("ArgumentError: param 'keys' expected to be an array with least one element");
339
+ }
340
+
341
+ key = keys[0];
342
+
343
+ // Only one key, then it's not a deepSet, just assign the value.
344
+ if (keys.length === 1) {
345
+ if (key === '') {
346
+ o.push(value); // '' is used to push values into the array (assume o is an array)
347
+ } else {
348
+ o[key] = value; // other keys can be used as object keys or array indexes
349
+ }
350
+
351
+ // With more keys is a deepSet. Apply recursively.
352
+ } else {
353
+ nextKey = keys[1];
354
+
355
+ // '' is used to push values into the array,
356
+ // with nextKey, set the value into the same object, in object[nextKey].
357
+ // Covers the case of ['', 'foo'] and ['', 'var'] to push the object {foo, var}, and the case of nested arrays.
358
+ if (key === '') {
359
+ lastIdx = o.length - 1; // asume o is array
360
+ lastVal = o[lastIdx];
361
+ if (f.isObject(lastVal) && (f.isUndefined(lastVal[nextKey]) || keys.length > 2)) { // if nextKey is not present in the last object element, or there are more keys to deep set
362
+ key = lastIdx; // then set the new value in the same object element
363
+ } else {
364
+ key = lastIdx + 1; // otherwise, point to set the next index in the array
365
+ }
366
+ }
367
+
368
+ // '' is used to push values into the array "array[]"
369
+ if (nextKey === '') {
370
+ if (f.isUndefined(o[key]) || !$.isArray(o[key])) {
371
+ o[key] = []; // define (or override) as array to push values
372
+ }
373
+ } else {
374
+ if (opts.useIntKeysAsArrayIndex && f.isValidArrayIndex(nextKey)) { // if 1, 2, 3 ... then use an array, where nextKey is the index
375
+ if (f.isUndefined(o[key]) || !$.isArray(o[key])) {
376
+ o[key] = []; // define (or override) as array, to insert values using int keys as array indexes
377
+ }
378
+ } else { // for anything else, use an object, where nextKey is going to be the attribute name
379
+ if (f.isUndefined(o[key]) || !f.isObject(o[key])) {
380
+ o[key] = {}; // define (or override) as object, to set nested properties
381
+ }
382
+ }
383
+ }
384
+
385
+ // Recursively set the inner object
386
+ tail = keys.slice(1);
387
+ f.deepSet(o[key], tail, value, opts);
388
+ }
389
+ }
390
+
391
+ };
392
+
393
+ }));
assets/backend/jquery-serializejson/jquery-serializejson.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /*!
3
+ SerializeJSON jQuery plugin.
4
+ https://github.com/marioizquierdo/jquery.serializeJSON
5
+ version 2.9.0 (Jan, 2018)
6
+ Copyright (c) 2012-2018 Mario Izquierdo
7
+ Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
8
+ and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
9
+ */
10
+ (function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof exports==="object"){var b=require("jquery");module.exports=a(b)}else{a(window.jQuery||window.Zepto||window.$)}}}(function(a){a.fn.serializeJSON=function(o){var h,p,b,i,k,c,m,d,j,e,l,n,g;h=a.serializeJSON;p=this;b=h.setupOpts(o);i=p.serializeArray();h.readCheckboxUncheckedValues(i,b,p);k={};a.each(i,function(f,q){c=q.name;m=q.value;j=h.extractTypeAndNameWithNoType(c);e=j.nameWithNoType;l=j.type;if(!l){l=h.attrFromInputWithName(p,c,"data-value-type")}h.validateType(c,l,b);if(l!=="skip"){n=h.splitInputNameIntoKeysArray(e);d=h.parseValue(m,c,l,b);g=!d&&h.shouldSkipFalsy(p,c,e,l,b);if(!g){h.deepSet(k,n,d,b)}}});return k};a.serializeJSON={defaultOptions:{checkboxUncheckedValue:undefined,parseNumbers:false,parseBooleans:false,parseNulls:false,parseAll:false,parseWithFunction:null,skipFalsyValuesForTypes:[],skipFalsyValuesForFields:[],customTypes:{},defaultTypes:{string:function(b){return String(b)},number:function(b){return Number(b)},"boolean":function(c){var b=["false","null","undefined","","0"];return b.indexOf(c)===-1},"null":function(c){var b=["false","null","undefined","","0"];return b.indexOf(c)===-1?c:null},array:function(b){return JSON.parse(b)},object:function(b){return JSON.parse(b)},auto:function(b){return a.serializeJSON.parseValue(b,null,null,{parseNumbers:true,parseBooleans:true,parseNulls:true})},skip:null},useIntKeysAsArrayIndex:false},setupOpts:function(d){var e,g,b,i,c,h;h=a.serializeJSON;if(d==null){d={}}b=h.defaultOptions||{};g=["checkboxUncheckedValue","parseNumbers","parseBooleans","parseNulls","parseAll","parseWithFunction","skipFalsyValuesForTypes","skipFalsyValuesForFields","customTypes","defaultTypes","useIntKeysAsArrayIndex"];for(e in d){if(g.indexOf(e)===-1){throw new Error("serializeJSON ERROR: invalid option '"+e+"'. Please use one of "+g.join(", "))}}i=function(f){return(d[f]!==false)&&(d[f]!=="")&&(d[f]||b[f])};c=i("parseAll");return{checkboxUncheckedValue:i("checkboxUncheckedValue"),parseNumbers:c||i("parseNumbers"),parseBooleans:c||i("parseBooleans"),parseNulls:c||i("parseNulls"),parseWithFunction:i("parseWithFunction"),skipFalsyValuesForTypes:i("skipFalsyValuesForTypes"),skipFalsyValuesForFields:i("skipFalsyValuesForFields"),typeFunctions:a.extend({},i("defaultTypes"),i("customTypes")),useIntKeysAsArrayIndex:i("useIntKeysAsArrayIndex")}},parseValue:function(d,c,e,g){var h,b;h=a.serializeJSON;b=d;if(g.typeFunctions&&e&&g.typeFunctions[e]){b=g.typeFunctions[e](d)}else{if(g.parseNumbers&&h.isNumeric(d)){b=Number(d)}else{if(g.parseBooleans&&(d==="true"||d==="false")){b=(d==="true")}else{if(g.parseNulls&&d=="null"){b=null}else{if(g.typeFunctions&&g.typeFunctions.string){b=g.typeFunctions.string(d)}}}}}if(g.parseWithFunction&&!e){b=g.parseWithFunction(b,c)}return b},isObject:function(b){return b===Object(b)},isUndefined:function(b){return b===void 0},isValidArrayIndex:function(b){return/^[0-9]+$/.test(String(b))},isNumeric:function(b){return b-parseFloat(b)>=0},optionKeys:function(d){if(Object.keys){return Object.keys(d)}else{var b,c=[];for(b in d){c.push(b)}return c}},readCheckboxUncheckedValues:function(i,b,k){var d,g,j,h,e,c;if(b==null){b={}}e=a.serializeJSON;d="input[type=checkbox][name]:not(:checked):not([disabled])";g=k.find(d).add(k.filter(d));g.each(function(f,l){j=a(l);h=j.attr("data-unchecked-value");if(h==null){h=b.checkboxUncheckedValue}if(h!=null){if(l.name&&l.name.indexOf("[][")!==-1){throw new Error("serializeJSON ERROR: checkbox unchecked values are not supported on nested arrays of objects like '"+l.name+"'. See https://github.com/marioizquierdo/jquery.serializeJSON/issues/67")}i.push({name:l.name,value:h})}})},extractTypeAndNameWithNoType:function(c){var b;if(b=c.match(/(.*):([^:]+)$/)){return{nameWithNoType:b[1],type:b[2]}}else{return{nameWithNoType:c,type:null}}},shouldSkipFalsy:function(k,c,e,i,b){var h=a.serializeJSON;var j=h.attrFromInputWithName(k,c,"data-skip-falsy");if(j!=null){return j!=="false"}var g=b.skipFalsyValuesForFields;if(g&&(g.indexOf(e)!==-1||g.indexOf(c)!==-1)){return true}var d=b.skipFalsyValuesForTypes;if(i==null){i="string"}if(d&&d.indexOf(i)!==-1){return true}return false},attrFromInputWithName:function(d,e,f){var c,b,h,g;c=e.replace(/(:|\.|\[|\]|\s)/g,"\\$1");b='[name="'+c+'"]';h=d.find(b).add(d.filter(b));return h.attr(f)},validateType:function(b,c,d){var g,e;e=a.serializeJSON;g=e.optionKeys(d?d.typeFunctions:e.defaultOptions.defaultTypes);if(!c||g.indexOf(c)!==-1){return true}else{throw new Error("serializeJSON ERROR: Invalid type "+c+" found in input name '"+b+"', please use one of "+g.join(", "))}},splitInputNameIntoKeysArray:function(b){var c,d;d=a.serializeJSON;c=b.split("[");c=a.map(c,function(e){return e.replace(/\]/g,"")});if(c[0]===""){c.shift()}return c},deepSet:function(c,l,j,b){var k,h,g,i,d,e;if(b==null){b={}}e=a.serializeJSON;if(e.isUndefined(c)){throw new Error("ArgumentError: param 'o' expected to be an object or array, found undefined")}if(!l||l.length===0){throw new Error("ArgumentError: param 'keys' expected to be an array with least one element")}k=l[0];if(l.length===1){if(k===""){c.push(j)}else{c[k]=j}}else{h=l[1];if(k===""){i=c.length-1;d=c[i];if(e.isObject(d)&&(e.isUndefined(d[h])||l.length>2)){k=i}else{k=i+1}}if(h===""){if(e.isUndefined(c[k])||!a.isArray(c[k])){c[k]=[]}}else{if(b.useIntKeysAsArrayIndex&&e.isValidArrayIndex(h)){if(e.isUndefined(c[k])||!a.isArray(c[k])){c[k]=[]}}else{if(e.isUndefined(c[k])||!e.isObject(c[k])){c[k]={}}}}g=l.slice(1);e.deepSet(c[k],g,j,b)}}}}));
assets/backend/js/qligg-admin-account.js ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+
3
+ _.mixin({
4
+ escapeHtml: function (attribute) {
5
+ return attribute.replace('&amp;', /&/g)
6
+ .replace(/&gt;/g, ">")
7
+ .replace(/&lt;/g, "<")
8
+ .replace(/&quot;/g, '"')
9
+ .replace(/&#039;/g, "'");
10
+ },
11
+ getFormData: function ($form) {
12
+ return $form.serializeJSON();
13
+ }
14
+ });
15
+
16
+ // Model
17
+ // ---------------------------------------------------------------------------
18
+
19
+ var Account = Backbone.Model.extend({
20
+ defaults: {
21
+ access_token: ''
22
+ }
23
+ });
24
+
25
+ var AccountView = Backbone.View.extend({
26
+ events: {
27
+ 'change input': 'enable',
28
+ 'click .media-modal-close': 'close',
29
+ 'submit .media-modal-form': 'submit'
30
+ },
31
+ templates: {},
32
+ initialize: function () {
33
+ _.bindAll(this, 'open', 'render', 'close', 'enable', 'submit');
34
+ this.init();
35
+ this.open();
36
+ },
37
+ init: function () {
38
+ this.templates.window = wp.template('qligg-modal-account-main');
39
+ },
40
+
41
+ render: function () {
42
+ var modal = this;
43
+ modal.$el.html(modal.templates.window(modal.model.attributes));
44
+ },
45
+ updateModel: function (e) {
46
+ e.preventDefault();
47
+ var modal = this,
48
+ $form = modal.$el.find('form');
49
+ var model = _.getFormData($form);
50
+ this.model.set(model);
51
+ },
52
+ enable: function (e) {
53
+ $('.media-modal-submit').removeProp('disabled');
54
+ this.updateModel(e);
55
+
56
+ },
57
+ open: function (e) {
58
+ this.render();
59
+ $('body').addClass('modal-open').append(this.$el);
60
+ },
61
+ close: function (e) {
62
+ e.preventDefault();
63
+ this.undelegateEvents();
64
+ $(document).off('focusin');
65
+ $('body').removeClass('modal-open');
66
+ this.remove();
67
+ return;
68
+ },
69
+ submit: function (e) {
70
+ e.preventDefault();
71
+ var modal = this,
72
+ $modal = modal.$el.find('#qligg_modal'),
73
+ $spinner = $modal.find('.settings-save-status .spinner'),
74
+ $saved = $modal.find('.settings-save-status .saved');
75
+ $.ajax({
76
+ url: ajaxurl,
77
+ data: {
78
+ action: 'qligg_add_token',
79
+ nonce: qligg_account.nonce.qligg_add_token,
80
+ access_token: modal.model.attributes.access_token
81
+ },
82
+ dataType: 'json',
83
+ type: 'POST',
84
+ beforeSend: function () {
85
+ $('.media-modal-submit').prop('disabled', true);
86
+ $spinner.addClass('is-active');
87
+ },
88
+ complete: function () {
89
+ $spinner.removeClass('is-active');
90
+ },
91
+ error: function (response) {
92
+ alert('Error!');
93
+ },
94
+ success: function (response) {
95
+ console.log(response);
96
+ if (response.success) {
97
+ $modal.addClass('reload');
98
+ $saved.addClass('is-active');
99
+ _.delay(function () {
100
+ $saved.removeClass('is-active');
101
+ }, 5000);
102
+ modal.close(e);
103
+ window.location.reload();
104
+
105
+ } else {
106
+ alert(response.data);
107
+ }
108
+ }
109
+ });
110
+ return false;
111
+ }
112
+ });
113
+
114
+ var AccountModal = Backbone.View.extend({
115
+ initialize: function (e) {
116
+ var model = new Account();
117
+ model.set({
118
+ access_token: ''
119
+ });
120
+ new AccountView({
121
+ model: model
122
+ });
123
+ }
124
+ });
125
+
126
+ // Copy token
127
+ // ---------------------------------------------------------------------------
128
+
129
+ $(document).on('click', '[data-qligg-copy-token]', function (e) {
130
+ e.preventDefault();
131
+ $($(this).data('qligg-copy-token')).select();
132
+ document.execCommand('copy');
133
+ });
134
+
135
+ // Delete token
136
+ // -------------------------------------------------------------------------
137
+
138
+ $(document).on('click', '[data-qligg-delete-token]', function (e) {
139
+ e.preventDefault();
140
+
141
+ var c = confirm(qligg_account.message.confirm_delete);
142
+
143
+ if (!c) {
144
+ return false;
145
+ }
146
+
147
+ var $button = $(e.target),
148
+ token_id = $button.closest('[data-token_id]').data('token_id'),
149
+ $spinner = $(e.target).closest('td').find('.spinner');
150
+
151
+ $.ajax({
152
+ url: ajaxurl,
153
+ type: 'post',
154
+ data: {
155
+ action: 'qligg_delete_token',
156
+ token_id: token_id,
157
+ nonce: qligg_account.nonce.qligg_delete_token
158
+ },
159
+ beforeSend: function () {
160
+ $spinner.addClass('is-active');
161
+ },
162
+ success: function (response) {
163
+ if (response.success) {
164
+ setTimeout(function () {
165
+ window.location.reload();
166
+ }, 300);
167
+
168
+ } else {
169
+ alert(response.data);
170
+ }
171
+ },
172
+ complete: function () {
173
+ $spinner.removeClass('is-active');
174
+ },
175
+ error: function (jqXHR, textStatus) {
176
+ console.log(textStatus);
177
+ }
178
+ });
179
+
180
+ });
181
+
182
+ // Save token
183
+ // ---------------------------------------------------------------------------
184
+
185
+ $('#qligg-add-token').on('click', function (e) {
186
+ e.preventDefault();
187
+ new AccountModal(e);
188
+ });
189
+
190
+ // Generate token
191
+ // ---------------------------------------------------------------------------
192
+ $(document).on('ready', function (e) {
193
+
194
+ var hash = window.location.hash,
195
+ access_token = hash.substring(14);
196
+
197
+ if (access_token.length > 40) {
198
+
199
+ var $button = $('#qligg-generate-token'),
200
+ $spinner = $button.closest('p').find('.spinner');
201
+
202
+ $.ajax({
203
+ url: ajaxurl,
204
+ type: 'post',
205
+ data: {
206
+ action: 'qligg_add_token',
207
+ access_token: access_token,
208
+ nonce: qligg_account.nonce.qligg_add_token
209
+ },
210
+ beforeSend: function () {
211
+ $button.css({'opacity': '.5', 'pointer-events': 'none'});
212
+ $spinner.addClass('is-active');
213
+ },
214
+ success: function (response) {
215
+ if (response.success) {
216
+ setTimeout(function () {
217
+ window.location.reload();
218
+ }, 300);
219
+ } else {
220
+ alert(response.data);
221
+ }
222
+ },
223
+ complete: function () {
224
+ $button.removeAttr('style');
225
+ $spinner.removeClass('is-active');
226
+ window.location.hash = '';
227
+ window.location.href.split('#')[0]
228
+ },
229
+ error: function (jqXHR, textStatus) {
230
+ console.log(textStatus);
231
+ }
232
+ });
233
+ }
234
+ });
235
+ })(jQuery);
assets/backend/js/qligg-admin-account.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+
2
+ (function(c){_.mixin({escapeHtml:function(e){return e.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")},getFormData:function(e){return e.serializeJSON()}});var b=Backbone.Model.extend({defaults:{access_token:""}});var a=Backbone.View.extend({events:{"change input":"enable","click .media-modal-close":"close","submit .media-modal-form":"submit"},templates:{},initialize:function(){_.bindAll(this,"open","render","close","enable","submit");this.init();this.open()},init:function(){this.templates.window=wp.template("qligg-modal-account-main")},render:function(){var e=this;e.$el.html(e.templates.window(e.model.attributes))},updateModel:function(i){i.preventDefault();var h=this,f=h.$el.find("form");var g=_.getFormData(f);this.model.set(g)},enable:function(f){c(".media-modal-submit").removeProp("disabled");this.updateModel(f)},open:function(f){this.render();c("body").addClass("modal-open").append(this.$el)},close:function(f){f.preventDefault();this.undelegateEvents();c(document).off("focusin");c("body").removeClass("modal-open");this.remove();return},submit:function(j){j.preventDefault();var i=this,g=i.$el.find("#qligg_modal"),h=g.find(".settings-save-status .spinner"),f=g.find(".settings-save-status .saved");c.ajax({url:ajaxurl,data:{action:"qligg_add_token",nonce:qligg_account.nonce.qligg_add_token,access_token:i.model.attributes.access_token},dataType:"json",type:"POST",beforeSend:function(){c(".media-modal-submit").prop("disabled",true);h.addClass("is-active")},complete:function(){h.removeClass("is-active")},error:function(e){alert("Error!")},success:function(e){console.log(e);if(e.success){g.addClass("reload");f.addClass("is-active");_.delay(function(){f.removeClass("is-active")},5000);i.close(j);window.location.reload()}else{alert(e.data)}}});return false}});var d=Backbone.View.extend({initialize:function(g){var f=new b();f.set({access_token:""});new a({model:f})}});c(document).on("click","[data-qligg-copy-token]",function(f){f.preventDefault();c(c(this).data("qligg-copy-token")).select();document.execCommand("copy")});c(document).on("click","[data-qligg-delete-token]",function(i){i.preventDefault();var j=confirm(qligg_account.message.confirm_delete);if(!j){return false}var h=c(i.target),f=h.closest("[data-token_id]").data("token_id"),g=c(i.target).closest("td").find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_delete_token",token_id:f,nonce:qligg_account.nonce.qligg_delete_token},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,k){console.log(k)}})});c("#qligg-add-token").on("click",function(f){f.preventDefault();new d(f)});c(document).on("ready",function(i){var h=window.location.hash,j=h.substring(14);if(j.length>40){var g=c("#qligg-generate-token"),f=g.closest("p").find(".spinner");c.ajax({url:ajaxurl,type:"post",data:{action:"qligg_add_token",access_token:j,nonce:qligg_account.nonce.qligg_add_token},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)}})}})})(jQuery);
assets/backend/js/qligg-admin-feed.js ADDED
@@ -0,0 +1,463 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ var count = 0,
3
+ timer;
4
+
5
+ var is_blocked = function ($node) {
6
+ return $node.is('.processing') || $node.parents('.processing').length;
7
+ };
8
+
9
+ var block = function () {
10
+ $('#qligg_modal').addClass('processing');
11
+ };
12
+
13
+ var unblock = function () {
14
+ $('#qligg_modal').removeClass('processing');
15
+ };
16
+
17
+ _.mixin({
18
+ escapeHtml: function (attribute) {
19
+ return attribute.replace('&amp;', /&/g)
20
+ .replace(/&gt;/g, ">")
21
+ .replace(/&lt;/g, "<")
22
+ .replace(/&quot;/g, '"')
23
+ .replace(/&#039;/g, "'");
24
+ },
25
+ getFormData: function ($form) {
26
+ return $form.serializeJSON({checkboxUncheckedValue: 'false', parseBooleans: true, parseNulls: true});
27
+ //breakes image highlight id
28
+ // return $form.serializeJSON({checkboxUncheckedValue: 'false', parseBooleans: true, parseNumbers: true, parseNulls: true});
29
+ }
30
+ });
31
+
32
+ // Model
33
+ // ---------------------------------------------------------------------------
34
+
35
+ var Feed = Backbone.Model.extend({
36
+ defaults: qligg_feed.args
37
+ });
38
+
39
+ var FeedViewTabs = Backbone.View.extend({
40
+ templates: {},
41
+ initialize: function () {
42
+ this.templates.window = wp.template('qligg-modal-tabs');
43
+ },
44
+ render: function () {
45
+ this.model.attributes.panel = 'tab_panel_feed';
46
+ this.$el.html(this.templates.window(this.model.attributes));
47
+ }
48
+ });
49
+
50
+ var FeedViewPanels = Backbone.View.extend({
51
+ templates: {},
52
+ initialize: function () {
53
+ this.templates.window = wp.template('qligg-modal-panels');
54
+
55
+ },
56
+ render: function () {
57
+ this.$el.html(this.templates.window(this.model.attributes));
58
+ this.$el.trigger('qligg-enhanced-color');
59
+ }
60
+ });
61
+
62
+ var FeedView = Backbone.View.extend({
63
+ events: {
64
+ 'change input': 'enable',
65
+ 'change textarea': 'enable',
66
+ 'change select': 'enable',
67
+ 'click .media-modal-image': 'setLayout',
68
+ 'click .media-modal-backdrop': 'close',
69
+ 'click .media-modal-close': 'close',
70
+ 'click .media-modal-prev': 'edit',
71
+ 'click .media-modal-next': 'edit',
72
+ 'click .media-modal-tab': 'tab',
73
+ 'change .media-modal-render-tabs': 'renderTabs',
74
+ 'change .media-modal-render-panels': 'renderPanels',
75
+ 'submit .media-modal-form': 'submit',
76
+ 'qligg.color.change input': 'enable',
77
+ },
78
+ templates: {},
79
+ initialize: function () {
80
+ _.bindAll(this, 'open', 'tab', 'edit', 'change', 'load', 'render', 'close', 'submit');
81
+ this.init();
82
+ this.open();
83
+ },
84
+ init: function () {
85
+ this.templates.window = wp.template('qligg-modal-main');
86
+ },
87
+ assign: function (view, selector) {
88
+ view.setElement(this.$(selector)).render();
89
+ },
90
+ render: function () {
91
+ var modal = this;
92
+ modal.$el.html(modal.templates.window(modal.model.attributes));
93
+ this.tabs = new FeedViewTabs({model: modal.model});
94
+ this.panels = new FeedViewPanels({model: modal.model});
95
+ this.assign(this.tabs, '#qligg-modal-tabs');
96
+ this.assign(this.panels, '#qligg-modal-panels');
97
+ _.delay(function () {
98
+ modal.$el.trigger('qligg-enhanced-color');
99
+ }, 100);
100
+ },
101
+ load: function () {
102
+ var modal = this,
103
+ $modal = modal.$el.find('#qligg_modal');
104
+ if (modal.model.attributes.id == undefined) {
105
+ modal.render();
106
+ return;
107
+ }
108
+ $.ajax({
109
+ url: ajaxurl,
110
+ data: {
111
+ action: 'qligg_edit_feed',
112
+ nonce: qligg_feed.nonce.qligg_edit_feed,
113
+ feed_id: this.model.attributes.id
114
+ },
115
+ dataType: 'json',
116
+ type: 'POST',
117
+ beforeSend: function () {
118
+ //if ($modal.length)
119
+ // block();
120
+ },
121
+ complete: function () {
122
+ // if ($modal.length)
123
+ unblock();
124
+ },
125
+ error: function () {
126
+ alert('Error!');
127
+ },
128
+ success: function (response) {
129
+ if (response.success) {
130
+ modal.model.set(response.data);
131
+ modal.render();
132
+ } else {
133
+ alert(response.data);
134
+ }
135
+ }
136
+ });
137
+ },
138
+ edit: function (e) {
139
+ e.preventDefault();
140
+ var modal = this,
141
+ $button = $(e.target),
142
+ feed_count = parseInt($('#qligg_feeds_table tr[data-feed_id]').length),
143
+ order = parseInt(modal.model.get('order'));
144
+ count++;
145
+ if (timer) {
146
+ clearTimeout(timer);
147
+ }
148
+
149
+ timer = setTimeout(function () {
150
+
151
+ if ($button.hasClass('media-modal-next')) {
152
+ order = Math.min(order + count, feed_count);
153
+ } else {
154
+ order = Math.max(order - count, 1);
155
+ }
156
+ modal.model.set({
157
+ id: parseInt($('#qligg_feeds_table tr[data-feed_position=' + order + ']').data('feed_id'))
158
+ // id: parseInt($('#qligg_feeds_table tr[data-item_nonce=' + order + ']').data('item_id'))
159
+ });
160
+ count = 0;
161
+ modal.load();
162
+ }, 300);
163
+ },
164
+ open: function (e) {
165
+ var modal = this;
166
+ $('body').addClass('modal-open').append(this.$el);
167
+ if (modal.model.attributes.id == undefined) {
168
+ _.delay(function () {
169
+ unblock();
170
+ modal.setUsername();
171
+ }, 100);
172
+
173
+ return;
174
+ }
175
+ this.load();
176
+ },
177
+ setLayout: function (e) {
178
+ e.preventDefault();
179
+ e.stopPropagation();
180
+ $(e.target).find('input[type=radio]').prop('checked', true);//.trigger('change');
181
+ $(e.target).siblings().find('input[type=radio]').prop('checked', false);
182
+ this.updateModel(e);
183
+ this.renderPanels(e);
184
+ this.renderTabs(e);
185
+ this.enable(e);
186
+ },
187
+ setUsername: function (e) {
188
+ var modal = this,
189
+ $select = modal.$el.find('#qligg_modal').find('form').find('select[name=username]');
190
+ $select.trigger('change');
191
+ },
192
+ updateModel: function (e) {
193
+ e.preventDefault();
194
+ var modal = this,
195
+ $form = modal.$el.find('#qligg_modal').find('form');
196
+
197
+ var model = _.getFormData($form);
198
+
199
+ this.model.set(model);
200
+ },
201
+ tab: function (e) {
202
+ e.preventDefault();
203
+
204
+ var modal = this,
205
+ $modal = modal.$el.find('#qligg_modal'),
206
+ $tab = $(e.currentTarget),
207
+ $tabs = $modal.find('ul.qligg-tabs'),
208
+ panel = $tab.find('a').attr('href').replace('#', '');
209
+
210
+ $tabs.find('.active').removeClass('active');
211
+ $tab.addClass('active');
212
+
213
+ this.model.attributes['panel'] = panel;
214
+ this.model.changed['panel'] = panel;
215
+
216
+ this.renderPanels(e);
217
+
218
+ },
219
+ renderTabs: function (e) {
220
+ this.renderPanels(e);
221
+ this.tabs.render();
222
+ },
223
+ renderPanels: function (e) {
224
+ this.updateModel(e);
225
+ this.panels.render();
226
+ },
227
+ change: function (e) {
228
+ e.preventDefault();
229
+ this.updateModel(e);
230
+ },
231
+ reload: function (e) {
232
+ if (this.$el.find('#qligg_modal').hasClass('reload')) {
233
+ location.reload();
234
+ return;
235
+ }
236
+ this.remove();
237
+ return;
238
+ },
239
+ close: function (e) {
240
+ e.preventDefault();
241
+ this.undelegateEvents();
242
+ $(document).off('focusin');
243
+ $('body').removeClass('modal-open');
244
+ // if necesary reload...
245
+ this.$el.find('#qligg_modal').addClass('reload');
246
+ this.reload(e);
247
+ return;
248
+ },
249
+ enable: function (e) {
250
+ $('.media-modal-submit').removeProp('disabled');
251
+ this.updateModel(e);
252
+
253
+ },
254
+ submit: function (e) {
255
+ e.preventDefault();
256
+ var modal = this,
257
+ $modal = modal.$el.find('#qligg_modal'),
258
+ $spinner = $modal.find('.settings-save-status .spinner'),
259
+ $saved = $modal.find('.settings-save-status .saved');
260
+ $.ajax({
261
+ url: ajaxurl,
262
+ data: {
263
+ action: 'qligg_save_feed',
264
+ nonce: qligg_feed.nonce.qligg_save_feed,
265
+ feed: JSON.stringify(modal.model.attributes)
266
+ },
267
+ dataType: 'json',
268
+ type: 'POST',
269
+ beforeSend: function () {
270
+ $('.media-modal-submit').prop('disabled', true);
271
+ $spinner.addClass('is-active');
272
+ },
273
+ complete: function () {
274
+ $saved.addClass('is-active');
275
+ $spinner.removeClass('is-active');
276
+ _.delay(function () {
277
+ $saved.removeClass('is-active');
278
+ }, 1000);
279
+ },
280
+ error: function (response) {
281
+ alert('Error!');
282
+ },
283
+ success: function (response) {
284
+ console.log(response);
285
+ if (response.success) {
286
+
287
+ if (modal.model.attributes.id == undefined) {
288
+ $modal.addClass('reload');
289
+ modal.reload(e);
290
+ modal.close(e);
291
+ }
292
+
293
+ } else {
294
+ alert(response.data);
295
+ }
296
+ }
297
+ });
298
+ return false;
299
+ }
300
+ });
301
+
302
+ var FeedModal = Backbone.View.extend({
303
+ initialize: function (e) {
304
+ var $button = $(e.target),
305
+ feed_id = $button.closest('[data-feed_position]').data('feed_id');
306
+ var model = new Feed();
307
+ model.set({
308
+ id: feed_id
309
+ });
310
+ new FeedView({
311
+ model: model
312
+ }).render();
313
+ }
314
+ });
315
+
316
+ $(document).on('qligg-enhanced-color', function (e) {
317
+
318
+ $('.color-picker').filter(':not(.enhanced)').each(function () {
319
+
320
+ if ($(this).is('[readonly]')) {
321
+ $(this).parent('.form-field').addClass('disabled-color-picker');
322
+ }
323
+
324
+ $(this).wpColorPicker({
325
+ change: function (event, ui) {
326
+ console.log('wpColorPicker');
327
+ $(event.target).trigger('qligg.color.change');
328
+ },
329
+ clear: function (event, ui) {
330
+ // $(event.target).trigger('change');
331
+ },
332
+ hide: function (event, ui) {
333
+ aler('!!!!');
334
+ // $(event.target).trigger('change');
335
+ }
336
+ });
337
+ });
338
+
339
+ });
340
+
341
+ // Add feed
342
+ // ---------------------------------------------------------------------------
343
+
344
+ $('#qligg-add-feed').on('click', function (e) {
345
+ e.preventDefault();
346
+ new FeedModal(e);
347
+ });
348
+
349
+ // Edit feed
350
+ // ---------------------------------------------------------------------------
351
+
352
+ var exist_modal = false;
353
+ $('.qligg_edit_feed').on('click', function (e) {
354
+ e.preventDefault();
355
+ if (!exist_modal) {
356
+ new FeedModal(e);
357
+ exist_modal = true;
358
+ }
359
+ });
360
+
361
+ // Delete feed
362
+ // ---------------------------------------------------------------------------
363
+
364
+ $('.qligg_delete_feed').on('click', function (e) {
365
+ e.preventDefault();
366
+
367
+ var c = confirm(qligg_feed.message.confirm_delete);
368
+
369
+ if (!c) {
370
+ return false;
371
+ }
372
+
373
+ var $button = $(e.target),
374
+ $spinner = $button.parent().find('.spinner'),
375
+ feed_id = $button.closest('[data-feed_id]').data('feed_id');
376
+
377
+ $.ajax({
378
+ url: ajaxurl,
379
+ data: {
380
+ action: 'qligg_delete_feed',
381
+ nonce: qligg_feed.nonce.qligg_delete_feed,
382
+ feed_id: feed_id
383
+ },
384
+ dataType: 'json',
385
+ type: 'POST',
386
+ beforeSend: function () {
387
+ $spinner.addClass('is-active');
388
+ },
389
+ complete: function () {
390
+ $spinner.removeClass('is-active');
391
+ },
392
+ error: function (response) {
393
+ },
394
+ success: function (response) {
395
+
396
+ if (response.data) {
397
+ console.log(response.data);
398
+ location.reload();
399
+ } else {
400
+ alert(response.data);
401
+ }
402
+ }
403
+ });
404
+
405
+ });
406
+
407
+ // Feed clear cache
408
+ // ---------------------------------------------------------------------------
409
+
410
+ $('.qligg_clear_cache').on('click', function (e) {
411
+ e.preventDefault();
412
+
413
+ var c = confirm(qligg_feed.message.confirm_clear_cache);
414
+
415
+ if (!c) {
416
+ return false;
417
+ }
418
+
419
+ var $button = $(e.target),
420
+ $spinner = $button.parent().find('.spinner'),
421
+ feed_id = $button.closest('[data-feed_id]').data('feed_id');
422
+
423
+ $.ajax({
424
+ url: ajaxurl,
425
+ type: 'post',
426
+ data: {
427
+ action: 'qligg_clear_cache',
428
+ feed_id: feed_id,
429
+ nonce: qligg_feed.nonce.qligg_clear_cache,
430
+ },
431
+ beforeSend: function () {
432
+ $spinner.addClass('is-active');
433
+ },
434
+ success: function (response) {
435
+ if (response.success) {
436
+ setTimeout(function () {
437
+ $spinner.removeClass('is-active');
438
+ }, 300);
439
+ } else {
440
+ alert(response.data);
441
+ }
442
+ },
443
+ complete: function () {
444
+ setTimeout(function () {
445
+ $spinner.removeClass('is-active');
446
+ }, 600);
447
+ },
448
+ error: function (jqXHR, textStatus) {
449
+ console.log(textStatus);
450
+ },
451
+ });
452
+ });
453
+
454
+ // Copy shortcode
455
+ // ---------------------------------------------------------------------------
456
+
457
+ $(document).on('click', '[data-qligg-copy-feed-shortcode]', function (e) {
458
+ e.preventDefault();
459
+ $($(this).data('qligg-copy-feed-shortcode')).select();
460
+ document.execCommand('copy');
461
+ });
462
+
463
+ })(jQuery);
assets/backend/js/qligg-admin-feed.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+
2
+ (function(f){var l=0,a;var e=function(m){return m.is(".processing")||m.parents(".processing").length};var d=function(){f("#qligg_modal").addClass("processing")};var j=function(){f("#qligg_modal").removeClass("processing")};_.mixin({escapeHtml:function(m){return m.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")},getFormData:function(m){return m.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:true,parseNulls:true})}});var b=Backbone.Model.extend({defaults:qligg_feed.args});var g=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))}});var i=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")}});var h=Backbone.View.extend({events:{"change input":"enable","change textarea":"enable","change select":"enable","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":"enable",},templates:{},initialize:function(){_.bindAll(this,"open","tab","edit","change","load","render","close","submit");this.init();this.open()},init:function(){this.templates.window=wp.template("qligg-modal-main")},assign:function(n,m){n.setElement(this.$(m)).render()},render:function(){var m=this;m.$el.html(m.templates.window(m.model.attributes));this.tabs=new g({model:m.model});this.panels=new i({model:m.model});this.assign(this.tabs,"#qligg-modal-tabs");this.assign(this.panels,"#qligg-modal-panels");_.delay(function(){m.$el.trigger("qligg-enhanced-color")},100)},load:function(){var n=this,m=n.$el.find("#qligg_modal");if(n.model.attributes.id==undefined){n.render();return}f.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",beforeSend:function(){},complete:function(){j()},error:function(){alert("Error!")},success:function(o){if(o.success){n.model.set(o.data);n.render()}else{alert(o.data)}}})},edit:function(q){q.preventDefault();var n=this,p=f(q.target),o=parseInt(f("#qligg_feeds_table tr[data-feed_id]").length),m=parseInt(n.model.get("order"));l++;if(a){clearTimeout(a)}a=setTimeout(function(){if(p.hasClass("media-modal-next")){m=Math.min(m+l,o)}else{m=Math.max(m-l,1)}n.model.set({id:parseInt(f("#qligg_feeds_table tr[data-feed_position="+m+"]").data("feed_id"))});l=0;n.load()},300)},open:function(n){var m=this;f("body").addClass("modal-open").append(this.$el);if(m.model.attributes.id==undefined){_.delay(function(){j();m.setUsername()},100);return}this.load()},setLayout:function(m){m.preventDefault();m.stopPropagation();f(m.target).find("input[type=radio]").prop("checked",true);f(m.target).siblings().find("input[type=radio]").prop("checked",false);this.updateModel(m);this.renderPanels(m);this.renderTabs(m);this.enable(m)},setUsername:function(o){var n=this,m=n.$el.find("#qligg_modal").find("form").find("select[name=username]");m.trigger("change")},updateModel:function(p){p.preventDefault();var o=this,m=o.$el.find("#qligg_modal").find("form");var n=_.getFormData(m);this.model.set(n)},tab:function(r){r.preventDefault();var p=this,o=p.$el.find("#qligg_modal"),q=f(r.currentTarget),m=o.find("ul.qligg-tabs"),n=q.find("a").attr("href").replace("#","");m.find(".active").removeClass("active");q.addClass("active");this.model.attributes.panel=n;this.model.changed.panel=n;this.renderPanels(r)},renderTabs:function(m){this.renderPanels(m);this.tabs.render()},renderPanels:function(m){this.updateModel(m);this.panels.render()},change:function(m){m.preventDefault();this.updateModel(m)},reload:function(m){if(this.$el.find("#qligg_modal").hasClass("reload")){location.reload();return}this.remove();return},close:function(m){m.preventDefault();this.undelegateEvents();f(document).off("focusin");f("body").removeClass("modal-open");this.$el.find("#qligg_modal").addClass("reload");this.reload(m);return},enable:function(m){f(".media-modal-submit").removeProp("disabled");this.updateModel(m)},submit:function(q){q.preventDefault();var p=this,n=p.$el.find("#qligg_modal"),o=n.find(".settings-save-status .spinner"),m=n.find(".settings-save-status .saved");f.ajax({url:ajaxurl,data:{action:"qligg_save_feed",nonce:qligg_feed.nonce.qligg_save_feed,feed:JSON.stringify(p.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){f(".media-modal-submit").prop("disabled",true);o.addClass("is-active")},complete:function(){m.addClass("is-active");o.removeClass("is-active");_.delay(function(){m.removeClass("is-active")},1000)},error:function(r){alert("Error!")},success:function(r){console.log(r);if(r.success){if(p.model.attributes.id==undefined){n.addClass("reload");p.reload(q);p.close(q)}}else{alert(r.data)}}});return false}});var c=Backbone.View.extend({initialize:function(p){var o=f(p.target),n=o.closest("[data-feed_position]").data("feed_id");var m=new b();m.set({id:n});new h({model:m}).render()}});f(document).on("qligg-enhanced-color",function(m){f(".color-picker").filter(":not(.enhanced)").each(function(){if(f(this).is("[readonly]")){f(this).parent(".form-field").addClass("disabled-color-picker")}f(this).wpColorPicker({change:function(n,o){console.log("wpColorPicker");f(n.target).trigger("qligg.color.change")},clear:function(n,o){},hide:function(n,o){aler("!!!!")}})})});f("#qligg-add-feed").on("click",function(m){m.preventDefault();new c(m)});var k=false;f(".qligg_edit_feed").on("click",function(m){m.preventDefault();if(!k){new c(m);k=true}});f(".qligg_delete_feed").on("click",function(p){p.preventDefault();var q=confirm(qligg_feed.message.confirm_delete);if(!q){return false}var o=f(p.target),n=o.parent().find(".spinner"),m=o.closest("[data-feed_id]").data("feed_id");f.ajax({url:ajaxurl,data:{action:"qligg_delete_feed",nonce:qligg_feed.nonce.qligg_delete_feed,feed_id:m},dataType:"json",type:"POST",beforeSend:function(){n.addClass("is-active")},complete:function(){n.removeClass("is-active")},error:function(r){},success:function(r){if(r.data){console.log(r.data);location.reload()}else{alert(r.data)}}})});f(".qligg_clear_cache").on("click",function(p){p.preventDefault();var q=confirm(qligg_feed.message.confirm_clear_cache);if(!q){return false}var o=f(p.target),n=o.parent().find(".spinner"),m=o.closest("[data-feed_id]").data("feed_id");f.ajax({url:ajaxurl,type:"post",data:{action:"qligg_clear_cache",feed_id:m,nonce:qligg_feed.nonce.qligg_clear_cache,},beforeSend:function(){n.addClass("is-active")},success:function(r){if(r.success){setTimeout(function(){n.removeClass("is-active")},300)}else{alert(r.data)}},complete:function(){setTimeout(function(){n.removeClass("is-active")},600)},error:function(r,s){console.log(s)},})});f(document).on("click","[data-qligg-copy-feed-shortcode]",function(m){m.preventDefault();f(f(this).data("qligg-copy-feed-shortcode")).select();document.execCommand("copy")})})(jQuery);
assets/backend/js/qligg-admin-settings.js ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ (function ($) {
3
+
4
+ _.mixin({
5
+ escapeHtml: function (attribute) {
6
+ return attribute.replace('&amp;', /&/g)
7
+ .replace(/&gt;/g, ">")
8
+ .replace(/&lt;/g, "<")
9
+ .replace(/&quot;/g, '"')
10
+ .replace(/&#039;/g, "'");
11
+ },
12
+ getFormData: function ($form) {
13
+ return $form.serializeJSON();
14
+ }
15
+ });
16
+
17
+
18
+
19
+ // Spinner
20
+ // -------------------------------------------------------------------------
21
+
22
+ function ig_change_spinner(link) {
23
+ if (link) {
24
+ if (!$('#qligg-save-settings .insta-gallery-spinner img').length) {
25
+ var img = '<img src="' + link + '" class="ig-spin" />';
26
+ $('#qligg-save-settings .insta-gallery-spinner').append(img);
27
+ } else {
28
+ $('#qligg-save-settings .insta-gallery-spinner img').attr('src', link);
29
+ }
30
+ $('#qligg-save-settings .insta-gallery-spinner .ig-spin').hide();
31
+ $('#qligg-save-settings .insta-gallery-spinner img').show();
32
+ } else {
33
+ $('#qligg-save-settings .insta-gallery-spinner .ig-spin').show();
34
+ $('#qligg-save-settings .insta-gallery-spinner img').remove();
35
+ }
36
+
37
+ }
38
+
39
+ var $igs_image_id = $('input[name=insta_spinner_image_id]'),
40
+ $igs_reset = $('#ig-spinner-reset');
41
+
42
+ $('#qligg-save-settings').on('submit', function (e) {
43
+ e.preventDefault();
44
+
45
+ var $form = $(this),
46
+ $spinner = $form.find('.spinner');
47
+
48
+ $.ajax({
49
+ url: ajaxurl,
50
+ type: 'post',
51
+ dataType: 'JSON',
52
+ data: {
53
+ action: 'qligg_save_settings',
54
+ nonce: qligg_settings.nonce.qligg_save_settings,
55
+ settings_data: $form.serialize(),
56
+ },
57
+ beforeSend: function () {
58
+ $spinner.addClass('is-active');
59
+ },
60
+ success: function (response) {
61
+ },
62
+ complete: function () {
63
+ $spinner.removeClass('is-active');
64
+ },
65
+ error: function (jqXHR, textStatus) {
66
+ console.log(textStatus);
67
+ }
68
+ });
69
+ });
70
+
71
+ // reset spinner to default
72
+ $igs_reset.click(function () {
73
+ $igs_image_id.val('');
74
+ ig_change_spinner();
75
+ $(this).hide();
76
+ });
77
+
78
+ if ($igs_image_id.val() == '')
79
+ $igs_reset.hide();
80
+ if ($igs_image_id.data('misrc') != '')
81
+ ig_change_spinner($igs_image_id.data('misrc'));
82
+
83
+ // Upload media image
84
+ // ---------------------------------------------------------------------------
85
+ $('#ig-spinner-upload').click(function (e) {
86
+ e.preventDefault();
87
+ var image_frame;
88
+
89
+ if (image_frame) {
90
+ image_frame.open();
91
+ }
92
+ // Define image_frame as wp.media object
93
+ image_frame = wp.media({
94
+ title: 'Select Media',
95
+ multiple: false,
96
+ library: {
97
+ type: 'image',
98
+ }
99
+ });
100
+
101
+ image_frame.on('close', function () {
102
+ // On close, get selections and save to the hidden input
103
+ // plus other AJAX stuff to refresh the image preview
104
+ var selection = image_frame.state().get('selection');
105
+
106
+ if (selection.length) {
107
+
108
+ var gallery_ids = new Array();
109
+ var i = 0, attachment_url;
110
+
111
+ selection.each(function (attachment) {
112
+ gallery_ids[i] = attachment['id'];
113
+ attachment_url = attachment.attributes.url;
114
+ i++;
115
+ });
116
+ var ids = gallery_ids.join(",");
117
+ $igs_image_id.val(ids);
118
+ ig_change_spinner(attachment_url)
119
+ }
120
+
121
+ // toggle reset button
122
+ if ($igs_image_id.val() == '') {
123
+ $igs_reset.hide();
124
+ } else {
125
+ $igs_reset.show();
126
+ }
127
+
128
+ });
129
+
130
+ image_frame.on('open', function () {
131
+ // On open, get the id from the hidden input
132
+ // and select the appropiate images in the media manager
133
+ var selection = image_frame.state().get('selection');
134
+ var ids = $igs_image_id.val().split(',');
135
+
136
+ ids.forEach(function (id) {
137
+ attachment = wp.media.attachment(id);
138
+ attachment.fetch();
139
+ selection.add(attachment ? [attachment] : []);
140
+ });
141
+
142
+ });
143
+
144
+ image_frame.open();
145
+ });
146
+
147
+
148
+
149
+ })(jQuery);
assets/backend/js/qligg-admin-settings.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+
2
+ (function(c){_.mixin({escapeHtml:function(e){return e.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")},getFormData:function(e){return e.serializeJSON()}});function b(f){if(f){if(!c("#qligg-save-settings .insta-gallery-spinner img").length){var e='<img src="'+f+'" class="ig-spin" />';c("#qligg-save-settings .insta-gallery-spinner").append(e)}else{c("#qligg-save-settings .insta-gallery-spinner img").attr("src",f)}c("#qligg-save-settings .insta-gallery-spinner .ig-spin").hide();c("#qligg-save-settings .insta-gallery-spinner img").show()}else{c("#qligg-save-settings .insta-gallery-spinner .ig-spin").show();c("#qligg-save-settings .insta-gallery-spinner img").remove()}}var d=c("input[name=insta_spinner_image_id]"),a=c("#ig-spinner-reset");c("#qligg-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:{action:"qligg_save_settings",nonce:qligg_settings.nonce.qligg_save_settings,settings_data:f.serialize(),},beforeSend:function(){g.addClass("is-active")},success:function(e){},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()})})(jQuery);
assets/{rgba → backend/rgba}/wp-color-picker-alpha.js RENAMED
File without changes
assets/{rgba → backend/rgba}/wp-color-picker-alpha.min.js RENAMED
File without changes
assets/css/qligg-admin.css DELETED
@@ -1,286 +0,0 @@
1
- @-moz-keyframes "igspin" {
2
- 100% {
3
- -moz-transform: rotate(360deg);
4
- }
5
- }
6
- @-webkit-keyframes "igspin" {
7
- 100% {
8
- -webkit-transform: rotate(360deg);
9
- }
10
- }
11
- @keyframes "igspin" {
12
- 100% {
13
- -webkit-transform: rotate(360deg);
14
- transform: rotate(360deg);
15
- }
16
- }
17
- .qlwrap .nav-tab i {
18
- line-height: 26px;
19
- }
20
- .qlwrap hr {
21
- margin: 3em 0 1em 0;
22
- }
23
- div.premium,
24
- tr.premium,
25
- li.premium {
26
- position: relative;
27
- pointer-events: none;
28
- opacity: 0.5;
29
- }
30
- div.premium:before,
31
- tr.premium:before,
32
- li.premium:before {
33
- content: '';
34
- position: absolute;
35
- top: 0;
36
- bottom: -1px;
37
- left: 0;
38
- right: 0;
39
- background-color: #eee;
40
- opacity: 0.25;
41
- }
42
- .ig-table h4 {
43
- margin: 5px 0 10px 0;
44
- }
45
- .ig-table .iris-picker .iris-slider {
46
- margin-left: 8px!important;
47
- }
48
- .ig-table tr.premium {
49
- display: block!important;
50
- }
51
- .ig-table tr.premium td p.description {
52
- display: none;
53
- }
54
- .ig-table td {
55
- vertical-align: middle;
56
- }
57
- .ig-table td.profile-picture img {
58
- width: 46px;
59
- border-radius: 50%;
60
- }
61
- .ig-table td p.premium,
62
- .ig-table td span.premium {
63
- font-size: 11px;
64
- font-weight: 600;
65
- font-style: italic;
66
- color: #747474;
67
- }
68
- .ig-table input[type="text"]:read-only {
69
- font-weight: bold;
70
- font-size: 110%;
71
- padding: 3px 10px;
72
- background: #f7f7f7;
73
- color: #72777c;
74
- cursor: copy;
75
- border-color: transparent;
76
- box-shadow: none;
77
- }
78
- .ig-table input[type="text"]:read-only:focus {
79
- border-color: transparent;
80
- box-shadow: none;
81
- }
82
- .ig-list-images {
83
- display: inline-block;
84
- margin: 0px;
85
- }
86
- .ig-list-images li {
87
- display: inline-block;
88
- margin: 0 10px 0 0;
89
- margin-bottom: 0;
90
- vertical-align: middle;
91
- color: #aaa;
92
- position: relative;
93
- border: 1px solid #f1f1f1;
94
- border-radius: 3px;
95
- padding: 10px;
96
- background-color: #fff;
97
- cursor: pointer;
98
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
99
- }
100
- .ig-list-images li:before {
101
- content: '';
102
- position: absolute;
103
- top: 0;
104
- bottom: 0;
105
- left: 0;
106
- right: 0;
107
- background-color: #eee;
108
- opacity: 0.2;
109
- }
110
- .ig-list-images li.active:before,
111
- .ig-list-images li:hover:before {
112
- opacity: 0;
113
- }
114
- .ig-list-images li.active label,
115
- .ig-list-images li:hover label {
116
- color: #e23565;
117
- }
118
- .ig-list-images label {
119
- display: block;
120
- position: relative;
121
- line-height: 2em;
122
- z-index: 9;
123
- cursor: pointer;
124
- transition: all .25s linear;
125
- text-align: center;
126
- font-weight: bold;
127
- color: #23282d;
128
- }
129
- .ig-list-images input[type=radio] {
130
- display: none;
131
- }
132
- .ig-list-buttons {
133
- display: inline-block;
134
- margin: 0px;
135
- }
136
- .ig-list-buttons li {
137
- display: inline-block;
138
- margin-right: 20px;
139
- margin-bottom: 0px;
140
- vertical-align: middle;
141
- color: #AAAAAA;
142
- position: relative;
143
- }
144
- .ig-list-buttons li:hover label {
145
- color: #e23565;
146
- }
147
- .ig-list-buttons li:hover .check {
148
- border-color: #e23565;
149
- }
150
- .ig-list-buttons li .check {
151
- display: block;
152
- position: absolute;
153
- border: 5px solid #AAAAAA;
154
- border-radius: 50%;
155
- height: 25px;
156
- width: 25px;
157
- top: 5px;
158
- z-index: 5;
159
- -webkit-transition: border .25s linear;
160
- transition: border .25s linear;
161
- }
162
- .ig-list-buttons li .check::before {
163
- display: block;
164
- position: absolute;
165
- content: '';
166
- border-radius: 100%;
167
- height: 15px;
168
- width: 15px;
169
- top: 5px;
170
- left: 5px;
171
- margin: auto;
172
- -webkit-transition: background 0.25s linear;
173
- transition: background 0.25s linear;
174
- }
175
- .ig-list-buttons input[type=radio] {
176
- position: absolute;
177
- visibility: hidden;
178
- }
179
- .ig-list-buttons input[type=radio]:checked ~ .check {
180
- border-color: #e23565;
181
- }
182
- .ig-list-buttons input[type=radio]:checked ~ .check::before {
183
- background: #e23565;
184
- }
185
- .ig-list-buttons input[type=radio]:checked ~ label {
186
- color: #e23565;
187
- }
188
- .ig-list-buttons label {
189
- display: block;
190
- position: relative;
191
- font-size: 1.35em;
192
- padding: 10px 5px 10px 50px;
193
- z-index: 9;
194
- cursor: pointer;
195
- -webkit-transition: all 0.25s linear;
196
- transition: all 0.25s linear;
197
- }
198
- .btn-instagram-account {
199
- padding: 0 24px 0 120px;
200
- height: 44px;
201
- line-height: 44px;
202
- text-transform: uppercase;
203
- color: rgba(255, 255, 255, 0.8) !important;
204
- text-decoration: none;
205
- border-radius: 3px;
206
- transition: all 0.5s ease-in-out;
207
- font-weight: 600;
208
- display: inline-block;
209
- background: #408bd1 url(../img/instagram.png) no-repeat 16px 13.5px;
210
- background-size: auto 20px;
211
- }
212
- .btn-instagram-account:focus,
213
- .btn-instagram-account:hover {
214
- box-shadow: inset 0 0 20px 20px rgba(255, 255, 255, 0.2);
215
- }
216
- .btn-instagram,
217
- .btn-instagram:focus {
218
- display: inline-block;
219
- height: auto;
220
- box-shadow: none;
221
- text-shadow: none;
222
- border: 0;
223
- text-transform: uppercase;
224
- cursor: pointer;
225
- padding: 8px 24px;
226
- border-radius: 3px;
227
- transition: all .5s;
228
- text-decoration: none;
229
- background: #972dbe;
230
- color: #fff;
231
- font-size: 12px;
232
- font-weight: 600;
233
- }
234
- .btn-instagram:focus {
235
- background: #feb547;
236
- }
237
- .btn-instagram:hover {
238
- background: #feb547;
239
- color: #fff;
240
- }
241
- .btn-instagram .dashicons {
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;
259
- }
260
- .btn-instagram.secondary:focus {
261
- background: #feb547;
262
- color: #fff;
263
- }
264
- .btn-instagram.secondary:hover {
265
- background: #feb547;
266
- color: #fff;
267
- }
268
- .ig-tab-content-row {
269
- display: none;
270
- border-bottom: 1px solid #f1f1f1;
271
- }
272
- .ig-tab-content-row.active {
273
- display: table-row;
274
- }
275
- #ig-save-settings .insta-gallery-spinner {
276
- position: relative;
277
- height: 45px;
278
- width: 45px;
279
- }
280
- #ig-save-settings .insta-gallery-spinner .ig-spin {
281
- max-width: 100%;
282
- max-height: 100%;
283
- height: auto;
284
- width: auto;
285
- }
286
- /*# sourceMappingURL=qligg-admin.css.map */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/qligg-admin.min.css DELETED
@@ -1,2 +0,0 @@
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/{css → frontend/css}/qligg.css RENAMED
File without changes
assets/frontend/css/qligg.css.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["../../less/qligg.less"],"names":[],"mappings":"AAAA,gBAAgB;EACd;IACE,gBAAgB,cAAhB;;;AAGJ,mBAAmB;EACjB;IACE,mBAAmB,cAAnB;;;AAGJ,WAAW;EACT;IACE,mBAAmB,cAAnB;IACA,WAAW,cAAX;;;AAIJ;EACE,aAAa,OAAb;EACA,k0LAAA;EACA,m0LAAk0L,OAAO,ooLACzN,OAAO,muLACiG,OAAO,mqbAC67P,OAAO,MAHnqb;EAIA,mBAAA;EACA,kBAAA;;AAGF;AAAwB;;EAEtB,aAAa,OAAb;EACA,WAAA;EACA,kBAAA;EACA,mBAAA;EACA,oBAAA;EACA,oBAAA;EACA,cAAA;;EAGA,mCAAA;EACA,kCAAA;;AAGF,iBAAiB;EACf,SAAS,OAAT;;AAEF,mBAAmB;EACjB,SAAS,OAAT;;AAEF,mBAAmB;EACjB,SAAS,OAAT;;AAEF,kBAAkB;EAChB,SAAS,OAAT;;AAEF,mBAAmB;EACjB,SAAS,OAAT;;AAEF,mBAAmB;EACjB,SAAS,OAAT;;AAEF,iBAAiB;EACf,SAAS,OAAT;;AAEF,qBAAqB;EACnB,SAAS,OAAT;;AAEF,gBAAgB;EACd,SAAS,OAAT;;AAEF,kBAAkB;EAChB,SAAS,OAAT;;AAEF,gBAAgB;EACd,SAAS,OAAT;;AAEF,kBAAkB;EAChB,SAAS,OAAT;;AAEF,mBAAmB;EACjB,SAAS,OAAT;;AAEF,qBAAqB;EACnB,SAAS,OAAT;;AAEF,uBAAuB;EACrB,SAAS,OAAT;;AAGF;AA+rBA;EA9rBE,gDAAgD,gDAAhD;EACA,eAAA;EACA,cAAA;;AAGF,mBAKE;AALF,mBAME;AANF,mBAOE;EACE,UAAA;;AAGF,mBAAC,OAEC,oBAEE;EACE,wBAAA;EACA,UAAA;;AAEA,mBARL,OAEC,oBAEE,oBAIG,gBACC;EACE,oBAAA;EACA,UAAA;;AAXV,mBAAC,OAiBC;EACE,4BAAA;EACA,UAAA;;AA9BN,mBA+CE;EACE,kBAAA;EACA,YAAA;EACA,WAAA;EACA,uBAAA;EACA,qBAAA;EACA,4BAAA;EACA,4BAAA;EACA,64BAAA;;AAQA,mBAFF,oBAEG;EACC,SAAS,EAAT;EACA,cAAA;EACA,WAAA;;AAlEN,mBA6DE,oBAQE;EACE,gBAAA;EACA,cAAA;EACA,cAAA;;AAEA,mBAbJ,oBAQE,oBAKG;EACC,WAAA;;AAGF,mBAjBJ,oBAQE,oBASG;EACC,UAAA;;AAEA,mBApBN,oBAQE,oBASG,qBAGE;EACC,WAAA;;AAIJ,mBAzBJ,oBAQE,oBAiBG;EACC,cAAA;;AAEA,mBA5BN,oBAQE,oBAiBG,qBAGE;EACC,cAAA;;AAIJ,mBAjCJ,oBAQE,oBAyBG;EACC,UAAA;;AAEA,mBApCN,oBAQE,oBAyBG,qBAGE;EACC,UAAA;;AAIJ,mBAzCJ,oBAQE,oBAiCG;EACC,UAAA;;AAEA,mBA5CN,oBAQE,oBAiCG,qBAGE;EACC,UAAA;;AAIJ,mBAjDJ,oBAQE,oBAyCG;EACC,cAAA;;AAEA,mBApDN,oBAQE,oBAyCG,qBAGE;EACC,cAAA;;AAKJ,mBA1DJ,oBAQE,oBAkDG;EACC,cAAA;;AAEA,mBA7DN,oBAQE,oBAkDG,qBAGE;EACC,cAAA;;AAKJ,mBAnEJ,oBAQE,oBA2DG;EACC,YAAA;;AAEA,mBAtEN,oBAQE,oBA2DG,qBAGE;EACC,WAAA;;AAKJ,mBA5EJ,oBAQE,oBAoEG;EACC,cAAA;;AAEA,mBA/EN,oBAQE,oBAoEG,qBAGE;EACC,cAAA;;AAKJ,mBArFJ,oBAQE,oBA6EG;EACC,UAAA;;AAEA,mBAxFN,oBAQE,oBA6EG,sBAGE;EACC,UAAA;;AAIJ,mBA7FJ,oBAQE,oBAqFG;EACC,YAAA;;AAEA,mBAhGN,oBAQE,oBAqFG,sBAGE;EACC,aAAA;;AAIJ,mBArGJ,oBAQE,oBA6FG;EACC,YAAA;;AAEA,mBAxGN,oBAQE,oBA6FG,sBAGE;EACC,aAAA;;AAIJ,mBA7GJ,oBAQE,oBAqGG;EACC,aAAA;;AAEA,mBAhHN,oBAQE,oBAqGG,sBAGE;EACC,cAAA;;AAIJ,mBArHJ,oBAQE,oBA6GG;EACC,aAAA;;AAEA,mBAxHN,oBAQE,oBA6GG,sBAGE;EACC,cAAA;;AAIJ,mBA7HJ,oBAQE,oBAqHG;EACC,aAAA;;AAEA,mBAhIN,oBAQE,oBAqHG,sBAGE;EACC,cAAA;;AAIJ,mBArIJ,oBAQE,oBA6HG;EACC,YAAA;;AAEA,mBAxIN,oBAQE,oBA6HG,sBAGE;EACC,aAAA;;AAIJ,mBA7IJ,oBAQE,oBAqIG;EACC,aAAA;;AAEA,mBAhJN,oBAQE,oBAqIG,sBAGE;EACC,aAAA;;AAIJ,mBArJJ,oBAQE,oBA6IG;EACC,aAAA;;AAGF,mBAzJJ,oBAQE,oBAiJG;EACC,aAAA;;AAEA,mBA5JN,oBAQE,oBAiJG,sBAGE;EACC,aAAA;;AAKJ,mBAlKJ,oBAQE,oBA0JG;EACC,SAAA;;AAEA,mBArKN,oBAQE,oBA0JG,sBAGE;EACC,UAAA;;AAnOV,mBA6DE,oBAQE,oBAkKE;EACE,WAAA;EAEA,gBAAA;;AA1OR,mBA6DE,oBAQE,oBAwKE;AA7ON,mBA6DE,oBAQE,oBAyKE;EACE,mBAAA;;AA/OR,mBA6DE,oBAQE,oBA6KE;EACE,kBAAA;EACA,UAAA;EACA,eAAA;EACA,WAAA;EACA,YAAA;EACA,MAAA;EACA,YAAA;EACA,QAAA;EACA,wCAAA;EACA,cAAA;EACA,qBAAA;;AAEA,mBAlMN,oBAQE,oBA6KE,oBAaG;EACC,QAAA;EACA,SAAA;EACA,4BAAA;EACA,eAAA;EACA,WAAA;EACA,YAAA;;AAGF,mBA3MN,oBAQE,oBA6KE,oBAsBG;EACC,SAAA;EACA,SAAA;EACA,UAAA;EACA,oBAAA;;AA5QV,mBA6DE,oBAQE,oBA2ME;EACE,sBAAA;EAEA,gBAAA;EACA,cAAA;;AApRR,mBA6DE,oBAQE,oBA2ME,0BAOE;AAvRR,mBA6DE,oBAQE,oBA2ME,0BAQE;EACE,cAAA;EACA,WAAA;EACA,SAAA;EACA,cAAA;;AA5RV,mBA6DE,oBAQE,oBA2ME,0BAeE,cAGE;AAlSV,mBA6DE,oBAQE,oBA2ME,0BAgBE,kBAEE;AAlSV,mBA6DE,oBAQE,oBA2ME,0BAiBE,eACE;EACE,iBAAA;;AAnSZ,mBA6DE,oBAQE,oBA2ME,0BAuBE;EACE,4CAAA;EACA,gBAAA;;AAzSV,mBA6DE,oBAQE,oBA2ME,0BAuBE,cAIE;EACE,SAAA;EACA,yBAAA;EAGA,YAAA;EACA,YAAA;;AAjTZ,mBA6DE,oBAQE,oBA2ME,0BAuBE,cAaE;AApTV,mBA6DE,oBAQE,oBA2ME,0BAuBE,cAcE;AArTV,mBA6DE,oBAQE,oBA2ME,0BAuBE,cAeE;EACE,qBAAA;EACA,mBAAA;;AAxTZ,mBA6DE,oBAQE,oBAwPE;EACE,cAAA;EACA,kBAAA;EACA,kBAAA;EACA,sBAAA;EACA,eAAA;;AAlUR,mBA6DE,oBAQE,oBAwPE,0BAOE;EACE,WAAA;EACA,YAAA;EACA,gBAAA;EACA,sBAAA;;AAxUV,mBA6DE,oBAQE,oBAwPE,0BAcE;EACE,kBAAA;EACA,SAAS,EAAT;EACA,MAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;EACA,UAAA;EACA,6BAAA;EACA,UAAA;EACA,mCAAA;EACA,WAAA;EACA,YAAA;;AAvVV,mBA6DE,oBAQE,oBAwPE,0BA6BE;EACE,kBAAA;EACA,QAAA;EACA,SAAA;EACA,QAAA;EACA,mBAAA;EACA,UAAA;EACA,WAAA;EACA,WAAA;EACA,wBAAA;EACA,UAAA;EACA,iBAAA;EACA,eAAA;EACA,kBAAA;;AAvWV,mBA6DE,oBAQE,oBAwPE,0BA6BE,kCAeE;EACE,cAAA;EACA,eAAA;EACA,gBAAA;EACA,sBAAA;EACA,iBAAA;;AA9WZ,mBA6DE,oBAQE,oBAwPE,0BA6BE,kCAeE,OAOE;EACE,eAAA;EACA,iBAAA;;AAOJ,mBA5TR,oBAQE,oBAkTG,MACC,oBACG;EACC,YAAA;EACA,mBAAA;EACA,WAAA;;AACA,mBAhUV,oBAQE,oBAkTG,MACC,oBACG,qBAIE;EACC,UAAA;;AAGJ,mBApUR,oBAQE,oBAkTG,MACC,oBASG;AACD,mBArUR,oBAQE,oBAkTG,MACC,oBAUG;EACC,UAAA;EACA,oBAAA;;AAbN,mBA1TJ,oBAQE,oBAkTG,MAiBC,0BAEE;EACE,UAAA;;AApBN,mBA1TJ,oBAQE,oBAkTG,MAiBC,0BAME;EACE,UAAA;EACA,6BAAA;;AAhZZ,mBA2ZE;EACE,WAAA;EACA,cAAA;;AAEA,mBAJF;AA3ZF,mBA2ZE,uBAKE;AAhaJ,mBA2ZE,uBAME;EACE,YAAA;EACA,aAAA;EACA,mBAAA;;AApaN,mBA2ZE,uBAYE;EACE,YAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,mBAAA;;AA5aN,mBA2ZE,uBAoBE;EACE,kBAAA;;AAhbN,mBA2ZE,uBAwBE;AAnbJ,mBA2ZE,uBAyBE;AApbJ,mBA2ZE,uBA0BE;EACE,SAAA;EACA,UAAA;EACA,qBAAA;EACA,gBAAA;EACA,eAAA;EACA,cAAA;EACA,qBAAA;EACA,sBAAA;EACA,iBAAA;;AA9bN,mBA2ZE,uBAsCE;EACE,cAAA;EACA,gBAAA;EACA,iBAAA;;AApcN,mBA2ZE,uBA4CE;EACE,cAAA;;AACA,mBA9CJ,uBA4CE,QAEG;EACC,cAAA;;AA1cR,mBA2ZE,uBAmDE;EACE,iBAAA;EACA,eAAA;EACA,gBAAA;;AAjdN,mBAydE;EACE,kBAAA;EACA,gBAAA;;AA3dJ,mBAydE,uBAIE;EACE,qBAAA;EACA,aAAA;EACA,eAAA;EACA,kBAAA;EACA,mBAAA;EACA,qBAAA;EACA,kBAAA;EACA,yBAAA;EACA,WAAA;;AAteN,mBAydE,uBAIE,sBAWE;EACE,iBAAA;EACA,eAAA;;AAGF,mBApBJ,uBAIE,sBAgBG;AACC,mBArBN,uBAIE,sBAiBK;EACD,wDAAA;;AAGF,mBAzBJ,uBAIE,sBAqBG;EACC,yBAAA;;AAGF,mBA7BJ,uBAIE,sBAyBG;EACC,yBAAA;;AASN,mBAAC,qBAEC,oBAEE;EACE,aAAA;EACA,uBAAA;EACA,oBAAA;EACA,sBAAA;;AARN,mBAAC,qBAEC,oBAEE,oBAME;EACE,aAAA;EACA,uBAAA;EACA,mBAAA;EAEA,gBAAA;EACA,WAAA;EACA,iBAAA;;AAjBR,mBAAC,qBAEC,oBAEE,oBAME,0BASE;EACE,gBAAA;;AApBV,mBAAC,qBAEC,oBAEE,oBAME,0BAaE;EACE,gBAAA;EACA,iBAAA;EACA,WAAA;EACA,YAAA;EAEA,kBAAA;EACA,MAAA;EACA,SAAA;EACA,QAAA;EACA,OAAA;;AAUV,mBAAC;EACC,gBAAA;;AADF,mBAAC,2BAGC;EACE,aAAA;;AAJJ,mBAAC,2BAQC;AARF,mBAAC,2BASC;EACE,mBAAA;EACA,gBAAA;EACA,MAAA;EACA,SAAA;EACA,YAAA;EACA,SAAA;EACA,uBAAA;EACA,WAAA;EACA,aAAA;EACA,mBAAA;;AAnBJ,mBAAC,2BAQC,oBAaE;AArBJ,mBAAC,2BASC,oBAYE;EACE,kBAAA;EACA,cAAA;EACA,WAAA;EACA,eAAA;;AAGF,mBA5BH,2BAQC,oBAoBG;AAAD,mBA5BH,2BASC,oBAmBG;EACC,oCAAA;;AA7BN,mBAAC,2BAkCC;EACE,OAAA;;AAnCJ,mBAAC,2BAsCC;EACE,QAAA;;AAvCJ,mBAAC,2BA0CC;EACE,yBAAA;;AAQJ,mBAAC,0BAEC;EACE,aAAA;EACA,eAAA;EAEA,sBAAA;EACA,gBAAA;;AAeE,mBAAsC,wBAAuB;EA6YrE,mBApZG,0BAGC,oBAEE;EA+YN,mBAnZG,0BAEC,oBAEE;IAGI,kBAAA;;;AAGF,mBAAqC;EAyY7C,mBApZG,0BAGC,oBAEE;EA+YN,mBAnZG,0BAEC,oBAEE;IAOI,kBAAA;;;AAEF,mBAAqC;EAsY7C,mBApZG,0BAGC,oBAEE;EA+YN,mBAnZG,0BAEC,oBAEE;IAUI,cAAA;;;AASR,mBAAC,0BAEC,oBAEE;EACE,kBAAA;;AAUR;EACE,yBAAA;EACA,aAAA;EACA,WAAA;EACA,kBAAA;EACA,kBAAA;EACA,WAAA;EACA,cAAA;;AAEA,oBAAC;AACD,oBAAC;EACC,SAAS,GAAT;EACA,cAAA;;AAGF,oBAAC;EACC,WAAA;;AAhBJ,oBAkBE;EACE,YAAA;;AAnBJ,oBAsBE;EACE,UAAA;EACA,SAAA;;AAxBJ,oBA2BE;EACE,kCAAA;EACA,yBAAA;EACA,wBAAA;;AAOJ,eAIE;EACE,aAAa,OAAb;EACA,WAAA;EACA,kBAAA;EACA,oBAAA;EACA,oBAAA;EACA,cAAA;EACA,mCAAA;EACA,kCAAA;EACA,eAAA;EACA,iBAAA;;AAEA,eAZF,WAYG;EACC,aAAA;;AAGF,eAhBF,WAgBG;EACC,YAAA;;AAIA,eArBJ,WAoBG,eACE;EACC,SAAS,OAAT;;AAKF,eA3BJ,WA0BG,gBACE;EACC,SAAS,OAAT;;AAhCR,eAqCE;EAEE,yBAAA;;AAvCJ,eAqCE,eAIE;EACE,eAAA;EACA,SAAA;EACA,WAAA;EACA,WAAA;EACA,mBAAA;EACA,eAAA;EACA,SAAA;EACA,YAAA;EACA,cAAA;EACA,yBAAA;EACA,eAAA;EACA,SAAS,OAAT;;AArDN,eAqCE,eAmBE;EACE,WAAA;EACA,cAAA;EACA,cAAA;;AAGE,eAzBN,eAmBE,aAKE;AA7DN,eAqCE,eAmBE,aAKE,YAEE;AA/DR,eAqCE,eAmBE,aAKE,YAGE;EACE,0BAAA;EACA,yBAAA;;AAlEV,eAqCE,eAmBE,aAcE;EACE,UAAA;;AAvER,eAqCE,eAmBE,aAkBE;EACE,kBAAA;EACA,UAAA;EACA,0BAAA;EACA,kBAAA;;AAEA,eA3CN,eAmBE,aAkBE,YAMG;EACC,aAAA;;AAGF,eA/CN,eAmBE,aAkBE,YAUG;EACC,mBAAA;;AADF,eA/CN,eAmBE,aAkBE,YAUG,KAEC;EACE,4BAAA;EACA,MAAA;EACA,SAAA;EACA,OAAA;;AAIJ,eAzDN,eAmBE,aAkBE,YAoBG;EACC,oBAAA;;AADF,eAzDN,eAmBE,aAkBE,YAoBG,MAEC;EACE,2BAAA;EACA,MAAA;EACA,SAAA;EACA,QAAA;;AAIJ,eAnEN,eAmBE,aAkBE,YA8BG,KAEC;AADF,eApEN,eAmBE,aAkBE,YA+BG,MACC;EACE,YAAA;;AAIJ,eA1EN,eAmBE,aAkBE,YAqCG,IAEC;AADF,eA3EN,eAmBE,aAkBE,YAsCG,OACC;EACE,OAAA;EACA,QAAA;EACA,gBAAA;EACA,kBAAA;EACA,WAAA;EACA,gBAAA;EACA,iBAAA;;AAIJ,eAvFN,eAmBE,aAkBE,YAkDG;EACC,oBAAA;;AADF,eAvFN,eAmBE,aAkBE,YAkDG,OAEC;EACE,0BAAA;EACA,SAAA;;AAIJ,eA/FN,eAmBE,aAkBE,YA0DG;EACC,iBAAA;;AADF,eA/FN,eAmBE,aAkBE,YA0DG,IAEC;EACE,6BAAA;EACA,MAAA;;AAxIZ,eAqCE,eAmBE,aAqFE;EACE,SAAA;EACA,YAAA;EACA,WAAA;EACA,UAAA;EACA,sBAAA;EACA,SAAA;EACA,UAAA;EACA,gBAAA;EACA,gBAAA;;AAtJR,eAqCE,eAmBE,aAqFE,gBAWE;EACE,eAAA;EACA,gBAAA;EACA,cAAA;EACA,UAAA;;AA5JV,eAqCE,eAmBE,aAqFE,gBAWE,WAME;EACE,iBAAA;EACA,cAAA;;AAEA,eA7HV,eAmBE,aAqFE,gBAWE,WAME,EAIG;EACC,cAAA;;AAnKd,eAqCE,eAmBE,aAqFE,gBAWE,WAgBE;AAxKV,eAqCE,eAmBE,aAqFE,gBAWE,WAiBE;AAzKV,eAqCE,eAmBE,aAqFE,gBAWE,WAkBE;AA1KV,eAqCE,eAmBE,aAqFE,gBAWE,WAmBE;EACE,cAAA;EACA,WAAA;EACA,SAAA;EACA,aAAA;;AA/KZ,eAqCE,eAmBE,aAqFE,gBAWE,WA0BE;EACE,cAAA;EACA,iBAAA;EACA,mBAAA;;AArLZ,eAqCE,eAmBE,aAqFE,gBAWE,WAgCE,WACE;AAzLZ,eAqCE,eAmBE,aAqFE,gBAWE,WAgCE,WAEE;EACE,iBAAA;EACA,qBAAA;EACA,eAAA;EACA,gBAAA;EACA,WAAA;EACA,kBAAA;EACA,cAAA;;AAKA,eAjKZ,eAmBE,aAqFE,gBAWE,WAgCE,WAYE,UAEG;EACC,cAAA;;AAvMhB,eAqCE,eAmBE,aAqFE,gBAWE,WAoDE,UAGE;AA/MZ,eAqCE,eAmBE,aAqFE,gBAWE,WAqDE,cAEE;AA/MZ,eAqCE,eAmBE,aAqFE,gBAWE,WAsDE,WACE;EACE,mBAAA;EAEA,iBAAA;;AAlNd,eAqCE,eAmBE,aAqFE,gBAWE,WAgEE;EACE,0BAAA;;AAzNZ,eAqCE,eAmBE,aAqFE,gBAWE,WAgEE,UAGE;EACE,yBAAA;EACA,eAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,YAAA;;AAjOd,eAqCE,eAmBE,aAqFE,gBAWE,WAgEE,UAYE;AApOZ,eAqCE,eAmBE,aAqFE,gBAWE,WAgEE,UAaE;AArOZ,eAqCE,eAmBE,aAqFE,gBAWE,WAgEE,UAcE;EACE,qBAAA;EACA,mBAAA;;AAxOd,eAqCE,eAmBE,aAqFE,gBAWE,WAoFE;EACE,aAAA;EACA,mBAAA;EACA,6BAAA;EACA,WAAA;;AAhPZ,eAqCE,eAmBE,aAqFE,gBAWE,WAoFE,UAME;EACE,YAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;EACA,mBAAA;;AAvPd,eAqCE,eAmBE,aAqFE,gBAWE,WAoFE,UAcE;EACE,SAAA;EACA,UAAA;EACA,qBAAA;EACA,eAAA;;AAed,cACE;EACE,aAAA;;AAFJ,cAIE,mBACE;EAQE,kBAAA;EACA,WAAA;;AANI,cAJR,mBACE,oBACE,0BACG,MACE;EACC,gBAAA;;AATZ,cAiBE;EACE,aAAA;;AAlBJ,cAoBE;EACE,aAAA;;AAOJ,cACE;EACE,aAAA;;AAFJ,cAIE,mBACE;EACE,kBAAA;EACA,WAAA;;AAPN,cAUE;EACE,aAAA;;AAXJ,cAaE;EACE,aAAA;;AAIJ,oBACE,mBACE;EACE,UAAA;EACA,WAAA;;AAEF,oBALF,mBAKG;EACC,WAAA;EACA,cAAA;EACA,SAAS,EAAT","file":"qligg.css"}
assets/{css → frontend/css}/qligg.min.css RENAMED
File without changes
assets/{js → frontend/js}/qligg.js RENAMED
@@ -9,7 +9,7 @@
9
 
10
  var $wrap = $('.insta-gallery-list', $item),
11
  $spinner = $('.insta-gallery-spinner', $item),
12
- options = $item.data('feed');
13
 
14
  $.ajax({
15
  url: qligg.ajax_url,
@@ -18,7 +18,7 @@
18
  data: {
19
  action: 'qligg_load_item_images',
20
  next_max_id: next_max_id,
21
- feed: options
22
  },
23
  beforeSend: function () {
24
  $spinner.show();
@@ -127,7 +127,8 @@
127
  var $item = $(e.delegateTarget),
128
  $swiper = $('.swiper-container', $item),
129
  options = $item.data('feed');
130
-
 
131
  swiper_index++;
132
 
133
  $swipers[swiper_index] = new Swiper($swiper, {
@@ -139,9 +140,9 @@
139
  observer: true,
140
  observeParents: true,
141
  spaceBetween: parseInt(options.spacing),
142
- slidesPerView: parseInt(options.carousel.slides),
143
  autoplay: options.carousel.autoplay ? {
144
- delay: parseInt(options.carousel.interval),
145
  } : false,
146
  pagination: {
147
  el: '.swiper-pagination',
@@ -198,9 +199,9 @@
198
  $item.addClass('loaded');
199
 
200
  $(items).each(function (i, item) {
201
- setTimeout(function () {
202
  $(item.element).addClass('ig-image-loaded');
203
- }, 500 + (i * 50));
204
 
205
  });
206
  });
@@ -228,6 +229,8 @@
228
  if (!options.popup.display) {
229
  return;
230
  }
 
 
231
 
232
  $('.insta-gallery-item', $wrap).magnificPopup({
233
  type: 'inline',
9
 
10
  var $wrap = $('.insta-gallery-list', $item),
11
  $spinner = $('.insta-gallery-spinner', $item),
12
+ feed = $item.data('feed');
13
 
14
  $.ajax({
15
  url: qligg.ajax_url,
18
  data: {
19
  action: 'qligg_load_item_images',
20
  next_max_id: next_max_id,
21
+ feed: JSON.stringify(feed)
22
  },
23
  beforeSend: function () {
24
  $spinner.show();
127
  var $item = $(e.delegateTarget),
128
  $swiper = $('.swiper-container', $item),
129
  options = $item.data('feed');
130
+ options.carousel.slides = options.carousel.slidespv;
131
+ /// options.carousel.interval = options.carousel.autoplay_interval;
132
  swiper_index++;
133
 
134
  $swipers[swiper_index] = new Swiper($swiper, {
140
  observer: true,
141
  observeParents: true,
142
  spaceBetween: parseInt(options.spacing),
143
+ slidesPerView: parseInt(options.carousel.slidespv),
144
  autoplay: options.carousel.autoplay ? {
145
+ delay: parseInt(options.carousel.autoplay_interval),
146
  } : false,
147
  pagination: {
148
  el: '.swiper-pagination',
199
  $item.addClass('loaded');
200
 
201
  $(items).each(function (i, item) {
202
+ // setTimeout(function () {
203
  $(item.element).addClass('ig-image-loaded');
204
+ // }, 500 + (i * 50));
205
 
206
  });
207
  });
229
  if (!options.popup.display) {
230
  return;
231
  }
232
+
233
+ console.log('options', options);
234
 
235
  $('.insta-gallery-item', $wrap).magnificPopup({
236
  type: 'inline',
assets/frontend/js/qligg.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+
2
+ (function(c){var b=0,d={};function a(f,h){var e=c(".insta-gallery-list",f),g=c(".insta-gallery-spinner",f),i=f.data("feed");c.ajax({url:qligg.ajax_url,type:"post",timeout:30000,data:{action:"qligg_load_item_images",next_max_id:h,feed:JSON.stringify(i)},beforeSend:function(){g.show()},success:function(j){if(j.success!==true){e.append(c(j.data));g.hide();return}var k=c(j.data);e.append(k).trigger("qligg.loaded",[k])},complete:function(){},error:function(j,k){g.hide();console.log(k)}})}c(".insta-gallery-feed").on("qligg.loaded",function(i,j){var l=c(i.delegateTarget),n=c(".insta-gallery-list",l),g=c(".insta-gallery-spinner",l),f=c(".insta-gallery-button.load",l),m=l.data("feed"),k=c(j).length,h=0;if(k){n.find(".insta-gallery-image").load(function(o){h++;if(h>=k){n.trigger("qligg.imagesLoaded",[j])}})}if(k<m.limit){g.hide();setTimeout(function(){f.fadeOut()},300)}});c(".insta-gallery-feed").on("qligg.imagesLoaded",function(h){var f=c(h.delegateTarget),g=c(".insta-gallery-spinner",f);g.hide()});c(".insta-gallery-feed[data-feed_layout=gallery]").on("qligg.imagesLoaded",function(h,f){var g=c(h.delegateTarget);g.addClass("loaded");c(f).each(function(e,j){setTimeout(function(){c(j).addClass("ig-image-loaded")},150+(e*30))})});c(".insta-gallery-feed[data-feed_layout=carousel]").on("qligg.imagesLoaded",function(h,f){var g=c(h.delegateTarget);g.addClass("loaded");c(f).each(function(e,j){c(j).addClass("ig-image-loaded")})});c(".insta-gallery-feed[data-feed_layout=carousel]").on("qligg.imagesLoaded",function(j,f){var g=c(j.delegateTarget),i=c(".swiper-container",g),h=g.data("feed");h.carousel.slides=h.carousel.slidespv;b++;d[b]=new Swiper(i,{loop:true,autoHeight:true,observer:true,observeParents:true,spaceBetween:parseInt(h.spacing),slidesPerView:parseInt(h.carousel.slidespv),autoplay:h.carousel.autoplay?{delay:parseInt(h.carousel.autoplay_interval),}:false,pagination:{el:".swiper-pagination",dynamicBullets:true,clickable:true,type:"bullets",},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev",},breakpoints:{420:{slidesPerView:1,spaceBetween:2,},767:{slidesPerView:Math.min(2,h.carousel.slides)},1023:{slidesPerView:Math.min(3,h.carousel.slides)}}})});c(".insta-gallery-feed[data-feed_layout=masonry]").on("qligg.imagesLoaded",function(i,f){var h=c(i.delegateTarget),g=c(".insta-gallery-list",h);if(!g.data("masonry")){g.masonry({itemSelector:".insta-gallery-item",isResizable:true,isAnimated:false,transitionDuration:0,percentPosition:true,columnWidth:".insta-gallery-item:last-child"})}else{g.masonry("appended",f,false)}});c(".insta-gallery-feed[data-feed_layout=masonry]").on("layoutComplete",function(h,g){var f=c(h.delegateTarget);f.addClass("loaded");c(g).each(function(e,j){c(j.element).addClass("ig-image-loaded")})});c(".insta-gallery-feed").on("qligg.loaded",function(i){var g=c(i.delegateTarget),f=c(".insta-gallery-list",g),h=g.data("feed");c(".insta-gallery-item .insta-gallery-icon.qligg-icon-instagram",f).on("click",function(j){j.stopPropagation()});if(!h.popup.display){return}console.log("options",h);c(".insta-gallery-item",f).magnificPopup({type:"inline",callbacks:{beforeOpen:function(){this.st.mainClass=this.st.mainClass+" qligg-mfp-wrap"},elementParse:function(m){var n="",l="",e="",k="",j="";n='<img src="'+m.el.data("item").images.standard+'"/>';e='<div class="mfp-icons"><div class="mfp-counter">'+(m.index+1)+" / "+c(".insta-gallery-item",f).length+'</div><a class="mfp-link" href="'+m.el.data("item").link+'" target="_blank" rel="noopener"><i class="qligg-icon-instagram"></i>Instagram</a></div>';if(h.popup.profile){l='<div class="mfp-user"><img src="'+h.profile.picture+'"><a href="'+h.profile.link+'" title="'+h.profile.name+'" target="_blank" rel="noopener">'+h.profile.user+"</a></div>"}if(h.popup.caption){k='<div class="mfp-caption">'+m.el.data("item").caption+"</div>"}if(h.popup.likes){j='<div class="mfp-info"><div class="mfp-likes"><i class="qligg-icon-heart"></i>'+m.el.data("item").likes+'</div><div class="mfp-comments"><i class="qligg-icon-comment"></i>'+m.el.data("item").comments+'</div><div class="mfp-date">'+m.el.data("item").date+"</div></div>"}m.src='<div class="mfp-figure '+h.popup.align+'">'+n+'<div class="mfp-close"></div><div class="mfp-bottom-bar"><div class="mfp-title">'+l+e+k+j+"</div></div></div>"}},gallery:{enabled:true}})});c(".insta-gallery-feed").on("click",".insta-gallery-button.load",function(h){h.preventDefault();var f=c(h.delegateTarget);if(!f.hasClass("loaded")){return false}var g=c(".insta-gallery-list .insta-gallery-item:last-child",f).data("item").i;a(f,g)});c(".insta-gallery-feed").each(function(f,g){var e=c(g);if(e.hasClass("loaded")){return false}a(e,0)});if(navigator.appVersion.indexOf("MSIE 8.")!=-1){document.body.className+=" instagal-ie-8"}if(navigator.appVersion.indexOf("MSIE 9.")!=-1){document.body.className+=" instagal-ie-9"}})(jQuery);
assets/{magnific-popup → frontend/magnific-popup}/jquery.magnific-popup.min.js RENAMED
File without changes
assets/{magnific-popup → frontend/magnific-popup}/magnific-popup.css RENAMED
File without changes
assets/{magnific-popup → frontend/magnific-popup}/magnific-popup.min.css RENAMED
File without changes
assets/{masonry → frontend/masonry}/masonry.pkgd.min.js RENAMED
File without changes
assets/{swiper → frontend/swiper}/swiper.min.css RENAMED
File without changes
assets/{swiper → frontend/swiper}/swiper.min.js RENAMED
File without changes
assets/{swiper → frontend/swiper}/swiper.min.js.map RENAMED
File without changes
assets/js/qligg-admin.js DELETED
@@ -1,537 +0,0 @@
1
- (function ($) {
2
-
3
- $.fn.serializeArrayAll = function () {
4
- var o = {};
5
- var a = this.serializeArray();
6
- $.each(a, function () {
7
- if (o[this.name] !== undefined) {
8
- if (!o[this.name].push) {
9
- o[this.name] = [o[this.name]];
10
- }
11
- o[this.name].push(this.value || '');
12
- } else {
13
- o[this.name] = this.value || '';
14
- }
15
- });
16
- var $radio = $('input[type=radio],input[type=checkbox]', this);
17
- $.each($radio, function () {
18
- if (!o.hasOwnProperty(this.name)) {
19
- o[this.name] = '';
20
- }
21
- });
22
- return o;
23
- };
24
-
25
- // Toggles
26
- // ---------------------------------------------------------------------------
27
-
28
- $('.ig-list-images > li').on('click', function (e) {
29
- $(this).addClass('active');
30
- $(this).siblings().removeClass('active');
31
- $(this).find('input[type=radio]').prop('checked', true).trigger('change');
32
- $(this).siblings().find('input[type=radio]').prop('checked', false);
33
- });
34
-
35
- $('input[name=insta_source]').on('change', function (e) {
36
- if (this.value == 'username') {
37
- $('#ig-select-tag-wrap').hide(500, function (e) {
38
- $('#ig-select-username-wrap').show().addClass('active');
39
- }).removeClass('active');
40
- } else {
41
- $('#ig-select-username-wrap').hide(500, function (e) {
42
- $('#ig-select-tag-wrap').show().addClass('active');
43
- }).removeClass('active');
44
- }
45
- });
46
-
47
- $('input[name=insta_box]').on('change', function (e) {
48
- if (this.checked) {
49
- $('#ig-section-box').show('slow').addClass('active');
50
- } else {
51
- $('#ig-section-box').hide('slow').removeClass('active');
52
- }
53
- });
54
-
55
- $('input[name=insta_layout]').on('change', function (e) {
56
- if (this.value == 'carousel') {
57
- $('#ig-section-gallery, #ig-section-masonry').hide(500, function (e) {
58
- $('#ig-section-carousel').show().addClass('active');
59
- }).removeClass('active');
60
- } else if (this.value == 'gallery') {
61
- $('#ig-section-carousel, #ig-section-masonry').hide(500, function (e) {
62
- $('#ig-section-gallery').show().addClass('active');
63
- }).removeClass('active');
64
- } else {
65
- $('#ig-section-carousel').hide(500, function (e) {
66
- $('#ig-section-masonry').show().addClass('active');
67
- $('#ig-section-gallery').show().addClass('active');
68
- }).removeClass('active');
69
- }
70
- });
71
-
72
- $('input[name=insta_button]').on('change', function (e) {
73
- if (this.checked) {
74
- $('#ig-section-button').show('slow').addClass('active');
75
- } else {
76
- $('#ig-section-button').hide('slow').removeClass('active');
77
- }
78
- });
79
-
80
- $('input[name=insta_button_load]').on('change', function (e) {
81
- if (this.checked) {
82
- $('#ig-section-button_load').show('slow').addClass('active');
83
- } else {
84
- $('#ig-section-button_load').hide('slow').removeClass('active');
85
- }
86
- });
87
-
88
- $('input[name=insta_hover]').on('change', function (e) {
89
- if (this.checked) {
90
- $('#ig-section-hover').show('slow').addClass('active');
91
- } else {
92
- $('#ig-section-hover').hide('slow').removeClass('active');
93
- }
94
- });
95
-
96
- $('input[name=insta_popup]').on('change', function (e) {
97
- if (this.checked) {
98
- $('#ig-section-popup').show('slow').addClass('active');
99
- } else {
100
- $('#ig-section-popup').hide('slow').removeClass('active');
101
- }
102
- });
103
-
104
- $('input[name=insta_card]').on('change', function (e) {
105
- if (this.checked) {
106
- $('#ig-section-card').show('slow').addClass('active');
107
- } else {
108
- $('#ig-section-card').hide('slow').removeClass('active');
109
- }
110
- });
111
-
112
- // Spinner
113
- // -------------------------------------------------------------------------
114
-
115
- function ig_change_spinner(link) {
116
- if (link) {
117
- if (!$('#ig-save-settings .insta-gallery-spinner img').length) {
118
- var img = '<img src="' + link + '" class="ig-spin" />';
119
- $('#ig-save-settings .insta-gallery-spinner').append(img);
120
- } else {
121
- $('#ig-save-settings .insta-gallery-spinner img').attr('src', link);
122
- }
123
- $('#ig-save-settings .insta-gallery-spinner .ig-spin').hide();
124
- $('#ig-save-settings .insta-gallery-spinner img').show();
125
- } else {
126
- $('#ig-save-settings .insta-gallery-spinner .ig-spin').show();
127
- $('#ig-save-settings .insta-gallery-spinner img').remove();
128
- }
129
-
130
- }
131
-
132
- var $igs_image_id = $('input[name=insta_spinner_image_id]'),
133
- $igs_reset = $('#ig-spinner-reset');
134
-
135
- $('#ig-save-settings').on('submit', function (e) {
136
- e.preventDefault();
137
-
138
- var $form = $(this),
139
- $spinner = $form.find('.spinner');
140
-
141
- $.ajax({
142
- url: ajaxurl,
143
- type: 'post',
144
- dataType: 'JSON',
145
- data: $.param($form.serializeArrayAll()) + '&' + $.param({action: 'qligg_save_settings'}),
146
- beforeSend: function () {
147
- $spinner.addClass('is-active');
148
- },
149
- success: function (response) {
150
- if (response.success) {
151
- window.location.reload();
152
- }
153
- },
154
- complete: function () {
155
- $spinner.removeClass('is-active');
156
- },
157
- error: function (jqXHR, textStatus) {
158
- console.log(textStatus);
159
- }
160
- });
161
- });
162
-
163
- // reset spinner to default
164
- $igs_reset.click(function () {
165
- $igs_image_id.val('');
166
- ig_change_spinner();
167
- $(this).hide();
168
- });
169
-
170
- if ($igs_image_id.val() == '')
171
- $igs_reset.hide();
172
- if ($igs_image_id.data('misrc') != '')
173
- ig_change_spinner($igs_image_id.data('misrc'));
174
-
175
- // select media image
176
- $('#ig-spinner-upload').click(function (e) {
177
- e.preventDefault();
178
- var image_frame;
179
-
180
- if (image_frame) {
181
- image_frame.open();
182
- }
183
- // Define image_frame as wp.media object
184
- image_frame = wp.media({
185
- title: 'Select Media',
186
- multiple: false,
187
- library: {
188
- type: 'image',
189
- }
190
- });
191
-
192
- image_frame.on('close', function () {
193
- // On close, get selections and save to the hidden input
194
- // plus other AJAX stuff to refresh the image preview
195
- var selection = image_frame.state().get('selection');
196
-
197
- if (selection.length) {
198
-
199
- var gallery_ids = new Array();
200
- var i = 0, attachment_url;
201
-
202
- selection.each(function (attachment) {
203
- gallery_ids[i] = attachment['id'];
204
- attachment_url = attachment.attributes.url;
205
- i++;
206
- });
207
- var ids = gallery_ids.join(",");
208
- $igs_image_id.val(ids);
209
- ig_change_spinner(attachment_url)
210
- }
211
-
212
- // toggle reset button
213
- if ($igs_image_id.val() == '') {
214
- $igs_reset.hide();
215
- } else {
216
- $igs_reset.show();
217
- }
218
-
219
- });
220
-
221
- image_frame.on('open', function () {
222
- // On open, get the id from the hidden input
223
- // and select the appropiate images in the media manager
224
- var selection = image_frame.state().get('selection');
225
- var ids = $igs_image_id.val().split(',');
226
-
227
- ids.forEach(function (id) {
228
- attachment = wp.media.attachment(id);
229
- attachment.fetch();
230
- selection.add(attachment ? [attachment] : []);
231
- });
232
-
233
- });
234
-
235
- image_frame.open();
236
- });
237
-
238
- // Actions
239
- // ---------------------------------------------------------------------------
240
-
241
- $(document).on('click', '[data-qligg-toggle]', function (e) {
242
- e.preventDefault();
243
-
244
- $($(this).data('qligg-toggle')).slideToggle();
245
-
246
- });
247
-
248
- $(document).on('click', '[data-qligg-copy]', function (e) {
249
- e.preventDefault();
250
-
251
- $($(this).data('qligg-copy')).select();
252
- document.execCommand('copy');
253
-
254
- });
255
-
256
- $('#ig-remove-data').on('click', function (e) {
257
-
258
- var checked = $(this).is(':checked');
259
-
260
- if (checked) {
261
-
262
- var c = confirm(qligg.remove_data);
263
-
264
- if (!c) {
265
- return false;
266
- }
267
-
268
- }
269
-
270
- });
271
-
272
- // Generate token
273
- // ---------------------------------------------------------------------------
274
- $(document).on('ready', function (e) {
275
-
276
- var hash = window.location.hash,
277
- access_token = hash.substring(14);
278
-
279
- if (access_token.length > 40) {
280
-
281
- var $button = $('#ig-generate-token').find('.btn-instagram'),
282
- $spinner = $('#ig-generate-token').find('.spinner');
283
-
284
- $.ajax({
285
- url: ajaxurl,
286
- type: 'post',
287
- data: {
288
- action: 'qligg_generate_token',
289
- ig_access_token: access_token,
290
- ig_nonce: qligg.nonce
291
- },
292
- beforeSend: function () {
293
- $button.css({'opacity': '.5', 'pointer-events': 'none'});
294
- $spinner.addClass('is-active');
295
- },
296
- success: function (response) {
297
- if (response.success) {
298
- setTimeout(function () {
299
- window.location.reload();
300
- }, 300);
301
- } else {
302
- alert(response.data);
303
- }
304
- },
305
- complete: function () {
306
- $button.removeAttr('style');
307
- $spinner.removeClass('is-active');
308
- window.location.hash = '';
309
- window.location.href.split('#')[0]
310
- },
311
- error: function (jqXHR, textStatus) {
312
- console.log(textStatus);
313
- }
314
- });
315
-
316
- }
317
-
318
- });
319
-
320
- // Update token
321
- // -------------------------------------------------------------------------
322
-
323
- $('#ig-update-token').on('submit', function (e) {
324
- e.preventDefault();
325
-
326
- var $form = $(this),
327
- $spinner = $form.find('.spinner');
328
-
329
- $.ajax({
330
- url: ajaxurl,
331
- type: 'post',
332
- data: {
333
- action: 'qligg_generate_token',
334
- ig_access_token: $form.find('input[name=ig_access_token]').val(),
335
- ig_nonce: qligg.nonce
336
- },
337
- beforeSend: function () {
338
- $spinner.addClass('is-active');
339
- },
340
- success: function (response) {
341
- if (response.success) {
342
- setTimeout(function () {
343
- window.location.reload();
344
- }, 300);
345
- } else {
346
- alert(response.data);
347
- }
348
- },
349
- complete: function () {
350
- $spinner.removeClass('is-active');
351
- },
352
- error: function (jqXHR, textStatus) {
353
- console.log(textStatus);
354
- },
355
- });
356
- });
357
-
358
-
359
- // Remove token
360
- // -------------------------------------------------------------------------
361
-
362
- $('.ig-remove-token').on('click', function (e) {
363
- e.preventDefault();
364
-
365
- var c = confirm(qligg.remove_token);
366
-
367
- if (!c) {
368
- return false;
369
- }
370
-
371
- var $item = $(this),
372
- $tr = $item.closest('tr'),
373
- $spinner = $tr.find('.spinner');
374
-
375
- $.ajax({
376
- url: ajaxurl,
377
- type: 'post',
378
- data: {
379
- action: 'qligg_remove_token',
380
- item_id: $item.data('item_id'),
381
- ig_nonce: qligg.nonce
382
- },
383
- beforeSend: function () {
384
- $spinner.addClass('is-active');
385
- },
386
- success: function (response) {
387
- if (response.success) {
388
- $tr.fadeOut();
389
-
390
- setTimeout(function () {
391
- window.location.reload();
392
- }, 300);
393
-
394
- } else {
395
- alert(response.data);
396
- }
397
- },
398
- complete: function () {
399
- $spinner.removeClass('is-active');
400
- },
401
- error: function (jqXHR, textStatus) {
402
- console.log(textStatus);
403
- }
404
- });
405
-
406
- });
407
-
408
- // Gallery
409
- // ---------------------------------------------------------------------------
410
-
411
- $('#ig-update-form').on('submit', function (e) {
412
- e.preventDefault();
413
-
414
- var $form = $(this),
415
- $spinner = $form.find('.spinner');
416
-
417
- $.ajax({
418
- url: ajaxurl,
419
- type: 'post',
420
- data: $.param($form.serializeArrayAll()) + '&' + $.param({action: 'qligg_update_form'}),
421
- beforeSend: function () {
422
- $spinner.addClass('is-active');
423
- },
424
- success: function (response) {
425
- if (response.success) {
426
- setTimeout(function () {
427
- window.location.href = response.data;
428
- }, 300);
429
- } else {
430
- alert(response.data);
431
- }
432
- },
433
- complete: function () {
434
- $spinner.removeClass('is-active');
435
- },
436
- error: function (jqXHR, textStatus) {
437
- console.log(textStatus);
438
- },
439
- });
440
- });
441
-
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;
449
- }
450
-
451
- var $item = $(this),
452
- $tr = $item.closest('tr'),
453
- $spinner = $tr.find('.spinner');
454
-
455
- $.ajax({
456
- url: ajaxurl,
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');
465
- },
466
- success: function (response) {
467
- if (response.success) {
468
- setTimeout(function () {
469
- window.location.href = response.data;
470
- }, 300);
471
- } else {
472
- alert(response.data);
473
- }
474
- },
475
- complete: function () {
476
- setTimeout(function () {
477
- $tr.remove();
478
- }, 600);
479
- },
480
- error: function (jqXHR, textStatus) {
481
- console.log(textStatus);
482
- },
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
- });
536
-
537
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/qligg-admin.min.js DELETED
@@ -1 +0,0 @@
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);
 
assets/js/qligg.min.js DELETED
@@ -1,2 +0,0 @@
1
-
2
- (function(c){var b=0,d={};function a(f,i){var e=c(".insta-gallery-list",f),h=c(".insta-gallery-spinner",f),g=f.data("feed");c.ajax({url:qligg.ajax_url,type:"post",timeout:30000,data:{action:"qligg_load_item_images",next_max_id:i,feed:g},beforeSend:function(){h.show()},success:function(j){if(j.success!==true){e.append(c(j.data));h.hide();return}var k=c(j.data);e.append(k).trigger("qligg.loaded",[k])},complete:function(){},error:function(j,k){h.hide();console.log(k)}})}c(".insta-gallery-feed").on("qligg.loaded",function(i,j){var l=c(i.delegateTarget),n=c(".insta-gallery-list",l),g=c(".insta-gallery-spinner",l),f=c(".insta-gallery-button.load",l),m=l.data("feed"),k=c(j).length,h=0;if(k){n.find(".insta-gallery-image").load(function(o){h++;if(h>=k){n.trigger("qligg.imagesLoaded",[j])}})}if(k<m.limit){g.hide();setTimeout(function(){f.fadeOut()},300)}});c(".insta-gallery-feed").on("qligg.imagesLoaded",function(h){var f=c(h.delegateTarget),g=c(".insta-gallery-spinner",f);g.hide()});c(".insta-gallery-feed[data-feed_layout=gallery]").on("qligg.imagesLoaded",function(h,f){var g=c(h.delegateTarget);g.addClass("loaded");c(f).each(function(e,j){setTimeout(function(){c(j).addClass("ig-image-loaded")},150+(e*30))})});c(".insta-gallery-feed[data-feed_layout=carousel]").on("qligg.imagesLoaded",function(h,f){var g=c(h.delegateTarget);g.addClass("loaded");c(f).each(function(e,j){c(j).addClass("ig-image-loaded")})});c(".insta-gallery-feed[data-feed_layout=carousel]").on("qligg.imagesLoaded",function(j,f){var g=c(j.delegateTarget),i=c(".swiper-container",g),h=g.data("feed");b++;d[b]=new Swiper(i,{loop:true,autoHeight:true,observer:true,observeParents:true,spaceBetween:parseInt(h.spacing),slidesPerView:parseInt(h.carousel.slides),autoplay:h.carousel.autoplay?{delay:parseInt(h.carousel.interval),}:false,pagination:{el:".swiper-pagination",dynamicBullets:true,clickable:true,type:"bullets",},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev",},breakpoints:{420:{slidesPerView:1,spaceBetween:2,},767:{slidesPerView:Math.min(2,h.carousel.slides)},1023:{slidesPerView:Math.min(3,h.carousel.slides)}}})});c(".insta-gallery-feed[data-feed_layout=masonry]").on("qligg.imagesLoaded",function(i,f){var h=c(i.delegateTarget),g=c(".insta-gallery-list",h);if(!g.data("masonry")){g.masonry({itemSelector:".insta-gallery-item",isResizable:true,isAnimated:false,transitionDuration:0,percentPosition:true,columnWidth:".insta-gallery-item:last-child"})}else{g.masonry("appended",f,false)}});c(".insta-gallery-feed[data-feed_layout=masonry]").on("layoutComplete",function(h,g){var f=c(h.delegateTarget);f.addClass("loaded");c(g).each(function(e,j){setTimeout(function(){c(j.element).addClass("ig-image-loaded")},500+(e*50))})});c(".insta-gallery-feed").on("qligg.loaded",function(i){var g=c(i.delegateTarget),f=c(".insta-gallery-list",g),h=g.data("feed");c(".insta-gallery-item .insta-gallery-icon.qligg-icon-instagram",f).on("click",function(j){j.stopPropagation()});if(!h.popup.display){return}c(".insta-gallery-item",f).magnificPopup({type:"inline",callbacks:{beforeOpen:function(){this.st.mainClass=this.st.mainClass+" qligg-mfp-wrap"},elementParse:function(m){var n="",l="",e="",k="",j="";n='<img src="'+m.el.data("item").images.standard+'"/>';e='<div class="mfp-icons"><div class="mfp-counter">'+(m.index+1)+" / "+c(".insta-gallery-item",f).length+'</div><a class="mfp-link" href="'+m.el.data("item").link+'" target="_blank" rel="noopener"><i class="qligg-icon-instagram"></i>Instagram</a></div>';if(h.popup.profile){l='<div class="mfp-user"><img src="'+h.profile.picture+'"><a href="'+h.profile.link+'" title="'+h.profile.name+'" target="_blank" rel="noopener">'+h.profile.user+"</a></div>"}if(h.popup.caption){k='<div class="mfp-caption">'+m.el.data("item").caption+"</div>"}if(h.popup.likes){j='<div class="mfp-info"><div class="mfp-likes"><i class="qligg-icon-heart"></i>'+m.el.data("item").likes+'</div><div class="mfp-comments"><i class="qligg-icon-comment"></i>'+m.el.data("item").comments+'</div><div class="mfp-date">'+m.el.data("item").date+"</div></div>"}m.src='<div class="mfp-figure '+h.popup.align+'">'+n+'<div class="mfp-close"></div><div class="mfp-bottom-bar"><div class="mfp-title">'+l+e+k+j+"</div></div></div>"}},gallery:{enabled:true}})});c(".insta-gallery-feed").on("click",".insta-gallery-button.load",function(h){h.preventDefault();var f=c(h.delegateTarget);if(!f.hasClass("loaded")){return false}var g=c(".insta-gallery-list .insta-gallery-item:last-child",f).data("item").i;a(f,g)});c(".insta-gallery-feed").each(function(f,g){var e=c(g);if(e.hasClass("loaded")){return false}a(e,0)});if(navigator.appVersion.indexOf("MSIE 8.")!=-1){document.body.className+=" instagal-ie-8"}if(navigator.appVersion.indexOf("MSIE 9.")!=-1){document.body.className+=" instagal-ie-9"}})(jQuery);
 
 
includes/ajax.php DELETED
@@ -1,295 +0,0 @@
1
- <?php
2
-
3
- if (!defined('ABSPATH'))
4
- exit;
5
-
6
- if (!class_exists('QLIGG_AJAX')) {
7
-
8
- class QLIGG_AJAX {
9
-
10
- protected static $instance;
11
-
12
- function sanitize_feed($feed) {
13
-
14
- global $qligg_api;
15
-
16
- // Removing @, # and trimming input
17
- // ---------------------------------------------------------------------
18
-
19
- $feed = sanitize_text_field($feed);
20
-
21
- $feed = trim($feed);
22
- $feed = str_replace('@', '', $feed);
23
- $feed = str_replace('#', '', $feed);
24
- $feed = str_replace($qligg_api->instagram_url, '', $feed);
25
- $feed = str_replace('/explore/tags/', '', $feed);
26
- $feed = str_replace('/', '', $feed);
27
-
28
- return $feed;
29
- }
30
-
31
- function save_settings() {
32
-
33
- global $qligg;
34
-
35
- if (current_user_can('manage_options')) {
36
-
37
- if (!empty($_REQUEST) && check_admin_referer('qligg_save_settings', 'ig_nonce')) {
38
-
39
- $keys = array(
40
- 'insta_license' => 0,
41
- 'insta_flush' => 0,
42
- 'insta_reset' => 1,
43
- 'insta_spinner_image_id' => 0
44
- );
45
-
46
- $qligg = wp_parse_args(array_intersect_key($_REQUEST, $keys), $qligg);
47
-
48
- update_option('insta_gallery_settings', $qligg, false);
49
-
50
- wp_send_json_success(esc_html__('Settings updated successfully', 'insta-gallery'));
51
- }
52
- }
53
-
54
- wp_send_json_error(esc_html__('Invalid Request', 'insta-gallery'));
55
- }
56
-
57
- function generate_token() {
58
-
59
- global $qligg_token, $qligg_api;
60
-
61
- if (current_user_can('manage_options')) {
62
-
63
- if (!empty($_REQUEST) && check_admin_referer('qligg_generate_token', 'ig_nonce')) {
64
-
65
- if (empty($_REQUEST['ig_access_token'])) {
66
- wp_send_json_error(esc_html__('Empty access token', 'insta-gallery'));
67
- }
68
-
69
- $access_token = sanitize_text_field($_REQUEST['ig_access_token']);
70
-
71
- if (count($access_token_id = explode('.', $access_token)) == 1) {
72
- wp_send_json_error(esc_html__('Invalid access token', 'insta-gallery'));
73
- }
74
-
75
- if (!$qligg_api->validate_token($access_token)) {
76
- wp_send_json_error($qligg_api->get_message());
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
-
88
- $new_token = array(
89
- $access_token_id[0] => $access_token
90
- );
91
-
92
- update_option('insta_gallery_token', apply_filters('qligg_update_insta_gallery_token', $new_token), false);
93
- delete_transient('insta_gallery_user_profile');
94
-
95
- wp_send_json_success(esc_html__('Access token created', 'insta-gallery'));
96
- }
97
- }
98
-
99
- wp_send_json_error(esc_html__('Invalid Request', 'insta-gallery'));
100
- }
101
-
102
- function remove_token() {
103
-
104
- global $qligg_token;
105
-
106
- if (current_user_can('manage_options')) {
107
-
108
- if (!empty($_REQUEST) && check_admin_referer('qligg_generate_token', 'ig_nonce')) {
109
-
110
- if (!isset($_REQUEST['item_id'])) {
111
- wp_send_json_error(esc_html__('Invalid item id', 'insta-gallery'));
112
- }
113
-
114
- $item_id = sanitize_text_field($_REQUEST['item_id']);
115
-
116
- unset($qligg_token[$item_id]);
117
-
118
- update_option('insta_gallery_token', $qligg_token, false);
119
- delete_transient('insta_gallery_user_profile');
120
-
121
- wp_send_json_success(esc_html__('Token removed successfully', 'insta-gallery'));
122
- }
123
- }
124
-
125
- wp_send_json_error(esc_html__('Invalid Request', 'insta-gallery'));
126
- }
127
-
128
- function update_form() {
129
-
130
- global $qligg_token, $qligg_api;
131
-
132
- if (current_user_can('manage_options')) {
133
-
134
- if (!empty($_REQUEST) && check_admin_referer('qligg_update_form', 'ig_nonce')) {
135
-
136
- if (empty($item_type = $_REQUEST['insta_source'])) {
137
- wp_send_json_error(esc_html__('Select gallery item type', 'insta-gallery'));
138
- }
139
- if ($item_type == 'username' && empty($_REQUEST['insta_username'])) {
140
- wp_send_json_error(esc_html__('Username is empty', 'insta-gallery'));
141
- }
142
- if ($item_type == 'tag' && empty($_REQUEST['insta_tag'])) {
143
- wp_send_json_error(esc_html__('Tag is empty', 'insta-gallery'));
144
- }
145
-
146
- $instagram_feed = array();
147
-
148
- $instagram_feed['insta_source'] = sanitize_key(@$_REQUEST['insta_source']);
149
- $instagram_feed['insta_layout'] = sanitize_key(@$_REQUEST['insta_layout']);
150
- $instagram_feed['insta_username'] = $this->sanitize_feed(@$_REQUEST['insta_username']);
151
- $instagram_feed['insta_tag'] = $this->sanitize_feed(@$_REQUEST['insta_tag']);
152
- $instagram_feed['insta_limit'] = absint(@$_REQUEST['insta_limit']);
153
- $instagram_feed['insta_gal-cols'] = absint(@$_REQUEST['insta_gal-cols']);
154
- $instagram_feed['insta_spacing'] = absint(@$_REQUEST['insta_spacing']);
155
- $instagram_feed['insta_button'] = absint(@$_REQUEST['insta_button']);
156
- $instagram_feed['insta_button-text'] = trim(esc_html(@$_REQUEST['insta_button-text']));
157
- $instagram_feed['insta_button-background'] = sanitize_text_field(@$_REQUEST['insta_button-background']);
158
- $instagram_feed['insta_button-background-hover'] = sanitize_text_field(@$_REQUEST['insta_button-background-hover']);
159
- $instagram_feed['insta_car-slidespv'] = absint(@$_REQUEST['insta_car-slidespv']);
160
- $instagram_feed['insta_car-autoplay'] = absint(@$_REQUEST['insta_car-autoplay']);
161
- $instagram_feed['insta_car-autoplay-interval'] = absint(@$_REQUEST['insta_car-autoplay-interval']);
162
- $instagram_feed['insta_car-navarrows'] = absint(@$_REQUEST['insta_car-navarrows']);
163
- $instagram_feed['insta_car-navarrows-color'] = sanitize_text_field(@$_REQUEST['insta_car-navarrows-color']);
164
- $instagram_feed['insta_car-pagination'] = absint(@$_REQUEST['insta_car-pagination']);
165
- $instagram_feed['insta_car-pagination-color'] = sanitize_text_field(@$_REQUEST['insta_car-pagination-color']);
166
- $instagram_feed['insta_size'] = sanitize_key(@$_REQUEST['insta_size']);
167
- $instagram_feed['insta_hover'] = absint(@$_REQUEST['insta_hover']);
168
- $instagram_feed['insta_hover-color'] = sanitize_text_field(@$_REQUEST['insta_hover-color']);
169
- $instagram_feed['insta_popup'] = absint(@$_REQUEST['insta_popup']);
170
- $instagram_feed['insta_likes'] = absint(@$_REQUEST['insta_likes']);
171
- $instagram_feed['insta_comments'] = absint(@$_REQUEST['insta_comments']);
172
-
173
- // Removing @, # and trimming input
174
- /* ---------------------------------------------------------------------
175
- $instagram_feed['insta_username'] = trim($instagram_feed['insta_username']);
176
- $instagram_feed['insta_username'] = str_replace('@', '', $instagram_feed['insta_username']);
177
- $instagram_feed['insta_username'] = str_replace('#', '', $instagram_feed['insta_username']);
178
- $instagram_feed['insta_username'] = str_replace($qligg_api->instagram_url, '', $instagram_feed['insta_username']);
179
- $instagram_feed['insta_username'] = str_replace('/', '', $instagram_feed['insta_username']);
180
-
181
- $instagram_feed['insta_tag'] = trim($instagram_feed['insta_tag']);
182
- $instagram_feed['insta_tag'] = str_replace('@', '', $instagram_feed['insta_tag']);
183
- $instagram_feed['insta_tag'] = str_replace('#', '', $instagram_feed['insta_tag']);
184
- $instagram_feed['insta_tag'] = str_replace("{$qligg_api->instagram_url}/explore/tags/", '', $instagram_feed['insta_tag']);
185
- $instagram_feed['insta_tag'] = str_replace('/', '', $instagram_feed['insta_tag']); */
186
-
187
- $instagram_feeds = get_option('insta_gallery_items', array());
188
-
189
- $item_id = isset($_REQUEST['item_id']) ? absint($_REQUEST['item_id']) : absint(key(array_slice($instagram_feeds, -1, 1, true))) + 1;
190
-
191
- $instagram_feeds[$item_id] = $instagram_feed;
192
-
193
- update_option('insta_gallery_items', apply_filters('qligg_update_insta_gallery_items', $instagram_feeds, $item_id));
194
-
195
- wp_send_json_success(admin_url("admin.php?page=qligg_feeds&tab=edit&item_id={$item_id}"));
196
- }
197
- }
198
- wp_send_json_error(esc_html__('Invalid Request', 'insta-gallery'));
199
- }
200
-
201
- function form_item_delete() {
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
-
209
- $instagram_feeds = get_option('insta_gallery_items', array());
210
-
211
- $item_id = absint($_REQUEST['item_id']);
212
-
213
- if (isset($instagram_feeds[$item_id])) {
214
-
215
- unset($instagram_feeds[$item_id]);
216
-
217
- update_option('insta_gallery_items', $instagram_feeds, false);
218
- }
219
-
220
- wp_send_json_success(admin_url("admin.php?page=qligg_feeds"));
221
- }
222
- }
223
- }
224
-
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', array());
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'));
268
-
269
- // Token
270
- // -----------------------------------------------------------------------
271
- add_action('wp_ajax_qligg_generate_token', array($this, 'generate_token'));
272
- add_action('wp_ajax_qligg_remove_token', array($this, 'remove_token'));
273
-
274
- // 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'));
282
- }
283
-
284
- public static function instance() {
285
- if (!isset(self::$instance)) {
286
- self::$instance = new self();
287
- self::$instance->init();
288
- }
289
- return self::$instance;
290
- }
291
-
292
- }
293
-
294
- QLIGG_AJAX::instance();
295
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/api.php CHANGED
@@ -126,7 +126,7 @@ if (!class_exists('QLIGG_API')) {
126
 
127
  preg_match_all("/#(\\w+)/", @$item['caption']['text'], $hashtags);
128
 
129
- $test = $instagram_items[] = array(
130
  'i' => $i,
131
  'id' => str_replace("_{$item['user']['id']}", '', $item['id']),
132
  'images' => array(
126
 
127
  preg_match_all("/#(\\w+)/", @$item['caption']['text'], $hashtags);
128
 
129
+ $instagram_items[] = array(
130
  'i' => $i,
131
  'id' => str_replace("_{$item['user']['id']}", '', $item['id']),
132
  'images' => array(
includes/backend.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLIGG_Backend {
4
+
5
+ protected static $instance;
6
+
7
+ public static function instance() {
8
+ if (!isset(self::$instance)) {
9
+ self::$instance = new self();
10
+ self::$instance->init();
11
+ self::$instance->includes();
12
+ }
13
+ return self::$instance;
14
+ }
15
+
16
+ function init() {
17
+ add_action('admin_enqueue_scripts', array($this, 'add_js'));
18
+ add_action('admin_enqueue_scripts', array($this, 'dequeue_js'), 999);
19
+ // add_action('admin_head', array($this, 'add_css'));
20
+
21
+ add_filter('default_option_qligg', array($this, 'generate_db'));
22
+ add_filter('sanitize_option_qligg', 'wp_unslash');
23
+ }
24
+
25
+ function generate_db() {
26
+ $db = new QLIGG_Model();
27
+ return $db->options();
28
+ }
29
+
30
+ function includes() {
31
+ include_once (QLIGG_PLUGIN_DIR . 'includes/controllers/WelcomeController.php');
32
+ include_once (QLIGG_PLUGIN_DIR . 'includes/controllers/AccountController.php');
33
+ include_once (QLIGG_PLUGIN_DIR . 'includes/controllers/FeedController.php');
34
+ include_once (QLIGG_PLUGIN_DIR . 'includes/controllers/SettingController.php');
35
+ include_once (QLIGG_PLUGIN_DIR . 'includes/controllers/PremiumController.php');
36
+ include_once (QLIGG_PLUGIN_DIR . 'includes/controllers/SuggestionsController.php');
37
+ }
38
+
39
+ function dequeue_js() {
40
+ // Fix Instagram Feed compatibility
41
+ if (isset($_GET['page']) && strpos($_GET['page'], QLIGG_DOMAIN) !== false) {
42
+ wp_deregister_script('sb_instagram_admin_js');
43
+ wp_dequeue_script('sb_instagram_admin_js');
44
+ }
45
+ }
46
+
47
+ function add_js() {
48
+ wp_register_script('jquery-serializejson', plugins_url('/assets/backend/jquery-serializejson/jquery-serializejson' . QLIGG::is_min() . '.js', QLIGG_PLUGIN_FILE), array('jquery'), QLIGG_PLUGIN_VERSION, true);
49
+ wp_register_script('wp-color-picker-alpha', plugins_url('/assets/backend/rgba/wp-color-picker-alpha.min.js', QLIGG_PLUGIN_FILE), array('jquery', 'wp-color-picker'), QLIGG_PLUGIN_VERSION, true);
50
+ wp_register_style('qligg-admin', plugins_url('/assets/backend/css/qligg-admin' . QLIGG::is_min() . '.css', QLIGG_PLUGIN_FILE), array('wp-color-picker', 'media-views'), QLIGG_PLUGIN_VERSION, 'all');
51
+
52
+ if (isset($_GET['page']) && strpos($_GET['page'], QLIGG_PREFIX) !== false) {
53
+ wp_enqueue_style('qligg-admin');
54
+ }
55
+ }
56
+
57
+ }
58
+
59
+ QLIGG_Backend::instance();
60
+
includes/compatibility.php ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Token.php');
4
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Feed.php');
5
+
6
+ class QLIGG_Compatibility {
7
+
8
+ protected static $instance;
9
+
10
+ function premium_compatibility() {
11
+
12
+ global $qligg, $qligg_token;
13
+
14
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Setting.php');
15
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Token.php');
16
+
17
+ $token_model = new QLIGG_Token();
18
+
19
+ $qligg_token = $token_model->get_tokens();
20
+
21
+ $setting_model = new QLIGG_Setting();
22
+
23
+ $qligg = $setting_model->get_settings();
24
+ }
25
+
26
+ function rename_insta_gallery_token($token = array()) {
27
+
28
+ if (isset($token['access_token'])) {
29
+
30
+ $access_token = base64_decode($token['access_token']);
31
+
32
+ $access_token_id = explode('.', $access_token);
33
+
34
+ $token = array(
35
+ $access_token_id[0] => $access_token
36
+ );
37
+ }
38
+
39
+ return $token;
40
+ }
41
+
42
+ function rename_insta_gallery_items_223($instagram_feeds = array()) {
43
+
44
+ $token_model = new QLIGG_Token();
45
+ $tokens = $token_model->get_tokens();
46
+
47
+ // Backward compatibility v2.2.3
48
+ // -----------------------------------------------------------------------
49
+
50
+ foreach ($instagram_feeds as $id => $instagram_feed) {
51
+
52
+ if (!isset($instagram_feed['insta_username']) && !empty($instagram_feed['insta_user'])) {
53
+ $instagram_feeds[$id]['insta_username'] = key($tokens);
54
+ }
55
+
56
+ if (!isset($instagram_feed['insta_source']) && !empty($instagram_feed['ig_select_from'])) {
57
+ $instagram_feeds[$id]['insta_source'] = $instagram_feed['ig_select_from'];
58
+ }
59
+
60
+ if (!isset($instagram_feed['insta_layout']) && !empty($instagram_feed['ig_display_type'])) {
61
+ $instagram_feeds[$id]['insta_layout'] = $instagram_feed['ig_display_type'];
62
+ }
63
+
64
+ if (empty($instagram_feed['insta_button-text'])) {
65
+ $instagram_feeds[$id]['insta_button-text'] = 'View on Instagram';
66
+ }
67
+ if (empty($instagram_feed['insta_thumb']) && !empty($instagram_feed['insta_thumb-size'])) {
68
+ $instagram_feeds[$id]['insta_size'] = $instagram_feed['insta_thumb-size'];
69
+ }
70
+ if (empty($instagram_feed['insta_button']) && !empty($instagram_feed['insta_instalink'])) {
71
+ $instagram_feeds[$id]['insta_button'] = $instagram_feed['insta_instalink'];
72
+ }
73
+ if (empty($instagram_feed['insta_button-text']) && !empty($instagram_feed['insta_instalink-text'])) {
74
+ $instagram_feeds[$id]['insta_button-text'] = $instagram_feed['insta_instalink-text'];
75
+ }
76
+ if (empty($instagram_feed['insta_button-background']) && !empty($instagram_feed['insta_instalink-bgcolor'])) {
77
+ $instagram_feeds[$id]['insta_button-background'] = $instagram_feed['insta_instalink-bgcolor'];
78
+ }
79
+ if (empty($instagram_feed['insta_button-background-hover']) && !empty($instagram_feed['insta_instalink-hvrcolor'])) {
80
+ $instagram_feeds[$id]['insta_button-background-hover'] = $instagram_feed['insta_instalink-hvrcolor'];
81
+ }
82
+
83
+ if (!isset($instagram_feed['insta_limit'])) {
84
+
85
+ $instagram_feeds[$id]['insta_limit'] = 12;
86
+
87
+ if (isset($instagram_feed['insta_source']) && $instagram_feed['insta_source'] == 'username') {
88
+ $instagram_feeds[$id]['insta_limit'] = absint($instagram_feed['insta_user-limit']);
89
+ }
90
+
91
+ if (isset($instagram_feed['insta_source']) && $instagram_feed['insta_source'] == 'tag') {
92
+ $instagram_feeds[$id]['insta_limit'] = absint($instagram_feed['insta_tag-limit']);
93
+ }
94
+ }
95
+
96
+ if (!isset($instagram_feed['insta_spacing'])) {
97
+
98
+ $instagram_feeds[$id]['insta_spacing'] = 0;
99
+
100
+ if (!empty($instagram_feed['insta_gal-spacing']) && $instagram_feed['insta_layout'] == 'gallery') {
101
+ $instagram_feeds[$id]['insta_spacing'] = 10;
102
+ }
103
+
104
+ if (!empty($instagram_feed['insta_car-spacing']) && $instagram_feed['insta_layout'] == 'carousel') {
105
+ $instagram_feeds[$id]['insta_spacing'] = 10;
106
+ }
107
+ }
108
+
109
+ if (!isset($instagram_feed['insta_hover'])) {
110
+
111
+ $instagram_feeds[$id]['insta_hover'] = true;
112
+
113
+ if (isset($instagram_feed['insta_gal-hover']) && $instagram_feed['insta_layout'] == 'gallery') {
114
+ $instagram_feeds[$id]['insta_hover'] = $instagram_feed['insta_gal-hover'];
115
+ }
116
+
117
+ if (isset($instagram_feed['insta_car-hover']) && $instagram_feed['insta_layout'] == 'carousel') {
118
+ $instagram_feeds[$id]['insta_hover'] = $instagram_feed['insta_car-hover'];
119
+ }
120
+ }
121
+
122
+ if (!isset($instagram_feed['insta_popup'])) {
123
+
124
+ $instagram_feeds[$id]['insta_popup'] = true;
125
+
126
+ if (isset($instagram_feed['insta_gal-popup']) && $instagram_feed['insta_layout'] == 'gallery') {
127
+ $instagram_feeds[$id]['insta_popup'] = $instagram_feed['insta_gal-popup'];
128
+ }
129
+
130
+ if (isset($instagram_feed['insta_car-popup']) && $instagram_feed['insta_layout'] == 'carousel') {
131
+ $instagram_feeds[$id]['insta_popup'] = $instagram_feed['insta_car-popup'];
132
+ }
133
+ }
134
+ }
135
+
136
+ return $instagram_feeds;
137
+ }
138
+
139
+ // Backward compatibility v2.6.6 to 2.6.8
140
+ // -----------------------------------------------------------------------
141
+ function rename_insta_gallery_items_266($new_instagram_feeds = array()) {
142
+
143
+ // if dosent exists return
144
+ if (!$old_instagram_feeds = get_option('insta_gallery_items')) {
145
+ return $new_instagram_feeds;
146
+ }
147
+ // replace keys
148
+ foreach ($old_instagram_feeds as $id => $old_instagram_feed) {
149
+
150
+ $new_instagram_feeds[$id]['id'] = $id;
151
+ $new_instagram_feeds[$id]['order'] = $id;
152
+
153
+ if (isset($old_instagram_feed['insta_source'])) {
154
+ $new_instagram_feeds[$id]['type'] = $old_instagram_feed['insta_source'];
155
+ }
156
+ if (isset($old_instagram_feed['insta_tag'])) {
157
+ $new_instagram_feeds[$id]['tag'] = $old_instagram_feed['insta_tag'];
158
+ }
159
+ if (isset($old_instagram_feed['insta_username'])) {
160
+ $new_instagram_feeds[$id]['username'] = $old_instagram_feed['insta_username'];
161
+ }
162
+ if (isset($old_instagram_feed['insta_layout'])) {
163
+ $new_instagram_feeds[$id]['layout'] = $old_instagram_feed['insta_layout'];
164
+ }
165
+ if (isset($old_instagram_feed['insta_box'])) {
166
+ $new_instagram_feeds[$id]['box']['display'] = $old_instagram_feed['insta_box'];
167
+ }
168
+ if (isset($old_instagram_feed['insta_box-padding'])) {
169
+ $new_instagram_feeds[$id]['box']['padding'] = $old_instagram_feed['insta_box-padding'];
170
+ }
171
+ if (isset($old_instagram_feed['insta_box-radius'])) {
172
+ $new_instagram_feeds[$id]['box']['radius'] = $old_instagram_feed['insta_box-radius'];
173
+ }
174
+ if (isset($old_instagram_feed['insta_box-background'])) {
175
+ $new_instagram_feeds[$id]['box']['background'] = $old_instagram_feed['insta_box-background'];
176
+ }
177
+ if (isset($old_instagram_feed['insta_box-profile'])) {
178
+ $new_instagram_feeds[$id]['box']['profile'] = $old_instagram_feed['insta_box-profile'];
179
+ }
180
+ if (isset($old_instagram_feed['insta_box-desc'])) {
181
+ $new_instagram_feeds[$id]['box']['desc'] = $old_instagram_feed['insta_box-desc'];
182
+ }
183
+ if (isset($old_instagram_feed['insta_highlight-tag'])) {
184
+ $new_instagram_feeds[$id]['highlight']['tag'] = $old_instagram_feed['insta_highlight-tag'];
185
+ }
186
+ if (isset($old_instagram_feed['insta_highlight-id'])) {
187
+ $new_instagram_feeds[$id]['highlight']['id'] = $old_instagram_feed['insta_highlight-id'];
188
+ }
189
+ if (isset($old_instagram_feed['insta_highlight-position'])) {
190
+ $new_instagram_feeds[$id]['highlight']['position'] = $old_instagram_feed['insta_highlight-position'];
191
+ }
192
+ if (isset($old_instagram_feed['insta_car-position'])) {
193
+ $new_instagram_feeds[$id]['carousel']['slidespv'] = $old_instagram_feed['insta_car-slidespv'];
194
+ }
195
+ if (isset($old_instagram_feed['insta_car-autoplay'])) {
196
+ $new_instagram_feeds[$id]['carousel']['autoplay'] = $old_instagram_feed['insta_car-autoplay'];
197
+ }
198
+ if (isset($old_instagram_feed['insta_car-interval'])) {
199
+ $new_instagram_feeds[$id]['carousel']['autoplay_interval'] = $old_instagram_feed['insta_car-interval'];
200
+ }
201
+ if (isset($old_instagram_feed['insta_car-navarrows'])) {
202
+ $new_instagram_feeds[$id]['carousel']['navarrows'] = $old_instagram_feed['insta_car-navarrows'];
203
+ }
204
+ if (isset($old_instagram_feed['insta_car-navarrows-color'])) {
205
+ $new_instagram_feeds[$id]['carousel']['navarrows_color'] = $old_instagram_feed['insta_car-navarrows-color'];
206
+ }
207
+ if (isset($old_instagram_feed['insta_car-pagination'])) {
208
+ $new_instagram_feeds[$id]['carousel']['pagination'] = $old_instagram_feed['insta_car-pagination'];
209
+ }
210
+ if (isset($old_instagram_feed['insta_car-pagination-color'])) {
211
+ $new_instagram_feeds[$id]['carousel']['pagination-color'] = $old_instagram_feed['insta_car-pagination-color'];
212
+ }
213
+ if (isset($old_instagram_feed['insta_gal-cols'])) {
214
+ $new_instagram_feeds[$id]['carousel']['columns'] = $old_instagram_feed['insta_gal-cols'];
215
+ }
216
+ if (isset($old_instagram_feed['insta_limit'])) {
217
+ $new_instagram_feeds[$id]['limit'] = $old_instagram_feed['insta_limit'];
218
+ }
219
+ if (isset($old_instagram_feed['insta_spacing'])) {
220
+ $new_instagram_feeds[$id]['spacing'] = $old_instagram_feed['insta_spacing'];
221
+ }
222
+ if (isset($old_instagram_feed['insta_size'])) {
223
+ $new_instagram_feeds[$id]['size'] = $old_instagram_feed['insta_size'];
224
+ }
225
+ if (isset($old_instagram_feed['insta_hover'])) {
226
+ $new_instagram_feeds[$id]['mask']['display'] = $old_instagram_feed['insta_hover'];
227
+ }
228
+ if (isset($old_instagram_feed['insta_hover-color'])) {
229
+ $new_instagram_feeds[$id]['mask']['background'] = $old_instagram_feed['insta_hover-color'];
230
+ }
231
+ if (isset($old_instagram_feed['insta_likes'])) {
232
+ $new_instagram_feeds[$id]['mask']['likes'] = $old_instagram_feed['insta_likes'];
233
+ }
234
+ if (isset($old_instagram_feed['insta_comments'])) {
235
+ $new_instagram_feeds[$id]['mask']['comments'] = $old_instagram_feed['insta_comments'];
236
+ }
237
+ if (isset($old_instagram_feed['insta_button'])) {
238
+ $new_instagram_feeds[$id]['button']['display'] = $old_instagram_feed['insta_button'];
239
+ }
240
+ if (isset($old_instagram_feed['insta_button-text'])) {
241
+ $new_instagram_feeds[$id]['button']['text'] = $old_instagram_feed['insta_button-text'];
242
+ }
243
+ if (isset($old_instagram_feed['insta_button-background'])) {
244
+ $new_instagram_feeds[$id]['button']['background'] = $old_instagram_feed['insta_button-background'];
245
+ }
246
+ if (isset($old_instagram_feed['insta_button-background-hover'])) {
247
+ $new_instagram_feeds[$id]['button']['background_hover'] = $old_instagram_feed['insta_button-background-hover'];
248
+ }
249
+ if (isset($old_instagram_feed['insta_popup'])) {
250
+ $new_instagram_feeds[$id]['popup']['display'] = $old_instagram_feed['insta_popup'];
251
+ }
252
+ if (isset($old_instagram_feed['insta_popup'])) {
253
+ $new_instagram_feeds[$id]['popup']['display'] = $old_instagram_feed['insta_popup'];
254
+ }
255
+ if (isset($old_instagram_feed['insta_popup-profile'])) {
256
+ $new_instagram_feeds[$id]['popup']['profile'] = $old_instagram_feed['insta_popup-profile'];
257
+ }
258
+ if (isset($old_instagram_feed['insta_popup-caption'])) {
259
+ $new_instagram_feeds[$id]['popup']['caption'] = $old_instagram_feed['insta_popup-caption'];
260
+ }
261
+ if (isset($old_instagram_feed['insta_popup-likes'])) {
262
+ $new_instagram_feeds[$id]['popup']['likes'] = $old_instagram_feed['insta_popup-likes'];
263
+ }
264
+ if (isset($old_instagram_feed['insta_popup-align'])) {
265
+ $new_instagram_feeds[$id]['popup']['align'] = $old_instagram_feed['insta_popup-align'];
266
+ }
267
+ if (isset($old_instagram_feed['insta_button_load'])) {
268
+ $new_instagram_feeds[$id]['button_load']['display'] = $old_instagram_feed['insta_button_load'];
269
+ }
270
+ if (isset($old_instagram_feed['insta_button_load-text'])) {
271
+ $new_instagram_feeds[$id]['button_load']['text'] = $old_instagram_feed['insta_button_load-text'];
272
+ }
273
+ if (isset($old_instagram_feed['insta_button_load-background'])) {
274
+ $new_instagram_feeds[$id]['button_load']['background'] = $old_instagram_feed['insta_button_load-background'];
275
+ }
276
+ if (isset($old_instagram_feed['insta_button_load-background-hover'])) {
277
+ $new_instagram_feeds[$id]['button_load']['background_hover'] = $old_instagram_feed['insta_button_load-background-hover'];
278
+ }
279
+ if (isset($old_instagram_feed['insta_card'])) {
280
+ $new_instagram_feeds[$id]['card']['display'] = $old_instagram_feed['insta_card'];
281
+ }
282
+ if (isset($old_instagram_feed['insta_card-radius'])) {
283
+ $new_instagram_feeds[$id]['card']['radius'] = $old_instagram_feed['insta_card-radius'];
284
+ }
285
+ if (isset($old_instagram_feed['insta_card-font-size'])) {
286
+ $new_instagram_feeds[$id]['card']['font_size'] = $old_instagram_feed['insta_card-font-size'];
287
+ }
288
+ if (isset($old_instagram_feed['insta_card-background'])) {
289
+ $new_instagram_feeds[$id]['card']['background'] = $old_instagram_feed['insta_card-background'];
290
+ }
291
+ if (isset($old_instagram_feed['insta_card-padding'])) {
292
+ $new_instagram_feeds[$id]['card']['padding'] = $old_instagram_feed['insta_card-padding'];
293
+ }
294
+ if (isset($old_instagram_feed['insta_card-info'])) {
295
+ $new_instagram_feeds[$id]['card']['info'] = $old_instagram_feed['insta_card-info'];
296
+ }
297
+ if (isset($old_instagram_feed['insta_card-length'])) {
298
+ $new_instagram_feeds[$id]['card']['length'] = $old_instagram_feed['insta_card-length'];
299
+ }
300
+ if (isset($old_instagram_feed['insta_card-caption'])) {
301
+ $new_instagram_feeds[$id]['card']['caption'] = $old_instagram_feed['insta_card-caption'];
302
+ }
303
+ }
304
+ return $new_instagram_feeds;
305
+ }
306
+
307
+ function init() {
308
+ add_filter('option_insta_gallery_iac ', array($this, 'rename_insta_gallery_token'), 10);
309
+ add_filter('option_insta_gallery_token', array($this, 'rename_insta_gallery_token'), 10);
310
+ add_filter('option_insta_gallery_items', array($this, 'rename_insta_gallery_items_223'), 10);
311
+ add_filter('default_option_insta_gallery_feeds', array($this, 'rename_insta_gallery_items_266'), 10);
312
+ add_action('init', array($this, 'premium_compatibility'));
313
+ }
314
+
315
+ public static function instance() {
316
+ if (!isset(self::$instance)) {
317
+ self::$instance = new self();
318
+ //self::$instance->defaults();
319
+ self::$instance->init();
320
+ }
321
+ return self::$instance;
322
+ }
323
+
324
+ }
325
+
326
+ QLIGG_Compatibility::instance();
includes/controllers/AccountController.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Token.php');
4
+ include_once(QLIGG_PLUGIN_DIR . 'includes/controllers/QLIGG_Controller.php');
5
+
6
+ class QLIGG_Account_Controller extends QLIGG_Controller {
7
+
8
+ protected static $instance;
9
+ protected static $slug = QLIGG_DOMAIN . '_token';
10
+
11
+ public static function instance() {
12
+ if (!isset(self::$instance)) {
13
+ self::$instance = new self();
14
+ self::$instance->init();
15
+ }
16
+ return self::$instance;
17
+ }
18
+
19
+ function init() {
20
+ add_action('wp_ajax_qligg_add_token', array($this, 'ajax_add_token'));
21
+ add_action('wp_ajax_qligg_delete_token', array($this, 'ajax_delete_token'));
22
+ add_action('admin_enqueue_scripts', array($this, 'add_js'));
23
+ add_action('admin_menu', array($this, 'add_menu'));
24
+ }
25
+
26
+ function add_menu() {
27
+ add_submenu_page(QLIGG_DOMAIN, esc_html__('Account', 'insta-gallery'), esc_html__('Account', 'insta-gallery'), 'manage_options', self::$slug, array($this, 'add_panel'));
28
+ }
29
+
30
+ function add_panel() {
31
+ global $submenu, $qligg_api;
32
+ $token_model = new QLIGG_Token();
33
+ $tokens = $token_model->get_tokens();
34
+
35
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
36
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/accounts.php');
37
+ }
38
+
39
+ function ajax_add_token() {
40
+
41
+ global $qligg_api;
42
+
43
+ if (!empty($_REQUEST) && current_user_can('manage_options') && check_ajax_referer('qligg_add_token', 'nonce', false)) {
44
+
45
+ if (empty($_REQUEST['access_token'])) {
46
+ parent::error_ajax(esc_html__('Empty access token', 'insta-gallery'));
47
+ }
48
+
49
+ $access_token = sanitize_text_field($_REQUEST['access_token']);
50
+ $token_model = new QLIGG_Token();
51
+ $tokens = $token_model->get_tokens();
52
+
53
+ if (count($access_token_id = explode('.', $access_token)) == 1) {
54
+ parent::error_ajax(esc_html__('Invalid access token', 'insta-gallery'));
55
+ }
56
+
57
+ if (!$qligg_api->validate_token($access_token)) {
58
+ parent::error_ajax($qligg_api->get_message());
59
+ }
60
+
61
+ if (isset($tokens[$access_token_id[0]]) && $tokens[$access_token_id[0]] == $access_token) {
62
+ if ($profile_info = qligg_get_user_profile($access_token_id[0])) {
63
+ parent::error_ajax(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']));
64
+ }
65
+ parent::error_ajax(esc_html__('Account already connected. To connect a new account logout from Instagram in this browser.', 'insta-gallery'));
66
+ }
67
+
68
+ $new_token = array($access_token_id[0] => $access_token);
69
+
70
+ $token_model->add_token($new_token);
71
+
72
+ parent::success_ajax(esc_html__('Access token created', 'insta-gallery'));
73
+ }
74
+
75
+ parent::error_access_denied();
76
+ }
77
+
78
+ function ajax_delete_token() {
79
+
80
+ if (!empty($_REQUEST['token_id']) && current_user_can('manage_options') && check_ajax_referer('qligg_delete_token', 'nonce', false)) {
81
+
82
+ $token_model = new QLIGG_Token();
83
+
84
+ $token_id = sanitize_text_field($_REQUEST['token_id']);
85
+
86
+ $token_model->delete_token($token_id);
87
+
88
+ parent::success_ajax(esc_html__('Token removed successfully', 'insta-gallery'));
89
+ }
90
+
91
+ parent::error_access_denied();
92
+ }
93
+
94
+ function add_js() {
95
+
96
+ wp_register_script('qligg-admin-account', plugins_url('/assets/backend/js/qligg-admin-account' . QLIGG::is_min() . '.js', QLIGG_PLUGIN_FILE), array('wp-util', 'jquery', 'backbone', 'jquery-serializejson'), QLIGG_PLUGIN_VERSION, true);
97
+ wp_localize_script('qligg-admin-account', 'qligg_account', array(
98
+ 'nonce' => array(
99
+ 'qligg_add_token' => wp_create_nonce('qligg_add_token'),
100
+ 'qligg_delete_token' => wp_create_nonce('qligg_delete_token'),
101
+ ),
102
+ 'message' => array(
103
+ 'confirm_delete' => __('Do you want to delete the token?', 'insta-gallery')
104
+ )
105
+ ));
106
+
107
+ if (isset($_GET['page']) && ($_GET['page'] === self::$slug)) {
108
+ wp_enqueue_script('qligg-admin-account');
109
+ }
110
+ }
111
+
112
+ }
113
+
114
+ QLIGG_Account_Controller ::instance();
includes/controllers/FeedController.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Feed.php');
4
+ include_once(QLIGG_PLUGIN_DIR . 'includes/controllers/QLIGG_Controller.php');
5
+
6
+ class QLIGG_Feed_Controller extends QLIGG_Controller {
7
+
8
+ protected static $instance;
9
+ protected static $slug = QLIGG_DOMAIN . '_feeds';
10
+
11
+ function add_menu() {
12
+ add_submenu_page(QLIGG_DOMAIN, esc_html__('Feeds', 'insta-gallery'), esc_html__('Feeds', 'insta-gallery'), 'manage_options', self::$slug, array($this, 'add_panel'));
13
+ }
14
+
15
+ function add_panel() {
16
+ global $submenu, $qligg_api;
17
+ $feed_model = new QLIGG_Feed();
18
+ $feeds = $feed_model->get_feeds();
19
+ $token_model = new QLIGG_Token();
20
+ $tokens = $token_model->get_tokens();
21
+
22
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
23
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/feeds.php');
24
+ }
25
+
26
+ function get_feed($feed_id) {
27
+
28
+ function get_the_title1($id) {
29
+ return ($id == 'all') ? esc_html__('All', 'insta-gallery') : get_the_title($id);
30
+ }
31
+
32
+ $feed_model = new QLIGG_Feed();
33
+ $feed = $feed_model->get_feed($feed_id);
34
+ return $feed;
35
+ }
36
+
37
+ function ajax_edit_feed() {
38
+ if (current_user_can('manage_options') && check_ajax_referer('qligg_edit_feed', 'nonce', false)) {
39
+
40
+ $feed_id = (isset($_REQUEST['feed_id'])) ? absint($_REQUEST['feed_id']) : -1;
41
+
42
+ if ($feed_id != -1) {
43
+ $feed = $this->get_feed($feed_id);
44
+ if ($feed) {
45
+ return parent::success_ajax($feed);
46
+ }
47
+ }
48
+ parent::error_reload_page();
49
+ }
50
+ parent::error_access_denied();
51
+ }
52
+
53
+ function ajax_save_feed() {
54
+
55
+ if (isset($_REQUEST['feed']) && current_user_can('manage_options') && check_ajax_referer('qligg_save_feed', 'nonce', false)) {
56
+
57
+ $feed = json_decode(stripslashes($_REQUEST['feed']), true);
58
+
59
+ if (is_array($feed)) {
60
+
61
+ $feed_model = new QLIGG_Feed();
62
+
63
+ if (isset($feed['id'])) {
64
+ return parent::success_ajax($feed_model->update_feed($feed));
65
+ } else {
66
+ return parent::success_ajax($feed_model->add_feed($feed));
67
+ }
68
+
69
+ return parent::error_reload_page();
70
+ }
71
+ }
72
+ return parent::error_access_denied();
73
+ }
74
+
75
+ function ajax_delete_feed() {
76
+
77
+ if (isset($_REQUEST['feed_id']) && current_user_can('manage_options') && check_ajax_referer('qligg_delete_feed', 'nonce', false)) {
78
+
79
+ $feed_id = absint($_REQUEST['feed_id']);
80
+
81
+ $feed_model = new QLIGG_Feed();
82
+
83
+ $feed = $feed_model->delete_feed($feed_id);
84
+
85
+ if ($feed_id) {
86
+ return parent::success_ajax($feed);
87
+ }
88
+
89
+ parent::error_reload_page();
90
+ }
91
+
92
+ parent::error_access_denied();
93
+ }
94
+
95
+ function ajax_clear_cache() {
96
+
97
+ global $wpdb;
98
+
99
+ if (isset($_REQUEST['feed_id']) && current_user_can('manage_options') && check_ajax_referer('qligg_clear_cache', 'nonce', false)) {
100
+
101
+ $feed_id = absint($_REQUEST['feed_id']);
102
+
103
+ $feed_model = new QLIGG_Feed();
104
+
105
+ $feed = $feed_model->get_feed($feed_id);
106
+
107
+ if ($feed['type'] == 'username') {
108
+ $tk = "%%insta_gallery_user_items_{$feed['username']}_%%";
109
+ } else {
110
+ $tk = "%%insta_gallery_tag_items_{$feed['tag']}_%%";
111
+ }
112
+
113
+ if ($tks = $wpdb->get_row($wpdb->prepare("SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE %s", $tk))) {
114
+ foreach ($tks as $key => $name) {
115
+ delete_transient(str_replace('_transient_', '', $name));
116
+ }
117
+ }
118
+
119
+ return parent::success_ajax(esc_html__('Feed cache cleared', 'insta-gallery'));
120
+ }
121
+
122
+ parent::error_access_denied();
123
+ }
124
+
125
+ function init() {
126
+ add_action('wp_ajax_qligg_edit_feed', array($this, 'ajax_edit_feed'));
127
+ add_action('wp_ajax_qligg_save_feed', array($this, 'ajax_save_feed'));
128
+ add_action('wp_ajax_qligg_delete_feed', array($this, 'ajax_delete_feed'));
129
+ add_action('wp_ajax_qligg_clear_cache', array($this, 'ajax_clear_cache'));
130
+ add_action('admin_enqueue_scripts', array($this, 'add_js'));
131
+ add_action('admin_menu', array($this, 'add_menu'));
132
+ }
133
+
134
+ function add_js() {
135
+ if (isset($_GET['page']) && ($_GET['page'] === self::$slug)) {
136
+ $feed_model = new QLIGG_Feed();
137
+ wp_enqueue_script('qligg-admin-feed', plugins_url('/assets/backend/js/qligg-admin-feed' . QLIGG::is_min() . '.js', QLIGG_PLUGIN_FILE), array('wp-util', 'jquery', 'backbone', 'jquery-serializejson', 'wp-color-picker-alpha', 'jquery-ui-sortable'), QLIGG_PLUGIN_VERSION, true);
138
+ wp_localize_script('qligg-admin-feed', 'qligg_feed', array(
139
+ 'nonce' => array(
140
+ 'qligg_edit_feed' => wp_create_nonce('qligg_edit_feed'),
141
+ 'qligg_save_feed' => wp_create_nonce('qligg_save_feed'),
142
+ 'qligg_delete_feed' => wp_create_nonce('qligg_delete_feed'),
143
+ 'qligg_clear_cache' => wp_create_nonce('qligg_clear_cache'),
144
+ ),
145
+ 'message' => array(
146
+ 'confirm_delete' => __('Do you want to delete the feed?', 'insta-gallery'),
147
+ 'confirm_clear_cache' => __('Do you want to delete the feed?', 'insta-gallery')
148
+ ),
149
+ 'args' => $feed_model->get_args()[1]));
150
+ }
151
+ }
152
+
153
+ public static function instance() {
154
+ if (!isset(self::$instance)) {
155
+ self::$instance = new self();
156
+ self::$instance->init();
157
+ }
158
+ return self::$instance;
159
+ }
160
+
161
+ }
162
+
163
+ QLIGG_Feed_Controller::instance();
includes/controllers/PremiumController.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLIGG_Premium_Controller {
4
+
5
+ protected static $instance;
6
+ protected static $slug = QLIGG_DOMAIN . '_premium';
7
+
8
+ function add_menu() {
9
+ add_submenu_page(QLIGG_DOMAIN, esc_html__('Premium', 'insta-gallery'), sprintf('%s <i class="dashicons dashicons-awards"></i>', esc_html__('Premium', 'insta-gallery')), 'edit_posts', self::$slug, array($this, 'add_panel'));
10
+ }
11
+
12
+ function add_panel() {
13
+ global $submenu;
14
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
15
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/premium.php');
16
+ }
17
+
18
+ function init() {
19
+ add_action('admin_menu', array($this, 'add_menu'));
20
+ add_action('admin_footer', array($this, 'add_css'));
21
+ }
22
+
23
+ function add_css() {
24
+
25
+ if (isset($_GET['page']) && strpos($_GET['page'], QLIGG_DOMAIN) !== false) {
26
+ if (!class_exists('QLIGG_PRO')) {
27
+ ?>
28
+ <style>
29
+ .qligg-premium-field {
30
+ opacity: 0.5;
31
+ pointer-events: none;
32
+ }
33
+ .qligg-premium-field .description {
34
+ display: inline-block!important;
35
+ }
36
+ </style>
37
+ <?php
38
+ }
39
+ }
40
+ }
41
+
42
+ public static function instance() {
43
+ if (!isset(self::$instance)) {
44
+ self::$instance = new self();
45
+ self::$instance->init();
46
+ }
47
+ return self::$instance;
48
+ }
49
+
50
+ }
51
+
52
+ QLIGG_Premium_Controller::instance();
includes/controllers/QLIGG_Controller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLIGG_Controller {
4
+
5
+ function error_ajax($data) {
6
+ return wp_send_json_error($data);
7
+ }
8
+
9
+ function success_ajax($data) {
10
+ return wp_send_json_success($data);
11
+ }
12
+
13
+ function error_reload_page() {
14
+ return wp_send_json_error(esc_html__('Please, reload page', 'insta-gallery'));
15
+ }
16
+
17
+ function error_access_denied() {
18
+ return wp_send_json_error(esc_html__('Access denied', 'insta-gallery'));
19
+ }
20
+
21
+ }
includes/controllers/SettingController.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Setting.php');
4
+ include_once(QLIGG_PLUGIN_DIR . 'includes/controllers/SettingController.php');
5
+
6
+ class QLIGG_Setting_Controller extends QLIGG_Controller {
7
+
8
+ protected static $instance;
9
+ protected static $slug = QLIGG_DOMAIN . '_setting';
10
+
11
+ function add_menu() {
12
+ add_submenu_page(QLIGG_DOMAIN, esc_html__('Setting', 'insta-gallery'), esc_html__('Setting', 'insta-gallery'), 'manage_options', self::$slug, array($this, 'add_panel'));
13
+ }
14
+
15
+ function add_panel() {
16
+ global $submenu;
17
+ $settings_model = new QLIGG_Setting();
18
+ $settings = $settings_model->get_settings();
19
+
20
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
21
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/settings.php');
22
+ }
23
+
24
+ function init() {
25
+ add_action('wp_ajax_qligg_save_settings', array($this, 'ajax_save_settings'));
26
+ add_action('admin_enqueue_scripts', array($this, 'add_js'));
27
+ add_action('admin_menu', array($this, 'add_menu'));
28
+ }
29
+
30
+ function ajax_save_settings() {
31
+
32
+ if (!empty($_REQUEST['settings_data']) && current_user_can('manage_options') && check_admin_referer('qligg_save_settings', 'nonce')) {
33
+ $settings_model = new QLIGG_Setting();
34
+
35
+ $settings_data = array();
36
+ parse_str($_REQUEST['settings_data'], $settings_data);
37
+
38
+ $settings_model->save_settings($settings_data);
39
+ parent::success_ajax(esc_html__('Settings updated successfully', 'insta-gallery'));
40
+ }
41
+
42
+ parent::error_ajax(esc_html__('Invalid Request', 'insta-gallery'));
43
+ }
44
+
45
+ function add_js() {
46
+ if (isset($_GET['page']) && ($_GET['page'] === self::$slug)) {
47
+ wp_enqueue_media();
48
+ wp_enqueue_script('qligg-admin-settings', plugins_url('/assets/backend/js/qligg-admin-settings' . QLIGG::is_min() . '.js', QLIGG_PLUGIN_FILE), array('wp-util', 'jquery', 'backbone', 'jquery-serializejson', 'wp-color-picker-alpha'), QLIGG_PLUGIN_VERSION, true);
49
+ wp_localize_script('qligg-admin-settings', 'qligg_settings', array(
50
+ 'nonce' => array(
51
+ 'qligg_save_settings' => wp_create_nonce('qligg_save_settings'),
52
+ )
53
+ ));
54
+ }
55
+ }
56
+
57
+ public static function instance() {
58
+ if (!isset(self::$instance)) {
59
+ self::$instance = new self();
60
+ self::$instance->init();
61
+ }
62
+ return self::$instance;
63
+ }
64
+
65
+ }
66
+
67
+ QLIGG_Setting_Controller::instance();
68
+
includes/controllers/SuggestionsController.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLIGG_Suggestions_Controller {
4
+
5
+ protected static $instance;
6
+ protected static $slug = QLIGG_DOMAIN . '_suggestions';
7
+
8
+ function add_menu() {
9
+ add_submenu_page(QLIGG_DOMAIN, esc_html__('Suggestions', 'insta-gallery'), sprintf('%s', esc_html__('Suggestions', 'insta-gallery')), 'edit_posts', QLIGG_DOMAIN . '_suggestions', array($this, 'add_panel'), 99);
10
+ }
11
+
12
+ function add_panel() {
13
+ global $submenu;
14
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Suggestions.php');
15
+ $wp_list_table = new QLIGG_Suggestions_List_Table();
16
+ $wp_list_table->prepare_items();
17
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
18
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/suggestions.php');
19
+ }
20
+
21
+ function init() {
22
+ add_action('admin_menu', array($this, 'add_menu'));
23
+ add_action('admin_init', array($this, 'add_redirect'));
24
+ add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
25
+ }
26
+
27
+ public function add_redirect() {
28
+
29
+ if (isset($_REQUEST['activate']) && $_REQUEST['activate'] == 'true') {
30
+ if (wp_get_referer() == admin_url('admin.php?page=' . QLIGG_DOMAIN . '_suggestions')) {
31
+ wp_redirect(admin_url('admin.php?page=' . QLIGG_DOMAIN . '_suggestions'));
32
+ }
33
+ }
34
+ }
35
+
36
+ // fix for activateUrl on install now button
37
+ public function network_admin_url($url, $path) {
38
+
39
+ if (wp_doing_ajax() && !is_network_admin()) {
40
+ if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin') {
41
+ if (strpos($url, 'plugins.php') !== false) {
42
+ $url = self_admin_url($path);
43
+ }
44
+ }
45
+ }
46
+ return $url;
47
+ }
48
+
49
+ public static function instance() {
50
+ if (!isset(self::$instance)) {
51
+ self::$instance = new self();
52
+ self::$instance->init();
53
+ }
54
+ return self::$instance;
55
+ }
56
+
57
+ }
58
+
59
+ QLIGG_Suggestions_Controller ::instance();
includes/controllers/WelcomeController.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLIGG_Welcome_Controller {
4
+
5
+ protected static $instance;
6
+
7
+ public static function instance() {
8
+ if (!isset(self::$instance)) {
9
+ self::$instance = new self();
10
+ self::$instance->init();
11
+ }
12
+ return self::$instance;
13
+ }
14
+
15
+ function init() {
16
+ add_action('admin_menu', array($this, 'add_menu'));
17
+ }
18
+
19
+ function add_menu() {
20
+ add_menu_page(QLIGG_PLUGIN_NAME, QLIGG_PLUGIN_NAME, 'edit_posts', QLIGG_DOMAIN, array($this, 'add_panel'), 'dashicons-camera');
21
+ add_submenu_page(QLIGG_DOMAIN, esc_html__('Welcome', 'insta-gallery'), esc_html__('Welcome', 'insta-gallery'), 'edit_posts', QLIGG_DOMAIN, array($this, 'add_panel'));
22
+ }
23
+
24
+ function add_panel() {
25
+ global $submenu;
26
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
27
+ include (QLIGG_PLUGIN_DIR . '/includes/view/backend/pages/welcome.php');
28
+ }
29
+
30
+ }
31
+
32
+ QLIGG_Welcome_Controller ::instance();
includes/defaults.php DELETED
@@ -1,240 +0,0 @@
1
- <?php
2
-
3
- if (!defined('ABSPATH'))
4
- exit;
5
-
6
- if (!class_exists('QLIGG_Options')) {
7
-
8
- class QLIGG_Options {
9
-
10
- protected static $instance;
11
- public $instagram_feed = array(
12
- 'insta_source' => 'username',
13
- 'insta_tag' => '',
14
- 'insta_username' => '',
15
- 'insta_layout' => 'gallery',
16
- // Box
17
- // ---------------------------------------------------------------------
18
- 'insta_box' => false,
19
- 'insta_box-padding' => 0,
20
- 'insta_box-radius' => 0,
21
- 'insta_box-background' => false,
22
- 'insta_box-profile' => false,
23
- 'insta_box-desc' => false,
24
- // Masonry
25
- // ---------------------------------------------------------------------
26
- 'insta_highlight-tag' => '',
27
- 'insta_highlight-id' => '',
28
- 'insta_highlight-position' => '',
29
- // Carousel
30
- // ---------------------------------------------------------------------
31
- 'insta_car-slidespv' => 5,
32
- 'insta_car-autoplay' => true,
33
- 'insta_car-autoplay-interval' => '3000',
34
- 'insta_car-navarrows' => true,
35
- 'insta_car-navarrows-color' => '',
36
- 'insta_car-pagination' => true,
37
- 'insta_car-pagination-color' => '',
38
- // Gallery
39
- // ---------------------------------------------------------------------
40
- 'insta_gal-cols' => 3,
41
- // General
42
- // ---------------------------------------------------------------------
43
- 'insta_limit' => 12,
44
- 'insta_spacing' => 10,
45
- 'insta_size' => 'standard',
46
- // Mask
47
- // ---------------------------------------------------------------------
48
- 'insta_hover' => true,
49
- 'insta_hover-color' => '',
50
- 'insta_likes' => true,
51
- 'insta_comments' => true,
52
- // Button
53
- // ---------------------------------------------------------------------
54
- 'insta_button' => true,
55
- 'insta_button-text' => 'View on Instagram',
56
- 'insta_button-background' => '',
57
- 'insta_button-background-hover' => '',
58
- // Popup
59
- // ---------------------------------------------------------------------
60
- 'insta_popup' => true,
61
- // Premium
62
- // ---------------------------------------------------------------------
63
- // ---------------------------------------------------------------------
64
- 'insta_popup-profile' => false,
65
- 'insta_popup-caption' => false,
66
- 'insta_popup-likes' => false,
67
- 'insta_popup-align' => 'bottom',
68
- // Button
69
- // ---------------------------------------------------------------------
70
- 'insta_button_load' => false,
71
- 'insta_button_load-text' => 'Load more...',
72
- 'insta_button_load-background' => '',
73
- 'insta_button_load-background-hover' => '',
74
- // Card
75
- // ---------------------------------------------------------------------
76
- 'insta_card' => false,
77
- 'insta_card-radius' => '',
78
- 'insta_card-font-size' => '',
79
- 'insta_card-background' => '',
80
- 'insta_card-padding' => '',
81
- 'insta_card-info' => '',
82
- 'insta_card-length' => 10,
83
- 'insta_card-caption' => '',
84
- );
85
-
86
- /* function defaults() {
87
-
88
- $this->defaults = array(
89
- '3617511663' => '3617511663.6e628e6.b9ce4730be83482f84943bc2cbfdd077',
90
- );
91
-
92
- return $this->defaults;
93
- } */
94
-
95
- function options() {
96
-
97
- global $qligg, $qligg_token;
98
-
99
- $qligg = get_option('insta_gallery_settings', array(
100
- 'insta_license' => 0,
101
- 'insta_flush' => 0,
102
- 'insta_reset' => 1,
103
- 'insta_spinner_image_id' => 0
104
- ));
105
-
106
- $qligg_token = get_option('insta_gallery_token', get_option('insta_gallery_iac', array()));
107
- }
108
-
109
- function rename_insta_gallery_token($qligg_token = array()) {
110
-
111
- if (isset($qligg_token['access_token'])) {
112
-
113
- $access_token = base64_decode($qligg_token['access_token']);
114
-
115
- $access_token_id = explode('.', $access_token);
116
-
117
- $qligg_token = array(
118
- $access_token_id[0] => $access_token
119
- );
120
- }
121
-
122
- return $qligg_token;
123
- }
124
-
125
- function rename_insta_gallery_items($instagram_feeds = array()) {
126
-
127
- global $qligg_token;
128
-
129
- // Backward compatibility v2.2.3
130
- // -----------------------------------------------------------------------
131
-
132
- foreach ($instagram_feeds as $id => $instagram_feed) {
133
-
134
- if (!isset($instagram_feed['insta_username']) && !empty($instagram_feed['insta_user'])) {
135
- $instagram_feeds[$id]['insta_username'] = key($qligg_token);
136
- }
137
-
138
- if (!isset($instagram_feed['insta_source']) && !empty($instagram_feed['ig_select_from'])) {
139
- $instagram_feeds[$id]['insta_source'] = $instagram_feed['ig_select_from'];
140
- }
141
-
142
- if (!isset($instagram_feed['insta_layout']) && !empty($instagram_feed['ig_display_type'])) {
143
- $instagram_feeds[$id]['insta_layout'] = $instagram_feed['ig_display_type'];
144
- }
145
-
146
- if (empty($instagram_feed['insta_button-text'])) {
147
- $instagram_feeds[$id]['insta_button-text'] = 'View on Instagram';
148
- }
149
- if (empty($instagram_feed['insta_thumb']) && !empty($instagram_feed['insta_thumb-size'])) {
150
- $instagram_feeds[$id]['insta_size'] = $instagram_feed['insta_thumb-size'];
151
- }
152
- if (empty($instagram_feed['insta_button']) && !empty($instagram_feed['insta_instalink'])) {
153
- $instagram_feeds[$id]['insta_button'] = $instagram_feed['insta_instalink'];
154
- }
155
- if (empty($instagram_feed['insta_button-text']) && !empty($instagram_feed['insta_instalink-text'])) {
156
- $instagram_feeds[$id]['insta_button-text'] = $instagram_feed['insta_instalink-text'];
157
- }
158
- if (empty($instagram_feed['insta_button-background']) && !empty($instagram_feed['insta_instalink-bgcolor'])) {
159
- $instagram_feeds[$id]['insta_button-background'] = $instagram_feed['insta_instalink-bgcolor'];
160
- }
161
- if (empty($instagram_feed['insta_button-background-hover']) && !empty($instagram_feed['insta_instalink-hvrcolor'])) {
162
- $instagram_feeds[$id]['insta_button-background-hover'] = $instagram_feed['insta_instalink-hvrcolor'];
163
- }
164
-
165
- if (!isset($instagram_feed['insta_limit'])) {
166
-
167
- $instagram_feeds[$id]['insta_limit'] = 12;
168
-
169
- if (isset($instagram_feed['insta_source']) && $instagram_feed['insta_source'] == 'username') {
170
- $instagram_feeds[$id]['insta_limit'] = absint($instagram_feed['insta_user-limit']);
171
- }
172
-
173
- if (isset($instagram_feed['insta_source']) && $instagram_feed['insta_source'] == 'tag') {
174
- $instagram_feeds[$id]['insta_limit'] = absint($instagram_feed['insta_tag-limit']);
175
- }
176
- }
177
-
178
- if (!isset($instagram_feed['insta_spacing'])) {
179
-
180
- $instagram_feeds[$id]['insta_spacing'] = 0;
181
-
182
- if (!empty($instagram_feed['insta_gal-spacing']) && $instagram_feed['insta_layout'] == 'gallery') {
183
- $instagram_feeds[$id]['insta_spacing'] = 10;
184
- }
185
-
186
- if (!empty($instagram_feed['insta_car-spacing']) && $instagram_feed['insta_layout'] == 'carousel') {
187
- $instagram_feeds[$id]['insta_spacing'] = 10;
188
- }
189
- }
190
-
191
- if (!isset($instagram_feed['insta_hover'])) {
192
-
193
- $instagram_feeds[$id]['insta_hover'] = true;
194
-
195
- if (isset($instagram_feed['insta_gal-hover']) && $instagram_feed['insta_layout'] == 'gallery') {
196
- $instagram_feeds[$id]['insta_hover'] = $instagram_feed['insta_gal-hover'];
197
- }
198
-
199
- if (isset($instagram_feed['insta_car-hover']) && $instagram_feed['insta_layout'] == 'carousel') {
200
- $instagram_feeds[$id]['insta_hover'] = $instagram_feed['insta_car-hover'];
201
- }
202
- }
203
-
204
- if (!isset($instagram_feed['insta_popup'])) {
205
-
206
- $instagram_feeds[$id]['insta_popup'] = true;
207
-
208
- if (isset($instagram_feed['insta_gal-popup']) && $instagram_feed['insta_layout'] == 'gallery') {
209
- $instagram_feeds[$id]['insta_popup'] = $instagram_feed['insta_gal-popup'];
210
- }
211
-
212
- if (isset($instagram_feed['insta_car-popup']) && $instagram_feed['insta_layout'] == 'carousel') {
213
- $instagram_feeds[$id]['insta_popup'] = $instagram_feed['insta_car-popup'];
214
- }
215
- }
216
- }
217
-
218
- return $instagram_feeds;
219
- }
220
-
221
- function init() {
222
- add_filter('option_insta_gallery_iac', array($this, 'rename_insta_gallery_token'), 10);
223
- add_filter('option_insta_gallery_token', array($this, 'rename_insta_gallery_token'), 10);
224
- add_filter('option_insta_gallery_items', array($this, 'rename_insta_gallery_items'), 10);
225
- add_action('init', array($this, 'options'));
226
- }
227
-
228
- public static function instance() {
229
- if (!isset(self::$instance)) {
230
- self::$instance = new self();
231
- //self::$instance->defaults();
232
- self::$instance->init();
233
- }
234
- return self::$instance;
235
- }
236
-
237
- }
238
-
239
- QLIGG_Options::instance();
240
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/frontend.php CHANGED
@@ -1,17 +1,20 @@
1
  <?php
 
2
  if (!defined('ABSPATH'))
3
  exit;
4
 
5
  if (!class_exists('QLIGG_Frontend')) {
6
 
 
7
  class QLIGG_Frontend {
8
 
9
  protected static $instance;
10
 
11
- function add_frontend_js() {
 
 
12
 
13
- wp_register_style('insta-gallery', plugins_url('/assets/css/qligg.min.css', QLIGG_PLUGIN_FILE), null, QLIGG_PLUGIN_VERSION);
14
- wp_register_script('insta-gallery', plugins_url('/assets/js/qligg.min.js', QLIGG_PLUGIN_FILE), array('jquery'), QLIGG_PLUGIN_VERSION, true);
15
 
16
  wp_localize_script('insta-gallery', 'qligg', array(
17
  'ajax_url' => admin_url('admin-ajax.php')
@@ -19,65 +22,71 @@ if (!class_exists('QLIGG_Frontend')) {
19
 
20
  // Masonry
21
  // -----------------------------------------------------------------------
22
- wp_register_script('desandro', plugins_url('/assets/masonry/masonry.pkgd.min.js', QLIGG_PLUGIN_FILE), null, QLIGG_PLUGIN_VERSION, true);
23
 
24
  // Swiper
25
  // -----------------------------------------------------------------------
26
- wp_register_style('swiper', plugins_url('/assets/swiper/swiper.min.css', QLIGG_PLUGIN_FILE), null, QLIGG_PLUGIN_VERSION);
27
- wp_register_script('swiper', plugins_url('/assets/swiper/swiper.min.js', QLIGG_PLUGIN_FILE), array('jquery'), QLIGG_PLUGIN_VERSION, true);
28
 
29
  // Popup
30
  // -----------------------------------------------------------------------
31
- wp_register_style('magnific-popup', plugins_url('/assets/magnific-popup/magnific-popup.min.css', QLIGG_PLUGIN_FILE), null, QLIGG_PLUGIN_VERSION);
32
- wp_register_script('magnific-popup', plugins_url('/assets/magnific-popup/jquery.magnific-popup.min.js', QLIGG_PLUGIN_FILE), array('jquery'), QLIGG_PLUGIN_VERSION, true);
33
  }
34
 
35
- function get_items($instagram_feed = false, $next_max_id = false) {
36
 
37
- if (isset($instagram_feed['type'])) {
38
 
39
- if ($instagram_feed['type'] == 'username') {
40
- return qligg_get_user_items($instagram_feed['username'], $instagram_feed['limit'], $next_max_id);
41
  }
42
 
43
- if ($instagram_feed['type'] == 'tag') {
44
- return qligg_get_tag_items($instagram_feed['tag'], $instagram_feed['limit'], $next_max_id);
45
  }
46
  }
47
 
48
  return array();
49
  }
50
 
51
- function load_item_images() {
52
 
53
- global $qligg_token, $qligg_api;
54
 
55
- if (!isset($_REQUEST['feed']['id'])) {
56
  wp_send_json_error(esc_html__('Invalid item id', 'insta-gallery'));
57
  }
58
 
59
- $instagram_feed = $_REQUEST['feed'];
60
 
61
  $next_max_id = isset($_REQUEST['next_max_id']) ? $_REQUEST['next_max_id'] : null;
62
 
63
  ob_start();
64
 
65
- if (is_array($instagram_items = $this->get_items($instagram_feed, $next_max_id))) {
66
 
67
  // Template
68
  // ---------------------------------------------------------------------
69
 
70
  $i = 1;
71
 
72
- foreach ($instagram_items as $item) {
73
 
74
- $image = @$item['images'][$instagram_feed['size']];
 
 
 
 
 
 
75
 
76
  include($this->template_path('item/item.php'));
77
 
78
  $i++;
79
 
80
- if (($instagram_feed['limit'] != 0) && ($i > $instagram_feed['limit'])) {
81
  break;
82
  }
83
  }
@@ -109,157 +118,149 @@ if (!class_exists('QLIGG_Frontend')) {
109
 
110
  function do_shortcode($atts, $content = null) {
111
 
112
- global $qligg, $qligg_token, $qligg_api;
 
 
 
 
 
113
 
114
  $atts = shortcode_atts(array(
115
  'id' => 0), $atts);
116
 
117
  // Start loading
118
  // -----------------------------------------------------------------------
 
119
 
120
- if ($id = absint($atts['id'])) {
 
121
 
122
- if (count($instagram_feeds = get_option('insta_gallery_items', array()))) {
123
 
124
- if (isset($instagram_feeds[$id])) {
125
 
126
- $instagram_feed = wp_parse_args($instagram_feeds[$id], QLIGG_Options::instance()->instagram_feed);
127
-
128
- wp_enqueue_style('insta-gallery');
129
- wp_enqueue_script('insta-gallery');
130
-
131
- if ($instagram_feed['insta_popup']) {
132
- wp_enqueue_style('magnific-popup');
133
- wp_enqueue_script('magnific-popup');
134
- }
135
 
136
- if ($instagram_feed['insta_layout'] == 'carousel') {
137
- wp_enqueue_style('swiper');
138
- wp_enqueue_script('swiper');
139
- }
140
 
141
- if (in_array($instagram_feed['insta_layout'], array('masonry', 'highlight'))) {
142
- wp_enqueue_script('desandro');
 
143
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
 
145
- $item_selector = "insta-gallery-feed-{$id}";
146
-
147
- if (isset($instagram_feed['insta_source'])) {
 
148
 
149
- if ($instagram_feed['insta_source'] == 'username') {
 
 
150
 
151
- $profile_info = qligg_get_user_profile($instagram_feed['insta_username']);
152
- } else {
153
- $profile_info = qligg_get_tag_profile($instagram_feed['insta_tag']);
154
- }
155
- }
156
 
157
- $instagram_feed['insta_spacing'] = $instagram_feed['insta_spacing'] / 2;
158
-
159
- $options = array(
160
- 'id' => $id,
161
- 'profile' => array(
162
- 'id' => $profile_info['id'],
163
- 'user' => $profile_info['user'],
164
- 'name' => $profile_info['name'],
165
- 'picture' => $profile_info['picture'],
166
- 'link' => $profile_info['link'],
167
- ),
168
- 'type' => $instagram_feed['insta_source'],
169
- 'username' => $instagram_feed['insta_username'],
170
- 'tag' => $instagram_feed['insta_tag'],
171
- 'layout' => $instagram_feed['insta_layout'],
172
- 'limit' => $instagram_feed['insta_limit'],
173
- 'spacing' => $instagram_feed['insta_spacing'],
174
- 'size' => $instagram_feed['insta_size'],
175
- 'hover' => $instagram_feed['insta_hover'],
176
- 'comments' => $instagram_feed['insta_comments'],
177
- 'likes' => $instagram_feed['insta_likes'],
178
- 'columns' => $instagram_feed['insta_gal-cols'],
179
- 'highlight' => (array) explode(',', str_replace(' ', '', "{$instagram_feed['insta_highlight-tag']},{$instagram_feed['insta_highlight-id']},{$instagram_feed['insta_highlight-position']}")),
180
- 'carousel' => array(
181
- 'autoplay' => $instagram_feed['insta_car-autoplay'],
182
- 'interval' => $instagram_feed['insta_car-autoplay-interval'],
183
- 'slides' => $instagram_feed['insta_car-slidespv'],
184
- ),
185
- 'popup' => array(
186
- 'display' => $instagram_feed['insta_popup'],
187
- 'profile' => $instagram_feed['insta_popup-profile'],
188
- 'caption' => $instagram_feed['insta_popup-caption'],
189
- 'likes' => $instagram_feed['insta_popup-likes'],
190
- 'align' => $instagram_feed['insta_popup-align'],
191
- ),
192
- 'card' => array(
193
- 'display' => $instagram_feed['insta_card'],
194
- 'info' => $instagram_feed['insta_card-info'],
195
- 'caption' => $instagram_feed['insta_card-caption'],
196
- 'length' => $instagram_feed['insta_card-length'],
197
- )
198
- );
199
-
200
- ob_start();
201
- ?>
202
- <style>
203
- <?php
204
- if ($instagram_feed['insta_layout'] != 'carousel') {
205
- if (!empty($instagram_feed['insta_spacing'])) {
206
- echo "#{$item_selector} .insta-gallery-list {margin: 0 -{$instagram_feed['insta_spacing']}px;}";
207
- }
208
- if (!empty($instagram_feed['insta_spacing'])) {
209
- echo "#{$item_selector} .insta-gallery-list .insta-gallery-item {padding: {$instagram_feed['insta_spacing']}px;}";
210
- }
211
  }
212
- if ($instagram_feed['insta_layout'] == 'carousel') {
213
- if (!empty($instagram_feed['insta_car-pagination-color'])) {
214
- echo "#{$item_selector} .swiper-pagination-bullet-active {background-color: {$instagram_feed['insta_car-pagination-color']};}";
215
- }
216
- if (!empty($instagram_feed['insta_car-navarrows-color'])) {
217
- echo "#{$item_selector} .swiper-button-next > i, #{$item_selector} .swiper-button-prev > i {color: {$instagram_feed['insta_car-navarrows-color']};}";
218
- }
219
  }
220
- if (!empty($instagram_feed['insta_hover-color'])) {
221
- echo "#{$item_selector} .insta-gallery-list .insta-gallery-item .insta-gallery-image-wrap .insta-gallery-image-mask {background-color: {$instagram_feed['insta_hover-color']};}";
222
- }
223
- if (!empty($instagram_feed['insta_button-background'])) {
224
- echo "#{$item_selector} .insta-gallery-actions .insta-gallery-button {background-color: {$instagram_feed['insta_button-background']};}";
225
  }
226
- if (!empty($instagram_feed['insta_button-background-hover'])) {
227
- echo "#{$item_selector} .insta-gallery-actions .insta-gallery-button:hover {background-color: {$instagram_feed['insta_button-background-hover']};}";
228
  }
 
 
 
 
 
 
 
 
 
 
229
 
230
- if (!empty($qligg['insta_spinner_image_id'])) {
231
 
232
- $spinner = wp_get_attachment_image_src($qligg['insta_spinner_image_id'], 'full');
233
 
234
- if (!empty($spinner[0])) {
235
- echo "#{$item_selector} .insta-gallery-spinner {background-image:url($spinner[0])}";
236
- }
237
- }
238
- do_action('qligg_template_style', $item_selector, $instagram_feed);
239
- ?>
240
- </style>
241
- <?php
242
- if ($template_file = $this->template_path("{$instagram_feed['insta_layout']}.php")) {
243
- include($template_file);
244
- return ob_get_clean();
245
  }
 
 
 
 
 
 
 
 
 
246
 
247
- $messages = array(
248
- sprintf(esc_html__('The layout %s is not a available.', 'insta-gallery'), $instagram_feed['insta_layout'])
249
- );
250
 
251
- include($this->template_path('alert.php'));
252
 
253
- return ob_get_clean();
254
- }
255
  }
256
  }
257
  }
258
 
 
 
259
  function init() {
260
- add_action('wp_ajax_nopriv_qligg_load_item_images', array($this, 'load_item_images'));
261
- add_action('wp_ajax_qligg_load_item_images', array($this, 'load_item_images'));
262
- add_action('wp_enqueue_scripts', array($this, 'add_frontend_js'));
263
  add_shortcode('insta-gallery', array($this, 'do_shortcode'));
264
  }
265
 
1
  <?php
2
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Feed.php');
3
  if (!defined('ABSPATH'))
4
  exit;
5
 
6
  if (!class_exists('QLIGG_Frontend')) {
7
 
8
+
9
  class QLIGG_Frontend {
10
 
11
  protected static $instance;
12
 
13
+ function add_js() {
14
+
15
+ wp_register_style('insta-gallery', plugins_url('/assets/frontend/css/qligg' . QLIGG::is_min() . '.css', QLIGG_PLUGIN_FILE), null, QLIGG_PLUGIN_VERSION);
16
 
17
+ wp_register_script('insta-gallery', plugins_url('/assets/frontend/js/qligg' . QLIGG::is_min() . '.js', QLIGG_PLUGIN_FILE), array('jquery'), QLIGG_PLUGIN_VERSION, true);
 
18
 
19
  wp_localize_script('insta-gallery', 'qligg', array(
20
  'ajax_url' => admin_url('admin-ajax.php')
22
 
23
  // Masonry
24
  // -----------------------------------------------------------------------
25
+ wp_register_script('desandro', plugins_url('/assets/frontend/masonry/masonry.pkgd.min.js', QLIGG_PLUGIN_FILE), null, QLIGG_PLUGIN_VERSION, true);
26
 
27
  // Swiper
28
  // -----------------------------------------------------------------------
29
+ wp_register_style('swiper', plugins_url('/assets/frontend/swiper/swiper.min.css', QLIGG_PLUGIN_FILE), null, QLIGG_PLUGIN_VERSION);
30
+ wp_register_script('swiper', plugins_url('/assets/frontend/swiper/swiper.min.js', QLIGG_PLUGIN_FILE), array('jquery'), QLIGG_PLUGIN_VERSION, true);
31
 
32
  // Popup
33
  // -----------------------------------------------------------------------
34
+ wp_register_style('magnific-popup', plugins_url('/assets/frontend/magnific-popup/magnific-popup.min.css', QLIGG_PLUGIN_FILE), null, QLIGG_PLUGIN_VERSION);
35
+ wp_register_script('magnific-popup', plugins_url('/assets/frontend/magnific-popup/jquery.magnific-popup.min.js', QLIGG_PLUGIN_FILE), array('jquery'), QLIGG_PLUGIN_VERSION, true);
36
  }
37
 
38
+ function get_items($feed = false, $next_max_id = false) {
39
 
40
+ if (isset($feed['type'])) {
41
 
42
+ if ($feed['type'] == 'username') {
43
+ return qligg_get_user_items($feed['username'], $feed['limit'], $next_max_id);
44
  }
45
 
46
+ if ($feed['type'] == 'tag') {
47
+ return qligg_get_tag_items($feed['tag'], $feed['limit'], $next_max_id);
48
  }
49
  }
50
 
51
  return array();
52
  }
53
 
54
+ function ajax_load_item_images() {
55
 
56
+ global $qligg_api;
57
 
58
+ if (!isset($_REQUEST['feed'])) {
59
  wp_send_json_error(esc_html__('Invalid item id', 'insta-gallery'));
60
  }
61
 
62
+ $feed = json_decode(stripslashes($_REQUEST['feed']), true);
63
 
64
  $next_max_id = isset($_REQUEST['next_max_id']) ? $_REQUEST['next_max_id'] : null;
65
 
66
  ob_start();
67
 
68
+ if (is_array($feed_items = $this->get_items($feed, $next_max_id))) {
69
 
70
  // Template
71
  // ---------------------------------------------------------------------
72
 
73
  $i = 1;
74
 
75
+ foreach ($feed_items as $item) {
76
 
77
+ $image = $item['images'][$feed['resolution']];
78
+
79
+ // premium compatibility 2.6.6
80
+ $instagram_feed = $feed;
81
+ $instagram_feed['hover'] = $feed['mask']['display'];
82
+ $instagram_feed['likes'] = $feed['mask']['likes'];
83
+ $instagram_feed['comments'] = $feed['mask']['comments'];
84
 
85
  include($this->template_path('item/item.php'));
86
 
87
  $i++;
88
 
89
+ if (($feed['limit'] != 0) && ($i > $feed['limit'])) {
90
  break;
91
  }
92
  }
118
 
119
  function do_shortcode($atts, $content = null) {
120
 
121
+ global $qligg_api;
122
+
123
+ $feed_model = new QLIGG_Feed();
124
+ $feeds = $feed_model->get_feeds();
125
+ $settings_model = new QLIGG_Setting();
126
+ $settings = $settings_model->get_settings();
127
 
128
  $atts = shortcode_atts(array(
129
  'id' => 0), $atts);
130
 
131
  // Start loading
132
  // -----------------------------------------------------------------------
133
+ $id = absint($atts['id']);
134
 
135
+ if (count($feeds)) {
136
+ if (isset($feeds[$id])) {
137
 
138
+ $feed = wp_parse_args($feeds[$id], $feed_model->get_args()[1]);
139
 
140
+ // premium compatibility 2.6.6
141
 
142
+ if (isset($feed['type'])) {
 
 
 
 
 
 
 
 
143
 
144
+ if ($feed['type'] == 'username') {
 
 
 
145
 
146
+ $profile_info = qligg_get_user_profile($feed['username']);
147
+ } else {
148
+ $profile_info = qligg_get_tag_profile($feed['tag']);
149
  }
150
+ }
151
+ $feed['profile'] = $profile_info;
152
+ $feed['spacing'] = $feed['spacing'] / 2;
153
+
154
+ $feed['insta_layout'] = $feed['layout'];
155
+ $feed['insta_box'] = $feed['box']['display'];
156
+ $feed['insta_box-padding'] = $feed['box']['padding'];
157
+ $feed['insta_box-radius'] = $feed['box']['radius'];
158
+ $feed['insta_box-background'] = $feed['box']['background'];
159
+ $feed['insta_box-profile'] = $feed['box']['profile'];
160
+ $feed['insta_box-desc'] = $feed['box']['desc'];
161
+
162
+ $feed['insta_button_load'] = $feed['button_load']['display'];
163
+ $feed['insta_button_load-background-hover'] = $feed['button_load']['background_hover'];
164
+ $feed['insta_button_load-background'] = $feed['button_load']['background'];
165
+ $feed['insta_button_load-text'] = $feed['button_load']['text'];
166
+
167
+ $feed['insta_button'] = $feed['button']['display'];
168
+ $feed['insta_button-background-hover'] = $feed['button']['background_hover'];
169
+ $feed['insta_button-background'] = $feed['button']['background'];
170
+ $feed['insta_button-text'] = $feed['button']['text'];
171
+
172
+ $feed['insta_card'] = $feed['card']['display'];
173
+ $feed['insta_card-font-size'] = $feed['card']['font_size'];
174
+ $feed['insta_card-padding'] = $feed['card']['padding'];
175
+ $feed['insta_card-radius'] = $feed['card']['radius'];
176
+ $feed['insta_card-background'] = $feed['card']['background'];
177
+ $feed['highlight'] = explode(',', trim(str_replace(' ', '', "{$feed['highlight']['tag']},{$feed['highlight']['id']},{$feed['highlight']['position']}"), ','));
178
+
179
+ $options = $instagram_feed = $feed;
180
+
181
+ wp_enqueue_style('insta-gallery');
182
+ wp_enqueue_script('insta-gallery');
183
+
184
+ if (!empty($feed['popup']['display'])) {
185
+ wp_enqueue_style('magnific-popup');
186
+ wp_enqueue_script('magnific-popup');
187
+ }
188
 
189
+ if ($feed['layout'] == 'carousel') {
190
+ wp_enqueue_style('swiper');
191
+ wp_enqueue_script('swiper');
192
+ }
193
 
194
+ if (in_array($feed['layout'], array('masonry', 'highlight'))) {
195
+ wp_enqueue_script('desandro');
196
+ }
197
 
198
+ $item_selector = "insta-gallery-feed-{$id}";
 
 
 
 
199
 
200
+ ob_start();
201
+ ?>
202
+ <style>
203
+ <?php
204
+ if ($feed['layout'] != 'carousel') {
205
+ if (!empty($feed['spacing'])) {
206
+ echo "#{$item_selector} .insta-gallery-list {margin: 0 -{$feed['spacing']}px;}";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  }
208
+ if (!empty($feed['spacing'])) {
209
+ echo "#{$item_selector} .insta-gallery-list .insta-gallery-item {padding: {$feed['spacing']}px;}";
 
 
 
 
 
210
  }
211
+ }
212
+ if ($feed['layout'] == 'carousel') {
213
+ if (!empty($feed['carousel']['pagination_color'])) {
214
+ echo "#{$item_selector} .swiper-pagination-bullet-active {background-color: {$feed['carousel']['pagination_color']};}";
 
215
  }
216
+ if (!empty($feed['carousel']['navarrows_color'])) {
217
+ echo "#{$item_selector} .swiper-button-next > i, #{$item_selector} .swiper-button-prev > i {color: {$feed['carousel']['navarrows_color']};}";
218
  }
219
+ }
220
+ if (!empty($feed['mask']['background'])) {
221
+ echo "#{$item_selector} .insta-gallery-list .insta-gallery-item .insta-gallery-image-wrap .insta-gallery-image-mask {background-color: {$feed['mask']['background']};}";
222
+ }
223
+ if (!empty($feed['button']['background'])) {
224
+ echo "#{$item_selector} .insta-gallery-actions .insta-gallery-button {background-color: {$feed['button']['background']};}";
225
+ }
226
+ if (!empty($feed['button']['background_hover'])) {
227
+ echo "#{$item_selector} .insta-gallery-actions .insta-gallery-button:hover {background-color: {$feed['button']['background_hover']};}";
228
+ }
229
 
230
+ if (!empty($settings['insta_spinner_image_id'])) {
231
 
232
+ $spinner = wp_get_attachment_image_src($settings['insta_spinner_image_id'], 'full');
233
 
234
+ if (!empty($spinner[0])) {
235
+ echo "#{$item_selector} .insta-gallery-spinner {background-image:url($spinner[0])}";
 
 
 
 
 
 
 
 
 
236
  }
237
+ }
238
+ do_action('qligg_template_style', $item_selector, $feed);
239
+ ?>
240
+ </style>
241
+ <?php
242
+ if ($template_file = $this->template_path("{$feed['layout']}.php")) {
243
+ include($template_file);
244
+ return ob_get_clean();
245
+ }
246
 
247
+ $messages = array(
248
+ sprintf(esc_html__('The layout %s is not a available.', 'insta-gallery'), $feed['layout'])
249
+ );
250
 
251
+ include($this->template_path('alert.php'));
252
 
253
+ return ob_get_clean();
 
254
  }
255
  }
256
  }
257
 
258
+ // }
259
+
260
  function init() {
261
+ add_action('wp_ajax_nopriv_qligg_load_item_images', array($this, 'ajax_load_item_images'));
262
+ add_action('wp_ajax_qligg_load_item_images', array($this, 'ajax_load_item_images'));
263
+ add_action('wp_enqueue_scripts', array($this, 'add_js'));
264
  add_shortcode('insta-gallery', array($this, 'do_shortcode'));
265
  }
266
 
includes/{utis.php → helpers.php} RENAMED
@@ -1,13 +1,37 @@
1
  <?php
2
 
3
- if (!defined('ABSPATH'))
4
- exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  // Return user profile
7
  // -----------------------------------------------------------------------------
8
  function qligg_get_user_profile($user_id = null) {
9
 
10
- global $qligg, $qligg_token, $qligg_api;
 
 
 
 
 
11
 
12
  $profile_info = array();
13
 
@@ -21,15 +45,15 @@ function qligg_get_user_profile($user_id = null) {
21
  'link' => ''
22
  );
23
 
24
- if (empty($user_id) || !isset($qligg_token[$user_id])) {
25
  return $defaults;
26
  }
27
 
28
  if (QLIGG_DEVELOPER || false === ($profile_info = get_transient($tk))) {
29
- foreach ($qligg_token as $id => $access_token) {
30
  $profile_info[$id] = $qligg_api->get_user_profile($access_token);
31
  }
32
- set_transient($tk, $profile_info, absint($qligg['insta_reset']) * HOUR_IN_SECONDS);
33
  }
34
 
35
  if (!isset($profile_info[$user_id])) {
@@ -49,18 +73,21 @@ function qligg_get_user_profile($user_id = null) {
49
  // -----------------------------------------------------------------------------
50
  function qligg_get_tag_profile($tag = null) {
51
 
52
- global $qligg, $qligg_token, $qligg_api;
53
 
54
  if (!$tag) {
55
  return;
56
  }
57
 
 
 
 
58
  $tk = "insta_gallery_tag_items_{$tag}_";
59
 
60
  // Get any existing copy of our transient data
61
  if (QLIGG_DEVELOPER || false === ($response = get_transient($tk))) {
62
  if ($response = $qligg_api->get_tag_items($tag)) {
63
- set_transient($tk, $response, absint($qligg['insta_reset']) * HOUR_IN_SECONDS);
64
  }
65
  }
66
 
@@ -89,24 +116,30 @@ function qligg_get_tag_profile($tag = null) {
89
  // -----------------------------------------------------------------------------
90
  function qligg_get_user_items($user_id = null, $limit = 12, $next_max_id = null, $max_id = null) {
91
 
92
- global $qligg, $qligg_token, $qligg_api;
93
 
94
  if (!$user_id) {
95
  $qligg_api->set_message(esc_html__('Please update Instagram User in the gallery settings tab.', 'insta-gallery'));
96
  return;
97
  }
98
 
99
- if (empty($qligg_token[$user_id])) {
 
 
 
100
  $qligg_api->set_message(esc_html__('Please update Instagram Access Token in the account settings tab.', 'insta-gallery'));
101
  return;
102
  }
103
 
 
 
 
104
  $tk = "insta_gallery_user_items_{$user_id}_{$max_id}";
105
 
106
  // Get any existing copy of our transient data
107
  if (QLIGG_DEVELOPER || false === ($response = get_transient($tk))) {
108
- if ($response = $qligg_api->get_user_items($qligg_token[$user_id], $max_id)) {
109
- set_transient($tk, $response, absint($qligg['insta_reset']) * HOUR_IN_SECONDS);
110
  }
111
  }
112
 
@@ -114,39 +147,45 @@ function qligg_get_user_items($user_id = null, $limit = 12, $next_max_id = null,
114
  return;
115
  }
116
 
117
- if (count($instagram_feeds = $qligg_api->setup_user_item($response['data'], $next_max_id, $max_id)) >= $limit) {
118
- return $instagram_feeds;
119
  }
120
 
121
  if (!$next_max_id) {
122
- return $instagram_feeds;
123
  }
124
 
125
  if (!isset($response['pagination']['next_max_id'])) {
126
- return $instagram_feeds;
127
  }
128
 
129
  $max_id = $response['pagination']['next_max_id'];
130
 
131
- return array_merge($instagram_feeds, qligg_get_user_items($user_id, $limit, $next_max_id, $max_id));
132
  }
133
 
134
  // Get tag items
135
  // -----------------------------------------------------------------------------
136
  function qligg_get_tag_items($tag = null, $limit = 12, $next_max_id = null, $end_cursor = null) {
137
 
138
- global $qligg, $qligg_token, $qligg_api;
 
 
 
139
 
140
  if (!$tag) {
141
  return;
142
  }
143
 
 
 
 
144
  $tk = "insta_gallery_tag_items_{$tag}_{$end_cursor}";
145
 
146
  // Get any existing copy of our transient data
147
  if (QLIGG_DEVELOPER || false === ($response = get_transient($tk))) {
148
  if ($response = $qligg_api->get_tag_items($tag, $end_cursor)) {
149
- set_transient($tk, $response, absint($qligg['insta_reset']) * HOUR_IN_SECONDS);
150
  }
151
  }
152
 
@@ -154,15 +193,15 @@ function qligg_get_tag_items($tag = null, $limit = 12, $next_max_id = null, $end
154
  return;
155
  }
156
 
157
- if (count($instagram_feeds = $qligg_api->setup_tag_item($response['graphql']['hashtag']['edge_hashtag_to_media']['edges'], $next_max_id)) >= $limit) {
158
- return $instagram_feeds;
159
  }
160
 
161
  if (!isset($response['graphql']['hashtag']['edge_hashtag_to_media']['page_info']['end_cursor'])) {
162
- return $instagram_feeds;
163
  }
164
 
165
  $end_cursor = $response['graphql']['hashtag']['edge_hashtag_to_media']['page_info']['end_cursor'];
166
 
167
- return array_merge($instagram_feeds, qligg_get_tag_items($tag, $limit, $next_max_id, $end_cursor));
168
  }
1
  <?php
2
 
3
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Token.php');
4
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Setting.php');
5
+
6
+ function qligg_sanitize_instagram_feed($feed) {
7
+
8
+ global $qligg_api;
9
+
10
+ // Removing @, # and trimming input
11
+ // ---------------------------------------------------------------------
12
+
13
+ $feed = sanitize_text_field($feed);
14
+
15
+ $feed = trim($feed);
16
+ $feed = str_replace('@', '', $feed);
17
+ $feed = str_replace('#', '', $feed);
18
+ $feed = str_replace($qligg_api->instagram_url, '', $feed);
19
+ $feed = str_replace('/explore/tags/', '', $feed);
20
+ $feed = str_replace('/', '', $feed);
21
+
22
+ return $feed;
23
+ }
24
 
25
  // Return user profile
26
  // -----------------------------------------------------------------------------
27
  function qligg_get_user_profile($user_id = null) {
28
 
29
+ global $qligg_api;
30
+
31
+ $settings_model = new QLIGG_Setting();
32
+ $settings = $settings_model->get_settings();
33
+ $token_model = new QLIGG_Token();
34
+ $tokens = $token_model->get_tokens();
35
 
36
  $profile_info = array();
37
 
45
  'link' => ''
46
  );
47
 
48
+ if (empty($user_id) || !isset($tokens[$user_id])) {
49
  return $defaults;
50
  }
51
 
52
  if (QLIGG_DEVELOPER || false === ($profile_info = get_transient($tk))) {
53
+ foreach ($tokens as $id => $access_token) {
54
  $profile_info[$id] = $qligg_api->get_user_profile($access_token);
55
  }
56
+ set_transient($tk, $profile_info, absint($settings['insta_reset']) * HOUR_IN_SECONDS);
57
  }
58
 
59
  if (!isset($profile_info[$user_id])) {
73
  // -----------------------------------------------------------------------------
74
  function qligg_get_tag_profile($tag = null) {
75
 
76
+ global $qligg_api;
77
 
78
  if (!$tag) {
79
  return;
80
  }
81
 
82
+ $settings_model = new QLIGG_Setting();
83
+ $settings = $settings_model->get_settings();
84
+
85
  $tk = "insta_gallery_tag_items_{$tag}_";
86
 
87
  // Get any existing copy of our transient data
88
  if (QLIGG_DEVELOPER || false === ($response = get_transient($tk))) {
89
  if ($response = $qligg_api->get_tag_items($tag)) {
90
+ set_transient($tk, $response, absint($settings['insta_reset']) * HOUR_IN_SECONDS);
91
  }
92
  }
93
 
116
  // -----------------------------------------------------------------------------
117
  function qligg_get_user_items($user_id = null, $limit = 12, $next_max_id = null, $max_id = null) {
118
 
119
+ global $qligg_api;
120
 
121
  if (!$user_id) {
122
  $qligg_api->set_message(esc_html__('Please update Instagram User in the gallery settings tab.', 'insta-gallery'));
123
  return;
124
  }
125
 
126
+ $token_model = new QLIGG_Token();
127
+ $tokens = $token_model->get_tokens();
128
+
129
+ if (empty($tokens[$user_id])) {
130
  $qligg_api->set_message(esc_html__('Please update Instagram Access Token in the account settings tab.', 'insta-gallery'));
131
  return;
132
  }
133
 
134
+ $settings_model = new QLIGG_Setting();
135
+ $settings = $settings_model->get_settings();
136
+
137
  $tk = "insta_gallery_user_items_{$user_id}_{$max_id}";
138
 
139
  // Get any existing copy of our transient data
140
  if (QLIGG_DEVELOPER || false === ($response = get_transient($tk))) {
141
+ if ($response = $qligg_api->get_user_items($tokens[$user_id], $max_id)) {
142
+ set_transient($tk, $response, absint($settings['insta_reset']) * HOUR_IN_SECONDS);
143
  }
144
  }
145
 
147
  return;
148
  }
149
 
150
+ if (count($feeds = $qligg_api->setup_user_item($response['data'], $next_max_id, $max_id)) >= $limit) {
151
+ return $feeds;
152
  }
153
 
154
  if (!$next_max_id) {
155
+ return $feeds;
156
  }
157
 
158
  if (!isset($response['pagination']['next_max_id'])) {
159
+ return $feeds;
160
  }
161
 
162
  $max_id = $response['pagination']['next_max_id'];
163
 
164
+ return array_merge($feeds, qligg_get_user_items($user_id, $limit, $next_max_id, $max_id));
165
  }
166
 
167
  // Get tag items
168
  // -----------------------------------------------------------------------------
169
  function qligg_get_tag_items($tag = null, $limit = 12, $next_max_id = null, $end_cursor = null) {
170
 
171
+ global $qligg_api;
172
+
173
+ $token_model = new QLIGG_Token();
174
+ $tokens = $token_model->get_tokens();
175
 
176
  if (!$tag) {
177
  return;
178
  }
179
 
180
+ $settings_model = new QLIGG_Setting();
181
+ $settings = $settings_model->get_settings();
182
+
183
  $tk = "insta_gallery_tag_items_{$tag}_{$end_cursor}";
184
 
185
  // Get any existing copy of our transient data
186
  if (QLIGG_DEVELOPER || false === ($response = get_transient($tk))) {
187
  if ($response = $qligg_api->get_tag_items($tag, $end_cursor)) {
188
+ set_transient($tk, $response, absint($settings['insta_reset']) * HOUR_IN_SECONDS);
189
  }
190
  }
191
 
193
  return;
194
  }
195
 
196
+ if (count($feeds = $qligg_api->setup_tag_item($response['graphql']['hashtag']['edge_hashtag_to_media']['edges'], $next_max_id)) >= $limit) {
197
+ return $feeds;
198
  }
199
 
200
  if (!isset($response['graphql']['hashtag']['edge_hashtag_to_media']['page_info']['end_cursor'])) {
201
+ return $feeds;
202
  }
203
 
204
  $end_cursor = $response['graphql']['hashtag']['edge_hashtag_to_media']['page_info']['end_cursor'];
205
 
206
+ return array_merge($feeds, qligg_get_tag_items($tag, $limit, $next_max_id, $end_cursor));
207
  }
includes/models/Feed.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include_once 'QLIGG_Model.php';
4
+
5
+ class QLIGG_Feed extends QLIGG_Model {
6
+
7
+ protected $table = 'insta_gallery_feeds';
8
+
9
+ function get_args() {
10
+ return array(
11
+ 1 => array(
12
+ 'id' => 1,
13
+ 'order' => 1,
14
+ // 'profile' => array(
15
+ // 'id' => '',
16
+ // 'user' => '',
17
+ // 'name' => '',
18
+ // 'picture' => '',
19
+ // 'link' => '',
20
+ // ),
21
+ 'type' => 'username',
22
+ 'username' => '3617511663',
23
+ 'tag' => '',
24
+ 'layout' => 'gallery',
25
+ 'limit' => 12,
26
+ 'columns' => 3,
27
+ 'resolution' => 'standard',
28
+ 'spacing' => 10,
29
+ 'highlight' => array(
30
+ 'tag' => '',
31
+ 'id' => '',
32
+ 'position' => ''
33
+ ),
34
+ 'box' => array(
35
+ 'display' => false,
36
+ 'padding' => 1,
37
+ 'radius' => 0,
38
+ 'background' => '#fefefe',
39
+ 'profile' => false,
40
+ 'desc' => '',
41
+ ),
42
+ 'mask' => array(
43
+ 'display' => true,
44
+ 'background' => '#000000',
45
+ 'likes' => true,
46
+ 'comments' => true,
47
+ ),
48
+ 'card' => array(
49
+ 'display' => false,
50
+ 'radius' => '1',
51
+ 'font_size' => '12',
52
+ 'background' => '#ffffff',
53
+ 'padding' => '5',
54
+ 'info' => true,
55
+ 'length' => 10,
56
+ 'caption' => true,
57
+ ),
58
+ 'carousel' => array(
59
+ 'slidespv' => 5,
60
+ 'autoplay' => false,
61
+ 'autoplay_interval' => 3000,
62
+ 'navarrows' => true,
63
+ 'navarrows_color' => '',
64
+ 'pagination' => true,
65
+ 'pagination_color' => ''
66
+ ),
67
+ 'popup' => array(
68
+ 'display' => true,
69
+ 'profile' => false,
70
+ 'caption' => false,
71
+ 'likes' => false,
72
+ 'align' => 'bottom',
73
+ ),
74
+ 'button' => array(
75
+ 'display' => true,
76
+ 'text' => 'View on Instagram',
77
+ 'background' => '',
78
+ 'background_hover' => '',
79
+ ),
80
+ 'button_load' => array(
81
+ 'display' => false,
82
+ 'text' => 'Load more...',
83
+ 'background' => '',
84
+ 'background_hover' => '',
85
+ ),
86
+ )
87
+ );
88
+ }
89
+
90
+ function get_next_id() {
91
+ $feeds = $this->get_feeds();
92
+ if (count($feeds)) {
93
+ return max(array_keys($feeds)) + 1;
94
+ }
95
+ return 0;
96
+ }
97
+
98
+ function get_feed($id) {
99
+
100
+ $feeds = $this->get_feeds();
101
+
102
+ if (isset($feeds[$id])) {
103
+ return $feeds[$id];
104
+ }
105
+ }
106
+
107
+ function get_feeds() {
108
+
109
+ $feeds = $this->get_all();
110
+ //make sure each feed has all values
111
+ if (count($feeds)) {
112
+ foreach ($feeds as $id => $feed) {
113
+ $feeds[$id] = array_replace_recursive($this->get_args()[1], $feeds[$id]);
114
+ }
115
+ }
116
+ return $feeds;
117
+ }
118
+
119
+ function update_feed($feed_data) {
120
+ return $this->save_feed($feed_data);
121
+ }
122
+
123
+ function update_feeds($feeds, $order = 0) {
124
+ return $this->save_all($feeds);
125
+ }
126
+
127
+ // create a new feed, get the next id
128
+ function add_feed($feed_data) {
129
+ $feed_id = $this->get_next_id();
130
+ $feed_data['id'] = $feed_id;
131
+ $feed_data['order'] = $feed_id + 1;
132
+ $feed_data['tag'] = qligg_sanitize_instagram_feed($feed_data['tag']);
133
+ $feed_data['username'] = qligg_sanitize_instagram_feed($feed_data['username']);
134
+ return $this->save_feed($feed_data);
135
+ }
136
+
137
+ function save_feed($feed_data = null) {
138
+ $feeds = $this->get_feeds();
139
+ $feeds[$feed_data['id']] = array_replace_recursive($this->get_args()[1], $feed_data);
140
+ return $this->save_all($feeds);
141
+ }
142
+
143
+ function delete_feed($id = null) {
144
+ $feeds = $this->get_all();
145
+ if ($feeds) {
146
+ if (count($feeds) > 0) {
147
+ unset($feeds[$id]);
148
+ return $this->save_all($feeds);
149
+ }
150
+ }
151
+ }
152
+
153
+ }
includes/models/QLIGG_Model.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLIGG_Model {
4
+
5
+ private $cache = array();
6
+ protected $table = null;
7
+
8
+ function sanitize_value(&$value, $key, $args) {
9
+
10
+ if (isset($args[$key])) {
11
+
12
+ $type = $args[$key];
13
+
14
+ if (is_null($type) && !is_numeric($value)) {
15
+ $value = intval($value);
16
+ } elseif (is_bool($type) && !is_bool($value)) {
17
+ $value = ($value === 'true' || $value === '1' || $value === 1);
18
+ } elseif (is_string($type) && !is_string($value)) {
19
+ $value = strval($value);
20
+ } elseif (is_array($type) && !is_array($value)) {
21
+ $value = (array) $type;
22
+ } elseif (is_array($type) && count($value)) {
23
+ array_walk($value, array($this, 'sanitize_value'), $type);
24
+ }
25
+ }
26
+
27
+ return $value;
28
+ }
29
+
30
+ function sanitize_data($value_data) {
31
+
32
+ $args = $this->get_args();
33
+
34
+ if (!count($args)) {
35
+ return $value_data;
36
+ }
37
+
38
+ $value_data = array_replace_recursive($args, $value_data);
39
+
40
+ if (!count($value_data)) {
41
+ return $value_data;
42
+ }
43
+
44
+ array_walk($value_data, array($this, 'sanitize_value'), $args);
45
+
46
+ return $value_data;
47
+ }
48
+
49
+ function save_all($data = null) {
50
+
51
+ if (!$this->table) {
52
+ error_log('Model can\'t be accesed directly');
53
+ die();
54
+ }
55
+
56
+ return update_option($this->table, $data);
57
+ }
58
+
59
+ function get_all() {
60
+
61
+ if (!$this->table) {
62
+ error_log('Model can\'t be accesed directly');
63
+ die();
64
+ }
65
+
66
+ if (!isset($this->cache[$this->table])) {
67
+ // $this->cache[$this->table] = $this->sanitize_data(get_option($this->table, array()));
68
+ $this->cache[$this->table] = get_option($this->table, $this->get_args());
69
+ }
70
+
71
+ return $this->cache[$this->table];
72
+ }
73
+
74
+ }
includes/models/Setting.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include_once 'QLIGG_Model.php';
4
+
5
+ class QLIGG_Setting extends QLIGG_Model {
6
+
7
+ protected $table = 'insta_gallery_settings';
8
+
9
+ function get_args() {
10
+ return array(
11
+ 'insta_flush' => 0,
12
+ 'insta_reset' => 1,
13
+ 'insta_spinner_image_id' => 666666
14
+ );
15
+ }
16
+
17
+ function get_settings() {
18
+ return $this->get_all();
19
+ }
20
+
21
+ function save($settings) {
22
+ wp_parse_args($settings, $this->get_settings());
23
+ return update_option($this->table, $settings);
24
+ }
25
+
26
+ function save_settings($settings_data = null) {
27
+ return $this->save_all($settings_data);
28
+ }
29
+
30
+ }
includes/{suggestions.php → models/Suggestions.php} RENAMED
@@ -1,132 +1,131 @@
1
- <?php
2
-
3
- require_once( ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php' );
4
-
5
- class QLIGG_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
6
-
7
- public $promote = array(
8
- 'wp-menu-icons',
9
- 'wp-whatsapp-chat',
10
- 'insta-gallery',
11
- 'quadmenu',
12
- 'woocommerce-checkout-manager',
13
- 'woocommerce-direct-checkout',
14
- );
15
-
16
- private function remove_plugins($plugins) {
17
-
18
- $promote = array();
19
-
20
- foreach ($this->promote as $order => $slug) {
21
-
22
- if ($id = @max(array_keys(array_column($plugins, 'slug'), $slug))) {
23
-
24
- $promote[] = $plugins[$id];
25
- }
26
- }
27
-
28
- return $promote;
29
- }
30
-
31
- public function self_admin_url($url, $path) {
32
-
33
- if (strpos($url, 'tab=plugin-information') !== false) {
34
- $url = network_admin_url($path);
35
- }
36
-
37
- return $url;
38
- }
39
-
40
- public function network_admin_url($url, $path) {
41
-
42
- if (strpos($url, 'plugins.php') !== false) {
43
- $url = self_admin_url($path);
44
- }
45
-
46
- return $url;
47
- }
48
-
49
- public function display_rows() {
50
- add_filter('self_admin_url', array($this, 'self_admin_url'), 10, 2);
51
- add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
52
- parent::display_rows();
53
- }
54
-
55
- public function is_connected() {
56
-
57
- global $wp_version;
58
-
59
- $http_args = array(
60
- 'timeout' => 15,
61
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url('/'),
62
- );
63
-
64
- return is_wp_error(wp_remote_get('http://api.wordpress.org/plugins/info/1.2/', $http_args));
65
- }
66
-
67
- public function get_plugins() {
68
-
69
- $plugins = get_transient('ql_suggestions_plugins');
70
-
71
- if ($plugins === false) {
72
-
73
- $args = array(
74
- 'per_page' => 36,
75
- 'author' => 'quadlayers',
76
- 'locale' => get_user_locale(),
77
- );
78
-
79
- $api = plugins_api('query_plugins', $args);
80
-
81
- if (!is_wp_error($api)) {
82
-
83
- $plugins = $this->remove_plugins($api->plugins);
84
-
85
- set_transient('ql_suggestions_plugins', $plugins, 24 * HOUR_IN_SECONDS);
86
- }
87
- }
88
-
89
- return $plugins;
90
- }
91
-
92
- public function prepare_items() {
93
-
94
- include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
95
-
96
- global $tabs, $tab;
97
-
98
- wp_enqueue_style('thickbox');
99
- wp_enqueue_script('plugin-install');
100
- wp_enqueue_script('thickbox');
101
- wp_enqueue_script('updates');
102
-
103
- wp_reset_vars(array('tab'));
104
-
105
- $tabs = array();
106
-
107
- if ('search' === $tab) {
108
- $tabs['search'] = __('Search Results');
109
- }
110
- if ($tab === 'beta' || false !== strpos(get_bloginfo('version'), '-')) {
111
- $tabs['beta'] = _x('Beta Testing', 'Plugin Installer');
112
- }
113
- $tabs['featured'] = _x('Featured', 'Plugin Installer');
114
- $tabs['popular'] = _x('Popular', 'Plugin Installer');
115
- $tabs['recommended'] = _x('Recommended', 'Plugin Installer');
116
- $tabs['favorites'] = _x('Favorites', 'Plugin Installer');
117
-
118
- $nonmenu_tabs = array('plugin-information'); // Valid actions to perform which do not have a Menu item.
119
-
120
- $tabs = apply_filters('install_plugins_tabs', $tabs);
121
-
122
- $nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs);
123
-
124
- // If a non-valid menu tab has been selected, And it's not a non-menu action.
125
- if (empty($tab) || (!isset($tabs[$tab]) && !in_array($tab, (array) $nonmenu_tabs) )) {
126
- $tab = key($tabs);
127
- }
128
-
129
- $this->items = $this->get_plugins();
130
- }
131
-
132
- }
1
+ <?php
2
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php' );
3
+
4
+ class QLIGG_Suggestions_List_Table extends WP_Plugin_Install_List_Table {
5
+
6
+ public $promote = array(
7
+ 'wp-menu-icons',
8
+ 'wp-whatsapp-chat',
9
+ 'insta-gallery',
10
+ 'quadmenu',
11
+ 'woocommerce-checkout-manager',
12
+ 'woocommerce-direct-checkout',
13
+ );
14
+
15
+ private function remove_plugins($plugins) {
16
+
17
+ $promote = array();
18
+
19
+ foreach ($this->promote as $order => $slug) {
20
+
21
+ if ($id = @max(array_keys(array_column($plugins, 'slug'), $slug))) {
22
+
23
+ $promote[] = $plugins[$id];
24
+ }
25
+ }
26
+
27
+ return $promote;
28
+ }
29
+
30
+ public function self_admin_url($url, $path) {
31
+
32
+ if (strpos($url, 'tab=plugin-information') !== false) {
33
+ $url = network_admin_url($path);
34
+ }
35
+
36
+ return $url;
37
+ }
38
+
39
+ public function network_admin_url($url, $path) {
40
+
41
+ if (strpos($url, 'plugins.php') !== false) {
42
+ $url = self_admin_url($path);
43
+ }
44
+
45
+ return $url;
46
+ }
47
+
48
+ public function display_rows() {
49
+ add_filter('self_admin_url', array($this, 'self_admin_url'), 10, 2);
50
+ add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
51
+ parent::display_rows();
52
+ }
53
+
54
+ public function is_connected() {
55
+
56
+ global $wp_version;
57
+
58
+ $http_args = array(
59
+ 'timeout' => 15,
60
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url('/'),
61
+ );
62
+
63
+ return is_wp_error(wp_remote_get('http://api.wordpress.org/plugins/info/1.2/', $http_args));
64
+ }
65
+
66
+ public function get_plugins() {
67
+
68
+ $plugins = get_transient('ql_suggestions_plugins');
69
+
70
+ if ($plugins === false) {
71
+
72
+ $args = array(
73
+ 'per_page' => 36,
74
+ 'author' => 'quadlayers',
75
+ 'locale' => get_user_locale(),
76
+ );
77
+
78
+ $api = plugins_api('query_plugins', $args);
79
+
80
+ if (!is_wp_error($api)) {
81
+
82
+ $plugins = $this->remove_plugins($api->plugins);
83
+
84
+ set_transient('ql_suggestions_plugins', $plugins, 24 * HOUR_IN_SECONDS);
85
+ }
86
+ }
87
+
88
+ return $plugins;
89
+ }
90
+
91
+ public function prepare_items() {
92
+
93
+ include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
94
+
95
+ global $tabs, $tab;
96
+
97
+ wp_enqueue_style('thickbox');
98
+ wp_enqueue_script('plugin-install');
99
+ wp_enqueue_script('thickbox');
100
+ wp_enqueue_script('updates');
101
+
102
+ wp_reset_vars(array('tab'));
103
+
104
+ $tabs = array();
105
+
106
+ if ('search' === $tab) {
107
+ $tabs['search'] = __('Search Results');
108
+ }
109
+ if ($tab === 'beta' || false !== strpos(get_bloginfo('version'), '-')) {
110
+ $tabs['beta'] = _x('Beta Testing', 'Plugin Installer');
111
+ }
112
+ $tabs['featured'] = _x('Featured', 'Plugin Installer');
113
+ $tabs['popular'] = _x('Popular', 'Plugin Installer');
114
+ $tabs['recommended'] = _x('Recommended', 'Plugin Installer');
115
+ $tabs['favorites'] = _x('Favorites', 'Plugin Installer');
116
+
117
+ $nonmenu_tabs = array('plugin-information'); // Valid actions to perform which do not have a Menu item.
118
+
119
+ $tabs = apply_filters('install_plugins_tabs', $tabs);
120
+
121
+ $nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs);
122
+
123
+ // If a non-valid menu tab has been selected, And it's not a non-menu action.
124
+ if (empty($tab) || (!isset($tabs[$tab]) && !in_array($tab, (array) $nonmenu_tabs) )) {
125
+ $tab = key($tabs);
126
+ }
127
+
128
+ return $this->items = $this->get_plugins();
129
+ }
130
+
131
+ }
 
includes/models/Token.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include_once 'QLIGG_Model.php';
4
+
5
+ class QLIGG_Token extends QLIGG_Model {
6
+
7
+ protected $table = 'insta_gallery_token';
8
+
9
+ function get_args() {
10
+ return array(
11
+ '3617511663' => '3617511663.6e628e6.07625a349d1742a0815aca2f0654d4a4'
12
+ );
13
+ }
14
+
15
+ function get_tokens() {
16
+ return $this->get_all();
17
+ }
18
+
19
+ function add_token($token = null, $id = null) {
20
+ $tokens = $this->get_tokens();
21
+ // Fix compatibility between PHP 7.0 and 5.2
22
+ if (is_array($tokens) && count($tokens) && class_exists('QLIGG_PRO')) {
23
+ $tokens += $token;
24
+ } else {
25
+ $tokens = $token;
26
+ }
27
+ $this->save_token($tokens);
28
+ }
29
+
30
+ function delete_token($token_id) {
31
+ $tokens = $this->get_tokens();
32
+ unset($tokens[$token_id]);
33
+ $this->save_token($tokens);
34
+ }
35
+
36
+ function save_token($tokens) {
37
+ $this->save_all($tokens);
38
+ delete_transient('insta_gallery_user_profile');
39
+ }
40
+
41
+ }
includes/notices.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLIGG_Notices {
4
+
5
+ protected static $instance;
6
+
7
+ public static function instance() {
8
+ if (is_null(self::$instance)) {
9
+ self::$instance = new self();
10
+ self::$instance->init();
11
+ }
12
+ return self::$instance;
13
+ }
14
+
15
+ function init() {
16
+ add_filter('plugin_action_links_' . plugin_basename(QLIGG_PLUGIN_FILE), array($this, 'add_action_links'));
17
+ add_action('admin_notices', array($this, 'add_notices'));
18
+ add_action('wp_ajax_qligg_dismiss_notice', array($this, 'ajax_dismiss_notice'));
19
+ }
20
+
21
+ function ajax_dismiss_notice() {
22
+
23
+ if (check_admin_referer('qligg_dismiss_notice', 'nonce') && isset($_REQUEST['notice_id'])) {
24
+
25
+ $notice_id = sanitize_key($_REQUEST['notice_id']);
26
+
27
+ update_user_meta(get_current_user_id(), $notice_id, true);
28
+
29
+ wp_send_json($notice_id);
30
+ }
31
+
32
+ wp_die();
33
+ }
34
+
35
+ function add_notices() {
36
+
37
+ if (!get_transient('qligg-first-rating') && !get_user_meta(get_current_user_id(), 'qligg-user-rating', true)) {
38
+ ?>
39
+ <div id="qligg-admin-rating" class="qligg-notice notice is-dismissible" data-notice_id="qligg-user-rating">
40
+ <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
41
+ <div class="notice-image">
42
+ <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/backend/img/logo.jpg', QLIGG_PLUGIN_FILE); ?>" alt="<?php echo esc_html(QLIGG_PLUGIN_NAME); ?>>">
43
+ </div>
44
+ <div class="notice-content" style="margin-left: 15px;">
45
+ <p>
46
+ <?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
47
+ <br/>
48
+ <?php esc_html_e('Could you please give it a 5-star rating on WordPress? We know its a big favor, but we\'ve worked very much and very hard to release this great product. Your feedback will boost our motivation and help us promote and continue to improve this product.', 'insta-gallery'); ?>
49
+ </p>
50
+ <a href="<?php echo esc_url(QLIGG_REVIEW_URL); ?>" class="button-primary" target="_blank">
51
+ <?php esc_html_e('Yes, of course!', 'insta-gallery'); ?>
52
+ </a>
53
+ <a href="<?php echo esc_url(QLIGG_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
54
+ <?php esc_html_e('Report a bug', 'insta-gallery'); ?>
55
+ </a>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ <script>
60
+ (function ($) {
61
+ $('.qligg-notice').on('click', '.notice-dismiss', function (e) {
62
+ e.preventDefault();
63
+ var notice_id = $(e.delegateTarget).data('notice_id');
64
+ $.ajax({
65
+ type: 'POST',
66
+ url: ajaxurl,
67
+ data: {
68
+ notice_id: notice_id,
69
+ action: 'qligg_dismiss_notice',
70
+ nonce: '<?php echo wp_create_nonce('qligg_dismiss_notice'); ?>'
71
+ },
72
+ success: function (response) {
73
+ console.log(response);
74
+ },
75
+ });
76
+ });
77
+ })(jQuery);
78
+ </script>
79
+ <?php
80
+ }
81
+ }
82
+
83
+ public function add_action_links($links) {
84
+
85
+ $links[] = '<a target="_blank" href="' . QLIGG_PURCHASE_URL . '">' . esc_html__('Premium', 'insta-gallery') . '</a>';
86
+ $links[] = '<a href="' . admin_url('admin.php?page=' . sanitize_title(QLIGG_PREFIX)) . '">' . esc_html__('Settings', 'insta-gallery') . '</a>';
87
+
88
+ return $links;
89
+ }
90
+
91
+ }
92
+
93
+ QLIGG_Notices::instance();
includes/pages/premium.php DELETED
@@ -1,82 +0,0 @@
1
- <div class="has-2-columns" style="max-width: 100%">
2
- <div class="column">
3
- <div class="welcome-header">
4
- <h1><?php esc_html_e('Premium', 'insta-gallery'); ?></h1>
5
- <div class="about-description">
6
- <?php printf(esc_html__('Unlock the power of our premium %s plugin which allows you to add unlimited Instagram accounts and offers you more layout options.', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
7
- </div>
8
- <br/>
9
- <a style="background-color: #006cff;color: #ffffff;text-decoration: none;padding: 10px 30px;border-radius: 30px;margin: 10px 0 0 0;display: inline-block;" target="_blank" href="<?php echo esc_url(QLIGG_PURCHASE_URL); ?>"><?php esc_html_e('Purchase Now', 'insta-gallery'); ?></a>
10
- <a style="background-color: #ffffff;color: #626262;text-decoration: none;padding: 10px 30px;border-radius: 30px;margin: 10px 0 0 0;display: inline-block;" target="_blank" href="<?php echo QLIGG_DEMO_URL; ?>"><?php esc_html_e('View demo', 'insta-gallery'); ?></a>
11
- </div>
12
- <hr/>
13
- <div class="feature-section">
14
- <h3><?php esc_html_e('Multiple accounts', 'insta-gallery'); ?></h3>
15
- <p>
16
- <?php esc_html_e('Include unlimited user accounts and create feeds galleries for different users with their own layout and settings.', 'insta-gallery'); ?>
17
- </p>
18
- </div>
19
- <div class="feature-section">
20
- <h3><?php esc_html_e('Customize colors', 'insta-gallery'); ?></h3>
21
- <p>
22
- <?php esc_html_e('Customize the colors of the Instagram Feed with a custom background, padding, and a rounded border. It also includes the user or tag profile info in the header of the box.', 'insta-gallery'); ?>
23
- </p>
24
- </div>
25
- <div class="feature-section">
26
- <h3><?php esc_html_e('Load more button', 'insta-gallery'); ?></h3>
27
- <p>
28
- <?php esc_html_e('Allow your users to load more images in the gallery providing an improved user experience.', 'insta-gallery'); ?>
29
- </p>
30
- </div>
31
- </div>
32
- <div class="column">
33
- <img src="<?php echo plugins_url('/assets/img/instagram-feed.png', QLIGG_PLUGIN_FILE); ?>">
34
- </div>
35
- </div>
36
- <div class="has-2-columns" style="max-width: 100%">
37
- <div class="column">
38
- <img src="<?php echo plugins_url('/assets/img/instagram-feed-popup-macbook.png', QLIGG_PLUGIN_FILE); ?>">
39
- </div>
40
- <div class="column">
41
- <br/>
42
- <div class="welcome-header">
43
- <h1><?php esc_html_e('More content', 'insta-gallery'); ?></h1>
44
- <div class="about-description">
45
- <?php esc_html_e('Include some extra content for the images and the images popup.', 'insta-gallery'); ?>
46
- </div>
47
- </div>
48
- <hr/>
49
- <div class="feature-section">
50
- <h3><?php esc_html_e('Popup content', 'wp-whatsapp-chat'); ?></h3>
51
- <p>
52
- <?php esc_html_e('Our premium version allows you to include some extra content in the image popup, like the user profile, the image caption, and the number of comments and likes.', 'wp-whatsapp-chat'); ?>
53
- </p>
54
- </div>
55
- </div>
56
- </div>
57
- <div class="has-2-columns is-wider-left" style="max-width: 100%">
58
- <div class="column">
59
- <div class="welcome-header">
60
- <h1><?php esc_html_e('Layouts', 'insta-gallery'); ?></h1>
61
- <div class="about-description">
62
- <?php esc_html_e('Unlock the power of the masonry and highlight layouts that allows you to display the Instagram Feeds in a grid that supports items of variable size.', 'insta-gallery'); ?>
63
- </div>
64
- </div>
65
- <hr/>
66
- <div class="feature-section">
67
- <h3><?php esc_html_e('Masonry layout', 'insta-gallery'); ?></h3>
68
- <p>
69
- <?php esc_html_e('The masonry layout is a grid that displays the images with a fixed with and variable height size.', 'insta-gallery'); ?>
70
- </p>
71
- </div>
72
- <div class="feature-section">
73
- <h3><?php esc_html_e('Highlight layout', 'insta-gallery'); ?></h3>
74
- <p>
75
- <?php esc_html_e('The highlight layout is a masonry grid that allows you to stand out some images with two or three columns width size.', 'insta-gallery'); ?>
76
- </p>
77
- </div>
78
- </div>
79
- <div class="column">
80
- <img src="<?php echo plugins_url('/assets/img/instagram-feed-load-more.png', QLIGG_PLUGIN_FILE); ?>">
81
- </div>
82
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/pages/token.php DELETED
@@ -1,146 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>
5
- <div id="ig-generate-token" class="<?php echo!empty($qligg_token) ? 'premium' : ''; ?>">
6
- <p>
7
- <a class="btn-instagram-account" target="_self" href="<?php echo esc_url($qligg_api->get_create_account_link()); ?>" title="<?php esc_html_e('Add New Account', 'insta-gallery'); ?>">
8
- <?php esc_html_e('Add New Account', 'insta-gallery'); ?>
9
- </a>
10
- <span style="float: none; margin-top: 0;" class="spinner"></span>
11
- <a data-qligg-toggle="#ig-update-token" href="#"><?php esc_html_e('Button not working?', 'insta-gallery'); ?></a>
12
- </p>
13
- <form id="ig-update-token" class=" hidden" method="post">
14
- <table class="widefat ig-table">
15
- <tbody>
16
- <tr>
17
- <td>
18
- <h4><?php esc_html_e('Manually connect an account', 'insta-gallery'); ?></h4>
19
- <p class="field-item">
20
- <input class="widefat" name="ig_access_token" type="text" maxlength="200" placeholder="<?php esc_html_e('Enter a valid Access Token', 'insta-gallery'); ?>" required />
21
- </p>
22
- <button type="submit" class="btn-instagram secondary"><?php esc_html_e('Update', 'insta-gallery'); ?></button>
23
- <span style="float: none; margin-top: 0;" class="spinner"></span>
24
- <a target="_blank" href="https://quadlayers.com/insta-token/"><?php esc_html_e('Get access token', 'insta-gallery'); ?></a>
25
- <?php wp_nonce_field('qligg_update_token', 'ig_nonce'); ?>
26
- </form>
27
- </td>
28
- </tr>
29
- </tbody>
30
- </table>
31
- <?php wp_nonce_field('qligg_update_token', 'ig_nonce'); ?>
32
- </form>
33
- </div>
34
- <?php if (is_array($qligg_token) && count($qligg_token)) : ?>
35
- <table class="widefat ig-table">
36
- <thead>
37
- <tr>
38
- <th><?php esc_html_e('Image', 'insta-gallery'); ?></th>
39
- <th><?php esc_html_e('ID', 'insta-gallery'); ?></th>
40
- <th><?php esc_html_e('User', 'insta-gallery'); ?></th>
41
- <th><?php esc_html_e('Name', 'insta-gallery'); ?></th>
42
- <th><?php esc_html_e('Token', 'insta-gallery'); ?></th>
43
- <th><?php esc_html_e('Action', 'insta-gallery'); ?></th>
44
- </tr>
45
- </thead>
46
- <tbody>
47
- <?php
48
- //if (count($qligg_token)) {
49
- foreach ($qligg_token as $id => $access_token) {
50
- $profile_info = qligg_get_user_profile($id);
51
- ?>
52
- <tr>
53
- <td class="profile-picture"><img src="<?php echo esc_url($profile_info['picture']); ?>" width="30" /></td>
54
- <td><?php echo esc_attr($id); ?></td>
55
- <td><?php echo esc_html($profile_info['user']); ?></td>
56
- <td><?php echo esc_html($profile_info['name']); ?></td>
57
- <td>
58
- <input id="<?php echo esc_attr($id); ?>-access-token" type="text" value="<?php echo esc_attr($access_token); ?>" readonly />
59
- </td>
60
- <td>
61
- <a data-qligg-copy="#<?php echo esc_attr($id); ?>-access-token" href="#" class="btn-instagram">
62
- <span class="dashicons dashicons-edit"></span><?php esc_html_e('Copy', 'insta-gallery'); ?>
63
- </a>
64
- <a href="#" data-item_id="<?php echo esc_attr($id); ?>" class="btn-instagram ig-remove-token">
65
- <span class="dashicons dashicons-trash"></span><?php esc_html_e('Delete', 'insta-gallery'); ?>
66
- </a>
67
- <span class="spinner"></span>
68
- </td>
69
- </tr>
70
- <?php
71
- }
72
- //}
73
- ?>
74
- </tbody>
75
- </table>
76
- <?php endif; ?>
77
- <form id="ig-save-settings" method="post">
78
- <table class="widefat form-table ig-table">
79
- <tbody>
80
- <tr>
81
- <td colspan="100%">
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">
89
- <?php esc_html_e('Reset your Instagram feeds cache every x hours.', 'insta-gallery'); ?>
90
- </span>
91
- </td>
92
- </tr>
93
- <tr>
94
- <th><?php esc_html_e('Remove data', 'insta-gallery'); ?></th>
95
- <td>
96
- <input id="ig-remove-data" type="checkbox" name="insta_flush" value="1" <?php checked(1, $qligg['insta_flush']); ?> />
97
- <span class="description">
98
- <?php esc_html_e('Check this box to remove all data related to this plugin on uninstall.', 'insta-gallery'); ?>
99
- </span>
100
- </td>
101
- </tr>
102
- <tr>
103
- <th><?php esc_html_e('Replace loader', 'insta-gallery'); ?></th>
104
- <td>
105
- <?php
106
- $mid = '';
107
- $misrc = '';
108
- if (isset($qligg['insta_spinner_image_id'])) {
109
- $mid = $qligg['insta_spinner_image_id'];
110
- $image = wp_get_attachment_image_src($mid, 'full');
111
- if ($image) {
112
- $misrc = $image[0];
113
- }
114
- }
115
- ?>
116
- <input type="hidden" name="insta_spinner_image_id" value="<?php echo esc_attr($mid); ?>" data-misrc="<?php echo esc_attr($misrc); ?>" />
117
- <a class="btn-instagram" id="ig-spinner-upload" /><?php esc_html_e('Upload', 'insta-gallery'); ?></a>
118
- <a class="btn-instagram" id="ig-spinner-reset" /><?php esc_html_e('Reset Spinner', 'insta-gallery'); ?></a>
119
- <p class="description">
120
- <?php esc_html_e('Select an image from media library to replace the default loader icon.', 'insta-gallery'); ?>
121
- </p>
122
- </td>
123
- <td rowspan="2">
124
- <div class="insta-gallery-spinner">
125
- </div>
126
- </td>
127
- </tr>
128
- </tbody>
129
- </table>
130
- </td>
131
- </tr>
132
- </tbody>
133
- <tfoot>
134
- <tr>
135
- <td colspan="3">
136
- <span class="spinner"></span>
137
- <button type="submit" class="btn-instagram secondary"><?php esc_html_e('Update', 'insta-gallery'); ?></button>
138
- <span class="description">
139
- <?php //printf(esc_html__('Update settings and copy/paste generated shortcode in your post/pages or go to Widgets and use %s widget', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
140
- </span>
141
- </td>
142
- </tr>
143
- </tfoot>
144
- </table>
145
- <?php wp_nonce_field('qligg_save_settings', 'ig_nonce'); ?>
146
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/pages/views/edit.php DELETED
@@ -1,636 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>
5
- <form method="post" id="ig-update-form" class="<?php //echo!isset($ig_item_id) ? 'hidden' : ''; ?>">
6
- <table class="widefat form-table ig-table">
7
- <tbody>
8
- <tr>
9
- <td colspan="100%">
10
- <table>
11
- <tr>
12
- <th scope="row"><?php esc_html_e('Type', 'insta-gallery'); ?></th>
13
- <td>
14
- <ul class="ig-list-buttons">
15
- <li>
16
- <input type="radio" id="insta_source-username" name="insta_source" value="username" <?php checked('username', $instagram_feed['insta_source']); ?> />
17
- <label for="insta_source-username"><?php esc_html_e('User', 'insta-gallery'); ?></label>
18
- <div class="check"></div>
19
- </li>
20
- <li>
21
- <input type="radio" id="insta_source-tag" name="insta_source" value="tag" <?php checked('tag', $instagram_feed['insta_source']); ?> />
22
- <label for="insta_source-tag"><?php esc_html_e('Tag', 'insta-gallery'); ?></label>
23
- <div class="check"></div>
24
- </li>
25
- </ul>
26
- <p class="description">
27
- <?php esc_html_e('Please select option to display images from Instagram @username or #tag', 'insta-gallery'); ?>
28
- </p>
29
- </td>
30
- </tr>
31
- </table>
32
- </td>
33
- </tr>
34
- <tr id="ig-select-username-wrap" class="ig-tab-content-row <?php if ($instagram_feed['insta_source'] == 'username') echo 'active'; ?>">
35
- <td colspan="100%">
36
- <table>
37
- <tr>
38
- <th scope="row"><?php esc_html_e('User', 'insta-gallery'); ?></th>
39
- <td>
40
- <?php if (!count($qligg_token)): ?>
41
- <p class="description">
42
- <strong><?php printf(__('No Instagram account connected. Please connect your account <a href="%s">here</a>.', 'insta-gallery'), $qligg_api->get_create_account_link()); ?></strong></strong>
43
- </p>
44
- <?php
45
- else :
46
- ?>
47
- <select name="insta_username">
48
- <?php foreach ($qligg_token as $id => $access_token) : ?>
49
- <?php $profile_info = qligg_get_user_profile($id); ?>
50
- <option value="<?php echo esc_attr($id) ?>" <?php selected($id, $instagram_feed['insta_username']); ?>><?php echo esc_html($profile_info['user']); ?></option>
51
- <?php endforeach; ?>
52
- </select>
53
- <p class="description">
54
- <?php esc_html_e('Please enter Instagram username', 'insta-gallery'); ?>
55
- </p>
56
- <?php endif; ?>
57
- </td>
58
- </tr>
59
- </table>
60
- </td>
61
- </tr>
62
- <tr id="ig-select-tag-wrap" class="ig-tab-content-row <?php if ($instagram_feed['insta_source'] == 'tag') echo 'active'; ?>">
63
- <td colspan="100%">
64
- <table>
65
- <tr>
66
- <th scope="row"><?php esc_html_e('Tag', 'insta-gallery'); ?></th>
67
- <td>
68
- <input name="insta_tag" type="text" placeholder="beautiful" value="<?php echo esc_attr($instagram_feed['insta_tag']); ?>" />
69
- <p class="description"><?php esc_html_e('Please enter Instagram tag', 'insta-gallery'); ?></p>
70
- </td>
71
- </tr>
72
- </table>
73
- </td>
74
- </tr>
75
- <tr class="ig-tab-content-row active">
76
- <td colspan="100%">
77
- <table>
78
- <tr>
79
- <th scope="row"><?php esc_html_e('Layout', 'insta-gallery'); ?></th>
80
- <td>
81
- <ul class="ig-list-images">
82
- <li class="<?php if ($instagram_feed['insta_layout'] == 'gallery') echo 'active'; ?>">
83
- <input type="radio" id="insta_layout-gallery" name="insta_layout" value="gallery" <?php checked('gallery', $instagram_feed['insta_layout']); ?> />
84
- <label for="insta_layout-gallery"><?php esc_html_e('Gallery', 'insta-gallery'); ?></label>
85
- <img src="<?php echo plugins_url('/assets/img/gallery.png', QLIGG_PLUGIN_FILE); ?>"/>
86
- </li>
87
- <li class="<?php if ($instagram_feed['insta_layout'] == 'carousel') echo 'active'; ?>">
88
- <input type="radio" id="insta_layout-carousel" name="insta_layout" value="carousel" <?php checked('carousel', $instagram_feed['insta_layout']); ?> />
89
- <label for="insta_layout-carousel"><?php esc_html_e('Carousel', 'insta-gallery'); ?></label>
90
- <img src="<?php echo plugins_url('/assets/img/carousel.png', QLIGG_PLUGIN_FILE); ?>"/>
91
- </li>
92
- <li class="<?php if ($instagram_feed['insta_layout'] == 'masonry') echo 'active'; ?> premium">
93
- <input type="radio" id="insta_layout-masonry" name="insta_layout" value="masonry" <?php checked('masonry', $instagram_feed['insta_layout']); ?> />
94
- <label for="insta_layout-masonry"><?php esc_html_e('Masonry', 'insta-gallery'); ?><span class="premium"> (<?php esc_html_e('Premium', 'insta-gallery'); ?>)</span></label>
95
- <img src="<?php echo plugins_url('/assets/img/masonry.png', QLIGG_PLUGIN_FILE); ?>"/>
96
- </li>
97
- <li class="<?php if ($instagram_feed['insta_layout'] == 'highlight') echo 'active'; ?> premium">
98
- <input type="radio" id="insta_layout-highlight" name="insta_layout" value="highlight" <?php checked('highlight', $instagram_feed['insta_layout']); ?> />
99
- <label for="insta_layout-highlight"><?php esc_html_e('Highlight', 'insta-gallery'); ?><span class="premium"> (<?php esc_html_e('Premium', 'insta-gallery'); ?>)</span></label>
100
- <img src="<?php echo plugins_url('/assets/img/highlight.png', QLIGG_PLUGIN_FILE); ?>"/>
101
- </li>
102
- </ul>
103
- </td>
104
- </tr>
105
- </table>
106
- </td>
107
- </tr>
108
- <tr class="premium">
109
- <td colspan="100%">
110
- <table>
111
- <tr>
112
- <th scope="row"><?php esc_html_e('Box', 'insta-gallery'); ?></th>
113
- <td>
114
- <input name="insta_box" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_box']); ?>/>
115
- <p class="description">
116
- <?php esc_html_e('Display the Instagram Feed inside a customizable box', 'insta-gallery'); ?>
117
- </p>
118
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
119
- </td>
120
- </tr>
121
- </table>
122
- </td>
123
- </tr>
124
- <tr id="ig-section-box" class="ig-tab-content-row premium <?php if (!empty($instagram_feed['insta_box'])) echo 'active'; ?>">
125
- <td colspan="100%">
126
- <table>
127
- <tr>
128
- <th scope="row"><?php esc_html_e('Box padding', 'insta-gallery'); ?></th>
129
- <td>
130
- <input name="insta_box-padding" type="number" value="<?php echo esc_attr($instagram_feed['insta_box-padding']); ?>" />
131
- <p class="description">
132
- <?php esc_html_e('Add padding to the Instagram Feed', 'insta-gallery'); ?>
133
- </p>
134
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
135
- </td>
136
- </tr>
137
- <tr>
138
- <th scope="row"><?php esc_html_e('Box radius', 'insta-gallery'); ?></th>
139
- <td>
140
- <input name="insta_box-radius" type="number" value="<?php echo esc_attr($instagram_feed['insta_box-radius']); ?>" />
141
- <p class="description">
142
- <?php esc_html_e('Add radius to the Instagram Feed', 'insta-gallery'); ?>
143
- </p>
144
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
145
- </td>
146
- </tr>
147
- <tr>
148
- <th scope="row"><?php esc_html_e('Box background', 'insta-gallery'); ?></th>
149
- <td>
150
- <input class="color-picker" data-alpha="true" name="insta_box-background" type="text" placeholder="#c32a67" value="<?php echo esc_html($instagram_feed['insta_box-background']); ?>" />
151
- <p class="description">
152
- <?php esc_html_e('Color which is displayed on box background', 'insta-gallery'); ?>
153
- </p>
154
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
155
- </td>
156
- </tr>
157
- </table>
158
- </td>
159
- </tr>
160
- <tr id="ig-section-profile" class="ig-tab-content-row active premium">
161
- <td colspan="100%">
162
- <table>
163
- <tr>
164
- <th scope="row"><?php esc_html_e('Profile', 'insta-gallery'); ?></th>
165
- <td>
166
- <input name="insta_box-profile" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_box-profile']); ?>/>
167
- <p class="description">
168
- <?php esc_html_e('Display user profile or tag info', 'insta-gallery'); ?>
169
- </p>
170
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
171
- </td>
172
- </tr>
173
- <tr>
174
- <th scope="row"><?php esc_html_e('Profile description', 'insta-gallery'); ?></th>
175
- <td>
176
- <input name="insta_box-desc" type="text" placeholder="Instagram" value="<?php echo esc_html($instagram_feed['insta_box-desc']); ?>" />
177
- <p class="description">
178
- <?php esc_html_e('Box description here', 'insta-gallery'); ?>
179
- </p>
180
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
181
- </td>
182
- </tr>
183
- </table>
184
- </td>
185
- </tr>
186
- <tr>
187
- <td colspan="100%">
188
- <table>
189
- <tr>
190
- <th scope="row"><?php esc_html_e('Limit', 'insta-gallery'); ?></th>
191
- <td><input name="insta_limit" type="number" min="1" max="33" value="<?php echo esc_attr($instagram_feed['insta_limit']); ?>" />
192
- <p class="description"><?php esc_html_e('Number of images to display', 'insta-gallery'); ?></p>
193
- </td>
194
- </tr>
195
- </table>
196
- </td>
197
- </tr>
198
- <tr id="ig-section-gallery" class="ig-tab-content-row <?php if (in_array($instagram_feed['insta_layout'], array('gallery', 'masonry', 'highlight'))) echo 'active'; ?>">
199
- <td colspan="100%">
200
- <table>
201
- <tr>
202
- <th scope="row"><?php esc_html_e('Columns', 'insta-gallery'); ?></th>
203
- <td>
204
- <input name="insta_gal-cols" type="number" min="1" max="20" value="<?php echo esc_attr($instagram_feed['insta_gal-cols']); ?>" />
205
- <p class="description">
206
- <?php esc_html_e('Number of images in a row', 'insta-gallery'); ?>
207
- </p>
208
- </td>
209
- </tr>
210
- </table>
211
- </td>
212
- </tr>
213
- <tr id="ig-section-masonry" class="ig-tab-content-row premium <?php if (in_array($instagram_feed['insta_layout'], array('highlight', 'masonry'))) echo 'active'; ?>">
214
- <td colspan="100%">
215
- <table>
216
- <tr>
217
- <th scope="row"><?php esc_html_e('Highlight by tag', 'insta-gallery'); ?></th>
218
- <td>
219
- <textarea name="insta_highlight-tag" placeholder="tag1, tag2, tag3"><?php echo esc_html($instagram_feed['insta_highlight-tag']); ?></textarea>
220
- <p class="description"><?php esc_html_e('Highlight feeds items with this tags', 'insta-gallery'); ?></p>
221
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
222
- </td>
223
- </tr>
224
- <tr>
225
- <th scope="row"><?php esc_html_e('Highlight by id', 'insta-gallery'); ?></th>
226
- <td>
227
- <textarea name="insta_highlight-id" placeholder="101010110101010"><?php echo esc_html($instagram_feed['insta_highlight-id']); ?></textarea>
228
- <p class="description"><?php esc_html_e('Highlight feeds items with this ids', 'insta-gallery'); ?></p>
229
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
230
- </td>
231
- </tr>
232
- <tr>
233
- <th scope="row"><?php esc_html_e('Highlight by position', 'insta-gallery'); ?></th>
234
- <td>
235
- <textarea name="insta_highlight-position" placeholder="1, 5, 7"><?php echo esc_html($instagram_feed['insta_highlight-position']); ?></textarea>
236
- <p class="description"><?php esc_html_e('Highlight feeds items in this positions', 'insta-gallery'); ?></p>
237
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
238
- </td>
239
- </tr>
240
- </table>
241
- </td>
242
- </tr>
243
- <tr id="ig-section-carousel" class="ig-tab-content-row <?php if ($instagram_feed['insta_layout'] == 'carousel') echo 'active'; ?>">
244
- <td colspan="100%">
245
- <table>
246
- <tr>
247
- <th scope="row"><?php esc_html_e('Slides per view', 'insta-gallery'); ?></th>
248
- <td>
249
- <input name="insta_car-slidespv" type="number" min="1" max="10" value="<?php echo esc_html($instagram_feed['insta_car-slidespv']); ?>" />
250
- <p class="description"><?php esc_html_e('Number of images per slide', 'insta-gallery'); ?></p>
251
- </td>
252
- </tr>
253
- <tr>
254
- <th scope="row"><?php esc_html_e('Autoplay', 'insta-gallery'); ?></th>
255
- <td>
256
- <input name="insta_car-autoplay" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_car-autoplay']); ?> />
257
- <p class="description"><?php esc_html_e('Autoplay carousel items', 'insta-gallery'); ?></p>
258
- </td>
259
- </tr>
260
- <tr>
261
- <th scope="row"><?php esc_html_e('Autoplay Interval', 'insta-gallery'); ?></th>
262
- <td>
263
- <input name="insta_car-autoplay-interval" type="number" min="1000" max="300000" step="100" value="<?php echo esc_attr(max(1000, absint($instagram_feed['insta_car-autoplay-interval']))); ?>" />
264
- <p class="description">
265
- <?php esc_html_e('Moves to next picture after specified time interval', 'insta-gallery'); ?></p>
266
- </td>
267
- </tr>
268
- <tr>
269
- <th scope="row"><?php esc_html_e('Navigation', 'insta-gallery'); ?></th>
270
- <td>
271
- <input name="insta_car-navarrows" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_car-navarrows']); ?>/>
272
- <p class="description"><?php esc_html_e('Display navigation arrows', 'insta-gallery'); ?></p>
273
- </td>
274
- </tr>
275
- <tr>
276
- <th scope="row"><?php esc_html_e('Navigation color', 'insta-gallery'); ?></th>
277
- <td>
278
- <input class="color-picker" data-alpha="true" name="insta_car-navarrows-color" type="text" placeholder="#c32a67" value="<?php echo esc_html($instagram_feed['insta_car-navarrows-color']); ?>" />
279
- <p class="description"><?php esc_html_e('Change navigation arrows color', 'insta-gallery'); ?></p>
280
- </td>
281
- </tr>
282
- <tr>
283
- <th scope="row"><?php esc_html_e('Pagination', 'insta-gallery'); ?></th>
284
- <td>
285
- <input name="insta_car-pagination" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_car-pagination']); ?>/>
286
- <p class="description"><?php esc_html_e('Display pagination dots', 'insta-gallery'); ?></p>
287
- </td>
288
- </tr>
289
- <tr>
290
- <th scope="row"><?php esc_html_e('Pagination color', 'insta-gallery'); ?></th>
291
- <td>
292
- <input class="color-picker" data-alpha="true" name="insta_car-pagination-color" type="text" placeholder="#c32a67" value="<?php echo esc_html($instagram_feed['insta_car-pagination-color']); ?>" />
293
- <p class="description"><?php esc_html_e('Change pagination dotts color', 'insta-gallery'); ?></p>
294
- </td>
295
- </tr>
296
- </table>
297
- </td>
298
- </tr>
299
- <tr class="ig-tab-content-row active">
300
- <td colspan="100%">
301
- <table>
302
- <tr>
303
- <th scope="row"><?php esc_html_e('Images size', 'insta-gallery'); ?></th>
304
- <td>
305
- <select name="insta_size">
306
- <option value="standard"><?php esc_html_e('Standard', 'insta-gallery'); ?> (640 x auto)</option>
307
- <option value="medium" <?php echo (isset($instagram_feed['insta_size']) && ($instagram_feed['insta_size'] == 'medium')) ? 'selected' : ''; ?>><?php esc_html_e('Medium', 'insta-gallery'); ?> (320 x auto)</option>
308
- <option value="small" <?php echo (isset($instagram_feed['insta_size']) && ($instagram_feed['insta_size'] == 'small')) ? 'selected' : ''; ?>><?php esc_html_e('Small', 'insta-gallery'); ?> (150 x 150)</option>
309
- </select>
310
- </td>
311
- </tr>
312
- <tr>
313
- <th scope="row"><?php esc_html_e('Images spacing', 'insta-gallery'); ?></th>
314
- <td>
315
- <input name="insta_spacing" type="number" value="<?php echo esc_attr($instagram_feed['insta_spacing']); ?>" />
316
- <p class="description">
317
- <?php esc_html_e('Add blank space between images', 'insta-gallery'); ?>
318
- </p>
319
- </td>
320
- </tr>
321
- </table>
322
- </td>
323
- </tr>
324
- <tr class="premium">
325
- <td colspan="100%">
326
- <table>
327
- <tr>
328
- <th scope="row"><?php esc_html_e('Images card', 'insta-gallery'); ?></th>
329
- <td>
330
- <input name="insta_card" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_card']); ?>/>
331
- <p class="description">
332
- <?php esc_html_e('Display card gallery by clicking on image', 'insta-gallery'); ?>
333
- </p>
334
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
335
- </td>
336
- </tr>
337
- </table>
338
- </td>
339
- </tr>
340
- <tr id="ig-section-card" class="ig-tab-content-row premium <?php if (!empty($instagram_feed['insta_card'])) echo 'active'; ?>">
341
- <td colspan="100%">
342
- <table>
343
- <tr>
344
- <th scope="row"><?php esc_html_e('Card radius', 'insta-gallery'); ?></th>
345
- <td>
346
- <input name="insta_card-radius" type="number" min="0" max="1000" value="<?php echo esc_attr($instagram_feed['insta_card-radius']); ?>" />
347
- <p class="description">
348
- <?php esc_html_e('Add radius to the Instagram Feed', 'insta-gallery'); ?>
349
- </p>
350
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
351
- </td>
352
- </tr>
353
- <tr>
354
- <th scope="row"><?php esc_html_e('Card font size', 'insta-gallery'); ?></th>
355
- <td>
356
- <input name="insta_card-font-size" type="number" min="8" max="36" value="<?php echo esc_attr($instagram_feed['insta_card-font-size']); ?>" />
357
- <p class="description">
358
- <?php esc_html_e('Add font-size to the Instagram Feed', 'insta-gallery'); ?>
359
- </p>
360
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
361
- </td>
362
- </tr>
363
- <tr>
364
- <th scope="row"><?php esc_html_e('Card background', 'insta-gallery'); ?></th>
365
- <td>
366
- <input class="color-picker" data-alpha="true" name="insta_card-background" type="link" placeholder="#007aff" value="<?php echo esc_html($instagram_feed['insta_card-background']); ?>" />
367
- <p class="description">
368
- <?php esc_html_e('Color which is displayed when over images', 'insta-gallery'); ?>
369
- </p>
370
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
371
- </td>
372
- </tr>
373
- <tr>
374
- <th scope="row"><?php esc_html_e('Card padding', 'insta-gallery'); ?></th>
375
- <td>
376
- <input name="insta_card-padding" type="number" min="0" max="50" value="<?php echo esc_attr($instagram_feed['insta_card-padding']); ?>" />
377
- <p class="description">
378
- <?php esc_html_e('Add blank space between images', 'insta-gallery'); ?>
379
- </p>
380
- </td>
381
- </tr>
382
- <tr>
383
- <th scope="row"><?php esc_html_e('Card info', 'insta-gallery'); ?></th>
384
- <td>
385
- <input name="insta_card-info" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_card-info']); ?>/>
386
- <p class="description">
387
- <?php esc_html_e('Display likes count of images', 'insta-gallery'); ?>
388
- </p>
389
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
390
- </td>
391
- </tr>
392
- <tr>
393
- <th scope="row"><?php esc_html_e('Card caption', 'insta-gallery'); ?></th>
394
- <td>
395
- <input name="insta_card-caption" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_card-caption']); ?>/>
396
- <p class="description">
397
- <?php esc_html_e('Display caption count of images', 'insta-gallery'); ?>
398
- </p>
399
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
400
- </td>
401
- </tr>
402
- <tr>
403
- <th scope="row"><?php esc_html_e('Card length', 'insta-gallery'); ?></th>
404
- <td>
405
- <input name="insta_card-length" type="number" min="5" max="1000" value="<?php echo esc_attr($instagram_feed['insta_card-length']); ?>" />
406
- <p class="description">
407
- <?php esc_html_e('Add blank space between images', 'insta-gallery'); ?>
408
- </p>
409
- </td>
410
- </tr>
411
- </table>
412
- </td>
413
- </tr>
414
- <tr>
415
- <td colspan="100%">
416
- <table>
417
- <tr>
418
- <th scope="row"><?php esc_html_e('Images popup', 'insta-gallery'); ?></th>
419
- <td><input name="insta_popup" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_popup']); ?>/>
420
- <p class="description">
421
- <?php esc_html_e('Display popup gallery by clicking on image', 'insta-gallery'); ?>
422
- </p>
423
- </td>
424
- </tr>
425
- </table>
426
- </td>
427
- </tr>
428
- <tr id="ig-section-popup" class="ig-tab-content-row premium <?php if (!empty($instagram_feed['insta_popup'])) echo 'active'; ?>">
429
- <td colspan="100%">
430
- <table>
431
- <tr>
432
- <th scope="row"><?php esc_html_e('Images popup profile', 'insta-gallery'); ?></th>
433
- <td>
434
- <input name="insta_popup-profile" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_popup-profile']); ?>/>
435
- <p class="description">
436
- <?php esc_html_e('Display user profile or tag info', 'insta-gallery'); ?>
437
- </p>
438
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
439
- </td>
440
- </tr>
441
- <tr>
442
- <th scope="row"><?php esc_html_e('Images popup caption', 'insta-gallery'); ?></th>
443
- <td>
444
- <input name="insta_popup-caption" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_popup-caption']); ?>/>
445
- <p class="description"><?php esc_html_e('Display caption in the popup', 'insta-gallery'); ?></p>
446
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
447
- </td>
448
- </tr>
449
- <tr>
450
- <th scope="row"><?php esc_html_e('Images popup likes', 'insta-gallery'); ?></th>
451
- <td>
452
- <input name="insta_popup-likes" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_popup-likes']); ?>/>
453
- <p class="description">
454
- <?php esc_html_e('Display likes count of images', 'insta-gallery'); ?>
455
- </p>
456
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
457
- </td>
458
- </tr>
459
- <tr>
460
- <th scope="row"><?php esc_html_e('Images popup align', 'insta-gallery'); ?></th>
461
- <td>
462
- <select name="insta_popup-align">
463
- <option value="top" <?php selected('top', $instagram_feed['insta_popup-align']); ?>><?php esc_html_e('Top', 'insta-gallery'); ?></option>
464
- <option value="left" <?php selected('left', $instagram_feed['insta_popup-align']); ?>><?php esc_html_e('Left', 'insta-gallery'); ?></option>
465
- <option value="right" <?php selected('right', $instagram_feed['insta_popup-align']); ?>><?php esc_html_e('Right', 'insta-gallery'); ?></option>
466
- <option value="bottom" <?php selected('bottom', $instagram_feed['insta_popup-align']); ?>><?php esc_html_e('Bottom', 'insta-gallery'); ?></option>
467
- </select>
468
- <p class="description"><?php esc_html_e('Display likes count of images', 'insta-gallery'); ?></p>
469
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
470
- </td>
471
- </tr>
472
- </table>
473
- </td>
474
- </tr>
475
- <tr>
476
- <td colspan="100%">
477
- <table>
478
- <tr>
479
- <th scope="row"><?php esc_html_e('Images mask', 'insta-gallery'); ?></th>
480
- <td>
481
- <input name="insta_hover" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_hover']); ?>/>
482
- <p class="description">
483
- <?php esc_html_e('Image mouseover effect', 'insta-gallery'); ?>
484
- </p>
485
- </td>
486
- </tr>
487
- </table>
488
- </td>
489
- </tr>
490
- <tr id="ig-section-hover" class="ig-tab-content-row <?php if (!empty($instagram_feed['insta_hover'])) echo 'active'; ?>">
491
- <td colspan="100%">
492
- <table>
493
- <tr>
494
- <th scope="row"><?php esc_html_e('Images mask color', 'insta-gallery'); ?></th>
495
- <td>
496
- <input class="color-picker" data-alpha="true" name="insta_hover-color" type="link" placeholder="#007aff" value="<?php echo esc_html($instagram_feed['insta_hover-color']); ?>" />
497
- <p class="description">
498
- <?php esc_html_e('Color which is displayed when hovered over images', 'insta-gallery'); ?>
499
- </p>
500
- </td>
501
- </tr>
502
- <tr>
503
- <th scope="row"><?php esc_html_e('Images mask likes', 'insta-gallery'); ?></th>
504
- <td>
505
- <input name="insta_likes" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_likes']); ?>/>
506
- <p class="description">
507
- <?php esc_html_e('Display likes count of images', 'insta-gallery'); ?>
508
- </p>
509
- </td>
510
- </tr>
511
- <tr>
512
- <th scope="row"><?php esc_html_e('Images mask comments', 'insta-gallery'); ?></th>
513
- <td>
514
- <input name="insta_comments" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_comments']); ?>/>
515
- <p class="description">
516
- <?php esc_html_e('Display comments count of images', 'insta-gallery'); ?>
517
- </p>
518
- </td>
519
- </tr>
520
- </table>
521
- </td>
522
- </tr>
523
- <tr class="premium">
524
- <td colspan="100%">
525
- <table>
526
- <tr>
527
- <th scope="row"><?php esc_html_e('Instagram load more', 'insta-gallery'); ?></th>
528
- <td>
529
- <input name="insta_button_load" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_button_load']); ?>/>
530
- <p class="description">
531
- <?php esc_html_e('Display the load more button', 'insta-gallery'); ?>
532
- </p>
533
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
534
- </td>
535
- </tr>
536
- </table>
537
- </td>
538
- </tr>
539
- <tr id="ig-section-button_load" class="ig-tab-content-row premium <?php if (!empty($instagram_feed['insta_button_load'])) echo 'active'; ?>">
540
- <td colspan="100%">
541
- <table>
542
- <tr>
543
- <th scope="row"><?php esc_html_e('Instagram load more text', 'insta-gallery'); ?></th>
544
- <td>
545
- <input name="insta_button_load-text" type="text" placeholder="Instagram" value="<?php echo esc_html($instagram_feed['insta_button_load-text']); ?>" />
546
- <p class="description">
547
- <?php esc_html_e('Instagram load more text here', 'insta-gallery'); ?>
548
- </p>
549
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
550
- </td>
551
- </tr>
552
- <tr>
553
- <th scope="row"><?php esc_html_e('Instagram load more background', 'insta-gallery'); ?></th>
554
- <td>
555
- <input class="color-picker" data-alpha="true" name="insta_button_load-background" type="text" placeholder="#c32a67" value="<?php echo esc_html($instagram_feed['insta_button_load-background']); ?>" />
556
- <p class="description">
557
- <?php esc_html_e('Color which is displayed on button load background', 'insta-gallery'); ?>
558
- </p>
559
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
560
- </td>
561
- </tr>
562
- <tr>
563
- <th scope="row"><?php esc_html_e('Instagram load more hover background', 'insta-gallery'); ?></th>
564
- <td>
565
- <input class="color-picker" data-alpha="true" name="insta_button_load-background-hover" type="text" placeholder="#da894a" value="<?php echo esc_html($instagram_feed['insta_button_load-background-hover']); ?>" />
566
- <p class="description">
567
- <?php esc_html_e('Color which is displayed when hovered over button load more', 'insta-gallery'); ?>
568
- </p>
569
- <p class="premium"><?php esc_html_e('This is a premium feature.', 'insta-gallery'); ?></p>
570
- </td>
571
- </tr>
572
- </table>
573
- </td>
574
- </tr>
575
- <tr>
576
- <td colspan="100%">
577
- <table>
578
- <tr>
579
- <th scope="row"><?php esc_html_e('Instagram button', 'insta-gallery'); ?></th>
580
- <td>
581
- <input name="insta_button" type="checkbox" value="1" <?php checked(1, $instagram_feed['insta_button']); ?>/>
582
- <p class="description">
583
- <?php esc_html_e('Display the button to open Instagram site link', 'insta-gallery'); ?>
584
- </p>
585
- </td>
586
- </tr>
587
- </table>
588
- </td>
589
- </tr>
590
- <tr id="ig-section-button" class="ig-tab-content-row <?php if (!empty($instagram_feed['insta_button'])) echo 'active'; ?>">
591
- <td colspan="100%">
592
- <table>
593
- <tr>
594
- <th scope="row"><?php esc_html_e('Instagram button text', 'insta-gallery'); ?></th>
595
- <td>
596
- <input name="insta_button-text" type="text" placeholder="Instagram" value="<?php echo esc_html($instagram_feed['insta_button-text']); ?>" />
597
- <p class="description">
598
- <?php esc_html_e('Instagram button text here', 'insta-gallery'); ?>
599
- </p>
600
- </td>
601
- </tr>
602
- <tr>
603
- <th scope="row"><?php esc_html_e('Instagram button background', 'insta-gallery'); ?></th>
604
- <td>
605
- <input class="color-picker" data-alpha="true" name="insta_button-background" type="text" placeholder="#c32a67" value="<?php echo esc_html($instagram_feed['insta_button-background']); ?>" />
606
- <p class="description"><?php esc_html_e('Color which is displayed on button background', 'insta-gallery'); ?></p>
607
- </td>
608
- </tr>
609
- <tr>
610
- <th scope="row"><?php esc_html_e('Instagram button hover background', 'insta-gallery'); ?></th>
611
- <td>
612
- <input class="color-picker" data-alpha="true" name="insta_button-background-hover" type="text" placeholder="#da894a" value="<?php echo esc_html($instagram_feed['insta_button-background-hover']); ?>" />
613
- <p class="description"><?php esc_html_e('Color which is displayed when hovered over button', 'insta-gallery'); ?></p>
614
- </td>
615
- </tr>
616
- </table>
617
- </td>
618
- </tr>
619
- </tbody>
620
- <tfoot>
621
- <tr>
622
- <td colspan="3">
623
- <span class="spinner"></span>
624
- <button type="submit" class="btn-instagram secondary"><?php esc_html_e('Update', 'insta-gallery'); ?></button>
625
- <span>
626
- <?php printf(esc_html__('Update settings and copy/paste generated shortcode in your post/pages or go to Widgets and use %s widget', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
627
- </span>
628
- </td>
629
- </tr>
630
- </tfoot>
631
- </table>
632
- <?php if (!empty($ig_item_id)) : ?>
633
- <input type="hidden" name="item_id" value="<?php echo esc_attr($ig_item_id); ?>" />
634
- <?php endif; ?>
635
- <?php wp_nonce_field('qligg_update_form', 'ig_nonce'); ?>
636
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/pages/views/list.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>
5
- <div id="ig-create-gallery">
6
- <p>
7
- <a class="btn-instagram" href="<?php echo admin_url('admin.php?page=qligg_feeds&tab=edit'); ?>" title="<?php esc_html_e('Add New Gallery', 'insta-gallery'); ?>">
8
- <span class="dashicons dashicons-plus"></span>
9
- <?php esc_html_e('Add New Gallery', 'insta-gallery'); ?>
10
- </a>
11
- </p>
12
- </div>
13
- <?php if (count($instagram_feeds)) : //var_dump($instagram_feeds);?>
14
- <table class="widefat ig-table">
15
- <thead>
16
- <tr>
17
- <th><?php esc_html_e('Image', 'insta-gallery'); ?></th>
18
- <th><?php esc_html_e('Source', 'insta-gallery'); ?></th>
19
- <th><?php esc_html_e('Type', 'insta-gallery'); ?></th>
20
- <th><?php esc_html_e('Shortcode', 'insta-gallery'); ?></th>
21
- <th><?php esc_html_e('Action', 'insta-gallery'); ?></th>
22
- </tr>
23
- </thead>
24
- <tbody>
25
- <?php
26
- $i = 1;
27
- foreach ($instagram_feeds as $id => $instagram_feed) {
28
-
29
- if (!isset($instagram_feed['insta_source']))
30
- continue;
31
-
32
- if ($instagram_feed['insta_source'] == 'username') {
33
- $profile_info = qligg_get_user_profile($instagram_feed['insta_username']);
34
- } else {
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']); ?>
42
- </td>
43
- <td>
44
- <?php echo esc_html(ucfirst($instagram_feed['insta_layout'])); ?>
45
- </td>
46
- <td>
47
- <input id="<?php echo esc_attr($id); ?>-gallery-item" type="text" data-qligg-copy="#<?php echo esc_attr($id); ?>-gallery-item" value='[insta-gallery id="<?php echo esc_attr($id); ?>"]' readonly />
48
- </td>
49
- <td>
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>
62
- <?php } unset($i); ?>
63
- </tbody>
64
- </table>
65
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/pages/welcome.php DELETED
@@ -1,39 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
- ?>
5
- <div class="has-2-columns is-wider-left" style="max-width: 100%">
6
- <div class="column">
7
- <div class="qligg-welcome-header">
8
- <h1><?php echo QLIGG_PLUGIN_NAME; ?> <span style="font-size: 24px;color: #555;">v<?php echo QLIGG_PLUGIN_VERSION; ?></span></h1>
9
- <div class="about-text">
10
- <?php esc_html_e('Hello we\'re QuadLayers! We\'ve recently acquired this plugin. We will do our absolute best to support it and fix all the issues.', 'insta-gallery'); ?>
11
- </div>
12
- </div>
13
- <hr/>
14
- <div class="feature-section one-col is-wide wp-clearfix">
15
- <h3><?php esc_html_e('Demo', 'insta-gallery'); ?></h3>
16
- <p>
17
- <?php printf(esc_html__('Thank you for choosing our %s plugin for WordPress! Here you can see our demo and test the features we offer in the premium version.', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
18
- </p>
19
- <a style="background-color: #006cff;color: #ffffff;text-decoration: none;padding: 10px 30px;border-radius: 30px;margin: 10px 0 0 0;display: inline-block;" target="_blank" href="<?php echo QLIGG_DEMO_URL; ?>"><?php esc_html_e('View demo', 'insta-gallery'); ?></a>
20
- </div>
21
- <div class="feature-section" style="padding: 15px 0;">
22
- <h3><?php esc_html_e('Support', 'insta-gallery'); ?></h3>
23
- <p>
24
- <?php printf(esc_html__('If you have any doubt or you find any issue don\'t hesitate to contact us through our ticket system or join our community to meet other %s users.', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
25
- </p>
26
- <a style="background-color: #ffffff;color: #626262;text-decoration: none;padding: 10px 30px;border-radius: 30px;margin: 10px 0 0 0;display: inline-block;" target="_blank" href="<?php echo QLIGG_SUPPORT_URL; ?>"><?php esc_html_e('Submit ticket', 'insta-gallery'); ?></a>
27
- </div>
28
- <div class="feature-section" style="padding: 15px 0;">
29
- <h3><?php esc_html_e('Community', 'insta-gallery'); ?></h3>
30
- <p>
31
- <?php printf(esc_html__('If you want to get in touch with other %s users or be aware of our promotional discounts join our community now.', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
32
- </p>
33
- <a style="background-color: #ffffff;color: #626262;text-decoration: none;padding: 10px 30px;border-radius: 30px;margin: 10px 0 0 0;display: inline-block;" target="_blank" href="<?php echo QLIGG_GROUP_URL; ?>"><?php esc_html_e('Join our community', 'insta-gallery'); ?></a>
34
- </div>
35
- </div>
36
- <div class="column">
37
- <img src="<?php echo plugins_url('/assets/img/mobile.png', QLIGG_PLUGIN_FILE); ?>">
38
- </div>
39
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/qligg.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLIGG {
4
+
5
+ protected static $instance;
6
+
7
+ public static function instance() {
8
+ if (!isset(self::$instance)) {
9
+ self::$instance = new self();
10
+ self::$instance->api();
11
+ self::$instance->init();
12
+ self::$instance->includes();
13
+ }
14
+ return self::$instance;
15
+ }
16
+
17
+ function init() {
18
+ add_action('widgets_init', array($this, 'register_widget'));
19
+ do_action('qligg_init');
20
+ load_plugin_textdomain('insta-gallery', false, QLIGG_PLUGIN_DIR . '/languages/');
21
+ }
22
+
23
+ function includes() {
24
+ include_once(QLIGG_PLUGIN_DIR . 'includes/notices.php');
25
+ include_once(QLIGG_PLUGIN_DIR . 'includes/helpers.php');
26
+ include_once(QLIGG_PLUGIN_DIR . 'includes/widget.php');
27
+ include_once(QLIGG_PLUGIN_DIR . 'includes/compatibility.php');
28
+ include_once(QLIGG_PLUGIN_DIR . 'includes/backend.php');
29
+ include_once(QLIGG_PLUGIN_DIR . 'includes/frontend.php');
30
+ }
31
+
32
+ function register_widget() {
33
+ if (class_exists('QLIGG_Widget')) {
34
+ register_widget('QLIGG_Widget');
35
+ }
36
+ }
37
+
38
+ function api() {
39
+
40
+ global $qligg_api;
41
+
42
+ if (!class_exists('QLIGG_API')) {
43
+
44
+ include_once(QLIGG_PLUGIN_DIR . 'includes/api.php');
45
+
46
+ $qligg_api = new QLIGG_API();
47
+ }
48
+ }
49
+
50
+ public static function do_activation() {
51
+ set_transient('qligg-first-rating', true, MONTH_IN_SECONDS);
52
+ }
53
+
54
+ public static function is_min() {
55
+ if (!QLIGG_DEVELOPER && (!defined('SCRIPT_DEBUG') || !SCRIPT_DEBUG)) {
56
+ return '.min';
57
+ }
58
+ }
59
+
60
+ }
61
+
62
+ QLIGG::instance();
63
+
includes/settings.php DELETED
@@ -1,219 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
-
5
- if (!class_exists('QLIGG_Settings')) {
6
-
7
- class QLIGG_Settings {
8
-
9
- protected static $instance;
10
-
11
- function add_action_links($links) {
12
-
13
- $links[] = '<a target="_blank" href="' . QLIGG_PURCHASE_URL . '">' . esc_html__('Premium', 'insta-gallery') . '</a>';
14
-
15
- $links[] = '<a href="' . admin_url('admin.php?page=qligg') . '">' . esc_html__('Settings', 'insta-gallery') . '</a>';
16
-
17
- return $links;
18
- }
19
-
20
- function settings_header() {
21
-
22
- global $submenu;
23
- ?>
24
- <div class="wrap about-wrap full-width-layout qlwrap">
25
-
26
- <h1><?php echo esc_html(QLIGG_PLUGIN_NAME); ?></h1>
27
-
28
- <p class="about-text"><?php printf(esc_html__('Thanks for using %s! We will do our absolute best to support you and fix all the issues.', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?></p>
29
-
30
- <p class="about-text">
31
- <?php printf('<a href="%s" target="_blank">%s</a>', QLIGG_DEMO_URL, esc_html__('Check out our demo', 'insta-gallery')); ?></a>
32
- </p>
33
-
34
- <?php printf('<a href="%s" target="_blank"><div style="
35
- background: #006bff url(%s) no-repeat;
36
- background-position: top center;
37
- background-size: 130px 130px;
38
- color: #fff;
39
- font-size: 14px;
40
- text-align: center;
41
- font-weight: 600;
42
- margin: 5px 0 0;
43
- padding-top: 120px;
44
- height: 40px;
45
- display: inline-block;
46
- width: 140px;
47
- " class="wp-badge">%s</div></a>', 'https://quadlayers.com/?utm_source=qligg_admin', plugins_url('/assets/img/quadlayers.jpg', QLIGG_PLUGIN_FILE), esc_html__('QuadLayers', 'insta-gallery')); ?>
48
-
49
- </div>
50
- <?php
51
- if (isset($submenu[QLIGG_DOMAIN])) {
52
- if (is_array($submenu[QLIGG_DOMAIN])) {
53
- ?>
54
- <div class="wrap about-wrap full-width-layout qlwrap">
55
- <h2 class="nav-tab-wrapper">
56
- <?php
57
- foreach ($submenu[QLIGG_DOMAIN] as $tab) {
58
- if (strpos($tab[2], '.php') !== false)
59
- continue;
60
- ?>
61
- <a href="<?php echo admin_url('admin.php?page=' . esc_attr($tab[2])); ?>" class="nav-tab<?php echo (isset($_GET['page']) && $_GET['page'] == $tab[2]) ? ' nav-tab-active' : ''; ?>"><?php echo $tab[0]; ?></a>
62
- <?php
63
- }
64
- ?>
65
- </h2>
66
- </div>
67
- <?php
68
- }
69
- }
70
- }
71
-
72
- function settings_welcome() {
73
-
74
- global $qligg_token;
75
- ?>
76
- <?php $this->settings_header(); ?>
77
- <div class="qlwrap wrap about-wrap full-width-layout">
78
- <?php include_once('pages/welcome.php'); ?>
79
- </div>
80
- <?php
81
- }
82
-
83
- function settings_token() {
84
-
85
- global $qligg, $qligg_token, $qligg_api;
86
- ?>
87
- <?php $this->settings_header(); ?>
88
- <div class="qlwrap wrap about-wrap full-width-layout">
89
- <?php include_once('pages/token.php'); ?>
90
- </div>
91
- <?php
92
- }
93
-
94
- function settings_feeds() {
95
- global $qligg, $qligg_token, $qligg_api;
96
- $instagram_feeds = get_option('insta_gallery_items', array());
97
- ?>
98
- <?php $this->settings_header(); ?>
99
- <div class="qlwrap wrap about-wrap full-width-layout">
100
- <?php include_once('pages/views/list.php'); ?>
101
- <?php
102
- $instagram_feed = QLIGG_Options::instance()->instagram_feed;
103
-
104
- if (isset($_GET['tab']) && $_GET['tab'] == 'edit') {
105
-
106
- if (isset($_GET['item_id'])) {
107
-
108
- $ig_item_id = absint($_GET['item_id']);
109
-
110
- if (isset($instagram_feeds[$ig_item_id])) {
111
-
112
- $instagram_feed = wp_parse_args($instagram_feeds[$ig_item_id], $instagram_feed);
113
- }
114
- }
115
-
116
- include_once('pages/views/edit.php');
117
- }
118
- ?>
119
- </div>
120
- <?php
121
- }
122
-
123
- function settings_premium() {
124
-
125
- global $qligg_token, $qligg_api;
126
- ?>
127
- <?php $this->settings_header(); ?>
128
- <div class="qlwrap wrap about-wrap full-width-layout">
129
- <?php include_once('pages/premium.php'); ?>
130
- </div>
131
- <?php
132
- }
133
-
134
- function settings_suggestions() {
135
- ?>
136
- <?php $this->settings_header(); ?>
137
- <?php include_once('suggestions.php'); ?>
138
- <?php include_once('pages/suggestions.php'); ?>
139
- <?php
140
- }
141
-
142
- function add_menu() {
143
- add_menu_page(QLIGG_PLUGIN_NAME, str_replace('Feed ', '', QLIGG_PLUGIN_NAME), 'edit_posts', QLIGG_DOMAIN, array($this, 'settings_welcome'), 'dashicons-camera');
144
- add_submenu_page(QLIGG_DOMAIN, esc_html__('Welcome', 'insta-gallery'), esc_html__('Welcome', 'insta-gallery'), 'edit_posts', QLIGG_DOMAIN, array($this, 'settings_welcome'));
145
- add_submenu_page(QLIGG_DOMAIN, esc_html__('Account', 'insta-gallery'), esc_html__('Account', 'insta-gallery'), 'manage_options', QLIGG_DOMAIN . '_token', array($this, 'settings_token'));
146
- add_submenu_page(QLIGG_DOMAIN, esc_html__('Feeds', 'insta-gallery'), esc_html__('Feeds', 'insta-gallery'), 'manage_options', QLIGG_DOMAIN . '_feeds', array($this, 'settings_feeds'));
147
- add_submenu_page(QLIGG_DOMAIN, esc_html__('Suggestions', 'insta-gallery'), sprintf('%s', esc_html__('Suggestions', 'insta-gallery')), 'edit_posts', QLIGG_DOMAIN . '_suggestions', array($this, 'settings_suggestions'), 99);
148
- add_submenu_page(QLIGG_DOMAIN, esc_html__('Premium', 'insta-gallery'), sprintf('<i class="dashicons dashicons-awards"></i> %s', esc_html__('Premium', 'insta-gallery')), 'edit_posts', QLIGG_DOMAIN . '_premium', array($this, 'settings_premium'));
149
- }
150
-
151
- function add_admin_js($hook) {
152
- if (isset($_GET['page']) && strpos($_GET['page'], QLIGG_DOMAIN) !== false) {
153
- wp_enqueue_style('qligg-admin', plugins_url('/assets/css/qligg-admin.min.css', QLIGG_PLUGIN_FILE), array('wp-color-picker'), QLIGG_PLUGIN_VERSION, 'all');
154
- wp_enqueue_script('wp-color-picker-alpha', plugins_url('/assets/rgba/wp-color-picker-alpha.min.js', QLIGG_PLUGIN_FILE), array('jquery', 'wp-color-picker'), QLIGG_PLUGIN_VERSION, true);
155
- 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);
156
- wp_localize_script('qligg-admin', 'qligg', array(
157
- 'nonce' => wp_create_nonce('qligg_generate_token'),
158
- 'remove_cache' => esc_html__('Are you sure want to clear this item cache?', 'insta-gallery'),
159
- 'remove_item' => esc_html__('Are you sure want to delete this item?', 'insta-gallery'),
160
- 'remove_token' => esc_html__('Are you sure want to delete this access token?', 'insta-gallery'),
161
- 'remove_data' => esc_html__('Are you sure want to delete all settings on plugin uninstall?', 'insta-gallery')
162
- ));
163
- wp_enqueue_media();
164
- }
165
- }
166
-
167
- function dequeue_admin_js() {
168
- // Fix Instagram Feed compatibility
169
- if (isset($_GET['page']) && strpos($_GET['page'], QLIGG_DOMAIN) !== false) {
170
- wp_deregister_script('sb_instagram_admin_js');
171
- wp_dequeue_script('sb_instagram_admin_js');
172
- }
173
- }
174
-
175
- // fix for activateUrl on install now button
176
- public function network_admin_url($url, $path) {
177
-
178
- if (wp_doing_ajax() && !is_network_admin()) {
179
- if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin') {
180
- if (strpos($url, 'plugins.php') !== false) {
181
- $url = self_admin_url($path);
182
- }
183
- }
184
- }
185
-
186
- return $url;
187
- }
188
-
189
- public function add_redirect() {
190
-
191
- if (isset($_REQUEST['activate']) && $_REQUEST['activate'] == 'true') {
192
- if (wp_get_referer() == admin_url('admin.php?page=' . QLIGG_DOMAIN . '_suggestions')) {
193
- wp_redirect(admin_url('admin.php?page=' . QLIGG_DOMAIN . '_suggestions'));
194
- }
195
- }
196
- }
197
-
198
- function init() {
199
- add_action('admin_enqueue_scripts', array($this, 'add_admin_js'));
200
- add_action('admin_enqueue_scripts', array($this, 'dequeue_admin_js'), 999);
201
- add_action('admin_menu', array($this, 'add_menu'));
202
- add_filter('plugin_action_links_' . plugin_basename(QLIGG_PLUGIN_FILE), array($this, 'add_action_links'));
203
- //
204
- add_action('admin_init', array($this, 'add_redirect'));
205
- add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
206
- }
207
-
208
- public static function instance() {
209
- if (!isset(self::$instance)) {
210
- self::$instance = new self();
211
- self::$instance->init();
212
- }
213
- return self::$instance;
214
- }
215
-
216
- }
217
-
218
- QLIGG_Settings::instance();
219
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/view/backend/pages/accounts.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap about-wrap full-width-layout">
2
+ <p class="<?php
3
+ if (is_array($tokens) && count($tokens)) {
4
+ echo 'qligg-premium-field';
5
+ }
6
+ ?>">
7
+ <a id="qligg-generate-token" target="_self" href="<?php echo esc_url($qligg_api->get_create_account_link()); ?>" title="<?php esc_html_e('Add New Account', 'insta-gallery'); ?>">
8
+ <?php esc_html_e('Add New Account', 'insta-gallery'); ?>
9
+ </a>
10
+ <span style="float: none; margin-top: 0;" class="spinner"></span>
11
+ <a id="qligg-add-token" href="javascript:;"><?php esc_html_e('Button not working?', 'insta-gallery'); ?></a>
12
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature).', 'insta-gallery'); ?></small></span>
13
+ </p>
14
+
15
+ <?php if (is_array($tokens) && count($tokens)) : ?>
16
+ <table id="qligg_account_table" class="form-table widefat striped">
17
+ <thead>
18
+ <tr>
19
+ <th><?php esc_html_e('Image', 'insta-gallery'); ?></th>
20
+ <th><?php esc_html_e('User', 'insta-gallery'); ?></th>
21
+ <th><?php esc_html_e('ID', 'insta-gallery'); ?></th>
22
+ <th><?php esc_html_e('Name', 'insta-gallery'); ?></th>
23
+ <th><?php esc_html_e('Token', 'insta-gallery'); ?></th>
24
+ <th><?php esc_html_e('Action', 'insta-gallery'); ?></th>
25
+ </tr>
26
+ </thead>
27
+ <tbody>
28
+ <?php
29
+ foreach ($tokens as $username => $access_token) {
30
+ $profile_info = qligg_get_user_profile($username);
31
+ ?>
32
+ <tr data-token_id="<?php echo esc_attr($username) ?>">
33
+ <td width="1%">
34
+ <img class="qligg-avatar" src="<?php echo esc_url($profile_info['picture']); ?>" />
35
+ </td>
36
+ <td>
37
+ <?php echo esc_html($profile_info['user']); ?>
38
+ </td>
39
+ <td>
40
+ <?php echo esc_html($profile_info['id']); ?>
41
+ </td>
42
+ <td>
43
+ <?php echo esc_html($profile_info['name']); ?>
44
+ </td>
45
+ <td>
46
+ <input type="hidden" name="token_id" value="<?php echo esc_attr($username); ?>">
47
+ <input id="<?php echo esc_attr($username); ?>-access-token" type="text" value="<?php echo esc_attr($access_token); ?>" readonly />
48
+ </td>
49
+ <td>
50
+ <a href="javascript:;" data-qligg-copy-token="#<?php echo esc_attr($username); ?>-access-token" class="button button-primary">
51
+ <i class="dashicons dashicons-edit"></i><?php esc_html_e('Copy', 'insta-gallery'); ?>
52
+ </a>
53
+ <a href="javascript:;" data-qligg-delete-token="<?php echo esc_attr($username); ?>" class="button button-secondary">
54
+ <i class="dashicons dashicons-trash"></i><?php esc_html_e('Delete', 'insta-gallery'); ?>
55
+ </a>
56
+ <span class="spinner"></span>
57
+ </td>
58
+ </tr>
59
+ <?php
60
+ }
61
+ ?>
62
+ </tbody>
63
+ </table>
64
+ <?php endif; ?>
65
+ </div>
66
+
67
+ <?php include_once('modals/template-scripts-account.php'); ?>
includes/view/backend/pages/feeds.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap about-wrap full-width-layout">
2
+ <form method="post">
3
+ <p class="submit">
4
+ <?php submit_button(esc_html__('+ Feed', 'btn-instagram'), 'primary', 'submit', false, array('id' => 'qligg-add-feed')); ?>
5
+ <!--<span class="settings-save-status qligg-premium-field">
6
+ <?php submit_button(esc_html__('Save reorder', 'insta-gallery'), 'secondary', 'submit', false, array('id' => 'qligg_feeds_order', 'disabled' => 'disabled')); ?>
7
+ <span class="spinner"></span>
8
+ <span class="saved"><?php esc_html_e('Saved successfully!'); ?></span>
9
+ </span>-->
10
+ </p>
11
+ <table id="qligg_feeds_table" class="form-table widefat striped">
12
+ <thead>
13
+ <tr>
14
+ <th><?php esc_html_e('Image', 'insta-gallery'); ?></th>
15
+ <th><?php esc_html_e('Feed', 'insta-gallery'); ?></th>
16
+ <th><?php esc_html_e('ID', 'insta-gallery'); ?></th>
17
+ <th><?php esc_html_e('Layout', 'insta-gallery'); ?></th>
18
+ <th><?php esc_html_e('Token', 'insta-gallery'); ?></th>
19
+ <th><?php esc_html_e('Action', 'insta-gallery'); ?></th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <?php
24
+ $position = 1;
25
+
26
+ // var_dump($feeds);
27
+
28
+ foreach ($feeds as $id => $feed) {
29
+
30
+ if (!isset($feed['type']))
31
+ continue;
32
+ if ($feed['type'] == 'username') {
33
+ $profile_info = qligg_get_user_profile($feed['username']);
34
+ } else {
35
+ $profile_info = qligg_get_tag_profile($feed['tag']);
36
+ }
37
+ ?>
38
+ <tr class="<?php if ($position > 1) ?>" data-feed_id="<?php echo esc_attr($id) ?>" data-feed_position="<?php echo esc_attr($position) ?>">
39
+ <td width="1%">
40
+ <img class="qligg-avatar" src="<?php echo esc_url($profile_info['picture']); ?>" />
41
+ </td>
42
+ <td width="1%">
43
+ <?php echo esc_html($profile_info['user']); ?>
44
+ </td>
45
+ <td width="1%">
46
+ <?php echo esc_html($profile_info['id']); ?>
47
+ </td>
48
+ <td>
49
+ <?php echo esc_html(ucfirst($feed['layout'])); ?>
50
+ </td>
51
+ <td>
52
+ <input id="<?php echo esc_attr($id); ?>-feed-shortcode" type="text" value='[insta-gallery id="<?php echo esc_attr($id); ?>"]' readonly />
53
+ <a href="javascript:;" data-qligg-copy-feed-shortcode="#<?php echo esc_attr($id); ?>-feed-shortcode" class="button button-secondary">
54
+ <i class="dashicons dashicons-edit"></i><?php esc_html_e('Copy', 'insta-gallery'); ?>
55
+ </a>
56
+ </td>
57
+ <td>
58
+ <a href="javascript:;" class="qligg_edit_feed button button-primary" title="<?php esc_html_e('Edit feed', 'insta-gallery'); ?>"><?php esc_html_e('Edit'); ?></a>
59
+ <a href="javascript:;" class="qligg_clear_cache button button-secondary" title="<?php esc_html_e('Clear feed cache', 'insta-gallery'); ?>"><i class="dashicons dashicons dashicons-update"></i><?php esc_html_e('Cache', 'insta-gallery'); ?></a>
60
+ <a href="javascript:;" class="qligg_delete_feed" title="<?php esc_html_e('Delete feed', 'insta-gallery'); ?>"><?php esc_html_e('Delete'); ?></a>
61
+ <span class="spinner"></span>
62
+ </td>
63
+ </tr>
64
+ <?php
65
+ $position++;
66
+ } unset($i);
67
+ ?>
68
+ </tbody>
69
+ </table>
70
+ </form>
71
+ </div>
72
+
73
+ <?php include_once('modals/template-scripts-feed.php'); ?>
includes/view/backend/pages/modals/account/main.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="media-modal-backdrop">&nbsp;</div>
2
+ <div tabindex="0" id="<?php echo esc_attr(QLIGG_PREFIX . '_modal'); ?>" class="media-modal qligg-modal-token wp-core-ui upload-php" role="dialog" aria-modal="true" aria-labelledby="media-frame-title">
3
+ <form class="media-modal-form" method="POST">
4
+ <div class="media-modal-content" role="document">
5
+ <div class="edit-attachment-frame mode-select hide-menu hide-router">
6
+ <div class="edit-media-header">
7
+ <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php esc_html_e('Close dialog'); ?></span></span></button>
8
+ </div>
9
+ <div class="media-frame-title">
10
+ <h1><?php esc_html_e('Manually connect an account', 'insta-gallery'); ?></h1>
11
+ </div>
12
+ <div class="panel" style="
13
+ top: 50px;
14
+ position: absolute;
15
+ width: 100%;
16
+ border-top: 1px solid #ddd;
17
+ ">
18
+ <div class="options_group">
19
+ <p class="form-field">
20
+ <label><?php esc_html_e('Token', 'insta-gallery'); ?></label>
21
+ <input style="min-width: 260px;" name="access_token" type="text" maxlength="200" placeholder="<?php esc_html_e('Enter a valid access token', 'insta-gallery'); ?>" required />
22
+ <span class="description"><a style="margin: 0 15px" target="_blank" href="https://quadlayers.com/insta-token/"><?php esc_html_e('Get access token', 'insta-gallery'); ?></a></span>
23
+ </p>
24
+ </div>
25
+ <div class="options_group" style="border-bottom: none">
26
+ <p class="form-field">
27
+ Once you click the button you'll be prompted to log into your Instagram account and authorize the website to read your information. Once authorized you'll be returned back to this page with both your Access Token and User ID.
28
+ </p>
29
+ </div>
30
+ </div>
31
+ <div class="media-frame-toolbar" style="left:0;">
32
+ <div class="media-toolbar">
33
+ <div class="media-toolbar-secondary">
34
+ <span class="settings-save-status media-button" style="float:left">
35
+ <span class="saved"><?php esc_html_e('Saved successfully!'); ?></span>
36
+ <span class="spinner"></span>
37
+ </span>
38
+ </div>
39
+ <div class="media-toolbar-primary search-form">
40
+ <button type="submit" class="media-modal-submit button button-primary media-button button-large" <# if ( data.id != undefined ) { #>disabled="disabled"<# } #>><?php esc_html_e('Save'); ?></button>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ </form>
47
+ </div>
includes/view/backend/pages/modals/feed/main.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="media-modal-backdrop">&nbsp;</div>
2
+ <div tabindex="0" id="<?php echo esc_attr(QLIGG_PREFIX . '_modal'); ?>" class="media-modal qligg-modal-feed wp-core-ui upload-php processing" role="dialog" aria-modal="true" aria-labelledby="media-frame-title">
3
+ <div class="media-modal-content" role="document">
4
+ <form class="media-modal-form" method="POST">
5
+ <# if ( data.id != undefined ) { #>
6
+ <input type="hidden" name="id" value="{{data.id}}" />
7
+ <input type="hidden" name="order" value="{{data.order}}" />
8
+ <# } #>
9
+ <div class="edit-attachment-frame mode-select hide-menu hide-router">
10
+ <div class="edit-media-header">
11
+ <# if ( data.id != undefined ) { #>
12
+ <button type="button" class="media-modal-prev left dashicons" <# if ( data.order == 1 ) { #>disabled="disabled"<# } #>><span class="screen-reader-text"><?php esc_html_e('Edit previous media item'); ?></span></button>
13
+ <button type="button" class="media-modal-next right dashicons" <# if ( data.order == <?php echo 0//esc_attr(count($feeds)); ?> ) { #>disabled="disabled"<# } #> ><span class="screen-reader-text"><?php esc_html_e('Edit next media item'); ?></span></button>
14
+ <# } #>
15
+ <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php esc_html_e('Close dialog'); ?></span></span></button>
16
+ </div>
17
+ <div class="media-frame-title">
18
+ <h1><?php esc_html_e('Edit feed', 'insta-gallery'); ?> # <# if ( data.id != undefined ) { #>{{data.id}}<# } else { #><?php echo esc_html_e('New', 'insta-gallery'); ?><# } #></h1>
19
+ </div>
20
+ <div class="media-frame-content" style="bottom:61px;">
21
+ <div class="attachment-details" style="overflow: hidden;">
22
+ <div class="attachment-media-view landscape">
23
+ <div id="woocommerce-product-data" style="height:100%;">
24
+ <div class="panel-wrap" style="height:100%;">
25
+ <div id="qligg-modal-tabs">
26
+ </div>
27
+ <div id="qligg-modal-panels" style="height: 100%;overflow-x: hidden;">
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <div class="media-frame-toolbar" style="left:0;">
35
+ <div class="media-toolbar">
36
+ <div class="media-toolbar-secondary">
37
+ <span class="settings-save-status media-button" style="float:left">
38
+ <span class="saved"><?php esc_html_e('Saved successfully!'); ?></span>
39
+ <span class="spinner"></span>
40
+ </span>
41
+ </div>
42
+ <div class="media-toolbar-primary search-form">
43
+ <button type="submit" class="media-modal-submit button button-primary media-button button-large" <# if ( data.id != undefined ) { #>disabled="disabled"<# } #>><?php esc_html_e('Save'); ?></button>
44
+ <button type="button" class="media-modal-close button button-secondary media-button button-large" style="
45
+ height: auto;
46
+ float: none;
47
+ position: inherit;
48
+ padding: inherit;
49
+ "><?php esc_html_e('Close'); ?></button>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ </form>
55
+ </div>
56
+ </div>
includes/view/backend/pages/modals/feed/panel-feed-box.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_panel_feed_box" class="panel qligg_options_panel <# if (data.panel != 'tab_panel_feed_box') { #>hidden<# } #> " >
2
+
3
+ <div class="options_group qligg-premium-field">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Box', 'insta-gallery'); ?></label>
6
+ <input class="media-modal-render-panels" name="box[display]" type="checkbox" value="true" <# if (data.box.display){ #>checked<# } #> />
7
+ <span class="description"><small><?php esc_html_e('Display the Instagram Feed inside a customizable box', 'insta-gallery'); ?></small></span>
8
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
9
+ </p>
10
+ </div>
11
+
12
+ <div class="options_group <# if (!data.box.display){ #>disabled-color-picker<# } #>">
13
+ <p class="form-field">
14
+ <label><?php esc_html_e('Box padding', 'insta-gallery'); ?></label>
15
+ <input name="box[padding]" type="number" value="{{data.box.padding}}" min="0"/>
16
+ <span class="description"><small><?php esc_html_e('Add padding to the Instagram Feed', 'insta-gallery'); ?></small></span>
17
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
18
+ </p>
19
+
20
+ <p class="form-field">
21
+ <label><?php esc_html_e('Box radius', 'insta-gallery'); ?></label>
22
+ <input name="box[radius]" type="number" value="{{data.box.radius}}" min="0"/>
23
+ <span class="description"><small><?php esc_html_e('Add radius to the Instagram Feed', 'insta-gallery'); ?></small></span>
24
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
25
+ </p>
26
+
27
+ <p class="form-field">
28
+ <label><?php esc_html_e('Box background', 'insta-gallery'); ?></label>
29
+ <input data-alpha="true" name="box[background]" type="text" placeholder="#c32a67" value="{{data.box.background}}" class="color-picker"/>
30
+ <span class="description"><small><?php esc_html_e('Color which is displayed on box background', 'insta-gallery'); ?></small></span>
31
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
32
+ </p>
33
+ </div>
34
+
35
+ <div class="options_group qligg-premium-fielsd <# if (!data.box.display){ #>disabled-color-picker<# } #>">
36
+ <p class="form-field">
37
+ <label><?php esc_html_e('Profile', 'insta-gallery'); ?></label>
38
+ <input class="media-modal-render-panels" name="box[profile]" type="checkbox" value="true" <# if (data.box.profile){ #>checked<# } #> />
39
+ <span class="description"><small><?php esc_html_e('Display user profile or tag info', 'insta-gallery'); ?> </small></span>
40
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
41
+ </p>
42
+ <p class="form-field <# if (!data.box.profile){ #>disabled-color-picker<# } #>">
43
+ <label><?php esc_html_e('Profile description', 'insta-gallery'); ?></label>
44
+ <input name="box[desc]" type="text" placeholder="Instagram" value="{{data.box.desc}}"/>
45
+ <span class="description"><small><?php esc_html_e('Box description here', 'insta-gallery'); ?></small></span>
46
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
47
+ </p>
48
+ </div>
49
+
50
+ </div>
includes/view/backend/pages/modals/feed/panel-feed-button-load.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_panel_feed_button_load" class="panel qligg_options_panel <# if (data.panel != 'tab_panel_feed_button_load') { #>hidden<# } #>" >
2
+
3
+ <div class="options_group qligg-premium-field">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Instagram button', 'insta-gallery'); ?></label>
6
+ <input class="media-modal-render-panels" name="button_load[display]" type="checkbox" value="true" <# if (data.button_load.display){ #>checked<# } #>/>
7
+ <span class="description"><small><?php esc_html_e('Display the button to open Instagram site link', 'insta-gallery'); ?></small></span>
8
+ </p>
9
+ <p class="form-field <# if (!data.button_load.display){ #>disabled-color-picker<# } #>">
10
+ <label><?php esc_html_e('Instagram button text', 'insta-gallery'); ?></label>
11
+ <input name="button_load[text]" type="text" placeholder="Instagram" value="{{data.button_load.text}}"/>
12
+ <span class="description"><small><?php esc_html_e('Instagram button text here', 'insta-gallery'); ?></small></span>
13
+ </div>
14
+
15
+ <div class="options_group qligg-premium-field <# if (!data.button_load.display){ #>disabled-color-picker<# } #>">
16
+ <p class="form-field">
17
+ <label><?php esc_html_e('Instagram button background', 'insta-gallery'); ?></label>
18
+ <input class="color-picker" data-alpha="true" name="button_load[background]" type="text" placeholder="#c32a67" value="{{data.button_load.background}}"/>
19
+ <span class="description"><small><?php esc_html_e('Color which is displayed on button background', 'insta-gallery'); ?></small></span>
20
+ </p>
21
+ <p class="form-field">
22
+ <label><?php esc_html_e('Instagram button hover background', 'insta-gallery'); ?></label>
23
+ <input class="color-picker" data-alpha="true" name="button_load[background_hover]" type="text" placeholder="#da894a" value="{{data.button_load.background_hover}}"/>
24
+ <span class="description"><small><?php esc_html_e('Color which is displayed when hovered over button', 'insta-gallery'); ?></small></span>
25
+ </p>
26
+ </div>
27
+
28
+ </div>
includes/view/backend/pages/modals/feed/panel-feed-button.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_panel_feed_button" class="panel qligg_options_panel <# if (data.panel != 'tab_panel_feed_button') { #>hidden<# } #>" >
2
+
3
+ <div class="options_group">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Instagram button', 'insta-gallery'); ?></label>
6
+ <input class="media-modal-render-panels" name="button[display]" type="checkbox" value="true" <# if (data.button.display){ #>checked<# } #>/>
7
+ <span class="description"><small><?php esc_html_e('Display the button to open Instagram site link', 'insta-gallery'); ?></small></span>
8
+ </p>
9
+ <p class="form-field <# if (!data.button.display){ #>disabled-color-picker<# } #>">
10
+ <label><?php esc_html_e('Instagram button text', 'insta-gallery'); ?></label>
11
+ <input name="button[text]" type="text" placeholder="Instagram" value="{{data.button.text}}"/>
12
+ <span class="description"><small><?php esc_html_e('Instagram button text here', 'insta-gallery'); ?></small></span>
13
+ </div>
14
+
15
+ <div class="options_group <# if (!data.button.display){ #>disabled-color-picker<# } #> ">
16
+ <p class="form-field">
17
+ <label><?php esc_html_e('Instagram button background', 'insta-gallery'); ?></label>
18
+ <input class="color-picker" data-alpha="true" name="button[background]" type="text" placeholder="#c32a67" value="{{data.button.background}}"/>
19
+ <span class="description"><small><?php esc_html_e('Color which is displayed on button background', 'insta-gallery'); ?></small></span>
20
+ </p>
21
+ <p class="form-field">
22
+ <label><?php esc_html_e('Instagram button hover background', 'insta-gallery'); ?></label>
23
+ <input class="color-picker" data-alpha="true" name="button[background_hover]" type="text" placeholder="#da894a" value="{{data.button.background_hover}}"/>
24
+ <span class="description"><small><?php esc_html_e('Color which is displayed when hovered over button', 'insta-gallery'); ?></small></span>
25
+ </p>
26
+ </div>
27
+
28
+ </div>
includes/view/backend/pages/modals/feed/panel-feed-carousel.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_panel_feed" class="panel qligg_options_panel <# if (data.panel != 'tab_panel_carousel') { #>hidden<# } #>" >
2
+
3
+ <div class="options_group">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Slides per view', 'insta-gallery'); ?></label>
6
+ <input name="carousel[slidespv]" type="number" min="1" max="10" value="{{data.carousel.slidespv}}" />
7
+ <span class="description"><small><?php esc_html_e('Number of images per slide', 'insta-gallery'); ?></small> </span>
8
+ </p>
9
+ </div>
10
+ <div class="options_group">
11
+ <p class="form-field">
12
+ <label><?php esc_html_e('Autoplay', 'insta-gallery'); ?></label>
13
+ <input class="media-modal-render-panels" name="carousel[autoplay]" type="checkbox" value="true" <# if (data.carousel.autoplay){ #>checked<# } #> />
14
+ <span class="description"><small><?php esc_html_e('Autoplay carousel items', 'insta-gallery'); ?></small></span>
15
+ </p>
16
+ </div>
17
+ <div class="options_group <# if (!data.carousel.autoplay){ #>disabled-color-picker<# } #>">
18
+ <p class="form-field">
19
+ <label><?php esc_html_e('Autoplay Interval', 'insta-gallery'); ?></label>
20
+ <input name="carousel[autoplay_interval]" type="number" min="1000" max="300000" step="100" value="{{data.carousel.autoplay_interval}}" />
21
+ <span class="description"><small><?php esc_html_e('Moves to next picture after specified time interval', 'insta-gallery'); ?></small></span>
22
+
23
+ </div>
24
+ <div class="options_group">
25
+ <p class="form-field">
26
+ <label><?php esc_html_e('Navigation', 'insta-gallery'); ?></label>
27
+ <input name="carousel[navarrows]" type="checkbox" value="true" <# if (data.carousel.navarrows){ #>checked<# } #> />
28
+ <span class="description"><small><?php esc_html_e('Display navigation arrows', 'insta-gallery'); ?></small></span>
29
+ </p>
30
+ </div>
31
+ <div class="options_group">
32
+ <p class="form-field">
33
+ <label><?php esc_html_e('Navigation color', 'insta-gallery'); ?></label>
34
+ <input class="color-picker" data-alpha="true" name="carousel[navarrows_color]" type="text" placeholder="#c32a67" value="{{data.carousel.navarrows_color}}" />
35
+ <span class="description"><small><?php esc_html_e('Change navigation arrows color', 'insta-gallery'); ?></small></span>
36
+ </p>
37
+ </div>
38
+ <div class="options_group">
39
+ <p class="form-field">
40
+ <label><?php esc_html_e('Pagination', 'insta-gallery'); ?></label>
41
+ <input name="carousel[pagination]" type="checkbox" value="true" <# if (data.carousel.pagination){ #>checked<# } #> />
42
+ <span class="description"><small><?php esc_html_e('Display pagination dots', 'insta-gallery'); ?></small></span>
43
+ </p>
44
+ </div>
45
+ <div class="options_group">
46
+ <p class="form-field">
47
+ <label><?php esc_html_e('Pagination color', 'insta-gallery'); ?></label>
48
+ <input class="color-picker" data-alpha="true" name="carousel[pagination_color]" type="text" placeholder="#c32a67" value="{{data.carousel.pagination_color}}" />
49
+ <span class="description"><small><?php esc_html_e('Change pagination dotts color', 'insta-gallery'); ?></small></span>
50
+ </p>
51
+ </div>
52
+
53
+ </div>
includes/view/backend/pages/modals/feed/panel-feed-image-mask.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_panel_feed_image_mask" class="panel qligg_options_panel <# if (data.panel != 'tab_panel_feed_image_mask') { #>hidden<# } #>" >
2
+
3
+ <div class="options_group">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Images mask', 'insta-gallery'); ?></label>
6
+ <input class="media-modal-render-panels" name="mask[display]" type="checkbox" value="true" <# if (data.mask.display){ #>checked<# } #>/>
7
+ <span class="description"><small><?php esc_html_e('Image mouseover effect', 'insta-gallery'); ?></small></span>
8
+ </p>
9
+ </div>
10
+
11
+ <div class="options_group <# if (!data.mask.display){ #>disabled-color-picker<# } #>">
12
+ <p class="form-field">
13
+ <label><?php esc_html_e('Images mask color', 'insta-gallery'); ?></label>
14
+ <input data-alpha="true" name="mask[background]" type="text" placeholder="#007aff" value="{{data.mask.background}}" class="color-picker"/>
15
+
16
+ <span class="description"><small><?php esc_html_e('Color which is displayed when displayed over images', 'insta-gallery'); ?></small></span>
17
+ </p>
18
+ </div>
19
+
20
+ <div class="options_group <# if (!data.mask.display){ #>disabled-color-picker<# } #>">
21
+ <p class="form-field">
22
+ <label><?php esc_html_e('Images mask likes', 'insta-gallery'); ?></label>
23
+ <input name="mask[likes]" type="checkbox" value="true" <# if (data.mask.likes ){ #>checked<# } #>/>
24
+ <span class="description"><small><?php esc_html_e('Display likes count of images', 'insta-gallery'); ?></small></span>
25
+ </p>
26
+ </div>
27
+
28
+ <div class="options_group <# if (!data.mask.display){ #>disabled-color-picker<# } #>">
29
+ <p class="form-field">
30
+ <label><?php esc_html_e('Images mask comments', 'insta-gallery'); ?></label>
31
+ <input name="mask[comments]" type="checkbox" value="true" <# if (data.mask.comments ){ #>checked<# } #>/>
32
+ <span class="description"><small><?php esc_html_e('Display comments count of images', 'insta-gallery'); ?></small></span>
33
+ </p>
34
+ </div>
35
+
36
+ </div>
includes/view/backend/pages/modals/feed/panel-feed-image-popup.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_panel_feed_image_popup" class="panel qligg_options_panel <# if (data.panel != 'tab_panel_feed_image_popup') { #>hidden<# } #>" >
2
+
3
+ <div class="options_group">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Images popup', 'insta-gallery'); ?></label>
6
+ <input class="media-modal-render-panels" name="popup[display]" type="checkbox" value="true" <# if (data.popup.display){ #>checked<# } #>/>
7
+ <span class="description"><small><?php esc_html_e('Display popup gallery by clicking on image', 'insta-gallery'); ?></small></span>
8
+ </p>
9
+ </div>
10
+
11
+ <div class="options_group qligg-premium-field <# if (!data.popup.display){ #>disabled-color-picker<# } #>">
12
+ <p class="form-field">
13
+ <label><?php esc_html_e('Images popup profile', 'insta-gallery'); ?></label>
14
+ <input name="popup[profile]" type="checkbox" value="true" <# if (data.popup.profile){ #>checked<# } #> />
15
+ <span class="description"><small><?php esc_html_e('Display user profile or tag info', 'insta-gallery'); ?></small></span>
16
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
17
+ </p>
18
+ </div>
19
+
20
+ <div class="options_group qligg-premium-field <# if (!data.popup.display){ #>disabled-color-picker<# } #>">
21
+ <p class="form-field">
22
+ <label><?php esc_html_e('Images popup caption', 'insta-gallery'); ?></label>
23
+ <input name="popup[caption]" type="checkbox" value="true" <# if (data.popup.caption){ #>checked<# } #> />
24
+ <span class="description"><small><?php esc_html_e('Display caption in the popup', 'insta-gallery'); ?></small></span>
25
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
26
+ </p>
27
+ </div>
28
+
29
+ <div class="options_group qligg-premium-field <# if (!data.popup.display){ #>disabled-color-picker<# } #>">
30
+ <p class="form-field">
31
+ <label><?php esc_html_e('Images popup likes', 'insta-gallery'); ?></label>
32
+ <input name="popup[likes]" type="checkbox" value="true" <# if (data.popup.likes){ #>checked<# } #>/>
33
+ <span class="description"><small><?php esc_html_e('Display likes count of images', 'insta-gallery'); ?></small></span>
34
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
35
+ </p>
36
+ </div>
37
+
38
+ <div class="options_group qligg-premium-field <# if (!data.popup.display){ #>disabled-color-picker<# } #>">
39
+ <p class="form-field">
40
+ <label><?php esc_html_e('Images popup align', 'insta-gallery'); ?></label>
41
+ <select name="popup[align]">
42
+ <option value="top" <?php selected('top', $feed['popup']['align']); ?>><?php esc_html_e('Top', 'insta-gallery'); ?></option>
43
+ <option <# if ( data.popup.align == 'left') { #>selected="selected"<# } #> value="left"><?php esc_html_e('Left', 'insta-gallery'); ?> </option>
44
+ <option <# if ( data.popup.align == 'right') { #>selected="selected"<# } #> value="right"><?php esc_html_e('Right', 'insta-gallery'); ?> </option>
45
+ <option <# if ( data.popup.align == 'bottom') { #>selected="selected"<# } #> value="bottom"><?php esc_html_e('Bottom', 'insta-gallery'); ?> </option>
46
+ <option <# if ( data.popup.align == 'top') { #>selected="selected"<# } #> value="top"><?php esc_html_e('Top', 'insta-gallery'); ?> </option>
47
+ </select>
48
+ <span class="description"><small><?php esc_html_e('Display likes count of images', 'insta-gallery'); ?></small></span>
49
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
50
+ </p>
51
+ </div>
52
+
53
+ </div>
includes/view/backend/pages/modals/feed/panel-feed-image.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_panel_feed_image" class="panel qligg_options_panel <# if (data.panel != 'tab_panel_feed_image') { #>hidden<# } #>">
2
+
3
+ <div class="options_group">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Images resolution', 'insta-gallery'); ?></label>
6
+ <select name="resolution">
7
+ <option <# if ( data.resolution == 'standard') { #>selected="selected"<# } #> value="standard"><?php esc_html_e('Standard', 'insta-gallery'); ?> (640 x auto)</option>
8
+ <option <# if ( data.resolution == 'medium') { #>selected="selected"<# } #> value="medium"><?php esc_html_e('Medium', 'insta-gallery'); ?> (320 x auto)</option>
9
+ <option <# if ( data.resolution == 'small') { #>selected="selected"<# } #> value="small"><?php esc_html_e('Small', 'insta-gallery'); ?> (150 x 150)</option>
10
+ </select>
11
+ </p>
12
+ <p class="form-field">
13
+ <label><?php esc_html_e('Images spacing', 'insta-gallery'); ?></label>
14
+ <input name="spacing" min="0" type="number" value="{{data.spacing}}" />
15
+ <span class="description"><small><?php esc_html_e('Add blank space between images', 'insta-gallery'); ?></small></span>
16
+ </p>
17
+ </div>
18
+
19
+ <div class="options_group qligg-premium-field">
20
+ <p class="form-field">
21
+ <label><?php esc_html_e('Images card', 'insta-gallery'); ?></label>
22
+ <input class="media-modal-render-panels" name="card[display]" type="checkbox" value="true" <# if (data.card.display){ #>checked<# } #> />
23
+ <span class="description"><small><?php esc_html_e('Display card gallery by clicking on image', 'insta-gallery'); ?></small></span>
24
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
25
+ </p>
26
+ </div>
27
+
28
+ <div class="options_group qligg-premium-field <# if (!data.card.display){ #>disabled-color-picker<# } #>">
29
+ <p class="form-field">
30
+ <label><?php esc_html_e('Card radius', 'insta-gallery'); ?></label>
31
+ <input name="card[radius]" type="number" min="0" max="1000" value="{{data.card.radius}}"/>
32
+ <span class="description"><small><?php esc_html_e('Add radius to the Instagram Feed', 'insta-gallery'); ?></small></span>
33
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
34
+ </p>
35
+
36
+ <p class="form-field">
37
+ <label><?php esc_html_e('Card font size', 'insta-gallery'); ?></label>
38
+ <input name="card[font_size]" type="number" min="8" max="36" value="{{data.card.font_size}}"/>
39
+ <span class="description"><small><?php esc_html_e('Add font-size to the Instagram Feed', 'insta-gallery'); ?></small></span>
40
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
41
+ </p>
42
+
43
+ <p class="form-field">
44
+ <label><?php esc_html_e('Card background', 'insta-gallery'); ?></label>
45
+ <input class="color-picker" data-alpha="true" name="card[background]" type="link" placeholder="#007aff" value="{{data.card.background}}"/>
46
+ <span class="description"><small><?php esc_html_e('Color which is displayed when over images', 'insta-gallery'); ?></small></span>
47
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
48
+ </p>
49
+
50
+ <p class="form-field">
51
+ <label><?php esc_html_e('Card padding', 'insta-gallery'); ?></label>
52
+ <input name="card[padding]" type="number" min="0" max="50" value="{{data.card.padding}}"/>
53
+ <span class="description"><small><?php esc_html_e('Add blank space between images', 'insta-gallery'); ?></small></span>
54
+ </p>
55
+
56
+ <p class="form-field">
57
+ <label><?php esc_html_e('Card info', 'insta-gallery'); ?></label>
58
+ <input name="card[info]" type="checkbox" value="true" <# if (data.card.info){ #>checked<# } #> />
59
+ <span class="description"><small><?php esc_html_e('Display likes count of images', 'insta-gallery'); ?></small></span>
60
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
61
+ </p>
62
+
63
+ <p class="form-field">
64
+ <label><?php esc_html_e('Card caption', 'insta-gallery'); ?></label>
65
+ <input name="card[caption]" type="checkbox" value="true" <# if (data.card.caption){ #>checked<# } #> />
66
+ <span class="description"><small><?php esc_html_e('Display caption count of images', 'insta-gallery'); ?></small></span>
67
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
68
+ </p>
69
+
70
+ <p class="form-field">
71
+ <label><?php esc_html_e('Card length', 'insta-gallery'); ?></label>
72
+ <input name="card[length]" type="number" min="5" max="1000" value="{{data.card.length}}"/></small></span>
73
+ <span class="description"><small><?php esc_html_e('Add blank space between images', 'insta-gallery'); ?></small></span>
74
+ </p>
75
+ </div>
76
+
77
+ </div>
includes/view/backend/pages/modals/feed/panel-feed.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tab_panel_feed" class="panel qligg_options_panel <# if (data.panel != 'tab_panel_feed') { #>hidden<# } #>" >
2
+
3
+ <div class="options_group">
4
+ <p class="form-field">
5
+ <label><?php esc_html_e('Type', 'insta-gallery'); ?></label>
6
+ <input type="radio" class="media-modal-render-panels" name="type" value="tag" <# if(data.type == 'tag') { #>checked="checked"<# } #> />
7
+ <label><?php esc_html_e('Tag', 'insta-gallery'); ?></label>
8
+ <input type="radio" class="media-modal-render-panels" name="type" value="username" <# if(data.type == 'username') { #>checked="checked"<# } #> />
9
+ <label><?php esc_html_e('User name', 'insta-gallery'); ?></label>
10
+ </p>
11
+ </div>
12
+
13
+ <div class="options_group <# if ( data.type != 'username') {#>hidden<#}#>">
14
+ <p class="form-field">
15
+ <?php if (!count($tokens)): ?>
16
+ <div class="notice error" style="margin-left:0; margin-right:0; padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
17
+ <strong>
18
+ <?php printf(__('No Instagram account connected. Please connect your account <a target="_blank" href="%s">here</a>.', 'insta-gallery'), $qligg_api->get_create_account_link()); ?>
19
+ </strong>
20
+ </div>
21
+ <?php
22
+ else :
23
+ ?>
24
+ <label><?php esc_html_e('User', 'insta-gallery'); ?></label>
25
+ <select name="username" <# if ( data.type == 'username') {#>required="required"<#}#>>
26
+ <?php foreach ($tokens as $username => $access_token) : ?>
27
+ <?php $profile_info = qligg_get_user_profile($username); ?>
28
+ <option value="<?php echo esc_attr($username) ?>" <# if ( data.type == <?php echo $username; ?> ) { #>selected="selected"<# } #> > <?php echo esc_html($profile_info['user']); ?></option>
29
+ <?php endforeach; ?>
30
+ </select>
31
+ <span class="description"><small><?php esc_html_e('Please enter Instagram username', 'insta-gallery'); ?></small></span>
32
+ <?php endif; ?>
33
+ </p>
34
+ </div>
35
+
36
+ <div class="options_group <# if ( data.type != 'tag') {#>hidden<#}#>">
37
+ <p class="form-field">
38
+ <label><?php esc_html_e('Tag', 'insta-gallery'); ?></label>
39
+ <input name="tag" type="text" <# if ( data.type == 'tag') {#>required="required"<#}#> placeholder="beautiful" value="{{data.tag}}" />
40
+ <span class="description">
41
+ <small>
42
+ <?php esc_html_e('Please enter Instagram tag', 'insta-gallery'); ?>
43
+ </small>
44
+ </span>
45
+ </p>
46
+ </div>
47
+
48
+ <div class="options_group">
49
+ <div class="form-field">
50
+ <ul class="list-images">
51
+ <li class="media-modal-image <# if ( data.layout == 'gallery') {#>active<#}#>">
52
+ <input type="radio" name="layout" value="gallery" <# if (data.layout== 'gallery'){ #>checked<# } #> />
53
+ <label for="insta_layout-gallery"><?php esc_html_e('Gallery', 'insta-gallery'); ?></label>
54
+ <img src="<?php echo plugins_url('/assets/backend/img/gallery.png', QLIGG_PLUGIN_FILE); ?>"/>
55
+ </li>
56
+ <li class="media-modal-image <# if ( data.layout == 'carousel') {#>active<# } #>">
57
+ <input type="radio" name="layout" value="carousel" <# if (data.layout== 'carousel'){ #>checked<# } #> />
58
+ <label for="insta_layout-carousel"><?php esc_html_e('Carousel', 'insta-gallery'); ?></label>
59
+ <img src="<?php echo plugins_url('/assets/backend/img/carousel.png', QLIGG_PLUGIN_FILE); ?>"/>
60
+ </li>
61
+ <li class="media-modal-image qligg-premium-field <# if ( data.layout == 'masonry') {#>active<#}#>">
62
+ <input type="radio" name="layout" value="masonry" <# if (data.layout== 'masonry'){ #>checked<# } #> />
63
+ <label for="insta_layout-masonry"><?php esc_html_e('Masonry', 'insta-gallery'); ?>
64
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
65
+ </label>
66
+ <img src="<?php echo plugins_url('/assets/backend/img/masonry.png', QLIGG_PLUGIN_FILE); ?>"/>
67
+ </li>
68
+ <li class="media-modal-image qligg-premium-field <# if ( data.layout == 'highlight') {#>active<#}#>">
69
+ <input type="radio" id="insta_layout-highlight" name="layout" value="highlight" <# if (data.layout== 'highlight'){ #>checked<# } #> />
70
+ <label for="insta_layout-highlight"><?php esc_html_e('Highlight', 'insta-gallery'); ?>
71
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
72
+ </label>
73
+ <img src="<?php echo plugins_url('/assets/backend/img/highlight.png', QLIGG_PLUGIN_FILE); ?>"/>
74
+ </li>
75
+ </ul>
76
+ </div>
77
+ </div>
78
+
79
+ <div class="options_group">
80
+ <p class="form-field">
81
+ <label><?php esc_html_e('Limit', 'insta-gallery'); ?></label>
82
+ <input name="limit" type="number" min="1" max="33" value="{{data.limit}}" />
83
+ <span class="description"><small><?php esc_html_e('Number of images to display', 'insta-gallery'); ?></small></span>
84
+ </p>
85
+ </div>
86
+
87
+ <div class="options_group <# if(!_.contains(['gallery', 'masonry', 'highlight'], data.layout)) { #>hidden<# } #>">
88
+ <p class="form-field">
89
+ <label><?php esc_html_e('Columns', 'insta-gallery'); ?></label>
90
+ <input name="columns" type="number" min="1" max="20" value="{{data.columns}}" />
91
+ <span class="description"><small><?php esc_html_e('Number of images in a row', 'insta-gallery'); ?></small></span>
92
+ </p>
93
+ </div>
94
+
95
+ <div class="options_group qligg-premium-field <# if(!_.contains(['highlight', 'masonry'], data.layout)) { #>hidden<# } #>">
96
+ <p class="form-field">
97
+ <label><?php esc_html_e('Highlight by tag', 'insta-gallery'); ?></label>
98
+ <textarea name="highlight[tag]" placeholder="tag1, tag2, tag3">{{data.highlight.tag}}</textarea>
99
+ <span class="description"><small><?php esc_html_e('Highlight feeds items with this tags', 'insta-gallery'); ?></small></span>
100
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
101
+ </p>
102
+ <p class="form-field">
103
+ <label><?php esc_html_e('Highlight by id', 'insta-gallery'); ?></label>
104
+ <textarea name="highlight[id]" placeholder="101010110101010">{{data.highlight.id}}</textarea>
105
+ <span class="description"><small><?php esc_html_e('Highlight feeds items with this ids', 'insta-gallery'); ?></small></span>
106
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
107
+ </p>
108
+ <p class="form-field">
109
+ <label><?php esc_html_e('Highlight by position', 'insta-gallery'); ?></label>
110
+ <textarea name="highlight[position]" placeholder="1, 5, 7">{{data.highlight.position}}</textarea>
111
+ <span class="description"><small><?php esc_html_e('Highlight feeds items in this positions', 'insta-gallery'); ?></small></span>
112
+ <span class="description hidden"><small><?php esc_html_e('(This is a premium feature)', 'insta-gallery'); ?></small></span>
113
+ </p>
114
+ </div>
115
+
116
+ </div>
includes/view/backend/pages/modals/feed/panel-tabs.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul class="qligg-tabs">
2
+ <li class="media-modal-tab active">
3
+ <a href="#tab_panel_feed"><span><?php esc_html_e('General', 'insta-gallery'); ?></span></a>
4
+ </li>
5
+ <# if (data.layout == 'carousel' ){ #>
6
+ <li class="media-modal-tab">
7
+ <a href="#tab_panel_carousel"><span><?php esc_html_e('Carousel', 'insta-gallery'); ?></span></a>
8
+ </li>
9
+ <# } #>
10
+ <li class="media-modal-tab">
11
+ <a href="#tab_panel_feed_box"><span><?php esc_html_e('Box', 'insta-gallery'); ?></span></a>
12
+ </li>
13
+ <li class="media-modal-tab">
14
+ <a href="#tab_panel_feed_image"><span><?php esc_html_e('Image', 'insta-gallery'); ?></span></a>
15
+ </li>
16
+ <li class="media-modal-tab">
17
+ <a href="#tab_panel_feed_image_mask"><span><?php esc_html_e('Image mask', 'insta-gallery'); ?></span></a>
18
+ </li>
19
+ <li class="media-modal-tab">
20
+ <a href="#tab_panel_feed_image_popup"><span><?php esc_html_e('Image popup', 'insta-gallery'); ?></span></a>
21
+ </li>
22
+ <li class="media-modal-tab">
23
+ <a href="#tab_panel_feed_button"><span><?php esc_html_e('Button', 'insta-gallery'); ?></span></a>
24
+ </li>
25
+ <li class="media-modal-tab">
26
+ <a href="#tab_panel_feed_button_load"><span><?php esc_html_e('Button load more', 'insta-gallery'); ?></span></a>
27
+ </li>
28
+ </ul>
includes/view/backend/pages/modals/template-scripts-account.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <script type="text/html" id='tmpl-qligg-modal-account-main'>
2
+ <?php include_once(QLIGG_PLUGIN_DIR . 'includes/view/backend/pages/modals/account/main.php'); ?>
3
+ </script>
4
+
includes/view/backend/pages/modals/template-scripts-feed.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/html" id='tmpl-qligg-modal-main'>
2
+ <?php include_once(QLIGG_PLUGIN_DIR . 'includes/view/backend/pages/modals/feed/main.php'); ?>
3
+ </script>
4
+
5
+ <script type="text/html" id='tmpl-qligg-modal-tabs'>
6
+ <?php include_once('feed/panel-tabs.php'); ?>
7
+ </script>
8
+
9
+ <script type="text/html" id='tmpl-qligg-modal-panels'>
10
+ <?php include_once('feed/panel-feed.php'); ?>
11
+ <?php include_once('feed/panel-feed-carousel.php'); ?>
12
+ <?php include_once('feed/panel-feed-box.php'); ?>
13
+ <?php include_once('feed/panel-feed-image.php'); ?>
14
+ <?php include_once('feed/panel-feed-image-mask.php'); ?>
15
+ <?php include_once('feed/panel-feed-image-popup.php'); ?>
16
+ <?php include_once('feed/panel-feed-button.php'); ?>
17
+ <?php include_once('feed/panel-feed-button-load.php'); ?>
18
+ </script>
19
+
includes/view/backend/pages/parts/header.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap about-wrap full-width-layout">
2
+
3
+ <h1><?php echo esc_html(QLIGG_PLUGIN_NAME); ?></h1>
4
+
5
+ <p class="about-text"><?php printf(esc_html__('Thanks for using %s! We will do our best to offer you the best and improved communication experience with your users.', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?></p>
6
+
7
+ <p class="about-text">
8
+ <?php printf('<a href="%s" target="_blank">%s</a>', QLIGG_PURCHASE_URL, esc_html__('Purchase', 'insta-gallery')); ?></a> |
9
+ <?php printf('<a href="%s" target="_blank">%s</a>', QLIGG_DEMO_URL, esc_html__('Demo', 'insta-gallery')); ?></a> |
10
+ <?php printf('<a href="%s" target="_blank">%s</a>', QLIGG_DOCUMENTATION_URL, esc_html__('Documentation', 'insta-gallery')); ?></a>
11
+ </p>
12
+
13
+ <?php printf('<a href="%s" target="_blank"><div style="
14
+ background: #006bff url(%s) no-repeat;
15
+ background-position: top center;
16
+ background-size: 130px 130px;
17
+ color: #fff;
18
+ font-size: 14px;
19
+ text-align: center;
20
+ font-weight: 600;
21
+ margin: 5px 0 0;
22
+ padding-top: 120px;
23
+ height: 40px;
24
+ display: inline-block;
25
+ width: 140px;
26
+ " class="wp-badge">%s</div></a>', 'https://quadlayers.com/?utm_source=qligg_admin', plugins_url('/assets/backend/img/quadlayers.jpg', QLIGG_PLUGIN_FILE), esc_html__('QuadLayers', 'insta-gallery')); ?>
27
+
28
+ </div>
29
+ <?php
30
+ if (isset($submenu[QLIGG_DOMAIN])) {
31
+ if (is_array($submenu[QLIGG_DOMAIN])) {
32
+ ?>
33
+ <div class="wrap about-wrap full-width-layout">
34
+ <h2 class="nav-tab-wrapper">
35
+ <?php
36
+ foreach ($submenu[QLIGG_DOMAIN] as $tab) {
37
+ if (strpos($tab[2], '.php') !== false)
38
+ continue;
39
+ ?>
40
+ <a href="<?php echo admin_url('admin.php?page=' . esc_attr($tab[2])); ?>" class="nav-tab<?php echo (isset($_GET['page']) && $_GET['page'] == $tab[2]) ? ' nav-tab-active' : ''; ?>"><?php echo $tab[0]; ?></a>
41
+ <?php
42
+ }
43
+ ?>
44
+ </h2>
45
+ </div>
46
+ <?php
47
+ }
48
+ }
includes/view/backend/pages/premium.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap about-wrap full-width-layout">
2
+ <div class="has-2-columns is-wider-left" style="max-width: 100%">
3
+ <div class="column">
4
+ <div class="welcome-header">
5
+ <h1><?php esc_html_e('Premium', 'insta-gallery'); ?></h1>
6
+ <div class="about-description">
7
+ <?php printf(esc_html__('Unlock the power of our premium %s plugin which allows you to add unlimited Instagram accounts and offers you more layout options.', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
8
+ </div>
9
+ <br/>
10
+ <a style="background-color: #006cff;color: #ffffff;text-decoration: none;padding: 10px 30px;border-radius: 30px;margin: 10px 0 0 0;display: inline-block;" target="_blank" href="<?php echo esc_url(QLIGG_PURCHASE_URL); ?>"><?php esc_html_e('Purchase Now', 'insta-gallery'); ?></a>
11
+ <a style="background-color: #ffffff;color: #626262;text-decoration: none;padding: 10px 30px;border-radius: 30px;margin: 10px 0 0 0;display: inline-block;" target="_blank" href="<?php echo QLIGG_DEMO_URL; ?>"><?php esc_html_e('View demo', 'insta-gallery'); ?></a>
12
+ </div>
13
+ <hr/>
14
+ <div class="feature-section" style="margin: 15px 0;">
15
+ <h3><?php esc_html_e('Multiple accounts', 'insta-gallery'); ?></h3>
16
+ <p>
17
+ <?php esc_html_e('Include unlimited user accounts and create feeds galleries for different users with their own layout and settings.', 'insta-gallery'); ?>
18
+ </p>
19
+ </div>
20
+ <div class="feature-section" style="margin: 15px 0;">
21
+ <h3><?php esc_html_e('Customize colors', 'insta-gallery'); ?></h3>
22
+ <p>
23
+ <?php esc_html_e('Customize the colors of the Instagram Feed with a custom background, padding, and a rounded border. It also includes the user or tag profile info in the header of the box.', 'insta-gallery'); ?>
24
+ </p>
25
+ </div>
26
+ <div class="feature-section" style="margin: 15px 0;">
27
+ <h3><?php esc_html_e('Load more button', 'insta-gallery'); ?></h3>
28
+ <p>
29
+ <?php esc_html_e('Allow your users to load more images in the gallery providing an improved user experience.', 'insta-gallery'); ?>
30
+ </p>
31
+ </div>
32
+ </div>
33
+ <div class="column">
34
+ <img src="<?php echo plugins_url('/assets/backend/img/instagram-feed.png', QLIGG_PLUGIN_FILE); ?>">
35
+ </div>
36
+ </div>
37
+ <div class="has-2-columns" style="max-width: 100%">
38
+ <div class="column">
39
+ <img src="<?php echo plugins_url('/assets/backend/img/instagram-feed-popup-macbook.png', QLIGG_PLUGIN_FILE); ?>">
40
+ </div>
41
+ <div class="column">
42
+ <br/>
43
+ <div class="welcome-header">
44
+ <h1><?php esc_html_e('More content', 'insta-gallery'); ?></h1>
45
+ <div class="about-description">
46
+ <?php esc_html_e('Include some extra content for the images and the images popup.', 'insta-gallery'); ?>
47
+ </div>
48
+ </div>
49
+ <hr/>
50
+ <div class="feature-section" style="margin: 15px 0;">
51
+ <h3><?php esc_html_e('Popup content', 'insta-gallery'); ?></h3>
52
+ <p>
53
+ <?php esc_html_e('Our premium version allows you to include some extra content in the image popup, like the user profile, the image caption, and the number of comments and likes.', 'insta-gallery'); ?>
54
+ </p>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ <div class="has-2-columns is-wider-left" style="max-width: 100%">
59
+ <div class="column">
60
+ <div class="welcome-header">
61
+ <h1><?php esc_html_e('Layouts', 'insta-gallery'); ?></h1>
62
+ <div class="about-description">
63
+ <?php esc_html_e('Unlock the power of the masonry and highlight layouts that allows you to display the Instagram Feeds in a grid that supports items of variable size.', 'insta-gallery'); ?>
64
+ </div>
65
+ </div>
66
+ <hr/>
67
+ <div class="feature-section" style="margin: 15px 0;">
68
+ <h3><?php esc_html_e('Masonry layout', 'insta-gallery'); ?></h3>
69
+ <p>
70
+ <?php esc_html_e('The masonry layout is a grid that displays the images with a fixed with and variable height size.', 'insta-gallery'); ?>
71
+ </p>
72
+ </div>
73
+ <div class="feature-section" style="margin: 15px 0;">
74
+ <h3><?php esc_html_e('Highlight layout', 'insta-gallery'); ?></h3>
75
+ <p>
76
+ <?php esc_html_e('The highlight layout is a masonry grid that allows you to stand out some images with two or three columns width size.', 'insta-gallery'); ?>
77
+ </p>
78
+ </div>
79
+ </div>
80
+ <div class="column">
81
+ <img src="<?php echo plugins_url('/assets/backend/img/instagram-feed-load-more.png', QLIGG_PLUGIN_FILE); ?>">
82
+ </div>
83
+ </div>
84
+ </div>
includes/view/backend/pages/settings.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap about-wrap full-width-layout">
2
+ <form id="qligg-save-settings" method="post">
3
+ <table class="widefat form-table">
4
+ <tbody>
5
+ <tr>
6
+ <td colspan="100%">
7
+ <table>
8
+ <tbody>
9
+ <tr>
10
+ <th scope="row"><?php esc_html_e('Feeds cache', 'insta-gallery'); ?></th>
11
+ <td>
12
+ <input name="insta_reset" type="number" min="1" max="168" value="<?php echo esc_attr($settings['insta_reset']); ?>" />
13
+ <span class="description">
14
+ <?php esc_html_e('Reset your Instagram feeds cache every x hours.', 'insta-gallery'); ?>
15
+ </span>
16
+ </td>
17
+ </tr>
18
+ <tr>
19
+ <th><?php esc_html_e('Remove data', 'insta-gallery'); ?></th>
20
+ <td>
21
+ <input type="checkbox" name="insta_flush" value="1" <?php checked(1, $settings['insta_flush']); ?> />
22
+ <span class="description">
23
+ <?php esc_html_e('Check this box to remove all data related to this plugin on uninstall.', 'insta-gallery'); ?>
24
+ </span>
25
+ </td>
26
+ </tr>
27
+ <tr>
28
+ <th><?php esc_html_e('Replace loader', 'insta-gallery'); ?></th>
29
+ <td>
30
+ <?php
31
+ $mid = '';
32
+ $misrc = '';
33
+ if (isset($settings['insta_spinner_image_id'])) {
34
+ $mid = $settings['insta_spinner_image_id'];
35
+ $image = wp_get_attachment_image_src($mid, 'full');
36
+ if ($image) {
37
+ $misrc = $image[0];
38
+ }
39
+ }
40
+ ?>
41
+ <input type="hidden" name="insta_spinner_image_id" value="<?php echo esc_attr($mid); ?>" data-misrc="<?php echo esc_attr($misrc); ?>" />
42
+ <a href="javascript:;" id="ig-spinner-upload" class="button button-primary"><?php esc_html_e('Upload', 'insta-gallery'); ?></a>
43
+ <a href="javascript:;" id="ig-spinner-reset" class="button button-secondary"><?php esc_html_e('Reset Spinner', 'insta-gallery'); ?></a>
44
+ <p>
45
+ <span class="description">
46
+ <?php esc_html_e('Select an image from media library to replace the default loader icon.', 'insta-gallery'); ?>
47
+ </span>
48
+ </p>
49
+ </td>
50
+ <td rowspan="2">
51
+ <div class="insta-gallery-spinner">
52
+ </div>
53
+ </td>
54
+ </tr>
55
+ </tbody>
56
+ </table>
57
+ </td>
58
+ </tr>
59
+ </tbody>
60
+ <tfoot>
61
+ <tr>
62
+ <td colspan="3">
63
+ <span class="spinner"></span>
64
+ <button type="submit" class="button button-primary secondary"><?php esc_html_e('Save', 'insta-gallery'); ?></button>
65
+ </td>
66
+ </tr>
67
+ </tfoot>
68
+ </table>
69
+ </form>
70
+ </div>
includes/{pages → view/backend/pages}/suggestions.php RENAMED
File without changes
includes/view/backend/pages/welcome.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap about-wrap full-width-layout">
2
+ <div class="has-2-columns is-wider-left" style="max-width: 100%">
3
+ <div class="column">
4
+ <div class="welcome-header">
5
+ <h1><?php echo QLIGG_PLUGIN_NAME; ?> <span style="font-size: 24px;color: #555;">v<?php echo QLIGG_PLUGIN_VERSION; ?></span></h1>
6
+ <div class="about-text">
7
+ <?php esc_html_e('Hello we\'re QuadLayers! We\'ve recently acquired this plugin. We will do our absolute best to support it and fix all the issues.', 'insta-gallery'); ?>
8
+ </div>
9
+ </div>
10
+ <hr/>
11
+ <div class="feature-section" style="margin: 15px 0;">
12
+ <h3><?php esc_html_e('Demo', 'insta-gallery'); ?></h3>
13
+ <p>
14
+ <?php printf(esc_html__('Thank you for choosing our %s plugin for WordPress! Here you can see our demo and test the features we offer in the premium version.', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
15
+ </p>
16
+ <a style="background-color: #006cff;color: #ffffff;text-decoration: none;padding: 10px 30px;border-radius: 30px;margin: 10px 0 0 0;display: inline-block;" target="_blank" href="<?php echo QLIGG_DEMO_URL; ?>"><?php esc_html_e('View demo', 'insta-gallery'); ?></a>
17
+ </div>
18
+ <div class="feature-section" style="margin: 15px 0;">
19
+ <h3><?php esc_html_e('Support', 'insta-gallery'); ?></h3>
20
+ <p>
21
+ <?php printf(esc_html__('If you have any doubt or you find any issue don\'t hesitate to contact us through our ticket system or join our community to meet other %s users.', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
22
+ </p>
23
+ <a style="background-color: #ffffff;color: #626262;text-decoration: none;padding: 10px 30px;border-radius: 30px;margin: 10px 0 0 0;display: inline-block;" target="_blank" href="<?php echo QLIGG_SUPPORT_URL; ?>"><?php esc_html_e('Submit ticket', 'insta-gallery'); ?></a>
24
+ </div>
25
+ <div class="feature-section" style="margin: 15px 0;">
26
+ <h3><?php esc_html_e('Community', 'insta-gallery'); ?></h3>
27
+ <p>
28
+ <?php printf(esc_html__('If you want to get in touch with other %s users or be aware of our promotional discounts join our community now.', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
29
+ </p>
30
+ <a style="background-color: #ffffff;color: #626262;text-decoration: none;padding: 10px 30px;border-radius: 30px;margin: 10px 0 0 0;display: inline-block;" target="_blank" href="<?php echo QLIGG_GROUP_URL; ?>"><?php esc_html_e('Join our community', 'insta-gallery'); ?></a>
31
+ </div>
32
+ </div>
33
+ <div class="column">
34
+ <img src="<?php echo plugins_url('/assets/backend/img/mobile.png', QLIGG_PLUGIN_FILE); ?>">
35
+ </div>
36
+ </div>
37
+ </div>
includes/widget.php CHANGED
@@ -1,6 +1,4 @@
1
  <?php
2
- if (!defined('ABSPATH'))
3
- exit;
4
 
5
  class QLIGG_Widget extends WP_Widget {
6
 
@@ -36,28 +34,33 @@ class QLIGG_Widget extends WP_Widget {
36
 
37
  $title = $instance['title'];
38
  $instagal_id = $instance['instagal_id'];
39
- $instagram_feeds = get_option('insta_gallery_items', array());
 
 
 
 
 
40
  ?>
41
  <p>
42
  <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Title', 'insta-gallery'); ?>: <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label>
43
  </p>
44
- <?php if (!empty($instagram_feeds) && is_array($instagram_feeds)): ?>
45
  <p>
46
- <label for="<?php echo esc_attr($this->get_field_id('instagal_id')); ?>"><?php esc_html_e('Select your Instagram gallery', 'insta-gallery'); ?>: </label> <select
47
- id="<?php echo esc_attr($this->get_field_id('instagal_id')); ?>" name="<?php echo esc_attr($this->get_field_name('instagal_id')); ?>" class="widefat">
48
- <?php
49
- foreach ($instagram_feeds as $id => $instagram_feed) {
50
-
51
- if (isset($instagram_feed['insta_source'])) {
52
- if ($instagram_feed['insta_source'] == 'username') {
53
- $profile_info = qligg_get_user_profile($instagram_feed['insta_username']);
54
- } else {
55
- $profile_info = qligg_get_tag_profile($instagram_feed['insta_tag']);
56
- }
57
  }
 
58
 
59
- $label = sprintf('%s: %s', sprintf(esc_html__('Feed %s', 'insta-gallery'), $id), $profile_info['name']);
60
- ?>
61
  <option value="<?php echo esc_html($id); ?>" <?php selected($id, $instagal_id) ?>><?php echo esc_html($label); ?></option>
62
  <?php } ?>
63
  </select>
1
  <?php
 
 
2
 
3
  class QLIGG_Widget extends WP_Widget {
4
 
34
 
35
  $title = $instance['title'];
36
  $instagal_id = $instance['instagal_id'];
37
+
38
+ include_once(QLIGG_PLUGIN_DIR . 'includes/models/Feed.php');
39
+
40
+ $feed_model = new QLIGG_Feed();
41
+
42
+ $feeds = $feed_model->get_feeds();
43
  ?>
44
  <p>
45
  <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Title', 'insta-gallery'); ?>: <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label>
46
  </p>
47
+ <?php if (!empty($feeds) && is_array($feeds)): ?>
48
  <p>
49
+ <label for="<?php echo esc_attr($this->get_field_id('instagal_id')); ?>"><?php esc_html_e('Select your Instagram gallery', 'insta-gallery'); ?>:</label>
50
+ <select id="<?php echo esc_attr($this->get_field_id('instagal_id')); ?>" name="<?php echo esc_attr($this->get_field_name('instagal_id')); ?>" class="widefat">
51
+ <?php
52
+ foreach ($feeds as $id => $feed) {
53
+
54
+ if (isset($feed['type'])) {
55
+ if ($feed['type'] == 'username') {
56
+ $profile_info = qligg_get_user_profile($feed['username']);
57
+ } else {
58
+ $profile_info = qligg_get_tag_profile($feed['tag']);
 
59
  }
60
+ }
61
 
62
+ $label = sprintf('%s : %s', sprintf(esc_html__('Feed %s', 'insta-gallery'), $id), $profile_info['name']);
63
+ ?>
64
  <option value="<?php echo esc_html($id); ?>" <?php selected($id, $instagal_id) ?>><?php echo esc_html($label); ?></option>
65
  <?php } ?>
66
  </select>
insta-gallery.php CHANGED
@@ -1,9 +1,10 @@
1
  <?php
 
2
  /**
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.6.6
7
  * Author: QuadLayers
8
  * Author URI: https://quadlayers.com
9
  * License: GPL-2.0+
@@ -12,166 +13,52 @@
12
  * Domain Path: /languages
13
  */
14
  if (!defined('ABSPATH'))
15
- exit;
16
 
17
  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.6.6');
22
  }
23
  if (!defined('QLIGG_PLUGIN_FILE')) {
24
- define('QLIGG_PLUGIN_FILE', __FILE__);
25
  }
26
  if (!defined('QLIGG_PLUGIN_DIR')) {
27
- define('QLIGG_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
28
  }
29
  if (!defined('QLIGG_DOMAIN')) {
30
- define('QLIGG_DOMAIN', 'qligg');
 
 
 
31
  }
32
  if (!defined('QLIGG_WORDPRESS_URL')) {
33
- define('QLIGG_WORDPRESS_URL', 'https://wordpress.org/plugins/insta-gallery/');
34
  }
35
  if (!defined('QLIGG_REVIEW_URL')) {
36
- define('QLIGG_REVIEW_URL', 'https://wordpress.org/support/plugin/insta-gallery/reviews/?filter=5#new-post');
37
  }
38
  if (!defined('QLIGG_DEMO_URL')) {
39
- define('QLIGG_DEMO_URL', 'https://quadlayers.com/instagram-feed/?utm_source=qligg_admin');
40
  }
41
  if (!defined('QLIGG_PURCHASE_URL')) {
42
- define('QLIGG_PURCHASE_URL', QLIGG_DEMO_URL);
43
  }
44
  if (!defined('QLIGG_SUPPORT_URL')) {
45
- define('QLIGG_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=qligg_admin');
 
 
 
46
  }
47
  if (!defined('QLIGG_GROUP_URL')) {
48
- define('QLIGG_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
49
  }
50
  if (!defined('QLIGG_DEVELOPER')) {
51
- define('QLIGG_DEVELOPER', false);
52
  }
53
 
54
  if (!class_exists('QLIGG')) {
55
-
56
- class QLIGG {
57
-
58
- protected static $instance;
59
-
60
- function ajax_dismiss_notice() {
61
-
62
- if (check_admin_referer('qligg_dismiss_notice', 'nonce') && isset($_REQUEST['notice_id'])) {
63
-
64
- $notice_id = sanitize_key($_REQUEST['notice_id']);
65
-
66
- update_user_meta(get_current_user_id(), $notice_id, true);
67
-
68
- wp_send_json($notice_id);
69
- }
70
-
71
- wp_die();
72
- }
73
-
74
- function add_notices() {
75
-
76
- if (!get_transient('qligg-first-rating') && !get_user_meta(get_current_user_id(), 'qligg-user-rating', true)) {
77
- ?>
78
- <div id="qligg-admin-rating" class="qligg-notice notice is-dismissible" data-notice_id="qligg-user-rating">
79
- <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
80
- <div class="notice-image">
81
- <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/img/logo.jpg', QLIGG_PLUGIN_FILE); ?>" alt="<?php echo esc_html(QLIGG_PLUGIN_NAME); ?>>">
82
- </div>
83
- <div class="notice-content" style="margin-left: 15px;">
84
- <p>
85
- <?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'insta-gallery'), QLIGG_PLUGIN_NAME); ?>
86
- <br/>
87
- <?php esc_html_e('Could you please give it a 5-star rating on WordPress? We know its a big favor, but we\'ve worked very much and very hard to release this great product. Your feedback will boost our motivation and help us promote and continue to improve this product.', 'insta-gallery'); ?>
88
- </p>
89
- <a href="<?php echo esc_url(QLIGG_REVIEW_URL); ?>" class="button-primary" target="_blank">
90
- <?php esc_html_e('Yes, of course!', 'insta-gallery'); ?>
91
- </a>
92
- <a href="<?php echo esc_url(QLIGG_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
93
- <?php esc_html_e('Report a bug', 'insta-gallery'); ?>
94
- </a>
95
- </div>
96
- </div>
97
- </div>
98
- <script>
99
- (function ($) {
100
- $('.qligg-notice').on('click', '.notice-dismiss', function (e) {
101
- e.preventDefault();
102
- var notice_id = $(e.delegateTarget).data('notice_id');
103
- $.ajax({
104
- type: 'POST',
105
- url: ajaxurl,
106
- data: {
107
- notice_id: notice_id,
108
- action: 'qligg_dismiss_notice',
109
- nonce: '<?php echo wp_create_nonce('qligg_dismiss_notice'); ?>'
110
- },
111
- success: function (response) {
112
- console.log(response);
113
- },
114
- });
115
- });
116
- })(jQuery);
117
- </script>
118
- <?php
119
- }
120
- }
121
-
122
- function register_widget() {
123
- register_widget('QLIGG_Widget');
124
- }
125
-
126
- function api() {
127
-
128
- global $qligg_api;
129
-
130
- if (!class_exists('QLIGG_API')) {
131
-
132
- include_once ('includes/api.php');
133
- include_once ('includes/ajax.php');
134
-
135
- $qligg_api = new QLIGG_API();
136
- }
137
- }
138
-
139
- function includes() {
140
- include_once ('includes/utis.php');
141
- include_once ('includes/widget.php');
142
- include_once ('includes/defaults.php');
143
- include_once ('includes/settings.php');
144
- include_once ('includes/frontend.php');
145
- }
146
-
147
- function i18n() {
148
- load_plugin_textdomain('insta-gallery', false, QLIGG_PLUGIN_DIR . '/languages/');
149
- }
150
-
151
- function init() {
152
- add_action('widgets_init', array($this, 'register_widget'));
153
- add_action('plugins_loaded', array($this, 'i18n'));
154
- add_action('wp_ajax_qligg_dismiss_notice', array($this, 'ajax_dismiss_notice'));
155
- add_action('admin_notices', array($this, 'add_notices'));
156
- }
157
-
158
- public static function instance() {
159
- if (!isset(self::$instance)) {
160
- self::$instance = new self();
161
- self::$instance->api();
162
- self::$instance->includes();
163
- self::$instance->init();
164
- }
165
- return self::$instance;
166
- }
167
-
168
- public static function do_activation() {
169
- set_transient('qligg-first-rating', true, MONTH_IN_SECONDS);
170
- }
171
-
172
- }
173
-
174
- QLIGG::instance();
175
-
176
- register_activation_hook(QLIGG_PLUGIN_FILE, array('QLIGG', 'do_activation'));
177
- }
1
  <?php
2
+
3
  /**
4
  * Plugin Name: Instagram Feed Gallery
5
  * Plugin URI: https://quadlayers.com/portfolio/instagram-gallery/
6
  * Description: Display beautifull and responsive galleries on your website from your Instagram feed account.
7
+ * Version: 2.7.0
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPL-2.0+
13
  * Domain Path: /languages
14
  */
15
  if (!defined('ABSPATH'))
16
+ exit;
17
 
18
  if (!defined('QLIGG_PLUGIN_NAME')) {
19
+ define('QLIGG_PLUGIN_NAME', 'Instagram Feed Gallery');
20
  }
21
  if (!defined('QLIGG_PLUGIN_VERSION')) {
22
+ define('QLIGG_PLUGIN_VERSION', '2.7.0');
23
  }
24
  if (!defined('QLIGG_PLUGIN_FILE')) {
25
+ define('QLIGG_PLUGIN_FILE', __FILE__);
26
  }
27
  if (!defined('QLIGG_PLUGIN_DIR')) {
28
+ define('QLIGG_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
29
  }
30
  if (!defined('QLIGG_DOMAIN')) {
31
+ define('QLIGG_DOMAIN', 'qligg');
32
+ }
33
+ if (!defined('QLIGG_PREFIX')) {
34
+ define('QLIGG_PREFIX', QLIGG_DOMAIN);
35
  }
36
  if (!defined('QLIGG_WORDPRESS_URL')) {
37
+ define('QLIGG_WORDPRESS_URL', 'https://wordpress.org/plugins/insta-gallery/');
38
  }
39
  if (!defined('QLIGG_REVIEW_URL')) {
40
+ define('QLIGG_REVIEW_URL', 'https://wordpress.org/support/plugin/insta-gallery/reviews/?filter=5#new-post');
41
  }
42
  if (!defined('QLIGG_DEMO_URL')) {
43
+ define('QLIGG_DEMO_URL', 'https://quadlayers.com/instagram-feed/?utm_source=qligg_admin');
44
  }
45
  if (!defined('QLIGG_PURCHASE_URL')) {
46
+ define('QLIGG_PURCHASE_URL', 'https://quadlayers.com/portfolio/instagram-feed-gallery/?utm_source=qligg_admin');
47
  }
48
  if (!defined('QLIGG_SUPPORT_URL')) {
49
+ define('QLIGG_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=qligg_admin');
50
+ }
51
+ if (!defined('QLIGG_DOCUMENTATION_URL')) {
52
+ define('QLIGG_DOCUMENTATION_URL', 'https://quadlayers.com/documentation/instagram-feed-gallery/?utm_source=qligg_admin');
53
  }
54
  if (!defined('QLIGG_GROUP_URL')) {
55
+ define('QLIGG_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
56
  }
57
  if (!defined('QLIGG_DEVELOPER')) {
58
+ define('QLIGG_DEVELOPER', false);
59
  }
60
 
61
  if (!class_exists('QLIGG')) {
62
+ include_once( QLIGG_PLUGIN_DIR . 'includes/qligg.php' );
63
+ }
64
+ register_activation_hook(QLIGG_PLUGIN_FILE, array('QLIGG', 'do_activation'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,38 +1,50 @@
1
- === Social Feed Gallery ===
2
  Contributors: quadlayers, instagram
3
  Donate link: https://quadlayers.com/portfolio/instagram-gallery/
4
  Tags: instagram, instagram feed, instagram gallery, instagram photos, instagram widget, instagram pictures, gallery widget, pictures, carousel slider, image gallery, image slider
5
  Requires at least: 3.4
6
- Tested up to: 5.3
7
- Stable tag: 2.6.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Instagram Feed Gallery is an easy way to display your Instagram feed pictures in your website.
12
 
13
- == Description ==
 
 
 
 
 
 
 
14
 
15
- [Premium](https://quadlayers.com/portfolio/wordpress-instagram-feed/) | [Demo](https://quadlayers.com/instagram-feed/) | [Community](https://www.facebook.com/groups/quadlayers/)
 
 
 
 
16
 
17
- Instagram Feed Gallery is the most user-friendly Instagram plugin for Wordpress. It allows you to showcase your Instagram feed or Instagram tags on your website.
18
 
19
- This Instagram Gallery plugin offers you two different layouts to display your feeds, a grid gallery or a carousel slider. It also lets you create hashtags feeds, a feature that is usually available only the premium versions of other plugins.
20
 
21
  == Formerly Instagram Feed Gallery ==
22
 
23
- This plugin was formerly known as "Instagram Feed Gallery". WordPress forced us on August 8, 2019 to change the name of the plugin due to use of the "Instagram" word in the name. We apologize for the problems that the downtime may have caused to you.
24
 
25
  == Instagram Token setup ==
26
 
27
- Unlike other plugins that require creating an app with the developer tools, our Instagram Feed plugin offers you a one-click setup.
 
 
28
 
29
- All you need to display your Instagram user or hashtags pictures is clicking on the "Add New Account" button and your Instagram access token will be automatically generated and saved.
30
 
31
- == Instagram Premium ==
32
 
33
- Instagram Feed Gallery is a freemium plugin which allows you to include an unlimited number of user accounts and then create a separate feed for each of them.
34
 
35
- It also includes two extra layouts and offers a lot of customization options like a ‘Load More’ button, a box mode for the feed with colors and borders, the option to display the user profile avatar image, username and custom description and a lot more.
36
  ####Pro Features:
37
 
38
  > * Multiple Instagram User Accounts
@@ -47,6 +59,8 @@ It also includes two extra layouts and offers a lot of customization options lik
47
  > * Change Instagram Pictures popup description position
48
  > * Load more button
49
 
 
 
50
 
51
  == Frequently Asked Questions ==
52
 
@@ -91,6 +105,9 @@ There may be some other plugins(like: fancybox, elementor) which also uses image
91
 
92
  == Changelog ==
93
 
 
 
 
94
  = 2.6.6 =
95
  * Fix. instagram photo enhance
96
 
@@ -131,7 +148,7 @@ There may be some other plugins(like: fancybox, elementor) which also uses image
131
  * Fix. Instagram Feed Gallery card date
132
 
133
  = 2.5.3 =
134
- * Improvement. Instagram Account disconnet alert
135
  * Improvement. Instagram Feeds clear feeds cache button
136
 
137
  = 2.5.2 =
@@ -247,7 +264,7 @@ There may be some other plugins(like: fancybox, elementor) which also uses image
247
  * Fix. Instagram gallery image alignment
248
 
249
  = 2.1.4 =
250
- * Fix. Instagram thumbnail imagessizes updated
251
 
252
  = 2.1.3 =
253
  * Fix. Code bug
@@ -277,7 +294,7 @@ There may be some other plugins(like: fancybox, elementor) which also uses image
277
 
278
  = 1.6.2 =
279
  * Fix. Elementor confliction fixed
280
- * Fix. code optimised
281
  * Fix. IE 8,9 Carousel support dropped
282
 
283
  = 1.6.1 =
@@ -307,8 +324,8 @@ There may be some other plugins(like: fancybox, elementor) which also uses image
307
 
308
  = 1.5.5 =
309
  * Fix. Carousel autoplay toggle
310
- * Fix. dashicons removed
311
- * Fix. assets minified
312
 
313
  = 1.5.4 =
314
  * Fix. API update for Tags fixed
@@ -322,7 +339,7 @@ There may be some other plugins(like: fancybox, elementor) which also uses image
322
  = 1.5.1 =
323
  * Fix. Gallery widget added
324
  * Fix. Transients support added
325
- * Fix. template customisation added
326
  * Fix. code updated for better performance
327
 
328
  = 1.4.6 =
@@ -398,4 +415,4 @@ There may be some other plugins(like: fancybox, elementor) which also uses image
398
  * Fix. small modification in plugin backend
399
 
400
  = 1.1.1 =
401
- * Fix. Initial Release
1
+ === Social Feed Gallery ===
2
  Contributors: quadlayers, instagram
3
  Donate link: https://quadlayers.com/portfolio/instagram-gallery/
4
  Tags: instagram, instagram feed, instagram gallery, instagram photos, instagram widget, instagram pictures, gallery widget, pictures, carousel slider, image gallery, image slider
5
  Requires at least: 3.4
6
+ Tested up to: 5.3.2
7
+ Stable tag: 2.7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Instagram Feed Gallery helps to display your Instagram feed pictures in your website.
12
 
13
+ == Presentation ==
14
+
15
+ [Premium](https://quadlayers.com/portfolio/wordpress-instagram-feed/) | [Demo](https://quadlayers.com/instagram-feed/) | [Documentation](https://quadlayers.com/documentation/instagram-feed-gallery/) | [Community](https://www.facebook.com/groups/quadlayers/)
16
+
17
+ We are glad to present a plugin that helps to integrate <b>Instagram feed <b> from @ids or #tags inside your Wordpress site. Giving the possibility to <b>customize the layout of the display <b>, choosing from gallery or carousel for free version. Adding masonry or highlight alternatives for premium version.
18
+ While allowing to <b>set the appearance of display's boxes, images & backgrounds, masks and buttons<b>.
19
+
20
+ == Highlights ==
21
 
22
+ * Simplicity: Easy to sync up and configure how to display images from your Instagram account.
23
+ * Keep on track: site update is automated. Caching Images and testimonial data from Instagram.
24
+ * API use optimized: include <b>features to cache data<b>, to minimize the requests and reduce loading time.
25
+ * Pop-up box: customizable lightbox to allow users to see your content at your own site.
26
+ * Customization options: alternatives to change appearance, positioning and layout of your Instagram feed.
27
 
28
+ == Description ==
29
 
30
+ Instagram Feed Gallery is the most <b>user-friendly Instagram plugin for Wordpress <b>. It was built to simplify the integration, to reduce time to have sites updated and to be on track with social media that shows best growing indicators.
31
 
32
  == Formerly Instagram Feed Gallery ==
33
 
34
+ This plugin was formerly known as "Instagram Feed Gallery". WordPress forced us on August 8, 2019 to change the name of the plugin due to use of the "Instagram" as part of the name. We apologize for the problems that could be caused to you, due the downtime.
35
 
36
  == Instagram Token setup ==
37
 
38
+ Instagram Feed plugin offers you a one-click setup. Discarding the requirement to create any app to do this link, like other plugins do.
39
+
40
+ All you need is to do is add your credentials, and then select an Instagram @id or #tags pictures, by clicking on the "Add New Account" button and your Instagram access token will be automatically generated and saved.
41
 
42
+ == Instagram feed gallery Premium ==
43
 
44
+ Instagram Feed Gallery is a freemium plugin which allows you to include an unlimited number of user accounts and then create a separate feed for each one.
45
 
46
+ It also includes two extra layouts and offers a lot of customization options like a ‘Load More’ button, a box mode for the feed with colors and borders, the option to display the user profile avatar image, username and custom description and many more.
47
 
 
48
  ####Pro Features:
49
 
50
  > * Multiple Instagram User Accounts
59
  > * Change Instagram Pictures popup description position
60
  > * Load more button
61
 
62
+ Further information of configuration possibilities at [Documentation](https://quadlayers.com/documentation/instagram-feed-gallery/)
63
+
64
 
65
  == Frequently Asked Questions ==
66
 
105
 
106
  == Changelog ==
107
 
108
+ = 2.7.0 =
109
+ * Fix. instagram refactoring
110
+
111
  = 2.6.6 =
112
  * Fix. instagram photo enhance
113
 
148
  * Fix. Instagram Feed Gallery card date
149
 
150
  = 2.5.3 =
151
+ * Improvement. Instagram Account disconnect alert
152
  * Improvement. Instagram Feeds clear feeds cache button
153
 
154
  = 2.5.2 =
264
  * Fix. Instagram gallery image alignment
265
 
266
  = 2.1.4 =
267
+ * Fix. Instagram thumbnail images sizes updated
268
 
269
  = 2.1.3 =
270
  * Fix. Code bug
294
 
295
  = 1.6.2 =
296
  * Fix. Elementor confliction fixed
297
+ * Fix. code optimized
298
  * Fix. IE 8,9 Carousel support dropped
299
 
300
  = 1.6.1 =
324
 
325
  = 1.5.5 =
326
  * Fix. Carousel autoplay toggle
327
+ * Fix. Dash icons removed
328
+ * Fix. Assets minified
329
 
330
  = 1.5.4 =
331
  * Fix. API update for Tags fixed
339
  = 1.5.1 =
340
  * Fix. Gallery widget added
341
  * Fix. Transients support added
342
+ * Fix. Template customization added
343
  * Fix. code updated for better performance
344
 
345
  = 1.4.6 =
415
  * Fix. small modification in plugin backend
416
 
417
  = 1.1.1 =
418
+ * Fix. Initial Release
templates/carousel.php CHANGED
@@ -1,23 +1,23 @@
1
- <div id="<?php echo esc_attr($item_selector); ?>" class="insta-gallery-feed insta-gallery-square" data-feed="<?php echo htmlentities(json_encode($options), ENT_QUOTES, 'UTF-8'); ?>" data-feed_layout="<?php echo esc_attr($instagram_feed['insta_layout']); ?>">
2
  <?php
3
- if ($instagram_feed['insta_box-profile'] && ($template_file = $this->template_path('parts/profile.php'))) {
4
- include($template_file);
5
  }
6
  ?>
7
  <div class = "swiper-container">
8
  <div class = "insta-gallery-list swiper-wrapper">
9
  </div>
10
- <?php if ($instagram_feed['insta_car-pagination']) :
11
- ?>
12
- <div class="swiper-pagination"></div>
13
  <?php endif; ?>
14
- <?php if ($instagram_feed['insta_car-navarrows']) : ?>
15
- <div class="swiper-button-prev">
16
- <i class="qligg-icon-prev"></i>
17
- </div>
18
- <div class="swiper-button-next">
19
- <i class="qligg-icon-next"></i>
20
- </div>
21
  <?php endif; ?>
22
  <?php include($this->template_path('parts/spinner.php')); ?>
23
  </div>
1
+ <div id="<?php echo esc_attr($item_selector); ?>" class="insta-gallery-feed insta-gallery-square" data-feed="<?php echo htmlentities(json_encode($feed), ENT_QUOTES, 'UTF-8'); ?>" data-feed_layout="<?php echo esc_attr($feed['layout']); ?>">
2
  <?php
3
+ if (!empty($feed['box']['profile']) && ( $template_file = $this->template_path('parts/profile.php'))) {
4
+ include($template_file);
5
  }
6
  ?>
7
  <div class = "swiper-container">
8
  <div class = "insta-gallery-list swiper-wrapper">
9
  </div>
10
+ <?php if ($feed['carousel']['pagination']) :
11
+ ?>
12
+ <div class="swiper-pagination"></div>
13
  <?php endif; ?>
14
+ <?php if ($feed['carousel']['navarrows']) : ?>
15
+ <div class="swiper-button-prev">
16
+ <i class="qligg-icon-prev"></i>
17
+ </div>
18
+ <div class="swiper-button-next">
19
+ <i class="qligg-icon-next"></i>
20
+ </div>
21
  <?php endif; ?>
22
  <?php include($this->template_path('parts/spinner.php')); ?>
23
  </div>
templates/gallery.php CHANGED
@@ -1,6 +1,6 @@
1
- <div id="<?php echo esc_attr($item_selector); ?>" class="insta-gallery-feed insta-gallery-square" data-feed="<?php echo htmlentities(json_encode($options), ENT_QUOTES, 'UTF-8'); ?>" data-feed_layout="<?php echo esc_attr($instagram_feed['insta_layout']); ?>">
2
  <?php
3
- if ($instagram_feed['insta_box-profile'] && ($template_file = $this->template_path('parts/profile.php'))) {
4
  include($template_file);
5
  }
6
  ?>
1
+ <div id="<?php echo esc_attr($item_selector); ?>" class="insta-gallery-feed insta-gallery-square" data-feed="<?php echo htmlentities(json_encode($feed), ENT_QUOTES, 'UTF-8'); ?>" data-feed_layout="<?php echo esc_attr($feed['layout']); ?>">
2
  <?php
3
+ if (!empty($feed['box']['profile']) && ($template_file = $this->template_path('parts/profile.php'))) {
4
  include($template_file);
5
  }
6
  ?>
templates/item/item-image-mask.php CHANGED
@@ -1,16 +1,16 @@
1
  <div class="insta-gallery-image-mask">
2
  </div>
3
  <div class="insta-gallery-image-mask-content">
4
- <?php if ($instagram_feed['likes']): ?>
5
  <span class="ig-likes-likes">
6
  <i class="qligg-icon-heart-o"></i>
7
  <?php echo esc_attr($item['likes']); ?>
8
  </span>
9
  <?php endif; ?>
10
- <?php if ($instagram_feed['comments']): ?>
11
  <span class="ig-likes-comments">
12
  <i class="qligg-icon-comment-o"></i>
13
  <?php echo esc_attr($item['comments']); ?>
14
  </span>
15
  <?php endif; ?>
16
- </div>
1
  <div class="insta-gallery-image-mask">
2
  </div>
3
  <div class="insta-gallery-image-mask-content">
4
+ <?php if ($feed['mask']['likes']): ?>
5
  <span class="ig-likes-likes">
6
  <i class="qligg-icon-heart-o"></i>
7
  <?php echo esc_attr($item['likes']); ?>
8
  </span>
9
  <?php endif; ?>
10
+ <?php if ($feed['mask']['comments']): ?>
11
  <span class="ig-likes-comments">
12
  <i class="qligg-icon-comment-o"></i>
13
  <?php echo esc_attr($item['comments']); ?>
14
  </span>
15
  <?php endif; ?>
16
+ </div>
templates/item/item-image.php CHANGED
@@ -1,7 +1,7 @@
1
  <div class="insta-gallery-image-wrap">
2
  <a class="insta-gallery-link" href="<?php echo esc_url($item['link']); ?>" target="_blank">
3
  <img alt="Instagram" class="insta-gallery-image" src="<?php echo esc_url($image); ?>"/>
4
- <?php if ($instagram_feed['hover']): ?>
5
  <?php include($this->template_path('item/item-image-mask.php')); ?>
6
  <?php endif; ?>
7
  </a>
1
  <div class="insta-gallery-image-wrap">
2
  <a class="insta-gallery-link" href="<?php echo esc_url($item['link']); ?>" target="_blank">
3
  <img alt="Instagram" class="insta-gallery-image" src="<?php echo esc_url($image); ?>"/>
4
+ <?php if ($feed['mask']['display']): ?>
5
  <?php include($this->template_path('item/item-image-mask.php')); ?>
6
  <?php endif; ?>
7
  </a>
templates/item/item.php CHANGED
@@ -1,4 +1,7 @@
1
- <div id="insta-gallery-item-<?php echo esc_attr($item['id']); ?>" class="insta-gallery-item insta-gallery-cols-<?php echo esc_attr($instagram_feed['columns']); ?><?php echo ($instagram_feed['layout'] == 'carousel') ? ' swiper-slide nofancybox' : '' ?>" data-item="<?php echo htmlentities(json_encode($item), ENT_QUOTES, 'UTF-8'); ?>" data-elementor-open-lightbox="no">
 
 
 
2
  <div class="insta-gallery-item-wrap">
3
  <?php include($this->template_path('item/item-image.php')); ?>
4
  </div>
1
+ <div id="insta-gallery-item-<?php echo esc_attr($item['id']); ?>"
2
+ class="insta-gallery-item insta-gallery-cols-<?php echo esc_attr($feed['columns']); ?>
3
+ <?php echo ($feed['layout'] == 'carousel') ? ' swiper-slide nofancybox' : '' ?>"
4
+ data-item="<?php echo htmlentities(json_encode($item), ENT_QUOTES, 'UTF-8'); ?>" data-elementor-open-lightbox="no">
5
  <div class="insta-gallery-item-wrap">
6
  <?php include($this->template_path('item/item-image.php')); ?>
7
  </div>
templates/parts/actions.php CHANGED
@@ -1,5 +1,5 @@
1
- <?php if ($instagram_feed['insta_button']) : ?>
2
- <div class="insta-gallery-actions">
3
- <a href="<?php echo esc_url($profile_info['link']); ?>" target="blank" class="insta-gallery-button follow"><i class="qligg-icon-instagram-o"></i><?php echo esc_html($instagram_feed['insta_button-text']); ?></a>
4
- </div>
5
  <?php endif; ?>
1
+ <?php if (!empty($feed['button']['display'])) : ?>
2
+ <div class="insta-gallery-actions">
3
+ <a href="<?php echo esc_url($profile_info['link']); ?>" target="blank" class="insta-gallery-button follow"><i class="qligg-icon-instagram-o"></i><?php echo esc_html($feed['button']['text']); ?></a>
4
+ </div>
5
  <?php endif; ?>
uninstall.php CHANGED
@@ -10,6 +10,7 @@ if (!is_multisite()) {
10
  delete_option('insta_gallery_settings');
11
  delete_option('insta_gallery_setting');
12
  delete_option('insta_gallery_items');
 
13
  delete_option('insta_gallery_token');
14
  delete_option('insta_gallery_iac');
15
  }
10
  delete_option('insta_gallery_settings');
11
  delete_option('insta_gallery_setting');
12
  delete_option('insta_gallery_items');
13
+ delete_option('insta_gallery_feeds');
14
  delete_option('insta_gallery_token');
15
  delete_option('insta_gallery_iac');
16
  }