Instagram Feed - Version 2.6

Version Description

  • New: Integrations with popular GDPR cookie consent solutions added: Cookie Notice by dFactory, GDPR Cookie Consent by WebToffee, Cookiebot by Cybot A/S, Complianz by Really Simple Plugins, and Borlabs Cookie by Borlabs. Visit the Instagram Feed settings page, Customize tab, GDPR section for more information.
  • Fix: API error notices would not be removed from the WordPress dashboard after successfully reconnecting an account when the problem was resolved.
  • Fix: Fixed PHP Error that would occur when connecting a personal account that would result in an HTTP error.
  • Fix: oEmbeds were not always working in much older versions of WordPress.
  • Fix: Play and carousel icons would appear very large for small images when the the mobile layout was disabled.
Download this release

Release Info

Developer Craig at Smash Balloon
Plugin Icon 128x128 Instagram Feed
Version 2.6
Comparing to
See all releases

Code changes from version 2.5.4 to 2.6

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.4
5
  Tested up to: 5.5
6
- Stable tag: 2.5.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -20,6 +20,7 @@ Display Instagram posts from your Instagram accounts, either in the same single
20
  * Completely **responsive** and mobile ready - layout looks great on any screen size and in any container width
21
  * **Completely customizable** - Customize the width, height, number of photos, number of columns, image size, background color, image spacing and more!
22
  * Display **multiple Instagram feeds** on the same page or on different pages throughout your site
 
23
  * Use the built-in **shortcode options** to completely customize each of your Instagram feeds
24
  * Display thumbnail, medium or **full-size photos** from your Instagram feed
25
  * **Infinitely load more** of your Instagram photos with the 'Load More' button
@@ -331,6 +332,13 @@ We understand that sometimes you need help, have issues or just have questions.
331
  * Plus more customization options added all the time!
332
 
333
  == Changelog ==
 
 
 
 
 
 
 
334
  = 2.5.4 =
335
  * Fix: Added more debugging info to the System Info for oEmbeds.
336
  * Fix: Added a workaround for a rare issue where oEmbed access tokens wouldn't save.
3
  Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
  Requires at least: 3.4
5
  Tested up to: 5.5
6
+ Stable tag: 2.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
20
  * Completely **responsive** and mobile ready - layout looks great on any screen size and in any container width
21
  * **Completely customizable** - Customize the width, height, number of photos, number of columns, image size, background color, image spacing and more!
22
  * Display **multiple Instagram feeds** on the same page or on different pages throughout your site
23
+ * **GDPR Compliance** - automatically integrates with many of the popular GDPR cookie consent plugins and includes a 1-click easy GDPR setting.
24
  * Use the built-in **shortcode options** to completely customize each of your Instagram feeds
25
  * Display thumbnail, medium or **full-size photos** from your Instagram feed
26
  * **Infinitely load more** of your Instagram photos with the 'Load More' button
332
  * Plus more customization options added all the time!
333
 
334
  == Changelog ==
335
+ = 2.6 =
336
+ * New: Integrations with popular GDPR cookie consent solutions added: Cookie Notice by dFactory, GDPR Cookie Consent by WebToffee, Cookiebot by Cybot A/S, Complianz by Really Simple Plugins, and Borlabs Cookie by Borlabs. Visit the Instagram Feed settings page, Customize tab, GDPR section for more information.
337
+ * Fix: API error notices would not be removed from the WordPress dashboard after successfully reconnecting an account when the problem was resolved.
338
+ * Fix: Fixed PHP Error that would occur when connecting a personal account that would result in an HTTP error.
339
+ * Fix: oEmbeds were not always working in much older versions of WordPress.
340
+ * Fix: Play and carousel icons would appear very large for small images when the the mobile layout was disabled.
341
+
342
  = 2.5.4 =
343
  * Fix: Added more debugging info to the System Info for oEmbeds.
344
  * Fix: Added a workaround for a rare issue where oEmbed access tokens wouldn't save.
css/sb-instagram-admin.css CHANGED
@@ -2445,6 +2445,57 @@
2445
  margin-top: 20px;
2446
  }
2447
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2448
  /* Clear */
2449
  .sbi-clear:before {
2450
  content: " ";
2445
  margin-top: 20px;
2446
  }
2447
 
2448
+
2449
+ /* GDPR Settings */
2450
+ .gdpr_tooltip p{
2451
+ padding: 0 0 10px 0;
2452
+ }
2453
+ .gdpr_tooltip span{
2454
+ display: inline-block;
2455
+ margin: 0;
2456
+ font-weight: bold;
2457
+ font-size: 14px;
2458
+ }
2459
+ .gdpr_tooltip .sbi-list{
2460
+ padding: 0 0 10px 0;
2461
+ }
2462
+ .gdpr_tooltip li{
2463
+ padding: 0;
2464
+ }
2465
+ .sbi_gdpr_plugin_active .sbi_active{
2466
+ display: inline-block;
2467
+ padding: 10px 20px 15px 20px;
2468
+ border-radius: 5px;
2469
+ background: #edf4f0;
2470
+ border: 1px solid #2c8649;
2471
+ color: #2c8649;
2472
+ margin: 8px 0 0 0;
2473
+ }
2474
+ .sbi_gdpr_plugin_active svg{
2475
+ width: 16px;
2476
+ height: 16px;
2477
+ position: relative;
2478
+ top: 3px;
2479
+ margin-right: 2px;
2480
+ }
2481
+ .sbi_gdpr_plugin_active path{
2482
+ fill: green;
2483
+ }
2484
+ .sbi_gdpr_list,
2485
+ .sbi_gdpr_yes,
2486
+ .sbi_gdpr_no{
2487
+ display: none;
2488
+ }
2489
+ #sbi_admin .sbi_gdpr_error {
2490
+ padding: 10px 20px 15px 20px;
2491
+ border-radius: 5px;
2492
+ background: #F7E6E6;
2493
+ border: 1px solid #BA7B7B;
2494
+ color: #592626;
2495
+ }
2496
+ #sbi_admin .sbi-list {
2497
+ list-style: inside disc;
2498
+ }
2499
  /* Clear */
2500
  .sbi-clear:before {
2501
  content: " ";
inc/admin/actions.php CHANGED
@@ -145,41 +145,6 @@ function sbi_delete_local_avatar( $username ) {
145
  }
146
  }
147
 
148
- function sbi_create_local_avatar( $username, $file_name ) {
149
- $image_editor = wp_get_image_editor( $file_name );
150
-
151
- if ( ! is_wp_error( $image_editor ) ) {
152
- $upload = wp_upload_dir();
153
-
154
- $full_file_name = trailingslashit( $upload['basedir'] ) . trailingslashit( SBI_UPLOADS_NAME ) . $username . '.jpg';
155
-
156
- $saved_image = $image_editor->save( $full_file_name );
157
-
158
- if ( ! $saved_image ) {
159
- global $sb_instagram_posts_manager;
160
-
161
- $sb_instagram_posts_manager->add_error( 'image_editor_save', array(
162
- __( 'Error saving edited image.', 'instagram-feed' ),
163
- $full_file_name
164
- ) );
165
- } else {
166
- return true;
167
- }
168
- } else {
169
- global $sb_instagram_posts_manager;
170
-
171
- $message = __( 'Error editing image.', 'instagram-feed' );
172
- if ( isset( $image_editor ) && isset( $image_editor->errors ) ) {
173
- foreach ( $image_editor->errors as $key => $item ) {
174
- $message .= ' ' . $key . '- ' . $item[0] . ' |';
175
- }
176
- }
177
-
178
- $sb_instagram_posts_manager->add_error( 'image_editor', array( $file_name, $message ) );
179
- }
180
- return false;
181
- }
182
-
183
  function sbi_connect_business_accounts() {
184
  $nonce = $_POST['sbi_nonce'];
185
 
@@ -224,7 +189,7 @@ function sbi_connect_business_accounts() {
224
  }
225
  global $sb_instagram_posts_manager;
226
 
227
- $sb_instagram_posts_manager->remove_error( 'at_' . $username );
228
  delete_transient( SBI_USE_BACKUP_PREFIX . 'sbi_' . $user_id );
229
  }
230
 
@@ -377,8 +342,7 @@ function sbi_do_account_delete( $account_id ) {
377
  update_option( 'sb_instagram_settings', $options );
378
  global $sb_instagram_posts_manager;
379
 
380
- $sb_instagram_posts_manager->remove_error( 'at_' . $username );
381
- $sb_instagram_posts_manager->remove_error( 'api' );
382
  }
383
 
384
  function sbi_connect_new_account( $access_token, $account_id ) {
@@ -544,7 +508,7 @@ function sbi_connect_new_account( $access_token, $account_id ) {
544
 
545
  global $sb_instagram_posts_manager;
546
 
547
- $sb_instagram_posts_manager->remove_error( 'at_' . $json['username'] );
548
  delete_transient( SBI_USE_BACKUP_PREFIX . 'sbi_' . $json['id'] );
549
 
550
  }
@@ -596,7 +560,7 @@ function sbi_connect_new_account( $access_token, $account_id ) {
596
  delete_transient( SBI_USE_BACKUP_PREFIX . 'sbi_' . $user_id );
597
  global $sb_instagram_posts_manager;
598
 
599
- $sb_instagram_posts_manager->remove_error( 'at_' . $username );
600
  $options['connected_accounts'] = $connected_accounts;
601
 
602
  update_option( 'sb_instagram_settings', $options );
@@ -759,9 +723,7 @@ function sbi_connect_basic_account( $new_account_details ) {
759
  update_option( 'sb_instagram_settings', $options );
760
  global $sb_instagram_posts_manager;
761
 
762
- $sb_instagram_posts_manager->remove_error( 'at_' . $new_account_details['username'] );
763
- $sb_instagram_posts_manager->remove_error( 'api' );
764
- $sb_instagram_posts_manager->remove_error( 'expiration_' . $new_account_details['user_id'] );
765
  return $options;
766
  }
767
 
145
  }
146
  }
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  function sbi_connect_business_accounts() {
149
  $nonce = $_POST['sbi_nonce'];
150
 
189
  }
190
  global $sb_instagram_posts_manager;
191
 
192
+ $sb_instagram_posts_manager->remove_all_errors();
193
  delete_transient( SBI_USE_BACKUP_PREFIX . 'sbi_' . $user_id );
194
  }
195
 
342
  update_option( 'sb_instagram_settings', $options );
343
  global $sb_instagram_posts_manager;
344
 
345
+ $sb_instagram_posts_manager->remove_all_errors();
 
346
  }
347
 
348
  function sbi_connect_new_account( $access_token, $account_id ) {
508
 
509
  global $sb_instagram_posts_manager;
510
 
511
+ $sb_instagram_posts_manager->remove_all_errors();
512
  delete_transient( SBI_USE_BACKUP_PREFIX . 'sbi_' . $json['id'] );
513
 
514
  }
560
  delete_transient( SBI_USE_BACKUP_PREFIX . 'sbi_' . $user_id );
561
  global $sb_instagram_posts_manager;
562
 
563
+ $sb_instagram_posts_manager->remove_all_errors();
564
  $options['connected_accounts'] = $connected_accounts;
565
 
566
  update_option( 'sb_instagram_settings', $options );
723
  update_option( 'sb_instagram_settings', $options );
724
  global $sb_instagram_posts_manager;
725
 
726
+ $sb_instagram_posts_manager->remove_all_errors();
 
 
727
  return $options;
728
  }
729
 
