Instagram Feed - Version 1.7

Version Description

  • New: Added feed caching to limit the number of API requests. Use the setting on the "Configure" tab "Check for new posts every" to set how long feed data will be cached before refreshing.
  • New: Added backup caching for all feeds. If the feed is unable to display then a backup feed will be shown to visitors if one is available. The backup cache can be disabled or cleared by using the following setting: Customize > Misc > Enable Backup Caching.
  • New: Icons are now generated as SVGs for a sharper look and more semantic markup
  • New: Carousel posts include an icon to indicate that they are carousel posts
  • Tweak: Using the "sort posts by random" feature will include the most recent 33 posts instead of just the posts shown in the feed
  • Fix: links back to instagram.com will use the "www" prefix
Download this release

Release Info

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

Code changes from version 1.6.2 to 1.7

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: smashballoon, craig-at-smash-balloon
3
Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
Requires at least: 3.0
5
Tested up to: 4.9
6
- Stable tag: 1.6.2
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
@@ -310,6 +310,14 @@ We understand that sometimes you need help, have issues or just have questions.
310
* Plus more customization options added all the time!
311
312
== Changelog ==
313
= 1.6.2 =
314
* Fix: Fixed a rare issue where the Load More button wouldn't be displayed after the last update if the Instagram account didn't have many posts
315
3
Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
Requires at least: 3.0
5
Tested up to: 4.9
6
+ Stable tag: 1.7
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
310
* Plus more customization options added all the time!
311
312
== Changelog ==
313
+ = 1.7 =
314
+ * New: Added feed caching to limit the number of API requests. Use the setting on the "Configure" tab "Check for new posts every" to set how long feed data will be cached before refreshing.
315
+ * New: Added backup caching for all feeds. If the feed is unable to display then a backup feed will be shown to visitors if one is available. The backup cache can be disabled or cleared by using the following setting: `Customize > Misc > Enable Backup Caching`.
316
+ * New: Icons are now generated as SVGs for a sharper look and more semantic markup
317
+ * New: Carousel posts include an icon to indicate that they are carousel posts
318
+ * Tweak: Using the "sort posts by random" feature will include the most recent 33 posts instead of just the posts shown in the feed
319
+ * Fix: links back to instagram.com will use the "www" prefix
320
+
321
= 1.6.2 =
322
* Fix: Fixed a rare issue where the Load More button wouldn't be displayed after the last update if the Instagram account didn't have many posts
323
css/sb-instagram-admin.css CHANGED
@@ -41,6 +41,7 @@
41
margin: 15px 0;
42
border-bottom: 1px solid #ccc;
43
}
44
/* Instagram btn */
45
#sbi_admin .sbi_admin_btn{
46
display: block;
@@ -92,6 +93,9 @@
92
margin-left: 5px;
93
border-radius: 3px;
94
}
95
#sbi_admin .sbi_note{
96
font-size: 12px;
97
font-style: italic;
41
margin: 15px 0;
42
border-bottom: 1px solid #ccc;
43
}
44
+
45
/* Instagram btn */
46
#sbi_admin .sbi_admin_btn{
47
display: block;
93
margin-left: 5px;
94
border-radius: 3px;
95
}
96
+ #sbi_admin .sbi-customize-tab-opt .sbi-success {
97
+ top: 5px;
98
+ }
99
#sbi_admin .sbi_note{
100
font-size: 12px;
101
font-style: italic;
css/sb-instagram.css CHANGED
@@ -142,20 +142,41 @@
142
}
143
144
/* Videos */
145
- #sb_instagram .sbi_type_video .sbi_playbtn{
146
display: block !important;
147
position: absolute;
148
z-index: 0;
149
top: 50%;
150
left: 50%;
151
margin-top: -24px;
152
margin-left: -19px;
153
padding: 0;
154
font-size: 48px;
155
- color: #fff;
156
- color: rgba(255,255,255,0.9);
157
- font-style: normal !important;
158
- text-shadow: 0 0 8px rgba(0,0,0,0.8);
159
}
160
161
/* Loader */
@@ -344,8 +365,9 @@
344
filter: alpha(opacity=85);
345
opacity: 0.85;
346
}
347
- #sb_instagram #sbi_load .fa,
348
- #sb_instagram .sbi_follow_btn .fa{
349
margin-bottom: -1px;
350
margin-right: 7px;
351
font-size: 15px;
@@ -394,16 +416,28 @@
394
}
395
396
/* Medium */
397
- #sb_instagram.sbi_medium .sbi_playbtn{
398
- font-size: 23px;
399
margin-top: -12px;
400
margin-left: -9px;
401
}
402
- /* Small */
403
- #sb_instagram.sbi_small .sbi_playbtn{
404
font-size: 18px;
405
margin-top: -9px;
406
margin-left: -7px;
407
}
408
409
/* Media queries */
142
}
143
144
/* Videos */
145
+ #sb_instagram .sbi_type_video .sbi_playbtn,
146
+ #sb_instagram .sbi_type_carousel .sbi_playbtn,
147
+ .sbi_type_carousel .fa-clone,
148
+ #sb_instagram .sbi_type_carousel .svg-inline--fa.fa-play,
149
+ #sb_instagram .sbi_type_video .svg-inline--fa.fa-play{
150
display: block !important;
151
position: absolute;
152
z-index: 0;
153
+
154
+ color: #fff;
155
+ color: rgba(255,255,255,0.9);
156
+ font-style: normal !important;
157
+ text-shadow: 0 0 8px rgba(0,0,0,0.8);
158
+ }
159
+ #sb_instagram .sbi_type_video .sbi_playbtn,
160
+ #sb_instagram .sbi_type_carousel .sbi_playbtn {
161
+ z-index: 2;
162
top: 50%;
163
left: 50%;
164
margin-top: -24px;
165
margin-left: -19px;
166
padding: 0;
167
font-size: 48px;
168
+ }
169
+ #sb_instagram .sbi_type_carousel .fa-clone{
170
+ right: 12px;
171
+ top: 12px;
172
+ font-size: 24px;
173
+ text-shadow: 0 0 8px rgba(0,0,0,0.3);
174
+ }
175
+ .sbi_type_carousel svg.fa-clone,
176
+ #sb_instagram .sbi_type_video .svg-inline--fa.fa-play,
177
+ #sb_instagram .sbi_type_carousel .svg-inline--fa.fa-play{
178
+ -webkit-filter: drop-shadow( 0px 0px 2px rgba(0,0,0,.4) );
179
+ filter: drop-shadow( 0px 0px 2px rgba(0,0,0,.4) );
180
}
181
182
/* Loader */
365
filter: alpha(opacity=85);
366
opacity: 0.85;
367
}
368
+ #sb_instagram #sbi_load .fa-spinner,
369
+ #sb_instagram .sbi_follow_btn .fa,
370
+ #sb_instagram .sbi_follow_btn svg{
371
margin-bottom: -1px;
372
margin-right: 7px;
373
font-size: 15px;
416
}
417
418
/* Medium */
419
+ #sb_instagram.sbi_medium .sbi_playbtn,
420
+ #sb_instagram.sbi_medium .sbi_photo_wrap .svg-inline--fa.fa-play{
421
margin-top: -12px;
422
margin-left: -9px;
423
+ font-size: 23px;
424
}
425
+ #sb_instagram.sbi_medium .sbi_type_carousel .sbi_photo_wrap .fa-clone{
426
+ right: 8px;
427
+ top: 8px;
428
font-size: 18px;
429
+ }
430
+ /* Small */
431
+ #sb_instagram.sbi_small .sbi_playbtn,
432
+ #sb_instagram.sbi_small .sbi_photo_wrap .svg-inline--fa.fa-play{
433
margin-top: -9px;
434
margin-left: -7px;
435
+ font-size: 18px;
436
+ }
437
+ #sb_instagram.sbi_small .sbi_type_carousel .sbi_photo_wrap .fa-clone{
438
+ right: 5px;
439
+ top: 5px;
440
+ font-size: 12px;
441
}
442
443
/* Media queries */
css/sb-instagram.min.css CHANGED
@@ -1 +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;-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;vertical-align:top;zoom:1;*display:inline;padding:inherit!important;margin:0!important;text-decoration:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#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 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 .sbi_type_video .sbi_playbtn{display:block!important;position:absolute;z-index:0;top:50%;left:50%;margin-top:-24px;margin-left:-19px;padding:0;font-size:48px;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_loader{position:relative;left:50%;width:16px;height:16px;margin:10px 0 10px -8px;background:url(../img/loader.png) no-repeat}#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}#sb_instagram .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 .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 .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 .sbi_header_img_hover i{position:absolute;top:50%;left:50%;margin-top:-12px;margin-left:-12px;width:24px;height:24px;overflow:hidden;background:url(../img/small-logo.png) no-repeat 0 0}#sb_instagram .sbi_header_text{float:left;width:100%;padding-top:5px}#sb_instagram .sb_instagram_header a{text-decoration:none}#sb_instagram .sbi_header_text .sbi_bio,#sb_instagram .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}#sb_instagram .sb_instagram_header h3.sbi_no_bio{padding-top:9px!important}#sb_instagram .sbi_header_text img.emoji{margin-right:3px!important}#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 .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_load .sbi_follow_btn svg.fa-instagram{margin-right: 7px;}#sb_instagram .sbi_follow_btn.sbi_top{display:block;margin-bottom:5px}#sb_instagram .sbi_follow_btn a{background:#517fa4;color:#fff}#sb_instagram .sbi_follow_btn a:hover,#sb_instagram .sbi_follow_btn a:focus,#sb_instagram #sbi_load .sbi_load_btn:hover,#sb_instagram #sbi_load .sbi_load_btn:focus{filter:alpha(opacity=85);opacity:.85}#sb_instagram #sbi_load .fa,#sb_instagram .sbi_follow_btn .fa{margin-bottom:-1px;margin-right:7px;font-size:15px}#sb_instagram #sbi_load .sbi_follow_btn{margin-left:5px}#sb_instagram .sb_instagram_error{width:100%;text-align:center}#sbi_mod_error{display:none;border:1px solid #ddd;background:#eee;color:#333;margin:0;padding:10px 15px;font-size:13px;text-align:center;-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{font-size:23px;margin-top:-12px;margin-left:-9px}#sb_instagram.sbi_small .sbi_playbtn{font-size:18px;margin-top:-9px;margin-left:-7px}@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%}}
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;-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;vertical-align:top;zoom:1;*display:inline;padding:inherit!important;margin:0!important;text-decoration:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#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 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 .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:1;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{position:relative;left:50%;width:16px;height:16px;margin:10px 0 10px -8px;background:url(../img/loader.png) no-repeat}#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}#sb_instagram .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 .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 .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 .sbi_header_img_hover i{position:absolute;top:50%;left:50%;margin-top:-12px;margin-left:-12px;width:24px;height:24px;overflow:hidden;background:url(../img/small-logo.png) no-repeat 0 0}#sb_instagram .sbi_header_text{float:left;width:100%;padding-top:5px}#sb_instagram .sb_instagram_header a{text-decoration:none}#sb_instagram .sbi_header_text .sbi_bio,#sb_instagram .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}#sb_instagram .sb_instagram_header h3.sbi_no_bio{padding-top:9px!important}#sb_instagram .sbi_header_text img.emoji{margin-right:3px!important}#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 .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_load .sbi_follow_btn svg.fa-instagram{margin-right:7px}#sb_instagram .sbi_follow_btn.sbi_top{display:block;margin-bottom:5px}#sb_instagram .sbi_follow_btn a{background:#517fa4;color:#fff}#sb_instagram .sbi_follow_btn a:hover,#sb_instagram .sbi_follow_btn a:focus,#sb_instagram #sbi_load .sbi_load_btn:hover,#sb_instagram #sbi_load .sbi_load_btn:focus{filter:alpha(opacity=85);opacity:.85}#sb_instagram #sbi_load .fa-spinner,#sb_instagram .sbi_follow_btn .fa,#sb_instagram .sbi_follow_btn svg{margin-bottom:-1px;margin-right:7px;font-size:15px}#sb_instagram #sbi_load .sbi_follow_btn{margin-left:5px}#sb_instagram .sb_instagram_error{width:100%;text-align:center}#sbi_mod_error{display:none;border:1px solid #ddd;background:#eee;color:#333;margin:0;padding:10px 15px;font-size:13px;text-align:center;-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%}}
instagram-feed-admin.php CHANGED
@@ -33,6 +33,8 @@ function sb_instagram_settings_page() {
33
'sb_instagram_user_id' => '',
34
'sb_instagram_preserve_settings' => '',
35
'sb_instagram_ajax_theme' => false,
36
'sb_instagram_width' => '100',
37
'sb_instagram_width_unit' => '%',
38
'sb_instagram_feed_width_resp' => false,
@@ -61,6 +63,12 @@ function sb_instagram_settings_page() {
61
//Misc
62
'sb_instagram_custom_css' => '',
63
'sb_instagram_custom_js' => '',
64
'sb_instagram_disable_awesome' => false
65
);
66
//Save defaults in an array
@@ -72,7 +80,10 @@ function sb_instagram_settings_page() {
72
$sb_instagram_user_id = $options[ 'sb_instagram_user_id' ];
73
$sb_instagram_preserve_settings = $options[ 'sb_instagram_preserve_settings' ];
74
$sb_instagram_ajax_theme = $options[ 'sb_instagram_ajax_theme' ];
75
- $sb_instagram_width = $options[ 'sb_instagram_width' ];
76
$sb_instagram_width_unit = $options[ 'sb_instagram_width_unit' ];
77
$sb_instagram_feed_width_resp = $options[ 'sb_instagram_feed_width_resp' ];
78
$sb_instagram_height = $options[ 'sb_instagram_height' ];
@@ -101,7 +112,11 @@ function sb_instagram_settings_page() {
101
//Misc
102
$sb_instagram_custom_css = $options[ 'sb_instagram_custom_css' ];
103
$sb_instagram_custom_js = $options[ 'sb_instagram_custom_js' ];
104
- $sb_instagram_disable_awesome = $options[ 'sb_instagram_disable_awesome' ];
105
106
107
//Check nonce before saving data
@@ -118,11 +133,40 @@ function sb_instagram_settings_page() {
118
119
isset($_POST[ 'sb_instagram_preserve_settings' ]) ? $sb_instagram_preserve_settings = sanitize_text_field( $_POST[ 'sb_instagram_preserve_settings' ] ) : $sb_instagram_preserve_settings = '';
120
isset($_POST[ 'sb_instagram_ajax_theme' ]) ? $sb_instagram_ajax_theme = sanitize_text_field( $_POST[ 'sb_instagram_ajax_theme' ] ) : $sb_instagram_ajax_theme = '';
121
122
$options[ 'sb_instagram_at' ] = $sb_instagram_at;
123
$options[ 'sb_instagram_user_id' ] = $sb_instagram_user_id;
124
$options[ 'sb_instagram_preserve_settings' ] = $sb_instagram_preserve_settings;
125
$options[ 'sb_instagram_ajax_theme' ] = $sb_instagram_ajax_theme;
126
} //End config tab post
127
128
if( isset($_POST[ $sb_instagram_customize_hidden_field ]) && $_POST[ $sb_instagram_customize_hidden_field ] == 'Y' ) {
@@ -180,7 +224,11 @@ function sb_instagram_settings_page() {
180
//Misc
181
$sb_instagram_custom_css = $_POST[ 'sb_instagram_custom_css' ];
182
$sb_instagram_custom_js = $_POST[ 'sb_instagram_custom_js' ];
183
- isset($_POST[ 'sb_instagram_disable_awesome' ]) ? $sb_instagram_disable_awesome = sanitize_text_field( $_POST[ 'sb_instagram_disable_awesome' ] ) : $sb_instagram_disable_awesome = '';
184
185
$options[ 'sb_instagram_width' ] = $sb_instagram_width;
186
$options[ 'sb_instagram_width_unit' ] = $sb_instagram_width_unit;
@@ -211,7 +259,55 @@ function sb_instagram_settings_page() {
211
//Misc
212
$options[ 'sb_instagram_custom_css' ] = $sb_instagram_custom_css;
213
$options[ 'sb_instagram_custom_js' ] = $sb_instagram_custom_js;
214
- $options[ 'sb_instagram_disable_awesome' ] = $sb_instagram_disable_awesome;
215
216
} //End customize tab post
217
@@ -339,6 +435,20 @@ function sb_instagram_settings_page() {
339
<p class="sbi_tooltip"><?php _e("When navigating your site, if your theme uses Ajax to load content into your pages (meaning your page doesn't refresh) then check this setting. If you're not sure then please check with the theme author.", 'instagram-feed'); ?></p>
340
</td>
341
</tr>
342
</tbody>
343
</table>
344
@@ -1066,14 +1176,61 @@ function sb_instagram_settings_page() {
1066
</tr>
1067
</tbody>
1068
</table>
1069
<table class="form-table">
1070
<tbody>
1071
<tr valign="top">
1072
- <th scope="row"><label><?php _e("Disable Font Awesome", 'instagram-feed'); ?></label></th>
1073
<td>
1074
<input type="checkbox" name="sb_instagram_disable_awesome" id="sb_instagram_disable_awesome" <?php if($sb_instagram_disable_awesome == true) echo 'checked="checked"' ?> /> <?php _e( 'Yes', 'instagram-feed' ); ?>
1075
</td>
1076
</tr>
1077
</tbody>
1078
</table>
1079
@@ -1680,7 +1837,27 @@ function sbi_rating_notice_html() {
1680
1681
}
1682
}
1683
-
1684
/**
1685
* Called via ajax to automatically save access token and access token secret
1686
* retrieved with the big blue button
33
'sb_instagram_user_id' => '',
34
'sb_instagram_preserve_settings' => '',
35
'sb_instagram_ajax_theme' => false,
36
+ 'sb_instagram_cache_time' => 1,
37
+ 'sb_instagram_cache_time_unit' => 'hours',
38
'sb_instagram_width' => '100',
39
'sb_instagram_width_unit' => '%',
40
'sb_instagram_feed_width_resp' => false,
63
//Misc
64
'sb_instagram_custom_css' => '',
65
'sb_instagram_custom_js' => '',
66
+ 'sb_instagram_cron' => 'no',
67
+ 'check_api' => false,
68
+ 'sb_instagram_backup' => true,
69
+ 'enqueue_css_in_shortcode' => false,
70
+ 'sb_instagram_disable_mob_swipe' => false,
71
+ 'sbi_font_method' => 'svg',
72
'sb_instagram_disable_awesome' => false
73
);
74
//Save defaults in an array
80
$sb_instagram_user_id = $options[ 'sb_instagram_user_id' ];
81
$sb_instagram_preserve_settings = $options[ 'sb_instagram_preserve_settings' ];
82
$sb_instagram_ajax_theme = $options[ 'sb_instagram_ajax_theme' ];
83
+ $sb_instagram_cache_time = $options[ 'sb_instagram_cache_time' ];
84
+ $sb_instagram_cache_time_unit = $options[ 'sb_instagram_cache_time_unit' ];
85
+
86
+ $sb_instagram_width = $options[ 'sb_instagram_width' ];
87
$sb_instagram_width_unit = $options[ 'sb_instagram_width_unit' ];
88
$sb_instagram_feed_width_resp = $options[ 'sb_instagram_feed_width_resp' ];
89
$sb_instagram_height = $options[ 'sb_instagram_height' ];
112
//Misc
113
$sb_instagram_custom_css = $options[ 'sb_instagram_custom_css' ];
114
$sb_instagram_custom_js = $options[ 'sb_instagram_custom_js' ];
115
+ $sb_instagram_cron = $options[ 'sb_instagram_cron' ];
116
+ $check_api = $options[ 'check_api' ];
117
+ $sb_instagram_backup = $options[ 'sb_instagram_backup' ];
118
+ $sbi_font_method = $options[ 'sbi_font_method' ];
119
+ $sb_instagram_disable_awesome = $options[ 'sb_instagram_disable_awesome' ];
120
121
122
//Check nonce before saving data
133
134
isset($_POST[ 'sb_instagram_preserve_settings' ]) ? $sb_instagram_preserve_settings = sanitize_text_field( $_POST[ 'sb_instagram_preserve_settings' ] ) : $sb_instagram_preserve_settings = '';
135
isset($_POST[ 'sb_instagram_ajax_theme' ]) ? $sb_instagram_ajax_theme = sanitize_text_field( $_POST[ 'sb_instagram_ajax_theme' ] ) : $sb_instagram_ajax_theme = '';
136
+ isset($_POST[ 'sb_instagram_cache_time' ]) ? $sb_instagram_cache_time = sanitize_text_field( $_POST[ 'sb_instagram_cache_time' ] ) : $sb_instagram_cache_time = '';
137
+ isset($_POST[ 'sb_instagram_cache_time_unit' ]) ? $sb_instagram_cache_time_unit = sanitize_text_field( $_POST[ 'sb_instagram_cache_time_unit' ] ) : $sb_instagram_cache_time_unit = '';
138
139
$options[ 'sb_instagram_at' ] = $sb_instagram_at;
140
$options[ 'sb_instagram_user_id' ] = $sb_instagram_user_id;
141
$options[ 'sb_instagram_preserve_settings' ] = $sb_instagram_preserve_settings;
142
$options[ 'sb_instagram_ajax_theme' ] = $sb_instagram_ajax_theme;
143
+
144
+ $options[ 'sb_instagram_cache_time' ] = $sb_instagram_cache_time;
145
+ $options[ 'sb_instagram_cache_time_unit' ] = $sb_instagram_cache_time_unit;
146
+
147
+ //Delete all SBI transients
148
+ global $wpdb;
149
+ $table_name = $wpdb->prefix . "options";
150
+ $wpdb->query( "
151
+ DELETE
152
+ FROM $table_name
153
+ WHERE `option_name` LIKE ('%\_transient\_sbi\_%')
154
+ " );
155
+ $wpdb->query( "
156
+ DELETE
157
+ FROM $table_name
158
+ WHERE `option_name` LIKE ('%\_transient\_timeout\_sbi\_%')
159
+ " );
160
+ $wpdb->query( "
161
+ DELETE
162
+ FROM $table_name
163
+ WHERE `option_name` LIKE ('%\_transient\_&sbi\_%')
164
+ " );
165
+ $wpdb->query( "
166
+ DELETE
167
+ FROM $table_name
168
+ WHERE `option_name` LIKE ('%\_transient\_timeout\_&sbi\_%')
169
+ " );
170
} //End config tab post
171
172
if( isset($_POST[ $sb_instagram_customize_hidden_field ]) && $_POST[ $sb_instagram_customize_hidden_field ] == 'Y' ) {
224
//Misc
225
$sb_instagram_custom_css = $_POST[ 'sb_instagram_custom_css' ];
226
$sb_instagram_custom_js = $_POST[ 'sb_instagram_custom_js' ];
227
+ if (isset($_POST[ 'sb_instagram_cron' ]) ) $sb_instagram_cron = $_POST[ 'sb_instagram_cron' ];
228
+ isset($_POST[ 'check_api' ]) ? $check_api = $_POST[ 'check_api' ] : $check_api = '';
229
+ isset($_POST[ 'sb_instagram_backup' ]) ? $sb_instagram_backup = $_POST[ 'sb_instagram_backup' ] : $sb_instagram_backup = '';
230
+ isset($_POST[ 'sbi_font_method' ]) ? $sbi_font_method = $_POST[ 'sbi_font_method' ] : $sbi_font_method = 'svg';
231
+ isset($_POST[ 'sb_instagram_disable_awesome' ]) ? $sb_instagram_disable_awesome = sanitize_text_field( $_POST[ 'sb_instagram_disable_awesome' ] ) : $sb_instagram_disable_awesome = '';
232
233
$options[ 'sb_instagram_width' ] = $sb_instagram_width;
234
$options[ 'sb_instagram_width_unit' ] = $sb_instagram_width_unit;
259
//Misc
260
$options[ 'sb_instagram_custom_css' ] = $sb_instagram_custom_css;
261
$options[ 'sb_instagram_custom_js' ] = $sb_instagram_custom_js;
262
+ $options[ 'sb_instagram_cron' ] = $sb_instagram_cron;
263
+ $options[ 'check_api' ] = $check_api;
264
+ $options['sb_instagram_backup'] = $sb_instagram_backup;
265
+ $options['sbi_font_method'] = $sbi_font_method;
266
+ $options[ 'sb_instagram_disable_awesome' ] = $sb_instagram_disable_awesome;
267
+
268
+ //Delete all SBI transients
269
+ global $wpdb;
270
+ $table_name = $wpdb->prefix . "options";
271
+ $wpdb->query( "
272
+ DELETE
273
+ FROM $table_name
274
+ WHERE `option_name` LIKE ('%\_transient\_sbi\_%')
275
+ " );
276
+ $wpdb->query( "
277
+ DELETE
278
+ FROM $table_name
279
+ WHERE `option_name` LIKE ('%\_transient\_timeout\_sbi\_%')
280
+ " );
281
+ $wpdb->query( "
282
+ DELETE
283
+ FROM $table_name
284
+ WHERE `option_name` LIKE ('%\_transient\_&sbi\_%')
285
+ " );
286
+ $wpdb->query( "
287
+ DELETE
288
+ FROM $table_name
289
+ WHERE `option_name` LIKE ('%\_transient\_timeout\_&sbi\_%')
290
+ " );
291
+
292
+ if( $sb_instagram_cron == 'no' ) wp_clear_scheduled_hook('sb_instagram_cron_job');
293
+
294
+ //Run cron when Misc settings are saved
295
+ if( $sb_instagram_cron == 'yes' ){
296
+ //Clear the existing cron event
297
+ wp_clear_scheduled_hook('sb_instagram_cron_job');
298
+
299
+ $sb_instagram_cache_time = $options[ 'sb_instagram_cache_time' ];
300
+ $sb_instagram_cache_time_unit = $options[ 'sb_instagram_cache_time_unit' ];
301
+
302
+ //Set the event schedule based on what the caching time is set to
303
+ $sb_instagram_cron_schedule = 'hourly';
304
+ if( $sb_instagram_cache_time_unit == 'hours' && $sb_instagram_cache_time > 5 ) $sb_instagram_cron_schedule = 'twicedaily';
305
+ if( $sb_instagram_cache_time_unit == 'days' ) $sb_instagram_cron_schedule = 'daily';
306
+
307
+ wp_schedule_event(time(), $sb_instagram_cron_schedule, 'sb_instagram_cron_job');
308
+
309
+ sb_instagram_clear_page_caches();
310
+ }
311
312
} //End customize tab post
313
435
<p class="sbi_tooltip"><?php _e("When navigating your site, if your theme uses Ajax to load content into your pages (meaning your page doesn't refresh) then check this setting. If you're not sure then please check with the theme author.", 'instagram-feed'); ?></p>
436
</td>
437
</tr>
438
+
439
+ <tr valign="top">
440
+ <th scope="row"><label><?php _e('Check for new posts every'); ?></label></th>
441
+ <td>
442
+ <input name="sb_instagram_cache_time" type="text" value="<?php esc_attr_e( $sb_instagram_cache_time ); ?>" size="4" />
443
+ <select name="sb_instagram_cache_time_unit">
444
+ <option value="minutes" <?php if($sb_instagram_cache_time_unit == "minutes") echo 'selected="selected"' ?> ><?php _e('Minutes'); ?></option>
445
+ <option value="hours" <?php if($sb_instagram_cache_time_unit == "hours") echo 'selected="selected"' ?> ><?php _e('Hours'); ?></option>
446
+ <option value="days" <?php if($sb_instagram_cache_time_unit == "days") echo 'selected="selected"' ?> ><?php _e('Days'); ?></option>
447
+ </select>
448
+ <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
449
+ <p class="sbi_tooltip"><?php _e('Your Instagram posts are temporarily cached by the plugin in your WordPress database. You can choose how long the posts should be cached for. If you set the time to 1 hour then the plugin will clear the cache after that length of time and check Instagram for posts again.'); ?></p>
450
+ </td>
451
+ </tr>
452
</tbody>
453
</table>
454
1176
</tr>
1177
</tbody>
1178
</table>
1179
+ <table class="form-table">
1180
+ <tbody>
1181
+ <tr valign="top">
1182
+ <th scope="row"><label><?php _e('Cache error API recheck'); ?></label></th>
1183
+ <td>
1184
+ <input type="checkbox" name="check_api" id="sb_instagram_check_api" <?php if($check_api == true) echo 'checked="checked"' ?> />
1185
+ <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
1186
+ <p class="sbi_tooltip"><?php _e("If your site uses caching, minification, or JavaScript concatenation, this option can help prevent missing cache problems with the feed."); ?></p>
1187
+ </td>
1188
+ </tr>
1189
+ <tr valign="top">
1190
+ <th><label><?php _e("Enable Backup Caching"); ?></label></th>
1191
+ <td class="sbi-customize-tab-opt">
1192
+ <input name="sb_instagram_backup" type="checkbox" id="sb_instagram_backup" <?php if($sb_instagram_backup == true) echo "checked"; ?> />
1193
+ <input id="sbi_clear_backups" class="button-secondary" type="submit" style="position: relative; top: -4px;" value="<?php esc_attr_e( 'Clear Backup Cache' ); ?>" />
1194
+ <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
1195
+ <p class="sbi_tooltip"><?php _e('Every feed will save a duplicate version of itself in the database to be used if the normal cache is not available.'); ?></p>
1196
+ </td>
1197
+ </tr>
1198
+ <tr>
1199
+ <th class="bump-left">
1200
+ <label for="sb_instagram_cron" class="bump-left"><?php _e("Force cache to clear on interval"); ?></label>
1201
+ </th>
1202
+ <td>
1203
+ <select name="sb_instagram_cron">
1204
+ <option value="unset" <?php if($sb_instagram_cron == "unset") echo 'selected="selected"' ?> ><?php _e(' - '); ?></option>
1205
+ <option value="yes" <?php if($sb_instagram_cron == "yes") echo 'selected="selected"' ?> ><?php _e('Yes'); ?></option>
1206
+ <option value="no" <?php if($sb_instagram_cron == "no") echo 'selected="selected"' ?> ><?php _e('No'); ?></option>
1207
+ </select>
1208
+
1209
+ <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
1210
+ <p class="sbi_tooltip"><?php _e("If you're experiencing an issue with the plugin not auto-updating then you can set this to 'Yes' to run a scheduled event behind the scenes which forces the plugin cache to clear on a regular basis and retrieve new data from Instagram."); ?></p>
1211
+ </td>
1212
+ </tr>
1213
+ </tbody>
1214
+ </table>
1215
<table class="form-table">
1216
<tbody>
1217
<tr valign="top">
1218
+ <th scope="row"><label><?php _e("Disable Icon Font", 'instagram-feed'); ?></label></th>
1219
<td>
1220
<input type="checkbox" name="sb_instagram_disable_awesome" id="sb_instagram_disable_awesome" <?php if($sb_instagram_disable_awesome == true) echo 'checked="checked"' ?> /> <?php _e( 'Yes', 'instagram-feed' ); ?>
1221
</td>
1222
</tr>
1223
+ <tr>
1224
+ <th scope="row"><label for="sbi_font_method"><?php _e("Icon Method"); ?></label></th>
1225
+ <td>
1226
+ <select name="sbi_font_method" id="sbi_font_method" class="default-text">
1227
+ <option value="svg" id="sbi-font_method" class="default-text" <?php if($sbi_font_method == 'svg') echo 'selected="selected"' ?>>SVG</option>
1228
+ <option value="fontfile" id="sbi-font_method" class="default-text" <?php if($sbi_font_method == 'fontfile') echo 'selected="selected"' ?>><?php _e("Font File"); ?></option>
1229
+ </select>
1230
+ <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
1231
+ <p class="sbi_tooltip"><?php _e("This plugin uses SVGs for all icons in the feed. Use this setting to switch to font icons."); ?></p>
1232
+ </td>
1233
+ </tr>
1234
</tbody>
1235
</table>
1236
1837
1838
}
1839
}
1840
+ function sb_instagram_clear_page_caches() {
1841
+ if ( isset( $GLOBALS['wp_fastest_cache'] ) && method_exists( $GLOBALS['wp_fastest_cache'], 'deleteCache' ) ){
1842
+ /* Clear WP fastest cache*/
1843
+ $GLOBALS['wp_fastest_cache']->deleteCache();
1844
+ }
1845
+
1846
+ if ( function_exists( 'wp_cache_clear_cache' ) ) {
1847
+ wp_cache_clear_cache();
1848
+ }
1849
+
1850
+ if ( class_exists('W3_Plugin_TotalCacheAdmin') ) {
1851
+ $plugin_totalcacheadmin = & w3_instance('W3_Plugin_TotalCacheAdmin');
1852
+
1853
+ $plugin_totalcacheadmin->flush_all();
1854
+ }
1855
+
1856
+ if ( class_exists( 'autoptimizeCache' ) ) {
1857
+ /* Clear autoptimize */
1858
+ autoptimizeCache::clearall();
1859
+ }
1860
+ }
1861
/**
1862
* Called via ajax to automatically save access token and access token secret
1863
* retrieved with the big blue button
instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Instagram Feed
4
Plugin URI: https://smashballoon.com/instagram-feed
5
Description: Display beautifully clean, customizable, and responsive Instagram feeds
6
- Version: 1.6.2
7
Author: Smash Balloon
8
Author URI: https://smashballoon.com/
9
License: GPLv2 or later
@@ -23,7 +23,7 @@ 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
26
- define( 'SBIVER', '1.6.2' );
27
28
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
29
@@ -67,7 +67,9 @@ function display_instagram($atts, $content = null) {
67
'showbio' => isset($options[ 'sb_instagram_show_bio' ]) ? $options[ 'sb_instagram_show_bio' ] : '',
68
'headercolor' => isset($options[ 'sb_instagram_header_color' ]) ? $options[ 'sb_instagram_header_color' ] : '',
69
'class' => '',
70
- 'ajaxtheme' => isset($options[ 'sb_instagram_ajax_theme' ]) ? $options[ 'sb_instagram_ajax_theme' ] : ''
71
), $atts);
72
73
@@ -113,6 +115,9 @@ function display_instagram($atts, $content = null) {
113
if( $atts[ 'showheader' ] === 'false' ) $sb_instagram_show_header = false;
114
$sb_instagram_header_color = str_replace('#', '', $atts['headercolor']);
115
116
$sb_instagram_show_bio = $atts['showbio'];
117
( $sb_instagram_show_bio == 'on' || $sb_instagram_show_bio == 'true' || $sb_instagram_show_bio ) ? $sb_instagram_show_bio = 'true' : $sb_instagram_show_bio = 'false';
118
if( $atts[ 'showbio' ] === 'false' ) $sb_instagram_show_bio = false;
@@ -121,8 +126,6 @@ function display_instagram($atts, $content = null) {
121
$sb_instagram_follow_btn_text = __( $atts['followtext'], 'instagram-feed' );
122
$sb_instagram_load_btn_text = __( $atts['buttontext'], 'instagram-feed' );
123
124
- //As this is a new option in the update then set it to be true if it doesn't exist yet
125
- if ( !array_key_exists( 'sb_instagram_show_bio', $options ) ) $sb_instagram_show_bio = 'true';
126
//Load more button
127
$sb_instagram_show_btn = $atts['showbutton'];
128
( $sb_instagram_show_btn == 'on' || $sb_instagram_show_btn == 'true' || $sb_instagram_show_btn == true ) ? $sb_instagram_show_btn = true : $sb_instagram_show_btn = false;
@@ -147,14 +150,104 @@ function display_instagram($atts, $content = null) {
147
if ( !empty($sb_instagram_follow_btn_text_color) ) $sb_instagram_follow_btn_styles .= 'color: #'.$sb_instagram_follow_btn_text_color.';';
148
$sb_instagram_follow_btn_styles .= '"';
149
//Follow button HTML
150
- $sb_instagram_follow_btn_html = '<div class="sbi_follow_btn"><a href="https://instagram.com/" '.$sb_instagram_follow_btn_styles.' target="_blank"><i class="fa fab fa-instagram"></i>'.esc_html( stripslashes( $sb_instagram_follow_btn_text ) ).'</a></div>';
151
-
152
153
//Mobile
154
$sb_instagram_disable_mobile = $atts['disablemobile'];
155
- ( $sb_instagram_disable_mobile == 'on' || $sb_instagram_disable_mobile == 'true' || $sb_instagram_disable_mobile == true ) ? $sb_instagram_disable_mobile = ' sbi_disable_mobile' : $sb_instagram_disable_mobile = '';
156
- if( $atts[ 'disablemobile' ] === 'false' ) $sb_instagram_disable_mobile = '';
157
158
//Class
159
!empty( $atts['class'] ) ? $sbi_class = ' ' . trim($atts['class']) : $sbi_class = '';
160
@@ -170,7 +263,7 @@ function display_instagram($atts, $content = null) {
170
if ( !empty($sb_instagram_height) ) $sb_instagram_content .= ' sbi_fixed_height ';
171
$sb_instagram_content .= ' sbi_col_' . trim($sb_instagram_cols);
172
if ( $sb_instagram_width_resp ) $sb_instagram_content .= ' sbi_width_resp';
173
- $sb_instagram_content .= '" '.$sb_instagram_styles .' data-id="' . $sb_instagram_user_id . '" data-num="' . trim($atts['num']) . '" data-res="' . trim($atts['imageres']) . '" data-cols="' . trim($sb_instagram_cols) . '" data-options=\'{&quot;sortby&quot;: &quot;'.$atts['sortby'].'&quot;, &quot;showbio&quot;: &quot;'.$sb_instagram_show_bio.'&quot;, &quot;headercolor&quot;: &quot;'.$sb_instagram_header_color.'&quot;, &quot;imagepadding&quot;: &quot;'.$sb_instagram_image_padding.'&quot;}\'>';
174
175
//Header
176
if( $sb_instagram_show_header ) $sb_instagram_content .= '<div class="sb_instagram_header" style="padding: '.(2*intval($sb_instagram_image_padding)) . $sb_instagram_image_padding_unit .'; padding-bottom: 0;"></div>';
@@ -226,6 +319,229 @@ function display_instagram($atts, $content = null) {
226
//Allows shortcodes in theme
227
add_filter('widget_text', 'do_shortcode');
228
229
//Enqueue stylesheet
230
add_action( 'wp_enqueue_scripts', 'sb_instagram_styles_enqueue' );
231
function sb_instagram_styles_enqueue() {
@@ -250,9 +566,15 @@ function sb_instagram_scripts_enqueue() {
250
251
//Access token
252
isset($sb_instagram_settings[ 'sb_instagram_at' ]) ? $sb_instagram_at = trim($sb_instagram_settings['sb_instagram_at']) : $sb_instagram_at = '';
253
254
$data = array(
255
- 'sb_instagram_at' => $sb_instagram_at
256
);
257
258
isset($sb_instagram_settings[ 'sb_instagram_ajax_theme' ]) ? $sb_instagram_ajax_theme = trim($sb_instagram_settings['sb_instagram_ajax_theme']) : $sb_instagram_ajax_theme = '';
@@ -286,7 +608,7 @@ function sb_instagram_custom_css() {
286
287
if( current_user_can( 'manage_options' ) ){
288
echo "\r\n";
289
- echo "#sbi_mod_error{ display: block; }";
290
}
291
292
if( $sbi_show_css ) echo "\r\n";
@@ -298,25 +620,30 @@ function sb_instagram_custom_css() {
298
//Custom JS
299
add_action( 'wp_footer', 'sb_instagram_custom_js' );
300
function sb_instagram_custom_js() {
301
- $options = get_option('sb_instagram_settings');
302
- isset($options[ 'sb_instagram_custom_js' ]) ? $sb_instagram_custom_js = trim($options['sb_instagram_custom_js']) : $sb_instagram_custom_js = '';
303
-
304
- if( !empty($sb_instagram_custom_js) ) echo '<!-- Instagram Feed JS -->';
305
- if( !empty($sb_instagram_custom_js) ) echo "\r\n";
306
- if( !empty($sb_instagram_custom_js) ) echo '<script type="text/javascript">';
307
- if( !empty($sb_instagram_custom_js) ) echo "\r\n";
308
- if( !empty($sb_instagram_custom_js) ) echo "jQuery( document ).ready(function($) {";
309
- if( !empty($sb_instagram_custom_js) ) echo "\r\n";
310
- if( !empty($sb_instagram_custom_js) ) echo "window.sbi_custom_js = function(){";
311
- if( !empty($sb_instagram_custom_js) ) echo "\r\n";
312
- if( !empty($sb_instagram_custom_js) ) echo stripslashes($sb_instagram_custom_js);
313
- if( !empty($sb_instagram_custom_js) ) echo "\r\n";
314
- if( !empty($sb_instagram_custom_js) ) echo "}";
315
- if( !empty($sb_instagram_custom_js) ) echo "\r\n";
316
- if( !empty($sb_instagram_custom_js) ) echo "});";
317
- if( !empty($sb_instagram_custom_js) ) echo "\r\n";
318
- if( !empty($sb_instagram_custom_js) ) echo '</script>';
319
- if( !empty($sb_instagram_custom_js) ) echo "\r\n";
320
}
321
322
if ( ! function_exists( 'sb_remove_style_version' ) ) {
@@ -362,5 +689,23 @@ function sb_instagram_uninstall()
362
363
//Settings
364
delete_option( 'sb_instagram_settings' );
365
}
366
register_uninstall_hook( __FILE__, 'sb_instagram_uninstall' );
3
Plugin Name: Instagram Feed
4
Plugin URI: https://smashballoon.com/instagram-feed
5
Description: Display beautifully clean, customizable, and responsive Instagram feeds
6
+ Version: 1.7
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
26
+ define( 'SBIVER', '1.7' );
27
28
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
29
67
'showbio' => isset($options[ 'sb_instagram_show_bio' ]) ? $options[ 'sb_instagram_show_bio' ] : '',
68
'headercolor' => isset($options[ 'sb_instagram_header_color' ]) ? $options[ 'sb_instagram_header_color' ] : '',
69
'class' => '',
70
+ 'ajaxtheme' => isset($options[ 'sb_instagram_ajax_theme' ]) ? $options[ 'sb_instagram_ajax_theme' ] : '',
71
+ 'cachetime' => isset($options[ 'sb_instagram_cache_time' ]) ? $options[ 'sb_instagram_cache_time' ] : '',
72
+ 'media' => isset($options[ 'sb_instagram_media_type' ]) ? $options[ 'sb_instagram_media_type' ] : ''
73
), $atts);
74
75
115
if( $atts[ 'showheader' ] === 'false' ) $sb_instagram_show_header = false;
116
$sb_instagram_header_color = str_replace('#', '', $atts['headercolor']);
117
118
+ //As this is a new option in the update then set it to be true if it doesn't exist yet
119
+ if ( !array_key_exists( 'sb_instagram_show_bio', $options ) ) $sb_instagram_show_bio = 'true';
120
+
121
$sb_instagram_show_bio = $atts['showbio'];
122
( $sb_instagram_show_bio == 'on' || $sb_instagram_show_bio == 'true' || $sb_instagram_show_bio ) ? $sb_instagram_show_bio = 'true' : $sb_instagram_show_bio = 'false';
123
if( $atts[ 'showbio' ] === 'false' ) $sb_instagram_show_bio = false;
126
$sb_instagram_follow_btn_text = __( $atts['followtext'], 'instagram-feed' );
127
$sb_instagram_load_btn_text = __( $atts['buttontext'], 'instagram-feed' );
128
129
//Load more button
130
$sb_instagram_show_btn = $atts['showbutton'];
131
( $sb_instagram_show_btn == 'on' || $sb_instagram_show_btn == 'true' || $sb_instagram_show_btn == true ) ? $sb_instagram_show_btn = true : $sb_instagram_show_btn = false;
150
if ( !empty($sb_instagram_follow_btn_text_color) ) $sb_instagram_follow_btn_styles .= 'color: #'.$sb_instagram_follow_btn_text_color.';';
151
$sb_instagram_follow_btn_styles .= '"';
152
//Follow button HTML
153
+ $sb_instagram_follow_btn_html = '<div class="sbi_follow_btn"><a href="https://www.instagram.com/" '.$sb_instagram_follow_btn_styles.' target="_blank"><i class="fa fab fa-instagram"></i>'.esc_html( stripslashes( $sb_instagram_follow_btn_text ) ).'</a></div>';
154
155
//Mobile
156
$sb_instagram_disable_mobile = $atts['disablemobile'];
157
+ ( $sb_instagram_disable_mobile == 'on' || $sb_instagram_disable_mobile == 'true' || $sb_instagram_disable_mobile == true ) ? $sb_instagram_disable_mobile = ' sbi_disable_mobile' : $sb_instagram_disable_mobile = ' sbi_mob_col_auto';
158
+ if( $atts[ 'disablemobile' ] === 'false' ) $sb_instagram_disable_mobile = ' sbi_mob_col_auto';
159
+
160
+ //Caching
161
+ $sb_instagram_cache_time = trim($atts['cachetime']);
162
+ if ( !array_key_exists( 'sb_instagram_cache_time', $options ) || $sb_instagram_cache_time == '' ) $sb_instagram_cache_time = '1';
163
+ ($sb_instagram_cache_time == 0 || $sb_instagram_cache_time == '0') ? $sb_instagram_disable_cache = 'true' : $sb_instagram_disable_cache = 'false';
164
+ //Figure out how long the first part of the caching string should be
165
+ $sbi_cache_string_include_length = 0;
166
+ $sbi_cache_string_exclude_length = 0;
167
+ $sbi_cache_string_length = 40 - min($sbi_cache_string_include_length + $sbi_cache_string_exclude_length, 20);
168
+
169
+ //Create the first part of the caching string
170
+ $sbi_transient_name = 'sbi_';
171
+ $sb_instagram_white_list = '';
172
+ $sb_instagram_show_users = '';
173
+ $sbi_transient_name .= substr( $sb_instagram_white_list, 0, 3 ) . substr( $sb_instagram_show_users, 0, 3 );
174
+
175
+ $feed_is_filtered = ($sb_instagram_white_list !== '' || $sb_instagram_show_users !== '');
176
+ //Media type
177
+ $sb_instagram_media_type = $atts['media'];
178
+ if( !isset($sb_instagram_media_type) || empty($sb_instagram_media_type) ) $sb_instagram_media_type = 'all';
179
+
180
+ if ( $sb_instagram_media_type !== 'all' ) {
181
+ $sbi_transient_name .= substr( $sb_instagram_media_type, 0, 1 );
182
+ }
183
+ if( true ) $sbi_transient_name .= substr( str_replace(str_split(', '), '', $sb_instagram_user_id), 0, $sbi_cache_string_length); //Remove commas and spaces and limit chars
184
+
185
+ //Find the length of the string so far, and then however many chars are left we can use this for filters
186
+ $sbi_cache_string_length = strlen($sbi_transient_name);
187
+ $sbi_cache_string_length = 44 - intval($sbi_cache_string_length);
188
+
189
+ //Add both parts of the caching string together and make sure it doesn't exceed 45
190
+ $sbi_transient_name = substr($sbi_transient_name, 0, 45);
191
+ // delete_transient($sbi_transient_name);
192
+
193
+ //Check whether the cache transient exists in the database
194
+ ( false === ( $sbi_cache_exists = get_transient( $sbi_transient_name ) ) ) ? $sbi_cache_exists = false : $sbi_cache_exists = true;
195
+ ($sbi_cache_exists) ? $sbi_cache_exists = 'true' : $sbi_cache_exists = 'false';
196
+
197
+ $sbiHeaderCache = 'false';
198
+ //If it's a user then add the header cache check to the feed
199
+ $sb_instagram_user_id_arr = explode(',', $sb_instagram_user_id);
200
+ $sbi_header_transient_name = 'sbi_header_' . trim($sb_instagram_user_id_arr[0]);
201
+ $sbi_header_transient_name = substr($sbi_header_transient_name, 0, 45);
202
+
203
+ //Check for the header cache
204
+ ( false === ( $sbi_header_cache_exists = get_transient( $sbi_header_transient_name ) ) ) ? $sbi_header_cache_exists = false : $sbi_header_cache_exists = true;
205
206
+ ($sbi_header_cache_exists) ? $sbiHeaderCache = 'true' : $sbiHeaderCache = 'false';
207
+
208
+ if ( isset( $options['check_api'] ) && ( $options['check_api'] === 'on' || $options['check_api']) && ( !isset( $options['sb_instagram_cache_time'] ) || ( isset( $options['sb_instagram_cache_time'] ) && (int)$options['sb_instagram_cache_time'] > 0 ) ) ) {
209
+ $sbi_cache_exists = 'true';
210
+ $sbiHeaderCache = 'true';
211
+ }
212
+
213
+ $use_backup_json = '';
214
+ $use_header_backup = false;
215
+ $always_use_backup = isset( $atts['permanent'] ) ? ($atts['permanent'] === 'true') : false;
216
+ $backups_enabled = isset( $options['sb_instagram_backup'] ) ? $options['sb_instagram_backup'] !== '' : true;
217
+ if ( !$always_use_backup ) {
218
+ $always_use_backup = false;
219
+ }
220
+ $still_using_backup = false;
221
+ if ( $sbiHeaderCache == 'false' && true ) {
222
+ $still_using_backup = get_transient( '&'.$sbi_header_transient_name, false );
223
+ }
224
+
225
+ if ( ($sbiHeaderCache == 'false' && $still_using_backup) || ($always_use_backup && isset( $sbi_header_transient_name )) ) {
226
+ $use_header_backup = sbi_should_use_backup_cache( $options['sb_instagram_at'], $sbi_header_transient_name, $feed_is_filtered, $always_use_backup, $sb_instagram_white_list, $backups_enabled);
227
+ if ( $use_header_backup ) {
228
+ $sbiHeaderCache = 'true';
229
+ $use_backup_json = ', &quot;useBackup&quot;: &quot;header&quot;';
230
+ }
231
+ }
232
+
233
+ $still_using_backup = false;
234
+ if ( $sbi_cache_exists == 'false' ) {
235
+ $still_using_backup = get_transient( '&'.$sbi_transient_name, false );
236
+ }
237
+ if ( ($sbi_cache_exists == 'false' && $still_using_backup) || $always_use_backup ) {
238
+ $use_feed_backup = sbi_should_use_backup_cache( $options['sb_instagram_at'], $sbi_transient_name, $feed_is_filtered, $always_use_backup, $sb_instagram_white_list, $backups_enabled );
239
+
240
+ if ( $use_feed_backup ) {
241
+ $sbi_cache_exists = 'true';
242
+ if ( $use_header_backup ) {
243
+ $use_backup_json = ', &quot;useBackup&quot;: &quot;header,feed&quot;';
244
+ } else {
245
+ $use_backup_json = ', &quot;useBackup&quot;: &quot;feed&quot;';
246
+ }
247
+ }
248
+ }
249
+
250
+ /* END CACHING */
251
//Class
252
!empty( $atts['class'] ) ? $sbi_class = ' ' . trim($atts['class']) : $sbi_class = '';
253
263
if ( !empty($sb_instagram_height) ) $sb_instagram_content .= ' sbi_fixed_height ';
264
$sb_instagram_content .= ' sbi_col_' . trim($sb_instagram_cols);
265
if ( $sb_instagram_width_resp ) $sb_instagram_content .= ' sbi_width_resp';
266
+ $sb_instagram_content .= '" '.$sb_instagram_styles .' data-id="' . $sb_instagram_user_id . '" data-num="' . trim($atts['num']) . '" data-res="' . trim($atts['imageres']) . '" data-cols="' . trim($sb_instagram_cols) . '" data-options=\'{&quot;sortby&quot;: &quot;'.$atts['sortby'].'&quot;, &quot;showbio&quot;: &quot;'.$sb_instagram_show_bio.'&quot;, &quot;headercolor&quot;: &quot;'.$sb_instagram_header_color.'&quot;, &quot;imagepadding&quot;: &quot;'.$sb_instagram_image_padding.'&quot;, &quot;disablecache&quot;: &quot;'.$sb_instagram_disable_cache.'&quot;, &quot;sbiCacheExists&quot;: &quot;'.$sbi_cache_exists.'&quot;, &quot;sbiHeaderCache&quot;: &quot;'.$sbiHeaderCache.'&quot;'.$use_backup_json.'}\'>';
267
268
//Header
269
if( $sb_instagram_show_header ) $sb_instagram_content .= '<div class="sb_instagram_header" style="padding: '.(2*intval($sb_instagram_image_padding)) . $sb_instagram_image_padding_unit .'; padding-bottom: 0;"></div>';
319
//Allows shortcodes in theme
320
add_filter('widget_text', 'do_shortcode');
321
322
+ function sbi_should_use_backup_cache( $token, $cache_name, $is_filtered, $always_use_backup = false, $white_list_id = '', $backups_enabled = true ) {
323
+ if ( ! $backups_enabled ) {
324
+ return false;
325
+ }
326
+
327
+ $expired_tokens = get_option( 'sb_expired_tokens', array() );
328
+ $still_using_backup = get_transient( '&'.$cache_name, false );
329
+ $backup_cache_exists = get_option( '!' . $cache_name );
330
+ $white_list_updated = get_transient( 'sb_wlupdated_'.$white_list_id );
331
+
332
+ if ( $always_use_backup ) {
333
+ if ( !$backup_cache_exists || $white_list_updated ) {
334
+ return false;
335
+ }
336
+ return true;
337
+ } elseif ( $white_list_updated == 'true' ) {
338
+ return false;
339
+ }
340
+
341
+ if ( in_array( $token, $expired_tokens, true ) && $backup_cache_exists ) {
342
+
343
+ if ( !strpos( $cache_name, '_header' ) ) {
344
+ echo '<div id="sbi_mod_error">';
345
+ echo '<p><b>' . __( 'Error: Access Token is not valid or has expired.', 'instagram-feed' ) . ' ' . __( 'Feed will not update.', 'instagram-feed' ) . '</b><br /><span>' . __(' This error message is only visible to WordPress admins</span>', 'instagram-feed' );
346
+ echo '<p>' . __( 'There\'s an issue with the Instagram Access Token that you are using. Please obtain a new Access Token on the plugin\'s Settings page.<br />If you continue to have an issue with your Access Token then please see <a href="https://smashballoon.com/my-instagram-access-token-keep-expiring/" target="_blank">this FAQ</a> for more information.', 'instagram-feed' );
347
+ echo '</div>';
348
+ }
349
+
350
+ return true;
351
+ } elseif ( $still_using_backup && $backup_cache_exists ) {
352
+ return true;
353
+ }
354
+
355
+ return false;
356
+ }
357
+
358
+ function sbi_cache_photos() {
359
+ $sb_instagram_settings = get_option('sb_instagram_settings');
360
+
361
+ //If the caching time doesn't exist in the database then set it to be 1 hour
362
+ ( !array_key_exists( 'sb_instagram_cache_time', $sb_instagram_settings ) ) ? $sb_instagram_cache_time = 1 : $sb_instagram_cache_time = $sb_instagram_settings['sb_instagram_cache_time'];
363
+ ( !array_key_exists( 'sb_instagram_cache_time_unit', $sb_instagram_settings ) ) ? $sb_instagram_cache_time_unit = 'minutes' : $sb_instagram_cache_time_unit = $sb_instagram_settings['sb_instagram_cache_time_unit'];
364
+
365
+ //Calculate the cache time in seconds
366
+ if($sb_instagram_cache_time_unit == 'minutes') $sb_instagram_cache_time_unit = 60;
367
+ if($sb_instagram_cache_time_unit == 'hours') $sb_instagram_cache_time_unit = 60*60;
368
+ if($sb_instagram_cache_time_unit == 'days') $sb_instagram_cache_time_unit = 60*60*24;
369
+ $cache_seconds = intval($sb_instagram_cache_time) * intval($sb_instagram_cache_time_unit);
370
+
371
+ $transient_name = $_POST['transientName'];
372
+ if ( is_array( $transient_name ) ) {
373
+ $transient_name = isset( $transient_name['feed'] ) ? sanitize_text_field( $transient_name['feed'] ) : 'sbi_other';
374
+ }
375
+
376
+ if ( strpos( $_POST['photos'], "%7B%22" ) === 0
377
+ && ( strpos( "%22standard_resolution%22", $_POST['photos'] ) && strpos( "%22https://scontent.cdninstagram.com", $_POST['photos'] ) || ! strpos( "%22standard_resolution%22", $_POST['photos'] ) ) ) {
378
+
379
+ $stripped_json_string = wp_strip_all_tags( $_POST['photos'] );
380
+ set_transient( $transient_name, $stripped_json_string, $cache_seconds );
381
+
382
+ $backups_enabled = isset( $sb_instagram_settings['sb_instagram_backup'] ) ? $sb_instagram_settings['sb_instagram_backup'] !== '' : true;
383
+
384
+ if ( $backups_enabled ) {
385
+ if ( strlen( $stripped_json_string ) > 1999 && strpos( $transient_name, 'sbi_header_' ) !== 0 ) {
386
+ update_option( '!'.$transient_name, $stripped_json_string, false );
387
+ } elseif ( strpos( $transient_name, 'sbi_header_' ) === 0 ) {
388
+ update_option( '!'.$transient_name, $stripped_json_string, false );
389
+ }
390
+ }
391
+
392
+ }
393
+
394
+ if ( strlen( $stripped_json_string ) < 2000 && strpos( $transient_name, 'sbi_header_' ) !== 0 && get_option( '!'.$transient_name ) ) {
395
+ echo 'too much filtering';
396
+ }
397
+
398
+ }
399
+ add_action('wp_ajax_cache_photos', 'sbi_cache_photos');
400
+ add_action('wp_ajax_nopriv_cache_photos', 'sbi_cache_photos');
401
+
402
+ function sbi_set_expired_token() {
403
+ $access_token = isset( $_POST['access_token'] ) ? sanitize_text_field( $_POST['access_token'] ) : false;
404
+
405
+ if ( $access_token !== false ) {
406
+ $expired_tokens = get_option( 'sb_expired_tokens', array() );
407
+ $expired_tokens[] = $access_token;
408
+
409
+ update_option( 'sb_expired_tokens', $expired_tokens, false );
410
+ sbi_set_use_backup();
411
+ }
412
+
413
+ die();
414
+ }
415
+ add_action('wp_ajax_sbi_set_expired_token', 'sbi_set_expired_token');
416
+ add_action('wp_ajax_nopriv_sbi_set_expired_token', 'sbi_set_expired_token');
417
+
418
+ function sbi_set_use_backup() {
419
+ $sb_instagram_settings = get_option('sb_instagram_settings');
420
+ $backups_enabled = isset( $sb_instagram_settings['sb_instagram_backup'] ) ? $sb_instagram_settings['sb_instagram_backup'] !== '' : true;
421
+ $context = isset( $_POST['context'] ) ? sanitize_text_field( $_POST['context'] ) : 'use_backup';
422
+
423
+ if ( $backups_enabled ) {
424
+ $transient_name = $_POST['transientName'];
425
+
426
+ if ( is_array( $transient_name ) ) {
427
+ $transient_name = isset( $transient_name['feed'] ) ? sanitize_text_field( $transient_name['feed'] ) : 'sbi_other';
428
+ }
429
+ $backup_exists = get_option( '!' . $transient_name, false );
430
+
431
+ if ( ! get_transient( '&' . $transient_name ) && $backup_exists !== false ) {
432
+ set_transient( '&' . $transient_name, $context, 86400 );
433
+ }
434
+
435
+ }
436
+
437
+ die();
438
+ }
439
+ add_action('wp_ajax_sbi_set_use_backup', 'sbi_set_use_backup');
440
+ add_action('wp_ajax_nopriv_sbi_set_use_backup', 'sbi_set_use_backup');
441
+
442
+ function sbi_encode_uri( $uri )
443
+ {
444
+ $unescaped = array(
445
+ '%2D'=>'-','%5F'=>'_','%2E'=>'.','%21'=>'!', '%7E'=>'~',
446
+ '%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')'
447
+ );
448
+ $reserved = array(
449
+ '%3B'=>';','%2C'=>',','%2F'=>'/','%3F'=>'?','%3A'=>':',
450
+ '%40'=>'@','%26'=>'&','%3D'=>'=','%2B'=>'+','%24'=>'#x27;
451
+ );
452
+ $score = array(
453
+ '%23'=>'#'
454
+ );
455
+
456
+ return strtr( rawurlencode( $uri ), array_merge( $reserved,$unescaped,$score ) );
457
+ }
458
+
459
+ function sbi_get_cache() {
460
+ $options = get_option( 'sb_instagram_settings' );
461
+
462
+ $transient_names = json_decode(str_replace( array( '\"', "\\'" ), array( '"', "'" ), sanitize_text_field( $_POST['transientName'] ) ), true);
463
+ $header_cache_data_transient_data = get_transient( $transient_names['header'] );
464
+ $should_use_backup_header = isset( $_POST['useBackupHeader'] ) && sanitize_text_field( $_POST['useBackupHeader'] ) == 'true' ? true : false;
465
+ $should_use_backup_feed = isset( $_POST['useBackupFeed'] ) && sanitize_text_field( $_POST['useBackupFeed'] ) == 'true' ? true : false;
466
+ $feed_cache_transient_data = get_transient( $transient_names['feed'] );
467
+ $warning_message_data = '';
468
+
469
+ if ( ! empty( $feed_cache_transient_data ) ) {
470
+ $feed_cache_data = $feed_cache_transient_data;
471
+ } elseif ( isset( $options['check_api'] ) && $options['check_api'] === 'on' || $options['check_api'] ) {
472
+ $feed_cache_data = '{%22error%22:%22tryfetch%22}';
473
+ } else {
474
+ $feed_cache_data = '{%22error%22:%22nocache%22}';
475
+ }
476
+
477
+ if ( $transient_names['comments'] === 'need' ) {
478
+ $comment_cache_data = get_transient( 'sbinst_comment_cache' );
479
+ $comment_cache_data = ! empty( $comment_cache_data ) ? sbi_encode_uri( $comment_cache_data ) : '{%22error%22:%22nocache%22}';
480
+ } else {
481
+ $comment_cache_data = '{%22error%22:%22nocache%22}';
482
+ }
483
+
484
+ // maybe use backup cache
485
+ $still_using_backup = get_transient( '&'.$transient_names['feed'], false );
486
+ $doing_tryfetch = (isset( $options['check_api'] ) && $options['check_api'] === 'on' || $options['check_api']);
487
+ if ( ! empty( $header_cache_data_transient_data ) ) {
488
+ $header_cache_data = $header_cache_data_transient_data;
489
+ } elseif ( $doing_tryfetch ) {
490
+ $header_cache_data = '{%22error%22:%22tryfetch%22}';
491
+ } elseif ( empty( $header_cache_data_transient_data ) || $still_using_backup ) {
492
+ $backup_header_cache = get_option( '!' . $transient_names['header'] );
493
+ $header_cache_data = ! empty( $backup_header_cache ) ? $backup_header_cache : '{%22error%22:%22nocache%22}';
494
+ if ( $still_using_backup === 'falsecache' ) {
495
+ $warning_message_data = ',%22warning%22:{%22warning%22:%22falsecache%22}';
496
+ }
497
+ } else {
498
+ $header_cache_data = ! empty( $header_cache_data ) ? $header_cache_data : '{%22error%22:%22nocache%22}';
499
+ }
500
+
501
+ // maybe use backup cache
502
+ if ( (empty( $feed_cache_transient_data ) && $should_use_backup_feed) || $still_using_backup ) {
503
+ $backup_feed_cache = get_option( '!' . $transient_names['feed'] );
504
+ $feed_cache_data = ! empty( $backup_feed_cache ) ? $backup_feed_cache : $feed_cache_data;
505
+ if ( $still_using_backup === 'falsecache' ) {
506
+ $warning_message_data = ',%22warning%22:{%22warning%22:%22falsecache%22}';
507
+ }
508
+ }
509
+
510
+ $data = '{%22header%22:' . $header_cache_data .',%22feed%22:' . $feed_cache_data . ',%22comments%22:' . $comment_cache_data . $warning_message_data . '}';
511
+
512
+ echo $data;
513
+
514
+ die();
515
+ }
516
+ add_action('wp_ajax_get_cache', 'sbi_get_cache');
517
+ add_action('wp_ajax_nopriv_get_cache', 'sbi_get_cache');
518
+
519
+ //sbi_clear_backups
520
+ function sbi_clear_backups() {
521
+ if ( current_user_can( 'edit_posts' ) ) {
522
+ //Delete all transients
523
+ global $wpdb;
524
+ $table_name = $wpdb->prefix . "options";
525
+ $wpdb->query( "
526
+ DELETE
527
+ FROM $table_name
528
+ WHERE `option_name` LIKE ('%!sbi\_%')
529
+ " );
530
+ $wpdb->query( "
531
+ DELETE
532
+ FROM $table_name
533
+ WHERE `option_name` LIKE ('%\_transient\_&sbi\_%')
534
+ " );
535
+ $wpdb->query( "
536
+ DELETE
537
+ FROM $table_name
538
+ WHERE `option_name` LIKE ('%\_transient\_timeout\_&sbi\_%')
539
+ " );
540
+ }
541
+ die();
542
+ }
543
+ add_action( 'wp_ajax_sbi_clear_backups', 'sbi_clear_backups' );
544
+
545
//Enqueue stylesheet
546
add_action( 'wp_enqueue_scripts', 'sb_instagram_styles_enqueue' );
547
function sb_instagram_styles_enqueue() {
566
567
//Access token
568
isset($sb_instagram_settings[ 'sb_instagram_at' ]) ? $sb_instagram_at = trim($sb_instagram_settings['sb_instagram_at']) : $sb_instagram_at = '';
569
+ $font_method = isset( $sb_instagram_settings['sbi_font_method'] ) ? $sb_instagram_settings['sbi_font_method'] : 'svg';
570
+ $disable_font_awesome = isset($sb_instagram_settings['sb_instagram_disable_awesome']) ? $sb_instagram_settings['sb_instagram_disable_awesome'] : false;
571
572
+ if ( $font_method === 'fontfile' && ! $disable_font_awesome ) {
573
+ wp_enqueue_style( 'sb-font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
574
+ }
575
$data = array(
576
+ 'sb_instagram_at' => $sb_instagram_at,
577
+ 'font_method' => $font_method,
578
);
579
580
isset($sb_instagram_settings[ 'sb_instagram_ajax_theme' ]) ? $sb_instagram_ajax_theme = trim($sb_instagram_settings['sb_instagram_ajax_theme']) : $sb_instagram_ajax_theme = '';
608
609
if( current_user_can( 'manage_options' ) ){
610
echo "\r\n";
611
+ echo "#sbi_mod_error{ display: block !important; }";
612
}
613
614
if( $sbi_show_css ) echo "\r\n";
620
//Custom JS
621
add_action( 'wp_footer', 'sb_instagram_custom_js' );
622
function sb_instagram_custom_js() {
623
+ $options = get_option('sb_instagram_settings');
624
+ isset($options[ 'sb_instagram_custom_js' ]) ? $sb_instagram_custom_js = trim($options['sb_instagram_custom_js']) : $sb_instagram_custom_js = '';
625
+
626
+ echo '<!-- Instagram Feed JS -->';
627
+ echo "\r\n";
628
+ echo '<script type="text/javascript">';
629
+ echo "\r\n";
630
+ echo 'var sbiajaxurl = "' . admin_url('admin-ajax.php') . '";';
631
+
632
+ if( !empty($sb_instagram_custom_js) ) echo "\r\n";
633
+ if( !empty($sb_instagram_custom_js) ) echo "jQuery( document ).ready(function($) {";
634
+ if( !empty($sb_instagram_custom_js) ) echo "\r\n";
635
+ if( !empty($sb_instagram_custom_js) ) echo "window.sbi_custom_js = function(){";
636
+ if( !empty($sb_instagram_custom_js) ) echo "\r\n";
637
+ if( !empty($sb_instagram_custom_js) ) echo stripslashes($sb_instagram_custom_js);
638
+ if( !empty($sb_instagram_custom_js) ) echo "\r\n";
639
+ if( !empty($sb_instagram_custom_js) ) echo "}";
640
+ if( !empty($sb_instagram_custom_js) ) echo "\r\n";
641
+ if( !empty($sb_instagram_custom_js) ) echo "});";
642
+
643
+ echo "\r\n";
644
+ echo '</script>';
645
+ echo "\r\n";
646
+
647
}
648
649
if ( ! function_exists( 'sb_remove_style_version' ) ) {
689
690
//Settings
691
delete_option( 'sb_instagram_settings' );
692
+
693
+ global $wpdb;
694
+ $table_name = $wpdb->prefix . "options";
695
+ $wpdb->query( "
696
+ DELETE
697
+ FROM $table_name
698
+ WHERE `option_name` LIKE ('%!sbi\_%')
699
+ " );
700
+ $wpdb->query( "
701
+ DELETE
702
+ FROM $table_name
703
+ WHERE `option_name` LIKE ('%\_transient\_&sbi\_%')
704
+ " );
705
+ $wpdb->query( "
706
+ DELETE
707
+ FROM $table_name
708
+ WHERE `option_name` LIKE ('%\_transient\_timeout\_&sbi\_%')
709
+ " );
710
}
711
register_uninstall_hook( __FILE__, 'sb_instagram_uninstall' );
js/sb-instagram-admin.js CHANGED
@@ -39,6 +39,24 @@ jQuery(document).ready(function($) {
39
jQuery('#sb_instagram_at').val(token);
40
sbSaveToken(token);
41
});
42
43
//Tooltips
44
jQuery('#sbi_admin .sbi_tooltip_link').click(function(){
39
jQuery('#sb_instagram_at').val(token);
40
sbSaveToken(token);
41
});
42
+
43
+ //clear backup caches
44
+ jQuery('#sbi_clear_backups').click(function(event) {
45
+ jQuery('.sbi-success').remove();
46
+ event.preventDefault();
47
+ jQuery.ajax({
48
+ url: sbiA.ajax_url,
49
+ type: 'post',
50
+ data: {
51
+ action: 'sbi_clear_backups',
52
+ access_token: token,
53
+ just_tokens: true
54
+ },
55
+ success: function (data) {
56
+ jQuery('#sbi_clear_backups').after('<span class="sbi-success"><i class="fa fa-check-circle"></i></span>');
57
+ }
58
+ });
59
+ });
60
61
//Tooltips
62
jQuery('#sbi_admin .sbi_tooltip_link').click(function(){
js/sb-instagram.js CHANGED
@@ -1,500 +1,1430 @@
1
var sbi_js_exists = (typeof sbi_js_exists !== 'undefined') ? true : false;
2
if(!sbi_js_exists){
3
4
- (function() {
5
- var e, t;
6
- e = function() {
7
- function e(e, t) {
8
- var n, r;
9
- this.options = {
10
- target: "instafeed",
11
- get: "popular",
12
- resolution: "thumbnail",
13
- sortBy: "none",
14
- links: !0,
15
- mock: !1,
16
- useHttp: !1
17
- };
18
- if (typeof e == "object")
19
- for (n in e) r = e[n], this.options[n] = r;
20
- this.context = t != null ? t : this, this.unique = this._genKey()
21
- }
22
- return e.prototype.hasNext = function() {
23
- return typeof this.context.nextUrl == "string" && this.context.nextUrl.length > 0
24
- }, e.prototype.next = function() {
25
- return this.hasNext() ? this.run(this.context.nextUrl) : !1
26
- }, e.prototype.run = function(t) {
27
- var n, r, i;
28
- if (typeof this.options.clientId != "string" && typeof this.options.accessToken != "string") throw new Error("Missing clientId or accessToken.");
29
- if (typeof this.options.accessToken != "string" && typeof this.options.clientId != "string") throw new Error("Missing clientId or accessToken.");
30
- return this.options.before != null && typeof this.options.before == "function" && this.options.before.call(this), typeof document != "undefined" && document !== null && (i = document.createElement("script"), i.id = "instafeed-fetcher", i.src = t || this._buildUrl(), n = document.getElementsByTagName("head"), n[0].appendChild(i), r = "instafeedCache" + this.unique, window[r] = new e(this.options, this), window[r].unique = this.unique), !0
31
- }, e.prototype.parse = function(e) {
32
- var t, n, r, i, s, o, u, a, f, l, c, h, p, d, v, m, g, y, b, w, E, S;
33
- if (typeof e != "object") {
34
- if (this.options.error != null && typeof this.options.error == "function") return this.options.error.call(this, "Invalid JSON data"), !1;
35
- throw new Error("Invalid JSON response")
36
- }
37
- if (e.meta.code !== 200) {
38
- if (this.options.error != null && typeof this.options.error == "function") return this.options.error.call(this, e.meta.error_message), !1;
39
- throw new Error("Error from Instagram: " + e.meta.error_message)
40
- }
41
- if (e.data.length === 0) {
42
- if (this.options.error != null && typeof this.options.error == "function") return this.options.error.call(this, "No images were returned from Instagram"), !1;
43
- throw new Error("No images were returned from Instagram")
44
- }
45
- this.options.success != null && typeof this.options.success == "function" && this.options.success.call(this, e), this.context.nextUrl = "", e.pagination != null && (this.context.nextUrl = e.pagination.next_url);
46
- var lastVisiblePost = typeof e.data[Math.min(this.options.limit - 1,e.data.length-1)] !== 'undefined' ? e.data[Math.min(this.options.limit - 1,e.data.length-1)] : e.data[e.data.length],
47
- lastRetrievedPost = e.data[e.data.length-1],
48
- hasMorePosts = (typeof e.data[this.options.limit] !== 'undefined');
49
- if (typeof e.pagination.next_url !== 'undefined') {
50
- this.context.nextUrl = e.pagination.next_url.replace(lastRetrievedPost.id, lastVisiblePost.id);
51
- } else if (hasMorePosts) {
52
- this.context.nextUrl = "https://api.instagram.com/v1/users/"+this.options.userId+"/media/recent?access_token="+this.options.accessToken+"&count=33&callback=instafeedCache"+this.unique+".parse&max_id=" + lastVisiblePost.id;
53
- e.pagination.next_url = this.context.nextUrl;
54
- e.pagination.next_max_id = lastVisiblePost.id;
55
- }
56
- if (e.data.length > this.options.limit) {
57
- e.data = e.data.slice(0,this.options.limit);
58
- }
59
- if (this.options.sortBy !== "none") {
60
- this.options.sortBy === "random" ? d = ["", "random"] : d = this.options.sortBy.split("-"), p = d[0] === "least" ? !0 : !1;
61
- switch (d[1]) {
62
- case "random":
63
- e.data.sort(function() {
64
- return .5 - Math.random()
65
- });
66
- break;
67
- case "recent":
68
- e.data = this._sortBy(e.data, "created_time", p);
69
- break;
70
- case "liked":
71
- e.data = this._sortBy(e.data, "likes.count", p);
72
- break;
73
- case "commented":
74
- e.data = this._sortBy(e.data, "comments.count", p);
75
- break;
76
- default:
77
- throw new Error("Invalid option for sortBy: '" + this.options.sortBy + "'.")
78
- }
79
- }
80
- if (typeof document != "undefined" && document !== null && this.options.mock === !1) {
81
- a = e.data, this.options.limit != null && a.length > this.options.limit && (a = a.slice(0, this.options.limit + 1 || 9e9)), n = document.createDocumentFragment(), this.options.filter != null && typeof this.options.filter == "function" && (a = this._filter(a, this.options.filter));
82
- if (this.options.template != null && typeof this.options.template == "string") {
83
- i = "", o = "", l = "", v = document.createElement("div");
84
- for (m = 0, b = a.length; m < b; m++) s = a[m], u = s.images[this.options.resolution].url, this.options.useHttp || (u = u.replace("http://", "//")), o = this._makeTemplate(this.options.template, {
85
- model: s,
86
- id: s.id,
87
- link: s.link,
88
- image: u,
89
- caption: this._getObjectProperty(s, "caption.text"),
90
- likes: s.likes.count,
91
- comments: s.comments.count,
92
- location: this._getObjectProperty(s, "location.name")
93
- }), i += o;
94
- v.innerHTML = i, S = [].slice.call(v.childNodes);
95
- for (g = 0, w = S.length; g < w; g++) h = S[g], n.appendChild(h)
96
- } else
97
- for (y = 0, E = a.length; y < E; y++) s = a[y], f = document.createElement("img"), u = s.images[this.options.resolution].url, this.options.useHttp || (u = u.replace("http://", "//")), f.src = u, this.options.links === !0 ? (t = document.createElement("a"), t.href = s.link, t.appendChild(f), n.appendChild(t)) : n.appendChild(f);
98
- this.options.target.append(n), r = document.getElementsByTagName("head")[0], r.removeChild(document.getElementById("instafeed-fetcher")), c = "instafeedCache" + this.unique, window[c] = void 0;
99
- try {
100
- delete window[c]
101
- } catch (x) {}
102
- }
103
- return this.options.after != null && typeof this.options.after == "function" && this.options.after.call(this), !0
104
- }, e.prototype._buildUrl = function() {
105
- var e, t, n;
106
- e = "https://api.instagram.com/v1";
107
- switch (this.options.get) {
108
- case "popular":
109
- t = "media/popular";
110
- break;
111
- case "tagged":
112
- if (typeof this.options.tagName != "string") throw new Error("No tag name specified. Use the 'tagName' option.");
113
- t = "tags/" + this.options.tagName + "/media/recent";
114
- break;
115
- case "location":
116
- if (typeof this.options.locationId != "number") throw new Error("No location specified. Use the 'locationId' option.");
117
- t = "locations/" + this.options.locationId + "/media/recent";
118
- break;
119
- case "user":
120
- if (typeof this.options.userId != "number") throw new Error("No user specified. Use the 'userId' option.");
121
- if (typeof this.options.accessToken != "string") throw new Error("No access token. Use the 'accessToken' option.");
122
- t = "users/" + this.options.userId + "/media/recent";
123
- break;
124
- default:
125
- throw new Error("Invalid option for get: '" + this.options.get + "'.")
126
- }
127
- return n = "" + e + "/" + t, this.options.accessToken != null ? n += "?access_token=" + this.options.accessToken : n += "?client_id=" + this.options.clientId, this.options.limit != null && (n += "&count=33"), n += "&callback=instafeedCache" + this.unique + ".parse", n
128
- }, e.prototype._genKey = function() {
129
- var e;
130
- return e = function() {
131
- return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1)
132
- }, "" + e() + e() + e() + e()
133
- }, e.prototype._makeTemplate = function(e, t) {
134
- var n, r, i, s, o;
135
- r = /(?:\{{2})([\w\[\]\.]+)(?:\}{2})/, n = e;
136
- while (r.test(n)) i = n.match(r)[1], s = (o = this._getObjectProperty(t, i)) != null ? o : "", n = n.replace(r, "" + s);
137
- return n
138
- }, e.prototype._getObjectProperty = function(e, t) {
139
- var n, r;
140
- t = t.replace(/\[(\w+)\]/g, ".$1"), r = t.split(".");
141
- while (r.length) {
142
- n = r.shift();
143
- if (!(e != null && n in e)) return null;
144
- e = e[n]
145
- }
146
- return e
147
- }, e.prototype._sortBy = function(e, t, n) {
148
- var r;
149
- return r = function(e, r) {
150
- var i, s;
151
- return i = this._getObjectProperty(e, t), s = this._getObjectProperty(r, t), n ? i > s ? 1 : -1 : i < s ? 1 : -1
152
- }, e.sort(r.bind(this)), e
153
- }, e.prototype._filter = function(e, t) {
154
- var n, r, i, s, o;
155
- n = [], i = function(e) {
156
- if (t(e)) return n.push(e)
157
- };
158
- for (s = 0, o = e.length; s < o; s++) r = e[s], i(r);
159
- return n
160
- }, e
161
- }(), t = typeof exports != "undefined" && exports !== null ? exports : window, t.instagramfeed = e
162
- }).call(this);
163
-
164
//Shim for "fixing" IE's lack of support (IE < 9) for applying slice on host objects like NamedNodeMap, NodeList, and HTMLCollection) https://github.com/stevenschobert/instafeed.js/issues/84
165
(function(){"use strict";var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){n=typeof n!=="undefined"?n:this.length;if(Object.prototype.toString.call(this)==="[object Array]"){return e.call(this,t,n)}var r,i=[],s,o=this.length;var u=t||0;u=u>=0?u:o+u;var a=n?n:o;if(n<0){a=o+n}s=a-u;if(s>0){i=new Array(s);if(this.charAt){for(r=0;r<s;r++){i[r]=this.charAt(u+r)}}else{for(r=0;r<s;r++){i[r]=this[u+r]}}}return i}}})()
166
167
//IE8 also doesn't offer the .bind() method triggered by the 'sortBy' property. Copy and paste the polyfill offered here:
168
if(!Function.prototype.bind){Function.prototype.bind=function(e){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable")}var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};r.prototype=this.prototype;i.prototype=new r;return i}}
169
170
- function sbi_init(){
171
- // used to track multiple feeds on the page
172
- window.sbiFeedMeta = {};
173
-
174
- jQuery('#sb_instagram.sbi').each(function($i){
175
-
176
- var $self = jQuery(this),
177
- $target = $self.find('#sbi_images'),
178
- $loadBtn = $self.find("#sbi_load .sbi_load_btn"),
179
- imgRes = 'standard_resolution',
180
- cols = parseInt( this.getAttribute('data-cols'), 10 ),
181
- //Convert styles JSON string to an object
182
- feedOptions = JSON.parse( this.getAttribute('data-options') ),
183
- getType = 'user',
184
- sortby = 'none',
185
- user_id = this.getAttribute('data-id'),
186
- num = this.getAttribute('data-num'),
187
- $header = '',
188
- morePosts = []; //Used to determine whether to show the Load More button when displaying posts from more than one id/hashtag. If one of the ids/hashtags has more posts then still show button.
189
-
190
- jQuery(this).attr('data-sbi-index', $i);
191
- // setting up some global objects to keep track of various statuses used for the caching system
192
- feedOptions.feedIndex = $i;
193
- window.sbiFeedMeta[$i] = {
194
- 'error' : {},
195
- 'idsInFeed' : []
196
- };
197
-
198
- if( feedOptions.sortby !== '' ) sortby = feedOptions.sortby;
199
200
- switch( this.getAttribute('data-res') ) {
201
- case 'auto':
202
- var feedWidth = $self.innerWidth(),
203
- colWidth = $self.innerWidth() / cols;
204
205
- //Check if page width is less than 640. If it is then use the script above
206
- var sbiWindowWidth = jQuery(window).width();
207
- if( sbiWindowWidth < 640 ){
208
- //Need this for mobile so that image res is right on mobile, as the number of cols isn't always accurate on mobile as they are changed using CSS
209
- if( feedWidth < 640 && $self.is('.sbi_col_3, .sbi_col_4, .sbi_col_5, .sbi_col_6') ) colWidth = 300; //Use medium images
210
- if( feedWidth < 640 && $self.is('.sbi_col_7, .sbi_col_8, .sbi_col_9, .sbi_col_10') ) colWidth = 100; //Use thumbnail images
211
- if( (feedWidth > 320 && feedWidth < 480) && sbiWindowWidth < 480 ) colWidth = 480; //Use full size images
212
- if( feedWidth < 320 && sbiWindowWidth < 480 ) colWidth = 300; //Use medium size images
213
- }
214
215
- if( colWidth < 150 ){
216
- imgRes = 'thumbnail';
217
- } else if( colWidth < 320 ){
218
- imgRes = 'low_resolution';
219
} else {
220
- imgRes = 'standard_resolution';
221
}
222
223
- //If the feed is hidden (eg; in a tab) then the width is returned as 100, and so auto set the res to be medium to cover most bases
224
- if( feedWidth <= 100 ) imgRes = 'low_resolution';
225
226
- break;
227
- case 'thumb':
228
- imgRes = 'thumbnail';
229
- break;
230
- case 'medium':
231
- imgRes = 'low_resolution';
232
- break;
233
- default:
234
- imgRes = 'standard_resolution';
235
}
236
237
- //Split comma separated hashtags into array
238
- var ids_arr = user_id.replace(/ /g,'').split(",");
239
- var looparray = ids_arr;
240
-
241
- //Get page info for first User ID
242
- var headerStyles = '',
243
- sbi_page_url = 'https://api.instagram.com/v1/users/' + ids_arr[0] + '?access_token=' + sb_instagram_js_options.sb_instagram_at;
244
-
245
- if(feedOptions.headercolor.length) headerStyles = 'style="color: #'+feedOptions.headercolor+'"';
246
247
jQuery.ajax({
248
method: "GET",
249
- url: sbi_page_url,
250
dataType: "jsonp",
251
success: function(data) {
252
- var sbiErrorResponse = data.meta.error_message;
253
- if (typeof sbiErrorResponse === 'undefined') {
254
- $header = '<a href="https://instagram.com/' + data.data.username + '" target="_blank" title="@' + data.data.username + '" class="sbi_header_link">';
255
- $header += '<div class="sbi_header_text">';
256
- $header += '<h3 ' + headerStyles;
257
- if (data.data.bio.length == 0 || feedOptions.showbio !== "true") $header += ' class="sbi_no_bio"';
258
- $header += '>@' + data.data.username + '</h3>';
259
- if (data.data.bio.length && feedOptions.showbio === "true") $header += '<p class="sbi_bio" ' + headerStyles + '>' + data.data.bio + '</p>';
260
- $header += '</div>';
261
- $header += '<div class="sbi_header_img">';
262
- $header += '<div class="sbi_header_img_hover"><i></i></div>';
263
- $header += '<img src="' + data.data.profile_picture + '" alt="' + data.data.full_name + '" width="50" height="50">';
264
- $header += '</div>';
265
- $header += '</a>';
266
- //Add the header
267
- $self.find('.sb_instagram_header').prepend($header);
268
- //Change the URL of the follow button
269
- if ($self.find('.sbi_follow_btn').length) $self.find('.sbi_follow_btn a').attr('href', 'https://instagram.com/' + data.data.username)
270
271
- }
272
}
273
});
274
275
- //Loop through User IDs
276
- jQuery.each( looparray, function( index, entry ) {
277
- window.sbiFeedMeta[$i].idsInFeed.push(entry);
278
-
279
- var userFeed = new instagramfeed({
280
- target: $target,
281
- get: getType,
282
- sortBy: sortby,
283
- resolution: imgRes,
284
- limit: parseInt( num, 10 ),
285
- template: '<div class="sbi_item sbi_type_{{model.type}} sbi_new" id="sbi_{{id}}" data-date="{{model.created_time_raw}}"><div class="sbi_photo_wrap"><a class="sbi_photo" href="{{link}}" target="_blank"><img src="{{image}}" alt="{{caption}}" width="200" height="200" /></a></div></div>',
286
- filter: function(image) {
287
- //Create time for sorting
288
- var date = new Date(image.created_time*1000),
289
- time = date.getTime();
290
- image.created_time_raw = time;
291
-
292
- //Remove all special chars in caption so doesn't cause issue in alt tag
293
- //Always check to make sure it exists
294
- if(image.caption != null) image.caption.text = image.caption.text.replace(/[^a-zA-Z ]/g, "");
295
-
296
- //Remove caching key from image sources to prevent duplicate content issue
297
- image.images.thumbnail.url = image.images.thumbnail.url.split("?ig_cache_key")[0];
298
- image.images.standard_resolution.url = image.images.standard_resolution.url.split("?ig_cache_key")[0];
299
- image.images.low_resolution.url = image.images.low_resolution.url.split("?ig_cache_key")[0];
300
-
301
- return true;
302
- },
303
- userId: parseInt( entry, 10 ),
304
- accessToken: sb_instagram_js_options.sb_instagram_at,
305
- after: function() {
306
- $self.find('.sbi_loader').remove();
307
- $self.find('.sbi_load_btn .fa-spinner').hide();
308
- $self.find('.sbi_load_btn .sbi_btn_text').css('opacity', 1);
309
- /* Load more button */
310
- if (this.hasNext()) morePosts.push('1');
311
-
312
- if(morePosts.length > 0){
313
$loadBtn.show();
314
} else {
315
- $loadBtn.hide();
316
- $self.css('padding-bottom', 0);
317
}
318
319
- // Call Custom JS if it exists
320
- if (typeof sbi_custom_js == 'function') setTimeout(function(){ sbi_custom_js(); }, 100);
321
-
322
- if( imgRes !== 'thumbnail' ){
323
- //This needs to be here otherwise it results in the following error for some sites: $self.find(...).sbi_imgLiquid() is not a function.
324
- /*! imgLiquid v0.9.944 / 03-05-2013 https://github.com/karacas/imgLiquid */
325
- var sbi_imgLiquid=sbi_imgLiquid||{VER:"0.9.944"};sbi_imgLiquid.bgs_Available=!1,sbi_imgLiquid.bgs_CheckRunned=!1,function(i){function t(){if(!sbi_imgLiquid.bgs_CheckRunned){sbi_imgLiquid.bgs_CheckRunned=!0;var t=i('<span style="background-size:cover" />');i("body").append(t),!function(){var i=t[0];if(i&&window.getComputedStyle){var e=window.getComputedStyle(i,null);e&&e.backgroundSize&&(sbi_imgLiquid.bgs_Available="cover"===e.backgroundSize)}}(),t.remove()}}i.fn.extend({sbi_imgLiquid:function(e){this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},t();var a=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(t){function e(){-1===u.css("background-image").indexOf(encodeURI(c.attr("src")))&&u.css({"background-image":'url("'+encodeURI(c.attr("src"))+'")'}),u.css({"background-size":g.fill?"cover":"contain","background-position":(g.horizontalAlign+" "+g.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",u).css({display:"block",width:"100%",height:"100%"}),i("img",u).css({display:"none"}),g.onItemFinish&&g.onItemFinish(t,u,c),u.addClass("sbi_imgLiquid_bgSize"),u.addClass("sbi_imgLiquid_ready"),l()}function o(){function e(){c.data("sbi_imgLiquid_error")||c.data("sbi_imgLiquid_loaded")||c.data("sbi_imgLiquid_oldProcessed")||(u.is(":visible")&&c[0].complete&&c[0].width>0&&c[0].height>0?(c.data("sbi_imgLiquid_loaded",!0),setTimeout(r,t*g.delay)):setTimeout(e,g.timecheckvisibility))}if(c.data("oldSrc")&&c.data("oldSrc")!==c.attr("src")){var a=c.clone().removeAttr("style");return a.data("sbi_imgLiquid_settings",c.data("sbi_imgLiquid_settings")),c.parent().prepend(a),c.remove(),c=a,c[0].width=0,void setTimeout(o,10)}return c.data("sbi_imgLiquid_oldProcessed")?void r():(c.data("sbi_imgLiquid_oldProcessed",!1),c.data("oldSrc",c.attr("src")),i("img:not(:first)",u).css("display","none"),u.css({overflow:"hidden"}),c.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),c.on("error",n),c[0].onerror=n,e(),void d())}function d(){(g.responsive||c.data("sbi_imgLiquid_oldProcessed"))&&c.data("sbi_imgLiquid_settings")&&(g=c.data("sbi_imgLiquid_settings"),u.actualSize=u.get(0).offsetWidth+u.get(0).offsetHeight/1e4,u.sizeOld&&u.actualSize!==u.sizeOld&&r(),u.sizeOld=u.actualSize,setTimeout(d,g.responsiveCheckTime))}function n(){c.data("sbi_imgLiquid_error",!0),u.addClass("sbi_imgLiquid_error"),g.onItemError&&g.onItemError(t,u,c),l()}function s(){var i={};if(a.settings.useDataHtmlAttr){var t=u.attr("data-sbi_imgLiquid-fill"),e=u.attr("data-sbi_imgLiquid-horizontalAlign"),o=u.attr("data-sbi_imgLiquid-verticalAlign");("true"===t||"false"===t)&&(i.fill=Boolean("true"===t)),void 0===e||"left"!==e&&"center"!==e&&"right"!==e&&-1===e.indexOf("%")||(i.horizontalAlign=e),void 0===o||"top"!==o&&"bottom"!==o&&"center"!==o&&-1===o.indexOf("%")||(i.verticalAlign=o)}return sbi_imgLiquid.isIE&&a.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}function r(){var i,e,a,o,d,n,s,r,m=0,h=0,f=u.width(),v=u.height();void 0===c.data("owidth")&&c.data("owidth",c[0].width),void 0===c.data("oheight")&&c.data("oheight",c[0].height),g.fill===f/v>=c.data("owidth")/c.data("oheight")?(i="100%",e="auto",a=Math.floor(f),o=Math.floor(f*(c.data("oheight")/c.data("owidth")))):(i="auto",e="100%",a=Math.floor(v*(c.data("owidth")/c.data("oheight"))),o=Math.floor(v)),d=g.horizontalAlign.toLowerCase(),s=f-a,"left"===d&&(h=0),"center"===d&&(h=.5*s),"right"===d&&(h=s),-1!==d.indexOf("%")&&(d=parseInt(d.replace("%",""),10),d>0&&(h=s*d*.01)),n=g.verticalAlign.toLowerCase(),r=v-o,"left"===n&&(m=0),"center"===n&&(m=.5*r),"bottom"===n&&(m=r),-1!==n.indexOf("%")&&(n=parseInt(n.replace("%",""),10),n>0&&(m=r*n*.01)),g.hardPixels&&(i=a,e=o),c.css({width:i,height:e,"margin-left":Math.floor(h),"margin-top":Math.floor(m)}),c.data("sbi_imgLiquid_oldProcessed")||(c.fadeTo(g.fadeInTime,1),c.data("sbi_imgLiquid_oldProcessed",!0),g.removeBoxBackground&&u.css("background-image","none"),u.addClass("sbi_imgLiquid_nobgSize"),u.addClass("sbi_imgLiquid_ready")),g.onItemFinish&&g.onItemFinish(t,u,c),l()}function l(){t===a.length-1&&a.settings.onFinish&&a.settings.onFinish()}var g=a.settings,u=i(this),c=i("img:first",u);return c.length?(c.data("sbi_imgLiquid_settings")?(u.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),g=i.extend({},c.data("sbi_imgLiquid_settings"),a.options)):g=i.extend({},a.settings,s()),c.data("sbi_imgLiquid_settings",g),g.onItemStart&&g.onItemStart(t,u,c),void(sbi_imgLiquid.bgs_Available&&g.useBackgroundSize?e():o())):void n()})}})}(jQuery);
326
-
327
- // Use imagefill to set the images as backgrounds so they can be square
328
- !function () {
329
- var css = sbi_imgLiquid.injectCss,
330
- head = document.getElementsByTagName('head')[0],
331
- style = document.createElement('style');
332
- style.type = 'text/css';
333
- if (style.styleSheet) {
334
- style.styleSheet.cssText = css;
335
} else {
336
- style.appendChild(document.createTextNode(css));
337
}
338
- head.appendChild(style);
339
- }();
340
- $self.find(".sbi_photo").sbi_imgLiquid({fill:true});
341
- } // End: ( imgRes !== 'thumbnail' ) check
342
-
343
- //Only check the width once the resize event is over
344
- var sbi_delay = (function(){
345
- var sbi_timer = 0;
346
- return function(sbi_callback, sbi_ms){
347
- clearTimeout (sbi_timer);
348
- sbi_timer = setTimeout(sbi_callback, sbi_ms);
349
- };
350
- })();
351
-
352
- jQuery(window).resize(function(){
353
- sbi_delay(function(){
354
- sbiSetPhotoHeight();
355
}, 500);
356
- });
357
358
- //Resize image height
359
- function sbiSetPhotoHeight(){
360
361
- if( imgRes !== 'thumbnail' ){
362
- var sbi_photo_width = $self.find('.sbi_photo').eq(0).innerWidth();
363
364
- //Figure out number of columns for either desktop or mobile
365
- var sbi_num_cols = parseInt(cols);
366
367
- if( !$self.hasClass('sbi_disable_mobile') ){
368
- var sbiWindowWidth = jQuery(window).width();
369
- if( sbiWindowWidth < 640 && (parseInt(cols) > 2 && parseInt(cols) < 7 ) ) sbi_num_cols = 2;
370
- if( sbiWindowWidth < 640 && (parseInt(cols) > 6 && parseInt(cols) < 11 ) ) sbi_num_cols = 4;
371
- if( sbiWindowWidth <= 480 && parseInt(cols) > 2 ) sbi_num_cols = 1;
372
}
373
374
- //Figure out what the width should be using the number of cols
375
- var sbi_photo_width_manual = ( $self.find('#sbi_images').width() / sbi_num_cols ) - (feedOptions.imagepadding*2);
376
377
- //If the width is less than it should be then set it manually
378
- if( sbi_photo_width <= (sbi_photo_width_manual) ) sbi_photo_width = sbi_photo_width_manual;
379
380
- $self.find('.sbi_photo').css('height', sbi_photo_width);
381
}
382
383
- }
384
- sbiSetPhotoHeight();
385
386
- /* Detect when element becomes visible. Used for when the feed is initially hidden, in a tab for example. https://github.com/shaunbowe/jquery.visibilityChanged */
387
- !function(i){var n={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},c={};c.sbiCheckVisibility=function(i,n){if(jQuery.contains(document,i[0])){var e=n.sbiPreviousVisibility,t=i.is(":visible");n.sbiPreviousVisibility=t,null==e?n.runOnLoad&&n.callback(i,t):e!==t&&n.callback(i,t),setTimeout(function(){c.sbiCheckVisibility(i,n)},n.frequency)}},i.fn.sbiVisibilityChanged=function(e){var t=i.extend({},n,e);return this.each(function(){c.sbiCheckVisibility(i(this),t)})}}(jQuery);
388
389
- //If the feed is initially hidden (in a tab for example) then check for when it becomes visible and set then set the height
390
- jQuery(".sbi").filter(':hidden').sbiVisibilityChanged({
391
- callback: function(element, visible) {
392
- sbiSetPhotoHeight();
393
- },
394
- runOnLoad: false
395
- });
396
397
398
- //Fade photos on hover
399
- jQuery('#sb_instagram .sbi_photo').each(function(){
400
- $sbi_photo = jQuery(this);
401
- $sbi_photo.hover(function(){
402
- jQuery(this).fadeTo(200, 0.85);
403
- }, function(){
404
- jQuery(this).stop().fadeTo(500, 1);
405
});
406
407
- //Add video icon to videos
408
- if( $sbi_photo.closest('.sbi_item').hasClass('sbi_type_video') ){
409
- if( !$sbi_photo.find('.sbi_playbtn').length ) $sbi_photo.append('<i class="fa fa-play sbi_playbtn"></i>');
410
}
411
- });
412
413
- //Sort posts by date
414
- //only sort the new posts that are loaded in, not the whole feed, otherwise some photos will switch positions due to dates
415
- $self.find('#sbi_images .sbi_item.sbi_new').sort(function (a, b) {
416
- var aComp = jQuery(a).data('date'),
417
- bComp = jQuery(b).data('date');
418
419
- if(sortby == 'none'){
420
- //Order by date
421
- return bComp - aComp;
422
- } else {
423
- //Randomize
424
- return (Math.round(Math.random())-0.5);
425
}
426
427
- }).appendTo( $self.find("#sbi_images") );
428
-
429
- //Remove the new class after 500ms, once the sorting is done
430
- setTimeout(function(){
431
- jQuery('#sbi_images .sbi_item.sbi_new').removeClass('sbi_new');
432
- //Reset the morePosts variable so we can check whether there are more posts every time the Load More button is clicked
433
- morePosts = [];
434
- }, 500);
435
-
436
- function sbiGetItemSize(){
437
- $self.removeClass('sbi_small sbi_medium');
438
- var sbiItemWidth = $self.find('.sbi_item').innerWidth();
439
- if( sbiItemWidth > 120 && sbiItemWidth < 240 ){
440
- $self.addClass('sbi_medium');
441
- } else if( sbiItemWidth <= 120 ){
442
- $self.addClass('sbi_small');
443
}
444
}
445
- sbiGetItemSize();
446
-
447
- }, // End 'after' function
448
- error: function(data) {
449
- var sbiErrorMsg = '',
450
- sbiErrorDir = '',
451
- sbiErrorResponse = data;
452
-
453
- if( sbiErrorResponse.indexOf('access_token') > -1 ){
454
- sbiErrorMsg += '<p><b>Error: Access Token is not valid or has expired</b><br /><span>This error message is only visible to WordPress admins</span>';
455
- sbiErrorDir = "<p>There's an issue with the Instagram Access Token that you are using. Please obtain a new Access Token on the plugin's Settings page.<br />If you continue to have an issue with your Access Token then please see <a href='https://smashballoon.com/my-instagram-access-token-keep-expiring/' target='_blank'>this FAQ</a> for more information.";
456
- jQuery('#sb_instagram').empty().append( '<p style="text-align: center;">Unable to show Instagram photos</p><div id="sbi_mod_error">' + sbiErrorMsg + sbiErrorDir + '</div>');
457
- return;
458
- } else if( sbiErrorResponse.indexOf('user does not exist') > -1 || sbiErrorResponse.indexOf('you cannot view this resource') > -1 ){
459
- window.sbiFeedMeta[$i].error = {
460
- errorMsg : '<p><b>Error: User ID <span class="sbiErrorIds">'+window.sbiFeedMeta[$i].idsInFeed[index]+'</span> does not exist, is invalid, or is private</b><br /><span>This error is only visible to WordPress admins</span>',
461
- errorDir : "<p>Please double check the Instagram User ID that you are using and ensure that it is valid and not from a private account. To find your User ID simply enter your Instagram user name into this <a href='https://smashballoon.com/instagram-feed/find-instagram-user-id/' target='_blank'>tool</a>.</p>"
462
- };
463
- if (!$self.find('#sbi_mod_error').length) {
464
- $self.prepend('<div id="sbi_mod_error">'+window.sbiFeedMeta[$i].error.errorMsg+window.sbiFeedMeta[$i].error.errorDir+'</div>');
465
- } else if ($self.find('.sbiErrorIds').text().indexOf(window.sbiFeedMeta[$i].idsInFeed[index]) == -1) {
466
- $self.find('.sbiErrorIds').append(','+window.sbiFeedMeta[$i].idsInFeed[index]);
467
- }
468
- } else if (sbiErrorResponse.indexOf('No images were returned') > -1) {
469
- window.sbiFeedMeta[$i].error = {
470
- errorMsg : '<p><b>Error: User ID <span class="sbiErrorNone">'+window.sbiFeedMeta[$i].idsInFeed[index]+'</span> has no posts</b><br /><span>This error is only visible to WordPress admins</span>',
471
- errorDir : "<p>If you are the owner of this account, make a post on Instagram to see it in your feed.</p>"
472
- };
473
- if (!$self.find('#sbi_mod_error.sbi_error_none').length) {
474
- $self.prepend('<div id="sbi_mod_error" class="sbi_error_none">'+window.sbiFeedMeta[$i].error.errorMsg+window.sbiFeedMeta[$i].error.errorDir+'</div>');
475
- } else if ($self.find('.sbiErrorNone').text().indexOf(window.sbiFeedMeta[$i].idsInFeed[index]) == -1) {
476
- $self.find('.sbiErrorNone').append(','+window.sbiFeedMeta[$i].idsInFeed[index]);
477
}
478
}
479
}
480
- });
481
482
- $loadBtn.click(function() {
483
- jQuery(this).find('.fa-spinner').show();
484
- jQuery(this).find('.sbi_btn_text').css('opacity', 0);
485
- userFeed.next();
486
});
487
488
- userFeed.run();
489
490
- }); //End User ID array loop
491
492
- });
493
494
}
495
496
jQuery( document ).ready(function() {
497
- sbi_init();
498
});
499
500
} // end sbi_js_exists check
1
var sbi_js_exists = (typeof sbi_js_exists !== 'undefined') ? true : false;
2
if(!sbi_js_exists){
3
4
//Shim for "fixing" IE's lack of support (IE < 9) for applying slice on host objects like NamedNodeMap, NodeList, and HTMLCollection) https://github.com/stevenschobert/instafeed.js/issues/84
5
(function(){"use strict";var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){n=typeof n!=="undefined"?n:this.length;if(Object.prototype.toString.call(this)==="[object Array]"){return e.call(this,t,n)}var r,i=[],s,o=this.length;var u=t||0;u=u>=0?u:o+u;var a=n?n:o;if(n<0){a=o+n}s=a-u;if(s>0){i=new Array(s);if(this.charAt){for(r=0;r<s;r++){i[r]=this.charAt(u+r)}}else{for(r=0;r<s;r++){i[r]=this[u+r]}}}return i}}})()
6
7
//IE8 also doesn't offer the .bind() method triggered by the 'sortBy' property. Copy and paste the polyfill offered here:
8
if(!Function.prototype.bind){Function.prototype.bind=function(e){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable")}var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};r.prototype=this.prototype;i.prototype=new r;return i}}
9
10
+ /* Font Awesome SVG implementation */
11
+ var sbIconSVG = {
12
+ 'fa-clock' : 'class="svg-inline--fa fa-clock fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="far" data-icon="clock" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm61.8-104.4l-84.9-61.7c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v141.7l66.8 48.6c5.4 3.9 6.5 11.4 2.6 16.8L334.6 349c-3.9 5.3-11.4 6.5-16.8 2.6z"></path></svg>',
13
+ 'fa-play' : 'class="svg-inline--fa fa-play fa-w-14 sbi_playbtn" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="play" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"></path></svg>',
14
+ 'fa-image' : 'class="svg-inline--fa fa-image fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="far" data-icon="image" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>',
15
+ 'fa-user' : 'class="svg-inline--fa fa-user fa-w-16" style="margin-right: 3px;" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="user" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M96 160C96 71.634 167.635 0 256 0s160 71.634 160 160-71.635 160-160 160S96 248.366 96 160zm304 192h-28.556c-71.006 42.713-159.912 42.695-230.888 0H112C50.144 352 0 402.144 0 464v24c0 13.255 10.745 24 24 24h464c13.255 0 24-10.745 24-24v-24c0-61.856-50.144-112-112-112z"></path></svg>',
16
+ 'fa-comment' : 'class="svg-inline--fa fa-comment fa-w-18" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="comment" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M576 240c0 115-129 208-288 208-48.3 0-93.9-8.6-133.9-23.8-40.3 31.2-89.8 50.3-142.4 55.7-5.2.6-10.2-2.8-11.5-7.7-1.3-5 2.7-8.1 6.6-11.8 19.3-18.4 42.7-32.8 51.9-94.6C21.9 330.9 0 287.3 0 240 0 125.1 129 32 288 32s288 93.1 288 208z"></path></svg>',
17
+ 'fa-heart' : 'class="svg-inline--fa fa-heart fa-w-18" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="heart" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M414.9 24C361.8 24 312 65.7 288 89.3 264 65.7 214.2 24 161.1 24 70.3 24 16 76.9 16 165.5c0 72.6 66.8 133.3 69.2 135.4l187 180.8c8.8 8.5 22.8 8.5 31.6 0l186.7-180.2c2.7-2.7 69.5-63.5 69.5-136C560 76.9 505.7 24 414.9 24z"></path></svg>',
18
+ 'fa-check' : 'class="svg-inline--fa fa-check fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="check" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>',
19
+ 'fa-exclamation-circle' : 'class="svg-inline--fa fa-exclamation-circle fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="exclamation-circle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>',
20
+ 'fa-map-marker' : 'class="svg-inline--fa fa-map-marker fa-w-12" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="map-marker" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0z"></path></svg>',
21
+ 'fa-clone' : 'class="svg-inline--fa fa-clone fa-w-16 sbi_lightbox_carousel_icon" aria-hidden="true" data-fa-processed="" data-prefix="far" data-icon="clone" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M464 0H144c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h320c26.51 0 48-21.49 48-48v-48h48c26.51 0 48-21.49 48-48V48c0-26.51-21.49-48-48-48zM362 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h42v224c0 26.51 21.49 48 48 48h224v42a6 6 0 0 1-6 6zm96-96H150a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h308a6 6 0 0 1 6 6v308a6 6 0 0 1-6 6z"></path></svg>',
22
+ 'fa-chevron-right' : 'class="svg-inline--fa fa-chevron-right fa-w-10" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="chevron-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg>',
23
+ 'fa-chevron-left' : 'class="svg-inline--fa fa-chevron-left fa-w-10" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="chevron-left" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"></path></svg>',
24
+ 'fa-share' : 'class="svg-inline--fa fa-share fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="share" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"></path></svg>',
25
+ 'fa-times' : 'class="svg-inline--fa fa-times fa-w-12" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="times" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M323.1 441l53.9-53.9c9.4-9.4 9.4-24.5 0-33.9L279.8 256l97.2-97.2c9.4-9.4 9.4-24.5 0-33.9L323.1 71c-9.4-9.4-24.5-9.4-33.9 0L192 168.2 94.8 71c-9.4-9.4-24.5-9.4-33.9 0L7 124.9c-9.4 9.4-9.4 24.5 0 33.9l97.2 97.2L7 353.2c-9.4 9.4-9.4 24.5 0 33.9L60.9 441c9.4 9.4 24.5 9.4 33.9 0l97.2-97.2 97.2 97.2c9.3 9.3 24.5 9.3 33.9 0z"></path></svg>',
26
+ 'fa-envelope' : 'class="svg-inline--fa fa-envelope fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="envelope" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg>',
27
+ 'fa-edit' : 'class="svg-inline--fa fa-edit fa-w-18" aria-hidden="true" data-fa-processed="" data-prefix="far" data-icon="edit" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M402.3 344.9l32-32c5-5 13.7-1.5 13.7 5.7V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h273.5c7.1 0 10.7 8.6 5.7 13.7l-32 32c-1.5 1.5-3.5 2.3-5.7 2.3H48v352h352V350.5c0-2.1.8-4.1 2.3-5.6zm156.6-201.8L296.3 405.7l-90.4 10c-26.2 2.9-48.5-19.2-45.6-45.6l10-90.4L432.9 17.1c22.9-22.9 59.9-22.9 82.7 0l43.2 43.2c22.9 22.9 22.9 60 .1 82.8zM460.1 174L402 115.9 216.2 301.8l-7.3 65.3 65.3-7.3L460.1 174zm64.8-79.7l-43.2-43.2c-4.1-4.1-10.8-4.1-14.8 0L436 82l58.1 58.1 30.9-30.9c4-4.2 4-10.8-.1-14.9z"></path></svg>',
28
+ 'fa-arrows-alt' : 'class="svg-inline--fa fa-arrows-alt fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="arrows-alt" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"></path></svg>',
29
+ 'fa-check-circle' : 'class="svg-inline--fa fa-check-circle fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="check-circle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg>',
30
+ 'fa-ban' : 'class="svg-inline--fa fa-ban fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="ban" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 8C119.034 8 8 119.033 8 256s111.034 248 248 248 248-111.034 248-248S392.967 8 256 8zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676zM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676z"></path></svg>',
31
+ 'fa-facebook-square' : 'class="svg-inline--fa fa-facebook-square fa-w-14" aria-hidden="true" data-fa-processed="" data-prefix="fab" data-icon="facebook-square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M448 80v352c0 26.5-21.5 48-48 48h-85.3V302.8h60.6l8.7-67.6h-69.3V192c0-19.6 5.4-32.9 33.5-32.9H384V98.7c-6.2-.8-27.4-2.7-52.2-2.7-51.6 0-87 31.5-87 89.4v49.9H184v67.6h60.9V480H48c-26.5 0-48-21.5-48-48V80c0-26.5 21.5-48 48-48h352c26.5 0 48 21.5 48 48z"></path></svg>',
32
+ 'fa-twitter' : 'class="svg-inline--fa fa-twitter fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fab" data-icon="twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg>',
33
+ 'fa-google-plus' : 'class="svg-inline--fa fa-google-plus fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fab" data-icon="google-plus" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8zm-70.7 372c-68.8 0-124-55.5-124-124s55.2-124 124-124c31.3 0 60.1 11 83 32.3l-33.6 32.6c-13.2-12.9-31.3-19.1-49.4-19.1-42.9 0-77.2 35.5-77.2 78.1s34.2 78.1 77.2 78.1c32.6 0 64.9-19.1 70.1-53.3h-70.1v-42.6h116.9c1.3 6.8 1.9 13.6 1.9 20.7 0 70.8-47.5 121.2-118.8 121.2zm230.2-106.2v35.5H372v-35.5h-35.5v-35.5H372v-35.5h35.5v35.5h35.2v35.5h-35.2z"></path></svg>',
34
+ 'fa-instagram' : 'class="svg-inline--fa fa-instagram fa-w-14" aria-hidden="true" data-fa-processed="" data-prefix="fab" data-icon="instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg>',
35
+ 'fa-linkedin' : 'class="svg-inline--fa fa-linkedin fa-w-14" aria-hidden="true" data-fa-processed="" data-prefix="fab" data-icon="linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"></path></svg>',
36
+ 'fa-pinterest' : 'class="svg-inline--fa fa-pinterest fa-w-16" aria-hidden="true" data-fa-processed="" data-prefix="fab" data-icon="pinterest" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M496 256c0 137-111 248-248 248-25.6 0-50.2-3.9-73.4-11.1 10.1-16.5 25.2-43.5 30.8-65 3-11.6 15.4-59 15.4-59 8.1 15.4 31.7 28.5 56.8 28.5 74.8 0 128.7-68.8 128.7-154.3 0-81.9-66.9-143.2-152.9-143.2-107 0-163.9 71.8-163.9 150.1 0 36.4 19.4 81.7 50.3 96.1 4.7 2.2 7.2 1.2 8.3-3.3.8-3.4 5-20.3 6.9-28.1.6-2.5.3-4.7-1.7-7.1-10.1-12.5-18.3-35.3-18.3-56.6 0-54.7 41.4-107.6 112-107.6 60.9 0 103.6 41.5 103.6 100.9 0 67.1-33.9 113.6-78 113.6-24.3 0-42.6-20.1-36.7-44.8 7-29.5 20.5-61.3 20.5-82.6 0-19-10.2-34.9-31.4-34.9-24.9 0-44.9 25.7-44.9 60.2 0 22 7.4 36.8 7.4 36.8s-24.5 103.8-29 123.2c-5 21.4-3 51.6-.9 71.2C65.4 450.9 0 361.1 0 256 0 119 111 8 248 8s248 111 248 248z"></path></svg>',
37
+ 'fa-spinner' : 'class="svg-inline--fa fa-spinner fa-w-16 fa-pulse" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="spinner" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"></path></svg>',
38
+ 'fa-spin' : 'class="svg-inline--fa fa-spin fa-w-16 fa-pulse" aria-hidden="true" data-fa-processed="" data-prefix="fa" data-icon="spinner" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"></path></svg>'
39
+ };
40
41
+ function sbSVGify(elem) {
42
+ if (sb_instagram_js_options.font_method != 'fontfile') {
43
44
+ if (typeof elem === 'undefined') {
45
+ elem = jQuery('.sbi');
46
+ }
47
48
+ elem.each(function() {
49
+ jQuery(this).find('i.fa').each(function() {
50
+ var faClass = jQuery(this).attr('class').match(/fa-[a-z-]+/),
51
+ styles = jQuery(this).attr('style');
52
+ if (faClass && typeof sbIconSVG[faClass[0]] !== 'undefined') {
53
+ var theStyle = typeof styles !== 'undefined' ? 'style="'+styles+'" ' : '';
54
+ jQuery(this).replaceWith('<svg '+theStyle+sbIconSVG[faClass[0]]);
55
} else {
56
+ console.log(faClass,'missing');
57
}
58
+ })
59
+ });
60
+ sbiSizeSVG(elem);
61
+ }
62
+ }
63
64
+ // backup for themes/plugins that won't clear CSS cache
65
+ function sbiSizeSVG(elem) {
66
+ if (elem.find('svg').innerWidth() > 48 || elem.find('.sbi_follow_btn svg').innerWidth() > 30 || elem.find('.fa-clone').last().innerWidth() > 24 || elem.find('.fa-play').last().innerWidth() > 48) {
67
+ jQuery('.sbi_follow_btn svg').css({
68
+ 'margin-bottom': '-4px',
69
+ 'margin-right': '7px',
70
+ 'font-size': '15px',
71
+ 'width': '15px'
72
+ });
73
+ elem.find('.fa-spinner').css({
74
+ 'font-size': '15px',
75
+ 'width': '15px'
76
+ });
77
+ if (elem.find('.sbi_type_carousel .fa-clone').length){
78
+ elem.find('.sbi_type_carousel .fa-clone').each(function() {
79
+ var size = '24px',
80
+ offset = '8px';
81
+ if (elem.hasClass('sbi_small')) {
82
+ size = '12px';
83
+ offset = '5px';
84
+ } else if (elem.hasClass('sbi_medium')){
85
+ size = '18px';
86
+ offset = '5px';
87
+ }
88
89
+ jQuery(this).css({
90
+ 'top': offset,
91
+ 'right': offset,
92
+ 'position': 'absolute',
93
+ 'font-size': size,
94
+ 'width': size,
95
+ 'color': '#fff',
96
+ '-webkit-filter' : 'drop-shadow( 0px 0px 2px rgba(0,0,0,.4) )',
97
+ 'filter' : 'drop-shadow( 0px 0px 2px rgba(0,0,0,.4) )'
98
+ });
99
+ });
100
}
101
+ if (elem.find('.sbi_item .fa-play').length){
102
+ elem.find('.sbi_item .fa-play').each(function() {
103
+ var size = '48px',
104
+ margintop = '-24px',
105
+ marginleft = '-19px';
106
+ if (jQuery(this).closest('.sbi').hasClass('sbi_small')) {
107
+ size = '18px';
108
+ margintop = '-9px';
109
+ marginleft = '-7px';
110
+ } else if (jQuery(this).closest('.sbi').hasClass('sbi_medium')){
111
+ size = '23px';
112
+ margintop = '-12px';
113
+ marginleft = '-10px';
114
+ }
115
116
+ jQuery(this).css({
117
+ 'top': '50%',
118