Instagram Feed - Version 2.1

Version Description

  • New: Added the ability to overwrite default templates in your theme. View this article for more information.
  • New: Added several PHP hooks for modifying feeds settings and functionality.
  • Fix: Using the "Load Initial Posts with AJAX" setting would cause images to not resize with the browser window.
  • Fix: Added back language files for translations.
  • Fix: Changing the image resolution setting would not change the image size.
  • Fix: Follow button would not show if there was no connected account.
  • Fix: Deleting any connected account will delete any connected accounts that have errors in the data that was saved for them.
Download this release

Release Info

Developer smashballoon
Plugin Icon 128x128 Instagram Feed
Version 2.1
Comparing to
See all releases

Code changes from version 2.0.2 to 2.1

README.txt CHANGED
@@ -2,8 +2,8 @@
2
Contributors: smashballoon, craig-at-smash-balloon
3
Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
Requires at least: 3.4
5
- Tested up to: 5.2
6
- Stable tag: 2.0.2
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
@@ -324,6 +324,15 @@ We understand that sometimes you need help, have issues or just have questions.
324
* Plus more customization options added all the time!
325
326
== Changelog ==
327
= 2.0.2 =
328
* Fix: HTML for header would still be visible in the source of the page when removing the header using showheader=false in the shortcode
329
* Fix: CSS added to prevent layout issues when adding the feed to a "text" widget for certain themes
2
Contributors: smashballoon, craig-at-smash-balloon
3
Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
Requires at least: 3.4
5
+ Tested up to: 5.3
6
+ Stable tag: 2.1
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
324
* Plus more customization options added all the time!
325
326
== Changelog ==
327
+ = 2.1 =
328
+ * New: Added the ability to overwrite default templates in your theme. View [this article](https://smashballoon.com/guide-to-creating-custom-templates/) for more information.
329
+ * New: Added several PHP hooks for modifying feeds settings and functionality.
330
+ * Fix: Using the "Load Initial Posts with AJAX" setting would cause images to not resize with the browser window.
331
+ * Fix: Added back language files for translations.
332
+ * Fix: Changing the image resolution setting would not change the image size.
333
+ * Fix: Follow button would not show if there was no connected account.
334
+ * Fix: Deleting any connected account will delete any connected accounts that have errors in the data that was saved for them.
335
+
336
= 2.0.2 =
337
* Fix: HTML for header would still be visible in the source of the page when removing the header using showheader=false in the shortcode
338
* Fix: CSS added to prevent layout issues when adding the feed to a "text" widget for certain themes
css/sb-instagram-2-1.css ADDED
@@ -0,0 +1,740 @@
1
+ /**************/
2
+ /*** LAYOUT ***/
3
+ /**************/
4
+
5
+ /* Feed container */
6
+ #sb_instagram {
7
+ width: 100%;
8
+ margin: 0 auto;
9
+ padding: 0;
10
+ -webkit-box-sizing: border-box;
11
+ -moz-box-sizing: border-box;
12
+ box-sizing: border-box;
13
+ }
14
+ #sb_instagram:after{
15
+ content: "";
16
+ display: table;
17
+ clear: both;
18
+ }
19
+
20
+ /*********************/
21
+ /*** STYLE OPTIONS ***/
22
+ /*********************/
23
+ #sb_instagram.sbi_fixed_height{
24
+ overflow: hidden;
25
+ overflow-y: auto;
26
+ -webkit-box-sizing: border-box;
27
+ -moz-box-sizing: border-box;
28
+ box-sizing: border-box;
29
+ }
30
+ #sb_instagram #sbi_images{
31
+ width: 100%;
32
+ float: left;
33
+ line-height: 0;
34
+
35
+ -webkit-box-sizing: border-box;
36
+ -moz-box-sizing: border-box;
37
+ box-sizing: border-box;
38
+ }
39
+
40
+ /* Items */
41
+ #sb_instagram #sbi_images .sbi_item{
42
+ display: -moz-inline-stack;
43
+ display: inline-block;
44
+ float: left;
45
+ vertical-align: top;
46
+ zoom: 1;
47
+ *display: inline;
48
+
49
+ max-height: 1000px;
50
+ padding: inherit !important;
51
+ margin: 0 !important;
52
+ text-decoration: none;
53
+ opacity: 1;
54
+ overflow: hidden;
55
+
56
+ -webkit-box-sizing: border-box;
57
+ -moz-box-sizing: border-box;
58
+ box-sizing: border-box;
59
+
60
+ -webkit-transition: all 0.5s ease;
61
+ -moz-transition: all 0.5s ease;
62
+ -o-transition: all 0.5s ease;
63
+ -ms-transition: all 0.5s ease;
64
+ transition: all 0.5s ease;
65
+ }
66
+ /* Transition items in */
67
+ #sb_instagram #sbi_images .sbi_item.sbi_transition{
68
+ opacity: 0;
69
+ max-height: 0;
70
+ }
71
+
72
+ /* Cols */
73
+ #sb_instagram.sbi_col_1 #sbi_images .sbi_item{ width: 100%; }
74
+ #sb_instagram.sbi_col_2 #sbi_images .sbi_item{ width: 50%; }
75
+ #sb_instagram.sbi_col_3 #sbi_images .sbi_item{ width: 33.33%; }
76
+ #sb_instagram.sbi_col_4 #sbi_images .sbi_item{ width: 25%; }
77
+ #sb_instagram.sbi_col_5 #sbi_images .sbi_item{ width: 20%; }
78
+ #sb_instagram.sbi_col_6 #sbi_images .sbi_item{ width: 16.66%; }
79
+ #sb_instagram.sbi_col_7 #sbi_images .sbi_item{ width: 14.28%; }
80
+ #sb_instagram.sbi_col_8 #sbi_images .sbi_item{ width: 12.5%; }
81
+ #sb_instagram.sbi_col_9 #sbi_images .sbi_item{ width: 11.11%; }
82
+ #sb_instagram.sbi_col_10 #sbi_images .sbi_item{ width: 10%; }
83
+
84
+ /* Disable mobile layout */
85
+ #sb_instagram.sbi_col_1.sbi_disable_mobile #sbi_images .sbi_item{ width: 100%; }
86
+ #sb_instagram.sbi_col_2.sbi_disable_mobile #sbi_images .sbi_item{ width: 50%; }
87
+ #sb_instagram.sbi_col_3.sbi_disable_mobile #sbi_images .sbi_item{ width: 33.33%; }
88
+ #sb_instagram.sbi_col_4.sbi_disable_mobile #sbi_images .sbi_item{ width: 25%; }
89
+ #sb_instagram.sbi_col_5.sbi_disable_mobile #sbi_images .sbi_item{ width: 20%; }
90
+ #sb_instagram.sbi_col_6.sbi_disable_mobile #sbi_images .sbi_item{ width: 16.66%; }
91
+ #sb_instagram.sbi_col_7.sbi_disable_mobile #sbi_images .sbi_item{ width: 14.28%; }
92
+ #sb_instagram.sbi_col_8.sbi_disable_mobile #sbi_images .sbi_item{ width: 12.5%; }
93
+ #sb_instagram.sbi_col_9.sbi_disable_mobile #sbi_images .sbi_item{ width: 11.11%; }
94
+ #sb_instagram.sbi_col_10.sbi_disable_mobile #sbi_images .sbi_item{ width: 10%; }
95
+
96
+ /* Photos */
97
+ #sb_instagram .sbi_photo_wrap{
98
+ position: relative;
99
+ }
100
+ #sb_instagram .sbi_photo{
101
+ display: block;
102
+ text-decoration: none;
103
+ }
104
+ #sb_instagram .sbi_photo img{
105
+ width: 100%;
106
+ height: auto;
107
+ }
108
+ #sb_instagram .sbi_no_js img{
109
+ display: none;
110
+ }
111
+ #sb_instagram a,
112
+ #sb_instagram a:hover,
113
+ #sb_instagram a:focus,
114
+ #sb_instagram a:active{
115
+ outline: none;
116
+ }
117
+ #sb_instagram img{
118
+ display: block;
119
+ padding: 0 !important;
120
+ margin: 0 !important;
121
+ max-width: 100% !important;
122
+ opacity: 1 !important;
123
+ }
124
+ #sb_instagram .sbi_link{
125
+ display: none;
126
+ position: absolute;
127
+ bottom: 0;
128
+ right: 0;
129
+
130
+ width: 100%;
131
+ padding: 10px 0;
132
+ background: rgba(0,0,0,0.5);
133
+ text-align: center;
134
+ color: #fff;
135
+ font-size: 12px;
136
+ line-height: 1.1;
137
+ }
138
+ #sb_instagram .sbi_link a{
139
+ padding: 0 6px;
140
+ text-decoration: none;
141
+ color: #fff;
142
+ font-size: 12px;
143
+ line-height: 1.1;
144
+
145
+ display: -moz-inline-stack;
146
+ display: inline-block;
147
+ vertical-align: top;
148
+ zoom: 1;
149
+ *display: inline;
150
+ }
151
+ #sb_instagram .sbi_link .sbi_lightbox_link{
152
+ padding-bottom: 5px;
153
+ }
154
+ #sb_instagram .sbi_link a:hover,
155
+ #sb_instagram .sbi_link a:focus{
156
+ text-decoration: underline;
157
+ }
158
+ #sb_instagram .sbi_photo_wrap:hover .sbi_link,
159
+ #sb_instagram .sbi_photo_wrap:focus .sbi_link{
160
+ display: block;
161
+ }
162
+
163
+ /* Videos */
164
+ #sb_instagram svg:not(:root).svg-inline--fa {
165
+ height: 1em;
166
+ }
167
+
168
+ #sb_instagram .sbi_type_video .sbi_playbtn,
169
+ #sb_instagram .sbi_type_carousel .sbi_playbtn,
170
+ .sbi_type_carousel .fa-clone,
171
+ #sb_instagram .sbi_type_carousel .svg-inline--fa.fa-play,
172
+ #sb_instagram .sbi_type_video .svg-inline--fa.fa-play{
173
+ display: block !important;
174
+ position: absolute;
175
+ z-index: 1;
176
+
177
+ color: #fff;
178
+ color: rgba(255,255,255,0.9);
179
+ font-style: normal !important;
180
+ text-shadow: 0 0 8px rgba(0,0,0,0.8);
181
+ }
182
+ #sb_instagram .sbi_type_video .sbi_playbtn,
183
+ #sb_instagram .sbi_type_carousel .sbi_playbtn {
184
+ z-index: 2;
185
+ top: 50%;
186
+ left: 50%;
187
+ margin-top: -24px;
188
+ margin-left: -19px;
189
+ padding: 0;
190
+ font-size: 48px;
191
+ }
192
+ #sb_instagram .sbi_type_carousel .fa-clone{
193
+ right: 12px;
194
+ top: 12px;
195
+ font-size: 24px;
196
+ text-shadow: 0 0 8px rgba(0,0,0,0.3);
197
+ }
198
+ .sbi_type_carousel svg.fa-clone,
199
+ #sb_instagram .sbi_type_video .svg-inline--fa.fa-play,
200
+ #sb_instagram .sbi_type_carousel .svg-inline--fa.fa-play{
201
+ -webkit-filter: drop-shadow( 0px 0px 2px rgba(0,0,0,.4) );
202
+ filter: drop-shadow( 0px 0px 2px rgba(0,0,0,.4) );
203
+ }
204
+
205
+ /* Loader */
206
+ #sb_instagram .sbi_loader{
207
+ width: 20px;
208
+ height: 20px;
209
+
210
+ position: relative;
211
+ top: 50%;
212
+ left: 50%;
213
+ margin: -10px 0 0 -10px;
214
+ background-color: #000;
215
+ background-color: rgba(0,0,0,0.5);
216
+
217
+ border-radius: 100%;
218
+ -webkit-animation: sbi-sk-scaleout 1.0s infinite ease-in-out;
219
+ animation: sbi-sk-scaleout 1.0s infinite ease-in-out;
220
+ }
221
+ #sb_instagram br {
222
+ display: none;
223
+ }
224
+ #sbi_load p {
225
+ display: inline;
226
+ padding: 0;
227
+ margin: 0;
228
+ }
229
+ /* Loader in button */
230
+ #sb_instagram #sbi_load .sbi_loader{
231
+ position: absolute;
232
+ margin-top: -11px;
233
+ background-color: #fff;
234
+ opacity: 1;
235
+ }
236
+ @-webkit-keyframes sbi-sk-scaleout {
237
+ 0% { -webkit-transform: scale(0) }
238
+ 100% {
239
+ -webkit-transform: scale(1.0);
240
+ opacity: 0;
241
+ }
242
+ }
243
+ @keyframes sbi-sk-scaleout {
244
+ 0% {
245
+ -webkit-transform: scale(0);
246
+ -ms-transform: scale(0);
247
+ transform: scale(0);
248
+ } 100% {
249
+ -webkit-transform: scale(1.0);
250
+ -ms-transform: scale(1.0);
251
+ transform: scale(1.0);
252
+ opacity: 0;
253
+ }
254
+ }
255
+
256
+ #sb_instagram .fa-spin,
257
+ #sbi_lightbox .fa-spin{
258
+ -webkit-animation: fa-spin 2s infinite linear;
259
+ animation: fa-spin 2s infinite linear
260
+ }
261
+
262
+ #sb_instagram .fa-pulse,
263
+ #sbi_lightbox .fa-pulse{
264
+ -webkit-animation: fa-spin 1s infinite steps(8);
265
+ animation: fa-spin 1s infinite steps(8)
266
+ }
267
+
268
+ @-webkit-keyframes fa-spin {
269
+ 0% {
270
+ -webkit-transform: rotate(0deg);
271
+ transform: rotate(0deg)
272
+ }
273
+ 100% {
274
+ -webkit-transform: rotate(359deg);
275
+ transform: rotate(359deg)
276
+ }
277
+ }
278
+
279
+ @keyframes fa-spin {
280
+ 0% {
281
+ -webkit-transform: rotate(0deg);
282
+ transform: rotate(0deg)
283
+ }
284
+ 100% {
285
+ -webkit-transform: rotate(359deg);
286
+ transform: rotate(359deg)
287
+ }
288
+ }
289
+ /* Screen reader */
290
+ .sbi-screenreader{text-indent: -9999px !important;display: block !important;width: 0 !important;height: 0 !important;line-height: 0 !important;}
291
+
292
+ /* HEADER */
293
+ #sb_instagram .sb_instagram_header{
294
+ float: left;
295
+ clear: both;
296
+ margin: 0 0 15px 0;
297
+ padding: 0;
298
+ line-height: 1.2;
299
+ width: 100%;
300
+ }
301
+ #sb_instagram .sb_instagram_header a{
302
+ float: left;
303
+ display: block;
304
+ /*width: 100%;*/
305
+ min-width: 100%\9;
306
+ text-decoration: none;
307
+ transition: color 0.5s ease;
308
+ }
309
+ /** Medium Header */
310
+ /* Only use medium & large headers on devices above 480px */
311
+ @media all and (min-width: 480px){
312
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_img {
313
+ width: 80px;
314
+ height: 80px;
315
+ border-radius: 40px;
316
+ }
317
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_img img {
318
+ width: 80px;
319
+ height: 80px;
320
+ border-radius: 40px;
321
+ }
322
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text h3 {
323
+ font-size: 20px;
324
+ }
325
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text .sbi_bio_info,
326
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text .sbi_bio{
327
+ font-size: 14px;
328
+ }
329
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text h3,
330
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text .sbi_bio_info,
331
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text .sbi_bio{
332
+ margin-left: 95px !important;
333
+ line-height: 1.4
334
+ }
335
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text h3{
336
+ margin-right: -85px !important;
337
+ }
338
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text .sbi_bio_info{
339
+ margin-top: 4px !important;
340
+ }
341
+ #sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text.sbi_no_bio h3{
342
+ padding-top: 20px !important;
343
+ }
344
+ /** Large Header */
345
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_img {
346
+ width: 120px;
347
+ height: 120px;
348
+ border-radius: 60px;
349
+ }
350
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_img img {
351
+ width: 120px;
352
+ height: 120px;
353
+ border-radius: 60px;
354
+ }
355
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_text h3 {
356
+ font-size: 28px;
357
+ }
358
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_text .sbi_bio_info,
359
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_text .sbi_bio{
360
+ font-size: 16px;
361
+ }
362
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_text h3,
363
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_text .sbi_bio_info,
364
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_text .sbi_bio{
365
+ margin-left: 140px !important;
366
+ line-height: 1.5;
367
+ }
368
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_text h3{
369
+ margin-right: -120px !important;
370
+ }
371
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_text .sbi_bio_info{
372
+ margin-top: 12px !important;
373
+ }
374
+ #sb_instagram .sb_instagram_header.sbi_large .sbi_header_text.sbi_no_bio h3{
375
+ padding-top: 32px !important;
376
+ }
377
+ }
378
+
379
+ /* Header profile pic */
380
+ #sb_instagram .sb_instagram_header .sbi_header_img{
381
+ float: left;
382
+ position: relative;
383
+ width: 50px;
384
+ margin: 0 0 0 -100% !important;
385
+ overflow: hidden;
386
+
387
+ -moz-border-radius: 40px;
388
+ -webkit-border-radius: 40px;
389
+ border-radius: 40px;
390
+ }
391
+ #sb_instagram .sb_instagram_header .sbi_header_img img{
392
+ float: left;
393
+ margin: 0 !important;
394
+ padding: 0 !important;
395
+ border: none !important;
396
+
397
+ -moz-border-radius: 40px;
398
+ -webkit-border-radius: 40px;
399
+ border-radius: 40px;
400
+ }
401
+ /* Profile pic hover */
402
+ /* Profile pic hover */
403
+ #sb_instagram .sb_instagram_header .sbi_header_img_hover{
404
+ opacity: 0;
405
+ position: absolute;
406
+ width: 100%;
407
+ top: 0;
408
+ bottom: 0;
409
+ left: 0;
410
+ text-align: center;
411
+ color: #fff;
412
+ background: rgba(0,0,0,0.75);
413
+ }
414
+
415
+ #sb_instagram .sb_instagram_header .sbi_header_img_hover .sbi_new_logo{
416
+ position: absolute;
417
+ top: 50%;
418
+ left: 50%;
419
+ margin-top: -12px;
420
+ margin-left: -12px;
421
+ width: 24px;
422
+ height: 24px;
423
+ font-size: 24px;
424
+ }
425
+ #sb_instagram .sb_instagram_header .sbi_header_img_hover i {
426
+ overflow: hidden;
427
+ background: url('../img/small-logo.png') no-repeat 0 0;
428
+ }
429
+ #sb_instagram .sb_instagram_header .sbi_header_img_hover{
430
+ z-index: 2;
431
+ transition: opacity 0.4s ease-in-out;
432
+ }
433
+ #sb_instagram .sb_instagram_header .sbi_fade_in{
434
+ opacity: 1;
435
+ transition: opacity 0.2s ease-in-out;
436
+ }
437
+ #sb_instagram .sb_instagram_header .sbi_header_img_hover{
438
+ position: absolute;
439
+ width: 100%;
440
+ top: 0;
441
+ bottom: 0;
442
+ left: 0;
443
+ text-align: center;
444
+ color: #fff;
445
+ background: rgba(0,0,0,0.75);
446
+
447
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
448
+ filter: alpha(opacity=0);
449
+ -moz-opacity: 0;
450
+ -khtml-opacity: 0;
451
+ opacity: 0;
452
+ border-radius: 40px;
453
+ transition: opacity 0.2s;
454
+ }
455
+ /* Fade the Instagram icon in when hovering on the header */
456
+ #sb_instagram .sb_instagram_header a:hover .sbi_header_img_hover,
457
+ #sb_instagram .sb_instagram_header a:focus .sbi_header_img_hover{
458
+ opacity: 1;
459
+ }
460
+ /* Header text */
461
+ #sb_instagram .sb_instagram_header .sbi_header_text{
462
+ float: left;
463
+ width: 100%;
464
+ padding-top: 5px;
465
+ }
466
+ #sb_instagram .sb_instagram_header a{
467
+ text-decoration: none;
468
+ }
469
+ #sb_instagram .sb_instagram_header .sbi_header_text .sbi_bio,
470
+ #sb_instagram .sb_instagram_header .sbi_header_text h3{
471
+ float: left;
472
+ clear: both;
473
+ width: auto;
474
+ margin: 0 0 0 60px !important;
475
+ padding: 0 !important;
476
+ }
477
+ #sb_instagram .sb_instagram_header h3{
478
+ font-size: 16px;
479
+ line-height: 1.3;
480
+ }
481
+ #sb_instagram .sb_instagram_header p{
482
+ font-size: 13px;
483
+ line-height: 1.3;
484
+ margin: 0;
485
+ padding: 0;
486
+ }
487
+ #sb_instagram p:empty { display: none; }
488
+ #sb_instagram .sb_instagram_header .sbi_header_text img.emoji{
489
+ margin-right: 3px !important;
490
+ }
491
+
492
+ /* No bio */
493
+ #sb_instagram .sb_instagram_header .sbi_header_text.sbi_no_bio h3{
494
+ padding-top: 9px !important;
495
+ }
496
+ #sb_instagram .sb_instagram_header .sbi_header_text.sbi_no_bio .sbi_bio_info{
497
+ clear: both;
498
+ }
499
+
500
+
501
+ /* Buttons */
502
+ #sb_instagram #sbi_load{
503
+ float: left;
504
+ clear: both;
505
+ width: 100%;
506
+ text-align: center;
507
+ }
508
+ #sb_instagram #sbi_load .fa-spinner{
509
+ display: none;
510
+ position: absolute;
511
+ top: 50%;
512
+ left: 50%;
513
+ margin: -8px 0 0 -7px;
514
+ font-size: 15px;
515
+ }
516
+ #sb_instagram #sbi_load{
517
+ opacity: 1;
518
+ transition: all 0.5s ease-in;
519
+ }
520
+ #sb_instagram .sbi_load_btn .sbi_btn_text, #sb_instagram .sbi_load_btn .sbi_loader{
521
+ opacity: 1;
522
+ transition: all 0.1s ease-in;
523
+ }
524
+ #sb_instagram .sbi_hidden{
525
+ opacity: 0 !important;
526
+ }
527
+ #sb_instagram #sbi_load .sbi_load_btn,
528
+ #sb_instagram .sbi_follow_btn a{
529
+ display: -moz-inline-stack;
530
+ display: inline-block;
531
+ vertical-align: top;
532
+ zoom: 1;
533
+ *display: inline;
534
+
535
+ padding: 7px 14px;
536
+ margin: 5px auto 0 auto;
537
+ background: #333;
538
+ color: #eee;
539
+ border: none;
540
+ color: #fff;
541
+ text-decoration: none;
542
+ font-size: 13px;
543
+ line-height: 1.5;
544
+
545
+ -moz-border-radius: 4px;
546
+ -webkit-border-radius: 4px;
547
+ border-radius: 4px;
548
+
549
+ -webkit-box-sizing: border-box;
550
+ -moz-box-sizing: border-box;
551
+ box-sizing: border-box;
552
+ }
553
+ #sb_instagram #sbi_load .sbi_load_btn {
554
+ position: relative;
555
+ }
556
+ /* Follow button */
557
+ #sb_instagram .sbi_follow_btn{
558
+ display: -moz-inline-stack;
559
+ display: inline-block;
560
+ vertical-align: top;
561
+ zoom: 1;
562
+ *display: inline;
563
+ text-align: center;
564
+ }
565
+ #sb_instagram .sbi_follow_btn.sbi_top{
566
+ display: block;
567
+ margin-bottom: 5px;
568
+ }
569
+ #sb_instagram .sbi_follow_btn a{
570
+ background: #408bd1;
571
+ color: #fff;
572
+ }
573
+ #sb_instagram .sbi_follow_btn a,
574
+ #sb_instagram .sbi_follow_btn a,
575
+ #sb_instagram #sbi_load .sbi_load_btn{
576
+ transition: all 0.1s ease-in;
577
+ }
578
+ /* Hover state for default colors */
579
+ #sb_instagram #sbi_load .sbi_load_btn:hover{
580
+ outline: none;
581
+ box-shadow: inset 0 0 20px 20px rgba(255,255,255,0.25);
582
+ }
583
+ #sb_instagram .sbi_follow_btn a:hover,
584
+ #sb_instagram .sbi_follow_btn a:focus{
585
+ outline: none;
586
+ box-shadow: inset 0 0 10px 20px #359dff;
587
+ }
588
+ /* If a custom color is applied then just use opacity for the hover effect */
589
+ #sb_instagram .sbi_follow_btn.sbi_custom a:hover,
590
+ #sb_instagram .sbi_follow_btn.sbi_custom a:focus,
591
+ #sb_instagram #sbi_load .sbi_load_btn.sbi_custom:hover{
592
+ box-shadow: inset 0 0 20px 20px rgba(255,255,255,0.15);
593
+ }
594
+ /* Active state */
595
+ #sb_instagram .sbi_follow_btn a:active,
596
+ #sb_instagram #sbi_load .sbi_load_btn:active{
597
+ box-shadow: inset 0 0 10px 20px rgba(0,0,0,0.3);
598
+ }
599
+
600
+ #sb_instagram .sbi_follow_btn .fa,
601
+ #sb_instagram .sbi_follow_btn svg{
602
+ margin-bottom: -1px;
603
+ margin-right: 7px;
604
+ font-size: 15px;
605
+ }
606
+ #sb_instagram .sbi_follow_btn svg{
607
+ vertical-align: -.125em;
608
+ }
609
+ #sb_instagram #sbi_load .sbi_follow_btn{
610
+ margin-left: 5px;
611
+ }
612
+
613
+ /* Error messages */
614
+ #sb_instagram .sb_instagram_error{
615
+ width: 100%;
616
+ text-align: center;
617
+ line-height: 1.4;
618
+ }
619
+
620
+ /* Mod only error msgs */
621
+ #sbi_mod_error{
622
+ display: none;
623
+ border: 1px solid #ddd;
624
+ background: #eee;
625
+ color: #333;
626
+ margin: 10px 0 0;
627
+ padding: 10px 15px;
628
+ font-size: 13px;
629
+ text-align: center;
630
+ clear: both;
631
+
632
+ -moz-border-radius: 4px;
633
+ -webkit-border-radius: 4px;
634
+ border-radius: 4px;
635
+ }
636
+ #sbi_mod_error p{
637
+ padding: 5px 0 !important;
638
+ margin: 0 !important;
639
+ line-height: 1.3 !important;
640
+ }
641
+ #sbi_mod_error ol,
642
+ #sbi_mod_error ul{
643
+ padding: 5px 0 5px 20px !important;
644
+ margin: 0 !important;
645
+ }
646
+ #sbi_mod_error li{
647
+ padding: 1px 0 !important;
648
+ margin: 0 !important;
649
+ }
650
+ #sbi_mod_error span{
651
+ font-size: 12px;
652
+ }
653
+
654
+ /* Medium */
655
+ #sb_instagram.sbi_medium .sbi_playbtn,
656
+ #sb_instagram.sbi_medium .sbi_photo_wrap .svg-inline--fa.fa-play{
657
+ margin-top: -12px;
658
+ margin-left: -9px;
659
+ font-size: 23px;
660
+ }
661
+ #sb_instagram.sbi_medium .sbi_type_carousel .sbi_photo_wrap .fa-clone{
662
+ right: 8px;
663
+ top: 8px;
664
+ font-size: 18px;
665
+ }
666
+ /* Small */
667
+ #sb_instagram.sbi_small .sbi_playbtn,
668
+ #sb_instagram.sbi_small .sbi_photo_wrap .svg-inline--fa.fa-play{
669
+ margin-top: -9px;
670
+ margin-left: -7px;
671
+ font-size: 18px;
672
+ }
673
+ #sb_instagram.sbi_small .sbi_type_carousel .sbi_photo_wrap .fa-clone{
674
+ right: 5px;
675
+ top: 5px;
676
+ font-size: 12px;
677
+ }
678
+
679
+ /* Media queries */
680
+ @media all and (max-width: 640px){
681
+ /* Make 3-6 cols into 2 col */
682
+ #sb_instagram.sbi_col_3 #sbi_images .sbi_item,
683
+ #sb_instagram.sbi_col_4 #sbi_images .sbi_item,
684
+ #sb_instagram.sbi_col_5 #sbi_images .sbi_item,
685
+ #sb_instagram.sbi_col_6 #sbi_images .sbi_item{
686
+ width: 50%;
687
+ }
688
+ /* Make 7-10 cols into 4 col */
689
+ #sb_instagram.sbi_col_7 #sbi_images .sbi_item,
690
+ #sb_instagram.sbi_col_8 #sbi_images .sbi_item,
691
+ #sb_instagram.sbi_col_9 #sbi_images .sbi_item,
692
+ #sb_instagram.sbi_col_10 #sbi_images .sbi_item{
693
+ width: 25%;
694
+ }
695
+ /* On mobile make the min-width 100% */
696
+ #sb_instagram.sbi_width_resp{
697
+ width: 100% !important;
698
+ }
699
+ }
700
+ @media all and (max-width: 480px){
701
+ /* Make all cols into 1 col */
702
+ #sb_instagram.sbi_col_3 #sbi_images .sbi_item,
703
+ #sb_instagram.sbi_col_4 #sbi_images .sbi_item,
704
+ #sb_instagram.sbi_col_5 #sbi_images .sbi_item,
705
+ #sb_instagram.sbi_col_6 #sbi_images .sbi_item,
706
+ #sb_instagram.sbi_col_7 #sbi_images .sbi_item,
707
+ #sb_instagram.sbi_col_8 #sbi_images .sbi_item,
708
+ #sb_instagram.sbi_col_9 #sbi_images .sbi_item,
709
+ #sb_instagram.sbi_col_10 #sbi_images .sbi_item{
710
+ width: 100%;
711
+ }
712
+ }
713
+
714
+ /* NO JS */
715
+ #sb_instagram.sbi_no_js #sbi_images .sbi_item .sbi_photo_wrap{
716
+ box-sizing: border-box;
717
+ position: relative;
718
+ overflow: hidden;
719
+ }
720
+ #sb_instagram.sbi_no_js #sbi_images .sbi_item .sbi_photo_wrap:before {
721
+ content: "";
722
+ display: block;
723
+ padding-top: 100%;
724
+ z-index: -300;
725
+ }
726
+ #sb_instagram.sbi_no_js #sbi_images .sbi_item .sbi_photo {
727
+ position: absolute;
728
+ top: 0;
729
+ left: 0;
730
+ bottom: 0;
731
+ right: 0;
732
+ }
733
+ #sb_instagram.sbi_no_js #sbi_images .sbi_item.sbi_transition {
734
+ opacity: 1;
735
+ max-height: 640px;
736
+ }
737
+ #sb_instagram.sbi_no_js .sbi_photo img,
738
+ #sb_instagram.sbi_no_js .sbi_load_btn{
739
+ display: none;
740
+ }
css/sb-instagram-2-1.min.css ADDED
@@ -0,0 +1 @@
1
+ #sb_instagram{width:100%;margin:0 auto;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram:after{content:"";display:table;clear:both}#sb_instagram.sbi_fixed_height{overflow:hidden;overflow-y:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_images{width:100%;float:left;line-height:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_images .sbi_item{display:-moz-inline-stack;display:inline-block;float:left;vertical-align:top;zoom:1;*display:inline;max-height:1000px;padding:inherit!important;margin:0!important;text-decoration:none;opacity:1;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:all 0.5s ease;-moz-transition:all 0.5s ease;-o-transition:all 0.5s ease;-ms-transition:all 0.5s ease;transition:all 0.5s ease}#sb_instagram #sbi_images .sbi_item.sbi_transition{opacity:0;max-height:0}#sb_instagram.sbi_col_1 #sbi_images .sbi_item{width:100%}#sb_instagram.sbi_col_2 #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_3 #sbi_images .sbi_item{width:33.33%}#sb_instagram.sbi_col_4 #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_col_5 #sbi_images .sbi_item{width:20%}#sb_instagram.sbi_col_6 #sbi_images .sbi_item{width:16.66%}#sb_instagram.sbi_col_7 #sbi_images .sbi_item{width:14.28%}#sb_instagram.sbi_col_8 #sbi_images .sbi_item{width:12.5%}#sb_instagram.sbi_col_9 #sbi_images .sbi_item{width:11.11%}#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:10%}#sb_instagram.sbi_col_1.sbi_disable_mobile #sbi_images .sbi_item{width:100%}#sb_instagram.sbi_col_2.sbi_disable_mobile #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_3.sbi_disable_mobile #sbi_images .sbi_item{width:33.33%}#sb_instagram.sbi_col_4.sbi_disable_mobile #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_col_5.sbi_disable_mobile #sbi_images .sbi_item{width:20%}#sb_instagram.sbi_col_6.sbi_disable_mobile #sbi_images .sbi_item{width:16.66%}#sb_instagram.sbi_col_7.sbi_disable_mobile #sbi_images .sbi_item{width:14.28%}#sb_instagram.sbi_col_8.sbi_disable_mobile #sbi_images .sbi_item{width:12.5%}#sb_instagram.sbi_col_9.sbi_disable_mobile #sbi_images .sbi_item{width:11.11%}#sb_instagram.sbi_col_10.sbi_disable_mobile #sbi_images .sbi_item{width:10%}#sb_instagram .sbi_photo_wrap{position:relative}#sb_instagram .sbi_photo{display:block;text-decoration:none}#sb_instagram .sbi_photo img{width:100%;height:auto}#sb_instagram .sbi_no_js img{display:none}#sb_instagram a,#sb_instagram a:hover,#sb_instagram a:focus,#sb_instagram a:active{outline:none}#sb_instagram img{display:block;padding:0!important;margin:0!important;max-width:100%!important;opacity:1!important}#sb_instagram .sbi_link{display:none;position:absolute;bottom:0;right:0;width:100%;padding:10px 0;background:rgba(0,0,0,.5);text-align:center;color:#fff;font-size:12px;line-height:1.1}#sb_instagram .sbi_link a{padding:0 6px;text-decoration:none;color:#fff;font-size:12px;line-height:1.1;display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline}#sb_instagram .sbi_link .sbi_lightbox_link{padding-bottom:5px}#sb_instagram .sbi_link a:hover,#sb_instagram .sbi_link a:focus{text-decoration:underline}#sb_instagram .sbi_photo_wrap:hover .sbi_link,#sb_instagram .sbi_photo_wrap:focus .sbi_link{display:block}#sb_instagram svg:not(:root).svg-inline--fa{height:1em}#sb_instagram .sbi_type_video .sbi_playbtn,#sb_instagram .sbi_type_carousel .sbi_playbtn,.sbi_type_carousel .fa-clone,#sb_instagram .sbi_type_carousel .svg-inline--fa.fa-play,#sb_instagram .sbi_type_video .svg-inline--fa.fa-play{display:block!important;position:absolute;z-index:1;color:#fff;color:rgba(255,255,255,.9);font-style:normal!important;text-shadow:0 0 8px rgba(0,0,0,.8)}#sb_instagram .sbi_type_video .sbi_playbtn,#sb_instagram .sbi_type_carousel .sbi_playbtn{z-index:2;top:50%;left:50%;margin-top:-24px;margin-left:-19px;padding:0;font-size:48px}#sb_instagram .sbi_type_carousel .fa-clone{right:12px;top:12px;font-size:24px;text-shadow:0 0 8px rgba(0,0,0,.3)}.sbi_type_carousel svg.fa-clone,#sb_instagram .sbi_type_video .svg-inline--fa.fa-play,#sb_instagram .sbi_type_carousel .svg-inline--fa.fa-play{-webkit-filter:drop-shadow(0 0 2px rgba(0,0,0,.4));filter:drop-shadow(0 0 2px rgba(0,0,0,.4))}#sb_instagram .sbi_loader{width:20px;height:20px;position:relative;top:50%;left:50%;margin:-10px 0 0 -10px;background-color:#000;background-color:rgba(0,0,0,.5);border-radius:100%;-webkit-animation:sbi-sk-scaleout 1.0s infinite ease-in-out;animation:sbi-sk-scaleout 1.0s infinite ease-in-out}#sb_instagram br{display:none}#sbi_load p{display:inline;padding:0;margin:0}#sb_instagram #sbi_load .sbi_loader{position:absolute;margin-top:-11px;background-color:#fff;opacity:1}@-webkit-keyframes sbi-sk-scaleout{0%{-webkit-transform:scale(0)}100%{-webkit-transform:scale(1);opacity:0}}@keyframes sbi-sk-scaleout{0%{-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}100%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);opacity:0}}#sb_instagram .fa-spin,#sbi_lightbox .fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}#sb_instagram .fa-pulse,#sbi_lightbox .fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.sbi-screenreader{text-indent:-9999px!important;display:block!important;width:0!important;height:0!important;line-height:0!important}#sb_instagram .sb_instagram_header{float:left;clear:both;margin:0 0 15px 0;padding:0;line-height:1.2;width:100%}#sb_instagram .sb_instagram_header a{float:left;display:block;min-width:100%\9;text-decoration:none;transition:color 0.5s ease}@media all and (min-width:480px){#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_img{width:80px;height:80px;border-radius:40px}#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_img img{width:80px;height:80px;border-radius:40px}#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text h3{font-size:20px}#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text .sbi_bio_info,#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text .sbi_bio{font-size:14px}#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text h3,#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text .sbi_bio_info,#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text .sbi_bio{margin-left:95px!important;line-height:1.4}#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text h3{margin-right:-85px!important}#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text .sbi_bio_info{margin-top:4px!important}#sb_instagram .sb_instagram_header.sbi_medium .sbi_header_text.sbi_no_bio h3{padding-top:20px!important}#sb_instagram .sb_instagram_header.sbi_large .sbi_header_img{width:120px;height:120px;border-radius:60px}#sb_instagram .sb_instagram_header.sbi_large .sbi_header_img img{width:120px;height:120px;border-radius:60px}#sb_instagram .sb_instagram_header.sbi_large .sbi_header_text h3{font-size:28px}#sb_instagram .sb_instagram_header.sbi_large .sbi_header_text .sbi_bio_info,#sb_instagram .sb_instagram_header.sbi_large .sbi_header_text .sbi_bio{font-size:16px}#sb_instagram .sb_instagram_header.sbi_large .sbi_header_text h3,#sb_instagram .sb_instagram_header.sbi_large .sbi_header_text .sbi_bio_info,#sb_instagram .sb_instagram_header.sbi_large .sbi_header_text .sbi_bio{margin-left:140px!important;line-height:1.5}#sb_instagram .sb_instagram_header.sbi_large .sbi_header_text h3{margin-right:-120px!important}#sb_instagram .sb_instagram_header.sbi_large .sbi_header_text .sbi_bio_info{margin-top:12px!important}#sb_instagram .sb_instagram_header.sbi_large .sbi_header_text.sbi_no_bio h3{padding-top:32px!important}}#sb_instagram .sb_instagram_header .sbi_header_img{float:left;position:relative;width:50px;margin:0 0 0 -100%!important;overflow:hidden;-moz-border-radius:40px;-webkit-border-radius:40px;border-radius:40px}#sb_instagram .sb_instagram_header .sbi_header_img img{float:left;margin:0!important;padding:0!important;border:none!important;-moz-border-radius:40px;-webkit-border-radius:40px;border-radius:40px}#sb_instagram .sb_instagram_header .sbi_header_img_hover{opacity:0;position:absolute;width:100%;top:0;bottom:0;left:0;text-align:center;color:#fff;background:rgba(0,0,0,.75)}#sb_instagram .sb_instagram_header .sbi_header_img_hover .sbi_new_logo{position:absolute;top:50%;left:50%;margin-top:-12px;margin-left:-12px;width:24px;height:24px;font-size:24px}#sb_instagram .sb_instagram_header .sbi_header_img_hover i{overflow:hidden;background:url(../img/small-logo.png) no-repeat 0 0}#sb_instagram .sb_instagram_header .sbi_header_img_hover{z-index:2;transition:opacity 0.4s ease-in-out}#sb_instagram .sb_instagram_header .sbi_fade_in{opacity:1;transition:opacity 0.2s ease-in-out}#sb_instagram .sb_instagram_header .sbi_header_img_hover{position:absolute;width:100%;top:0;bottom:0;left:0;text-align:center;color:#fff;background:rgba(0,0,0,.75);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0;border-radius:40px;transition:opacity 0.2s}#sb_instagram .sb_instagram_header a:hover .sbi_header_img_hover,#sb_instagram .sb_instagram_header a:focus .sbi_header_img_hover{opacity:1}#sb_instagram .sb_instagram_header .sbi_header_text{float:left;width:100%;padding-top:5px}#sb_instagram .sb_instagram_header a{text-decoration:none}#sb_instagram .sb_instagram_header .sbi_header_text .sbi_bio,#sb_instagram .sb_instagram_header .sbi_header_text h3{float:left;clear:both;width:auto;margin:0 0 0 60px!important;padding:0!important}#sb_instagram .sb_instagram_header h3{font-size:16px;line-height:1.3}#sb_instagram .sb_instagram_header p{font-size:13px;line-height:1.3;margin:0;padding:0}#sb_instagram p:empty{display:none}#sb_instagram .sb_instagram_header .sbi_header_text img.emoji{margin-right:3px!important}#sb_instagram .sb_instagram_header .sbi_header_text.sbi_no_bio h3{padding-top:9px!important}#sb_instagram .sb_instagram_header .sbi_header_text.sbi_no_bio .sbi_bio_info{clear:both}#sb_instagram #sbi_load{float:left;clear:both;width:100%;text-align:center}#sb_instagram #sbi_load .fa-spinner{display:none;position:absolute;top:50%;left:50%;margin:-8px 0 0 -7px;font-size:15px}#sb_instagram #sbi_load{opacity:1;transition:all 0.5s ease-in}#sb_instagram .sbi_load_btn .sbi_btn_text,#sb_instagram .sbi_load_btn .sbi_loader{opacity:1;transition:all 0.1s ease-in}#sb_instagram .sbi_hidden{opacity:0!important}#sb_instagram #sbi_load .sbi_load_btn,#sb_instagram .sbi_follow_btn a{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;padding:7px 14px;margin:5px auto 0 auto;background:#333;color:#eee;border:none;color:#fff;text-decoration:none;font-size:13px;line-height:1.5;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#sb_instagram #sbi_load .sbi_load_btn{position:relative}#sb_instagram .sbi_follow_btn{display:-moz-inline-stack;display:inline-block;vertical-align:top;zoom:1;*display:inline;text-align:center}#sb_instagram .sbi_follow_btn.sbi_top{display:block;margin-bottom:5px}#sb_instagram .sbi_follow_btn a{background:#408bd1;color:#fff}#sb_instagram .sbi_follow_btn a,#sb_instagram .sbi_follow_btn a,#sb_instagram #sbi_load .sbi_load_btn{transition:all 0.1s ease-in}#sb_instagram #sbi_load .sbi_load_btn:hover{outline:none;box-shadow:inset 0 0 20px 20px rgba(255,255,255,.25)}#sb_instagram .sbi_follow_btn a:hover,#sb_instagram .sbi_follow_btn a:focus{outline:none;box-shadow:inset 0 0 10px 20px #359dff}#sb_instagram .sbi_follow_btn.sbi_custom a:hover,#sb_instagram .sbi_follow_btn.sbi_custom a:focus,#sb_instagram #sbi_load .sbi_load_btn.sbi_custom:hover{box-shadow:inset 0 0 20px 20px rgba(255,255,255,.15)}#sb_instagram .sbi_follow_btn a:active,#sb_instagram #sbi_load .sbi_load_btn:active{box-shadow:inset 0 0 10px 20px rgba(0,0,0,.3)}#sb_instagram .sbi_follow_btn .fa,#sb_instagram .sbi_follow_btn svg{margin-bottom:-1px;margin-right:7px;font-size:15px}#sb_instagram .sbi_follow_btn svg{vertical-align:-.125em}#sb_instagram #sbi_load .sbi_follow_btn{margin-left:5px}#sb_instagram .sb_instagram_error{width:100%;text-align:center;line-height:1.4}#sbi_mod_error{display:none;border:1px solid #ddd;background:#eee;color:#333;margin:10px 0 0;padding:10px 15px;font-size:13px;text-align:center;clear:both;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}#sbi_mod_error p{padding:5px 0!important;margin:0!important;line-height:1.3!important}#sbi_mod_error ol,#sbi_mod_error ul{padding:5px 0 5px 20px!important;margin:0!important}#sbi_mod_error li{padding:1px 0!important;margin:0!important}#sbi_mod_error span{font-size:12px}#sb_instagram.sbi_medium .sbi_playbtn,#sb_instagram.sbi_medium .sbi_photo_wrap .svg-inline--fa.fa-play{margin-top:-12px;margin-left:-9px;font-size:23px}#sb_instagram.sbi_medium .sbi_type_carousel .sbi_photo_wrap .fa-clone{right:8px;top:8px;font-size:18px}#sb_instagram.sbi_small .sbi_playbtn,#sb_instagram.sbi_small .sbi_photo_wrap .svg-inline--fa.fa-play{margin-top:-9px;margin-left:-7px;font-size:18px}#sb_instagram.sbi_small .sbi_type_carousel .sbi_photo_wrap .fa-clone{right:5px;top:5px;font-size:12px}@media all and (max-width:640px){#sb_instagram.sbi_col_3 #sbi_images .sbi_item,#sb_instagram.sbi_col_4 #sbi_images .sbi_item,#sb_instagram.sbi_col_5 #sbi_images .sbi_item,#sb_instagram.sbi_col_6 #sbi_images .sbi_item{width:50%}#sb_instagram.sbi_col_7 #sbi_images .sbi_item,#sb_instagram.sbi_col_8 #sbi_images .sbi_item,#sb_instagram.sbi_col_9 #sbi_images .sbi_item,#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:25%}#sb_instagram.sbi_width_resp{width:100%!important}}@media all and (max-width:480px){#sb_instagram.sbi_col_3 #sbi_images .sbi_item,#sb_instagram.sbi_col_4 #sbi_images .sbi_item,#sb_instagram.sbi_col_5 #sbi_images .sbi_item,#sb_instagram.sbi_col_6 #sbi_images .sbi_item,#sb_instagram.sbi_col_7 #sbi_images .sbi_item,#sb_instagram.sbi_col_8 #sbi_images .sbi_item,#sb_instagram.sbi_col_9 #sbi_images .sbi_item,#sb_instagram.sbi_col_10 #sbi_images .sbi_item{width:100%}}#sb_instagram.sbi_no_js #sbi_images .sbi_item .sbi_photo_wrap{box-sizing:border-box;position:relative;overflow:hidden}#sb_instagram.sbi_no_js #sbi_images .sbi_item .sbi_photo_wrap:before{content:"";display:block;padding-top:100%;z-index:-300}#sb_instagram.sbi_no_js #sbi_images .sbi_item .sbi_photo{position:absolute;top:0;left:0;bottom:0;right:0}#sb_instagram.sbi_no_js #sbi_images .sbi_item.sbi_transition{opacity:1;max-height:640px}#sb_instagram.sbi_no_js .sbi_photo img,#sb_instagram.sbi_no_js .sbi_load_btn{display:none}
css/sb-instagram-admin.css CHANGED
@@ -402,8 +402,12 @@
402
border: 1px solid #6AB074;
403
color: #214F28;
404
}
405
.sbi_review_notice img{
406
- width: 84px;
407
margin: 0 0 0 -100% !important;
408
409
-moz-border-radius: 4px;
@@ -414,14 +418,18 @@
414
float: left;
415
clear: none;
416
width: 100%;
417
- padding: 4px 0;
418
}
419
.sbi_review_notice p{
420
float: left;
421
clear: both;
422
width: auto;
423
- margin: 0 0 0 100px !important;
424
- padding: 4px 40px 4px 0;
425
}
426
.sbi_review_notice a{
427
display: inline-block;
@@ -433,11 +441,9 @@
433
color: #0c7abf;
434
}
435
.sbi_review_notice .links{
436
- margin: 0 0 0 92px !important;
437
padding: 4px 0 0 0;
438
- }
439
- .sbi_review_notice .links a:first-child{
440
- /*padding-left: 0;*/
441
}
442
.sbi_review_notice .sbi_notice_close,
443
.sbi_review_notice .sbi_bfcm_sale_notice_close,
@@ -1235,7 +1241,7 @@
1235
#sbi_admin .sbi_feed_type .sbi_lock{
1236
height: 18px;
1237
padding: 4px 10px 4px 13px;
1238
- top: 1px;
1239
left: 98px;
1240
color: #999;
1241
}
@@ -1259,18 +1265,20 @@
1259
}
1260
#sbi_admin .sbi_pro_tooltip{
1261
text-align: center;
1262
display: none;
1263
position: absolute;
1264
background: #333;
1265
color: #eee;
1266
width: 90%;
1267
padding: 8px 10px 10px 10px;
1268
border-radius: 3px;
1269
- bottom: 45px;
1270
line-height: 1.3;
1271
font-size: 12px;
1272
- width: 174px;
1273
- bottom: 40px;
1274
}
1275
#sbi_admin .sbi_pro_tooltip .fa-caret-down {
1276
position: absolute;
@@ -1368,9 +1376,26 @@
1368
color: #fff;
1369
}
1370
.sbi_review_notice .sbi_other_notice{
1371
- font-size: 13px;
1372
- font-style: italic;
1373
- margin-top: 5px !important;
1374
}
1375
1376
/* Admin footer share icons */
402
border: 1px solid #6AB074;
403
color: #214F28;
404
}
405
+ .sbi_bfcm_sale_notice,
406
+ .sbi_new_user_sale_notice{
407
+ max-width: 672px;
408
+ }
409
.sbi_review_notice img{
410
+ width: 74px;
411
margin: 0 0 0 -100% !important;
412
413
-moz-border-radius: 4px;
418
float: left;
419
clear: none;
420
width: 100%;
421
+ padding: 0;
422
+ }
423
+ .sbi_review_notice .sbi-links{
424
+ margin-top: 4px !important;
425
}
426
.sbi_review_notice p{
427
float: left;
428
clear: both;
429
width: auto;
430
+ margin: 0 0 0 90px !important;
431
+ padding: 2px 40px 2px 0;
432
+ line-height: 1.4;
433
}
434
.sbi_review_notice a{
435
display: inline-block;
441
color: #0c7abf;
442
}
443
.sbi_review_notice .links{
444
+ margin: 0 0 0 82px !important;
445
padding: 4px 0 0 0;
446
+ margin-top: 6px !important;
447
}
448
.sbi_review_notice .sbi_notice_close,
449
.sbi_review_notice .sbi_bfcm_sale_notice_close,
1241
#sbi_admin .sbi_feed_type .sbi_lock{
1242
height: 18px;
1243
padding: 4px 10px 4px 13px;
1244
+ top: 18px;
1245
left: 98px;
1246
color: #999;
1247
}
1265
}
1266
#sbi_admin .sbi_pro_tooltip{
1267
text-align: center;
1268
+ z-index:99;
1269
display: none;
1270
position: absolute;
1271
+ bottom: 22px;
1272
+ left: -8px;
1273
+
1274
background: #333;
1275
color: #eee;
1276
width: 90%;
1277
padding: 8px 10px 10px 10px;
1278
border-radius: 3px;
1279
line-height: 1.3;
1280
font-size: 12px;
1281
+ width: 190px;
1282
}
1283
#sbi_admin .sbi_pro_tooltip .fa-caret-down {
1284
position: absolute;
1376
color: #fff;
1377
}
1378
.sbi_review_notice .sbi_other_notice{
1379
+ padding-top: 10px;
1380
+ font-style: italic;
1381
+ font-size: 12px;
1382
+ }
1383
+ .sbi_review_notice .sbi_other_notice a {
1384
+ padding: 0;
1385
+ }
1386
+
1387
+ .sbi_review_notice .sbi_offer_btn {
1388
+ padding: 4px 12px 6px 12px;
1389
+ background: green;
1390
+ color: #fff;
1391
+ border-radius: 4px;
1392
+ display: inline-block;
1393
+ text-decoration: none;
1394
+ margin-left: 0;
1395
+ }
1396
+ .sbi_review_notice .sbi_offer_btn:hover, .sbi_review_notice .sbi_offer_btn:focus {
1397
+ background: #049404;
1398
+ color: #fff;
1399
}
1400
1401
/* Admin footer share icons */
img/sbi-icon-offer.png CHANGED
Binary file
inc/admin/actions.php CHANGED
@@ -182,7 +182,8 @@ function sbi_connect_business_accounts() {
182
'last_checked' => time(),
183
'profile_picture' => $profile_picture,
184
'name' => $name,
185
- 'type' => $type
186
);
187
188
if ( !$options['sb_instagram_disable_resize'] ) {
@@ -254,11 +255,13 @@ function sbi_test_token() {
254
);
255
}
256
257
}
258
259
if ( isset( $test_connection_data['error_message'] ) ) {
260
echo $test_connection_data['error_message'];
261
- } elseif ( $test_connection_data !== false ) {
262
$username = $test_connection_data['username'] ? $test_connection_data['username'] : $connected_accounts[ $new_user_id ]['username'];
263
$user_id = $test_connection_data['id'] ? $test_connection_data['id'] : $connected_accounts[ $new_user_id ]['user_id'];
264
$profile_picture = $test_connection_data['profile_picture'] ? $test_connection_data['profile_picture'] : $connected_accounts[ $new_user_id ]['profile_picture'];
@@ -268,7 +271,7 @@ function sbi_test_token() {
268
'user_id' => $user_id,
269
'username' => $username,
270
'type' => $type,
271
- 'is_valid' => $test_connection_data['is_valid'],
272
'last_checked' => $test_connection_data['last_checked'],
273
'profile_picture' => $profile_picture
274
);
@@ -281,6 +284,25 @@ function sbi_test_token() {
281
$connected_accounts[ $new_user_id ]['local_avatar'] = false;
282
}
283
284
$options['connected_accounts'] = $connected_accounts;
285
286
update_option( 'sb_instagram_settings', $options );
@@ -306,29 +328,31 @@ function sbi_delete_account() {
306
$options = get_option( 'sb_instagram_settings', array() );
307
$connected_accounts = isset( $options['connected_accounts'] ) ? $options['connected_accounts'] : array();
308
309
- if ( $account_id ) {
310
- wp_cache_delete ( 'alloptions', 'options' );
311
- $username = $connected_accounts[ $account_id ]['username'];
312
313
- $num_times_used = 0;
314
- foreach ( $connected_accounts as $connected_account ) {
315
316
- if ( $connected_account['username'] === $username ) {
317
- $num_times_used++;
318
- }
319
- }
320
321
- if ( $num_times_used < 2 ) {
322
- sbi_delete_local_avatar( $username );
323
- }
324
325
- unset( $connected_accounts[ $account_id ] );
326
327
- $options['connected_accounts'] = $connected_accounts;
328
329
- update_option( 'sb_instagram_settings', $options );
330
331
- }
332
333
die();
334
}
@@ -619,16 +643,7 @@ function sbi_notices_html() {
619
$should_show_new_user_discount = false;
620
$has_been_one_month_since_rating_dismissal = isset( $sbi_statuses_option['rating_notice_dismissed'] ) ? ((int)$sbi_statuses_option['rating_notice_dismissed'] + 30*24*60*60) < $current_time + 1: true;
621
622
- if ( isset( $sbi_statuses_option['first_install'] ) && $sbi_statuses_option['first_install'] === 'from_update' ) {
623
- global $current_user;
624
- $user_id = $current_user->ID;
625
- $ignore_new_user_sale_notice_meta = get_user_meta( $user_id, 'sbi_ignore_new_user_sale_notice' );
626
- $ignore_new_user_sale_notice_meta = isset( $ignore_new_user_sale_notice_meta[0] ) ? $ignore_new_user_sale_notice_meta[0] : '';
627
-
628
- if ( $ignore_new_user_sale_notice_meta !== 'always' ) {
629
- $should_show_new_user_discount = true;
630
- }
631
- } elseif ( $in_new_user_month_range && $has_been_one_month_since_rating_dismissal ) {
632
global $current_user;
633
$user_id = $current_user->ID;
634
$ignore_new_user_sale_notice_meta = get_user_meta( $user_id, 'sbi_ignore_new_user_sale_notice' );
@@ -666,16 +681,14 @@ function sbi_notices_html() {
666
667
var_dump( $sbi_statuses_option );
668
}
669
-
670
- $should_show_bfcm_discount = false; // temporary to not show notices on update
671
- $should_show_new_user_discount = false; // temporary to not show notices on update
672
673
if ( $should_show_rating_notice ) {
674
$other_notice_html = '';
675
$dismiss_url = add_query_arg( 'sbi_ignore_rating_notice_nag', '1' );
676
$later_url = add_query_arg( 'sbi_ignore_rating_notice_nag', 'later' );
677
if ( $should_show_bfcm_discount ) {
678
- $other_notice_html = '<p class="sbi_other_notice">' . __( 'PS. We currently have a Black Friday/Cyber Monday deal going on for <b>20% off</b> the Pro version of the plugin.', 'instagram-feed' ) . '<a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi&discount='.$sbi_bfcm_discount_code.'" target="_blank" class="sbi_offer_btn">' . __( 'Get this deal!', 'instagram-feed' ) . '</a></p>';
679
680
$dismiss_url = add_query_arg( array(
681
'sbi_ignore_rating_notice_nag' => '1',
@@ -689,12 +702,14 @@ function sbi_notices_html() {
689
);
690
}
691
692
- echo"
693
<div class='sbi_notice sbi_review_notice'>
694
<img src='". SBI_PLUGIN_URL . 'img/sbi-icon.png' ."' alt='" . __( 'Instagram Feed', 'instagram-feed' ) . "'>
695
<div class='sbi-notice-text'>
696
- <p>" . __( "It's great to see that you've been using the <strong>Smash Balloon Instagram Feed</strong> plugin for a while now. Hopefully you're happy with it!&nbsp; If so, would you consider leaving a positive review? It really helps to support the plugin and helps others to discover it too!", 'instagram-feed' ) . "</p>
697
- <p class='links'>
698
<a class='sbi_notice_dismiss' href='https://wordpress.org/support/plugin/instagram-feed/reviews/' target='_blank'>" . __( 'Sure, I\'d love to!', 'instagram-feed' ) . "</a>
699
&middot;
700
<a class='sbi_notice_dismiss' href='" .esc_url( $dismiss_url ). "'>" . __( 'No thanks', 'instagram-feed' ) . "</a>
@@ -718,9 +733,9 @@ function sbi_notices_html() {
718
<div class='sbi_notice sbi_review_notice sbi_new_user_sale_notice'>
719
<img src='" . SBI_PLUGIN_URL . 'img/sbi-icon-offer.png' . "' alt='Instagram Feed'>
720
<div class='sbi-notice-text'>
721
- <p>" . __( '<b style="font-weight: 700;">Thank you!</b> We appreciate you using the Smash Balloon Instagram Feed plugin and wanted to say thank you by offering you a limited time <b>20% discount</b> on the Pro version.', 'instagram-feed' ) . "</p>
722
- <p class='links'>
723
- <a class='sbi_notice_dismiss sbi_offer_btn' href='https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi&discount=instagramthankyou' target='_blank'>" . __( 'Yes please!', 'instagram-feed' ) . "</a>
724
<a class='sbi_notice_dismiss' style='margin-left: 5px;' href='" . esc_url( add_query_arg( 'sbi_ignore_new_user_sale_notice', 'always' ) ) . "'>" . __( 'I\'m not interested', 'instagram-feed' ) . "</a>
725
726
</p>
@@ -736,8 +751,8 @@ function sbi_notices_html() {
736
<div class='sbi_notice sbi_review_notice sbi_bfcm_sale_notice'>
737
<img src='". SBI_PLUGIN_URL . 'img/sbi-icon-offer.png' ."' alt='Instagram Feed'>
738
<div class='sbi-notice-text'>
739
- <p>" . __( '<b style="font-weight: 700;">Black Friday/Cyber Monday Deal!</b> Thank you for using our free Instagram Feed plugin. For a limited time, we\'re offering <b>20% off</b> the Pro version for all of our users.', 'instagram-feed' ) . "</p>
740
- <p class='links'>
741
<a class='sbi_notice_dismiss sbi_offer_btn' href='https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi&discount=".$sbi_bfcm_discount_code."' target='_blank'>" . __( 'Get this offer!', 'instagram-feed' ) . "</a>
742
<a class='sbi_notice_dismiss' style='margin-left: 5px;' href='" .esc_url( add_query_arg( 'sbi_ignore_bfcm_sale_notice', date( 'Y', $current_time ) ) ). "'>" . __( 'I\'m not interested', 'instagram-feed' ) . "</a>
743
</p>
182
'last_checked' => time(),
183
'profile_picture' => $profile_picture,
184
'name' => $name,
185
+ 'type' => $type,
186
+ 'use_tagged' => '1'
187
);
188
189
if ( !$options['sb_instagram_disable_resize'] ) {
255
);
256
}
257
258
+ delete_transient( SBI_USE_BACKUP_PREFIX . 'sbi_' . $json['id'] );
259
+
260
}
261
262
if ( isset( $test_connection_data['error_message'] ) ) {
263
echo $test_connection_data['error_message'];
264
+ } elseif ( $test_connection_data !== false && ! empty( $new_user_id ) ) {
265
$username = $test_connection_data['username'] ? $test_connection_data['username'] : $connected_accounts[ $new_user_id ]['username'];
266
$user_id = $test_connection_data['id'] ? $test_connection_data['id'] : $connected_accounts[ $new_user_id ]['user_id'];
267
$profile_picture = $test_connection_data['profile_picture'] ? $test_connection_data['profile_picture'] : $connected_accounts[ $new_user_id ]['profile_picture'];
271
'user_id' => $user_id,
272
'username' => $username,
273
'type' => $type,
274
+ 'is_valid' => true,
275
'last_checked' => $test_connection_data['last_checked'],
276
'profile_picture' => $profile_picture
277
);
284
$connected_accounts[ $new_user_id ]['local_avatar'] = false;
285
}
286
287
+ if ( $type === 'business' ) {
288
+ $url = 'https://graph.facebook.com/'.$user_id.'/tags?user_id='.$user_id.'&fields=id&limit=1&access_token='.sbi_maybe_clean( $access_token );
289
+ $args = array(
290
+ 'timeout' => 60,
291
+ 'sslverify' => false
292
+ );
293
+ $response = wp_remote_get( $url, $args );
294
+
295
+ if ( ! is_wp_error( $response ) ) {
296
+ // certain ways of representing the html for double quotes causes errors so replaced here.
297
+ $response = json_decode( str_replace( '%22', '&rdquo;', $response['body'] ), true );
298
+ if ( isset( $response['data'] ) ) {
299
+ $connected_accounts[ $new_user_id ]['use_tagged'] = '1';
300
+ }
301
+ }
302
+ }
303
+
304
+ delete_transient( SBI_USE_BACKUP_PREFIX . 'sbi_' . $user_id );
305
+
306
$options['connected_accounts'] = $connected_accounts;
307
308
update_option( 'sb_instagram_settings', $options );
328
$options = get_option( 'sb_instagram_settings', array() );
329
$connected_accounts = isset( $options['connected_accounts'] ) ? $options['connected_accounts'] : array();
330
331
+ wp_cache_delete ( 'alloptions', 'options' );
332
+ $username = $connected_accounts[ $account_id ]['username'];
333
334
+ $num_times_used = 0;
335
336
+ $new_con_accounts = array();
337
+ foreach ( $connected_accounts as $connected_account ) {
338
339
+ if ( $connected_account['username'] === $username ) {
340
+ $num_times_used++;
341
+ }
342
+
343
+ if ( $connected_account['username'] !== '' && $account_id !== $connected_account['user_id'] && ! empty( $connected_account['user_id'] ) ) {
344
+ $new_con_accounts[ $connected_account['user_id'] ] = $connected_account;
345
+ }
346
+ }
347
348
+ if ( $num_times_used < 2 ) {
349
+ sbi_delete_local_avatar( $username );
350
+ }
351
352
+ $options['connected_accounts'] = $new_con_accounts;
353
354
+ update_option( 'sb_instagram_settings', $options );
355
356
357
die();
358
}
643
$should_show_new_user_discount = false;
644
$has_been_one_month_since_rating_dismissal = isset( $sbi_statuses_option['rating_notice_dismissed'] ) ? ((int)$sbi_statuses_option['rating_notice_dismissed'] + 30*24*60*60) < $current_time + 1: true;
645
646
+ if ( $in_new_user_month_range && $has_been_one_month_since_rating_dismissal ) {
647
global $current_user;
648
$user_id = $current_user->ID;
649
$ignore_new_user_sale_notice_meta = get_user_meta( $user_id, 'sbi_ignore_new_user_sale_notice' );
681
682
var_dump( $sbi_statuses_option );
683
}
684
+
685
686
if ( $should_show_rating_notice ) {
687
$other_notice_html = '';
688
$dismiss_url = add_query_arg( 'sbi_ignore_rating_notice_nag', '1' );
689
$later_url = add_query_arg( 'sbi_ignore_rating_notice_nag', 'later' );
690
if ( $should_show_bfcm_discount ) {
691
+ $other_notice_html = '<p class="sbi_other_notice">' . __( 'PS. We currently have a <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi&discount='.$sbi_bfcm_discount_code.'" target="_blank"><b style="font-weight: 700;">Black Friday deal</b></a> for 20% off the Pro version!', 'instagram-feed' ) . '</a></p>';
692
693
$dismiss_url = add_query_arg( array(
694
'sbi_ignore_rating_notice_nag' => '1',
702
);
703
}
704
705
+ echo "
706
<div class='sbi_notice sbi_review_notice'>
707
<img src='". SBI_PLUGIN_URL . 'img/sbi-icon.png' ."' alt='" . __( 'Instagram Feed', 'instagram-feed' ) . "'>
708
<div class='sbi-notice-text'>
709
+ <p style='padding-top: 4px;'>" . __( "It's great to see that you've been using the <strong style='font-weight: 700;'>Instagram Feed</strong> plugin for a while now. Hopefully you're happy with it!&nbsp; If so, would you consider leaving a positive review? It really helps to support the plugin and helps others to discover it too!", 'instagram-feed' ) . "</p>
710
+ <p class='links'";
711
+ if( $should_show_bfcm_discount ) echo " style='margin-top: 0 !important;'";
712
+ echo ">
713
<a class='sbi_notice_dismiss' href='https://wordpress.org/support/plugin/instagram-feed/reviews/' target='_blank'>" . __( 'Sure, I\'d love to!', 'instagram-feed' ) . "</a>
714
&middot;
715
<a class='sbi_notice_dismiss' href='" .esc_url( $dismiss_url ). "'>" . __( 'No thanks', 'instagram-feed' ) . "</a>
733
<div class='sbi_notice sbi_review_notice sbi_new_user_sale_notice'>
734
<img src='" . SBI_PLUGIN_URL . 'img/sbi-icon-offer.png' . "' alt='Instagram Feed'>
735
<div class='sbi-notice-text'>
736
+ <p>" . __( '<b style="font-weight: 700;">Exclusive offer!</b> We don\'t run promotions very often, but for a limited time we\'re offering <b style="font-weight: 700;">20% off</b> our Pro version to all users of our free Instagram Feed plugin.', 'instagram-feed' ) . "</p>
737
+ <p class='sbi-links'>
738
+ <a class='sbi_notice_dismiss sbi_offer_btn' href='https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi&discount=instagramthankyou' target='_blank'><b>" . __( 'Get this offer', 'instagram-feed' ) . "</b></a>
739
<a class='sbi_notice_dismiss' style='margin-left: 5px;' href='" . esc_url( add_query_arg( 'sbi_ignore_new_user_sale_notice', 'always' ) ) . "'>" . __( 'I\'m not interested', 'instagram-feed' ) . "</a>
740
741
</p>
751
<div class='sbi_notice sbi_review_notice sbi_bfcm_sale_notice'>
752
<img src='". SBI_PLUGIN_URL . 'img/sbi-icon-offer.png' ."' alt='Instagram Feed'>
753
<div class='sbi-notice-text'>
754
+ <p>" . __( '<b style="font-weight: 700;">Black Friday/Cyber Monday Deal!</b> Thank you for using our free Instagram Feed plugin. For a limited time, we\'re offering <b style="font-weight: 700;">20% off</b> the Pro version for all of our users.', 'instagram-feed' ) . "</p>
755
+ <p class='sbi-links'>
756
<a class='sbi_notice_dismiss sbi_offer_btn' href='https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi&discount=".$sbi_bfcm_discount_code."' target='_blank'>" . __( 'Get this offer!', 'instagram-feed' ) . "</a>
757
<a class='sbi_notice_dismiss' style='margin-left: 5px;' href='" .esc_url( add_query_arg( 'sbi_ignore_bfcm_sale_notice', date( 'Y', $current_time ) ) ). "'>" . __( 'I\'m not interested', 'instagram-feed' ) . "</a>
758
</p>
inc/admin/main.php CHANGED
@@ -85,7 +85,8 @@ function sb_instagram_settings_page() {
85
'enqueue_css_in_shortcode' => false,
86
'sb_instagram_disable_mob_swipe' => false,
87
'sbi_font_method' => 'svg',
88
- 'sb_instagram_disable_awesome' => false
89
);
90
//Save defaults in an array
91
$options = wp_parse_args(get_option('sb_instagram_settings'), $sb_instagram_settings_defaults);
@@ -144,6 +145,8 @@ function sb_instagram_settings_page() {
144
$sb_ajax_initial = $options[ 'sb_ajax_initial' ];
145
$sbi_font_method = $options[ 'sbi_font_method' ];
146
$sb_instagram_disable_awesome = $options[ 'sb_instagram_disable_awesome' ];
147
148
149
//Check nonce before saving data
@@ -328,6 +331,9 @@ function sb_instagram_settings_page() {
328
$options['sbi_font_method'] = $sbi_font_method;
329
$options[ 'sb_instagram_disable_awesome' ] = $sb_instagram_disable_awesome;
330
331
//clear expired tokens
332
delete_option( 'sb_expired_tokens' );
333
@@ -413,7 +419,7 @@ function sb_instagram_settings_page() {
413
<h3><?php _e( 'Configure', 'instagram-feed' ); ?></h3>
414
415
<div id="sbi_config">
416
- <a data-new-api="https://www.facebook.com/dialog/oauth?client_id=254638078422287&redirect_uri=https://api.smashballoon.com/instagram-graph-api-redirect.php&scope=manage_pages,instagram_basic,instagram_manage_insights&state=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>"
417
data-old-api="https://instagram.com/oauth/authorize/?client_id=3a81a9fa2a064751b8c31385b91cc25c&scope=basic&redirect_uri=https://smashballoon.com/instagram-feed/instagram-token-plugin/?return_uri=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>&response_type=token&state=<?php echo admin_url('admin.php?page-sb-instagram-feed'); ?>&hl=en"
418
href="https://instagram.com/oauth/authorize/?client_id=3a81a9fa2a064751b8c31385b91cc25c&scope=basic&redirect_uri=https://smashballoon.com/instagram-feed/instagram-token-plugin/?return_uri=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>&response_type=token&state=<?php echo admin_url('admin.php?page-sb-instagram-feed'); ?>&hl=en" class="sbi_admin_btn"><i class="fa fa-user-plus" aria-hidden="true" style="font-size: 20px;"></i>&nbsp; <?php _e('Connect an Instagram Account', 'instagram-feed' ); ?></a>
419
@@ -702,7 +708,7 @@ function sb_instagram_settings_page() {
702
</div>
703
<div class="sbi_col sbi_two">
704
705
- <p class="sbi_pro_tooltip"><?php _e( 'Upgrade to the Pro version to display hashtag feeds', 'instagram-feed' ); ?><i class="fa fa-caret-down" aria-hidden="true"></i></p>
706
<a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank" class="sbi_lock"><i class="fa fa-rocket"></i><?php _e('Pro', 'instagram-feed'); ?></a>
707
708
<input readonly type="text" size="25" style="height: 32px; top: -2px; position: relative; box-shadow: none;" />
@@ -712,6 +718,19 @@ function sb_instagram_settings_page() {
712
</div>
713
</div>
714
715
<div class="sbi_row sbi_pro">
716
<br>
717
<a class="sbi_tooltip_link sbi_pro" href="JavaScript:void(0);" style="margin-left: 0;"><i class="fa fa-question-circle" aria-hidden="true" style="margin-right: 6px;"></i><?php _e('Combine multiple feed types into a single feed', 'instagram-feed'); ?></a>
@@ -1781,7 +1800,16 @@ function sb_instagram_settings_page() {
1781
<p class="sbi_tooltip"><?php _e("This plugin uses SVGs for all icons in the feed. Use this setting to switch to font icons.", 'instagram-feed'); ?></p>
1782
</td>
1783
</tr>
1784
- </tbody>
1785
</table>
1786
1787
<?php submit_button(); ?>
85
'enqueue_css_in_shortcode' => false,
86
'sb_instagram_disable_mob_swipe' => false,
87
'sbi_font_method' => 'svg',
88
+ 'sb_instagram_disable_awesome' => false,
89
+ 'custom_template' => false
90
);
91
//Save defaults in an array
92
$options = wp_parse_args(get_option('sb_instagram_settings'), $sb_instagram_settings_defaults);
145
$sb_ajax_initial = $options[ 'sb_ajax_initial' ];
146
$sbi_font_method = $options[ 'sbi_font_method' ];
147
$sb_instagram_disable_awesome = $options[ 'sb_instagram_disable_awesome' ];
148
+ $sb_instagram_custom_template = $options[ 'custom_template' ];
149
+
150
151
152
//Check nonce before saving data
331
$options['sbi_font_method'] = $sbi_font_method;
332
$options[ 'sb_instagram_disable_awesome' ] = $sb_instagram_disable_awesome;
333
334
+ isset($_POST[ 'sb_instagram_custom_template' ]) ? $sb_instagram_custom_template = $_POST[ 'sb_instagram_custom_template' ] : $sb_instagram_custom_template = '';
335
+ $options['custom_template'] = $sb_instagram_custom_template;
336
+
337
//clear expired tokens
338
delete_option( 'sb_expired_tokens' );
339
419
<h3><?php _e( 'Configure', 'instagram-feed' ); ?></h3>
420
421
<div id="sbi_config">
422
+ <a data-new-api="https://www.facebook.com/dialog/oauth?client_id=254638078422287&redirect_uri=https://api.smashballoon.com/instagram-graph-api-redirect.php&scope=manage_pages,instagram_basic,instagram_manage_insights,instagram_manage_comments&state=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>"
423
data-old-api="https://instagram.com/oauth/authorize/?client_id=3a81a9fa2a064751b8c31385b91cc25c&scope=basic&redirect_uri=https://smashballoon.com/instagram-feed/instagram-token-plugin/?return_uri=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>&response_type=token&state=<?php echo admin_url('admin.php?page-sb-instagram-feed'); ?>&hl=en"
424
href="https://instagram.com/oauth/authorize/?client_id=3a81a9fa2a064751b8c31385b91cc25c&scope=basic&redirect_uri=https://smashballoon.com/instagram-feed/instagram-token-plugin/?return_uri=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>&response_type=token&state=<?php echo admin_url('admin.php?page-sb-instagram-feed'); ?>&hl=en" class="sbi_admin_btn"><i class="fa fa-user-plus" aria-hidden="true" style="font-size: 20px;"></i>&nbsp; <?php _e('Connect an Instagram Account', 'instagram-feed' ); ?></a>
425
708
</div>
709
<div class="sbi_col sbi_two">
710
711
+ <p class="sbi_pro_tooltip"><?php _e( 'Upgrade to the Pro version to display Hashtag and Tagged feeds', 'instagram-feed' ); ?><i class="fa fa-caret-down" aria-hidden="true"></i></p>
712
<a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank" class="sbi_lock"><i class="fa fa-rocket"></i><?php _e('Pro', 'instagram-feed'); ?></a>
713
714
<input readonly type="text" size="25" style="height: 32px; top: -2px; position: relative; box-shadow: none;" />
718
</div>
719
</div>
720
721
+ <div class="sbi_pro sbi_row">
722
+ <div class="sbi_col sbi_one">
723
+ <input disabled type="radio" name="sb_instagram_type" id="sb_instagram_type_tagged" value="tagged" <?php if($sb_instagram_type == "tagged") echo "checked"; ?> />
724
+ <label class="sbi_radio_label" for="sb_instagram_type_tagged"><?php _e( 'Tagged:', 'instagram-feed' ); ?></label>
725
+ </div>
726
+ <div class="sbi_col sbi_two">
727
+ <input readonly type="text" size="25" style="height: 32px; top: -2px; position: relative; box-shadow: none;" />
728
+ &nbsp;<a class="sbi_tooltip_link sbi_pro" href="JavaScript:void(0);"><?php _e( 'What is this?', 'instagram-feed' ); ?></a>
729
+
730
+ <p class="sbi_tooltip"><?php _e( 'Display posts that your account has been tagged in.', 'instagram-feed' ); ?></p>
731
+ </div>
732
+ </div>
733
+
734
<div class="sbi_row sbi_pro">
735
<br>
736
<a class="sbi_tooltip_link sbi_pro" href="JavaScript:void(0);" style="margin-left: 0;"><i class="fa fa-question-circle" aria-hidden="true" style="margin-right: 6px;"></i><?php _e('Combine multiple feed types into a single feed', 'instagram-feed'); ?></a>
1800
<p class="sbi_tooltip"><?php _e("This plugin uses SVGs for all icons in the feed. Use this setting to switch to font icons.", 'instagram-feed'); ?></p>
1801
</td>
1802
</tr>
1803
+ <tr>
1804
+ <th class="bump-left"><label class="bump-left"><?php _e("Enable Custom Templates", 'instagram-feed'); ?></label></th>
1805
+ <td>
1806
+ <input name="sb_instagram_custom_template" type="checkbox" id="sb_instagram_custom_template" <?php if($sb_instagram_custom_template == true) echo "checked"; ?> />
1807
+ <label for="sb_instagram_custom_template"><?php _e('Yes', 'instagram-feed'); ?></label>
1808
+ <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'instagram-feed'); ?></a>
1809
+ <p class="sbi_tooltip"><?php _e("The default HTML for the feed can be replaced with custom templates added to your theme's folder. Enable this setting to use these templates. See <a href=\"https://smashballoon.com/guide-to-creating-custom-templates/\" target=\"_blank\">this guide</a>", 'instagram-feed'); ?></p>
1810
+ </td>
1811
+ </tr>
1812
+ </tbody>
1813
</table>
1814
1815
<?php submit_button(); ?>
inc/class-sb-instagram-feed.php CHANGED
@@ -177,13 +177,15 @@ class SB_Instagram_Feed
177
* @since 2.0/5.0
178
*/
179
public function should_use_backup() {
180
- return $this->should_use_backup;
181
}
182
183
/**
184
* The header is only displayed when the setting is enabled and
185
* an account has been connected
186
*
187
* @param array $settings settings specific to this feed
188
* @param array $feed_types_and_terms organized settings related to feed data
189
* (ex. 'user' => array( 'smashballoon', 'custominstagramfeed' )
@@ -349,12 +351,13 @@ class SB_Instagram_Feed
349
$ids = $num_or_array_of_ids;
350
351
$id_string = '"' . implode( '","', $ids ) . '"';
352
- $results = $wpdb->get_results( "
353
SELECT p.media_id, p.instagram_id, p.aspect_ratio, p.sizes
354
FROM $posts_table_name AS p
355
INNER JOIN $feeds_posts_table_name AS f ON p.id = f.id
356
AND p.instagram_id IN($id_string)
357
- AND p.images_done = 1", ARRAY_A );
358
359
$return = array();
360
if ( !empty( $results ) && is_array( $results ) ) {
@@ -489,6 +492,14 @@ class SB_Instagram_Feed
489
$next_pages = $this->next_pages;
490
global $sb_instagram_posts_manager;
491
492
$num = apply_filters( 'sbi_num_in_request', $settings['minnum'], $settings );
493
494
$params = array(
@@ -497,6 +508,7 @@ class SB_Instagram_Feed
497
498
$one_successful_connection = false;
499
$next_page_found = false;
500
501
foreach ( $feed_types_and_terms as $type => $terms ) {
502
if ( is_array( $terms ) && count( $terms ) > 5 ) {
@@ -615,6 +627,8 @@ class SB_Instagram_Feed
615
}
616
}
617
} elseif ( $api_requests_delayed ) {
618
$this->add_report( 'delaying API request for ' . $term . ' - ' . $type );
619
620
$error = '<p><b>' . sprintf( __( 'Error: API requests are being delayed for this account.', 'instagram-feed' ), $connected_account_for_term['username'] ) . ' ' . __( 'New posts will not be retrieved.', 'instagram-feed' ) . '</b>';
@@ -626,7 +640,7 @@ class SB_Instagram_Feed
626
}
627
}
628
629
- if ( ! $one_successful_connection ) {
630
$this->should_use_backup = true;
631
}
632
$posts = $this->merge_posts( $new_post_sets, $settings );
@@ -658,7 +672,7 @@ class SB_Instagram_Feed
658
* @since 2.0/5.0
659
*/
660
public function set_remote_header_data( $settings, $feed_types_and_terms, $connected_accounts_for_feed ) {
661
- $first_user = isset( $feed_types_and_terms['users'][0] ) ? $feed_types_and_terms['users'][0]['term'] : '';
662
$this->header_data = false;
663
664
if ( isset( $connected_accounts_for_feed[ $first_user ] ) ) {
@@ -727,20 +741,27 @@ class SB_Instagram_Feed
727
* @since 2.0/5.1 duplicate posts removed, cache set trimmed to a maximum
728
*/
729
public function set_cron_cache( $to_cache, $cache_time, $save_backup = true ) {
730
- $this->remove_duplicate_posts();
731
- $this->trim_posts_to_max();
732
733
- $to_cache['data'] = isset( $to_cache['data'] ) ? $to_cache['data'] : $this->post_data;
734
- $to_cache['pagination'] = isset( $to_cache['next_pages'] ) ? $to_cache['next_pages'] : $this->next_pages;
735
- $to_cache['atts'] = isset( $to_cache['atts'] ) ? $to_cache['atts'] : $this->transient_atts;
736
- $to_cache['last_requested'] = isset( $to_cache['last_requested'] ) ? $to_cache['last_requested'] : time();
737
- $to_cache['last_retrieve'] = isset( $to_cache['last_retrieve'] ) ? $to_cache['last_retrieve'] : $this->last_retrieve;
738
739
- set_transient( $this->regular_feed_transient_name, wp_json_encode( $to_cache ), $cache_time );
740
741
- if ( $save_backup ) {
742
- update_option( $this->backup_feed_transient_name, wp_json_encode( $to_cache ), false );
743
}
744
}
745
746
/**
@@ -846,6 +867,10 @@ class SB_Instagram_Feed
846
$first_username = false;
847
if ( $first_user ) {
848
$first_username = isset( $connected_accounts_for_feed[ $first_user ]['username'] ) ? $connected_accounts_for_feed[ $first_user ]['username'] : $first_user;
849
}
850
$use_pagination = $this->should_use_pagination( $settings, 0 );
851
@@ -932,21 +957,6 @@ class SB_Instagram_Feed
932
return $html;
933
}
934
935
- /**
936
- * Additional options/settings added to the main div
937
- * for the feed
938
- *
939
- * Overwritten in the Pro version
940
- *
941
- * @param $other_atts
942
- * @param $settings
943
- *
944
- * @return string
945
- */
946
- protected function add_other_atts( $other_atts, $settings ) {
947
- return '';
948
- }
949
-
950
/**
951
* Generates HTML for individual sbi_item elements
952
*
@@ -1018,11 +1028,28 @@ class SB_Instagram_Feed
1018
$encoded_options = wp_json_encode( $js_options );
1019
1020
$js_option_html = '<script type="text/javascript">var sb_instagram_js_options = ' . $encoded_options . ';</script>';
1021
- $js_option_html .= "<script type='text/javascript' src='" . trailingslashit( SBI_PLUGIN_URL ) . 'js/sb-instagram-2-0-1.min.js?ver=' . SBIVER . "'></script>";
1022
1023
return $js_option_html;
1024
}
1025
1026
/**
1027
* Adds recorded strings to an array
1028
*
@@ -1043,6 +1070,21 @@ class SB_Instagram_Feed
1043
return $this->report;
1044
}
1045
1046
/**
1047
* Used for filtering a single API request worth of posts
1048
*
@@ -1219,6 +1261,7 @@ class SB_Instagram_Feed
1219
* @return mixed|array
1220
*
1221
* @since 2.0/5.0
1222
*/
1223
private function sort_posts( $post_set, $settings ) {
1224
if ( empty( $post_set ) ) {
@@ -1227,22 +1270,32 @@ class SB_Instagram_Feed
1227
1228
// sorting done with "merge_posts" to be more efficient
1229
if ( $settings['sortby'] === 'alternate' ) {
1230
- return $post_set;
1231
- } elseif ( $settings['sortby'] !== 'random' ) {
1232
- // compares posted on dates of posts
1233
- usort($post_set, 'sbi_date_sort' );
1234
-
1235
- return $post_set;
1236
- } else {
1237
/*
1238
- * randomly selects posts in a random order. Cache saves posts
1239
- * in this random order so paginating does not cause some posts to show up
1240
- * twice or not at all
1241
- */
1242
usort($post_set, 'sbi_rand_sort' );
1243
1244
- return $post_set;
1245
}
1246
}
1247
1248
/**
177
* @since 2.0/5.0
178
*/
179
public function should_use_backup() {
180
+ return $this->should_use_backup || empty( $this->post_data );
181
}
182
183
/**
184
* The header is only displayed when the setting is enabled and
185
* an account has been connected
186
*
187
+ * Overwritten in the Pro version
188
+ *
189
* @param array $settings settings specific to this feed
190
* @param array $feed_types_and_terms organized settings related to feed data
191
* (ex. 'user' => array( 'smashballoon', 'custominstagramfeed' )
351
$ids = $num_or_array_of_ids;
352
353
$id_string = '"' . implode( '","', $ids ) . '"';
354
+ $results = $wpdb->get_results( $wpdb->prepare( "
355
SELECT p.media_id, p.instagram_id, p.aspect_ratio, p.sizes
356
FROM $posts_table_name AS p
357
INNER JOIN $feeds_posts_table_name AS f ON p.id = f.id
358
+ WHERE f.feed_id = %s
359
AND p.instagram_id IN($id_string)
360
+ AND p.images_done = 1", $feed_id ), ARRAY_A );
361
362
$return = array();
363
if ( !empty( $results ) && is_array( $results ) ) {
492
$next_pages = $this->next_pages;
493
global $sb_instagram_posts_manager;
494
495
+ /**
496
+ * Number of posts to retrieve in each API call
497
+ *
498
+ * @param int Minimum number of posts needed in each API request
499
+ * @param array $settings Settings for this feed
500
+ *
501
+ * @since 2.0/5.0
502
+ */
503
$num = apply_filters( 'sbi_num_in_request', $settings['minnum'], $settings );
504
505
$params = array(
508
509
$one_successful_connection = false;
510
$next_page_found = false;
511
+ $one_api_request_delayed = false;
512
513
foreach ( $feed_types_and_terms as $type => $terms ) {
514
if ( is_array( $terms ) && count( $terms ) > 5 ) {
627
}
628
}
629
} elseif ( $api_requests_delayed ) {
630
+ $one_api_request_delayed = true;
631
+
632
$this->add_report( 'delaying API request for ' . $term . ' - ' . $type );
633
634
$error = '<p><b>' . sprintf( __( 'Error: API requests are being delayed for this account.', 'instagram-feed' ), $connected_account_for_term['username'] ) . ' ' . __( 'New posts will not be retrieved.', 'instagram-feed' ) . '</b>';
640
}
641
}
642
643
+ if ( ! $one_successful_connection || ($one_api_request_delayed && empty( $new_post_sets )) ) {
644
$this->should_use_backup = true;
645
}
646
$posts = $this->merge_posts( $new_post_sets, $settings );
672
* @since 2.0/5.0
673
*/
674
public function set_remote_header_data( $settings, $feed_types_and_terms, $connected_accounts_for_feed ) {
675
+ $first_user = $this->get_first_user( $feed_types_and_terms );
676
$this->header_data = false;
677
678
if ( isset( $connected_accounts_for_feed[ $first_user ] ) ) {
741
* @since 2.0/5.1 duplicate posts removed, cache set trimmed to a maximum
742
*/
743
public function set_cron_cache( $to_cache, $cache_time, $save_backup = true ) {
744
+ if ( ! empty( $this->post_data )
745
+ || ! empty( $this->next_pages )
746
+ || ! empty( $to_cache['data'] ) ) {
747
+ $this->remove_duplicate_posts();
748
+ $this->trim_posts_to_max();
749
750
+ $to_cache['data'] = isset( $to_cache['data'] ) ? $to_cache['data'] : $this->post_data;
751
+ $to_cache['pagination'] = isset( $to_cache['next_pages'] ) ? $to_cache['next_pages'] : $this->next_pages;
752
+ $to_cache['atts'] = isset( $to_cache['atts'] ) ? $to_cache['atts'] : $this->transient_atts;
753
+ $to_cache['last_requested'] = isset( $to_cache['last_requested'] ) ? $to_cache['last_requested'] : time();
754
+ $to_cache['last_retrieve'] = isset( $to_cache['last_retrieve'] ) ? $to_cache['last_retrieve'] : $this->last_retrieve;
755
756
+ set_transient( $this->regular_feed_transient_name, wp_json_encode( $to_cache ), $cache_time );
757
758
+ if ( $save_backup ) {
759
+ update_option( $this->backup_feed_transient_name, wp_json_encode( $to_cache ), false );
760
+ }
761
+ } else {
762
+ $this->add_report( 'no data not caching' );
763
}
764
+
765
}
766
767
/**
867
$first_username = false;
868
if ( $first_user ) {
869
$first_username = isset( $connected_accounts_for_feed[ $first_user ]['username'] ) ? $connected_accounts_for_feed[ $first_user ]['username'] : $first_user;
870
+ } elseif ( $header_data ) { // in case no connected account for feed
871
+ $first_username = SB_Instagram_Parse::get_username( $header_data );
872
+ } elseif ( isset( $feed_types_and_terms['users'] ) && isset( $this->post_data[0] ) ) { // in case no connected account and no header
873
+ $first_username = SB_Instagram_Parse::get_username( $this->post_data[0] );
874
}
875
$use_pagination = $this->should_use_pagination( $settings, 0 );
876
957
return $html;
958
}
959
960
/**
961
* Generates HTML for individual sbi_item elements
962
*
1028
$encoded_options = wp_json_encode( $js_options );
1029
1030
$js_option_html = '<script type="text/javascript">var sb_instagram_js_options = ' . $encoded_options . ';</script>';
1031
+ $js_option_html .= "<script type='text/javascript' src='" . trailingslashit( SBI_PLUGIN_URL ) . 'js/sb-instagram.min.js?ver=' . SBIVER . "'></script>";
1032
1033
return $js_option_html;
1034
}
1035
1036
+ /**
1037
+ * Overwritten in the Pro version
1038
+ *
1039
+ * @param $feed_types_and_terms
1040
+ *
1041
+ * @return string
1042
+ *
1043
+ * @since 2.1/5.2
1044
+ */
1045
+ public function get_first_user( $feed_types_and_terms ) {
1046
+ if ( isset( $feed_types_and_terms['users'][0] ) ) {
1047
+ return $feed_types_and_terms['users'][0]['term'];
1048
+ } else {
1049
+ return '';
1050
+ }
1051
+ }
1052
+
1053
/**
1054
* Adds recorded strings to an array
1055
*
1070
return $this->report;
1071
}
1072
1073
+ /**
1074
+ * Additional options/settings added to the main div
1075
+ * for the feed
1076
+ *
1077
+ * Overwritten in the Pro version
1078
+ *
1079
+ * @param $other_atts
1080
+ * @param $settings
1081
+ *
1082
+ * @return string
1083
+ */
1084
+ protected function add_other_atts( $other_atts, $settings ) {
1085
+ return '';
1086
+ }
1087
+
1088
/**
1089
* Used for filtering a single API request worth of posts
1090
*
1261
* @return mixed|array
1262
*
1263
* @since 2.0/5.0
1264
+ * @since 2.1/5.2 added filter hook for applying custom sorting
1265
*/
1266
private function sort_posts( $post_set, $settings ) {
1267
if ( empty( $post_set ) ) {
1270
1271
// sorting done with "merge_posts" to be more efficient
1272
if ( $settings['sortby'] === 'alternate' ) {
1273
+ $return_post_set = $post_set;
1274
+ } elseif ( $settings['sortby'] === 'random' ) {
1275
/*
1276
+ * randomly selects posts in a random order. Cache saves posts
1277
+ * in this random order so paginating does not cause some posts to show up
1278
+ * twice or not at all
1279
+ */
1280
usort($post_set, 'sbi_rand_sort' );
1281
+ $return_post_set = $post_set;
1282
1283
+ } else {
1284
+ // compares posted on dates of posts
1285
+ usort($post_set, 'sbi_date_sort' );
1286
+ $return_post_set = $post_set;
1287
}
1288
+
1289
+ /**
1290
+ * Apply a custom sorting of posts
1291
+ *
1292
+ * @param array $return_post_set Ordered set of filtered posts
1293
+ * @param array $settings Settings for this feed
1294
+ *
1295
+ * @since 2.1/5.2
1296
+ */
1297
+
1298
+ return apply_filters( 'sbi_sorted_posts', $return_post_set, $settings );
1299
}
1300
1301
/**
inc/class-sb-instagram-settings.php CHANGED
@@ -103,16 +103,19 @@ class SB_Instagram_Settings {
103
'user' => isset( $db['sb_instagram_user'] ) ? $db['sb_instagram_user'] : false,
104
'feedid' => isset( $db['sb_instagram_feed_id'] ) ? $db['sb_instagram_feed_id'] : false,
105
'resizeprocess' => isset( $db['sb_instagram_resizeprocess'] ) ? $db['sb_instagram_resizeprocess'] : 'background',
106
- ), $atts );
107
108
$this->settings['minnum'] = max( (int)$this->settings['num'], (int)$this->settings['nummobile'] );
109
$this->settings['showbio'] = $this->settings['showbio'] === 'true' || $this->settings['showbio'] === 'on' || $this->settings['showbio'] === true;
110
if ( isset( $atts['showbio'] ) && $atts['showbio'] === 'false' ) {
111
$this->settings['showbio'] = false;
112
}
113
- if ( isset( $atts['showheader'] ) && $atts['showheader'] === 'false' ) {
114
- $this->settings['showheader'] = false;
115
- }
116
$this->settings['disable_resize'] = isset( $db['sb_instagram_disable_resize'] ) && ($db['sb_instagram_disable_resize'] === 'on');
117
$this->settings['favor_local'] = isset( $db['sb_instagram_favor_local'] ) && ($db['sb_instagram_favor_local'] === 'on');
118
$this->settings['backup_cache_enabled'] = ! isset( $db['sb_instagram_backup'] ) || ($db['sb_instagram_backup'] === 'on');
@@ -132,6 +135,8 @@ class SB_Instagram_Settings {
132
$this->settings['sbi_cache_cron_interval'] = 60*60*12;
133
}
134
135
136
global $sb_instagram_posts_manager;
137
@@ -153,6 +158,8 @@ class SB_Instagram_Settings {
153
* The plugin will output settings on the frontend for debugging purposes.
154
* Safe settings to display are added here.
155
*
156
* @return array
157
*
158
* @since 2.0/5.0
@@ -200,7 +207,9 @@ class SB_Instagram_Settings {
200
'disable_js_image_loading',
201
'enqueue_js_in_head',
202
'sbi_font_method',
203
- 'sb_instagram_disable_awesome'
204
);
205
206
return $public;
@@ -467,13 +476,14 @@ class SB_Instagram_Settings {
467
return SBI_CRON_UPDATE_CACHE_TIME;
468
} else {
469
//If the caching time doesn't exist in the database then set it to be 1 hour
470
- $cache_time = isset( $settings['sb_instagram_cache_time'] ) ? (int)$this->settings['sb_instagram_cache_time'] : 1;
471
- $cache_time_unit = isset( $settings['sb_instagram_cache_time_unit'] ) ? $this->settings['sb_instagram_cache_time_unit'] : 'hours';
472
473
//Calculate the cache time in seconds
474
if ( $cache_time_unit == 'minutes' ) $cache_time_unit = 60;
475
if ( $cache_time_unit == 'hours' ) $cache_time_unit = 60*60;
476
if ( $cache_time_unit == 'days' ) $cache_time_unit = 60*60*24;
477
return $cache_time * $cache_time_unit;
478
}
479
}
103
'user' => isset( $db['sb_instagram_user'] ) ? $db['sb_instagram_user'] : false,
104
'feedid' => isset( $db['sb_instagram_feed_id'] ) ? $db['sb_instagram_feed_id'] : false,
105
'resizeprocess' => isset( $db['sb_instagram_resizeprocess'] ) ? $db['sb_instagram_resizeprocess'] : 'background',
106
+ 'customtemplates' => isset( $db['custom_template'] ) ? $db['custom_template'] : '',
107
108
+ ), $atts );
109
+
110
+ $this->settings['customtemplates'] = $this->settings['customtemplates'] === 'true' || $this->settings['customtemplates'] === 'on';
111
+ if ( isset( $_GET['sbi_debug'] ) ) {
112
+ $this->settings['customtemplates'] = false;
113
+ }
114
$this->settings['minnum'] = max( (int)$this->settings['num'], (int)$this->settings['nummobile'] );
115
$this->settings['showbio'] = $this->settings['showbio'] === 'true' || $this->settings['showbio'] === 'on' || $this->settings['showbio'] === true;
116
if ( isset( $atts['showbio'] ) && $atts['showbio'] === 'false' ) {
117
$this->settings['showbio'] = false;
118
}
119
$this->settings['disable_resize'] = isset( $db['sb_instagram_disable_resize'] ) && ($db['sb_instagram_disable_resize'] === 'on');
120
$this->settings['favor_local'] = isset( $db['sb_instagram_favor_local'] ) && ($db['sb_instagram_favor_local'] === 'on');
121
$this->settings['backup_cache_enabled'] = ! isset( $db['sb_instagram_backup'] ) || ($db['sb_instagram_backup'] === 'on');
135
$this->settings['sbi_cache_cron_interval'] = 60*60*12;
136
}
137
138
+ $this->settings['sb_instagram_cache_time'] = isset( $this->db['sb_instagram_cache_time'] ) ? $this->db['sb_instagram_cache_time'] : 1;
139
+ $this->settings['sb_instagram_cache_time_unit'] = isset( $this->db['sb_instagram_cache_time_unit'] ) ? $this->db['sb_instagram_cache_time_unit'] : 'hours';
140
141
global $sb_instagram_posts_manager;
142
158
* The plugin will output settings on the frontend for debugging purposes.
159
* Safe settings to display are added here.
160
*
161
+ * Overwritten in the Pro version.
162
+ *
163
* @return array
164
*
165
* @since 2.0/5.0
207
'disable_js_image_loading',
208
'enqueue_js_in_head',
209
'sbi_font_method',
210
+ 'sb_instagram_disable_awesome',
211
+ 'sb_ajax_initial',
212
+ 'use_custom'
213
);
214
215
return $public;
476
return SBI_CRON_UPDATE_CACHE_TIME;
477
} else {
478
//If the caching time doesn't exist in the database then set it to be 1 hour
479
+ $cache_time = isset( $this->settings['sb_instagram_cache_time'] ) ? (int)$this->settings['sb_instagram_cache_time'] : 1;
480
+ $cache_time_unit = isset( $this->settings['sb_instagram_cache_time_unit'] ) ? $this->settings['sb_instagram_cache_time_unit'] : 'hours';
481
482
//Calculate the cache time in seconds
483
if ( $cache_time_unit == 'minutes' ) $cache_time_unit = 60;
484
if ( $cache_time_unit == 'hours' ) $cache_time_unit = 60*60;
485
if ( $cache_time_unit == 'days' ) $cache_time_unit = 60*60*24;
486
+
487
return $cache_time * $cache_time_unit;
488
}
489
}
inc/if-functions.php CHANGED
@@ -552,20 +552,54 @@ function sbi_get_database_settings() {
552
553
/**
554
* May include support for templates in theme folders in the future
555
*/
556
function sbi_get_feed_template_part( $part, $settings = array() ) {
557
- $file = '';
558
- if ( $part === 'header' ) {
559
- $file = trailingslashit( SBI_PLUGIN_DIR ) . 'templates/header.php';
560
- } elseif ( $part === 'item' ) {
561
- $file = trailingslashit( SBI_PLUGIN_DIR ) . 'templates/item.php';
562
- } elseif ( $part === 'footer' ) {
563
- $file = trailingslashit( SBI_PLUGIN_DIR ) . 'templates/footer.php';
564
- } elseif ( $part === 'feed' ) {
565
- $file = trailingslashit( SBI_PLUGIN_DIR ) . 'templates/feed.php';
566
- }
567
568
- return $file;
569
}
570
571
/**
@@ -762,7 +796,7 @@ function sb_instagram_scripts_enqueue() {
762
//Options to pass to JS file
763
$sb_instagram_settings = get_option( 'sb_instagram_settings' );
764
765
- $js_file = 'js/sb-instagram-2-0-1.min.js';
766
if ( isset( $_GET['sbi_debug'] ) ) {
767
$js_file = 'js/sb-instagram.js';
768
}
@@ -774,9 +808,9 @@ function sb_instagram_scripts_enqueue() {
774
}
775
776
if ( isset( $sb_instagram_settings['enqueue_css_in_shortcode'] ) && $sb_instagram_settings['enqueue_css_in_shortcode'] ) {
777
- wp_register_style( 'sb_instagram_styles', trailingslashit( SBI_PLUGIN_URL ) . 'css/sb-instagram-2-0-2.min.css', array(), SBIVER );
778
} else {
779
- wp_enqueue_style( 'sb_instagram_styles', trailingslashit( SBI_PLUGIN_URL ) . 'css/sb-instagram-2-0-2.min.css', array(), SBIVER );
780
}
781
782
$font_method = isset( $sb_instagram_settings['sbi_font_method'] ) ? $sb_instagram_settings['sbi_font_method'] : 'svg';
552
553
/**
554
* May include support for templates in theme folders in the future
555
+ *
556
+ * @since 2.1 custom templates supported
557
*/
558
function sbi_get_feed_template_part( $part, $settings = array() ) {
559
+ $file = '';
560
+
561
+ $using_custom_templates_in_theme = apply_filters( 'sbi_use_theme_templates', $settings['customtemplates'] );
562
+ $generic_path = trailingslashit( SBI_PLUGIN_DIR ) . 'templates/';
563
+
564
+ if ( $using_custom_templates_in_theme ) {
565
+ $custom_header_template = locate_template( 'sbi/header.php', false, false );
566
+ $custom_item_template = locate_template( 'sbi/item.php', false, false );
567
+ $custom_footer_template = locate_template( 'sbi/footer.php', false, false );
568
+ $custom_feed_template = locate_template( 'sbi/feed.php', false, false );
569
+ } else {
570
+ $custom_header_template = false;
571
+ $custom_item_template = false;
572
+ $custom_footer_template = false;
573
+ $custom_feed_template = false;
574
+ }
575
+
576
+ if ( $part === 'header' ) {
577
+ if ( $custom_header_template ) {
578
+ $file = $custom_header_template;
579
+ } else {
580
+ $file = $generic_path . 'header.php';
581
+ }
582
+ } elseif ( $part === 'item' ) {
583
+ if ( $custom_item_template ) {
584
+ $file = $custom_item_template;
585
+ } else {
586
+ $file = $generic_path . 'item.php';
587
+ }
588
+ } elseif ( $part === 'footer' ) {
589
+ if ( $custom_footer_template ) {
590
+ $file = $custom_footer_template;
591
+ } else {
592
+ $file = $generic_path . 'footer.php';
593
+ }
594
+ } elseif ( $part === 'feed' ) {
595
+ if ( $custom_feed_template ) {
596
+ $file = $custom_feed_template;
597
+ } else {
598
+ $file = $generic_path . 'feed.php';
599
+ }
600
+ }
601
602
+ return $file;
603
}
604
605
/**
796
//Options to pass to JS file
797
$sb_instagram_settings = get_option( 'sb_instagram_settings' );
798
799
+ $js_file = 'js/sb-instagram-2-1.min.js';
800
if ( isset( $_GET['sbi_debug'] ) ) {
801
$js_file = 'js/sb-instagram.js';
802
}
808
}
809
810
if ( isset( $sb_instagram_settings['enqueue_css_in_shortcode'] ) && $sb_instagram_settings['enqueue_css_in_shortcode'] ) {
811
+ wp_register_style( 'sb_instagram_styles', trailingslashit( SBI_PLUGIN_URL ) . 'css/sb-instagram-2-1.min.css', array(), SBIVER );
812
} else {
813
+ wp_enqueue_style( 'sb_instagram_styles', trailingslashit( SBI_PLUGIN_URL ) . 'css/sb-instagram-2-1.min.css', array(), SBIVER );
814
}
815
816
$font_method = isset( $sb_instagram_settings['sbi_font_method'] ) ? $sb_instagram_settings['sbi_font_method'] : 'svg';
instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Smash Balloon Instagram Feed
4
Plugin URI: https://smashballoon.com/instagram-feed
5
Description: Display beautifully clean, customizable, and responsive Instagram feeds.
6
- Version: 2.0.2
7
Author: Smash Balloon
8
Author URI: https://smashballoon.com/
9
License: GPLv2 or later
@@ -23,11 +23,11 @@ along with this program; if not, write to the Free Software
23
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
*/
25
if ( ! defined( 'SBIVER' ) ) {
26
- define( 'SBIVER', '2.0.2' );
27
}
28
// Db version.
29
if ( ! defined( 'SBI_DBVERSION' ) ) {
30
- define( 'SBI_DBVERSION', '1.2' );
31
}
32
33
// Upload folder name for local image files for posts
@@ -429,6 +429,16 @@ if ( function_exists( 'sb_instagram_feed_init' ) ) {
429
update_option( 'sbi_db_version', SBI_DBVERSION );
430
}
431
432
}
433
434
add_action( 'wp_loaded', 'sbi_check_for_db_updates' );
3
Plugin Name: Smash Balloon Instagram Feed
4
Plugin URI: https://smashballoon.com/instagram-feed
5
Description: Display beautifully clean, customizable, and responsive Instagram feeds.
6
+ Version: 2.1
7
Author: Smash Balloon
8
Author URI: https://smashballoon.com/
9
License: GPLv2 or later
23
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
*/
25
if ( ! defined( 'SBIVER' ) ) {
26
+ define( 'SBIVER', '2.1' );
27
}
28
// Db version.
29
if ( ! defined( 'SBI_DBVERSION' ) ) {
30
+ define( 'SBI_DBVERSION', '1.3' );
31
}
32
33
// Upload folder name for local image files for posts
429
update_option( 'sbi_db_version', SBI_DBVERSION );
430
}
431
432
+ if ( (float) $db_ver < 1.3 ) {
433
+ $sbi_statuses_option = get_option( 'sbi_statuses', array() );
434
+ if ( $sbi_statuses_option['first_install'] === 'from_update' ) {
435
+ $sbi_statuses_option['first_install'] = time() - 60*60*24*23;
436
+ update_option( 'sbi_statuses', $sbi_statuses_option, false );
437
+ }
438
+
439
+ update_option( 'sbi_db_version', SBI_DBVERSION );
440
+ }
441
+
442
}
443
444
add_action( 'wp_loaded', 'sbi_check_for_db_updates' );
js/sb-instagram-2-1.js ADDED
@@ -0,0 +1,866 @@