inc/admin/main.php CHANGED
@@ -426,14 +426,13 @@ function sb_instagram_settings_page() {
426
  'sb_ajax_initial' => false,
427
  'enqueue_css_in_shortcode' => false,
428
  'sb_instagram_ajax_theme' => false,
429
- 'sb_instagram_disable_resize' => false,
 
430
  'sb_instagram_favor_local' => true,
431
  'sb_instagram_minnum' => 0,
432
  'disable_js_image_loading' => false,
433
  'enqueue_js_in_head' => false,
434
  'sb_instagram_disable_mob_swipe' => false,
435
- 'sbi_font_method' => 'svg',
436
- 'sb_instagram_disable_awesome' => false,
437
  'custom_template' => false,
438
  'disable_admin_notice' => false,
439
  'enable_email_report' => 'on',
@@ -449,6 +448,7 @@ function sb_instagram_settings_page() {
449
  $sb_instagram_user_id = $options[ 'sb_instagram_user_id' ];
450
  $sb_instagram_preserve_settings = $options[ 'sb_instagram_preserve_settings' ];
451
  $sb_instagram_ajax_theme = $options[ 'sb_instagram_ajax_theme' ];
 
452
  $enqueue_js_in_head = $options[ 'enqueue_js_in_head' ];
453
  $disable_js_image_loading = $options[ 'disable_js_image_loading' ];
454
  $sb_instagram_disable_resize = $options[ 'sb_instagram_disable_resize' ];
@@ -499,8 +499,6 @@ function sb_instagram_settings_page() {
499
  $sb_instagram_backup = $options[ 'sb_instagram_backup' ];
500
  $sb_ajax_initial = $options[ 'sb_ajax_initial' ];
501
  $enqueue_css_in_shortcode = $options[ 'enqueue_css_in_shortcode' ];
502
- $sbi_font_method = $options[ 'sbi_font_method' ];
503
- $sb_instagram_disable_awesome = $options[ 'sb_instagram_disable_awesome' ];
504
  $sb_instagram_custom_template = $options[ 'custom_template' ];
505
  $sb_instagram_disable_admin_notice = $options[ 'disable_admin_notice' ];
506
  $sb_instagram_enable_email_report = $options[ 'enable_email_report' ];
@@ -642,6 +640,7 @@ function sb_instagram_settings_page() {
642
  $sb_instagram_custom_css = $_POST[ 'sb_instagram_custom_css' ];
643
  $sb_instagram_custom_js = $_POST[ 'sb_instagram_custom_js' ];
644
  isset($_POST[ 'sb_instagram_ajax_theme' ]) ? $sb_instagram_ajax_theme = sanitize_text_field( $_POST[ 'sb_instagram_ajax_theme' ] ) : $sb_instagram_ajax_theme = '';
 
645
  isset($_POST[ 'enqueue_js_in_head' ]) ? $enqueue_js_in_head = $_POST[ 'enqueue_js_in_head' ] : $enqueue_js_in_head = '';
646
  isset($_POST[ 'disable_js_image_loading' ]) ? $disable_js_image_loading = $_POST[ 'disable_js_image_loading' ] : $disable_js_image_loading = '';
647
  isset($_POST[ 'sb_instagram_disable_resize' ]) ? $sb_instagram_disable_resize= sanitize_text_field( $_POST[ 'sb_instagram_disable_resize' ] ) : $sb_instagram_disable_resize = '';
@@ -652,8 +651,6 @@ function sb_instagram_settings_page() {
652
  isset($_POST[ 'sb_instagram_backup' ]) ? $sb_instagram_backup = $_POST[ 'sb_instagram_backup' ] : $sb_instagram_backup = '';
653
  isset($_POST[ 'sb_ajax_initial' ]) ? $sb_ajax_initial = $_POST[ 'sb_ajax_initial' ] : $sb_ajax_initial = '';
654
  isset($_POST[ 'enqueue_css_in_shortcode' ]) ? $enqueue_css_in_shortcode = $_POST[ 'enqueue_css_in_shortcode' ] : $enqueue_css_in_shortcode = '';
655
- isset($_POST[ 'sbi_font_method' ]) ? $sbi_font_method = $_POST[ 'sbi_font_method' ] : $sbi_font_method = 'svg';
656
- isset($_POST[ 'sb_instagram_disable_awesome' ]) ? $sb_instagram_disable_awesome = sanitize_text_field( $_POST[ 'sb_instagram_disable_awesome' ] ) : $sb_instagram_disable_awesome = '';
657
 
658
  $options[ 'sb_instagram_width' ] = $sb_instagram_width;
659
  $options[ 'sb_instagram_width_unit' ] = $sb_instagram_width_unit;
@@ -690,6 +687,7 @@ function sb_instagram_settings_page() {
690
  $options[ 'sb_instagram_custom_css' ] = $sb_instagram_custom_css;
691
  $options[ 'sb_instagram_custom_js' ] = $sb_instagram_custom_js;
692
  $options[ 'sb_instagram_ajax_theme' ] = $sb_instagram_ajax_theme;
 
693
  $options[ 'enqueue_js_in_head' ] = $enqueue_js_in_head;
694
  $options[ 'disable_js_image_loading' ] = $disable_js_image_loading;
695
  $options[ 'sb_instagram_disable_resize' ] = $sb_instagram_disable_resize;
@@ -701,9 +699,6 @@ function sb_instagram_settings_page() {
701
  $options['sb_instagram_backup'] = $sb_instagram_backup;
702
  $options['enqueue_css_in_shortcode'] = $enqueue_css_in_shortcode;
703
 
704
- $options['sbi_font_method'] = $sbi_font_method;
705
- $options[ 'sb_instagram_disable_awesome' ] = $sb_instagram_disable_awesome;
706
-
707
  isset($_POST[ 'sb_instagram_custom_template' ]) ? $sb_instagram_custom_template = $_POST[ 'sb_instagram_custom_template' ] : $sb_instagram_custom_template = '';
708
  $options['custom_template'] = $sb_instagram_custom_template;
709
  isset($_POST[ 'sb_instagram_disable_admin_notice' ]) ? $sb_instagram_disable_admin_notice = $_POST[ 'sb_instagram_disable_admin_notice' ] : $sb_instagram_disable_admin_notice = '';
@@ -1399,9 +1394,10 @@ function sb_instagram_settings_page() {
1399
  <a href="#headeroptions"><?php _e( 'Header', 'instagram-feed' ); ?></a>
1400
  <a href="#loadmore"><?php _e( "'Load More' Button", 'instagram-feed' ); ?></a>
1401
  <a href="#follow"><?php _e( "'Follow' Button", 'instagram-feed' ); ?></a>
1402
- <a href="#customcss"><?php _e( 'Custom CSS', 'instagram-feed' ); ?></a>
 
1403
  <a href="#customjs"><?php _e( 'Custom JavaScript', 'instagram-feed' ); ?></a>
1404
- </p>
1405
 
1406
  <input type="hidden" name="<?php echo $sb_instagram_customize_hidden_field; ?>" value="Y">
1407
 
@@ -2232,7 +2228,122 @@ function sb_instagram_settings_page() {
2232
  </table>
2233
  </div>
2234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2236
 
2237
  <hr id="customcss" />
2238
  <h3><?php _e('Misc', 'instagram-feed'); ?></h3>
@@ -2366,23 +2477,6 @@ function sb_instagram_settings_page() {
2366
  </table>
2367
  <table class="form-table">
2368
  <tbody>
2369
- <tr valign="top">
2370
- <th scope="row"><label><?php _e("Disable Icon Font", 'instagram-feed'); ?></label></th>
2371
- <td>
2372
- <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' ); ?>
2373
- </td>
2374
- </tr>
2375
- <tr>
2376
- <th scope="row"><label for="sbi_font_method"><?php _e("Icon Method", 'instagram-feed'); ?></label></th>
2377
- <td>
2378
- <select name="sbi_font_method" id="sbi_font_method" class="default-text">
2379
- <option value="svg" id="sbi-font_method" class="default-text" <?php if($sbi_font_method == 'svg') echo 'selected="selected"' ?>>SVG</option>
2380
- <option value="fontfile" id="sbi-font_method" class="default-text" <?php if($sbi_font_method == 'fontfile') echo 'selected="selected"' ?>><?php _e("Font File", 'instagram-feed'); ?></option>
2381
- </select>
2382
- <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'instagram-feed'); ?></a>
2383
- <p class="sbi_tooltip"><?php _e("This plugin uses SVGs for all icons in the feed. Use this setting to switch to font icons.", 'instagram-feed'); ?></p>
2384
- </td>
2385
- </tr>
2386
  <tr>
2387
  <th class="bump-left"><label class="bump-left"><?php _e("Enable Custom Templates", 'instagram-feed'); ?></label></th>
2388
  <td>
@@ -3206,6 +3300,13 @@ if ( $error_page ) {
3206
  echo 'Feed with error: ' . esc_url( get_the_permalink( $error_page ) ). "\n";
3207
  }?>
3208
 
 
 
 
 
 
 
 
3209
  ## oEmbed: ##
3210
  <?php
3211
  $oembed_token_settings = get_option( 'sbi_oembed_token', array() );
426
  'sb_ajax_initial' => false,
427
  'enqueue_css_in_shortcode' => false,
428
  'sb_instagram_ajax_theme' => false,
429
+ 'gdpr' => 'auto',
430
+ 'sb_instagram_disable_resize' => false,
431
  'sb_instagram_favor_local' => true,
432
  'sb_instagram_minnum' => 0,
433
  'disable_js_image_loading' => false,
434
  'enqueue_js_in_head' => false,
435
  'sb_instagram_disable_mob_swipe' => false,
 
 
436
  'custom_template' => false,
437
  'disable_admin_notice' => false,
438
  'enable_email_report' => 'on',
448
  $sb_instagram_user_id = $options[ 'sb_instagram_user_id' ];
449
  $sb_instagram_preserve_settings = $options[ 'sb_instagram_preserve_settings' ];
450
  $sb_instagram_ajax_theme = $options[ 'sb_instagram_ajax_theme' ];
451
+ $gdpr = $options[ 'gdpr' ];
452
  $enqueue_js_in_head = $options[ 'enqueue_js_in_head' ];
453
  $disable_js_image_loading = $options[ 'disable_js_image_loading' ];
454
  $sb_instagram_disable_resize = $options[ 'sb_instagram_disable_resize' ];
499
  $sb_instagram_backup = $options[ 'sb_instagram_backup' ];
500
  $sb_ajax_initial = $options[ 'sb_ajax_initial' ];
501
  $enqueue_css_in_shortcode = $options[ 'enqueue_css_in_shortcode' ];
 
 
502
  $sb_instagram_custom_template = $options[ 'custom_template' ];
503
  $sb_instagram_disable_admin_notice = $options[ 'disable_admin_notice' ];
504
  $sb_instagram_enable_email_report = $options[ 'enable_email_report' ];
640
  $sb_instagram_custom_css = $_POST[ 'sb_instagram_custom_css' ];
641
  $sb_instagram_custom_js = $_POST[ 'sb_instagram_custom_js' ];
642
  isset($_POST[ 'sb_instagram_ajax_theme' ]) ? $sb_instagram_ajax_theme = sanitize_text_field( $_POST[ 'sb_instagram_ajax_theme' ] ) : $sb_instagram_ajax_theme = '';
643
+ isset($_POST[ 'gdpr' ]) ? $gdpr = sanitize_text_field( $_POST[ 'gdpr' ] ) : $gdpr = '';
644
  isset($_POST[ 'enqueue_js_in_head' ]) ? $enqueue_js_in_head = $_POST[ 'enqueue_js_in_head' ] : $enqueue_js_in_head = '';
645
  isset($_POST[ 'disable_js_image_loading' ]) ? $disable_js_image_loading = $_POST[ 'disable_js_image_loading' ] : $disable_js_image_loading = '';
646
  isset($_POST[ 'sb_instagram_disable_resize' ]) ? $sb_instagram_disable_resize= sanitize_text_field( $_POST[ 'sb_instagram_disable_resize' ] ) : $sb_instagram_disable_resize = '';
651
  isset($_POST[ 'sb_instagram_backup' ]) ? $sb_instagram_backup = $_POST[ 'sb_instagram_backup' ] : $sb_instagram_backup = '';
652
  isset($_POST[ 'sb_ajax_initial' ]) ? $sb_ajax_initial = $_POST[ 'sb_ajax_initial' ] : $sb_ajax_initial = '';
653
  isset($_POST[ 'enqueue_css_in_shortcode' ]) ? $enqueue_css_in_shortcode = $_POST[ 'enqueue_css_in_shortcode' ] : $enqueue_css_in_shortcode = '';
 
 
654
 
655
  $options[ 'sb_instagram_width' ] = $sb_instagram_width;
656
  $options[ 'sb_instagram_width_unit' ] = $sb_instagram_width_unit;
687
  $options[ 'sb_instagram_custom_css' ] = $sb_instagram_custom_css;
688
  $options[ 'sb_instagram_custom_js' ] = $sb_instagram_custom_js;
689
  $options[ 'sb_instagram_ajax_theme' ] = $sb_instagram_ajax_theme;
690
+ $options[ 'gdpr' ] = $gdpr;
691
  $options[ 'enqueue_js_in_head' ] = $enqueue_js_in_head;
692
  $options[ 'disable_js_image_loading' ] = $disable_js_image_loading;
693
  $options[ 'sb_instagram_disable_resize' ] = $sb_instagram_disable_resize;
699
  $options['sb_instagram_backup'] = $sb_instagram_backup;
700
  $options['enqueue_css_in_shortcode'] = $enqueue_css_in_shortcode;
701
 
 
 
 
702
  isset($_POST[ 'sb_instagram_custom_template' ]) ? $sb_instagram_custom_template = $_POST[ 'sb_instagram_custom_template' ] : $sb_instagram_custom_template = '';
703
  $options['custom_template'] = $sb_instagram_custom_template;
704
  isset($_POST[ 'sb_instagram_disable_admin_notice' ]) ? $sb_instagram_disable_admin_notice = $_POST[ 'sb_instagram_disable_admin_notice' ] : $sb_instagram_disable_admin_notice = '';
1394
  <a href="#headeroptions"><?php _e( 'Header', 'instagram-feed' ); ?></a>
1395
  <a href="#loadmore"><?php _e( "'Load More' Button", 'instagram-feed' ); ?></a>
1396
  <a href="#follow"><?php _e( "'Follow' Button", 'instagram-feed' ); ?></a>
1397
+ <a href="#gdpr"><?php _e( 'GDPR', 'instagram-feed' ); ?></a>
1398
+ <a href="#customcss"><?php _e( 'Custom CSS', 'instagram-feed' ); ?></a>
1399
  <a href="#customjs"><?php _e( 'Custom JavaScript', 'instagram-feed' ); ?></a>
1400
+ </p>
1401
 
1402
  <input type="hidden" name="<?php echo $sb_instagram_customize_hidden_field; ?>" value="Y">
1403
 
2228
  </table>
2229
  </div>
2230
 
2231
+ <hr id="gdpr" />
2232
+ <h3><?php _e('GDPR', 'instagram-feed'); ?></h3>
2233
+
2234
+ <table class="form-table">
2235
+ <tbody>
2236
+ <tr>
2237
+ <th class="bump-left"><label class="bump-left"><?php _e("Enable GDPR settings", 'instagram-feed'); ?></label><code class="sbi_shortcode"> gdpr
2238
+ Eg: gdpr=yes</code></th>
2239
+ <td>
2240
+
2241
+ <?php
2242
+ $select_options = array(
2243
+ array(
2244
+ 'label' => __( 'Automatic', 'instagram-feed' ),
2245
+ 'value' => 'auto'
2246
+ ),
2247
+ array(
2248
+ 'label' => __( 'Yes', 'instagram-feed' ),
2249
+ 'value' => 'yes'
2250
+ ),
2251
+ array(
2252
+ 'label' => __( 'No', 'instagram-feed' ),
2253
+ 'value' => 'no'
2254
+ )
2255
+ )
2256
+ ?>
2257
+ <?php
2258
+ $gdpr_list = "<ul class='sbi-list'>
2259
+ <li>" . __('Only local images (not from Instagram\'s CDN) will be displayed in the feed.', 'instagram-feed') . "</li>
2260
+ <li>" . __('Placeholder blank images will be displayed until images are available.', 'instagram-feed') . "</li>
2261
+ </ul>";
2262
+ ?>
2263
+ <div>
2264
+ <select name="gdpr" id="sbi_gdpr_setting">
2265
+ <?php foreach ( $select_options as $select_option ) :
2266
+ $selected = $select_option['value'] === $gdpr ? ' selected' : '';
2267
+ ?>
2268
+ <option value="<?php echo esc_attr( $select_option['value'] ); ?>"<?php echo $selected; ?> ><?php echo esc_html( $select_option['label'] ); ?></option>
2269
+ <?php endforeach; ?>
2270
+ </select>
2271
+ <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'instagram-feed'); ?></a>
2272
+ <div class="sbi_tooltip gdpr_tooltip">
2273
+
2274
+ <p><span><?php _e("Yes", "instagram-feed" ); ?>:</span> <?php _e("Enabling this setting prevents all images and videos from being loaded directly from Instagram's servers (CDN) to prevent any requests to external websites in your browser. To accommodate this, some features of the plugin will be disabled or limited.", "instagram-feed" ); ?> <a href="JavaScript:void(0);" class="sbi_show_gdpr_list"><?php _e( 'What will be limited?', 'instagram-feed' ); ?></a></p>
2275
 
2276
+ <?php echo "<div class='sbi_gdpr_list'>" . $gdpr_list . '</div>'; ?>
2277
+
2278
+
2279
+ <p><span><?php _e("No", "instagram-feed" ); ?>:</span> <?php _e("The plugin will still make some requests to load and display images and videos directly from Instagram.", "instagram-feed" ); ?></p>
2280
+
2281
+
2282
+ <p><span><?php _e("Automatic", "instagram-feed" ); ?>:</span> <?php echo sprintf( __( 'The plugin will only load images and videos directly from Instagram if consent has been given by one of these integrated %s', 'instagram-feed' ), '<a href="https://smashballoon.com/doc/gdpr-plugin-list/?instagram" target="_blank" rel="noopener">' . __( 'GDPR cookie plugins', 'instagram-feed' ) . '</a>' ); ?></p>
2283
+
2284
+ <p><?php echo sprintf( __( '%s to learn more about GDPR compliance in the Instagram Feed plugin.', 'instagram-feed' ), '<a href="https://smashballoon.com/doc/instagram-feed-gdpr-compliance/?instagram" target="_blank" rel="noopener">'. __( 'Click here', 'instagram-feed' ).'</a>' ); ?></p>
2285
+ </div>
2286
+ </div>
2287
+
2288
+ <?php if ( ! SB_Instagram_GDPR_Integrations::gdpr_tests_successful() ) :
2289
+ $errors = SB_Instagram_GDPR_Integrations::gdpr_tests_error_message();
2290
+ ?>
2291
+ <div class="sb_instagram_box sbi_gdpr_error">
2292
+ <div class="sb_instagram_box_setting">
2293
+ <p>
2294
+ <strong><?php _e( 'Error:', 'instagram-feed' ); ?></strong> <?php _e("Due to a configuration issue on your web server, the GDPR setting is unable to be enabled.", "instagram-feed" ); ?></p>
2295
+ <p>
2296
+ <?php echo $errors; ?>
2297
+ </p>
2298
+ </div>
2299
+ </div>
2300
+ <?php else: ?>
2301
+
2302
+ <div class="sbi_gdpr_auto">
2303
+ <?php if ( SB_Instagram_GDPR_Integrations::gdpr_plugins_active() ) :
2304
+ $active_plugin = SB_Instagram_GDPR_Integrations::gdpr_plugins_active();
2305
+ ?>
2306
+ <div class="sbi_gdpr_plugin_active">
2307
+ <div class="sbi_active">
2308
+ <p>
2309
+ <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="check-circle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-check-circle fa-w-16 fa-2x"><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" class=""></path></svg>
2310
+ <b><?php echo sprintf( __( '%s detected', 'instagram-feed' ), $active_plugin ); ?></b>
2311
+ <br />
2312
+ <?php _e( 'Some Instagram Feed features will be limited for visitors to ensure GDPR compliance until they give consent.', 'instagram-feed' ); ?>
2313
+ <a href="JavaScript:void(0);" class="sbi_show_gdpr_list"><?php _e( 'What will be limited?', 'instagram-feed' ); ?></a>
2314
+ </p>
2315
+ <?php echo "<div class='sbi_gdpr_list'>" . $gdpr_list . '</div>'; ?>
2316
+ </div>
2317
+
2318
+ </div>
2319
+ <?php else: ?>
2320
+ <div class="sb_instagram_box">
2321
+ <div class="sb_instagram_box_setting">
2322
+ <p><?php echo sprintf( __( 'No GDPR consent plugin detected. Install a compatible %sGDPR consent plugin%s, or manually enable the setting above to display a GDPR compliant version of the feed to all visitors.', 'instagram-feed' ), '<a href="https://smashballoon.com/doc/gdpr-plugin-list/?instagram" target="_blank" rel="noopener">', '</a>' ); ?></p>
2323
+ </div>
2324
+ </div>
2325
+ <?php endif; ?>
2326
+ </div>
2327
+
2328
+ <div class="sb_instagram_box sbi_gdpr_yes">
2329
+ <div class="sb_instagram_box_setting">
2330
+ <p><?php _e( "No requests will be made to third-party websites. To accommodate this, some features of the plugin will be limited:", 'instagram-feed' ); ?></p>
2331
+ <?php echo $gdpr_list; ?>
2332
+ </div>
2333
+ </div>
2334
+
2335
+ <div class="sb_instagram_box sbi_gdpr_no">
2336
+ <div class="sb_instagram_box_setting">
2337
+ <p><?php _e( "The plugin will function as normal and load images directly from Instagram.", 'instagram-feed' ); ?></p>
2338
+ </div>
2339
+ </div>
2340
+
2341
+ <?php endif; ?>
2342
+ </td>
2343
+ </tr>
2344
+
2345
+ </tbody>
2346
+ </table>
2347
 
2348
  <hr id="customcss" />
2349
  <h3><?php _e('Misc', 'instagram-feed'); ?></h3>
2477
  </table>
2478
  <table class="form-table">
2479
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2480
  <tr>
2481
  <th class="bump-left"><label class="bump-left"><?php _e("Enable Custom Templates", 'instagram-feed'); ?></label></th>
2482
  <td>
3300
  echo 'Feed with error: ' . esc_url( get_the_permalink( $error_page ) ). "\n";
3301
  }?>
3302
 
3303
+ ## GDPR: ##
3304
+ <?php
3305
+ if ( ! SB_Instagram_GDPR_Integrations::gdpr_tests_successful() ) :
3306
+ $errors = SB_Instagram_GDPR_Integrations::gdpr_tests_error_message();
3307
+ ?><?php echo $errors; ?>
3308
+ <?php endif; ?>
3309
+
3310
  ## oEmbed: ##
3311
  <?php
3312
  $oembed_token_settings = get_option( 'sbi_oembed_token', array() );
inc/class-sb-instagram-api-connect.php CHANGED
@@ -228,6 +228,9 @@ class SB_Instagram_API_Connect
228
  $error = '<p><b>' . sprintf( __( 'Error: Permission for the Smash Balloon App is not valid or has expired.', 'instagram-feed' ), $user_name ) . ' ' . __( 'Feed will not update.', 'instagram-feed' ) . '</b></p>';
229
  $error .= '<p>' . sprintf( __( 'API error %s:', 'instagram-feed' ), $response['error']['code'] ) . ' ' . $response['error']['message'] . '</p>';
230
  $sb_instagram_posts_manager->add_error( 'at_100_' . $user_name, array( 'Business 100 Error', $error, $response['error']['code'] ) );
 
 
 
231
  $sb_instagram_posts_manager->add_frontend_error( 'at_100_' . $user_name, $error );
232
 
233
  } else {
@@ -269,9 +272,12 @@ class SB_Instagram_API_Connect
269
  $options['connected_accounts'] = $connected_accounts;
270
 
271
  update_option( 'sb_instagram_settings', $options );
272
-
273
  global $sb_instagram_posts_manager;
274
- $sb_instagram_posts_manager->add_error( 'error_18', array( 'Too many hashtags', $response['error']['error_user_msg'] ) );
 
 
 
 
275
 
276
  } elseif ( (int)$response['error']['code'] === 10 ) {
277
  $user_name = $error_connected_account['username'];
228
  $error = '<p><b>' . sprintf( __( 'Error: Permission for the Smash Balloon App is not valid or has expired.', 'instagram-feed' ), $user_name ) . ' ' . __( 'Feed will not update.', 'instagram-feed' ) . '</b></p>';
229
  $error .= '<p>' . sprintf( __( 'API error %s:', 'instagram-feed' ), $response['error']['code'] ) . ' ' . $response['error']['message'] . '</p>';
230
  $sb_instagram_posts_manager->add_error( 'at_100_' . $user_name, array( 'Business 100 Error', $error, $response['error']['code'] ) );
231
+ if ( current_user_can( $cap ) ) {
232
+ $error .= '<p class="sbi-error-directions"><a href="https://smashballoon.com/instagram-feed/docs/errors/" target="_blank" rel="noopener">' . __( 'Directions on how to resolve this issue', 'instagram-feed' ) . '</a></p>';
233
+ }
234
  $sb_instagram_posts_manager->add_frontend_error( 'at_100_' . $user_name, $error );
235
 
236
  } else {
272
  $options['connected_accounts'] = $connected_accounts;
273
 
274
  update_option( 'sb_instagram_settings', $options );
 
275
  global $sb_instagram_posts_manager;
276
+ $error = '<p><b>' . __( 'Error: Hashtag limit of 30 unique hashtags per week has been reached.', 'instagram-feed' ) . '</b>';
277
+ $error .= '<p>' . __( 'If you need to display more than 30 hashtag feeds on your site, consider connecting an additional business account from a separate Instagram and Facebook account.', 'instagram-feed' );
278
+
279
+ $sb_instagram_posts_manager->add_frontend_error( 'hashtag_limit_reached', $error );
280
+ $sb_instagram_posts_manager->add_error( 'error_18', array( 'Too many hashtags', $error ) );
281
 
282
  } elseif ( (int)$response['error']['code'] === 10 ) {
283
  $user_name = $error_connected_account['username'];
inc/class-sb-instagram-cron-updater.php CHANGED
@@ -163,7 +163,11 @@ class SB_Instagram_Cron_Updater
163
  */
164
  public static function get_feed_cache_option_names() {
165
  global $wpdb;
166
- $feed_caches = array();
 
 
 
 
167
 
168
  $results = $wpdb->get_results( "
169
  SELECT option_name
163
  */
164
  public static function get_feed_cache_option_names() {
165
  global $wpdb;
166
+ $feed_caches = apply_filters( 'sbi_feed_cache_option_names', array() );
167
+
168
+ if ( ! empty( $feed_caches ) ) {
169
+ return $feed_caches;
170
+ }
171
 
172
  $results = $wpdb->get_results( "
173
  SELECT option_name
inc/class-sb-instagram-display-elements.php CHANGED
@@ -133,6 +133,9 @@ class SB_Instagram_Display_Elements
133
  && $resized_images[ $post_id ]['id'] !== 'error' ) {
134
  $media_url = sbi_get_resized_uploads_url() . $resized_images[ $post_id ]['id'] . 'full.jpg';
135
  } else {
 
 
 
136
  $media_type = $post['media_type'];
137
  if ( $media_type === 'CAROUSEL_ALBUM'
138
  || $media_type === 'VIDEO'
133
  && $resized_images[ $post_id ]['id'] !== 'error' ) {
134
  $media_url = sbi_get_resized_uploads_url() . $resized_images[ $post_id ]['id'] . 'full.jpg';
135
  } else {
136
+ if ( SB_Instagram_GDPR_Integrations::doing_gdpr( $settings ) ) {
137
+ return trailingslashit( SBI_PLUGIN_URL ) . 'img/thumb-placeholder.png';
138
+ }
139
  $media_type = $post['media_type'];
140
  if ( $media_type === 'CAROUSEL_ALBUM'
141
  || $media_type === 'VIDEO'
inc/class-sb-instagram-feed.php CHANGED
@@ -377,6 +377,8 @@ class SB_Instagram_Feed
377
 
378
  global $wpdb;
379
 
 
 
380
  $posts_table_name = $wpdb->prefix . SBI_INSTAGRAM_POSTS_TYPE;
381
  $feeds_posts_table_name = $wpdb->prefix . SBI_INSTAGRAM_FEEDS_POSTS;
382
 
@@ -654,6 +656,7 @@ class SB_Instagram_Feed
654
  } else {
655
 
656
  if ( $this->can_try_another_request( $type, $connected_accounts_for_feed[ $term ] ) ) {
 
657
  $this->add_report( 'trying other accounts' );
658
  $i = 0;
659
  $attempted = array( $connected_accounts_for_feed[ $term ]['user_id'] );
@@ -707,10 +710,13 @@ class SB_Instagram_Feed
707
  }
708
  }
709
  $i++;
 
 
710
  }
711
  }
712
 
713
  if ( ! $success && $error ) {
 
714
  if ( $connection->is_wp_error() ) {
715
  SB_Instagram_API_Connect::handle_wp_remote_get_error( $error );
716
  } else {
@@ -827,6 +833,16 @@ class SB_Instagram_Feed
827
 
828
  $full_file_name = $resized_url . $this->header_data['username'] . '.jpg';
829
  $this->header_data['local_avatar'] = $full_file_name;
 
 
 
 
 
 
 
 
 
 
830
  }
831
  if ( empty( $this->header_data['bio'] )
832
  && isset( $connected_accounts_for_feed[ $first_user ]['bio'] ) ) {
@@ -1069,6 +1085,9 @@ class SB_Instagram_Feed
1069
  if ( $settings['ajax_post_load'] ) {
1070
  $flags[] = 'ajaxPostLoad';
1071
  }
 
 
 
1072
  if ( isset( $_GET['sbi_debug'] ) ) {
1073
  $flags[] = 'debug';
1074
  }
@@ -1079,6 +1098,8 @@ class SB_Instagram_Feed
1079
  $flags[] = 'testAjax';
1080
  }
1081
 
 
 
1082
  if ( ! empty( $flags ) ) {
1083
  $other_atts .= ' data-sbi-flags="' . implode(',', $flags ) . '"';
1084
  }
@@ -1156,7 +1177,7 @@ class SB_Instagram_Feed
1156
  return '';
1157
  }
1158
  $sbi_options = sbi_get_database_settings();
1159
- $font_method = isset( $sbi_options['sbi_font_method'] ) ? $sbi_options['sbi_font_method'] : 'svg';
1160
  $upload = wp_upload_dir();
1161
  $resized_url = trailingslashit( $upload['baseurl'] ) . trailingslashit( SBI_UPLOADS_NAME );
1162
 
@@ -1349,7 +1370,7 @@ class SB_Instagram_Feed
1349
 
1350
  $image_ids = array();
1351
  $post_index = $offset;
1352
- $icon_type = $settings['font_method'];
1353
  $resized_images = $this->get_resized_images();
1354
 
1355
  foreach ( $posts as $post ) {
377
 
378
  global $wpdb;
379
 
380
+ $offset = max( 0, $offset );
381
+
382
  $posts_table_name = $wpdb->prefix . SBI_INSTAGRAM_POSTS_TYPE;
383
  $feeds_posts_table_name = $wpdb->prefix . SBI_INSTAGRAM_FEEDS_POSTS;
384
 
656
  } else {
657
 
658
  if ( $this->can_try_another_request( $type, $connected_accounts_for_feed[ $term ] ) ) {
659
+
660
  $this->add_report( 'trying other accounts' );
661
  $i = 0;
662
  $attempted = array( $connected_accounts_for_feed[ $term ]['user_id'] );
710
  }
711
  }
712
  $i++;
713
+ } else {
714
+ $error = $connection->get_data();
715
  }
716
  }
717
 
718
  if ( ! $success && $error ) {
719
+
720
  if ( $connection->is_wp_error() ) {
721
  SB_Instagram_API_Connect::handle_wp_remote_get_error( $error );
722
  } else {
833
 
834
  $full_file_name = $resized_url . $this->header_data['username'] . '.jpg';
835
  $this->header_data['local_avatar'] = $full_file_name;
836
+ } else {
837
+ if ( !$sb_instagram_posts_manager->image_resizing_disabled() && ! isset( $connected_accounts_for_feed[ $first_user ]['local_avatar'] ) ) {
838
+ if ( sbi_store_local_avatar( $connected_accounts_for_feed[ $first_user ] ) ) {
839
+ $upload = wp_upload_dir();
840
+ $resized_url = trailingslashit( $upload['baseurl'] ) . trailingslashit( SBI_UPLOADS_NAME );
841
+
842
+ $full_file_name = $resized_url . $this->header_data['username'] . '.jpg';
843
+ $this->header_data['local_avatar'] = $full_file_name;
844
+ }
845
+ }
846
  }
847
  if ( empty( $this->header_data['bio'] )
848
  && isset( $connected_accounts_for_feed[ $first_user ]['bio'] ) ) {
1085
  if ( $settings['ajax_post_load'] ) {
1086
  $flags[] = 'ajaxPostLoad';
1087
  }
1088
+ if ( SB_Instagram_GDPR_Integrations::doing_gdpr( $settings ) ) {
1089
+ $flags[] = 'gdpr';
1090
+ }
1091
  if ( isset( $_GET['sbi_debug'] ) ) {
1092
  $flags[] = 'debug';
1093
  }
1098
  $flags[] = 'testAjax';
1099
  }
1100
 
1101
+ $flags = apply_filters( 'sbi_flags', $flags, $settings );
1102
+
1103
  if ( ! empty( $flags ) ) {
1104
  $other_atts .= ' data-sbi-flags="' . implode(',', $flags ) . '"';
1105
  }
1177
  return '';
1178
  }
1179
  $sbi_options = sbi_get_database_settings();
1180
+ $font_method = 'svg';
1181
  $upload = wp_upload_dir();
1182
  $resized_url = trailingslashit( $upload['baseurl'] ) . trailingslashit( SBI_UPLOADS_NAME );
1183
 
1370
 
1371
  $image_ids = array();
1372
  $post_index = $offset;
1373
+ $icon_type = 'svg';
1374
  $resized_images = $this->get_resized_images();
1375
 
1376
  foreach ( $posts as $post ) {
inc/class-sb-instagram-gdpr-integrations.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class SB_Instagram_GDPR_Integrations
4
+ *
5
+ * Adds GDPR related workarounds for third-party plugins:
6
+ * https://wordpress.org/plugins/cookie-law-info/
7
+ *
8
+ * @since 2.6/5.9
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ die( '-1' );
13
+ }
14
+
15
+ class SB_Instagram_GDPR_Integrations {
16
+
17
+ /**
18
+ * Undoing of Cookie Notice's Instagram Feed related code
19
+ * needs to be done late.
20
+ */
21
+ public static function init() {
22
+ add_filter( 'wt_cli_third_party_scripts', array( 'SB_Instagram_GDPR_Integrations', 'undo_script_blocking' ), 11 );
23
+ }
24
+
25
+ /**
26
+ * Prevents changes made to how JavaScript file is added to
27
+ * pages.
28
+ */
29
+ public static function undo_script_blocking() {
30
+ $settings = sbi_get_database_settings();
31
+ if ( ! SB_Instagram_GDPR_Integrations::doing_gdpr( $settings ) ) {
32
+ return;
33
+ }
34
+ remove_filter( 'wt_cli_third_party_scripts', 'wt_cli_instagram_feed_script' );
35
+ }
36
+
37
+ /**
38
+ * Whether or not consent plugins that Instagram Feed
39
+ * is compatible with are active.
40
+ *
41
+ * @return bool|string
42
+ */
43
+ public static function gdpr_plugins_active() {
44
+ if ( class_exists( 'Cookie_Notice' ) ) {
45
+ return 'Cookie Notice by dFactory';
46
+ }
47
+ if ( function_exists( 'run_cookie_law_info' ) ) {
48
+ return 'GDPR Cookie Consent by WebToffee';
49
+ }
50
+ if ( class_exists( 'Cookiebot_WP' ) ) {
51
+ return 'Cookiebot by Cybot A/S';
52
+ }
53
+ if ( class_exists( 'COMPLIANZ' ) ) {
54
+ return 'Complianz by Really Simple Plugins';
55
+ }
56
+ if ( function_exists('BorlabsCookieHelper') ) {
57
+ return 'Borlabs Cookie by Borlabs';
58
+ }
59
+
60
+ return false;
61
+ }
62
+
63
+ /**
64
+ * GDPR features can be added automatically, forced enabled,
65
+ * or forced disabled.
66
+ *
67
+ * @param $settings
68
+ *
69
+ * @return bool
70
+ */
71
+ public static function doing_gdpr( $settings ) {
72
+ $gdpr = isset( $settings['gdpr'] ) ? $settings['gdpr'] : 'auto';
73
+ if ( $gdpr === 'no' ) {
74
+ return false;
75
+ }
76
+ if ( $gdpr === 'yes' ) {
77
+ return true;
78
+ }
79
+ return (SB_Instagram_GDPR_Integrations::gdpr_plugins_active() !== false);
80
+ }
81
+
82
+ /**
83
+ * GDPR features are reliant on the image resizing features
84
+ *
85
+ * @param bool $retest
86
+ *
87
+ * @return bool
88
+ */
89
+ public static function gdpr_tests_successful( $retest = true ) {
90
+ $sbi_statuses_option = get_option( 'sbi_statuses', array() );
91
+
92
+ if ( ! isset( $sbi_statuses_option['gdpr'] ) || $retest ) {
93
+ $test_image = trailingslashit( SBI_PLUGIN_URL ) . 'img/placeholder.png';
94
+
95
+ $image_editor = wp_get_image_editor( $test_image );
96
+
97
+ // not uncommon for the image editor to not work using it this way
98
+ if ( ! is_wp_error( $image_editor ) ) {
99
+ $sbi_statuses_option['gdpr']['image_editor'] = true;
100
+ } else {
101
+ $sbi_statuses_option['gdpr']['image_editor'] = false;
102
+ }
103
+
104
+ $upload = wp_upload_dir();
105
+ $upload_dir = $upload['basedir'];
106
+ $upload_dir = trailingslashit( $upload_dir ) . SBI_UPLOADS_NAME;
107
+ if ( file_exists( $upload_dir ) ) {
108
+ $sbi_statuses_option['gdpr']['upload_dir'] = true;
109
+ } else {
110
+ $sbi_statuses_option['gdpr']['upload_dir'] = false;
111
+ }
112
+
113
+ global $wpdb;
114
+ $table_name = esc_sql( $wpdb->prefix . SBI_INSTAGRAM_POSTS_TYPE );
115
+ $sbi_statuses_option['gdpr']['tables'] = true;
116
+ if ( $wpdb->get_var( "show tables like '$table_name'" ) != $table_name ) {
117
+ $sbi_statuses_option['gdpr']['tables'] = false;
118
+ }
119
+
120
+ $feeds_posts_table_name = esc_sql( $wpdb->prefix . SBI_INSTAGRAM_FEEDS_POSTS );
121
+ if ( $wpdb->get_var( "show tables like '$feeds_posts_table_name'" ) != $feeds_posts_table_name ) {
122
+ $sbi_statuses_option['gdpr']['tables'] = false;
123
+ }
124
+
125
+ update_option( 'sbi_statuses', $sbi_statuses_option );
126
+ }
127
+
128
+ if ( ! $sbi_statuses_option['gdpr']['upload_dir']
129
+ || ! $sbi_statuses_option['gdpr']['tables']
130
+ || ! $sbi_statuses_option['gdpr']['image_editor'] ) {
131
+ return false;
132
+ }
133
+
134
+ return true;
135
+ }
136
+
137
+ public static function gdpr_tests_error_message() {
138
+ $sbi_statuses_option = get_option( 'sbi_statuses', array() );
139
+
140
+ $errors = array();
141
+ if ( ! $sbi_statuses_option['gdpr']['upload_dir'] ) {
142
+ $errors[] = __( 'A folder for storing resized images was not successfully created.' );
143
+ }
144
+ if ( ! $sbi_statuses_option['gdpr']['tables'] ) {
145
+ $errors[] = __( 'Tables used for storing information about resized images were not successfully created.' );
146
+ }
147
+ if ( ! $sbi_statuses_option['gdpr']['image_editor'] ) {
148
+ $errors[] = sprintf( __( 'An image editor is not available on your server. Instagram Feed is unable to create local resized images. See %sthis FAQ%s for more information' ), '<a href="https://smashballoon.com/doc/the-images-in-my-feed-are-missing-or-showing-errors/" target="_blank" rel="noopener noreferrer">','</a>' );
149
+ }
150
+
151
+ return implode( '<br>', $errors );
152
+ }
153
+
154
+ }
inc/class-sb-instagram-oembed.php CHANGED
@@ -113,6 +113,8 @@ class SB_Instagram_Oembed
113
  $oembed_url = SB_Instagram_Oembed::oembed_url();
114
  if ( $oembed_url ) {
115
  $providers['#https?://(www\.)?instagr(\.am|am\.com)/(p|tv)/.*#i'] = array( $oembed_url, true );
 
 
116
  }
117
 
118
  return $providers;
113
  $oembed_url = SB_Instagram_Oembed::oembed_url();
114
  if ( $oembed_url ) {
115
  $providers['#https?://(www\.)?instagr(\.am|am\.com)/(p|tv)/.*#i'] = array( $oembed_url, true );
116
+ // for WP 4.9
117
+ $providers['#https?://(www\.)?instagr(\.am|am\.com)/p/.*#i'] = array( $oembed_url, true );
118
  }
119
 
120
  return $providers;
inc/class-sb-instagram-parse.php CHANGED
@@ -268,14 +268,18 @@ class SB_Instagram_Parse
268
  } elseif ( ! empty( $header_data['local_avatar'] ) ) {
269
  return $header_data['local_avatar'];
270
  } else {
271
- if ( isset( $header_data['profile_picture'] ) ) {
272
- return $header_data['profile_picture'];
273
- } elseif ( isset( $header_data['profile_picture_url'] ) ) {
274
- return $header_data['profile_picture_url'];
275
- } elseif ( isset( $header_data['user'] ) ) {
276
- return $header_data['user']['profile_picture'];
277
- } elseif ( isset( $header_data['data'] ) ) {
278
- return $header_data['data']['profile_picture'];
 
 
 
 
279
  }
280
  }
281
 
268
  } elseif ( ! empty( $header_data['local_avatar'] ) ) {
269
  return $header_data['local_avatar'];
270
  } else {
271
+ if ( ! SB_Instagram_GDPR_Integrations::doing_gdpr( $settings ) ) {
272
+ if ( isset( $header_data['profile_picture'] ) ) {
273
+ return $header_data['profile_picture'];
274
+ } elseif ( isset( $header_data['profile_picture_url'] ) ) {
275
+ return $header_data['profile_picture_url'];
276
+ } elseif ( isset( $header_data['user'] ) ) {
277
+ return $header_data['user']['profile_picture'];
278
+ } elseif ( isset( $header_data['data'] ) ) {
279
+ return $header_data['data']['profile_picture'];
280
+ }
281
+ } else {
282
+ return trailingslashit( SBI_PLUGIN_URL ) . 'img/thumb-placeholder.png';
283
  }
284
  }
285
 
inc/class-sb-instagram-posts-manager.php CHANGED
@@ -252,7 +252,7 @@ class SB_Instagram_Posts_Manager
252
  foreach ( $connected_accounts as $account_id => $data ) {
253
 
254
  if ( isset( $data['local_avatar'] ) ) {
255
- $connected_accounts[ $account_id ]['local_avatar'] = false;
256
  }
257
 
258
  }
@@ -408,6 +408,7 @@ class SB_Instagram_Posts_Manager
408
  if ( isset( $this->frontend_errors['api_delay'] ) ) {
409
  return array( 'api_delay' => $this->frontend_errors['api_delay'] );
410
  }
 
411
  return $this->frontend_errors;
412
  }
413
 
@@ -559,7 +560,6 @@ class SB_Instagram_Posts_Manager
559
 
560
  if ( in_array( (int)$errors['api'][2], $critical_error_numbers, true ) ) {
561
  $are_errors = true;
562
-
563
  }
564
  } elseif ( strpos( $error_key, 'at_' ) !== false ) {
565
  $are_errors = true;
252
  foreach ( $connected_accounts as $account_id => $data ) {
253
 
254
  if ( isset( $data['local_avatar'] ) ) {
255
+ unset( $connected_accounts[ $account_id ]['local_avatar'] );
256
  }
257
 
258
  }
408
  if ( isset( $this->frontend_errors['api_delay'] ) ) {
409
  return array( 'api_delay' => $this->frontend_errors['api_delay'] );
410
  }
411
+
412
  return $this->frontend_errors;
413
  }
414
 
560
 
561
  if ( in_array( (int)$errors['api'][2], $critical_error_numbers, true ) ) {
562
  $are_errors = true;
 
563
  }
564
  } elseif ( strpos( $error_key, 'at_' ) !== false ) {
565
  $are_errors = true;
inc/class-sb-instagram-settings.php CHANGED
@@ -107,7 +107,7 @@ class SB_Instagram_Settings {
107
  'feedid' => isset( $db['sb_instagram_feed_id'] ) ? $db['sb_instagram_feed_id'] : false,
108
  'resizeprocess' => isset( $db['sb_instagram_resizeprocess'] ) ? $db['sb_instagram_resizeprocess'] : 'background',
109
  'customtemplates' => isset( $db['custom_template'] ) ? $db['custom_template'] : '',
110
-
111
  ), $atts );
112
 
113
  $this->settings['customtemplates'] = $this->settings['customtemplates'] === 'true' || $this->settings['customtemplates'] === 'on';
@@ -125,7 +125,6 @@ class SB_Instagram_Settings {
125
  $this->settings['disable_resize'] = isset( $db['sb_instagram_disable_resize'] ) && ($db['sb_instagram_disable_resize'] === 'on');
126
  $this->settings['favor_local'] = ! isset( $db['sb_instagram_favor_local'] ) || ($db['sb_instagram_favor_local'] === 'on') || ($db['sb_instagram_favor_local'] === true);
127
  $this->settings['backup_cache_enabled'] = ! isset( $db['sb_instagram_backup'] ) || ($db['sb_instagram_backup'] === 'on') || $db['sb_instagram_backup'] === true;
128
- $this->settings['font_method'] = isset( $db['sbi_font_method'] ) ? $db['sbi_font_method'] : 'svg';
129
  $this->settings['headeroutside'] = ($this->settings['headeroutside'] === true || $this->settings['headeroutside'] === 'on' || $this->settings['headeroutside'] === 'true');
130
  $this->settings['disable_js_image_loading'] = isset( $db['disable_js_image_loading'] ) && ($db['disable_js_image_loading'] === 'on');
131
  $this->settings['ajax_post_load'] = isset( $db['sb_ajax_initial'] ) && ($db['sb_ajax_initial'] === 'on');
@@ -155,6 +154,10 @@ class SB_Instagram_Settings {
155
  $this->settings['ajax_post_load'] = false;
156
  $this->settings['disable_js_image_loading'] = true;
157
  }
 
 
 
 
158
  }
159
 
160
  /**
@@ -218,7 +221,6 @@ class SB_Instagram_Settings {
218
  'sb_instagram_disable_resize',
219
  'disable_js_image_loading',
220
  'enqueue_js_in_head',
221
- 'sbi_font_method',
222
  'sb_instagram_disable_awesome',
223
  'sb_ajax_initial',
224
  'use_custom'
@@ -829,7 +831,6 @@ class SB_Instagram_Settings {
829
  'sb_ajax_initial' => false,
830
  'enqueue_css_in_shortcode' => false,
831
  'sb_instagram_disable_mob_swipe' => false,
832
- 'sbi_font_method' => 'svg',
833
  'sbi_br_adjust' => true,
834
  'sb_instagram_media_vine' => false,
835
  'custom_template' => false,
107
  'feedid' => isset( $db['sb_instagram_feed_id'] ) ? $db['sb_instagram_feed_id'] : false,
108
  'resizeprocess' => isset( $db['sb_instagram_resizeprocess'] ) ? $db['sb_instagram_resizeprocess'] : 'background',
109
  'customtemplates' => isset( $db['custom_template'] ) ? $db['custom_template'] : '',
110
+ 'gdpr' => isset( $db['gdpr'] ) ? $db['gdpr'] : 'auto',
111
  ), $atts );
112
 
113
  $this->settings['customtemplates'] = $this->settings['customtemplates'] === 'true' || $this->settings['customtemplates'] === 'on';
125
  $this->settings['disable_resize'] = isset( $db['sb_instagram_disable_resize'] ) && ($db['sb_instagram_disable_resize'] === 'on');
126
  $this->settings['favor_local'] = ! isset( $db['sb_instagram_favor_local'] ) || ($db['sb_instagram_favor_local'] === 'on') || ($db['sb_instagram_favor_local'] === true);
127
  $this->settings['backup_cache_enabled'] = ! isset( $db['sb_instagram_backup'] ) || ($db['sb_instagram_backup'] === 'on') || $db['sb_instagram_backup'] === true;
 
128
  $this->settings['headeroutside'] = ($this->settings['headeroutside'] === true || $this->settings['headeroutside'] === 'on' || $this->settings['headeroutside'] === 'true');
129
  $this->settings['disable_js_image_loading'] = isset( $db['disable_js_image_loading'] ) && ($db['disable_js_image_loading'] === 'on');
130
  $this->settings['ajax_post_load'] = isset( $db['sb_ajax_initial'] ) && ($db['sb_ajax_initial'] === 'on');
154
  $this->settings['ajax_post_load'] = false;
155
  $this->settings['disable_js_image_loading'] = true;
156
  }
157
+
158
+ if ( SB_Instagram_GDPR_Integrations::doing_gdpr( $this->settings ) ) {
159
+ SB_Instagram_GDPR_Integrations::init();
160
+ }
161
  }
162
 
163
  /**
221
  'sb_instagram_disable_resize',
222
  'disable_js_image_loading',
223
  'enqueue_js_in_head',
 
224
  'sb_instagram_disable_awesome',
225
  'sb_ajax_initial',
226
  'use_custom'
831
  'sb_ajax_initial' => false,
832
  'enqueue_css_in_shortcode' => false,
833
  'sb_instagram_disable_mob_swipe' => false,
 
834
  'sbi_br_adjust' => true,
835
  'sb_instagram_media_vine' => false,
836
  'custom_template' => false,
inc/class-sb-instagram-token-refresher.php CHANGED
@@ -161,8 +161,10 @@ class SB_Instagram_Token_Refresher
161
  */
162
  public function get_last_error_code() {
163
  if ( isset( $this->report['error_log'] ) ) {
164
- $error = $this->report['error_log']->get_data();
165
- return $error['error']['code'];
 
 
166
  }
167
  return false;
168
  }
161
  */
162
  public function get_last_error_code() {
163
  if ( isset( $this->report['error_log'] ) ) {
164
+ if ( ! is_wp_error( $this->report['error_log'] ) ) {
165
+ $error = $this->report['error_log']->get_data();
166
+ return $error['error']['code'];
167
+ }
168
  }
169
  return false;
170
  }
inc/if-functions.php CHANGED
@@ -365,6 +365,7 @@ function sbi_process_submitted_resize_ids() {
365
  $atts = $atts_raw; // now sanitized
366
 
367
  $offset = isset( $_POST['offset'] ) ? (int)$_POST['offset'] : 0;
 
368
 
369
  $database_settings = sbi_get_database_settings();
370
  $instagram_feed_settings = new SB_Instagram_Settings( $atts, $database_settings );
@@ -376,18 +377,27 @@ function sbi_process_submitted_resize_ids() {
376
  $instagram_feed_settings->set_feed_type_and_terms();
377
  $instagram_feed_settings->set_transient_name();
378
  $transient_name = $instagram_feed_settings->get_transient_name();
 
 
 
 
 
379
 
380
  if ( $transient_name !== $feed_id ) {
381
  die( 'id does not match' );
382
  }
383
 
384
- sbi_resize_posts_by_id( $images_need_resizing, $transient_name, $instagram_feed_settings->get_settings() );
385
 
386
  global $sb_instagram_posts_manager;
387
 
388
- $sb_instagram_posts_manager->update_successful_ajax_test();
 
 
 
389
 
390
- die();
 
391
  }
392
  add_action( 'wp_ajax_sbi_resized_images_submit', 'sbi_process_submitted_resize_ids' );
393
  add_action( 'wp_ajax_nopriv_sbi_resized_images_submit', 'sbi_process_submitted_resize_ids' );
@@ -523,6 +533,58 @@ function sbi_resize_posts_by_id( $ids, $transient_name, $settings, $offset = 0 )
523
  }
524
  }
525
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
  /**
527
  * Get the settings in the database with defaults
528
  *
@@ -575,7 +637,6 @@ function sbi_get_database_settings() {
575
  'sb_ajax_initial' => false,
576
  'enqueue_css_in_shortcode' => false,
577
  'sb_instagram_disable_mob_swipe' => false,
578
- 'sbi_font_method' => 'svg',
579
  'sb_instagram_disable_awesome' => false
580
  );
581
  $sbi_settings = get_option( 'sb_instagram_settings', array() );
@@ -964,20 +1025,9 @@ function sb_instagram_scripts_enqueue() {
964
  wp_enqueue_style( 'sb_instagram_styles', trailingslashit( SBI_PLUGIN_URL ) . 'css/sbi-styles.min.css', array(), SBIVER );
965
  }
966
 
967
- $font_method = isset( $sb_instagram_settings['sbi_font_method'] ) ? $sb_instagram_settings['sbi_font_method'] : 'svg';
968
 
969
- if ( isset( $sb_instagram_settings['sb_instagram_disable_awesome'] ) ) {
970
- $disable_font_awesome = isset( $sb_instagram_settings['sb_instagram_disable_awesome'] ) ? $sb_instagram_settings['sb_instagram_disable_awesome'] === 'on' : false;
971
- } else {
972
- $disable_font_awesome = isset( $sb_instagram_settings['sb_instagram_disable_font'] ) ? $sb_instagram_settings['sb_instagram_disable_font'] === 'on' : false;
973
- }
974
-
975
- if ( $font_method === 'fontfile' && ! $disable_font_awesome ) {
976
- wp_enqueue_style( 'sb-font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
977
- }
978
-
979
  $data = array(
980
- 'font_method' => $font_method,
981
  'resized_url' => sbi_get_resized_uploads_url(),
982
  'placeholder' => trailingslashit( SBI_PLUGIN_URL ) . 'img/placeholder.png'
983
  );
365
  $atts = $atts_raw; // now sanitized
366
 
367
  $offset = isset( $_POST['offset'] ) ? (int)$_POST['offset'] : 0;
368
+ $cache_all = isset( $_POST['cache_all'] ) ? $_POST['cache_all'] === 'true' : false;
369
 
370
  $database_settings = sbi_get_database_settings();
371
  $instagram_feed_settings = new SB_Instagram_Settings( $atts, $database_settings );
377
  $instagram_feed_settings->set_feed_type_and_terms();
378
  $instagram_feed_settings->set_transient_name();
379
  $transient_name = $instagram_feed_settings->get_transient_name();
380
+ $settings = $instagram_feed_settings->get_settings();
381
+
382
+ if ( $cache_all ) {
383
+ $settings['cache_all'] = true;
384
+ }
385
 
386
  if ( $transient_name !== $feed_id ) {
387
  die( 'id does not match' );
388
  }
389
 
390
+ sbi_resize_posts_by_id( $images_need_resizing, $transient_name, $settings );
391
 
392
  global $sb_instagram_posts_manager;
393
 
394
+ if ( ! $sb_instagram_posts_manager->image_resizing_disabled() ) {
395
+ echo sbi_json_encode( SB_Instagram_Feed::get_resized_images_source_set( $settings['minnum'], $offset - $settings['minnum'], $feed_id ) );
396
+ die();
397
+ }
398
 
399
+
400
+ die( 'resizing success' );
401
  }
402
  add_action( 'wp_ajax_sbi_resized_images_submit', 'sbi_process_submitted_resize_ids' );
403
  add_action( 'wp_ajax_nopriv_sbi_resized_images_submit', 'sbi_process_submitted_resize_ids' );
533
  }
534
  }
535
 
536
+ function sbi_store_local_avatar( $connected_account ) {
537
+ $sbi_settings = get_option( 'sb_instagram_settings', array() );
538
+ $connected_accounts = $sbi_settings['connected_accounts'];
539
+ if ( sbi_create_local_avatar( $connected_account['username'], $connected_account['profile_picture'] ) ) {
540
+ $connected_accounts[ $connected_account['user_id'] ]['local_avatar'] = true;
541
+ } else {
542
+ $connected_accounts[ $connected_account['user_id'] ]['local_avatar'] = false;
543
+ }
544
+
545
+
546
+ $sbi_settings['connected_accounts'] = $connected_accounts;
547
+
548
+ update_option( 'sb_instagram_settings', $sbi_settings );
549
+
550
+ return $connected_accounts[ $connected_account['user_id'] ]['local_avatar'];
551
+ }
552
+
553
+ function sbi_create_local_avatar( $username, $file_name ) {
554
+ $image_editor = wp_get_image_editor( $file_name );
555
+
556
+ if ( ! is_wp_error( $image_editor ) ) {
557
+ $upload = wp_upload_dir();
558
+
559
+ $full_file_name = trailingslashit( $upload['basedir'] ) . trailingslashit( SBI_UPLOADS_NAME ) . $username . '.jpg';
560
+
561
+ $saved_image = $image_editor->save( $full_file_name );
562
+
563
+ if ( ! $saved_image ) {
564
+ global $sb_instagram_posts_manager;
565
+
566
+ $sb_instagram_posts_manager->add_error( 'image_editor_save', array(
567
+ __( 'Error saving edited image.', 'instagram-feed' ),
568
+ $full_file_name
569
+ ) );
570
+ } else {
571
+ return true;
572
+ }
573
+ } else {
574
+ global $sb_instagram_posts_manager;
575
+
576
+ $message = __( 'Error editing image.', 'instagram-feed' );
577
+ if ( isset( $image_editor ) && isset( $image_editor->errors ) ) {
578
+ foreach ( $image_editor->errors as $key => $item ) {
579
+ $message .= ' ' . $key . '- ' . $item[0] . ' |';
580
+ }
581
+ }
582
+
583
+ $sb_instagram_posts_manager->add_error( 'image_editor', array( $file_name, $message ) );
584
+ }
585
+ return false;
586
+ }
587
+
588
  /**
589
  * Get the settings in the database with defaults
590
  *
637
  'sb_ajax_initial' => false,
638
  'enqueue_css_in_shortcode' => false,
639
  'sb_instagram_disable_mob_swipe' => false,
 
640
  'sb_instagram_disable_awesome' => false
641
  );
642
  $sbi_settings = get_option( 'sb_instagram_settings', array() );
1025
  wp_enqueue_style( 'sb_instagram_styles', trailingslashit( SBI_PLUGIN_URL ) . 'css/sbi-styles.min.css', array(), SBIVER );
1026
  }
1027
 
 
1028
 
 
 
 
 
 
 
 
 
 
 
1029
  $data = array(
1030
+ 'font_method' => 'svg',
1031
  'resized_url' => sbi_get_resized_uploads_url(),
1032
  'placeholder' => trailingslashit( SBI_PLUGIN_URL ) . 'img/placeholder.png'
1033
  );
instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Smash Balloon Instagram Feed
4
  Plugin URI: https://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds.
6
- Version: 2.5.4
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
  if ( ! defined( 'SBIVER' ) ) {
26
- define( 'SBIVER', '2.5.4' );
27
  }
28
  // Db version.
29
  if ( ! defined( 'SBI_DBVERSION' ) ) {
@@ -97,6 +97,7 @@ if ( function_exists( 'sb_instagram_feed_init' ) ) {
97
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-cron-updater.php';
98
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-display-elements.php';
99
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-feed.php';
 
100
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-oembed.php';
101
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-parse.php';
102
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-post.php';
3
  Plugin Name: Smash Balloon Instagram Feed
4
  Plugin URI: https://smashballoon.com/instagram-feed
5
  Description: Display beautifully clean, customizable, and responsive Instagram feeds.
6
+ Version: 2.6
7
  Author: Smash Balloon
8
  Author URI: https://smashballoon.com/
9
  License: GPLv2 or later
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
  if ( ! defined( 'SBIVER' ) ) {
26
+ define( 'SBIVER', '2.6' );
27
  }
28
  // Db version.
29
  if ( ! defined( 'SBI_DBVERSION' ) ) {
97
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-cron-updater.php';
98
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-display-elements.php';
99
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-feed.php';
100
+ include_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-gdpr-integrations.php';
101
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-oembed.php';
102
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-parse.php';
103
  require_once trailingslashit( SBI_PLUGIN_DIR ) . 'inc/class-sb-instagram-post.php';
js/sb-instagram-2-2.js CHANGED
@@ -186,7 +186,7 @@ if(!sbi_js_exists) {
186
  }
187
  var feedOptions = {
188
  cols : $self.attr('data-cols'),
189
- colsmobile : $self.attr('data-colsmobile') !== 'same' ? $self.attr('data-colsmobile') : $self.attr('data-cols'),
190
  num : $self.attr('data-num'),
191
  imgRes : $self.attr('data-res'),
192
  feedID : $self.attr('data-feedid'),
@@ -196,6 +196,8 @@ if(!sbi_js_exists) {
196
  debugEnabled : (flags.indexOf('debug') > -1),
197
  favorLocal : (flags.indexOf('favorLocal') > -1),
198
  ajaxPostLoad : (flags.indexOf('ajaxPostLoad') > -1),
 
 
199
  autoMinRes : 1,
200
  general : general
201
  };
@@ -257,6 +259,10 @@ if(!sbi_js_exists) {
257
  SbiFeed.prototype = {
258
  init: function() {
259
  var feed = this;
 
 
 
 
260
  if ($(this.el).find('#sbi_mod_error').length) {
261
  $(this.el).prepend($(this.el).find('#sbi_mod_error'));
262
  }
@@ -279,6 +285,11 @@ if(!sbi_js_exists) {
279
  }, 500);
280
  });
281
 
 
 
 
 
 
282
  },
283
  initLayout: function() {
284
 
@@ -342,7 +353,6 @@ if(!sbi_js_exists) {
342
  }, function () {
343
  jQuery(this).stop().fadeTo(500, 1);
344
  });
345
-
346
  }); //End .sbi_item each
347
 
348
  //Remove the new class after 500ms, once the sorting is done
@@ -360,6 +370,40 @@ if(!sbi_js_exists) {
360
  });
361
  }, 500);
362
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
  afterNewImagesRevealed: function() {
364
  this.listenForVisibilityChange();
365
  this.sendNeedsResizingToServer();
@@ -382,7 +426,8 @@ if(!sbi_js_exists) {
382
  sendNeedsResizingToServer: function() {
383
  var feed = this;
384
  if (feed.needsResizing.length > 0 && feed.settings.resizingEnabled) {
385
- var itemOffset = $(this.el).find('.sbi_item').length;
 
386
 
387
  var submitData = {
388
  action: 'sbi_resized_images_submit',
@@ -390,6 +435,7 @@ if(!sbi_js_exists) {
390
  offset: itemOffset,
391
  feed_id: feed.settings.feedID,
392
  atts: feed.settings.shortCodeAtts,
 
393
  };
394
  var onSuccess = function(data) {
395
  if (data.trim().indexOf('{') === 0) {
@@ -397,6 +443,16 @@ if(!sbi_js_exists) {
397
  if (feed.settings.debugEnabled) {
398
  console.log(response);
399
  }
 
 
 
 
 
 
 
 
 
 
400
  }
401
  };
402
  sbiAjax(submitData,onSuccess);
@@ -509,6 +565,19 @@ if(!sbi_js_exists) {
509
  return;
510
  }
511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  $.each(imgSrcSet, function (index, value) {
513
  if (value === currentUrl) {
514
  currentRes = parseInt(index);
@@ -545,11 +614,13 @@ if(!sbi_js_exists) {
545
  if (newRes > currentRes || currentUrl === window.sbi.options.placeholder || forceChange) {
546
  if (feed.settings.debugEnabled) {
547
  var reason = currentUrl === window.sbi.options.placeholder ? 'was placeholder' : 'too small';
548
- console.log('raise res for ' + currentUrl, reason);
549
  }
550
  var newUrl = imgSrcSet[newRes].split("?ig_cache_key")[0];
551
- $item.find('.sbi_photo img').attr('src', newUrl);
552
- $item.find('.sbi_photo').css('background-image', 'url("' + newUrl + '")');
 
 
553
  currentRes = newRes;
554
 
555
  if (feed.settings.imgRes === 'auto') {
@@ -561,7 +632,7 @@ if(!sbi_js_exists) {
561
 
562
  if ($this_image.get(0).naturalWidth !== 1000 && newAspectRatio > aspectRatio && !checked) {
563
  if (feed.settings.debugEnabled) {
564
- console.log('raise res again for aspect ratio change ' + currentUrl);
565
  }
566
  checked = true;
567
  minImageWidth = $item.find('.sbi_photo').innerWidth();
@@ -728,6 +799,9 @@ if(!sbi_js_exists) {
728
  getImageUrls: function ($item) {
729
  var srcSet = JSON.parse($item.find('.sbi_photo').attr('data-img-src-set').replace(/\\\//g, '/')),
730
  id = $item.attr('id').replace('sbi_', '');
 
 
 
731
  if (typeof this.resizedImages[id] !== 'undefined'
732
  && this.resizedImages[id] !== 'video'
733
  && this.resizedImages[id] !== 'pending'
@@ -847,6 +921,47 @@ if(!sbi_js_exists) {
847
  }
848
 
849
  return parseInt(returnCols);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
850
  }
851
  };
852
 
@@ -868,6 +983,21 @@ if(!sbi_js_exists) {
868
  });
869
  }
870
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
871
  })(jQuery);
872
 
873
  jQuery(document).ready(function($) {
@@ -886,6 +1016,58 @@ if(!sbi_js_exists) {
886
  }
887
  }
888
  sbi_init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
889
  });
890
 
891
  } // if sbi_js_exists
186
  }
187
  var feedOptions = {
188
  cols : $self.attr('data-cols'),
189
+ colsmobile : typeof $self.attr('data-colsmobile') !== 'undefined' && $self.attr('data-colsmobile') !== 'same' ? $self.attr('data-colsmobile') : $self.attr('data-cols'),
190
  num : $self.attr('data-num'),
191
  imgRes : $self.attr('data-res'),
192
  feedID : $self.attr('data-feedid'),
196
  debugEnabled : (flags.indexOf('debug') > -1),
197
  favorLocal : (flags.indexOf('favorLocal') > -1),
198
  ajaxPostLoad : (flags.indexOf('ajaxPostLoad') > -1),
199
+ gdpr : (flags.indexOf('gdpr') > -1),
200
+ consentGiven : false,
201
  autoMinRes : 1,
202
  general : general
203
  };
259
  SbiFeed.prototype = {
260
  init: function() {
261
  var feed = this;
262
+ feed.settings.consentGiven = feed.checkConsent();
263
+ if ($(this.el).find('.sbi_photo').parent('p').length) {
264
+ $(this.el).addClass('sbi_no_autop');
265
+ }
266
  if ($(this.el).find('#sbi_mod_error').length) {
267
  $(this.el).prepend($(this.el).find('#sbi_mod_error'));
268
  }
285
  }, 500);
286
  });
287
 
288
+ $(this.el).find('.sbi_item').each(function() {
289
+ feed.lazyLoadCheck($(this));
290
+ });
291
+
292
+
293
  },
294
  initLayout: function() {
295
 
353
  }, function () {
354
  jQuery(this).stop().fadeTo(500, 1);
355
  });
 
356
  }); //End .sbi_item each
357
 
358
  //Remove the new class after 500ms, once the sorting is done
370
  });
371
  }, 500);
372
  },
373
+ lazyLoadCheck: function($item){
374
+ var feed = this;
375
+ if ($item.find('.sbi_photo').length && !$item.closest('.sbi').hasClass('sbi-no-ll-check')) {
376
+ var imgSrcSet = feed.getImageUrls($item),
377
+ maxResImage = typeof imgSrcSet[640] !== 'undefined' ? imgSrcSet[640] : $item.find('.sbi_photo').attr('data-full-res');
378
+
379
+ if (!feed.settings.consentGiven) {
380
+ if (maxResImage.indexOf('scontent') > -1) {
381
+ return;
382
+ }
383
+ }
384
+
385
+ $item.find('.sbi_photo img').each(function() {
386
+ if (maxResImage && typeof $(this).attr('data-src') !== 'undefined') {
387
+ $(this).attr('data-src',maxResImage);
388
+ }
389
+ if (maxResImage && typeof $(this).attr('data-orig-src') !== 'undefined') {
390
+ $(this).attr('data-orig-src',maxResImage);
391
+ }
392
+ $(this).on('load',function() {
393
+ if (!$(this).hasClass('sbi-replaced')
394
+ && $(this).attr('src').indexOf('placeholder') > -1) {
395
+ $(this).addClass('sbi-replaced');
396
+ if (maxResImage) {
397
+ $(this).attr('src',maxResImage);
398
+ if ($(this).closest('.sbi_imgLiquid_bgSize').length) {
399
+ $(this).closest('.sbi_imgLiquid_bgSize').css('background-image', 'url(' + maxResImage + ')');
400
+ }
401
+ }
402
+ }
403
+ });
404
+ });
405
+ }
406
+ },
407
  afterNewImagesRevealed: function() {
408
  this.listenForVisibilityChange();
409
  this.sendNeedsResizingToServer();
426
  sendNeedsResizingToServer: function() {
427
  var feed = this;
428
  if (feed.needsResizing.length > 0 && feed.settings.resizingEnabled) {
429
+ var itemOffset = $(this.el).find('.sbi_item').length,
430
+ cacheAll = typeof feed.settings.general.cache_all !== 'undefined' ? feed.settings.general.cache_all : false;
431
 
432
  var submitData = {
433
  action: 'sbi_resized_images_submit',
435
  offset: itemOffset,
436
  feed_id: feed.settings.feedID,
437
  atts: feed.settings.shortCodeAtts,
438
+ cache_all: cacheAll
439
  };
440
  var onSuccess = function(data) {
441
  if (data.trim().indexOf('{') === 0) {
443
  if (feed.settings.debugEnabled) {
444
  console.log(response);
445
  }
446
+ for (var property in response) {
447
+ if (response.hasOwnProperty(property)) {
448
+ feed.resizedImages[property] = response[property];
449
+ }
450
+ }
451
+ feed.maybeRaiseImageResolution();
452
+
453
+ setTimeout(function() {
454
+ feed.afterResize();
455
+ },500);
456
  }
457
  };
458
  sbiAjax(submitData,onSuccess);
565
  return;
566
  }
567
 
568
+ if (imgSrcSet.length < 1) {
569
+ if ($item.find('.sbi_link_area').length) {
570
+ $item.find('.sbi_link_area').attr('href',window.sbi.options.placeholder.replace('placeholder.png','thumb-placeholder.png'))
571
+ }
572
+ return;
573
+ } else if ($item.find('.sbi_link_area').length && $item.find('.sbi_link_area').attr('href') === window.sbi.options.placeholder.replace('placeholder.png','thumb-placeholder.png')
574
+ || !feed.settings.consentGiven) {
575
+ $item.find('.sbi_link_area').attr('href',imgSrcSet[imgSrcSet.length - 1])
576
+ }
577
+ if (typeof imgSrcSet[640] !== 'undefined') {
578
+ $item.find('.sbi_photo').attr('data-full-res',imgSrcSet[640]);
579
+ }
580
+
581
  $.each(imgSrcSet, function (index, value) {
582
  if (value === currentUrl) {
583
  currentRes = parseInt(index);
614
  if (newRes > currentRes || currentUrl === window.sbi.options.placeholder || forceChange) {
615
  if (feed.settings.debugEnabled) {
616
  var reason = currentUrl === window.sbi.options.placeholder ? 'was placeholder' : 'too small';
617
+ console.log('rais res for ' + currentUrl, reason);
618
  }
619
  var newUrl = imgSrcSet[newRes].split("?ig_cache_key")[0];
620
+ if (currentUrl !== newUrl) {
621
+ $item.find('.sbi_photo img').attr('src', newUrl);
622
+ $item.find('.sbi_photo').css('background-image', 'url("' + newUrl + '")');
623
+ }
624
  currentRes = newRes;
625
 
626
  if (feed.settings.imgRes === 'auto') {
632
 
633
  if ($this_image.get(0).naturalWidth !== 1000 && newAspectRatio > aspectRatio && !checked) {
634
  if (feed.settings.debugEnabled) {
635
+ console.log('rais res again for aspect ratio change ' + currentUrl);
636
  }
637
  checked = true;
638
  minImageWidth = $item.find('.sbi_photo').innerWidth();
799
  getImageUrls: function ($item) {
800
  var srcSet = JSON.parse($item.find('.sbi_photo').attr('data-img-src-set').replace(/\\\//g, '/')),
801
  id = $item.attr('id').replace('sbi_', '');
802
+ if (!this.settings.consentGiven) {
803
+ srcSet = [];
804
+ }
805
  if (typeof this.resizedImages[id] !== 'undefined'
806
  && this.resizedImages[id] !== 'video'
807
  && this.resizedImages[id] !== 'pending'
921
  }
922
 
923
  return parseInt(returnCols);
924
+ },
925
+ checkConsent: function() {
926
+ if (this.settings.consentGiven || !this.settings.gdpr) {
927
+ return true;
928
+ }
929
+ if (typeof CLI_Cookie !== "undefined") { // GDPR Cookie Consent by WebToffee
930
+ if (CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) !== null) {
931
+
932
+ this.settings.consentGiven = CLI_Cookie.read('cookielawinfo-checkbox-non-necessary') === 'yes';
933
+ }
934
+
935
+ } else if (typeof window.cnArgs !== "undefined") { // Cookie Notice by dFactory
936
+ var value = "; " + document.cookie,
937
+ parts = value.split( '; cookie_notice_accepted=' );
938
+
939
+ if ( parts.length === 2 ) {
940
+ var val = parts.pop().split( ';' ).shift();
941
+
942
+ this.settings.consentGiven = (val === 'true');
943
+ }
944
+ } else if (typeof window.cookieconsent !== 'undefined') { // Complianz by Really Simple Plugins
945
+ this.settings.consentGiven = sbiCmplzGetCookie('complianz_consent_status') === 'allow';
946
+ } else if (typeof window.Cookiebot !== "undefined") { // Cookiebot by Cybot A/S
947
+ this.settings.consentGiven = Cookiebot.consented;
948
+ }
949
+
950
+ var evt = jQuery.Event('sbicheckconsent');
951
+ evt.feed = this;
952
+ jQuery(window).trigger(evt);
953
+
954
+ return this.settings.consentGiven; // GDPR not enabled
955
+ },
956
+ afterConsentToggled: function() {
957
+ if (this.checkConsent()) {
958
+ var feed = this;
959
+ feed.maybeRaiseImageResolution();
960
+
961
+ setTimeout(function() {
962
+ feed.afterResize();
963
+ },500);
964
+ }
965
  }
966
  };
967
 
983
  });
984
  }
985
 
986
+ function sbiCmplzGetCookie(cname) {
987
+ var name = cname + "="; //Create the cookie name variable with cookie name concatenate with = sign
988
+ var cArr = window.document.cookie.split(';'); //Create cookie array by split the cookie by ';'
989
+
990
+ //Loop through the cookies and return the cookie value if it find the cookie name
991
+ for (var i = 0; i < cArr.length; i++) {
992
+ var c = cArr[i].trim();
993
+ //If the name is the cookie string at position 0, we found the cookie and return the cookie value
994
+ if (c.indexOf(name) == 0)
995
+ return c.substring(name.length, c.length);
996
+ }
997
+
998
+ return "";
999
+ }
1000
+
1001
  })(jQuery);
1002
 
1003
  jQuery(document).ready(function($) {
1016
  }
1017
  }
1018
  sbi_init();
1019
+
1020
+ // Cookie Notice by dFactory
1021
+ $('#cookie-notice a').click(function() {
1022
+ setTimeout(function() {
1023
+ $.each(window.sbi.feeds,function(index){
1024
+ window.sbi.feeds[ index ].afterConsentToggled();
1025
+ });
1026
+ },1000);
1027
+ });
1028
+
1029
+ // Cookie Notice by dFactory
1030
+ $('#cookie-law-info-bar a').click(function() {
1031
+ setTimeout(function() {
1032
+ $.each(window.sbi.feeds,function(index){
1033
+ window.sbi.feeds[ index ].afterConsentToggled();
1034
+ });
1035
+ },1000);
1036
+ });
1037
+
1038
+ // GDPR Cookie Consent by WebToffee
1039
+ $('.cli-user-preference-checkbox').click(function(){
1040
+ setTimeout(function() {
1041
+ $.each(window.sbi.feeds,function(index){
1042
+ window.sbi.feeds[ index ].settings.consentGiven = false;
1043
+ window.sbi.feeds[ index ].afterConsentToggled();
1044
+ });
1045
+ },1000);
1046
+ });
1047
+
1048
+ // Cookiebot
1049
+ $(window).on('CookiebotOnAccept', function (event) {
1050
+ $.each(window.sbi.feeds,function(index){
1051
+ window.sbi.feeds[ index ].settings.consentGiven = true;
1052
+ window.sbi.feeds[ index ].afterConsentToggled();
1053
+ });
1054
+ });
1055
+
1056
+ // Complianz by Really Simple Plugins
1057
+ $(document).on('cmplzAcceptAll', function (event) {
1058
+ $.each(window.sbi.feeds,function(index){
1059
+ window.sbi.feeds[ index ].settings.consentGiven = true;
1060
+ window.sbi.feeds[ index ].afterConsentToggled();
1061
+ });
1062
+ });
1063
+
1064
+ // Complianz by Really Simple Plugins
1065
+ $(document).on('cmplzRevoke', function (event) {
1066
+ $.each(window.sbi.feeds,function(index){
1067
+ window.sbi.feeds[ index ].settings.consentGiven = false;
1068
+ window.sbi.feeds[ index ].afterConsentToggled();
1069
+ });
1070
+ });
1071
  });
1072
 
1073
  } // if sbi_js_exists
js/sb-instagram-2-2.min.js CHANGED
@@ -1 +1 @@
1
- var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(!function(i){function e(){var i,e,s,t=t||{VER:"0.9.944"};t.bgs_Available=!1,t.bgs_CheckRunned=!1,function(i){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},function(){if(!t.bgs_CheckRunned){t.bgs_CheckRunned=!0;var e=i('<span style="background-size:cover" />');i("body").append(e),function(){var i=e[0];if(i&&window.getComputedStyle){var s=window.getComputedStyle(i,null);s&&s.backgroundSize&&(t.bgs_Available="cover"===s.backgroundSize)}}(),e.remove()}}();var s=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(e){function a(){(r.responsive||h.data("sbi_imgLiquid_oldProcessed"))&&h.data("sbi_imgLiquid_settings")&&(r=h.data("sbi_imgLiquid_settings"),l.actualSize=l.get(0).offsetWidth+l.get(0).offsetHeight/1e4,l.sizeOld&&l.actualSize!==l.sizeOld&&o(),l.sizeOld=l.actualSize,setTimeout(a,r.responsiveCheckTime))}function n(){h.data("sbi_imgLiquid_error",!0),l.addClass("sbi_imgLiquid_error"),r.onItemError&&r.onItemError(e,l,h),d()}function o(){var i,s,t,a,n,o,g,u,m=0,_=0,f=l.width(),c=l.height();void 0===h.data("owidth")&&h.data("owidth",h[0].width),void 0===h.data("oheight")&&h.data("oheight",h[0].height),r.fill===f/c>=h.data("owidth")/h.data("oheight")?(i="100%",s="auto",t=Math.floor(f),a=Math.floor(f*(h.data("oheight")/h.data("owidth")))):(i="auto",s="100%",t=Math.floor(c*(h.data("owidth")/h.data("oheight"))),a=Math.floor(c)),g=f-t,"left"===(n=r.horizontalAlign.toLowerCase())&&(_=0),"center"===n&&(_=.5*g),"right"===n&&(_=g),-1!==n.indexOf("%")&&((n=parseInt(n.replace("%",""),10))>0&&(_=g*n*.01)),u=c-a,"left"===(o=r.verticalAlign.toLowerCase())&&(m=0),"center"===o&&(m=.5*u),"bottom"===o&&(m=u),-1!==o.indexOf("%")&&((o=parseInt(o.replace("%",""),10))>0&&(m=u*o*.01)),r.hardPixels&&(i=t,s=a),h.css({width:i,height:s,"margin-left":Math.floor(_),"margin-top":Math.floor(m)}),h.data("sbi_imgLiquid_oldProcessed")||(h.fadeTo(r.fadeInTime,1),h.data("sbi_imgLiquid_oldProcessed",!0),r.removeBoxBackground&&l.css("background-image","none"),l.addClass("sbi_imgLiquid_nobgSize"),l.addClass("sbi_imgLiquid_ready")),r.onItemFinish&&r.onItemFinish(e,l,h),d()}function d(){e===s.length-1&&s.settings.onFinish&&s.settings.onFinish()}var r=s.settings,l=i(this),h=i("img:first",l);return h.length?(h.data("sbi_imgLiquid_settings")?(l.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r=i.extend({},h.data("sbi_imgLiquid_settings"),s.options)):r=i.extend({},s.settings,function(){var i={};if(s.settings.useDataHtmlAttr){var e=l.attr("data-sbi_imgLiquid-fill"),a=l.attr("data-sbi_imgLiquid-horizontalAlign"),n=l.attr("data-sbi_imgLiquid-verticalAlign");("true"===e||"false"===e)&&(i.fill=Boolean("true"===e)),void 0===a||"left"!==a&&"center"!==a&&"right"!==a&&-1===a.indexOf("%")||(i.horizontalAlign=a),void 0===n||"top"!==n&&"bottom"!==n&&"center"!==n&&-1===n.indexOf("%")||(i.verticalAlign=n)}return t.isIE&&s.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}()),h.data("sbi_imgLiquid_settings",r),r.onItemStart&&r.onItemStart(e,l,h),void(t.bgs_Available&&r.useBackgroundSize?(-1===l.css("background-image").indexOf(encodeURI(h.attr("src")))&&l.css({"background-image":'url("'+encodeURI(h.attr("src"))+'")'}),l.css({"background-size":r.fill?"cover":"contain","background-position":(r.horizontalAlign+" "+r.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",l).css({display:"block",width:"100%",height:"100%"}),i("img",l).css({display:"none"}),r.onItemFinish&&r.onItemFinish(e,l,h),l.addClass("sbi_imgLiquid_bgSize"),l.addClass("sbi_imgLiquid_ready"),d()):function s(){if(h.data("oldSrc")&&h.data("oldSrc")!==h.attr("src")){var t=h.clone().removeAttr("style");return t.data("sbi_imgLiquid_settings",h.data("sbi_imgLiquid_settings")),h.parent().prepend(t),h.remove(),(h=t)[0].width=0,void setTimeout(s,10)}return h.data("sbi_imgLiquid_oldProcessed")?void o():(h.data("sbi_imgLiquid_oldProcessed",!1),h.data("oldSrc",h.attr("src")),i("img:not(:first)",l).css("display","none"),l.css({overflow:"hidden"}),h.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),h.on("error",n),h[0].onerror=n,function i(){h.data("sbi_imgLiquid_error")||h.data("sbi_imgLiquid_loaded")||h.data("sbi_imgLiquid_oldProcessed")||(l.is(":visible")&&h[0].complete&&h[0].width>0&&h[0].height>0?(h.data("sbi_imgLiquid_loaded",!0),setTimeout(o,e*r.delay)):setTimeout(i,r.timecheckvisibility))}(),void a())}())):void n()})}})}(jQuery),i=t.injectCss,e=document.getElementsByTagName("head")[0],(s=document.createElement("style")).type="text/css",s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i)),e.appendChild(s)}function s(){this.feeds={},this.options=sb_instagram_js_options}function t(i,e,s){this.el=i,this.index=e,this.settings=s,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1}function a(e,s){i.ajax({url:sbiajaxurl,type:"post",data:e,success:s})}s.prototype={createPage:function(e,s){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),i(".sbi_no_js_error_message").remove(),i(".sbi_no_js").removeClass("sbi_no_js"),e(s)},createFeeds:function(e){e.whenFeedsCreated(i(".sbi").each(function(e){i(this).attr("data-sbi-index",e+1);var s=i(this),n=void 0!==s.attr("data-sbi-flags")?s.attr("data-sbi-flags").split(","):[],o=void 0!==s.attr("data-options")?JSON.parse(s.attr("data-options")):{};if(n.indexOf("testAjax")>-1){window.sbi.triggeredTest=!0;a({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")})}var d={cols:s.attr("data-cols"),colsmobile:"same"!==s.attr("data-colsmobile")?s.attr("data-colsmobile"):s.attr("data-cols"),num:s.attr("data-num"),imgRes:s.attr("data-res"),feedID:s.attr("data-feedid"),shortCodeAtts:s.attr("data-shortcode-atts"),resizingEnabled:-1===n.indexOf("resizeDisable"),imageLoadEnabled:-1===n.indexOf("imageLoadDisable"),debugEnabled:n.indexOf("debug")>-1,favorLocal:n.indexOf("favorLocal")>-1,ajaxPostLoad:n.indexOf("ajaxPostLoad")>-1,autoMinRes:1,general:o};window.sbi.feeds[e]=function(i,e,s){return new t(i,e,s)}(this,e,d),window.sbi.feeds[e].setResizedImages(),window.sbi.feeds[e].init();var r=jQuery.Event("sbiafterfeedcreate");r.feed=window.sbi.feeds[e],jQuery(window).trigger(r)}))},afterFeedsCreated:function(){i(".sb_instagram_header").each(function(){var e=i(this);e.find(".sbi_header_link").hover(function(){e.find(".sbi_header_img_hover").addClass("sbi_fade_in")},function(){e.find(".sbi_header_img_hover").removeClass("sbi_fade_in")})})},encodeHTML:function(i){return void 0===i?"":i.replace(/(>)/g,"&gt;").replace(/(<)/g,"&lt;").replace(/(&lt;br\/&gt;)/g,"<br>").replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)}},t.prototype={init:function(){var e=this;i(this.el).find("#sbi_mod_error").length&&i(this.el).prepend(i(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var s,t=(s=0,function(i,e){clearTimeout(s),s=setTimeout(i,e)});jQuery(window).resize(function(){t(function(){e.afterResize()},500)})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var e=i(this.el),s=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){e.find(".sbi_loader").addClass("sbi_hidden"),e.find(".sbi_btn_text").removeClass("sbi_hidden"),s.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var e=i(this.el);e.find(".sbi-screenreader").each(function(){i(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),e.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var i=10;e.find(".sbi_transition").each(function(){var e=jQuery(this);setTimeout(function(){e.removeClass("sbi_transition")},i),i+=10})},500)},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||i(".sbi_no_resraise").removeClass("sbi_no_resraise");var e=i.Event("sbiafterimagesloaded");e.el=i(this.el),i(window).trigger(e)},setResizedImages:function(){i(this.el).find(".sbi_resized_image_data").length&&void 0!==i(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===i(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(i(this.el).find(".sbi_resized_image_data").attr("data-resized")),i(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var e=this;if(e.needsResizing.length>0&&e.settings.resizingEnabled){var s=i(this.el).find(".sbi_item").length;a({action:"sbi_resized_images_submit",needs_resizing:e.needsResizing,offset:s,feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts},function(i){if(0===i.trim().indexOf("{")){var s=JSON.parse(i);e.settings.debugEnabled&&console.log(s)}})}},loadMoreButtonInit:function(){var e=i(this.el),s=this;e.find("#sbi_load .sbi_load_btn").off().on("click",function(){s.afterLoadMoreClicked(jQuery(this)),s.getNewPostSet()})},getNewPostSet:function(){var e=i(this.el),s=this;a({action:"sbi_load_more_clicked",offset:e.find(".sbi_item").length,feed_id:s.settings.feedID,atts:s.settings.shortCodeAtts,current_resolution:s.imageResolution},function(t){if(0===t.trim().indexOf("{")){var a=JSON.parse(t);s.settings.debugEnabled&&console.log(a),s.appendNewPosts(a.html),s.addResizedImages(a.resizedImages),s.settings.ajaxPostLoad?(s.settings.ajaxPostLoad=!1,s.afterInitialImagesLoaded()):s.afterNewImagesLoaded(),a.feedStatus.shouldPaginate?s.outOfPages=!1:(s.outOfPages=!0,e.find(".sbi_load_btn").hide()),i(".sbi_no_js").removeClass("sbi_no_js")}})},appendNewPosts:function(e){var s=i(this.el);s.find("#sbi_images .sbi_item").length?s.find("#sbi_images .sbi_item").last().after(e):s.find("#sbi_images").append(e)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var e=i(this.el),s=e.find(".sbi_photo").eq(0).innerWidth(),t=this.getColumnCount(),a=e.find("#sbi_images").innerWidth()-e.find("#sbi_images").width(),n=a/2;sbi_photo_width_manual=e.find("#sbi_images").width()/t-a,e.find(".sbi_photo").css("height",s),e.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;e.find(".sbi_owl2row-item").length&&(i=1);var s=e.find(".sbi_photo").eq(0).innerWidth()/i;s+=parseInt(n)*(2-i+2),e.find(".sbi-owl-nav div").css("top",s)},100)},maybeRaiseSingleImageResolution:function(e,s,t){var a=this,n=a.getImageUrls(e),o=e.find(".sbi_photo img").attr("src"),d=150,r=e.find("img").get(0),l=o===window.sbi.options.placeholder?1:r.naturalWidth/r.naturalHeight;t=void 0!==t&&t;if(!(e.hasClass("sbi_no_resraise")||e.hasClass("sbi_had_error")||e.find(".sbi_link_area").length&&e.find(".sbi_link_area").hasClass("sbi_had_error"))){i.each(n,function(i,e){e===o&&(d=parseInt(i),t=!1)});var h=640;switch(a.settings.imgRes){case"thumb":h=150;break;case"medium":h=320;break;case"full":h=640;break;default:var g=Math.max(a.settings.autoMinRes,e.find(".sbi_photo").innerWidth()),u=a.getBestResolutionForAuto(g,l,e);switch(u){case 320:h=320;break;case 150:h=150}}if(h>d||o===window.sbi.options.placeholder||t){if(a.settings.debugEnabled){var m=o===window.sbi.options.placeholder?"was placeholder":"too small";console.log("raise res for "+o,m)}var _=n[h].split("?ig_cache_key")[0];if(e.find(".sbi_photo img").attr("src",_),e.find(".sbi_photo").css("background-image",'url("'+_+'")'),d=h,"auto"===a.settings.imgRes){var f=!1;e.find(".sbi_photo img").on("load",function(){var s=i(this),t=s.get(0).naturalWidth/s.get(0).naturalHeight;if(1e3!==s.get(0).naturalWidth&&t>l&&!f){switch(a.settings.debugEnabled&&console.log("raise res again for aspect ratio change "+o),f=!0,g=e.find(".sbi_photo").innerWidth(),u=a.getBestResolutionForAuto(g,t,e),h=640,u){case 320:h=320;break;case 150:h=150}h>d&&(_=n[h].split("?ig_cache_key")[0],s.attr("src",_),s.closest(".sbi_photo").css("background-image",'url("'+_+'")')),"masonry"!==a.layout&&"highlight"!==a.layout||(i(a.el).find("#sbi_images").smashotope(a.isotopeArgs),setTimeout(function(){i(a.el).find("#sbi_images").smashotope(a.isotopeArgs)},500))}else if(a.settings.debugEnabled){var r=f?"already checked":"no aspect ratio change";console.log("not raising res for replacement "+o,r)}})}}e.find("img").on("error",function(){if(i(this).hasClass("sbi_img_error"))console.log("unfixed error "+i(this).attr("src"));else{var e;if(i(this).addClass("sbi_img_error"),i(this).attr("src").indexOf("media/?size=")>-1||i(this).attr("src").indexOf("cdninstagram")>-1||i(this).attr("src").indexOf("fbcdn")>-1)a.settings.favorLocal=!0,void 0!==(e=a.getImageUrls(i(this).closest(".sbi_item")))[640]&&(i(this).attr("src",e[640]),i(this).closest(".sbi_photo").css("background-image","url("+e[640]+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));else if("undefined"!==i(this).closest(".sbi_photo").attr("data-img-src-set"))void 0!==(e=JSON.parse(i(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(i(this).attr("src",e.d),i(this).closest(".sbi_photo").css("background-image","url("+e.d+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));setTimeout(function(){a.afterResize()},1500)}})}},maybeRaiseImageResolution:function(e){var s=this,t=void 0!==e&&!0===e?".sbi_item.sbi_new":".sbi_item",a=!s.isInitialized;i(s.el).find(t).each(function(e){!i(this).hasClass("sbi_num_diff_hide")&&i(this).find(".sbi_photo").length&&void 0!==i(this).find(".sbi_photo").attr("data-img-src-set")&&s.maybeRaiseSingleImageResolution(i(this),e,a)}),s.isInitialized=!0},getBestResolutionForAuto:function(e,s,t){(isNaN(s)||s<1)&&(s=1);var a=e*s,n=10*Math.ceil(a/10),o=[150,320,640];if(t.hasClass("sbi_highlighted")&&(n*=2),-1===o.indexOf(parseInt(n))){var d=!1;i.each(o,function(i,e){e>parseInt(n)&&!d&&(n=e,d=!0)})}return n},hideExtraImagesForWidth:function(){if("carousel"!==this.layout){var e=i(this.el),s=void 0!==e.attr("data-num")&&""!==e.attr("data-num")?parseInt(e.attr("data-num")):1,t=void 0!==e.attr("data-nummobile")&&""!==e.attr("data-nummobile")?parseInt(e.attr("data-nummobile")):s;i(window).width()<480?t<e.find(".sbi_item").length&&e.find(".sbi_item").slice(t-e.find(".sbi_item").length).addClass("sbi_num_diff_hide"):s<e.find(".sbi_item").length&&e.find(".sbi_item").slice(s-e.find(".sbi_item").length).addClass("sbi_num_diff_hide")}},setImageSizeClass:function(){var e=i(this.el);e.removeClass("sbi_small sbi_medium");var s=e.innerWidth(),t=parseInt(e.find("#sbi_images").outerWidth()-e.find("#sbi_images").width())/2,a=this.getColumnCount(),n=(s-t*(a+2))/a;n>120&&n<240?e.addClass("sbi_medium"):n<=120&&e.addClass("sbi_small")},setMinImageWidth:function(){i(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=i(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),s=i.attr("id").replace("sbi_","");if(void 0!==this.resizedImages[s]&&"video"!==this.resizedImages[s]&&"pending"!==this.resizedImages[s]&&"error"!==this.resizedImages[s].id&&"video"!==this.resizedImages[s].id&&"pending"!==this.resizedImages[s].id){if(void 0!==this.resizedImages[s].sizes){var t=[];void 0!==this.resizedImages[s].sizes.full&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"full.jpg",t.push(640)),void 0!==this.resizedImages[s].sizes.low&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"low.jpg",t.push(320)),void 0!==this.resizedImages[s].sizes.thumb&&(t.push(150),e[150]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"thumb.jpg"),this.settings.favorLocal&&(-1===t.indexOf(640)&&t.indexOf(320)>-1&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"low.jpg"),-1===t.indexOf(320)&&(t.indexOf(640)>-1?e[320]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"full.jpg":t.indexOf(150)>-1&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"thumb.jpg")),-1===t.indexOf(150)&&(t.indexOf(320)>-1?e[150]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"low.jpg":t.indexOf(640)>-1&&(e[150]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"full.jpg")))}}else(void 0===this.resizedImages[s]||void 0!==this.resizedImages[s].id&&"pending"!==this.resizedImages[s].id&&"error"!==this.resizedImages[s].id)&&this.addToNeedsResizing(s);return e},getAvatarUrl:function(i,e){if(""===i)return"";var s=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==s[i]?s[i]:"":void 0!==s[i]?s[i]:void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var s=i(this.el);e(),"function"==typeof s.find(".sbi_photo").sbi_imgLiquid&&s.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var e,s,t,a=this;e=jQuery,s={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},t={sbiCheckVisibility:function(i,e){if(jQuery.contains(document,i[0])){var s=e.sbiPreviousVisibility,a=i.is(":visible");e.sbiPreviousVisibility=a,null==s?e.runOnLoad&&e.callback(i,a):s!==a&&e.callback(i,a),setTimeout(function(){t.sbiCheckVisibility(i,e)},e.frequency)}}},e.fn.sbiVisibilityChanged=function(i){var a=e.extend({},s,i);return this.each(function(){t.sbiCheckVisibility(e(this),a)})},"function"==typeof i(this.el).filter(":hidden").sbiVisibilityChanged&&i(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){a.afterResize()},runOnLoad:!1})},getColumnCount:function(){var e=i(this.el),s=this.settings.cols,t=this.settings.colsmobile,a=s;return sbiWindowWidth=window.innerWidth,e.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&parseInt(s)>2&&parseInt(s)<7&&(a=2),sbiWindowWidth<640&&parseInt(s)>6&&parseInt(s)<11&&(a=4),sbiWindowWidth<=480&&parseInt(s)>2&&(a=1)):sbiWindowWidth<=480&&(a=t),parseInt(a)}},window.sbi_init=function(){window.sbi=new s,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(i){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:")),sbi_init()}));
1
+ var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(function(b){function e(){var r,i,e,s,l=l||{VER:"0.9.944"};l.bgs_Available=!1,l.bgs_CheckRunned=!1,(r=jQuery).fn.extend({sbi_imgLiquid:function(i){var e,s,t;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},l.bgs_CheckRunned||(l.bgs_CheckRunned=!0,e=r('<span style="background-size:cover" />'),r("body").append(e),(t=e[0])&&window.getComputedStyle&&((s=window.getComputedStyle(t,null))&&s.backgroundSize&&(l.bgs_Available="cover"===s.backgroundSize)),e.remove());var d=this;return this.options=i,this.settings=r.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(c){function s(){(f.responsive||_.data("sbi_imgLiquid_oldProcessed"))&&_.data("sbi_imgLiquid_settings")&&(f=_.data("sbi_imgLiquid_settings"),b.actualSize=b.get(0).offsetWidth+b.get(0).offsetHeight/1e4,b.sizeOld&&b.actualSize!==b.sizeOld&&n(),b.sizeOld=b.actualSize,setTimeout(s,f.responsiveCheckTime))}function t(){_.data("sbi_imgLiquid_error",!0),b.addClass("sbi_imgLiquid_error"),f.onItemError&&f.onItemError(c,b,_),u()}function n(){var i,e,s,t,n,a,o,d,r=0,l=0,h=b.width(),g=b.height();void 0===_.data("owidth")&&_.data("owidth",_[0].width),void 0===_.data("oheight")&&_.data("oheight",_[0].height),t=f.fill===h/g>=_.data("owidth")/_.data("oheight")?(i="100%",e="auto",s=Math.floor(h),Math.floor(h*(_.data("oheight")/_.data("owidth")))):(i="auto",e="100%",s=Math.floor(g*(_.data("owidth")/_.data("oheight"))),Math.floor(g)),o=h-s,"left"===(n=f.horizontalAlign.toLowerCase())&&(l=0),"center"===n&&(l=.5*o),"right"===n&&(l=o),-1===n.indexOf("%")||0<(n=parseInt(n.replace("%",""),10))&&(l=o*n*.01),d=g-t,"left"===(a=f.verticalAlign.toLowerCase())&&(r=0),"center"===a&&(r=.5*d),"bottom"===a&&(r=d),-1===a.indexOf("%")||0<(a=parseInt(a.replace("%",""),10))&&(r=d*a*.01),f.hardPixels&&(i=s,e=t),_.css({width:i,height:e,"margin-left":Math.floor(l),"margin-top":Math.floor(r)}),_.data("sbi_imgLiquid_oldProcessed")||(_.fadeTo(f.fadeInTime,1),_.data("sbi_imgLiquid_oldProcessed",!0),f.removeBoxBackground&&b.css("background-image","none"),b.addClass("sbi_imgLiquid_nobgSize"),b.addClass("sbi_imgLiquid_ready")),f.onItemFinish&&f.onItemFinish(c,b,_),u()}function u(){c===d.length-1&&d.settings.onFinish&&d.settings.onFinish()}var i,e,a,o,f=d.settings,b=r(this),_=r("img:first",b);return _.length?(f=_.data("sbi_imgLiquid_settings")?(b.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r.extend({},_.data("sbi_imgLiquid_settings"),d.options)):r.extend({},d.settings,(o={},d.settings.useDataHtmlAttr&&(i=b.attr("data-sbi_imgLiquid-fill"),e=b.attr("data-sbi_imgLiquid-horizontalAlign"),a=b.attr("data-sbi_imgLiquid-verticalAlign"),"true"!==i&&"false"!==i||(o.fill=Boolean("true"===i)),void 0===e||"left"!==e&&"center"!==e&&"right"!==e&&-1===e.indexOf("%")||(o.horizontalAlign=e),void 0===a||"top"!==a&&"bottom"!==a&&"center"!==a&&-1===a.indexOf("%")||(o.verticalAlign=a)),l.isIE&&d.settings.ieFadeInDisabled&&(o.fadeInTime=0),o)),_.data("sbi_imgLiquid_settings",f),f.onItemStart&&f.onItemStart(c,b,_),void(l.bgs_Available&&f.useBackgroundSize?(-1===b.css("background-image").indexOf(encodeURI(_.attr("src")))&&b.css({"background-image":'url("'+encodeURI(_.attr("src"))+'")'}),b.css({"background-size":f.fill?"cover":"contain","background-position":(f.horizontalAlign+" "+f.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),r("a:first",b).css({display:"block",width:"100%",height:"100%"}),r("img",b).css({display:"none"}),f.onItemFinish&&f.onItemFinish(c,b,_),b.addClass("sbi_imgLiquid_bgSize"),b.addClass("sbi_imgLiquid_ready"),u()):function i(){if(_.data("oldSrc")&&_.data("oldSrc")!==_.attr("src")){var e=_.clone().removeAttr("style");return e.data("sbi_imgLiquid_settings",_.data("sbi_imgLiquid_settings")),_.parent().prepend(e),_.remove(),(_=e)[0].width=0,void setTimeout(i,10)}return _.data("sbi_imgLiquid_oldProcessed")?void n():(_.data("sbi_imgLiquid_oldProcessed",!1),_.data("oldSrc",_.attr("src")),r("img:not(:first)",b).css("display","none"),b.css({overflow:"hidden"}),_.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),_.on("error",t),_[0].onerror=t,function i(){_.data("sbi_imgLiquid_error")||_.data("sbi_imgLiquid_loaded")||_.data("sbi_imgLiquid_oldProcessed")||(b.is(":visible")&&_[0].complete&&0<_[0].width&&0<_[0].height?(_.data("sbi_imgLiquid_loaded",!0),setTimeout(n,c*f.delay)):setTimeout(i,f.timecheckvisibility))}(),void s())}())):void t()})}}),i=l.injectCss,e=document.getElementsByTagName("head")[0],(s=document.createElement("style")).type="text/css",s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i)),e.appendChild(s)}function i(){this.feeds={},this.options=sb_instagram_js_options}function o(i,e,s){this.el=i,this.index=e,this.settings=s,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1}function d(i,e){b.ajax({url:sbiajaxurl,type:"post",data:i,success:e})}i.prototype={createPage:function(i,e){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),b(".sbi_no_js_error_message").remove(),b(".sbi_no_js").removeClass("sbi_no_js"),i(e)},createFeeds:function(i){i.whenFeedsCreated(b(".sbi").each(function(i){b(this).attr("data-sbi-index",i+1);var e=b(this),s=void 0!==e.attr("data-sbi-flags")?e.attr("data-sbi-flags").split(","):[],t=void 0!==e.attr("data-options")?JSON.parse(e.attr("data-options")):{};-1<s.indexOf("testAjax")&&(window.sbi.triggeredTest=!0,d({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")}));var n={cols:e.attr("data-cols"),colsmobile:void 0!==e.attr("data-colsmobile")&&"same"!==e.attr("data-colsmobile")?e.attr("data-colsmobile"):e.attr("data-cols"),num:e.attr("data-num"),imgRes:e.attr("data-res"),feedID:e.attr("data-feedid"),shortCodeAtts:e.attr("data-shortcode-atts"),resizingEnabled:-1===s.indexOf("resizeDisable"),imageLoadEnabled:-1===s.indexOf("imageLoadDisable"),debugEnabled:-1<s.indexOf("debug"),favorLocal:-1<s.indexOf("favorLocal"),ajaxPostLoad:-1<s.indexOf("ajaxPostLoad"),gdpr:-1<s.indexOf("gdpr"),consentGiven:!1,autoMinRes:1,general:t};window.sbi.feeds[i]=new o(this,i,n),window.sbi.feeds[i].setResizedImages(),window.sbi.feeds[i].init();var a=jQuery.Event("sbiafterfeedcreate");a.feed=window.sbi.feeds[i],jQuery(window).trigger(a)}))},afterFeedsCreated:function(){b(".sb_instagram_header").each(function(){var i=b(this);i.find(".sbi_header_link").hover(function(){i.find(".sbi_header_img_hover").addClass("sbi_fade_in")},function(){i.find(".sbi_header_img_hover").removeClass("sbi_fade_in")})})},encodeHTML:function(i){if(void 0===i)return"";var e=i.replace(/(>)/g,"&gt;");return e=(e=(e=e.replace(/(<)/g,"&lt;")).replace(/(&lt;br\/&gt;)/g,"<br>")).replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)}},o.prototype={init:function(){var i=this;i.settings.consentGiven=i.checkConsent(),b(this.el).find(".sbi_photo").parent("p").length&&b(this.el).addClass("sbi_no_autop"),b(this.el).find("#sbi_mod_error").length&&b(this.el).prepend(b(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var s,e=(s=0,function(i,e){clearTimeout(s),s=setTimeout(i,e)});jQuery(window).resize(function(){e(function(){i.afterResize()},500)}),b(this.el).find(".sbi_item").each(function(){i.lazyLoadCheck(b(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var i=b(this.el),e=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){i.find(".sbi_loader").addClass("sbi_hidden"),i.find(".sbi_btn_text").removeClass("sbi_hidden"),e.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var i=b(this.el);i.find(".sbi-screenreader").each(function(){b(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),i.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var e=10;i.find(".sbi_transition").each(function(){var i=jQuery(this);setTimeout(function(){i.removeClass("sbi_transition")},e),e+=10})},500)},lazyLoadCheck:function(i){if(i.find(".sbi_photo").length&&!i.closest(".sbi").hasClass("sbi-no-ll-check")){var e=this.getImageUrls(i),s=void 0!==e[640]?e[640]:i.find(".sbi_photo").attr("data-full-res");if(!this.settings.consentGiven&&-1<s.indexOf("scontent"))return;i.find(".sbi_photo img").each(function(){s&&void 0!==b(this).attr("data-src")&&b(this).attr("data-src",s),s&&void 0!==b(this).attr("data-orig-src")&&b(this).attr("data-orig-src",s),b(this).on("load",function(){!b(this).hasClass("sbi-replaced")&&-1<b(this).attr("src").indexOf("placeholder")&&(b(this).addClass("sbi-replaced"),s&&(b(this).attr("src",s),b(this).closest(".sbi_imgLiquid_bgSize").length&&b(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+s+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||b(".sbi_no_resraise").removeClass("sbi_no_resraise");var i=b.Event("sbiafterimagesloaded");i.el=b(this.el),b(window).trigger(i)},setResizedImages:function(){b(this.el).find(".sbi_resized_image_data").length&&void 0!==b(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===b(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(b(this.el).find(".sbi_resized_image_data").attr("data-resized")),b(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var i,e,t=this;0<t.needsResizing.length&&t.settings.resizingEnabled&&(i=b(this.el).find(".sbi_item").length,e=void 0!==t.settings.general.cache_all&&t.settings.general.cache_all,d({action:"sbi_resized_images_submit",needs_resizing:t.needsResizing,offset:i,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,cache_all:e},function(i){if(0===i.trim().indexOf("{")){var e=JSON.parse(i);for(var s in t.settings.debugEnabled&&console.log(e),e)e.hasOwnProperty(s)&&(t.resizedImages[s]=e[s]);t.maybeRaiseImageResolution(),setTimeout(function(){t.afterResize()},500)}}))},loadMoreButtonInit:function(){var i=b(this.el),e=this;i.find("#sbi_load .sbi_load_btn").off().on("click",function(){e.afterLoadMoreClicked(jQuery(this)),e.getNewPostSet()})},getNewPostSet:function(){var s=b(this.el),t=this;d({action:"sbi_load_more_clicked",offset:s.find(".sbi_item").length,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,current_resolution:t.imageResolution},function(i){var e;0===i.trim().indexOf("{")&&(e=JSON.parse(i),t.settings.debugEnabled&&console.log(e),t.appendNewPosts(e.html),t.addResizedImages(e.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),e.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,s.find(".sbi_load_btn").hide()),b(".sbi_no_js").removeClass("sbi_no_js"))})},appendNewPosts:function(i){var e=b(this.el);e.find("#sbi_images .sbi_item").length?e.find("#sbi_images .sbi_item").last().after(i):e.find("#sbi_images").append(i)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var s=b(this.el),i=s.find(".sbi_photo").eq(0).innerWidth(),e=this.getColumnCount(),t=s.find("#sbi_images").innerWidth()-s.find("#sbi_images").width(),n=t/2;sbi_photo_width_manual=s.find("#sbi_images").width()/e-t,s.find(".sbi_photo").css("height",i),s.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;s.find(".sbi_owl2row-item").length&&(i=1);var e=s.find(".sbi_photo").eq(0).innerWidth()/i;e+=parseInt(n)*(2-i+2),s.find(".sbi-owl-nav div").css("top",e)},100)},maybeRaiseSingleImageResolution:function(t,i,s){var n=this,a=n.getImageUrls(t),o=t.find(".sbi_photo img").attr("src"),d=150,e=t.find("img").get(0),r=o===window.sbi.options.placeholder?1:e.naturalWidth/e.naturalHeight,s=void 0!==s&&s;if(!(t.hasClass("sbi_no_resraise")||t.hasClass("sbi_had_error")||t.find(".sbi_link_area").length&&t.find(".sbi_link_area").hasClass("sbi_had_error")))if(a.length<1)t.find(".sbi_link_area").length&&t.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));else{(t.find(".sbi_link_area").length&&t.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!n.settings.consentGiven)&&t.find(".sbi_link_area").attr("href",a[a.length-1]),void 0!==a[640]&&t.find(".sbi_photo").attr("data-full-res",a[640]),b.each(a,function(i,e){e===o&&(d=parseInt(i),s=!1)});var l,h,g,c=640;switch(n.settings.imgRes){case"thumb":c=150;break;case"medium":c=320;break;case"full":c=640;break;default:var u=Math.max(n.settings.autoMinRes,t.find(".sbi_photo").innerWidth()),f=n.getBestResolutionForAuto(u,r,t);switch(f){case 320:c=320;break;case 150:c=150}}(d<c||o===window.sbi.options.placeholder||s)&&(n.settings.debugEnabled&&(l=o===window.sbi.options.placeholder?"was placeholder":"too small",console.log("rais res for "+o,l)),h=a[c].split("?ig_cache_key")[0],o!==h&&(t.find(".sbi_photo img").attr("src",h),t.find(".sbi_photo").css("background-image",'url("'+h+'")')),d=c,"auto"===n.settings.imgRes&&(g=!1,t.find(".sbi_photo img").on("load",function(){var i,e=b(this),s=e.get(0).naturalWidth/e.get(0).naturalHeight;if(1e3!==e.get(0).naturalWidth&&r<s&&!g){switch(n.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+o),g=!0,u=t.find(".sbi_photo").innerWidth(),f=n.getBestResolutionForAuto(u,s,t),c=640,f){case 320:c=320;break;case 150:c=150}d<c&&(h=a[c].split("?ig_cache_key")[0],e.attr("src",h),e.closest(".sbi_photo").css("background-image",'url("'+h+'")')),"masonry"!==n.layout&&"highlight"!==n.layout||(b(n.el).find("#sbi_images").smashotope(n.isotopeArgs),setTimeout(function(){b(n.el).find("#sbi_images").smashotope(n.isotopeArgs)},500))}else{n.settings.debugEnabled&&(i=g?"already checked":"no aspect ratio change",console.log("not raising res for replacement "+o,i))}}))),t.find("img").on("error",function(){var i;b(this).hasClass("sbi_img_error")?console.log("unfixed error "+b(this).attr("src")):(b(this).addClass("sbi_img_error"),-1<b(this).attr("src").indexOf("media/?size=")||-1<b(this).attr("src").indexOf("cdninstagram")||-1<b(this).attr("src").indexOf("fbcdn")?(n.settings.favorLocal=!0,void 0!==(i=n.getImageUrls(b(this).closest(".sbi_item")))[640]&&(b(this).attr("src",i[640]),b(this).closest(".sbi_photo").css("background-image","url("+i[640]+")"),b(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",i[640]).addClass("sbi_had_error"))):"undefined"!==b(this).closest(".sbi_photo").attr("data-img-src-set")&&void 0!==(i=JSON.parse(b(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(b(this).attr("src",i.d),b(this).closest(".sbi_photo").css("background-image","url("+i.d+")"),b(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",i[640]).addClass("sbi_had_error")),setTimeout(function(){n.afterResize()},1500))})}},maybeRaiseImageResolution:function(i){var e=this,s=void 0!==i&&!0===i?".sbi_item.sbi_new":".sbi_item",t=!e.isInitialized;b(e.el).find(s).each(function(i){!b(this).hasClass("sbi_num_diff_hide")&&b(this).find(".sbi_photo").length&&void 0!==b(this).find(".sbi_photo").attr("data-img-src-set")&&e.maybeRaiseSingleImageResolution(b(this),i,t)}),e.isInitialized=!0},getBestResolutionForAuto:function(i,e,s){(isNaN(e)||e<1)&&(e=1);var t,n=i*e,a=10*Math.ceil(n/10),o=[150,320,640];return s.hasClass("sbi_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))&&(t=!1,b.each(o,function(i,e){e>parseInt(a)&&!t&&(a=e,t=!0)})),a},hideExtraImagesForWidth:function(){var i,e,s;"carousel"!==this.layout&&(e=void 0!==(i=b(this.el)).attr("data-num")&&""!==i.attr("data-num")?parseInt(i.attr("data-num")):1,s=void 0!==i.attr("data-nummobile")&&""!==i.attr("data-nummobile")?parseInt(i.attr("data-nummobile")):e,b(window).width()<480?s<i.find(".sbi_item").length&&i.find(".sbi_item").slice(s-i.find(".sbi_item").length).addClass("sbi_num_diff_hide"):e<i.find(".sbi_item").length&&i.find(".sbi_item").slice(e-i.find(".sbi_item").length).addClass("sbi_num_diff_hide"))},setImageSizeClass:function(){var i=b(this.el);i.removeClass("sbi_small sbi_medium");var e=i.innerWidth(),s=parseInt(i.find("#sbi_images").outerWidth()-i.find("#sbi_images").width())/2,t=this.getColumnCount(),n=(e-s*(t+2))/t;120<n&&n<240?i.addClass("sbi_medium"):n<=120&&i.addClass("sbi_small")},setMinImageWidth:function(){b(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=b(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e,s=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),t=i.attr("id").replace("sbi_","");return this.settings.consentGiven||(s=[]),void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id?void 0!==this.resizedImages[t].sizes&&(e=[],void 0!==this.resizedImages[t].sizes.full&&(s[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg",e.push(640)),void 0!==this.resizedImages[t].sizes.low&&(s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg",e.push(320)),void 0!==this.resizedImages[t].sizes.thumb&&(e.push(150),s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===e.indexOf(640)&&-1<e.indexOf(320)&&(s[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg"),-1===e.indexOf(320)&&(-1<e.indexOf(640)?s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg":-1<e.indexOf(150)&&(s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===e.indexOf(150)&&(-1<e.indexOf(320)?s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg":-1<e.indexOf(640)&&(s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg")))):(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t),s},getAvatarUrl:function(i,e){if(""===i)return"";var s=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==s[i]?s[i]:"":void 0!==s[i]?s[i]:void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var i=b(this.el);e(),"function"==typeof i.find(".sbi_photo").sbi_imgLiquid&&i.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var s,t,n,a=this;s=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},n={sbiCheckVisibility:function(i,e){var s,t;jQuery.contains(document,i[0])&&(s=e.sbiPreviousVisibility,t=i.is(":visible"),e.sbiPreviousVisibility=t,null==s?e.runOnLoad&&e.callback(i,t):s!==t&&e.callback(i,t),setTimeout(function(){n.sbiCheckVisibility(i,e)},e.frequency))}},s.fn.sbiVisibilityChanged=function(i){var e=s.extend({},t,i);return this.each(function(){n.sbiCheckVisibility(s(this),e)})},"function"==typeof b(this.el).filter(":hidden").sbiVisibilityChanged&&b(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){a.afterResize()},runOnLoad:!1})},getColumnCount:function(){var i=b(this.el),e=this.settings.cols,s=this.settings.colsmobile,t=e;return sbiWindowWidth=window.innerWidth,i.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&2<parseInt(e)&&parseInt(e)<7&&(t=2),sbiWindowWidth<640&&6<parseInt(e)&&parseInt(e)<11&&(t=4),sbiWindowWidth<=480&&2<parseInt(e)&&(t=1)):sbiWindowWidth<=480&&(t=s),parseInt(t)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;var i,e;"undefined"!=typeof CLI_Cookie?null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary")):void 0!==window.cnArgs?2===(i=("; "+document.cookie).split("; cookie_notice_accepted=")).length&&(e=i.pop().split(";").shift(),this.settings.consentGiven="true"===e):void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(i){for(var e=i+"=",s=window.document.cookie.split(";"),t=0;t<s.length;t++){var n=s[t].trim();if(0==n.indexOf(e))return n.substring(e.length,n.length)}return""}("complianz_consent_status"):void 0!==window.Cookiebot&&(this.settings.consentGiven=Cookiebot.consented);var s=jQuery.Event("sbicheckconsent");return s.feed=this,jQuery(window).trigger(s),this.settings.consentGiven},afterConsentToggled:function(){var i;this.checkConsent()&&((i=this).maybeRaiseImageResolution(),setTimeout(function(){i.afterResize()},500))}},window.sbi_init=function(){window.sbi=new i,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(e){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:")),sbi_init(),e("#cookie-notice a").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e("#cookie-law-info-bar a").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e(".cli-user-preference-checkbox").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e(window).on("CookiebotOnAccept",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),e(document).on("cmplzAcceptAll",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),e(document).on("cmplzRevoke",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})})}));
js/sb-instagram-admin-2-2.js CHANGED
@@ -1131,10 +1131,35 @@ jQuery(document).ready(function($) {
1131
 
1132
  jQuery('#sbi_config_info').show();
1133
  });
1134
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1135
  });
1136
 
1137
 
 
1138
  /* global smash_admin, jconfirm, wpCookies, Choices, List */
1139
 
1140
  (function($) {
1131
 
1132
  jQuery('#sbi_config_info').show();
1133
  });
1134
+
1135
+ jQuery('.sbi_show_gdpr_list').on('click', function(){
1136
+ jQuery(this).closest('div').find('.sbi_gdpr_list').slideToggle();
1137
+ });
1138
+
1139
+ //Selecting a post style
1140
+ jQuery('#sbi_gdpr_setting').on('change', function(){
1141
+ sbiCheckGdprSetting( jQuery(this).val() );
1142
+ });
1143
+ function sbiCheckGdprSetting(option) {
1144
+ console.log('heretere')
1145
+ if( option == 'yes' ){
1146
+ jQuery('.sbi_gdpr_yes').show();
1147
+ jQuery('.sbi_gdpr_no, .sbi_gdpr_auto').hide();
1148
+ }
1149
+ if( option == 'no' ){
1150
+ jQuery('.sbi_gdpr_no').show();
1151
+ jQuery('.sbi_gdpr_yes, .sbi_gdpr_auto').hide();
1152
+ }
1153
+ if( option == 'auto' ){
1154
+ jQuery('.sbi_gdpr_auto').show();
1155
+ jQuery('.sbi_gdpr_yes, .sbi_gdpr_no').hide();
1156
+ }
1157
+ }
1158
+ sbiCheckGdprSetting();
1159
  });
1160
 
1161
 
1162
+
1163
  /* global smash_admin, jconfirm, wpCookies, Choices, List */
1164
 
1165
  (function($) {
js/sbi-scripts.js CHANGED
@@ -186,7 +186,7 @@ if(!sbi_js_exists) {
186
  }
187
  var feedOptions = {
188
  cols : $self.attr('data-cols'),
189
- colsmobile : $self.attr('data-colsmobile') !== 'same' ? $self.attr('data-colsmobile') : $self.attr('data-cols'),
190
  num : $self.attr('data-num'),
191
  imgRes : $self.attr('data-res'),
192
  feedID : $self.attr('data-feedid'),
@@ -196,6 +196,8 @@ if(!sbi_js_exists) {
196
  debugEnabled : (flags.indexOf('debug') > -1),
197
  favorLocal : (flags.indexOf('favorLocal') > -1),
198
  ajaxPostLoad : (flags.indexOf('ajaxPostLoad') > -1),
 
 
199
  autoMinRes : 1,
200
  general : general
201
  };
@@ -257,6 +259,10 @@ if(!sbi_js_exists) {
257
  SbiFeed.prototype = {
258
  init: function() {
259
  var feed = this;
 
 
 
 
260
  if ($(this.el).find('#sbi_mod_error').length) {
261
  $(this.el).prepend($(this.el).find('#sbi_mod_error'));
262
  }
@@ -279,6 +285,11 @@ if(!sbi_js_exists) {
279
  }, 500);
280
  });
281
 
 
 
 
 
 
282
  },
283
  initLayout: function() {
284
 
@@ -324,6 +335,10 @@ if(!sbi_js_exists) {
324
  var $self = $(this.el),
325
  feed = this;
326
 
 
 
 
 
327
  // Call Custom JS if it exists
328
  if (typeof sbi_custom_js == 'function') setTimeout(function(){ sbi_custom_js(); }, 100);
329
 
@@ -338,7 +353,6 @@ if(!sbi_js_exists) {
338
  }, function () {
339
  jQuery(this).stop().fadeTo(500, 1);
340
  });
341
-
342
  }); //End .sbi_item each
343
 
344
  //Remove the new class after 500ms, once the sorting is done
@@ -356,6 +370,40 @@ if(!sbi_js_exists) {
356
  });
357
  }, 500);
358
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
  afterNewImagesRevealed: function() {
360
  this.listenForVisibilityChange();
361
  this.sendNeedsResizingToServer();
@@ -378,7 +426,8 @@ if(!sbi_js_exists) {
378
  sendNeedsResizingToServer: function() {
379
  var feed = this;
380
  if (feed.needsResizing.length > 0 && feed.settings.resizingEnabled) {
381
- var itemOffset = $(this.el).find('.sbi_item').length;
 
382
 
383
  var submitData = {
384
  action: 'sbi_resized_images_submit',
@@ -386,6 +435,7 @@ if(!sbi_js_exists) {
386
  offset: itemOffset,
387
  feed_id: feed.settings.feedID,
388
  atts: feed.settings.shortCodeAtts,
 
389
  };
390
  var onSuccess = function(data) {
391
  if (data.trim().indexOf('{') === 0) {
@@ -393,6 +443,16 @@ if(!sbi_js_exists) {
393
  if (feed.settings.debugEnabled) {
394
  console.log(response);
395
  }
 
 
 
 
 
 
 
 
 
 
396
  }
397
  };
398
  sbiAjax(submitData,onSuccess);
@@ -505,6 +565,19 @@ if(!sbi_js_exists) {
505
  return;
506
  }
507
 
 
 
 
 
 
 
 
 
 
 
 
 
 
508
  $.each(imgSrcSet, function (index, value) {
509
  if (value === currentUrl) {
510
  currentRes = parseInt(index);
@@ -541,11 +614,13 @@ if(!sbi_js_exists) {
541
  if (newRes > currentRes || currentUrl === window.sbi.options.placeholder || forceChange) {
542
  if (feed.settings.debugEnabled) {
543
  var reason = currentUrl === window.sbi.options.placeholder ? 'was placeholder' : 'too small';
544
- console.log('raise res for ' + currentUrl, reason);
545
  }
546
  var newUrl = imgSrcSet[newRes].split("?ig_cache_key")[0];
547
- $item.find('.sbi_photo img').attr('src', newUrl);
548
- $item.find('.sbi_photo').css('background-image', 'url("' + newUrl + '")');
 
 
549
  currentRes = newRes;
550
 
551
  if (feed.settings.imgRes === 'auto') {
@@ -557,7 +632,7 @@ if(!sbi_js_exists) {
557
 
558
  if ($this_image.get(0).naturalWidth !== 1000 && newAspectRatio > aspectRatio && !checked) {
559
  if (feed.settings.debugEnabled) {
560
- console.log('raise res again for aspect ratio change ' + currentUrl);
561
  }
562
  checked = true;
563
  minImageWidth = $item.find('.sbi_photo').innerWidth();
@@ -724,6 +799,9 @@ if(!sbi_js_exists) {
724
  getImageUrls: function ($item) {
725
  var srcSet = JSON.parse($item.find('.sbi_photo').attr('data-img-src-set').replace(/\\\//g, '/')),
726
  id = $item.attr('id').replace('sbi_', '');
 
 
 
727
  if (typeof this.resizedImages[id] !== 'undefined'
728
  && this.resizedImages[id] !== 'video'
729
  && this.resizedImages[id] !== 'pending'
@@ -843,6 +921,47 @@ if(!sbi_js_exists) {
843
  }
844
 
845
  return parseInt(returnCols);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
846
  }
847
  };
848
 
@@ -864,6 +983,21 @@ if(!sbi_js_exists) {
864
  });
865
  }
866
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
867
  })(jQuery);
868
 
869
  jQuery(document).ready(function($) {
@@ -882,6 +1016,58 @@ if(!sbi_js_exists) {
882
  }
883
  }
884
  sbi_init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
885
  });
886
 
887
  } // if sbi_js_exists
186
  }
187
  var feedOptions = {
188
  cols : $self.attr('data-cols'),
189
+ colsmobile : typeof $self.attr('data-colsmobile') !== 'undefined' && $self.attr('data-colsmobile') !== 'same' ? $self.attr('data-colsmobile') : $self.attr('data-cols'),
190
  num : $self.attr('data-num'),
191
  imgRes : $self.attr('data-res'),
192
  feedID : $self.attr('data-feedid'),
196
  debugEnabled : (flags.indexOf('debug') > -1),
197
  favorLocal : (flags.indexOf('favorLocal') > -1),
198
  ajaxPostLoad : (flags.indexOf('ajaxPostLoad') > -1),
199
+ gdpr : (flags.indexOf('gdpr') > -1),
200
+ consentGiven : false,
201
  autoMinRes : 1,
202
  general : general
203
  };
259
  SbiFeed.prototype = {
260
  init: function() {
261
  var feed = this;
262
+ feed.settings.consentGiven = feed.checkConsent();
263
+ if ($(this.el).find('.sbi_photo').parent('p').length) {
264
+ $(this.el).addClass('sbi_no_autop');
265
+ }
266
  if ($(this.el).find('#sbi_mod_error').length) {
267
  $(this.el).prepend($(this.el).find('#sbi_mod_error'));
268
  }
285
  }, 500);
286
  });
287
 
288
+ $(this.el).find('.sbi_item').each(function() {
289
+ feed.lazyLoadCheck($(this));
290
+ });
291
+
292
+
293
  },
294
  initLayout: function() {
295
 
335
  var $self = $(this.el),
336
  feed = this;
337
 
338
+ $self.find('.sbi-screenreader').each(function() {
339
+ $(this).find('img').remove();
340
+ });
341
+
342
  // Call Custom JS if it exists
343
  if (typeof sbi_custom_js == 'function') setTimeout(function(){ sbi_custom_js(); }, 100);
344
 
353
  }, function () {
354
  jQuery(this).stop().fadeTo(500, 1);
355
  });
 
356
  }); //End .sbi_item each
357
 
358
  //Remove the new class after 500ms, once the sorting is done
370
  });
371
  }, 500);
372
  },
373
+ lazyLoadCheck: function($item){
374
+ var feed = this;
375
+ if ($item.find('.sbi_photo').length && !$item.closest('.sbi').hasClass('sbi-no-ll-check')) {
376
+ var imgSrcSet = feed.getImageUrls($item),
377
+ maxResImage = typeof imgSrcSet[640] !== 'undefined' ? imgSrcSet[640] : $item.find('.sbi_photo').attr('data-full-res');
378
+
379
+ if (!feed.settings.consentGiven) {
380
+ if (maxResImage.indexOf('scontent') > -1) {
381
+ return;
382
+ }
383
+ }
384
+
385
+ $item.find('.sbi_photo img').each(function() {
386
+ if (maxResImage && typeof $(this).attr('data-src') !== 'undefined') {
387
+ $(this).attr('data-src',maxResImage);
388
+ }
389
+ if (maxResImage && typeof $(this).attr('data-orig-src') !== 'undefined') {
390
+ $(this).attr('data-orig-src',maxResImage);
391
+ }
392
+ $(this).on('load',function() {
393
+ if (!$(this).hasClass('sbi-replaced')
394
+ && $(this).attr('src').indexOf('placeholder') > -1) {
395
+ $(this).addClass('sbi-replaced');
396
+ if (maxResImage) {
397
+ $(this).attr('src',maxResImage);
398
+ if ($(this).closest('.sbi_imgLiquid_bgSize').length) {
399
+ $(this).closest('.sbi_imgLiquid_bgSize').css('background-image', 'url(' + maxResImage + ')');
400
+ }
401
+ }
402
+ }
403
+ });
404
+ });
405
+ }
406
+ },
407
  afterNewImagesRevealed: function() {
408
  this.listenForVisibilityChange();
409
  this.sendNeedsResizingToServer();
426
  sendNeedsResizingToServer: function() {
427
  var feed = this;
428
  if (feed.needsResizing.length > 0 && feed.settings.resizingEnabled) {
429
+ var itemOffset = $(this.el).find('.sbi_item').length,
430
+ cacheAll = typeof feed.settings.general.cache_all !== 'undefined' ? feed.settings.general.cache_all : false;
431
 
432
  var submitData = {
433
  action: 'sbi_resized_images_submit',
435
  offset: itemOffset,
436
  feed_id: feed.settings.feedID,
437
  atts: feed.settings.shortCodeAtts,
438
+ cache_all: cacheAll
439
  };
440
  var onSuccess = function(data) {
441
  if (data.trim().indexOf('{') === 0) {
443
  if (feed.settings.debugEnabled) {
444
  console.log(response);
445
  }
446
+ for (var property in response) {
447
+ if (response.hasOwnProperty(property)) {
448
+ feed.resizedImages[property] = response[property];
449
+ }
450
+ }
451
+ feed.maybeRaiseImageResolution();
452
+
453
+ setTimeout(function() {
454
+ feed.afterResize();
455
+ },500);
456
  }
457
  };
458
  sbiAjax(submitData,onSuccess);
565
  return;
566
  }
567
 
568
+ if (imgSrcSet.length < 1) {
569
+ if ($item.find('.sbi_link_area').length) {
570
+ $item.find('.sbi_link_area').attr('href',window.sbi.options.placeholder.replace('placeholder.png','thumb-placeholder.png'))
571
+ }
572
+ return;
573
+ } else if ($item.find('.sbi_link_area').length && $item.find('.sbi_link_area').attr('href') === window.sbi.options.placeholder.replace('placeholder.png','thumb-placeholder.png')
574
+ || !feed.settings.consentGiven) {
575
+ $item.find('.sbi_link_area').attr('href',imgSrcSet[imgSrcSet.length - 1])
576
+ }
577
+ if (typeof imgSrcSet[640] !== 'undefined') {
578
+ $item.find('.sbi_photo').attr('data-full-res',imgSrcSet[640]);
579
+ }
580
+
581
  $.each(imgSrcSet, function (index, value) {
582
  if (value === currentUrl) {
583
  currentRes = parseInt(index);
614
  if (newRes > currentRes || currentUrl === window.sbi.options.placeholder || forceChange) {
615
  if (feed.settings.debugEnabled) {
616
  var reason = currentUrl === window.sbi.options.placeholder ? 'was placeholder' : 'too small';
617
+ console.log('rais res for ' + currentUrl, reason);
618
  }
619
  var newUrl = imgSrcSet[newRes].split("?ig_cache_key")[0];
620
+ if (currentUrl !== newUrl) {
621
+ $item.find('.sbi_photo img').attr('src', newUrl);
622
+ $item.find('.sbi_photo').css('background-image', 'url("' + newUrl + '")');
623
+ }
624
  currentRes = newRes;
625
 
626
  if (feed.settings.imgRes === 'auto') {
632
 
633
  if ($this_image.get(0).naturalWidth !== 1000 && newAspectRatio > aspectRatio && !checked) {
634
  if (feed.settings.debugEnabled) {
635
+ console.log('rais res again for aspect ratio change ' + currentUrl);
636
  }
637
  checked = true;
638
  minImageWidth = $item.find('.sbi_photo').innerWidth();
799
  getImageUrls: function ($item) {
800
  var srcSet = JSON.parse($item.find('.sbi_photo').attr('data-img-src-set').replace(/\\\//g, '/')),
801
  id = $item.attr('id').replace('sbi_', '');
802
+ if (!this.settings.consentGiven) {
803
+ srcSet = [];
804
+ }
805
  if (typeof this.resizedImages[id] !== 'undefined'
806
  && this.resizedImages[id] !== 'video'
807
  && this.resizedImages[id] !== 'pending'
921
  }
922
 
923
  return parseInt(returnCols);
924
+ },
925
+ checkConsent: function() {
926
+ if (this.settings.consentGiven || !this.settings.gdpr) {
927
+ return true;
928
+ }
929
+ if (typeof CLI_Cookie !== "undefined") { // GDPR Cookie Consent by WebToffee
930
+ if (CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) !== null) {
931
+
932
+ this.settings.consentGiven = CLI_Cookie.read('cookielawinfo-checkbox-non-necessary') === 'yes';
933
+ }
934
+
935
+ } else if (typeof window.cnArgs !== "undefined") { // Cookie Notice by dFactory
936
+ var value = "; " + document.cookie,
937
+ parts = value.split( '; cookie_notice_accepted=' );
938
+
939
+ if ( parts.length === 2 ) {
940
+ var val = parts.pop().split( ';' ).shift();
941
+
942
+ this.settings.consentGiven = (val === 'true');
943
+ }
944
+ } else if (typeof window.cookieconsent !== 'undefined') { // Complianz by Really Simple Plugins
945
+ this.settings.consentGiven = sbiCmplzGetCookie('complianz_consent_status') === 'allow';
946
+ } else if (typeof window.Cookiebot !== "undefined") { // Cookiebot by Cybot A/S
947
+ this.settings.consentGiven = Cookiebot.consented;
948
+ }
949
+
950
+ var evt = jQuery.Event('sbicheckconsent');
951
+ evt.feed = this;
952
+ jQuery(window).trigger(evt);
953
+
954
+ return this.settings.consentGiven; // GDPR not enabled
955
+ },
956
+ afterConsentToggled: function() {
957
+ if (this.checkConsent()) {
958
+ var feed = this;
959
+ feed.maybeRaiseImageResolution();
960
+
961
+ setTimeout(function() {
962
+ feed.afterResize();
963
+ },500);
964
+ }
965
  }
966
  };
967
 
983
  });
984
  }
985
 
986
+ function sbiCmplzGetCookie(cname) {
987
+ var name = cname + "="; //Create the cookie name variable with cookie name concatenate with = sign
988
+ var cArr = window.document.cookie.split(';'); //Create cookie array by split the cookie by ';'
989
+
990
+ //Loop through the cookies and return the cookie value if it find the cookie name
991
+ for (var i = 0; i < cArr.length; i++) {
992
+ var c = cArr[i].trim();
993
+ //If the name is the cookie string at position 0, we found the cookie and return the cookie value
994
+ if (c.indexOf(name) == 0)
995
+ return c.substring(name.length, c.length);
996
+ }
997
+
998
+ return "";
999
+ }
1000
+
1001
  })(jQuery);
1002
 
1003
  jQuery(document).ready(function($) {
1016
  }
1017
  }
1018
  sbi_init();
1019
+
1020
+ // Cookie Notice by dFactory
1021
+ $('#cookie-notice a').click(function() {
1022
+ setTimeout(function() {
1023
+ $.each(window.sbi.feeds,function(index){
1024
+ window.sbi.feeds[ index ].afterConsentToggled();
1025
+ });
1026
+ },1000);
1027
+ });
1028
+
1029
+ // GDPR Cookie Consent by WebToffee
1030
+ $('#cookie-law-info-bar a').click(function() {
1031
+ setTimeout(function() {
1032
+ $.each(window.sbi.feeds,function(index){
1033
+ window.sbi.feeds[ index ].afterConsentToggled();
1034
+ });
1035
+ },1000);
1036
+ });
1037
+
1038
+ // GDPR Cookie Consent by WebToffee
1039
+ $('.cli-user-preference-checkbox').click(function(){
1040
+ setTimeout(function() {
1041
+ $.each(window.sbi.feeds,function(index){
1042
+ window.sbi.feeds[ index ].settings.consentGiven = false;
1043
+ window.sbi.feeds[ index ].afterConsentToggled();
1044
+ });
1045
+ },1000);
1046
+ });
1047
+
1048
+ // Cookiebot
1049
+ $(window).on('CookiebotOnAccept', function (event) {
1050
+ $.each(window.sbi.feeds,function(index){
1051
+ window.sbi.feeds[ index ].settings.consentGiven = true;
1052
+ window.sbi.feeds[ index ].afterConsentToggled();
1053
+ });
1054
+ });
1055
+
1056
+ // Complianz by Really Simple Plugins
1057
+ $(document).on('cmplzAcceptAll', function (event) {
1058
+ $.each(window.sbi.feeds,function(index){
1059
+ window.sbi.feeds[ index ].settings.consentGiven = true;
1060
+ window.sbi.feeds[ index ].afterConsentToggled();
1061
+ });
1062
+ });
1063
+
1064
+ // Complianz by Really Simple Plugins
1065
+ $(document).on('cmplzRevoke', function (event) {
1066
+ $.each(window.sbi.feeds,function(index){
1067
+ window.sbi.feeds[ index ].settings.consentGiven = false;
1068
+ window.sbi.feeds[ index ].afterConsentToggled();
1069
+ });
1070
+ });
1071
  });
1072
 
1073
  } // if sbi_js_exists
js/sbi-scripts.min.js CHANGED
@@ -1 +1 @@
1
- var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(!function(i){function e(){var i,e,s,t=t||{VER:"0.9.944"};t.bgs_Available=!1,t.bgs_CheckRunned=!1,function(i){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},function(){if(!t.bgs_CheckRunned){t.bgs_CheckRunned=!0;var e=i('<span style="background-size:cover" />');i("body").append(e),function(){var i=e[0];if(i&&window.getComputedStyle){var s=window.getComputedStyle(i,null);s&&s.backgroundSize&&(t.bgs_Available="cover"===s.backgroundSize)}}(),e.remove()}}();var s=this;return this.options=e,this.settings=i.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(e){function a(){(r.responsive||h.data("sbi_imgLiquid_oldProcessed"))&&h.data("sbi_imgLiquid_settings")&&(r=h.data("sbi_imgLiquid_settings"),l.actualSize=l.get(0).offsetWidth+l.get(0).offsetHeight/1e4,l.sizeOld&&l.actualSize!==l.sizeOld&&o(),l.sizeOld=l.actualSize,setTimeout(a,r.responsiveCheckTime))}function n(){h.data("sbi_imgLiquid_error",!0),l.addClass("sbi_imgLiquid_error"),r.onItemError&&r.onItemError(e,l,h),d()}function o(){var i,s,t,a,n,o,g,u,m=0,_=0,f=l.width(),c=l.height();void 0===h.data("owidth")&&h.data("owidth",h[0].width),void 0===h.data("oheight")&&h.data("oheight",h[0].height),r.fill===f/c>=h.data("owidth")/h.data("oheight")?(i="100%",s="auto",t=Math.floor(f),a=Math.floor(f*(h.data("oheight")/h.data("owidth")))):(i="auto",s="100%",t=Math.floor(c*(h.data("owidth")/h.data("oheight"))),a=Math.floor(c)),g=f-t,"left"===(n=r.horizontalAlign.toLowerCase())&&(_=0),"center"===n&&(_=.5*g),"right"===n&&(_=g),-1!==n.indexOf("%")&&((n=parseInt(n.replace("%",""),10))>0&&(_=g*n*.01)),u=c-a,"left"===(o=r.verticalAlign.toLowerCase())&&(m=0),"center"===o&&(m=.5*u),"bottom"===o&&(m=u),-1!==o.indexOf("%")&&((o=parseInt(o.replace("%",""),10))>0&&(m=u*o*.01)),r.hardPixels&&(i=t,s=a),h.css({width:i,height:s,"margin-left":Math.floor(_),"margin-top":Math.floor(m)}),h.data("sbi_imgLiquid_oldProcessed")||(h.fadeTo(r.fadeInTime,1),h.data("sbi_imgLiquid_oldProcessed",!0),r.removeBoxBackground&&l.css("background-image","none"),l.addClass("sbi_imgLiquid_nobgSize"),l.addClass("sbi_imgLiquid_ready")),r.onItemFinish&&r.onItemFinish(e,l,h),d()}function d(){e===s.length-1&&s.settings.onFinish&&s.settings.onFinish()}var r=s.settings,l=i(this),h=i("img:first",l);return h.length?(h.data("sbi_imgLiquid_settings")?(l.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r=i.extend({},h.data("sbi_imgLiquid_settings"),s.options)):r=i.extend({},s.settings,function(){var i={};if(s.settings.useDataHtmlAttr){var e=l.attr("data-sbi_imgLiquid-fill"),a=l.attr("data-sbi_imgLiquid-horizontalAlign"),n=l.attr("data-sbi_imgLiquid-verticalAlign");("true"===e||"false"===e)&&(i.fill=Boolean("true"===e)),void 0===a||"left"!==a&&"center"!==a&&"right"!==a&&-1===a.indexOf("%")||(i.horizontalAlign=a),void 0===n||"top"!==n&&"bottom"!==n&&"center"!==n&&-1===n.indexOf("%")||(i.verticalAlign=n)}return t.isIE&&s.settings.ieFadeInDisabled&&(i.fadeInTime=0),i}()),h.data("sbi_imgLiquid_settings",r),r.onItemStart&&r.onItemStart(e,l,h),void(t.bgs_Available&&r.useBackgroundSize?(-1===l.css("background-image").indexOf(encodeURI(h.attr("src")))&&l.css({"background-image":'url("'+encodeURI(h.attr("src"))+'")'}),l.css({"background-size":r.fill?"cover":"contain","background-position":(r.horizontalAlign+" "+r.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),i("a:first",l).css({display:"block",width:"100%",height:"100%"}),i("img",l).css({display:"none"}),r.onItemFinish&&r.onItemFinish(e,l,h),l.addClass("sbi_imgLiquid_bgSize"),l.addClass("sbi_imgLiquid_ready"),d()):function s(){if(h.data("oldSrc")&&h.data("oldSrc")!==h.attr("src")){var t=h.clone().removeAttr("style");return t.data("sbi_imgLiquid_settings",h.data("sbi_imgLiquid_settings")),h.parent().prepend(t),h.remove(),(h=t)[0].width=0,void setTimeout(s,10)}return h.data("sbi_imgLiquid_oldProcessed")?void o():(h.data("sbi_imgLiquid_oldProcessed",!1),h.data("oldSrc",h.attr("src")),i("img:not(:first)",l).css("display","none"),l.css({overflow:"hidden"}),h.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),h.on("error",n),h[0].onerror=n,function i(){h.data("sbi_imgLiquid_error")||h.data("sbi_imgLiquid_loaded")||h.data("sbi_imgLiquid_oldProcessed")||(l.is(":visible")&&h[0].complete&&h[0].width>0&&h[0].height>0?(h.data("sbi_imgLiquid_loaded",!0),setTimeout(o,e*r.delay)):setTimeout(i,r.timecheckvisibility))}(),void a())}())):void n()})}})}(jQuery),i=t.injectCss,e=document.getElementsByTagName("head")[0],(s=document.createElement("style")).type="text/css",s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i)),e.appendChild(s)}function s(){this.feeds={},this.options=sb_instagram_js_options}function t(i,e,s){this.el=i,this.index=e,this.settings=s,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1}function a(e,s){i.ajax({url:sbiajaxurl,type:"post",data:e,success:s})}s.prototype={createPage:function(e,s){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),i(".sbi_no_js_error_message").remove(),i(".sbi_no_js").removeClass("sbi_no_js"),e(s)},createFeeds:function(e){e.whenFeedsCreated(i(".sbi").each(function(e){i(this).attr("data-sbi-index",e+1);var s=i(this),n=void 0!==s.attr("data-sbi-flags")?s.attr("data-sbi-flags").split(","):[],o=void 0!==s.attr("data-options")?JSON.parse(s.attr("data-options")):{};if(n.indexOf("testAjax")>-1){window.sbi.triggeredTest=!0;a({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")})}var d={cols:s.attr("data-cols"),colsmobile:"same"!==s.attr("data-colsmobile")?s.attr("data-colsmobile"):s.attr("data-cols"),num:s.attr("data-num"),imgRes:s.attr("data-res"),feedID:s.attr("data-feedid"),shortCodeAtts:s.attr("data-shortcode-atts"),resizingEnabled:-1===n.indexOf("resizeDisable"),imageLoadEnabled:-1===n.indexOf("imageLoadDisable"),debugEnabled:n.indexOf("debug")>-1,favorLocal:n.indexOf("favorLocal")>-1,ajaxPostLoad:n.indexOf("ajaxPostLoad")>-1,autoMinRes:1,general:o};window.sbi.feeds[e]=function(i,e,s){return new t(i,e,s)}(this,e,d),window.sbi.feeds[e].setResizedImages(),window.sbi.feeds[e].init();var r=jQuery.Event("sbiafterfeedcreate");r.feed=window.sbi.feeds[e],jQuery(window).trigger(r)}))},afterFeedsCreated:function(){i(".sb_instagram_header").each(function(){var e=i(this);e.find(".sbi_header_link").hover(function(){e.find(".sbi_header_img_hover").addClass("sbi_fade_in")},function(){e.find(".sbi_header_img_hover").removeClass("sbi_fade_in")})})},encodeHTML:function(i){return void 0===i?"":i.replace(/(>)/g,"&gt;").replace(/(<)/g,"&lt;").replace(/(&lt;br\/&gt;)/g,"<br>").replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g)}},t.prototype={init:function(){var e=this;i(this.el).find("#sbi_mod_error").length&&i(this.el).prepend(i(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var s,t=(s=0,function(i,e){clearTimeout(s),s=setTimeout(i,e)});jQuery(window).resize(function(){t(function(){e.afterResize()},500)})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var e=i(this.el),s=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){e.find(".sbi_loader").addClass("sbi_hidden"),e.find(".sbi_btn_text").removeClass("sbi_hidden"),s.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var e=i(this.el);e.find(".sbi-screenreader").each(function(){i(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),e.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var i=10;e.find(".sbi_transition").each(function(){var e=jQuery(this);setTimeout(function(){e.removeClass("sbi_transition")},i),i+=10})},500)},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||i(".sbi_no_resraise").removeClass("sbi_no_resraise");var e=i.Event("sbiafterimagesloaded");e.el=i(this.el),i(window).trigger(e)},setResizedImages:function(){i(this.el).find(".sbi_resized_image_data").length&&void 0!==i(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===i(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(i(this.el).find(".sbi_resized_image_data").attr("data-resized")),i(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var e=this;if(e.needsResizing.length>0&&e.settings.resizingEnabled){var s=i(this.el).find(".sbi_item").length;a({action:"sbi_resized_images_submit",needs_resizing:e.needsResizing,offset:s,feed_id:e.settings.feedID,atts:e.settings.shortCodeAtts},function(i){if(0===i.trim().indexOf("{")){var s=JSON.parse(i);e.settings.debugEnabled&&console.log(s)}})}},loadMoreButtonInit:function(){var e=i(this.el),s=this;e.find("#sbi_load .sbi_load_btn").off().on("click",function(){s.afterLoadMoreClicked(jQuery(this)),s.getNewPostSet()})},getNewPostSet:function(){var e=i(this.el),s=this;a({action:"sbi_load_more_clicked",offset:e.find(".sbi_item").length,feed_id:s.settings.feedID,atts:s.settings.shortCodeAtts,current_resolution:s.imageResolution},function(t){if(0===t.trim().indexOf("{")){var a=JSON.parse(t);s.settings.debugEnabled&&console.log(a),s.appendNewPosts(a.html),s.addResizedImages(a.resizedImages),s.settings.ajaxPostLoad?(s.settings.ajaxPostLoad=!1,s.afterInitialImagesLoaded()):s.afterNewImagesLoaded(),a.feedStatus.shouldPaginate?s.outOfPages=!1:(s.outOfPages=!0,e.find(".sbi_load_btn").hide()),i(".sbi_no_js").removeClass("sbi_no_js")}})},appendNewPosts:function(e){var s=i(this.el);s.find("#sbi_images .sbi_item").length?s.find("#sbi_images .sbi_item").last().after(e):s.find("#sbi_images").append(e)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var e=i(this.el),s=e.find(".sbi_photo").eq(0).innerWidth(),t=this.getColumnCount(),a=e.find("#sbi_images").innerWidth()-e.find("#sbi_images").width(),n=a/2;sbi_photo_width_manual=e.find("#sbi_images").width()/t-a,e.find(".sbi_photo").css("height",s),e.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;e.find(".sbi_owl2row-item").length&&(i=1);var s=e.find(".sbi_photo").eq(0).innerWidth()/i;s+=parseInt(n)*(2-i+2),e.find(".sbi-owl-nav div").css("top",s)},100)},maybeRaiseSingleImageResolution:function(e,s,t){var a=this,n=a.getImageUrls(e),o=e.find(".sbi_photo img").attr("src"),d=150,r=e.find("img").get(0),l=o===window.sbi.options.placeholder?1:r.naturalWidth/r.naturalHeight;t=void 0!==t&&t;if(!(e.hasClass("sbi_no_resraise")||e.hasClass("sbi_had_error")||e.find(".sbi_link_area").length&&e.find(".sbi_link_area").hasClass("sbi_had_error"))){i.each(n,function(i,e){e===o&&(d=parseInt(i),t=!1)});var h=640;switch(a.settings.imgRes){case"thumb":h=150;break;case"medium":h=320;break;case"full":h=640;break;default:var g=Math.max(a.settings.autoMinRes,e.find(".sbi_photo").innerWidth()),u=a.getBestResolutionForAuto(g,l,e);switch(u){case 320:h=320;break;case 150:h=150}}if(h>d||o===window.sbi.options.placeholder||t){if(a.settings.debugEnabled){var m=o===window.sbi.options.placeholder?"was placeholder":"too small";console.log("raise res for "+o,m)}var _=n[h].split("?ig_cache_key")[0];if(e.find(".sbi_photo img").attr("src",_),e.find(".sbi_photo").css("background-image",'url("'+_+'")'),d=h,"auto"===a.settings.imgRes){var f=!1;e.find(".sbi_photo img").on("load",function(){var s=i(this),t=s.get(0).naturalWidth/s.get(0).naturalHeight;if(1e3!==s.get(0).naturalWidth&&t>l&&!f){switch(a.settings.debugEnabled&&console.log("raise res again for aspect ratio change "+o),f=!0,g=e.find(".sbi_photo").innerWidth(),u=a.getBestResolutionForAuto(g,t,e),h=640,u){case 320:h=320;break;case 150:h=150}h>d&&(_=n[h].split("?ig_cache_key")[0],s.attr("src",_),s.closest(".sbi_photo").css("background-image",'url("'+_+'")')),"masonry"!==a.layout&&"highlight"!==a.layout||(i(a.el).find("#sbi_images").smashotope(a.isotopeArgs),setTimeout(function(){i(a.el).find("#sbi_images").smashotope(a.isotopeArgs)},500))}else if(a.settings.debugEnabled){var r=f?"already checked":"no aspect ratio change";console.log("not raising res for replacement "+o,r)}})}}e.find("img").on("error",function(){if(i(this).hasClass("sbi_img_error"))console.log("unfixed error "+i(this).attr("src"));else{var e;if(i(this).addClass("sbi_img_error"),i(this).attr("src").indexOf("media/?size=")>-1||i(this).attr("src").indexOf("cdninstagram")>-1||i(this).attr("src").indexOf("fbcdn")>-1)a.settings.favorLocal=!0,void 0!==(e=a.getImageUrls(i(this).closest(".sbi_item")))[640]&&(i(this).attr("src",e[640]),i(this).closest(".sbi_photo").css("background-image","url("+e[640]+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));else if("undefined"!==i(this).closest(".sbi_photo").attr("data-img-src-set"))void 0!==(e=JSON.parse(i(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(i(this).attr("src",e.d),i(this).closest(".sbi_photo").css("background-image","url("+e.d+")"),i(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",e[640]).addClass("sbi_had_error"));setTimeout(function(){a.afterResize()},1500)}})}},maybeRaiseImageResolution:function(e){var s=this,t=void 0!==e&&!0===e?".sbi_item.sbi_new":".sbi_item",a=!s.isInitialized;i(s.el).find(t).each(function(e){!i(this).hasClass("sbi_num_diff_hide")&&i(this).find(".sbi_photo").length&&void 0!==i(this).find(".sbi_photo").attr("data-img-src-set")&&s.maybeRaiseSingleImageResolution(i(this),e,a)}),s.isInitialized=!0},getBestResolutionForAuto:function(e,s,t){(isNaN(s)||s<1)&&(s=1);var a=e*s,n=10*Math.ceil(a/10),o=[150,320,640];if(t.hasClass("sbi_highlighted")&&(n*=2),-1===o.indexOf(parseInt(n))){var d=!1;i.each(o,function(i,e){e>parseInt(n)&&!d&&(n=e,d=!0)})}return n},hideExtraImagesForWidth:function(){if("carousel"!==this.layout){var e=i(this.el),s=void 0!==e.attr("data-num")&&""!==e.attr("data-num")?parseInt(e.attr("data-num")):1,t=void 0!==e.attr("data-nummobile")&&""!==e.attr("data-nummobile")?parseInt(e.attr("data-nummobile")):s;i(window).width()<480?t<e.find(".sbi_item").length&&e.find(".sbi_item").slice(t-e.find(".sbi_item").length).addClass("sbi_num_diff_hide"):s<e.find(".sbi_item").length&&e.find(".sbi_item").slice(s-e.find(".sbi_item").length).addClass("sbi_num_diff_hide")}},setImageSizeClass:function(){var e=i(this.el);e.removeClass("sbi_small sbi_medium");var s=e.innerWidth(),t=parseInt(e.find("#sbi_images").outerWidth()-e.find("#sbi_images").width())/2,a=this.getColumnCount(),n=(s-t*(a+2))/a;n>120&&n<240?e.addClass("sbi_medium"):n<=120&&e.addClass("sbi_small")},setMinImageWidth:function(){i(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=i(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),s=i.attr("id").replace("sbi_","");if(void 0!==this.resizedImages[s]&&"video"!==this.resizedImages[s]&&"pending"!==this.resizedImages[s]&&"error"!==this.resizedImages[s].id&&"video"!==this.resizedImages[s].id&&"pending"!==this.resizedImages[s].id){if(void 0!==this.resizedImages[s].sizes){var t=[];void 0!==this.resizedImages[s].sizes.full&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"full.jpg",t.push(640)),void 0!==this.resizedImages[s].sizes.low&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"low.jpg",t.push(320)),void 0!==this.resizedImages[s].sizes.thumb&&(t.push(150),e[150]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"thumb.jpg"),this.settings.favorLocal&&(-1===t.indexOf(640)&&t.indexOf(320)>-1&&(e[640]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"low.jpg"),-1===t.indexOf(320)&&(t.indexOf(640)>-1?e[320]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"full.jpg":t.indexOf(150)>-1&&(e[320]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"thumb.jpg")),-1===t.indexOf(150)&&(t.indexOf(320)>-1?e[150]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"low.jpg":t.indexOf(640)>-1&&(e[150]=sb_instagram_js_options.resized_url+this.resizedImages[s].id+"full.jpg")))}}else(void 0===this.resizedImages[s]||void 0!==this.resizedImages[s].id&&"pending"!==this.resizedImages[s].id&&"error"!==this.resizedImages[s].id)&&this.addToNeedsResizing(s);return e},getAvatarUrl:function(i,e){if(""===i)return"";var s=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==s[i]?s[i]:"":void 0!==s[i]?s[i]:void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var s=i(this.el);e(),"function"==typeof s.find(".sbi_photo").sbi_imgLiquid&&s.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var e,s,t,a=this;e=jQuery,s={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},t={sbiCheckVisibility:function(i,e){if(jQuery.contains(document,i[0])){var s=e.sbiPreviousVisibility,a=i.is(":visible");e.sbiPreviousVisibility=a,null==s?e.runOnLoad&&e.callback(i,a):s!==a&&e.callback(i,a),setTimeout(function(){t.sbiCheckVisibility(i,e)},e.frequency)}}},e.fn.sbiVisibilityChanged=function(i){var a=e.extend({},s,i);return this.each(function(){t.sbiCheckVisibility(e(this),a)})},"function"==typeof i(this.el).filter(":hidden").sbiVisibilityChanged&&i(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){a.afterResize()},runOnLoad:!1})},getColumnCount:function(){var e=i(this.el),s=this.settings.cols,t=this.settings.colsmobile,a=s;return sbiWindowWidth=window.innerWidth,e.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&parseInt(s)>2&&parseInt(s)<7&&(a=2),sbiWindowWidth<640&&parseInt(s)>6&&parseInt(s)<11&&(a=4),sbiWindowWidth<=480&&parseInt(s)>2&&(a=1)):sbiWindowWidth<=480&&(a=t),parseInt(a)}},window.sbi_init=function(){window.sbi=new s,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(i){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:")),sbi_init()}));
1
+ var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(function(b){function e(){var r,i,e,s,l=l||{VER:"0.9.944"};l.bgs_Available=!1,l.bgs_CheckRunned=!1,(r=jQuery).fn.extend({sbi_imgLiquid:function(i){var e,s,t;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},l.bgs_CheckRunned||(l.bgs_CheckRunned=!0,e=r('<span style="background-size:cover" />'),r("body").append(e),(t=e[0])&&window.getComputedStyle&&((s=window.getComputedStyle(t,null))&&s.backgroundSize&&(l.bgs_Available="cover"===s.backgroundSize)),e.remove());var d=this;return this.options=i,this.settings=r.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(c){function s(){(f.responsive||_.data("sbi_imgLiquid_oldProcessed"))&&_.data("sbi_imgLiquid_settings")&&(f=_.data("sbi_imgLiquid_settings"),b.actualSize=b.get(0).offsetWidth+b.get(0).offsetHeight/1e4,b.sizeOld&&b.actualSize!==b.sizeOld&&n(),b.sizeOld=b.actualSize,setTimeout(s,f.responsiveCheckTime))}function t(){_.data("sbi_imgLiquid_error",!0),b.addClass("sbi_imgLiquid_error"),f.onItemError&&f.onItemError(c,b,_),u()}function n(){var i,e,s,t,n,a,o,d,r=0,l=0,h=b.width(),g=b.height();void 0===_.data("owidth")&&_.data("owidth",_[0].width),void 0===_.data("oheight")&&_.data("oheight",_[0].height),t=f.fill===h/g>=_.data("owidth")/_.data("oheight")?(i="100%",e="auto",s=Math.floor(h),Math.floor(h*(_.data("oheight")/_.data("owidth")))):(i="auto",e="100%",s=Math.floor(g*(_.data("owidth")/_.data("oheight"))),Math.floor(g)),o=h-s,"left"===(n=f.horizontalAlign.toLowerCase())&&(l=0),"center"===n&&(l=.5*o),"right"===n&&(l=o),-1===n.indexOf("%")||0<(n=parseInt(n.replace("%",""),10))&&(l=o*n*.01),d=g-t,"left"===(a=f.verticalAlign.toLowerCase())&&(r=0),"center"===a&&(r=.5*d),"bottom"===a&&(r=d),-1===a.indexOf("%")||0<(a=parseInt(a.replace("%",""),10))&&(r=d*a*.01),f.hardPixels&&(i=s,e=t),_.css({width:i,height:e,"margin-left":Math.floor(l),"margin-top":Math.floor(r)}),_.data("sbi_imgLiquid_oldProcessed")||(_.fadeTo(f.fadeInTime,1),_.data("sbi_imgLiquid_oldProcessed",!0),f.removeBoxBackground&&b.css("background-image","none"),b.addClass("sbi_imgLiquid_nobgSize"),b.addClass("sbi_imgLiquid_ready")),f.onItemFinish&&f.onItemFinish(c,b,_),u()}function u(){c===d.length-1&&d.settings.onFinish&&d.settings.onFinish()}var i,e,a,o,f=d.settings,b=r(this),_=r("img:first",b);return _.length?(f=_.data("sbi_imgLiquid_settings")?(b.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),r.extend({},_.data("sbi_imgLiquid_settings"),d.options)):r.extend({},d.settings,(o={},d.settings.useDataHtmlAttr&&(i=b.attr("data-sbi_imgLiquid-fill"),e=b.attr("data-sbi_imgLiquid-horizontalAlign"),a=b.attr("data-sbi_imgLiquid-verticalAlign"),"true"!==i&&"false"!==i||(o.fill=Boolean("true"===i)),void 0===e||"left"!==e&&"center"!==e&&"right"!==e&&-1===e.indexOf("%")||(o.horizontalAlign=e),void 0===a||"top"!==a&&"bottom"!==a&&"center"!==a&&-1===a.indexOf("%")||(o.verticalAlign=a)),l.isIE&&d.settings.ieFadeInDisabled&&(o.fadeInTime=0),o)),_.data("sbi_imgLiquid_settings",f),f.onItemStart&&f.onItemStart(c,b,_),void(l.bgs_Available&&f.useBackgroundSize?(-1===b.css("background-image").indexOf(encodeURI(_.attr("src")))&&b.css({"background-image":'url("'+encodeURI(_.attr("src"))+'")'}),b.css({"background-size":f.fill?"cover":"contain","background-position":(f.horizontalAlign+" "+f.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),r("a:first",b).css({display:"block",width:"100%",height:"100%"}),r("img",b).css({display:"none"}),f.onItemFinish&&f.onItemFinish(c,b,_),b.addClass("sbi_imgLiquid_bgSize"),b.addClass("sbi_imgLiquid_ready"),u()):function i(){if(_.data("oldSrc")&&_.data("oldSrc")!==_.attr("src")){var e=_.clone().removeAttr("style");return e.data("sbi_imgLiquid_settings",_.data("sbi_imgLiquid_settings")),_.parent().prepend(e),_.remove(),(_=e)[0].width=0,void setTimeout(i,10)}return _.data("sbi_imgLiquid_oldProcessed")?void n():(_.data("sbi_imgLiquid_oldProcessed",!1),_.data("oldSrc",_.attr("src")),r("img:not(:first)",b).css("display","none"),b.css({overflow:"hidden"}),_.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),_.on("error",t),_[0].onerror=t,function i(){_.data("sbi_imgLiquid_error")||_.data("sbi_imgLiquid_loaded")||_.data("sbi_imgLiquid_oldProcessed")||(b.is(":visible")&&_[0].complete&&0<_[0].width&&0<_[0].height?(_.data("sbi_imgLiquid_loaded",!0),setTimeout(n,c*f.delay)):setTimeout(i,f.timecheckvisibility))}(),void s())}())):void t()})}}),i=l.injectCss,e=document.getElementsByTagName("head")[0],(s=document.createElement("style")).type="text/css",s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i)),e.appendChild(s)}function i(){this.feeds={},this.options=sb_instagram_js_options}function o(i,e,s){this.el=i,this.index=e,this.settings=s,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.isInitialized=!1}function d(i,e){b.ajax({url:sbiajaxurl,type:"post",data:i,success:e})}i.prototype={createPage:function(i,e){void 0!==window.sbiajaxurl&&-1!==window.sbiajaxurl.indexOf(window.location.hostname)||(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),b(".sbi_no_js_error_message").remove(),b(".sbi_no_js").removeClass("sbi_no_js"),i(e)},createFeeds:function(i){i.whenFeedsCreated(b(".sbi").each(function(i){b(this).attr("data-sbi-index",i+1);var e=b(this),s=void 0!==e.attr("data-sbi-flags")?e.attr("data-sbi-flags").split(","):[],t=void 0!==e.attr("data-options")?JSON.parse(e.attr("data-options")):{};-1<s.indexOf("testAjax")&&(window.sbi.triggeredTest=!0,d({action:"sbi_on_ajax_test_trigger"},function(i){console.log("did test")}));var n={cols:e.attr("data-cols"),colsmobile:void 0!==e.attr("data-colsmobile")&&"same"!==e.attr("data-colsmobile")?e.attr("data-colsmobile"):e.attr("data-cols"),num:e.attr("data-num"),imgRes:e.attr("data-res"),feedID:e.attr("data-feedid"),shortCodeAtts:e.attr("data-shortcode-atts"),resizingEnabled:-1===s.indexOf("resizeDisable"),imageLoadEnabled:-1===s.indexOf("imageLoadDisable"),debugEnabled:-1<s.indexOf("debug"),favorLocal:-1<s.indexOf("favorLocal"),ajaxPostLoad:-1<s.indexOf("ajaxPostLoad"),gdpr:-1<s.indexOf("gdpr"),consentGiven:!1,autoMinRes:1,general:t};window.sbi.feeds[i]=new o(this,i,n),window.sbi.feeds[i].setResizedImages(),window.sbi.feeds[i].init();var a=jQuery.Event("sbiafterfeedcreate");a.feed=window.sbi.feeds[i],jQuery(window).trigger(a)}))},afterFeedsCreated:function(){b(".sb_instagram_header").each(function(){var i=b(this);i.find(".sbi_header_link").hover(function(){i.find(".sbi_header_img_hover").addClass("sbi_fade_in")},function(){i.find(".sbi_header_img_hover").removeClass("sbi_fade_in")})})},encodeHTML:function(i){if(void 0===i)return"";var e=i.replace(/(>)/g,"&gt;");return e=(e=(e=e.replace(/(<)/g,"&lt;")).replace(/(&lt;br\/&gt;)/g,"<br>")).replace(/(&lt;br&gt;)/g,"<br>")},urlDetect:function(i){return i.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)}},o.prototype={init:function(){var i=this;i.settings.consentGiven=i.checkConsent(),b(this.el).find(".sbi_photo").parent("p").length&&b(this.el).addClass("sbi_no_autop"),b(this.el).find("#sbi_mod_error").length&&b(this.el).prepend(b(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var s,e=(s=0,function(i,e){clearTimeout(s),s=setTimeout(i,e)});jQuery(window).resize(function(){e(function(){i.afterResize()},500)}),b(this.el).find(".sbi_item").each(function(){i.lazyLoadCheck(b(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(i){i.find(".sbi_loader").removeClass("sbi_hidden"),i.find(".sbi_btn_text").addClass("sbi_hidden"),i.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var i=b(this.el),e=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){i.find(".sbi_loader").addClass("sbi_hidden"),i.find(".sbi_btn_text").removeClass("sbi_hidden"),e.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var i=b(this.el);i.find(".sbi-screenreader").each(function(){b(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),i.find(".sbi_item").each(function(i){jQuery(this).find(".sbi_photo").hover(function(){jQuery(this).fadeTo(200,.85)},function(){jQuery(this).stop().fadeTo(500,1)})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var e=10;i.find(".sbi_transition").each(function(){var i=jQuery(this);setTimeout(function(){i.removeClass("sbi_transition")},e),e+=10})},500)},lazyLoadCheck:function(i){if(i.find(".sbi_photo").length&&!i.closest(".sbi").hasClass("sbi-no-ll-check")){var e=this.getImageUrls(i),s=void 0!==e[640]?e[640]:i.find(".sbi_photo").attr("data-full-res");if(!this.settings.consentGiven&&-1<s.indexOf("scontent"))return;i.find(".sbi_photo img").each(function(){s&&void 0!==b(this).attr("data-src")&&b(this).attr("data-src",s),s&&void 0!==b(this).attr("data-orig-src")&&b(this).attr("data-orig-src",s),b(this).on("load",function(){!b(this).hasClass("sbi-replaced")&&-1<b(this).attr("src").indexOf("placeholder")&&(b(this).addClass("sbi-replaced"),s&&(b(this).attr("src",s),b(this).closest(".sbi_imgLiquid_bgSize").length&&b(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+s+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||b(".sbi_no_resraise").removeClass("sbi_no_resraise");var i=b.Event("sbiafterimagesloaded");i.el=b(this.el),b(window).trigger(i)},setResizedImages:function(){b(this.el).find(".sbi_resized_image_data").length&&void 0!==b(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===b(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(this.resizedImages=JSON.parse(b(this.el).find(".sbi_resized_image_data").attr("data-resized")),b(this.el).find(".sbi_resized_image_data").remove())},sendNeedsResizingToServer:function(){var i,e,t=this;0<t.needsResizing.length&&t.settings.resizingEnabled&&(i=b(this.el).find(".sbi_item").length,e=void 0!==t.settings.general.cache_all&&t.settings.general.cache_all,d({action:"sbi_resized_images_submit",needs_resizing:t.needsResizing,offset:i,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,cache_all:e},function(i){if(0===i.trim().indexOf("{")){var e=JSON.parse(i);for(var s in t.settings.debugEnabled&&console.log(e),e)e.hasOwnProperty(s)&&(t.resizedImages[s]=e[s]);t.maybeRaiseImageResolution(),setTimeout(function(){t.afterResize()},500)}}))},loadMoreButtonInit:function(){var i=b(this.el),e=this;i.find("#sbi_load .sbi_load_btn").off().on("click",function(){e.afterLoadMoreClicked(jQuery(this)),e.getNewPostSet()})},getNewPostSet:function(){var s=b(this.el),t=this;d({action:"sbi_load_more_clicked",offset:s.find(".sbi_item").length,feed_id:t.settings.feedID,atts:t.settings.shortCodeAtts,current_resolution:t.imageResolution},function(i){var e;0===i.trim().indexOf("{")&&(e=JSON.parse(i),t.settings.debugEnabled&&console.log(e),t.appendNewPosts(e.html),t.addResizedImages(e.resizedImages),t.settings.ajaxPostLoad?(t.settings.ajaxPostLoad=!1,t.afterInitialImagesLoaded()):t.afterNewImagesLoaded(),e.feedStatus.shouldPaginate?t.outOfPages=!1:(t.outOfPages=!0,s.find(".sbi_load_btn").hide()),b(".sbi_no_js").removeClass("sbi_no_js"))})},appendNewPosts:function(i){var e=b(this.el);e.find("#sbi_images .sbi_item").length?e.find("#sbi_images .sbi_item").last().after(i):e.find("#sbi_images").append(i)},addResizedImages:function(i){for(var e in i)this.resizedImages[e]=i[e]},setImageHeight:function(){var s=b(this.el),i=s.find(".sbi_photo").eq(0).innerWidth(),e=this.getColumnCount(),t=s.find("#sbi_images").innerWidth()-s.find("#sbi_images").width(),n=t/2;sbi_photo_width_manual=s.find("#sbi_images").width()/e-t,s.find(".sbi_photo").css("height",i),s.find(".sbi-owl-nav").length&&setTimeout(function(){var i=2;s.find(".sbi_owl2row-item").length&&(i=1);var e=s.find(".sbi_photo").eq(0).innerWidth()/i;e+=parseInt(n)*(2-i+2),s.find(".sbi-owl-nav div").css("top",e)},100)},maybeRaiseSingleImageResolution:function(t,i,s){var n=this,a=n.getImageUrls(t),o=t.find(".sbi_photo img").attr("src"),d=150,e=t.find("img").get(0),r=o===window.sbi.options.placeholder?1:e.naturalWidth/e.naturalHeight,s=void 0!==s&&s;if(!(t.hasClass("sbi_no_resraise")||t.hasClass("sbi_had_error")||t.find(".sbi_link_area").length&&t.find(".sbi_link_area").hasClass("sbi_had_error")))if(a.length<1)t.find(".sbi_link_area").length&&t.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));else{(t.find(".sbi_link_area").length&&t.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!n.settings.consentGiven)&&t.find(".sbi_link_area").attr("href",a[a.length-1]),void 0!==a[640]&&t.find(".sbi_photo").attr("data-full-res",a[640]),b.each(a,function(i,e){e===o&&(d=parseInt(i),s=!1)});var l,h,g,c=640;switch(n.settings.imgRes){case"thumb":c=150;break;case"medium":c=320;break;case"full":c=640;break;default:var u=Math.max(n.settings.autoMinRes,t.find(".sbi_photo").innerWidth()),f=n.getBestResolutionForAuto(u,r,t);switch(f){case 320:c=320;break;case 150:c=150}}(d<c||o===window.sbi.options.placeholder||s)&&(n.settings.debugEnabled&&(l=o===window.sbi.options.placeholder?"was placeholder":"too small",console.log("rais res for "+o,l)),h=a[c].split("?ig_cache_key")[0],o!==h&&(t.find(".sbi_photo img").attr("src",h),t.find(".sbi_photo").css("background-image",'url("'+h+'")')),d=c,"auto"===n.settings.imgRes&&(g=!1,t.find(".sbi_photo img").on("load",function(){var i,e=b(this),s=e.get(0).naturalWidth/e.get(0).naturalHeight;if(1e3!==e.get(0).naturalWidth&&r<s&&!g){switch(n.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+o),g=!0,u=t.find(".sbi_photo").innerWidth(),f=n.getBestResolutionForAuto(u,s,t),c=640,f){case 320:c=320;break;case 150:c=150}d<c&&(h=a[c].split("?ig_cache_key")[0],e.attr("src",h),e.closest(".sbi_photo").css("background-image",'url("'+h+'")')),"masonry"!==n.layout&&"highlight"!==n.layout||(b(n.el).find("#sbi_images").smashotope(n.isotopeArgs),setTimeout(function(){b(n.el).find("#sbi_images").smashotope(n.isotopeArgs)},500))}else{n.settings.debugEnabled&&(i=g?"already checked":"no aspect ratio change",console.log("not raising res for replacement "+o,i))}}))),t.find("img").on("error",function(){var i;b(this).hasClass("sbi_img_error")?console.log("unfixed error "+b(this).attr("src")):(b(this).addClass("sbi_img_error"),-1<b(this).attr("src").indexOf("media/?size=")||-1<b(this).attr("src").indexOf("cdninstagram")||-1<b(this).attr("src").indexOf("fbcdn")?(n.settings.favorLocal=!0,void 0!==(i=n.getImageUrls(b(this).closest(".sbi_item")))[640]&&(b(this).attr("src",i[640]),b(this).closest(".sbi_photo").css("background-image","url("+i[640]+")"),b(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",i[640]).addClass("sbi_had_error"))):"undefined"!==b(this).closest(".sbi_photo").attr("data-img-src-set")&&void 0!==(i=JSON.parse(b(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"))).d&&(b(this).attr("src",i.d),b(this).closest(".sbi_photo").css("background-image","url("+i.d+")"),b(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",i[640]).addClass("sbi_had_error")),setTimeout(function(){n.afterResize()},1500))})}},maybeRaiseImageResolution:function(i){var e=this,s=void 0!==i&&!0===i?".sbi_item.sbi_new":".sbi_item",t=!e.isInitialized;b(e.el).find(s).each(function(i){!b(this).hasClass("sbi_num_diff_hide")&&b(this).find(".sbi_photo").length&&void 0!==b(this).find(".sbi_photo").attr("data-img-src-set")&&e.maybeRaiseSingleImageResolution(b(this),i,t)}),e.isInitialized=!0},getBestResolutionForAuto:function(i,e,s){(isNaN(e)||e<1)&&(e=1);var t,n=i*e,a=10*Math.ceil(n/10),o=[150,320,640];return s.hasClass("sbi_highlighted")&&(a*=2),-1===o.indexOf(parseInt(a))&&(t=!1,b.each(o,function(i,e){e>parseInt(a)&&!t&&(a=e,t=!0)})),a},hideExtraImagesForWidth:function(){var i,e,s;"carousel"!==this.layout&&(e=void 0!==(i=b(this.el)).attr("data-num")&&""!==i.attr("data-num")?parseInt(i.attr("data-num")):1,s=void 0!==i.attr("data-nummobile")&&""!==i.attr("data-nummobile")?parseInt(i.attr("data-nummobile")):e,b(window).width()<480?s<i.find(".sbi_item").length&&i.find(".sbi_item").slice(s-i.find(".sbi_item").length).addClass("sbi_num_diff_hide"):e<i.find(".sbi_item").length&&i.find(".sbi_item").slice(e-i.find(".sbi_item").length).addClass("sbi_num_diff_hide"))},setImageSizeClass:function(){var i=b(this.el);i.removeClass("sbi_small sbi_medium");var e=i.innerWidth(),s=parseInt(i.find("#sbi_images").outerWidth()-i.find("#sbi_images").width())/2,t=this.getColumnCount(),n=(e-s*(t+2))/t;120<n&&n<240?i.addClass("sbi_medium"):n<=120&&i.addClass("sbi_small")},setMinImageWidth:function(){b(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=b(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(i){var e,s=JSON.parse(i.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),t=i.attr("id").replace("sbi_","");return this.settings.consentGiven||(s=[]),void 0!==this.resizedImages[t]&&"video"!==this.resizedImages[t]&&"pending"!==this.resizedImages[t]&&"error"!==this.resizedImages[t].id&&"video"!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id?void 0!==this.resizedImages[t].sizes&&(e=[],void 0!==this.resizedImages[t].sizes.full&&(s[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg",e.push(640)),void 0!==this.resizedImages[t].sizes.low&&(s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg",e.push(320)),void 0!==this.resizedImages[t].sizes.thumb&&(e.push(150),s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg"),this.settings.favorLocal&&(-1===e.indexOf(640)&&-1<e.indexOf(320)&&(s[640]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg"),-1===e.indexOf(320)&&(-1<e.indexOf(640)?s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg":-1<e.indexOf(150)&&(s[320]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"thumb.jpg")),-1===e.indexOf(150)&&(-1<e.indexOf(320)?s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"low.jpg":-1<e.indexOf(640)&&(s[150]=sb_instagram_js_options.resized_url+this.resizedImages[t].id+"full.jpg")))):(void 0===this.resizedImages[t]||void 0!==this.resizedImages[t].id&&"pending"!==this.resizedImages[t].id&&"error"!==this.resizedImages[t].id)&&this.addToNeedsResizing(t),s},getAvatarUrl:function(i,e){if(""===i)return"";var s=this.settings.general.avatars;return"local"===(e=void 0!==e?e:"local")?void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":void 0!==s[i]?s[i]:"":void 0!==s[i]?s[i]:void 0!==s["LCL"+i]&&1===parseInt(s["LCL"+i])?sb_instagram_js_options.resized_url+i+".jpg":""},addToNeedsResizing:function(i){-1===this.needsResizing.indexOf(i)&&this.needsResizing.push(i)},applyImageLiquid:function(){var i=b(this.el);e(),"function"==typeof i.find(".sbi_photo").sbi_imgLiquid&&i.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var s,t,n,a=this;s=jQuery,t={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},n={sbiCheckVisibility:function(i,e){var s,t;jQuery.contains(document,i[0])&&(s=e.sbiPreviousVisibility,t=i.is(":visible"),e.sbiPreviousVisibility=t,null==s?e.runOnLoad&&e.callback(i,t):s!==t&&e.callback(i,t),setTimeout(function(){n.sbiCheckVisibility(i,e)},e.frequency))}},s.fn.sbiVisibilityChanged=function(i){var e=s.extend({},t,i);return this.each(function(){n.sbiCheckVisibility(s(this),e)})},"function"==typeof b(this.el).filter(":hidden").sbiVisibilityChanged&&b(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(i,e){a.afterResize()},runOnLoad:!1})},getColumnCount:function(){var i=b(this.el),e=this.settings.cols,s=this.settings.colsmobile,t=e;return sbiWindowWidth=window.innerWidth,i.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&2<parseInt(e)&&parseInt(e)<7&&(t=2),sbiWindowWidth<640&&6<parseInt(e)&&parseInt(e)<11&&(t=4),sbiWindowWidth<=480&&2<parseInt(e)&&(t=1)):sbiWindowWidth<=480&&(t=s),parseInt(t)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;var i,e;"undefined"!=typeof CLI_Cookie?null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary")):void 0!==window.cnArgs?2===(i=("; "+document.cookie).split("; cookie_notice_accepted=")).length&&(e=i.pop().split(";").shift(),this.settings.consentGiven="true"===e):void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(i){for(var e=i+"=",s=window.document.cookie.split(";"),t=0;t<s.length;t++){var n=s[t].trim();if(0==n.indexOf(e))return n.substring(e.length,n.length)}return""}("complianz_consent_status"):void 0!==window.Cookiebot&&(this.settings.consentGiven=Cookiebot.consented);var s=jQuery.Event("sbicheckconsent");return s.feed=this,jQuery(window).trigger(s),this.settings.consentGiven},afterConsentToggled:function(){var i;this.checkConsent()&&((i=this).maybeRaiseImageResolution(),setTimeout(function(){i.afterResize()},500))}},window.sbi_init=function(){window.sbi=new i,window.sbi.createPage(window.sbi.createFeeds,{whenFeedsCreated:window.sbi.afterFeedsCreated})}}(jQuery),jQuery(document).ready(function(e){void 0===window.sb_instagram_js_options&&(window.sb_instagram_js_options={font_method:"svg",resized_url:location.protocol+"//"+window.location.hostname+"/wp-content/uploads/sb-instagram-feed-images/",placeholder:location.protocol+"//"+window.location.hostname+"/wp-content/plugins/instagram-feed/img/placeholder.png"}),void 0!==window.sb_instagram_js_options.resized_url&&-1===window.sb_instagram_js_options.resized_url.indexOf(location.protocol)&&("http:"===location.protocol?window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("https:","http:"):window.sb_instagram_js_options.resized_url=window.sb_instagram_js_options.resized_url.replace("http:","https:")),sbi_init(),e("#cookie-notice a").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e("#cookie-law-info-bar a").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e(".cli-user-preference-checkbox").click(function(){setTimeout(function(){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})},1e3)}),e(window).on("CookiebotOnAccept",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),e(document).on("cmplzAcceptAll",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!0,window.sbi.feeds[i].afterConsentToggled()})}),e(document).on("cmplzRevoke",function(i){e.each(window.sbi.feeds,function(i){window.sbi.feeds[i].settings.consentGiven=!1,window.sbi.feeds[i].afterConsentToggled()})})}));
templates/feed.php CHANGED
@@ -15,7 +15,7 @@ $sb_images_style = SB_Instagram_Display_Elements::get_sbi_images_style( $setting
15
  $image_resolution_setting = $settings['imageres'];
16
  $cols_setting = $settings['cols'];
17
  $num_setting = $settings['num'];
18
- $icon_type = $settings['font_method'];
19
 
20
  /**
21
  * Add HTML or execute code before the feed displays.
15
  $image_resolution_setting = $settings['imageres'];
16
  $cols_setting = $settings['cols'];
17
  $num_setting = $settings['num'];
18
+ $icon_type = 'svg';
19
 
20
  /**
21
  * Add HTML or execute code before the feed displays.