Instagram Feed - Version 2.1.2

Version Description

  • New: Added setting "API request size" on the "Customize" tab to allow requesting of more posts than are in the feed. Setting this to a high number will prevent no posts being found if you often post IG TV posts and use a personal account.
  • Tweak: Removed width and height attributes from the image element in the feed to prevent notices about serving scaled images in optimization tools.
Download this release

Release Info

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

Code changes from version 2.1.1 to 2.1.2

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.3
6
- Stable tag: 2.1.1
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
@@ -324,10 +324,14 @@ We understand that sometimes you need help, have issues or just have questions.
324
* Plus more customization options added all the time!
325
326
== Changelog ==
327
= 2.1.1 =
328
* New: Added ability to enqueue the CSS file through the shortcode. This loads the file in the footer of the site, and only on pages that include a feed. Enable on the "Customize" tab.
329
* Tweak: Resized images can be used in the page source code when "Disable js image loading" setting is enabled.
330
- * Fix: HTML for header would still be visible in the source of the page when removing the header using showheader=false in the shortcode
331
332
= 2.1 =
333
* New: Added the ability to overwrite default templates in your theme. View [this article](https://smashballoon.com/guide-to-creating-custom-templates/) for more information.
3
Tags: Instagram, Instagram feed, Instagram photos, Instagram widget, Instagram gallery
4
Requires at least: 3.4
5
Tested up to: 5.3
6
+ Stable tag: 2.1.2
7
License: GPLv2 or later
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
324
* Plus more customization options added all the time!
325
326
== Changelog ==
327
+ = 2.1.2 =
328
+ * New: Added setting "API request size" on the "Customize" tab to allow requesting of more posts than are in the feed. Setting this to a high number will prevent no posts being found if you often post IG TV posts and use a personal account.
329
+ * Tweak: Removed width and height attributes from the image element in the feed to prevent notices about serving scaled images in optimization tools.
330
+
331
= 2.1.1 =
332
* New: Added ability to enqueue the CSS file through the shortcode. This loads the file in the footer of the site, and only on pages that include a feed. Enable on the "Customize" tab.
333
* Tweak: Resized images can be used in the page source code when "Disable js image loading" setting is enabled.
334
+ * Fix: HTML for header would still be visible in the source of the page when removing the header using showheader=false in the shortcode.
335
336
= 2.1 =
337
* New: Added the ability to overwrite default templates in your theme. View [this article](https://smashballoon.com/guide-to-creating-custom-templates/) for more information.
inc/admin/actions.php CHANGED
@@ -586,8 +586,7 @@ function sbi_notices_html() {
586
$is_plugins_page = isset( $current_screen->id ) && $current_screen->id === 'plugins';
587
$page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
588
//Only show to admins
589
- if ( ! current_user_can( 'manage_options' )
590
- || ($page !== 'sb-instagram-feed' && !$is_plugins_page) ) {
591
return;
592
}
593
@@ -643,7 +642,15 @@ function sbi_notices_html() {
643
$should_show_new_user_discount = false;
644
$has_been_one_month_since_rating_dismissal = isset( $sbi_statuses_option['rating_notice_dismissed'] ) ? ((int)$sbi_statuses_option['rating_notice_dismissed'] + 30*24*60*60) < $current_time + 1: true;
645
646
- if ( $in_new_user_month_range && $has_been_one_month_since_rating_dismissal ) {
647
global $current_user;
648
$user_id = $current_user->ID;
649
$ignore_new_user_sale_notice_meta = get_user_meta( $user_id, 'sbi_ignore_new_user_sale_notice' );
586
$is_plugins_page = isset( $current_screen->id ) && $current_screen->id === 'plugins';
587
$page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
588
//Only show to admins
589
+ if ( ! current_user_can( 'manage_options' ) ) {
590
return;
591
}
592
642
$should_show_new_user_discount = false;
643
$has_been_one_month_since_rating_dismissal = isset( $sbi_statuses_option['rating_notice_dismissed'] ) ? ((int)$sbi_statuses_option['rating_notice_dismissed'] + 30*24*60*60) < $current_time + 1: true;
644
645
+ if ( isset( $sbi_statuses_option['first_install'] ) && $sbi_statuses_option['first_install'] === 'from_update' ) {
646
+ global $current_user;
647
+ $user_id = $current_user->ID;
648
+ $ignore_new_user_sale_notice_meta = get_user_meta( $user_id, 'sbi_ignore_new_user_sale_notice' );
649
+ $ignore_new_user_sale_notice_meta = isset( $ignore_new_user_sale_notice_meta[0] ) ? $ignore_new_user_sale_notice_meta[0] : '';
650
+ if ( $ignore_new_user_sale_notice_meta !== 'always' ) {
651
+ $should_show_new_user_discount = true;
652
+ }
653
+ } elseif ( $in_new_user_month_range && $has_been_one_month_since_rating_dismissal ) {
654
global $current_user;
655
$user_id = $current_user->ID;
656
$ignore_new_user_sale_notice_meta = get_user_meta( $user_id, 'sbi_ignore_new_user_sale_notice' );
inc/admin/main.php CHANGED
@@ -81,6 +81,7 @@ function sb_instagram_settings_page() {
81
'sb_instagram_ajax_theme' => false,
82
'sb_instagram_disable_resize' => false,
83
'sb_instagram_favor_local' => false,
84
'disable_js_image_loading' => false,
85
'enqueue_js_in_head' => false,
86
'enqueue_css_in_shortcode' => false,
@@ -102,6 +103,7 @@ function sb_instagram_settings_page() {
102
$disable_js_image_loading = $options[ 'disable_js_image_loading' ];
103
$sb_instagram_disable_resize = $options[ 'sb_instagram_disable_resize' ];
104
$sb_instagram_favor_local = $options[ 'sb_instagram_favor_local' ];
105
106
$sb_instagram_cache_time = $options[ 'sb_instagram_cache_time' ];
107
$sb_instagram_cache_time_unit = $options[ 'sb_instagram_cache_time_unit' ];
@@ -285,6 +287,7 @@ function sb_instagram_settings_page() {
285
isset($_POST[ 'disable_js_image_loading' ]) ? $disable_js_image_loading = $_POST[ 'disable_js_image_loading' ] : $disable_js_image_loading = '';
286
isset($_POST[ 'sb_instagram_disable_resize' ]) ? $sb_instagram_disable_resize= sanitize_text_field( $_POST[ 'sb_instagram_disable_resize' ] ) : $sb_instagram_disable_resize = '';
287
isset($_POST[ 'sb_instagram_favor_local' ]) ? $sb_instagram_favor_local = sanitize_text_field( $_POST[ 'sb_instagram_favor_local' ] ) : $sb_instagram_favor_local = '';
288
289
if (isset($_POST[ 'sb_instagram_cron' ]) ) $sb_instagram_cron = $_POST[ 'sb_instagram_cron' ];
290
isset($_POST[ 'sb_instagram_backup' ]) ? $sb_instagram_backup = $_POST[ 'sb_instagram_backup' ] : $sb_instagram_backup = '';
@@ -328,6 +331,8 @@ function sb_instagram_settings_page() {
328
$options[ 'disable_js_image_loading' ] = $disable_js_image_loading;
329
$options[ 'sb_instagram_disable_resize' ] = $sb_instagram_disable_resize;
330
$options[ 'sb_instagram_favor_local' ] = $sb_instagram_favor_local;
331
$options[ 'sb_ajax_initial' ] = $sb_ajax_initial;
332
$options[ 'sb_instagram_cron' ] = $sb_instagram_cron;
333
$options['sb_instagram_backup'] = $sb_instagram_backup;
@@ -1730,6 +1735,17 @@ function sb_instagram_settings_page() {
1730
</td>
1731
</tr>
1732
1733
<tr valign="top">
1734
<th scope="row"><label><?php _e('Enqueue JS file in head', 'instagram-feed'); ?></label></th>
1735
<td>
81
'sb_instagram_ajax_theme' => false,
82
'sb_instagram_disable_resize' => false,
83
'sb_instagram_favor_local' => false,
84
+ 'sb_instagram_minnum' => 0,
85
'disable_js_image_loading' => false,
86
'enqueue_js_in_head' => false,
87
'enqueue_css_in_shortcode' => false,
103
$disable_js_image_loading = $options[ 'disable_js_image_loading' ];
104
$sb_instagram_disable_resize = $options[ 'sb_instagram_disable_resize' ];
105
$sb_instagram_favor_local = $options[ 'sb_instagram_favor_local' ];
106
+ $sb_instagram_minnum = $options[ 'sb_instagram_minnum' ];
107
108
$sb_instagram_cache_time = $options[ 'sb_instagram_cache_time' ];
109
$sb_instagram_cache_time_unit = $options[ 'sb_instagram_cache_time_unit' ];
287
isset($_POST[ 'disable_js_image_loading' ]) ? $disable_js_image_loading = $_POST[ 'disable_js_image_loading' ] : $disable_js_image_loading = '';
288
isset($_POST[ 'sb_instagram_disable_resize' ]) ? $sb_instagram_disable_resize= sanitize_text_field( $_POST[ 'sb_instagram_disable_resize' ] ) : $sb_instagram_disable_resize = '';
289
isset($_POST[ 'sb_instagram_favor_local' ]) ? $sb_instagram_favor_local = sanitize_text_field( $_POST[ 'sb_instagram_favor_local' ] ) : $sb_instagram_favor_local = '';
290
+ isset($_POST[ 'sb_instagram_minnum' ]) ? $sb_instagram_minnum = sanitize_text_field( $_POST[ 'sb_instagram_minnum' ] ) : $sb_instagram_minnum = '';
291
292
if (isset($_POST[ 'sb_instagram_cron' ]) ) $sb_instagram_cron = $_POST[ 'sb_instagram_cron' ];
293
isset($_POST[ 'sb_instagram_backup' ]) ? $sb_instagram_backup = $_POST[ 'sb_instagram_backup' ] : $sb_instagram_backup = '';
331
$options[ 'disable_js_image_loading' ] = $disable_js_image_loading;
332
$options[ 'sb_instagram_disable_resize' ] = $sb_instagram_disable_resize;
333
$options[ 'sb_instagram_favor_local' ] = $sb_instagram_favor_local;
334
+ $options[ 'sb_instagram_minnum' ] = $sb_instagram_minnum;
335
+
336
$options[ 'sb_ajax_initial' ] = $sb_ajax_initial;
337
$options[ 'sb_instagram_cron' ] = $sb_instagram_cron;
338
$options['sb_instagram_backup'] = $sb_instagram_backup;
1735
</td>
1736
</tr>
1737
1738
+ <tr valign="top">
1739
+ <th scope="row"><label><?php _e('API request size', 'instagram-feed'); ?></label><code class="sbi_shortcode"> minnum
1740
+ Eg: minnum=25</code></th>
1741
+ <td>
1742
+ <input name="sb_instagram_minnum" type="number" min="0" max="100" value="<?php echo esc_attr( $sb_instagram_minnum ); ?>" />
1743
+ <span class="sbi_note"><?php _e('Leave at "0" for default', 'instagram-feed'); ?></span>
1744
+ <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'instagram-feed'); ?></a>
1745
+ <p class="sbi_tooltip"><?php _e("If your feed contains a lot of IG TV posts or your feed is not displaying any posts despite there being posts available on Instagram.com, try increasing this number to 25 or more.", 'instagram-feed'); ?></p>
1746
+ </td>
1747
+ </tr>
1748
+
1749
<tr valign="top">
1750
<th scope="row"><label><?php _e('Enqueue JS file in head', 'instagram-feed'); ?></label></th>
1751
<td>
inc/class-sb-instagram-api-connect.php CHANGED
@@ -350,7 +350,7 @@ class SB_Instagram_API_Connect
350
if ( $endpoint_slug === 'header' ) {
351
$url = 'https://api.instagram.com/v1/users/' . $connected_account['user_id'] . '?access_token=' . sbi_maybe_clean( $connected_account['access_token'] );
352
} else {
353
- $num = min( $num, 33 );
354
$url = 'https://api.instagram.com/v1/users/' . $connected_account['user_id'] . '/media/recent?count='.$num.'&access_token=' . sbi_maybe_clean( $connected_account['access_token'] );
355
}
356
} else {
350
if ( $endpoint_slug === 'header' ) {
351
$url = 'https://api.instagram.com/v1/users/' . $connected_account['user_id'] . '?access_token=' . sbi_maybe_clean( $connected_account['access_token'] );
352
} else {
353
+ $num = $num > 20 ? min( $num, 33 ) : 20; // minimum set at 20 due to IG TV bug
354
$url = 'https://api.instagram.com/v1/users/' . $connected_account['user_id'] . '/media/recent?count='.$num.'&access_token=' . sbi_maybe_clean( $connected_account['access_token'] );
355
}
356
} else {
inc/class-sb-instagram-feed.php CHANGED
@@ -528,7 +528,7 @@ class SB_Instagram_Feed
528
* @since 2.0/5.0
529
*/
530
$num = apply_filters( 'sbi_num_in_request', $settings['minnum'], $settings );
531
-
532
$params = array(
533
'num' => $num
534
);
528
* @since 2.0/5.0
529
*/
530
$num = apply_filters( 'sbi_num_in_request', $settings['minnum'], $settings );
531
+ $num = max( $num, (int)$settings['apinum'] );
532
$params = array(
533
'num' => $num
534
);
inc/class-sb-instagram-parse.php CHANGED
@@ -163,12 +163,15 @@ class SB_Instagram_Parse
163
$media_urls['320'] = $permalink . 'media?size=m';
164
165
// use resized images if exists
166
- if ( isset( $resized_images[ $post_id ]['id'] ) && $resized_images[ $post_id ]['id'] !== 'pending' && $resized_images[ $post_id ]['id'] !== 'video' ) {
167
if ( isset( $resized_images[ $post_id ]['sizes']['full'] ) ) {
168
- $media_urls['640'] = sbi_get_resized_uploads_url() . $resized_images[ $post_id ]['id'] . 'full.jpg';
169
}
170
if ( isset( $resized_images[ $post_id ]['sizes']['low'] ) ) {
171
- $media_urls['320'] = sbi_get_resized_uploads_url() . $resized_images[ $post_id ]['id'] . 'low.jpg';
172
}
173
}
174
163
$media_urls['320'] = $permalink . 'media?size=m';
164
165
// use resized images if exists
166
+ if ( isset( $resized_images[ $post_id ]['id'] )
167
+ && $resized_images[ $post_id ]['id'] !== 'pending'
168
+ && $resized_images[ $post_id ]['id'] !== 'video'
169
+ && $resized_images[ $post_id ]['id'] !== 'error' ) {
170
if ( isset( $resized_images[ $post_id ]['sizes']['full'] ) ) {
171
+ $media_urls['640'] = $resized_images[ $post_id ]['id'];
172
}
173
if ( isset( $resized_images[ $post_id ]['sizes']['low'] ) ) {
174
+ $media_urls['320'] = $resized_images[ $post_id ]['id'];
175
}
176
}
177
inc/class-sb-instagram-settings.php CHANGED
@@ -75,6 +75,7 @@ class SB_Instagram_Settings {
75
'heightunit' => isset( $db['sb_instagram_height_unit'] ) ? $db['sb_instagram_height_unit'] : '',
76
'sortby' => isset( $db['sb_instagram_sort'] ) ? $db['sb_instagram_sort'] : '',
77
'num' => isset( $db['sb_instagram_num'] ) ? $db['sb_instagram_num'] : '',
78
'nummobile' => isset($db[ 'sb_instagram_nummobile' ]) ? $db[ 'sb_instagram_nummobile' ] : '',
79
'cols' => isset( $db['sb_instagram_cols'] ) ? $db['sb_instagram_cols'] : '',
80
'disablemobile' => isset( $db['sb_instagram_disable_mobile'] ) ? $db['sb_instagram_disable_mobile'] : '',
75
'heightunit' => isset( $db['sb_instagram_height_unit'] ) ? $db['sb_instagram_height_unit'] : '',
76
'sortby' => isset( $db['sb_instagram_sort'] ) ? $db['sb_instagram_sort'] : '',
77
'num' => isset( $db['sb_instagram_num'] ) ? $db['sb_instagram_num'] : '',
78
+ 'apinum' => isset( $db['sb_instagram_minnum'] ) ? $db['sb_instagram_minnum'] : '',
79
'nummobile' => isset($db[ 'sb_instagram_nummobile' ]) ? $db[ 'sb_instagram_nummobile' ] : '',
80
'cols' => isset( $db['sb_instagram_cols'] ) ? $db['sb_instagram_cols'] : '',
81
'disablemobile' => isset( $db['sb_instagram_disable_mobile'] ) ? $db['sb_instagram_disable_mobile'] : '',
instagram-feed-admin.php DELETED
@@ -1,2505 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
-
4
- function sbi_add_caps() {
5
- global $wp_roles;
6
- $wp_roles->add_cap( 'administrator', 'manage_instagram_feed_options' );
7
- }
8
- add_action( 'admin_init', 'sbi_add_caps' );
9
-
10
- function sb_instagram_menu() {
11
- $cap = current_user_can( 'manage_instagram_feed_options' ) ? 'manage_instagram_feed_options' : 'manage_options';
12
-
13
- add_menu_page(
14
- __( 'Instagram Feed', 'instagram-feed' ),
15
- __( 'Instagram Feed', 'instagram-feed' ),
16
- $cap,
17
- 'sb-instagram-feed',
18
- 'sb_instagram_settings_page'
19
- );
20
- add_submenu_page(
21
- 'sb-instagram-feed',
22
- __( 'Settings', 'instagram-feed' ),
23
- __( 'Settings', 'instagram-feed' ),
24
- $cap,
25
- 'sb-instagram-feed',
26
- 'sb_instagram_settings_page'
27
- );
28
- }
29
- add_action('admin_menu', 'sb_instagram_menu');
30
-
31
- function sb_instagram_settings_page() {
32
-
33
- //Hidden fields
34
- $sb_instagram_settings_hidden_field = 'sb_instagram_settings_hidden_field';
35
- $sb_instagram_configure_hidden_field = 'sb_instagram_configure_hidden_field';
36
- $sb_instagram_customize_hidden_field = 'sb_instagram_customize_hidden_field';
37
-
38
- //Declare defaults
39
- $sb_instagram_settings_defaults = array(
40
- 'sb_instagram_at' => '',
41
- 'sb_instagram_user_id' => '',
42
- 'sb_instagram_preserve_settings' => '',
43
- 'sb_instagram_ajax_theme' => false,
44
- 'sb_instagram_cache_time' => 1,
45
- 'sb_instagram_cache_time_unit' => 'hours',
46
- 'sb_instagram_width' => '100',
47
- 'sb_instagram_width_unit' => '%',
48
- 'sb_instagram_feed_width_resp' => false,
49
- 'sb_instagram_height' => '',
50
- 'sb_instagram_num' => '20',
51
- 'sb_instagram_height_unit' => '',
52
- 'sb_instagram_cols' => '4',
53
- 'sb_instagram_disable_mobile' => false,
54
- 'sb_instagram_image_padding' => '5',
55
- 'sb_instagram_image_padding_unit' => 'px',
56
- 'sb_instagram_sort' => 'none',
57
- 'sb_instagram_background' => '',
58
- 'sb_instagram_show_btn' => true,
59
- 'sb_instagram_btn_background' => '',
60
- 'sb_instagram_btn_text_color' => '',
61
- 'sb_instagram_btn_text' => __( 'Load More...', 'instagram-feed' ),
62
- 'sb_instagram_image_res' => 'auto',
63
- //Header
64
- 'sb_instagram_show_header' => true,
65
- 'sb_instagram_header_size' => 'small',
66
- 'sb_instagram_header_color' => '',
67
- //Follow button
68
- 'sb_instagram_show_follow_btn' => true,
69
- 'sb_instagram_folow_btn_background' => '',
70
- 'sb_instagram_follow_btn_text_color' => '',
71
- 'sb_instagram_follow_btn_text' => __( 'Follow on Instagram', 'instagram-feed' ),
72
- //Misc
73
- 'sb_instagram_custom_css' => '',
74
- 'sb_instagram_custom_js' => '',
75
- 'sb_instagram_cron' => 'no',
76
- 'check_api' => true,
77
- 'sb_instagram_backup' => true,
78
- 'enqueue_css_in_shortcode' => false,
79
- 'sb_instagram_disable_mob_swipe' => false,
80
- 'sbi_font_method' => 'svg',
81
- 'sb_instagram_disable_awesome' => false
82
- );
83
- //Save defaults in an array
84
- $options = wp_parse_args(get_option('sb_instagram_settings'), $sb_instagram_settings_defaults);
85
- update_option( 'sb_instagram_settings', $options );
86
-
87
- //Set the page variables
88
- $sb_instagram_at = $options[ 'sb_instagram_at' ];
89
- $sb_instagram_user_id = $options[ 'sb_instagram_user_id' ];
90
- $sb_instagram_preserve_settings = $options[ 'sb_instagram_preserve_settings' ];
91
- $sb_instagram_ajax_theme = $options[ 'sb_instagram_ajax_theme' ];
92
- $sb_instagram_cache_time = $options[ 'sb_instagram_cache_time' ];
93
- $sb_instagram_cache_time_unit = $options[ 'sb_instagram_cache_time_unit' ];
94
-
95
- $sb_instagram_width = $options[ 'sb_instagram_width' ];
96
- $sb_instagram_width_unit = $options[ 'sb_instagram_width_unit' ];
97
- $sb_instagram_feed_width_resp = $options[ 'sb_instagram_feed_width_resp' ];
98
- $sb_instagram_height = $options[ 'sb_instagram_height' ];
99
- $sb_instagram_height_unit = $options[ 'sb_instagram_height_unit' ];
100
- $sb_instagram_num = $options[ 'sb_instagram_num' ];
101
- $sb_instagram_cols = $options[ 'sb_instagram_cols' ];
102
- $sb_instagram_disable_mobile = $options[ 'sb_instagram_disable_mobile' ];
103
- $sb_instagram_image_padding = $options[ 'sb_instagram_image_padding' ];
104
- $sb_instagram_image_padding_unit = $options[ 'sb_instagram_image_padding_unit' ];
105
- $sb_instagram_sort = $options[ 'sb_instagram_sort' ];
106
- $sb_instagram_background = $options[ 'sb_instagram_background' ];
107
- $sb_instagram_show_btn = $options[ 'sb_instagram_show_btn' ];
108
- $sb_instagram_btn_background = $options[ 'sb_instagram_btn_background' ];
109
- $sb_instagram_btn_text_color = $options[ 'sb_instagram_btn_text_color' ];
110
- $sb_instagram_btn_text = $options[ 'sb_instagram_btn_text' ];
111
- $sb_instagram_image_res = $options[ 'sb_instagram_image_res' ];
112
- //Header
113
- $sb_instagram_show_header = $options[ 'sb_instagram_show_header' ];
114
- $sb_instagram_header_size = $options[ 'sb_instagram_header_size' ];
115
- $sb_instagram_show_bio = isset( $options[ 'sb_instagram_show_bio' ] ) ? $options[ 'sb_instagram_show_bio' ] : true;
116
- $sb_instagram_header_color = $options[ 'sb_instagram_header_color' ];
117
- //Follow button
118
- $sb_instagram_show_follow_btn = $options[ 'sb_instagram_show_follow_btn' ];
119
- $sb_instagram_folow_btn_background = $options[ 'sb_instagram_folow_btn_background' ];
120
- $sb_instagram_follow_btn_text_color = $options[ 'sb_instagram_follow_btn_text_color' ];
121
- $sb_instagram_follow_btn_text = $options[ 'sb_instagram_follow_btn_text' ];
122
- //Misc
123
- $sb_instagram_custom_css = $options[ 'sb_instagram_custom_css' ];
124
- $sb_instagram_custom_js = $options[ 'sb_instagram_custom_js' ];
125
- $sb_instagram_cron = $options[ 'sb_instagram_cron' ];
126
- $check_api = $options[ 'check_api' ];
127
- $sb_instagram_backup = $options[ 'sb_instagram_backup' ];
128
- $sbi_font_method = $options[ 'sbi_font_method' ];
129
- $sb_instagram_disable_awesome = $options[ 'sb_instagram_disable_awesome' ];
130
-
131
-
132
- //Check nonce before saving data
133
- if ( ! isset( $_POST['sb_instagram_settings_nonce'] ) || ! wp_verify_nonce( $_POST['sb_instagram_settings_nonce'], 'sb_instagram_saving_settings' ) ) {
134
- //Nonce did not verify
135
- } else {
136
- // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
137
- if( isset($_POST[ $sb_instagram_settings_hidden_field ]) && $_POST[ $sb_instagram_settings_hidden_field ] == 'Y' ) {
138
-
139
- if( isset($_POST[ $sb_instagram_configure_hidden_field ]) && $_POST[ $sb_instagram_configure_hidden_field ] == 'Y' ) {
140
-
141
- $sb_instagram_at = sanitize_text_field( $_POST[ 'sb_instagram_at' ] );
142
- $sb_instagram_user_id = array();
143
- if ( isset( $_POST[ 'sb_instagram_user_id' ] )) {
144
- if ( is_array( $_POST[ 'sb_instagram_user_id' ] ) ) {
145
- foreach( $_POST[ 'sb_instagram_user_id' ] as $user_id ) {
146
- $sb_instagram_user_id[] = sanitize_text_field( $user_id );
147
- }
148
- } else {
149
- $sb_instagram_user_id[] = sanitize_text_field( $_POST[ 'sb_instagram_user_id' ] );
150
- }
151
- }
152
- isset($_POST[ 'sb_instagram_preserve_settings' ]) ? $sb_instagram_preserve_settings = sanitize_text_field( $_POST[ 'sb_instagram_preserve_settings' ] ) : $sb_instagram_preserve_settings = '';
153
- isset($_POST[ 'sb_instagram_cache_time' ]) ? $sb_instagram_cache_time = sanitize_text_field( $_POST[ 'sb_instagram_cache_time' ] ) : $sb_instagram_cache_time = '';
154
- isset($_POST[ 'sb_instagram_cache_time_unit' ]) ? $sb_instagram_cache_time_unit = sanitize_text_field( $_POST[ 'sb_instagram_cache_time_unit' ] ) : $sb_instagram_cache_time_unit = '';
155
-
156
- $options[ 'sb_instagram_at' ] = $sb_instagram_at;
157
- $options[ 'sb_instagram_user_id' ] = $sb_instagram_user_id;
158
- $options[ 'sb_instagram_preserve_settings' ] = $sb_instagram_preserve_settings;
159
-
160
- $options[ 'sb_instagram_cache_time' ] = $sb_instagram_cache_time;
161
- $options[ 'sb_instagram_cache_time_unit' ] = $sb_instagram_cache_time_unit;
162
-
163
- //Delete all SBI transients
164
- global $wpdb;
165
- $table_name = $wpdb->prefix . "options";
166
- $wpdb->query( "
167
- DELETE
168
- FROM $table_name
169
- WHERE `option_name` LIKE ('%\_transient\_sbi\_%')
170
- " );
171
- $wpdb->query( "
172
- DELETE
173
- FROM $table_name
174
- WHERE `option_name` LIKE ('%\_transient\_timeout\_sbi\_%')
175
- " );
176
- $wpdb->query( "
177
- DELETE
178
- FROM $table_name
179
- WHERE `option_name` LIKE ('%\_transient\_&sbi\_%')
180
- " );
181
- $wpdb->query( "
182
- DELETE
183
- FROM $table_name
184
- WHERE `option_name` LIKE ('%\_transient\_timeout\_&sbi\_%')
185
- " );
186
- } //End config tab post
187
-
188
- if( isset($_POST[ $sb_instagram_customize_hidden_field ]) && $_POST[ $sb_instagram_customize_hidden_field ] == 'Y' ) {
189
-
190
- //Validate and sanitize width field
191
- $safe_width = intval( sanitize_text_field( $_POST['sb_instagram_width'] ) );
192
- if ( ! $safe_width ) $safe_width = '';
193
- if ( strlen( $safe_width ) > 4 ) $safe_width = substr( $safe_width, 0, 4 );
194
- $sb_instagram_width = $safe_width;
195
-
196
- $sb_instagram_width_unit = sanitize_text_field( $_POST[ 'sb_instagram_width_unit' ] );
197
- isset($_POST[ 'sb_instagram_feed_width_resp' ]) ? $sb_instagram_feed_width_resp = sanitize_text_field( $_POST[ 'sb_instagram_feed_width_resp' ] ) : $sb_instagram_feed_width_resp = '';
198
-
199
- //Validate and sanitize height field
200
- $safe_height = intval( sanitize_text_field( $_POST['sb_instagram_height'] ) );
201
- if ( ! $safe_height ) $safe_height = '';
202
- if ( strlen( $safe_height ) > 4 ) $safe_height = substr( $safe_height, 0, 4 );
203
- $sb_instagram_height = $safe_height;
204
-
205
- $sb_instagram_height_unit = sanitize_text_field( $_POST[ 'sb_instagram_height_unit' ] );
206
-
207
- //Validate and sanitize number of photos field
208
- $safe_num = intval( sanitize_text_field( $_POST['sb_instagram_num'] ) );
209
- if ( ! $safe_num ) $safe_num = '';
210
- if ( strlen( $safe_num ) > 4 ) $safe_num = substr( $safe_num, 0, 4 );
211
- $sb_instagram_num = $safe_num;
212
-
213
- $sb_instagram_cols = sanitize_text_field( $_POST[ 'sb_instagram_cols' ] );
214
- isset($_POST[ 'sb_instagram_disable_mobile' ]) ? $sb_instagram_disable_mobile = sanitize_text_field( $_POST[ 'sb_instagram_disable_mobile' ] ) : $sb_instagram_disable_mobile = '';
215
-
216
- //Validate and sanitize padding field
217
- $safe_padding = intval( sanitize_text_field( $_POST['sb_instagram_image_padding'] ) );
218
- if ( ! $safe_padding ) $safe_padding = '';
219
- if ( strlen( $safe_padding ) > 4 ) $safe_padding = substr( $safe_padding, 0, 4 );
220
- $sb_instagram_image_padding = $safe_padding;
221
-
222
- $sb_instagram_image_padding_unit = sanitize_text_field( $_POST[ 'sb_instagram_image_padding_unit' ] );
223
- $sb_instagram_sort = sanitize_text_field( $_POST[ 'sb_instagram_sort' ] );
224
- $sb_instagram_background = sanitize_text_field( $_POST[ 'sb_instagram_background' ] );
225
- isset($_POST[ 'sb_instagram_show_btn' ]) ? $sb_instagram_show_btn = sanitize_text_field( $_POST[ 'sb_instagram_show_btn' ] ) : $sb_instagram_show_btn = '';
226
- $sb_instagram_btn_background = sanitize_text_field( $_POST[ 'sb_instagram_btn_background' ] );
227
- $sb_instagram_btn_text_color = sanitize_text_field( $_POST[ 'sb_instagram_btn_text_color' ] );
228
- $sb_instagram_btn_text = sanitize_text_field( $_POST[ 'sb_instagram_btn_text' ] );
229
- $sb_instagram_image_res = sanitize_text_field( $_POST[ 'sb_instagram_image_res' ] );
230
- //Header
231
- isset($_POST[ 'sb_instagram_show_header' ]) ? $sb_instagram_show_header = sanitize_text_field( $_POST[ 'sb_instagram_show_header' ] ) : $sb_instagram_show_header = '';
232
- isset($_POST[ 'sb_instagram_show_bio' ]) ? $sb_instagram_show_bio = sanitize_text_field( $_POST[ 'sb_instagram_show_bio' ] ) : $sb_instagram_show_bio = '';
233
- if (isset($_POST[ 'sb_instagram_header_size' ]) ) $sb_instagram_header_size = $_POST[ 'sb_instagram_header_size' ];
234
-
235
- $sb_instagram_header_color = sanitize_text_field( $_POST[ 'sb_instagram_header_color' ] );
236
- //Follow button
237
- isset($_POST[ 'sb_instagram_show_follow_btn' ]) ? $sb_instagram_show_follow_btn = sanitize_text_field( $_POST[ 'sb_instagram_show_follow_btn' ] ) : $sb_instagram_show_follow_btn = '';
238
- $sb_instagram_folow_btn_background = sanitize_text_field( $_POST[ 'sb_instagram_folow_btn_background' ] );
239
- $sb_instagram_follow_btn_text_color = sanitize_text_field( $_POST[ 'sb_instagram_follow_btn_text_color' ] );
240
- $sb_instagram_follow_btn_text = sanitize_text_field( $_POST[ 'sb_instagram_follow_btn_text' ] );
241
- //Misc
242
- $sb_instagram_custom_css = $_POST[ 'sb_instagram_custom_css' ];
243
- $sb_instagram_custom_js = $_POST[ 'sb_instagram_custom_js' ];
244
- isset($_POST[ 'sb_instagram_ajax_theme' ]) ? $sb_instagram_ajax_theme = sanitize_text_field( $_POST[ 'sb_instagram_ajax_theme' ] ) : $sb_instagram_ajax_theme = '';
245
- if (isset($_POST[ 'sb_instagram_cron' ]) ) $sb_instagram_cron = $_POST[ 'sb_instagram_cron' ];
246
- isset($_POST[ 'check_api' ]) ? $check_api = $_POST[ 'check_api' ] : $check_api = '';
247
- isset($_POST[ 'sb_instagram_backup' ]) ? $sb_instagram_backup = $_POST[ 'sb_instagram_backup' ] : $sb_instagram_backup = '';
248
- isset($_POST[ 'sbi_font_method' ]) ? $sbi_font_method = $_POST[ 'sbi_font_method' ] : $sbi_font_method = 'svg';
249
- isset($_POST[ 'sb_instagram_disable_awesome' ]) ? $sb_instagram_disable_awesome = sanitize_text_field( $_POST[ 'sb_instagram_disable_awesome' ] ) : $sb_instagram_disable_awesome = '';
250
-
251
- $options[ 'sb_instagram_width' ] = $sb_instagram_width;
252
- $options[ 'sb_instagram_width_unit' ] = $sb_instagram_width_unit;
253
- $options[ 'sb_instagram_feed_width_resp' ] = $sb_instagram_feed_width_resp;
254
- $options[ 'sb_instagram_height' ] = $sb_instagram_height;
255
- $options[ 'sb_instagram_height_unit' ] = $sb_instagram_height_unit;
256
- $options[ 'sb_instagram_num' ] = $sb_instagram_num;
257
- $options[ 'sb_instagram_cols' ] = $sb_instagram_cols;
258
- $options[ 'sb_instagram_disable_mobile' ] = $sb_instagram_disable_mobile;
259
- $options[ 'sb_instagram_image_padding' ] = $sb_instagram_image_padding;
260
- $options[ 'sb_instagram_image_padding_unit' ] = $sb_instagram_image_padding_unit;
261
- $options[ 'sb_instagram_sort' ] = $sb_instagram_sort;
262
- $options[ 'sb_instagram_background' ] = $sb_instagram_background;
263
- $options[ 'sb_instagram_show_btn' ] = $sb_instagram_show_btn;
264
- $options[ 'sb_instagram_btn_background' ] = $sb_instagram_btn_background;
265
- $options[ 'sb_instagram_btn_text_color' ] = $sb_instagram_btn_text_color;
266
- $options[ 'sb_instagram_btn_text' ] = $sb_instagram_btn_text;
267
- $options[ 'sb_instagram_image_res' ] = $sb_instagram_image_res;
268
- //Header
269
- $options[ 'sb_instagram_show_header' ] = $sb_instagram_show_header;
270
- $options[ 'sb_instagram_header_size' ] = $sb_instagram_header_size;
271
- $options[ 'sb_instagram_show_bio' ] = $sb_instagram_show_bio;
272
- $options[ 'sb_instagram_header_color' ] = $sb_instagram_header_color;
273
- //Follow button
274
- $options[ 'sb_instagram_show_follow_btn' ] = $sb_instagram_show_follow_btn;
275
- $options[ 'sb_instagram_folow_btn_background' ] = $sb_instagram_folow_btn_background;
276
- $options[ 'sb_instagram_follow_btn_text_color' ] = $sb_instagram_follow_btn_text_color;
277
- $options[ 'sb_instagram_follow_btn_text' ] = $sb_instagram_follow_btn_text;
278
- //Misc
279
- $options[ 'sb_instagram_custom_css' ] = $sb_instagram_custom_css;
280
- $options[ 'sb_instagram_custom_js' ] = $sb_instagram_custom_js;
281
- $options[ 'sb_instagram_ajax_theme' ] = $sb_instagram_ajax_theme;
282
- $options[ 'sb_instagram_cron' ] = $sb_instagram_cron;
283
- $options[ 'check_api' ] = $check_api;
284
- $options['sb_instagram_backup'] = $sb_instagram_backup;
285
- $options['sbi_font_method'] = $sbi_font_method;
286
- $options[ 'sb_instagram_disable_awesome' ] = $sb_instagram_disable_awesome;
287
-
288
- //clear expired tokens
289
- delete_option( 'sb_expired_tokens' );
290
-
291
- //Delete all SBI transients
292
- global $wpdb;
293
- $table_name = $wpdb->prefix . "options";
294
- $wpdb->query( "
295
- DELETE
296
- FROM $table_name
297
- WHERE `option_name` LIKE ('%\_transient\_sbi\_%')
298
- " );
299
- $wpdb->query( "
300
- DELETE
301
- FROM $table_name
302
- WHERE `option_name` LIKE ('%\_transient\_timeout\_sbi\_%')
303
- " );
304
- $wpdb->query( "
305
- DELETE
306
- FROM $table_name
307
- WHERE `option_name` LIKE ('%\_transient\_&sbi\_%')
308
- " );
309
- $wpdb->query( "
310
- DELETE
311
- FROM $table_name
312
- WHERE `option_name` LIKE ('%\_transient\_timeout\_&sbi\_%')
313
- " );
314
-
315
- if( $sb_instagram_cron == 'no' ) wp_clear_scheduled_hook('sb_instagram_cron_job');
316
-
317
- //Run cron when Misc settings are saved
318
- if( $sb_instagram_cron == 'yes' ){
319
- //Clear the existing cron event
320
- wp_clear_scheduled_hook('sb_instagram_cron_job');
321
-
322
- $sb_instagram_cache_time = $options[ 'sb_instagram_cache_time' ];
323
- $sb_instagram_cache_time_unit = $options[ 'sb_instagram_cache_time_unit' ];
324
-
325
- //Set the event schedule based on what the caching time is set to
326
- $sb_instagram_cron_schedule = 'hourly';
327
- if( $sb_instagram_cache_time_unit == 'hours' && $sb_instagram_cache_time > 5 ) $sb_instagram_cron_schedule = 'twicedaily';
328
- if( $sb_instagram_cache_time_unit == 'days' ) $sb_instagram_cron_schedule = 'daily';
329
-
330
- wp_schedule_event(time(), $sb_instagram_cron_schedule, 'sb_instagram_cron_job');
331
-
332
- sb_instagram_clear_page_caches();
333
- }
334
-
335
- } //End customize tab post
336
-
337
- //Save the settings to the settings array
338
- update_option( 'sb_instagram_settings', $options );
339
-
340
- ?>
341
- <div class="updated"><p><strong><?php _e( 'Settings saved.', 'instagram-feed' ); ?></strong></p></div>
342
- <?php } ?>
343
-
344
- <?php } //End nonce check ?>
345
-
346
-
347
- <div id="sbi_admin" class="wrap">
348
-
349
- <div id="header">
350
- <h1><?php _e( 'Instagram Feed', 'instagram-feed' ); ?></h1>
351
- </div>
352
-
353
- <form name="form1" method="post" action="">
354
- <input type="hidden" name="<?php echo $sb_instagram_settings_hidden_field; ?>" value="Y">
355
- <?php wp_nonce_field( 'sb_instagram_saving_settings', 'sb_instagram_settings_nonce' ); ?>
356
-
357
- <?php $sbi_active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'configure'; ?>
358
- <h2 class="nav-tab-wrapper">
359
- <a href="?page=sb-instagram-feed&amp;tab=configure" class="nav-tab <?php echo $sbi_active_tab == 'configure' ? 'nav-tab-active' : ''; ?>"><?php _e( '1. Configure', 'instagram-feed' ); ?></a>
360
- <a href="?page=sb-instagram-feed&amp;tab=customize" class="nav-tab <?php echo $sbi_active_tab == 'customize' ? 'nav-tab-active' : ''; ?>"><?php _e( '2. Customize', 'instagram-feed' ); ?></a>
361
- <a href="?page=sb-instagram-feed&amp;tab=display" class="nav-tab <?php echo $sbi_active_tab == 'display' ? 'nav-tab-active' : ''; ?>"><?php _e( '3. Display Your Feed', 'instagram-feed' ); ?></a>
362
- <a href="?page=sb-instagram-feed&amp;tab=support" class="nav-tab <?php echo $sbi_active_tab == 'support' ? 'nav-tab-active' : ''; ?>"><?php _e( 'Support', 'instagram-feed' ); ?></a>
363
- </h2>
364
-
365
- <?php if( $sbi_active_tab == 'configure' ) { //Start Configure tab ?>
366
- <input type="hidden" name="<?php echo $sb_instagram_configure_hidden_field; ?>" value="Y">
367
-
368
- <table class="form-table">
369
- <tbody>
370
- <h3><?php _e( 'Configure', 'instagram-feed' ); ?></h3>
371
-
372
- <div id="sbi_config">
373
- <!-- <a href="https://instagram.com/oauth/authorize/?client_id=1654d0c81ad04754a898d89315bec227&redirect_uri=https://smashballoon.com/instagram-feed/instagram-token-plugin/?return_uri=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>&response_type=token" class="sbi_admin_btn"><?php _e( 'Log in and get my Access Token and User ID', 'instagram-feed' ); ?></a> -->
374
- <a href="https://instagram.com/oauth/authorize/?client_id=3a81a9fa2a064751b8c31385b91cc25c&scope=basic&redirect_uri=https://api.smashballoon.com/instagram-plugin-token.php?return_uri=<?php echo admin_url('admin.php?page=sb-instagram-feed'); ?>&response_type=token&state=<?php echo admin_url('admin.php?page-sb-instagram-feed'); ?>&hl=en" class="sbi_admin_btn"><i class="fa fa-user-plus" aria-hidden="true" style="font-size: 20px;"></i>&nbsp; <?php _e( 'Connect an Instagram Account', 'instagram-feed' ); ?></a>
375
- <a href="https://smashballoon.com/instagram-feed/token/" target="_blank" style="position: relative; top: 14px; left: 15px;"><?php _e( 'Button not working?', 'instagram-feed' ); ?></a>
376
- </div>
377
-
378
- <!-- Old Access Token -->
379
- <input name="sb_instagram_at" id="sb_instagram_at" type="hidden" value="<?php echo esc_attr( $sb_instagram_at ); ?>" size="80" maxlength="100" placeholder="Click button above to get your Access Token" />
380
-
381
- <?php
382
-
383
- $returned_data = sbi_get_connected_accounts_data( $sb_instagram_at );
384
- $connected_accounts = $returned_data['connected_accounts'];
385
- $user_feeds_returned = isset( $returned_data['user_ids'] ) ? $returned_data['user_ids'] : false;
386
- if ( $user_feeds_returned ) {
387
- $user_feed_ids = $user_feeds_returned;
388
- } else {
389
- $user_feed_ids = ! is_array( $sb_instagram_user_id ) ? explode( ',', $sb_instagram_user_id ) : $sb_instagram_user_id;
390
- }
391
- $expired_tokens = get_option( 'sb_expired_tokens', array() );
392
- $sb_instagram_type = 'user';
393
- ?>
394
-
395
- <tr valign="top">
396
- <th scope="row"><label><?php _e( 'Instagram Accounts', 'instagram-feed' ); ?></label><span style="font-weight:normal; font-style:italic; font-size: 12px; display: block;"><?php _e( 'Use the button above to connect an Instagram account', 'instagram-feed' ); ?></span></th>
397
- <td class="sbi_connected_accounts_wrap">
398
- <?php if ( empty( $connected_accounts ) ) : ?>
399
- <p class="sbi_no_accounts"><?php _e( 'No Instagram accounts connected. Click the button above to connect an account.', 'instagram-feed' ); ?></p><br />
400
- <?php else: ?>
401
- <?php foreach ( $connected_accounts as $account ) :
402
- $username = $account['username'] ? $account['username'] : $account['user_id'];
403
- $profile_picture = $account['profile_picture'] ? '<img class="sbi_ca_avatar" src="'.$account['profile_picture'].'" />' : ''; //Could add placeholder avatar image
404
- $access_token_expired = (in_array( $account['access_token'], $expired_tokens, true ) || in_array( sbi_maybe_clean( $account['access_token'] ), $expired_tokens, true ));
405
- $is_invalid_class = ! $account['is_valid'] || $access_token_expired ? ' sbi_account_invalid' : '';
406
- $in_user_feed = in_array( $account['user_id'], $user_feed_ids, true );
407
- ?>
408
- <div class="sbi_connected_account<?php echo $is_invalid_class; ?><?php if ( $in_user_feed ) echo ' sbi_account_active' ?>" id="sbi_connected_account_<?php esc_attr_e( $account['user_id'] ); ?>" data-accesstoken="<?php esc_attr_e( $account['access_token'] ); ?>" data-userid="<?php esc_attr_e( $account['user_id'] ); ?>" data-username="<?php esc_attr_e( $account['username'] ); ?>">
409
-
410
- <div class="sbi_ca_alert">
411
- <span><?php _e( 'The Access Token for this account is expired or invalid. Click the button above to attempt to renew it.', 'instagram-feed' ) ?></span>
412
- </div>
413
- <div class="sbi_ca_info">
414
-
415
- <div class="sbi_ca_delete">
416
- <a href="JavaScript:void(0);" class="sbi_delete_account"><i class="fa fa-times"></i><span class="sbi_remove_text"><?php _e( 'Remove', 'instagram-feed' ); ?></span></a>
417
- </div>
418
-
419
- <div class="sbi_ca_username">
420
- <?php echo $profile_picture; ?>
421
- <strong><?php echo $username; ?></strong>
422
- </div>
423
-
424
- <div class="sbi_ca_actions">
425
- <?php if ( ! $in_user_feed ) : ?>
426
- <a href="JavaScript:void(0);" class="sbi_use_in_user_feed button-primary"><i class="fa fa-plus-circle" aria-hidden="true"></i><?php _e( 'Add to Primary Feed', 'instagram-feed' ); ?></a>
427
- <?php else : ?>
428
- <a href="JavaScript:void(0);" class="sbi_remove_from_user_feed button-primary"><i class="fa fa-minus-circle" aria-hidden="true"></i><?php _e( 'Remove from Primary Feed', 'instagram-feed' ); ?></a>
429
- <?php endif; ?>
430
- <a class="sbi_ca_token_shortcode button-secondary" href="JavaScript:void(0);"><i class="fa fa-chevron-circle-right" aria-hidden="true"></i><?php _e( 'Add to another Feed', 'instagram-feed' ); ?></a>
431
- <p class="sbi_ca_show_token"><input type="checkbox" id="sbi_ca_show_token_<?php esc_attr_e( $account['user_id'] ); ?>" /><label for="sbi_ca_show_token_<?php esc_attr_e( $account['user_id'] ); ?>"><?php _e( 'Show Access Token', 'instagram-feed' ); ?></label></p>
432
-
433
- </div>
434
-
435
- <div class="sbi_ca_shortcode">
436
-
437
- <p><?php _e( 'Copy and paste this shortcode into your page or widget area:', 'instagram-feed' ); ?><br>
438
- <?php if ( !empty( $account['username'] ) ) : ?>
439
- <code>[instagram-feed user="<?php echo $account['username']; ?>"]</code>
440
- <?php else : ?>
441
- <code>[instagram-feed accesstoken="<?php echo $account['access_token']; ?>"]</code>
442
- <?php endif; ?>
443
- </p>
444
-
445
- <p><?php _e( 'To add multiple users in the same feed, simply separate them using commas:', 'instagram-feed' ); ?><br>
446
- <?php if ( !empty( $account['username'] ) ) : ?>
447
- <code>[instagram-feed user="<?php echo $account['username']; ?>, a_second_user, a_third_user"]</code>
448
- <?php else : ?>
449
- <code>[instagram-feed accesstoken="<?php echo $account['access_token']; ?>, another_access_token"]</code>
450
- <?php endif; ?>
451
-
452
- <p><?php _e( 'Click on the <a href="?page=sb-instagram-feed&tab=display" target="_blank">Display Your Feed</a> tab to learn more about shortcodes', 'instagram-feed' ); ?></p>
453
- </div>
454
-
455
- <div class="sbi_ca_accesstoken">
456
- <span class="sbi_ca_token_label"><?php _e( 'Access Token:', 'instagram-feed' ); ?></span><input type="text" class="sbi_ca_token" value="<?php echo $account['access_token']; ?>" readonly="readonly" onclick="this.focus();this.select()" title="To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).">
457
- </div>
458
-
459
- </div>
460
-
461
- </div>
462
-
463
- <?php endforeach; ?>
464
- <?php endif; ?>
465
- <a href="JavaScript:void(0);" class="sbi_manually_connect button-secondary"><?php _e( 'Manually Connect an Account', 'instagram-feed' ); ?></a>
466
- <div class="sbi_manually_connect_wrap">
467
- <input name="sb_manual_at" id="sb_manual_at" type="text" value="" style="margin-top: 4px; padding: 5px 9px; margin-left: 0px;" size="64" maxlength="100" placeholder="<?php _e( 'Enter a valid Instagram Access Token', 'instagram-feed' ); ?>" />
468
- <p class="sbi_submit" style="display: inline-block;"><button name="submit" id="sbi_manual_submit" class="button button-primary"><?php _e( 'Connect This Account', 'instagram-feed' ); ?></button></p>
469
- </div>
470
- </td>
471
- </tr>
472
-
473
- <tr valign="top" class="sbi_feed_type">
474
- <th scope="row"><label><?php _e('Show Photos From:', 'instagram-feed'); ?></label><code class="sbi_shortcode"> type
475
- Eg: type=user id=12986477
476
- </code></th>
477
- <td>
478
- <div class="sbi_row">
479
- <div class="sbi_col sbi_one">
480
- <input type="radio" name="sb_instagram_type" id="sb_instagram_type_user" value="user" <?php if($sb_instagram_type == "user") echo "checked"; ?> />
481
- <label class="sbi_radio_label" for="sb_instagram_type_user"><?php _e( 'User Account:', 'instagram-feed' ); ?></label>
482
- </div>
483
- <div class="sbi_col sbi_two">
484
- <div class="sbi_user_feed_ids_wrap">
485
- <?php foreach ( $user_feed_ids as $feed_id ) : if ( $feed_id !== '' ) :?>
486
- <?php if( count($connected_accounts) > 0 ) { ?><div id="sbi_user_feed_id_<?php echo $feed_id; ?>" class="sbi_user_feed_account_wrap"><?php } ?>
487
-
488
- <?php if ( isset( $connected_accounts[ $feed_id ] ) && ! empty( $connected_accounts[ $feed_id ]['username'] ) ) : ?>
489
- <strong><?php echo $connected_accounts[ $feed_id ]['username']; ?></strong> <span>(<?php echo $feed_id; ?>)</span>
490
- <input name="sb_instagram_user_id[]" id="sb_instagram_user_id" type="hidden" value="<?php esc_attr_e( $feed_id ); ?>" />
491
- <?php elseif ( isset( $connected_accounts[ $feed_id ] ) && ! empty( $connected_accounts[ $feed_id ]['access_token'] ) ) : ?>
492
- <strong><?php echo $feed_id; ?></strong>
493
- <input name="sb_instagram_user_id[]" id="sb_instagram_user_id" type="hidden" value="<?php esc_attr_e( $feed_id ); ?>" />
494
- <?php endif; ?>
495
-
496
- <?php if( count($connected_accounts) > 0 ) { ?></div><?php } ?>
497
- <?php endif; endforeach; ?>
498
- </div>
499
-
500
- <?php if ( empty( $user_feed_ids ) ) : ?>
501
- <p class="sbi_no_accounts" style="margin-top: -3px; margin-right: 10px;"><?php _e( 'Connect a user account above', 'instagram-feed' ); ?></p>
502
- <?php endif; ?>
503
-
504
- <a class="sbi_tooltip_link" href="JavaScript:void(0);" style="margin: 5px 0 10px 0; display: inline-block; height: 19px;"><?php _e("How to display User feeds", 'instagram-feed' ); ?></a>
505
- <div class="sbi_tooltip"><?php _e("<p><b>Displaying Posts from Your User Account</b><br />Simply connect an account using the button above.</p><p style='padding-top:8px;'><b>Displaying Posts from Other Instagram Accounts</b><br />Due to recent changes in the Instagram API it is no longer possible to display photos from other Instagram accounts which you do not have access to. You can only display the user feed of an account which you connect above. You can connect as many account as you like by logging in using the button above, or manually copy/pasting an Access Token by selecting the 'Manually Connect an Account' option.</p><p style='padding-top:10px;'><b>Multiple Acounts</b><br />It is only possible to display feeds from Instagram accounts which you own. In order to display feeds from multiple accounts, first connect them above and then use the buttons to add the account either to your primary feed or to another feed on your site.</p>", 'instagram-feed'); ?></div><br />
506
- </div>
507
-
508
- </div>
509
-
510
- <div class="sbi_pro sbi_row">
511
- <div class="sbi_col sbi_one">
512
- <input disabled type="radio" name="sb_instagram_type" id="sb_instagram_type_hashtag" value="hashtag" <?php if($sb_instagram_type == "hashtag") echo "checked"; ?> />
513
- <label class="sbi_radio_label" for="sb_instagram_type_hashtag"><?php _e( 'Hashtag:', 'instagram-feed' ); ?></label>
514
- </div>
515
- <div class="sbi_col sbi_two">
516
-
517
- <p class="sbi_pro_tooltip"><?php _e( 'Upgrade to the Pro version to display hashtag feeds', 'instagram-feed' ); ?><i class="fa fa-caret-down" aria-hidden="true"></i></p>
518
- <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank" class="sbi_lock"><i class="fa fa-rocket"></i><?php _e('Pro', 'instagram-feed'); ?></a>
519
-
520
- <input readonly type="text" size="25" style="height: 32px; top: -2px; position: relative; box-shadow: none;" />
521
- &nbsp;<a class="sbi_tooltip_link sbi_pro" href="JavaScript:void(0);"><?php _e( 'What is this?', 'instagram-feed' ); ?></a>
522
-
523
- <p class="sbi_tooltip"><?php _e( 'Display posts from a specific hashtag instead of from a user', 'instagram-feed' ); ?></p>
524
- </div>
525
- </div>
526
-
527
- <div class="sbi_row sbi_pro">
528
- <br>
529
- <a class="sbi_tooltip_link sbi_pro" href="JavaScript:void(0);" style="margin-left: 0;"><i class="fa fa-question-circle" aria-hidden="true" style="margin-right: 6px;"></i><?php _e('Combine multiple feed types into a single feed', 'instagram-feed'); ?></a>
530
- <p class="sbi_tooltip">
531
- <b><?php _e( 'Please note: this is only available in the <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank">Pro version</a>', 'instagram-feed' ); ?>.</b><br />
532
- <?php echo sprintf( __('To display multiple feed types in a single feed, use %s in your shortcode and then add each user name or hashtag of each feed into the shortcode, like so: %s. This will combine a user feed and a hashtag feed into the same feed.', 'instagram-feed'), 'type="mixed"', '<code>[instagram-feed type="mixed" user="smashballoon" hashtag="#awesomeplugins"]</code>' ); ?>
533
- </p>
534
- </div>
535
-
536
- </td>
537
- </tr>
538
-
539
- <tr>
540
- <th class="bump-left"><label for="sb_instagram_preserve_settings" class="bump-left"><?php _e("Preserve settings when plugin is removed", 'instagram-feed'); ?></label></th>
541
- <td>
542
- <input name="sb_instagram_preserve_settings" type="checkbox" id="sb_instagram_preserve_settings" <?php if($sb_instagram_preserve_settings == true) echo "checked"; ?> />
543
- <label for="sb_instagram_preserve_settings"><?php _e('Yes', 'instagram-feed'); ?></label>
544
- <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'instagram-feed'); ?></a>
545
- <p class="sbi_tooltip"><?php _e('When removing the plugin your settings are automatically erased. Checking this box will prevent any settings from being deleted. This means that you can uninstall and reinstall the plugin without losing your settings.', 'instagram-feed'); ?></p>
546
- </td>
547
- </tr>
548
-
549
- <tr valign="top">
550
- <th scope="row"><label><?php _e('Check for new posts every', 'instagram-feed'); ?></label></th>
551
- <td>
552
- <input name="sb_instagram_cache_time" type="text" value="<?php esc_attr_e( $sb_instagram_cache_time ); ?>" size="4" />
553
- <select name="sb_instagram_cache_time_unit">
554
- <option value="minutes" <?php if($sb_instagram_cache_time_unit == "minutes") echo 'selected="selected"' ?> ><?php _e('Minutes', 'instagram-feed'); ?></option>
555
- <option value="hours" <?php if($sb_instagram_cache_time_unit == "hours") echo 'selected="selected"' ?> ><?php _e('Hours', 'instagram-feed'); ?></option>
556
- <option value="days" <?php if($sb_instagram_cache_time_unit == "days") echo 'selected="selected"' ?> ><?php _e('Days', 'instagram-feed'); ?></option>
557
- </select>
558
- <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'instagram-feed'); ?></a>
559
- <p class="sbi_tooltip"><?php _e('Your Instagram posts are temporarily cached by the plugin in your WordPress database. You can choose how long the posts should be cached for. If you set the time to 1 hour then the plugin will clear the cache after that length of time and check Instagram for posts again.', 'instagram-feed'); ?></p>
560
- </td>
561
- </tr>
562
- </tbody>
563
- </table>
564
-
565
- <?php submit_button(); ?>
566
- </form>
567
-
568
- <p><i class="fa fa-chevron-circle-right" aria-hidden="true"></i>&nbsp; <?php _e('Next Step: <a href="?page=sb-instagram-feed&tab=customize">Customize your Feed</a>', 'instagram-feed'); ?></p>
569
-
570
- <p><i class="fa fa-life-ring" aria-hidden="true"></i>&nbsp; <?php _e('Need help setting up the plugin? Check out our <a href="https://smashballoon.com/instagram-feed/free/?utm_source=plugin-free&utm_campaign=sbi" target="_blank">setup directions</a>', 'instagram-feed'); ?></p>
571
-
572
-
573
- <?php } // End Configure tab ?>
574
-
575
-
576
-
577
- <?php if( $sbi_active_tab == 'customize' ) { //Start Configure tab ?>
578
-
579
- <p class="sb_instagram_contents_links" id="general">
580
- <span><?php _e( 'Quick links:', 'instagram-feed' ); ?> </span>
581
- <a href="#general"><?php _e( 'General', 'instagram-feed' ); ?></a>
582
- <a href="#layout"><?php _e( 'Layout', 'instagram-feed' ); ?></a>
583
- <a href="#photos"><?php _e( 'Photos', 'instagram-feed' ); ?></a>
584
- <a href="#headeroptions"><?php _e( 'Header', 'instagram-feed' ); ?></a>
585
- <a href="#loadmore"><?php _e( "'Load More' Button", 'instagram-feed' ); ?></a>
586
- <a href="#follow"><?php _e( "'Follow' Button", 'instagram-feed' ); ?></a>
587
- <a href="#customcss"><?php _e( 'Custom CSS', 'instagram-feed' ); ?></a>
588
- <a href="#customjs"><?php _e( 'Custom JavaScript', 'instagram-feed' ); ?></a>
589
- </p>
590
-
591
- <input type="hidden" name="<?php echo $sb_instagram_customize_hidden_field; ?>" value="Y">
592
-
593
- <h3><?php _e( 'General', 'instagram-feed' ); ?></h3>
594
-
595
- <table class="form-table">
596
- <tbody>
597
- <tr valign="top">
598
- <th scope="row"><label><?php _e('Width of Feed', 'instagram-feed'); ?></label><code class="sbi_shortcode"> width widthunit
599
- Eg: width=50 widthunit=%</code></th>
600
- <td>
601
- <input name="sb_instagram_width" type="text" value="<?php echo esc_attr( $sb_instagram_width ); ?>" id="sb_instagram_width" size="4" maxlength="4" />
602
- <select name="sb_instagram_width_unit" id="sb_instagram_width_unit">
603
- <option value="px" <?php if($sb_instagram_width_unit == "px") echo 'selected="selected"' ?> ><?php _e('px', 'instagram-feed'); ?></option>
604
- <option value="%" <?php if($sb_instagram_width_unit == "%") echo 'selected="selected"' ?> ><?php _e('%', 'instagram-feed'); ?></option>
605
- </select>
606
- <div id="sb_instagram_width_options">
607
- <input name="sb_instagram_feed_width_resp" type="checkbox" id="sb_instagram_feed_width_resp" <?php if($sb_instagram_feed_width_resp == true) echo "checked"; ?> /><label for="sb_instagram_feed_width_resp"><?php _e('Set to be 100% width on mobile?', 'instagram-feed'); ?></label>
608
- <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e( 'What does this mean?', 'instagram-feed' ); ?></a>
609
- <p class="sbi_tooltip"><?php _e("If you set a width on the feed then this will be used on mobile as well as desktop. Check this setting to set the feed width to be 100% on mobile so that it is responsive.", 'instagram-feed'); ?></p>
610
- </div>
611
- </td>
612
- </tr>
613
- <tr valign="top">
614
- <th scope="row"><label><?php _e('Height of Feed', 'instagram-feed'); ?></label><code class="sbi_shortcode"> height heightunit
615
- Eg: height=500 heightunit=px</code></th>
616
- <td>
617
- <input name="sb_instagram_height" type="text" value="<?php echo esc_attr( $sb_instagram_height ); ?>" size="4" maxlength="4" />
618
- <select name="sb_instagram_height_unit">
619
- <option value="px" <?php if($sb_instagram_height_unit == "px") echo 'selected="selected"' ?> ><?php _e('px', 'instagram-feed'); ?></option>
620
- <option value="%" <?php if($sb_instagram_height_unit == "%") echo 'selected="selected"' ?> ><?php _e('%', 'instagram-feed'); ?></option>
621
- </select>
622
- </td>
623
- </tr>
624
- <tr valign="top">
625
- <th scope="row"><label><?php _e('Background Color', 'instagram-feed'); ?></label><code class="sbi_shortcode"> background
626
- Eg: background=d89531</code></th>
627
- <td>
628
- <input name="sb_instagram_background" type="text" value="<?php echo esc_attr( $sb_instagram_background ); ?>" class="sbi_colorpick" />
629
- </td>
630
- </tr>
631
- </tbody>
632
- </table>
633
-
634
- <hr id="layout" />
635
- <h3><?php _e('Layout', 'instagram-feed'); ?></h3>
636
-
637
- <table class="form-table">
638
- <tbody>
639
- <?php
640
- $selected_type = isset( $sb_instagram_layout_type ) ? $sb_instagram_layout_type : 'grid';
641
- $layout_types = array(
642
- 'grid' => __( 'Grid', 'instagram-feed' ),
643
- 'carousel' => __( 'Carousel', 'instagram-feed' ),
644
- 'masonry' => __( 'Masonry', 'instagram-feed' ),
645
- 'highlight' => __( 'Highlight', 'instagram-feed' )
646
- );
647
- $layout_images = array(
648
- 'grid' => plugins_url( 'img/grid.png' , __FILE__ ),
649
- 'carousel' => plugins_url( 'img/carousel.png' , __FILE__ ),
650
- 'masonry' => plugins_url( 'img/masonry.png' , __FILE__ ),
651
- 'highlight' => plugins_url( 'img/highlight.png' , __FILE__ )
652
- );
653
- ?>
654
- <tr valign="top">
655
- <th scope="row" class="sbi_pro"><label title="<?php _e('Click for shortcode option', 'instagram-feed'); ?>"><?php _e('Layout Type', 'instagram-feed'); ?></label><br /><span class="sbi_note" style="margin: 5px 0 0 0; font-weight: normal;"><?php _e('Select a layout to see associated<br />options', 'instagram-feed'); ?></span></th>
656
- <td>
657
- <div class="sbi_layouts">
658
- <?php foreach( $layout_types as $layout_type => $label ) : ?>
659
- <div class="sbi_layout_cell sbi_pro">
660
- <input class="sb_layout_type" id="sb_layout_type_<?php esc_attr_e( $layout_type ); ?>" name="sb_instagram_layout_type" type="radio" value="<?php esc_attr_e( $layout_type ); ?>" <?php if ( $selected_type === $layout_type ) echo 'checked'; ?>/><label for="sb_layout_type_<?php esc_attr_e( $layout_type ); ?>"><span class="sbi_label"><?php echo esc_html( $label ); ?></span><img src="<?php echo $layout_images[ $layout_type ]; ?>" /></label>
661
- </div>
662
- <?php endforeach; ?>
663
-
664
- <p class="sbi_pro_tooltip"><?php _e('Upgrade to the Pro version to unlock these layouts', 'instagram-feed'); ?><i class="fa fa-caret-down" aria-hidden="true"></i></p>
665
- <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank" class="sbi_lock"><i class="fa fa-rocket"></i><?php _e('Pro', 'instagram-feed'); ?></a>
666
-
667
- </div>
668
- <div class="sb_layout_options_wrap sbi_pro">
669
- <a href="JavaScript:void(0);" class="sbi_close_options"><i class="fa fa-close"></i></a>
670
- <div class="sb_instagram_layout_settings sbi_layout_type_grid">
671
- <i class="fa fa-info-circle" aria-hidden="true" style="margin-right: 8px;"></i><span class="sbi_note" style="margin-left: 0;"><?php _e('A uniform grid of square-cropped images.', 'instagram-feed'); ?></span>
672
- </div>
673
- <div class="sb_instagram_layout_settings sbi_layout_type_masonry">
674
- <i class="fa fa-info-circle" aria-hidden="true" style="margin-right: 8px;"></i><span class="sbi_note" style="margin-left: 0;"><?php _e('Images in their original aspect ratios with no vertical space between posts.', 'instagram-feed'); ?></span>
675
- </div>
676
- <div class="sb_instagram_layout_settings sbi_layout_type_carousel">
677
- <div class="sb_instagram_layout_setting">
678
- <i class="fa fa-info-circle" aria-hidden="true" style="margin-right: 8px;"></i><span class="sbi_note" style="margin-left: 0;"><?php _e('Posts are displayed in a slideshow carousel.', 'instagram-feed'); ?></span>
679
- </div>
680
- <div class="sb_instagram_layout_setting">
681
-
682
- <label><?php _e('Number of Rows', 'instagram-feed'); ?></label><code class="sbi_shortcode"> carouselrows
683
- Eg: carouselrows=2</code>
684
- <br>
685
- <span class="sbi_note" style="margin: -5px 0 -10px 0; display: block;"><?php _e('Use the "Number of Columns" setting below this section to set how many posts are visible in the carousel at a given time.', 'instagram-feed'); ?></span>
686
- <br>
687
- <select name="sb_instagram_carousel_rows" id="sb_instagram_carousel_rows">
688
- <option value="1">1</option>
689
- <option value="2" selected="selected">2</option>
690
- </select>
691
- </div>
692
- <div class="sb_instagram_layout_setting">
693
- <label><?php _e('Loop Type', 'instagram-feed'); ?></label><code class="sbi_shortcode"> carouselloop
694
- Eg: carouselloop=rewind
695
- carouselloop=infinity</code>
696
- <br>
697
- <select name="sb_instagram_carousel_loop" id="sb_instagram_carousel_loop">
698
- <option value="rewind"><?php _e('Rewind', 'instagram-feed'); ?></option>
699
- <option value="infinity" selected="selected"><?php _e('Infinity', 'instagram-feed'); ?></option>
700
- </select>
701
- </div>
702
- <div class="sb_instagram_layout_setting">
703
- <input type="checkbox" name="sb_instagram_carousel_arrows" id="sb_instagram_carousel_arrows" checked="checked">
704
- <label><?php _e('Show Navigation Arrows', 'instagram-feed'); ?></label><code class="sbi_shortcode"> carouselarrows
705
- Eg: carouselarrows=true</code>
706
- </div>
707
- <div class="sb_instagram_layout_setting">
708
- <input type="checkbox" name="sb_instagram_carousel_pag" id="sb_instagram_carousel_pag">
709
- <label><?php _e('Show Pagination', 'instagram-feed'); ?></label><code class="sbi_shortcode"> carouselpag
710
- Eg: carouselpag=true</code>
711
- </div>
712
- <div class="sb_instagram_layout_setting">
713
- <input type="checkbox" name="sb_instagram_carousel_autoplay" id="sb_instagram_carousel_autoplay">
714
- <label><?php _e('Enable Autoplay', 'instagram-feed'); ?></label><code class="sbi_shortcode"> carouselautoplay
715
- Eg: carouselautoplay=true</code>
716
- </div>
717
- <div class="sb_instagram_layout_setting">
718
- <label><?php _e('Interval Time', 'instagram-feed'); ?></label><code class="sbi_shortcode"> carouseltime
719
- Eg: carouseltime=8000</code>
720
- <br>
721
- <input name="sb_instagram_carousel_interval" type="text" value="5000" size="6"><?php _e("miliseconds", 'instagram-feed'); ?>
722
- </div>
723
- </div>
724
-
725
- <div class="sb_instagram_layout_settings sbi_layout_type_highlight">
726
- <div class="sb_instagram_layout_setting">
727
- <i class="fa fa-info-circle" aria-hidden="true" style="margin-right: 8px;"></i><span class="sbi_note" style="margin-left: 0;"><?php _e('Masonry style, square-cropped, image only (no captions or likes/comments below image). "Highlighted" posts are twice as large.', 'instagram-feed'); ?></span>
728
- </div>
729
- <div class="sb_instagram_layout_setting">
730
- <label title="Click for shortcode option"><?php _e('Highlighting Type', 'instagram-feed'); ?></label><code class="sbi_shortcode"> highlighttype
731
- Eg: highlighttype=pattern</code>
732
- <br>
733
- <select name="sb_instagram_highlight_type" id="sb_instagram_highlight_type">
734
- <option value="pattern" selected="selected"><?php _e('Pattern', 'instagram-feed'); ?></option>
735
- <option value="id"><?php _e('Post ID', 'instagram-feed'); ?></option>
736
- <option value="hashtag"><?php _e('Hashtag', 'instagram-feed'); ?></option>
737
- </select>
738
- </div>
739
- <div class="sb_instagram_highlight_sub_options sb_instagram_highlight_pattern sb_instagram_layout_setting" style="display: block;">
740
- <label></label><code class="sbi_shortcode"> highlightoffset
741
- Eg: highlightoffset=2</code>
742
- <br>
743
- <input name="sb_instagram_highlight_offset" type="number" min="0" value="0" style="width: 50px;">
744
- </div>
745
- <div class="sb_instagram_highlight_sub_options sb_instagram_highlight_pattern sb_instagram_layout_setting" style="display: block;">
746
- <label><?php _e('Pattern', 'instagram-feed'); ?></label><code class="sbi_shortcode"> highlightpattern
747
- Eg: highlightpattern=3</code>
748
- <br>
749
- <span><?php _e('Highlight every', 'instagram-feed'); ?></span><input name="sb_instagram_highlight_factor" type="number" min="2" value="6" style="width: 50px;"><span><?php _e('posts', 'instagram-feed'); ?></span>
750
- </div>
751
- <div class="sb_instagram_highlight_sub_options sb_instagram_highlight_hashtag sb_instagram_layout_setting" style="display: none;">
752
- <label><?php _e('Highlight Posts with these Hashtags', 'instagram-feed'); ?></label>
753
- <input name="sb_instagram_highlight_hashtag" id="sb_instagram_highlight_hashtag" type="text" size="40" value="#fishing">&nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What is this?', 'instagram-feed'); ?></a>
754
- <br>
755
- <span class="sbi_note" style="margin-left: 0;"><?php _e('Separate multiple hashtags using commas', 'instagram-feed'); ?></span>
756
-
757
-
758
- <p class="sbi_tooltip"><?php _e('You can use this setting to highlight posts by a hashtag. Use a specified hashtag in your posts and they will be automatically highlighted in your feed.', 'instagram-feed'); ?></p>
759
- </div>
760
- <div class="sb_instagram_highlight_sub_options sb_instagram_highlight_ids sb_instagram_layout_setting" style="display: none;">
761
- <label><?php _e('Highlight Posts by ID', 'instagram-feed'); ?></label>
762
- <textarea name="sb_instagram_highlight_ids" id="sb_instagram_highlight_ids" style="width: 100%;" rows="3">sbi_1852317219231323590_3269008872</textarea>
763
- <br>
764
- <span class="sbi_note" style="margin-left: 0;"><?php _e('Separate IDs using commas', 'instagram-feed'); ?></span>
765
-
766
- &nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What is this?', 'instagram-feed'); ?></a>
767
- <p class="sbi_tooltip"><?php _e('You can use this setting to highlight posts by their ID. Enable and use "moderation mode", check the box to show post IDs underneath posts, then copy and paste IDs into this text box.', 'instagram-feed'); ?></p>
768
- </div>
769
- </div>
770
-
771
- </div>
772
- </td>
773
- </tr>
774
- <tr valign="top">
775
- <th scope="row"><label><?php _e('Number of Photos', 'instagram-feed'); ?></label><code class="sbi_shortcode"> num
776
- Eg: num=6</code></th>
777
- <td>
778
- <input name="sb_instagram_num" type="text" value="<?php echo esc_attr( $sb_instagram_num ); ?>" size="4" maxlength="4" />
779
- <span class="sbi_note"><?php _e('Number of photos to show initially. Maximum of 33.', 'instagram-feed'); ?></span>
780
- &nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e("Using multiple IDs or hashtags?", 'instagram-feed'); ?></a>
781
- <p class="sbi_tooltip"><?php _e("If you're displaying photos from multiple User IDs or hashtags then this is the number of photos which will be displayed from each.", 'instagram-feed'); ?></p>
782
- </td>
783
- </tr>
784
- <tr valign="top">
785
- <th scope="row"><label><?php _e('Number of Columns', 'instagram-feed'); ?></label><code class="sbi_shortcode"> cols
786
- Eg: cols=3</code></th>
787
- <td>
788
- <select name="sb_instagram_cols">
789
- <option value="1" <?php if($sb_instagram_cols == "1") echo 'selected="selected"' ?> ><?php _e('1', 'instagram-feed'); ?></option>
790
- <option value="2" <?php if($sb_instagram_cols == "2") echo 'selected="selected"' ?> ><?php _e('2', 'instagram-feed'); ?></option>
791
- <option value="3" <?php if($sb_instagram_cols == "3") echo 'selected="selected"' ?> ><?php _e('3', 'instagram-feed'); ?></option>
792
- <option value="4" <?php if($sb_instagram_cols == "4") echo 'selected="selected"' ?> ><?php _e('4', 'instagram-feed'); ?></option>
793
- <option value="5" <?php if($sb_instagram_cols == "5") echo 'selected="selected"' ?> ><?php _e('5', 'instagram-feed'); ?></option>
794
- <option value="6" <?php if($sb_instagram_cols == "6") echo 'selected="selected"' ?> ><?php _e('6', 'instagram-feed'); ?></option>
795
- <option value="7" <?php if($sb_instagram_cols == "7") echo 'selected="selected"' ?> ><?php _e('7', 'instagram-feed'); ?></option>
796
- <option value="8" <?php if($sb_instagram_cols == "8") echo 'selected="selected"' ?> ><?php _e('8', 'instagram-feed'); ?></option>
797
- <option value="9" <?php if($sb_instagram_cols == "9") echo 'selected="selected"' ?> ><?php _e('9', 'instagram-feed'); ?></option>
798
- <option value="10" <?php if($sb_instagram_cols == "10") echo 'selected="selected"' ?> ><?php _e('10', 'instagram-feed'); ?></option>
799
- </select>
800
- </td>
801
- </tr>
802
- <tr valign="top">
803
- <th scope="row"><label><?php _e('Padding around Images', 'instagram-feed'); ?></label><code class="sbi_shortcode"> imagepadding imagepaddingunit</code></th>
804
- <td>
805
- <input name="sb_instagram_image_padding" type="text" value="<?php echo esc_attr( $sb_instagram_image_padding ); ?>" size="4" maxlength="4" />
806
- <select name="sb_instagram_image_padding_unit">
807
- <option value="px" <?php if($sb_instagram_image_padding_unit == "px") echo 'selected="selected"' ?> ><?php _e('px', 'instagram-feed'); ?></option>
808
- <option value="%" <?php if($sb_instagram_image_padding_unit == "%") echo 'selected="selected"' ?> ><?php _e('%', 'instagram-feed'); ?></option>
809
- </select>
810
- </td>
811
- </tr>
812
- <tr valign="top">
813
- <th scope="row"><label><?php _e("Disable mobile layout", 'instagram-feed'); ?></label><code class="sbi_shortcode"> disablemobile
814
- Eg: disablemobile=true</code></th>
815
- <td>
816
- <input type="checkbox" name="sb_instagram_disable_mobile" id="sb_instagram_disable_mobile" <?php if($sb_instagram_disable_mobile == true) echo 'checked="checked"' ?> />
817
- &nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e( 'What does this mean?', 'instagram-feed' ); ?></a>
818
- <p class="sbi_tooltip"><?php _e("By default on mobile devices the layout automatically changes to use fewer columns. Checking this setting disables the mobile layout.", 'instagram-feed'); ?></p>
819
- </td>
820
- </tr>
821
- </tbody>
822
- </table>
823
-
824
- <?php submit_button(); ?>
825
-
826
- <hr id="photos" />
827
- <h3><?php _e('Photos', 'instagram-feed'); ?></h3>
828
-
829
- <table class="form-table">
830
- <tbody>
831
- <tr valign="top">
832
- <th scope="row"><label><?php _e('Sort Photos By', 'instagram-feed'); ?></label><code class="sbi_shortcode"> sortby
833
- Eg: sortby=random</code></th>
834
- <td>
835
- <select name="sb_instagram_sort">
836
- <option value="none" <?php if($sb_instagram_sort == "none") echo 'selected="selected"' ?> ><?php _e('Newest to oldest', 'instagram-feed'); ?></option>
837
- <option value="random" <?php if($sb_instagram_sort == "random") echo 'selected="selected"' ?> ><?php _e('Random', 'instagram-feed'); ?></option>
838
- </select>
839
- </td>
840
- </tr>
841
- <tr valign="top">
842
- <th scope="row"><label><?php _e('Image Resolution', 'instagram-feed'); ?></label><code class="sbi_shortcode"> imageres
843
- Eg: imageres=thumb</code></th>
844
- <td>
845
-
846
- <select name="sb_instagram_image_res">
847
- <option value="auto" <?php if($sb_instagram_image_res == "auto") echo 'selected="selected"' ?> ><?php _e('Auto-detect (recommended)', 'instagram-feed'); ?></option>
848
- <option value="thumb" <?php if($sb_instagram_image_res == "thumb") echo 'selected="selected"' ?> ><?php _e('Thumbnail (150x150)', 'instagram-feed'); ?></option>
849
- <option value="medium" <?php if($sb_instagram_image_res == "medium") echo 'selected="selected"' ?> ><?php _e('Medium (306x306)', 'instagram-feed'); ?></option>
850
- <option value="full" <?php if($sb_instagram_image_res == "full") echo 'selected="selected"' ?> ><?php _e('Full size (640x640)', 'instagram-feed'); ?></option>
851
- </select>
852
-
853
- &nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e( 'What does Auto-detect mean?', 'instagram-feed'); ?></a>
854
- <p class="sbi_tooltip"><?php _e("Auto-detect means that the plugin automatically sets the image resolution based on the size of your feed.", 'instagram-feed'); ?></p>
855
-
856
- </td>
857
- </tr>
858
- </tbody>
859
- </table>
860
-
861
- <span><a href="javascript:void(0);" class="button button-secondary sbi-show-pro"><b>+</b> <?php _e('Show Pro Options', 'instagram-feed'); ?></a></span>
862
-
863
- <div class="sbi-pro-options">
864
- <p class="sbi-upgrade-link">
865
- <i class="fa fa-rocket" aria-hidden="true"></i>&nbsp; <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank"><?php _e('Upgrade to Pro to enable these settings', 'instagram-feed'); ?></a>
866
- </p>
867
- <table class="form-table">
868
- <tbody>
869
- <tr valign="top" class="sbi_pro">
870
- <th scope="row"><label><?php _e('Media Type to Display','instagram-feed'); ?></label></th>
871
- <td>
872
- <select name="sb_instagram_media_type" disabled>
873
- <option value="all"><?php _e('All','instagram-feed'); ?></option>
874
- <option value="photos"><?php _e('Photos only','instagram-feed'); ?></option>
875
- <option value="videos"><?php _e('Videos only','instagram-feed'); ?></option>
876
- </select>
877
- </td>
878
- </tr>
879
-
880
- <tr valign="top" class="sbi_pro">
881
- <th scope="row"><label><?php _e("Enable Pop-up Lightbox", 'instagram-feed'); ?></label></th>
882
- <td>
883
- <input type="checkbox" name="sb_instagram_captionlinks" id="sb_instagram_captionlinks" disabled />
884
- </td>
885
- </tr>
886
-
887
- <tr valign="top" class="sbi_pro">
888
- <th scope="row"><label><?php _e("Link Posts to URL in Caption (Shoppable feed)",'instagram-feed'); ?></label></th>
889
- <td>
890
- <input type="checkbox" name="sb_instagram_captionlinks" id="sb_instagram_captionlinks" disabled />
891
- &nbsp;<a class="sbi_tooltip_link sbi_pro" href="JavaScript:void(0);"><?php _e("What will this do?",'instagram-feed'); ?></a>
892
- <p class="sbi_tooltip"><?php _e("Checking this box will change the link for each post to any url included in the caption for that Instagram post. The lightbox will be disabled. Visit <a href='https://smashballoon.com/make-a-shoppable-feed?utm_source=plugin-free&utm_campaign=sbi'>this link</a> to learn how this works.",'instagram-feed'); ?></p>
893
- </td>
894
- </tr>
895
- </tbody>
896
- </table>
897
- </div>
898
-
899
-
900
- <hr />
901
- <h3><?php _e('Photo Hover Style','instagram-feed'); ?></h3>
902
-
903
- <p style="padding-bottom: 18px;">
904
- <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank"><?php _e('Upgrade to Pro to enable Photo Hover styles','instagram-feed'); ?></a><br />
905
- <a href="javascript:void(0);" class="button button-secondary sbi-show-pro"><b>+</b> <?php _e('Show Pro Options','instagram-feed'); ?></a>
906
- </p>
907
-
908
- <div class="sbi-pro-options" style="margin-top: -15px;">
909
- <table class="form-table">
910
- <tbody>
911
- <tr valign="top" class="sbi_pro">
912
- <th scope="row"><label><?php _e('Hover Background Color', 'instagram-feed'); ?></label></th>
913
- <td>
914
- <input name="sb_hover_background" type="text" disabled class="sbi_colorpick" />
915
- </td>
916
- </tr>
917
- <tr valign="top" class="sbi_pro">
918
- <th scope="row"><label><?php _e('Hover Text Color', 'instagram-feed'); ?></label></th>
919
- <td>
920
- <input name="sb_hover_text" type="text" disabled class="sbi_colorpick" />
921
- </td>
922
- </tr>
923
- <tr valign="top" class="sbi_pro">
924
- <th scope="row"><label><?php _e('Information to display', 'instagram-feed'); ?></label></th>
925
- <td>
926
- <div>
927
- <input name="sbi_hover_inc_username" type="checkbox" disabled />
928
- <label for="sbi_hover_inc_username"><?php _e('Username', 'instagram-feed'); ?></label>
929
- </div>
930
- <div>
931
- <input name="sbi_hover_inc_icon" type="checkbox" disabled />
932
- <label for="sbi_hover_inc_icon"><?php _e('Expand Icon', 'instagram-feed'); ?></label>
933
- </div>
934
- <div>
935
- <input name="sbi_hover_inc_date" type="checkbox" disabled />
936
- <label for="sbi_hover_inc_date"><?php _e('Date', 'instagram-feed'); ?></label>
937
- </div>
938
- <div>
939
- <input name="sbi_hover_inc_instagram" type="checkbox" disabled />
940
- <label for="sbi_hover_inc_instagram"><?php _e('Instagram Icon/Link', 'instagram-feed'); ?></label>
941
- </div>
942
- <div>
943
- <input name="sbi_hover_inc_location" type="checkbox" disabled />
944
- <label for="sbi_hover_inc_location"><?php _e('Location', 'instagram-feed'); ?></label>
945
- </div>
946
- <div>
947
- <input name="sbi_hover_inc_caption" type="checkbox" disabled />
948
- <label for="sbi_hover_inc_caption"><?php _e('Caption', 'instagram-feed'); ?></label>
949
- </div>
950
- <div>
951
- <input name="sbi_hover_inc_likes" type="checkbox" disabled />
952
- <label for="sbi_hover_inc_likes"><?php _e('Like/Comment Icons', 'instagram-feed'); ?></label>
953
- </div>
954
- </td>
955
- </tr>
956
-
957
- </tbody>
958
- </table>
959
- </div>
960
-
961
-
962
- <hr />
963
- <h3><?php _e( 'Carousel', 'instagram-feed' ); ?></h3>
964
- <p style="padding-bottom: 18px;">
965
- <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank"><?php _e('Upgrade to Pro to enable Carousels', 'instagram-feed'); ?></a><br />
966
- <a href="javascript:void(0);" class="button button-secondary sbi-show-pro"><b>+</b> <?php _e('Show Pro Options', 'instagram-feed'); ?></a>
967
- </p>
968
-
969
- <div class="sbi-pro-options" style="margin-top: -15px;">
970
- <table class="form-table">
971
- <tbody>
972
- <tr valign="top" class="sbi_pro">
973
- <th scope="row"><label><?php _e("Enable Carousel", 'instagram-feed'); ?></label></th>
974
- <td>
975
- <input type="checkbox" disabled />
976
- &nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e("What is this?", 'instagram-feed'); ?></a>
977
- <p class="sbi_tooltip"><?php _e("Enable this setting to create a carousel slider out of your photos.", 'instagram-feed'); ?></p>
978
- </td>
979
- </tr>
980
- <tr valign="top" class="sbi_pro">
981
- <th scope="row"><label><?php _e("Show Navigation Arrows", 'instagram-feed'); ?></label></th>
982
- <td>
983
- <input type="checkbox" disabled />
984
- </td>
985
- </tr>
986
- <tr valign="top" class="sbi_pro">
987
- <th scope="row"><label><?php _e("Show Pagination", 'instagram-feed'); ?></label></th>
988
- <td>
989
- <input type="checkbox" disabled />
990
- </td>
991
- </tr>
992
- <tr valign="top" class="sbi_pro">
993
- <th scope="row"><label><?php _e("Enable Autoplay", 'instagram-feed'); ?></label></th>
994
- <td>
995
- <input type="checkbox" disabled />
996
- </td>
997
- </tr>
998
- <tr valign="top" class="sbi_pro">
999
- <th scope="row"><label><?php _e("Interval Time", 'instagram-feed'); ?></label></th>
1000
- <td>
1001
- <input name="sb_instagram_carousel_interval" type="text" disabled size="6" /><?php _e("miliseconds", 'instagram-feed'); ?>
1002
- </td>
1003
- </tr>
1004
- </tbody>
1005
- </table>
1006
- </div>
1007
-
1008
-
1009
-
1010
- <hr id="headeroptions" />
1011
- <h3><?php _e("Header", 'instagram-feed'); ?></h3>
1012
- <table class="form-table">
1013
- <tbody>
1014
- <tr valign="top">
1015
- <th scope="row"><label><?php _e("Show Feed Header", 'instagram-feed'); ?></label><code class="sbi_shortcode"> showheader
1016
- Eg: showheader=false</code></th>
1017
- <td>
1018
- <input type="checkbox" name="sb_instagram_show_header" id="sb_instagram_show_header" <?php if($sb_instagram_show_header == true) echo 'checked="checked"' ?> />
1019
- </td>
1020
- </tr>
1021
- <tr valign="top">
1022
- <th scope="row"><label><?php _e('Header Size', 'instagram-feed'); ?></label><code class="sbi_shortcode"> headersize
1023
- Eg: headersize=medium</code></th>
1024
- <td>
1025
- <select name="sb_instagram_header_size" id="sb_instagram_header_size" style="float: left;">
1026
- <option value="small" <?php if($sb_instagram_header_size == "small") echo 'selected="selected"' ?> ><?php _e('Small', 'instagram-feed'); ?></option>
1027
- <option value="medium" <?php if($sb_instagram_header_size == "medium") echo 'selected="selected"' ?> ><?php _e('Medium', 'instagram-feed'); ?></option>
1028
- <option value="large" <?php if($sb_instagram_header_size == "large") echo 'selected="selected"' ?> ><?php _e('Large', 'instagram-feed'); ?></option>
1029
- </select>
1030
- </td>
1031
- </tr>
1032
- <tr valign="top">
1033
- <th scope="row"><label><?php _e("Show Bio Text", 'instagram-feed'); ?></label><code class="sbi_shortcode"> showbio
1034
- Eg: showbio=false</code></th>
1035
- <td>
1036
- <?php $sb_instagram_show_bio = isset( $sb_instagram_show_bio ) ? $sb_instagram_show_bio : true; ?>
1037
- <input type="checkbox" name="sb_instagram_show_bio" id="sb_instagram_show_bio" <?php if($sb_instagram_show_bio == true) echo 'checked="checked"' ?> />
1038
- <span class="sbi_note"><?php _e("Only applies for Instagram accounts with bios", 'instagram-feed'); ?></span>
1039
- </td>
1040
- </tr>
1041
- <tr valign="top">
1042
- <th scope="row"><label><?php _e('Header Text Color', 'instagram-feed'); ?></label><code class="sbi_shortcode"> headercolor
1043
- Eg: headercolor=fff</code></th>
1044
- <td>
1045
- <input name="sb_instagram_header_color" type="text" value="<?php echo esc_attr( $sb_instagram_header_color ); ?>" class="sbi_colorpick" />
1046
- </td>
1047
- </tr>
1048
- </tbody>
1049
- </table>
1050
-
1051
- <span><a href="javascript:void(0);" class="button button-secondary sbi-show-pro"><b>+</b> <?php _e('Show Pro Options', 'instagram-feed'); ?></a></span>
1052
-
1053
- <div class="sbi-pro-options">
1054
- <p class="sbi-upgrade-link">
1055
- <i class="fa fa-rocket" aria-hidden="true"></i>&nbsp; <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank"><?php _e('Upgrade to Pro to enable these settings', 'instagram-feed'); ?></a>
1056
- </p>
1057
- <table class="form-table">
1058
- <tbody>
1059
- <tr valign="top" class="sbi_pro">
1060
- <th scope="row"><label><?php _e('Header Style','instagram-feed'); ?></label></th>
1061
- <td>
1062
- <select name="sb_instagram_header_style" style="float: left;">
1063
- <option value="circle"><?php _e('Standard','instagram-feed'); ?></option>
1064
- <option value="boxed"><?php _e('Boxed','instagram-feed'); ?></option>
1065
- <option value="centered"><?php _e('Centered','instagram-feed'); ?></option>
1066
- </select>
1067
- </td>
1068
- </tr>
1069
- <tr valign="top" class="sbi_pro">
1070
- <th scope="row"><label><?php _e("Show Number of Followers",'instagram-feed'); ?></label></th>
1071
- <td>
1072
- <input type="checkbox" disabled />
1073
- <span class="sbi_note"><?php _e("This only applies when displaying photos from a User ID",'instagram-feed'); ?></span>
1074
- </td>
1075
- </tr>
1076
- </tbody>
1077
- </table>
1078
- </div>
1079
-
1080
- <?php submit_button(); ?>
1081
-
1082
-
1083
- <hr />
1084
- <h3><?php _e("Caption", 'instagram-feed'); ?></h3>
1085
- <p style="padding-bottom: 18px;">
1086
- <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank"><?php _e("Upgrade to Pro to enable Photo Captions", 'instagram-feed'); ?></a><br />
1087
- <a href="javascript:void(0);" class="button button-secondary sbi-show-pro"><b>+</b> <?php _e("Show Pro Options", 'instagram-feed'); ?></a>
1088
- </p>
1089
-
1090
- <div class="sbi-pro-options" style="margin-top: -15px;">
1091
- <table class="form-table">
1092
- <tbody>
1093
- <tr valign="top" class="sbi_pro">
1094
- <th scope="row"><label><?php _e("Show Caption", 'instagram-feed'); ?></label></th>
1095
- <td>
1096
- <input type="checkbox" disabled />
1097
- </td>
1098
- </tr>
1099
- <tr valign="top" class="sbi_pro">
1100
- <th scope="row"><label><?php _e("Maximum Text Length", 'instagram-feed'); ?></label></th>
1101
- <td>
1102
- <input disabled size="4" />Characters
1103
- &nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e("What is this?", 'instagram-feed'); ?></a>
1104
- <p class="sbi_tooltip"><?php _e("The number of characters of text to display in the caption. An elipsis link will be added to allow the user to reveal more text if desired.", 'instagram-feed'); ?></p>
1105
- </td>
1106
- </tr>
1107
- <tr valign="top" class="sbi_pro">
1108
- <th scope="row"><label><?php _e('Text Color', 'instagram-feed'); ?></label></th>
1109
- <td>
1110
- <input type="text" disabled class="sbi_colorpick" />
1111
- </td>
1112
- </tr>
1113
- <tr valign="top" class="sbi_pro">
1114
- <th scope="row"><label><?php _e('Text Size', 'instagram-feed'); ?></label></th>
1115
- <td>
1116
- <select name="sb_instagram_caption_size" style="width: 180px;" disabled>
1117
- <option value="inherit" ><?php _e('Inherit from theme', 'instagram-feed'); ?></option>
1118
- <option value="10" >10px</option>
1119
- <option value="11" >11px</option>
1120
- <option value="12" >12px</option>
1121
- <option value="13" >13px</option>
1122
- <option value="14" >14px</option>
1123
- <option value="16" >16px</option>
1124
- <option value="18" >18px</option>
1125
- <option value="20" >20px</option>
1126
- <option value="24" >24px</option>
1127
- <option value="28" >28px</option>
1128
- <option value="32" >32px</option>
1129
- <option value="36" >36px</option>
1130
- <option value="40" >40px</option>
1131
- </select>
1132
- </td>
1133
- </tr>
1134
- </tbody>
1135
- </table>
1136
- </div>
1137
-
1138
-
1139
- <hr />
1140
- <h3><?php _e("Likes &amp; Comments", 'instagram-feed'); ?></h3>
1141
- <p style="padding-bottom: 18px;">
1142
- <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank"><?php _e("Upgrade to Pro to enable Likes &amp; Comments", 'instagram-feed'); ?></a><br />
1143
- <a href="javascript:void(0);" class="button button-secondary sbi-show-pro"><b>+</b> <?php _e("Show Pro Options", 'instagram-feed'); ?></a>
1144
- </p>
1145
-
1146
- <div class="sbi-pro-options" style="margin-top: -15px;">
1147
- <table class="form-table">
1148
- <tbody>
1149
- <tr valign="top" class="sbi_pro">
1150
- <th scope="row"><label><?php _e("Show Icons", 'instagram-feed'); ?></label></th>
1151
- <td>
1152
- <input type="checkbox" disabled />
1153
- </td>
1154
- </tr>
1155
- <tr valign="top" class="sbi_pro">
1156
- <th scope="row"><label><?php _e('Icon Color', 'instagram-feed'); ?></label></th>
1157
- <td>
1158
- <input type="text" disabled class="sbi_colorpick" />
1159
- </td>
1160
- </tr>
1161
- <tr valign="top" class="sbi_pro">
1162
- <th scope="row"><label><?php _e('Icon Size', 'instagram-feed'); ?></label></th>
1163
- <td>
1164
- <select disabled name="sb_instagram_meta_size" style="width: 180px;">
1165
- <option value="inherit"><?php _e('Inherit from theme', 'instagram-feed'); ?></option>
1166
- <option value="10" >10px</option>
1167
- <option value="11" >11px</option>
1168
- <option value="12" >12px</option>
1169
- <option value="13" >13px</option>
1170
- <option value="14" >14px</option>
1171
- <option value="16" >16px</option>
1172
- <option value="18" >18px</option>
1173
- <option value="20" >20px</option>
1174
- <option value="24" >24px</option>
1175
- <option value="28" >28px</option>
1176
- <option value="32" >32px</option>
1177
- <option value="36" >36px</option>
1178
- <option value="40" >40px</option>
1179
- </select>
1180
- </td>
1181
- </tr>
1182
- </tbody>
1183
- </table>
1184
- </div>
1185
-
1186
-
1187
- <hr />
1188
- <h3><?php _e('Lightbox Comments', 'instagram-feed'); ?></h3>
1189
-
1190
- <p style="padding-bottom: 18px;">
1191
- <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank"><?php _e('Upgrade to Pro to enable Comments', 'instagram-feed'); ?></a><br />
1192
- <a href="javascript:void(0);" class="button button-secondary sbi-show-pro"><b>+</b> <?php _e('Show Pro Options', 'instagram-feed'); ?></a>
1193
- </p>
1194
-
1195
- <div class="sbi-pro-options" style="margin-top: -15px;">
1196
- <table class="form-table">
1197
- <tbody>
1198
-
1199
- <tr valign="top" class="sbi_pro">
1200
- <th scope="row"><label><?php _e('Show Comments in Lightbox', 'instagram-feed'); ?></label></th>
1201
- <td style="padding: 5px 10px 0 10px;">
1202
- <input type="checkbox" disabled style="margin-right: 15px;" />
1203
- <input class="button-secondary" style="margin-top: -5px;" disabled value="<?php esc_attr_e( 'Clear Comment Cache', 'instagram-feed' ); ?>" />
1204
- &nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e("What is this?", 'instagram-feed'); ?></a>
1205
- <p class="sbi_tooltip"><?php _e("This will remove the cached comments saved in the database", 'instagram-feed'); ?></p>
1206
- </td>
1207
- </tr>
1208
- <tr valign="top" class="sbi_pro">
1209
- <th scope="row"><label><?php _e('Number of Comments', 'instagram-feed'); ?></label></th>
1210
- <td>
1211
- <input name="sb_instagram_num_comments" type="text" disabled size="4" />
1212
- <span class="sbi_note"><?php _e('Max number of latest comments.', 'instagram-feed'); ?></span>
1213
- &nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e("What is this?", 'instagram-feed'); ?></a>
1214
- <p class="sbi_tooltip"><?php _e("This is the maximum number of comments that will be shown in the lightbox. If there are more comments available than the number set, only the latest comments will be shown", 'instagram-feed'); ?></p>
1215
- </td>
1216
- </tr>
1217
-
1218
- </tbody>
1219
- </table>
1220
- </div>
1221
-
1222
-
1223
- <hr id="loadmore" />
1224
- <h3><?php _e("'Load More' Button", 'instagram-feed'); ?></h3>
1225
- <table class="form-table">
1226
- <tbody>
1227
- <tr valign="top">
1228
- <th scope="row"><label><?php _e("Show the 'Load More' button", 'instagram-feed'); ?></label><code class="sbi_shortcode"> showbutton
1229
- Eg: showbutton=false</code></th>
1230
- <td>
1231
- <input type="checkbox" name="sb_instagram_show_btn" id="sb_instagram_show_btn" <?php if($sb_instagram_show_btn == true) echo 'checked="checked"' ?> />
1232
- </td>
1233
- </tr>
1234
- <tr valign="top">
1235
- <th scope="row"><label><?php _e('Button Background Color', 'instagram-feed'); ?></label><code class="sbi_shortcode"> buttoncolor
1236
- Eg: buttoncolor=8224e3</code></th>
1237
- <td>
1238
- <input name="sb_instagram_btn_background" type="text" value="<?php echo esc_attr( $sb_instagram_btn_background ); ?>" class="sbi_colorpick" />
1239
- </td>
1240
- </tr>
1241
- <tr valign="top">
1242
- <th scope="row"><label><?php _e('Button Text Color', 'instagram-feed'); ?></label><code class="sbi_shortcode"> buttontextcolor
1243
- Eg: buttontextcolor=eeee22</code></th>
1244
- <td>
1245
- <input name="sb_instagram_btn_text_color" type="text" value="<?php echo esc_attr( $sb_instagram_btn_text_color ); ?>" class="sbi_colorpick" />
1246
- </td>
1247
- </tr>
1248
- <tr valign="top">
1249
- <th scope="row"><label><?php _e('Button Text', 'instagram-feed'); ?></label><code class="sbi_shortcode"> buttontext
1250
- Eg: buttontext="Show more.."</code></th>
1251
- <td>
1252
- <input name="sb_instagram_btn_text" type="text" value="<?php echo esc_attr( stripslashes( $sb_instagram_btn_text ) ); ?>" size="20" />
1253
- </td>
1254
- </tr>
1255
- </tbody>
1256
- </table>
1257
-
1258
- <?php submit_button(); ?>
1259
-
1260
- <hr id="follow" />
1261
- <h3><?php _e("'Follow' Button", 'instagram-feed'); ?></h3>
1262
- <table class="form-table">
1263
- <tbody>
1264
- <tr valign="top">
1265
- <th scope="row"><label><?php _e("Show the Follow button", 'instagram-feed'); ?></label><code class="sbi_shortcode"> showfollow
1266
- Eg: showfollow=true</code></th>
1267
- <td>
1268
- <input type="checkbox" name="sb_instagram_show_follow_btn" id="sb_instagram_show_follow_btn" <?php if($sb_instagram_show_follow_btn == true) echo 'checked="checked"' ?> />
1269
- </td>
1270
- </tr>
1271
-
1272
- <tr valign="top">
1273
- <th scope="row"><label><?php _e('Button Background Color', 'instagram-feed'); ?></label><code class="sbi_shortcode"> followcolor
1274
- Eg: followcolor=28a1bf</code></th>
1275
- <td>
1276
- <input name="sb_instagram_folow_btn_background" type="text" value="<?php echo esc_attr( $sb_instagram_folow_btn_background ); ?>" class="sbi_colorpick" />
1277
- </td>
1278
- </tr>
1279
- <tr valign="top">
1280
- <th scope="row"><label><?php _e('Button Text Color', 'instagram-feed'); ?></label><code class="sbi_shortcode"> followtextcolor
1281
- Eg: followtextcolor=000</code></th>
1282
- <td>
1283
- <input name="sb_instagram_follow_btn_text_color" type="text" value="<?php echo esc_attr( $sb_instagram_follow_btn_text_color ); ?>" class="sbi_colorpick" />
1284
- </td>
1285
- </tr>
1286
- <tr valign="top">
1287
- <th scope="row"><label><?php _e('Button Text', 'instagram-feed'); ?></label><code class="sbi_shortcode"> followtext
1288
- Eg: followtext="Follow me"</code></th>
1289
- <td>
1290
- <input name="sb_instagram_follow_btn_text" type="text" value="<?php echo esc_attr( stripslashes( $sb_instagram_follow_btn_text ) ); ?>" size="30" />
1291
- </td>
1292
- </tr>
1293
- </tbody>
1294
- </table>
1295
-
1296
- <hr id="filtering" />
1297
- <h3><?php _e('Post Filtering', 'instagram-feed'); ?></h3>
1298
-
1299
- <p style="padding-bottom: 18px;">
1300
- <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank"><?php _e('Upgrade to Pro to enable Post Filtering options', 'instagram-feed'); ?></a><br />
1301
- <a href="javascript:void(0);" class="button button-secondary sbi-show-pro"><b>+</b> <?php _e('Show Pro Options', 'instagram-feed'); ?></a>
1302
- </p>
1303
-
1304
- <div class="sbi-pro-options" style="margin-top: -15px;">
1305
-
1306
- <table class="form-table">
1307
- <tbody>
1308
- <tr valign="top" class="sbi_pro">
1309
- <th scope="row"><label><?php _e('Remove photos containing these words or hashtags', 'instagram-feed'); ?></label></th>
1310
- <td>
1311
- <div class="sb_instagram_apply_labels">
1312
- <p><?php _e('Apply to:', 'instagram-feed'); ?></p>
1313
- <input class="sb_instagram_incex_one_all" type="radio" value="all" disabled /><label><?php _e('All feeds', 'instagram-feed'); ?></label>
1314
- <input class="sb_instagram_incex_one_all" type="radio" value="one" disabled /><label><?php _e('One feed', 'instagram-feed'); ?></label>
1315
- </div>
1316
-
1317
- <input disabled name="sb_instagram_exclude_words" id="sb_instagram_exclude_words" type="text" style="width: 70%;" value="" />
1318
- <br />
1319
- <span class="sbi_note" style="margin-left: 0;"><?php _e('Separate words/hashtags using commas', 'instagram-feed'); ?></span>
1320
- &nbsp;<a class="sbi_tooltip_link sbi_pro" href="JavaScript:void(0);"><?php _e( 'What is this?', 'instagram-feed'); ?></a>
1321
- <p class="sbi_tooltip"><?php _e("You can use this setting to remove photos which contain certain words or hashtags in the caption. Separate multiple words or hashtags using commas.", 'instagram-feed'); ?></p>
1322
- </td>
1323
- </tr>
1324
-
1325
- <tr valign="top" class="sbi_pro">
1326
- <th scope="row"><label><?php _e('Show photos containing these words or hashtags', 'instagram-feed'); ?></label></th>
1327
- <td>
1328
- <div class="sb_instagram_apply_labels">
1329
- <p><?php _e('Apply to:', 'instagram-feed'); ?></p>
1330
- <input class="sb_instagram_incex_one_all" type="radio" value="all" disabled /><label><?php _e('All feeds', 'instagram-feed'); ?></label>
1331
- <input class="sb_instagram_incex_one_all" type="radio" value="one" disabled /><label><?php _e('One feed', 'instagram-feed'); ?></label>
1332
- </div>
1333
-
1334
- <input disabled name="sb_instagram_include_words" id="sb_instagram_include_words" type="text" style="width: 70%;" value="" />
1335
- <br />
1336
- <span class="sbi_note" style="margin-left: 0;"><?php _e('Separate words/hashtags using commas', 'instagram-feed'); ?></span>
1337
- &nbsp;<a class="sbi_tooltip_link sbi_pro" href="JavaScript:void(0);"><?php _e( 'What is this?', 'instagram-feed'); ?></a>
1338
- <p class="sbi_tooltip"><?php _e("You can use this setting to only show photos which contain certain words or hashtags in the caption. For example, adding <code>sheep, cow, dog</code> will show any photos which contain either the word sheep, cow, or dog. Separate multiple words or hashtags using commas.", 'instagram-feed'); ?></p>
1339
- </td>
1340
- </tr>
1341
- </tbody>
1342
- </table>
1343
- </div>
1344
-
1345
-
1346
- <hr id="moderation" />
1347
- <h3><?php _e('Moderation', 'instagram-feed'); ?></h3>
1348
-
1349
- <p style="padding-bottom: 18px;">
1350
- <a href="https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi" target="_blank"><?php _e('Upgrade to Pro to enable Moderation options', 'instagram-feed'); ?></a><br />
1351
- <a href="javascript:void(0);" class="button button-secondary sbi-show-pro"><b>+</b> <?php _e('Show Pro Options', 'instagram-feed'); ?></a>
1352
- </p>
1353
-
1354
- <div class="sbi-pro-options" style="margin-top: -15px;">
1355
- <table class="form-table">
1356
- <tbody>
1357
- <tr valign="top" class="sbi_pro">
1358
- <th scope="row"><label><?php _e('Moderation Type', 'instagram-feed'); ?></label></th>
1359
- <td>
1360
- <input class="sb_instagram_moderation_mode" checked="checked" disabled type="radio" value="visual" style="margin-top: 0;" /><label><?php _e('Visual', 'instagram-feed'); ?></label>
1361
- <input class="sb_instagram_moderation_mode" disabled type="radio" value="manual" style="margin-top: 0; margin-left: 10px;"/><label><?php _e('Manual', 'instagram-feed'); ?></label>
1362
-
1363
- <p class="sbi_tooltip" style="display: block;"><?php _e("<b>Visual Moderation Mode</b><br />This adds a button to each feed that will allow you to hide posts, block users, and create white lists from the front end using a visual interface. Visit <a href='https://smashballoon.com/guide-to-moderation-mode/?utm_source=plugin-free&utm_campaign=sbi' target='_blank'>this page</a> for details", 'instagram-feed'); ?></p>
1364
-
1365
- </td>
1366
- </tr>
1367
-
1368
- <tr valign="top" class="sbi_pro">
1369
- <th scope="row"><label><?php _e('Only show posts by these users', 'instagram-feed'); ?></label></th>
1370
- <td>
1371
- <input type="text" style="width: 70%;" disabled /><br />
1372
- <span class="sbi_note" style="margin-left: 0;"><?php _e('Separate usernames using commas', 'instagram-feed'); ?></span>
1373
-
1374
- &nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e("What is this?", 'instagram-feed'); ?></a>
1375
- <p class="sbi_tooltip"><?php _e("You can use this setting to show photos only from certain users in your feed. Just enter the usernames here which you want to show. Separate multiple usernames using commas.", 'instagram-feed'); ?></p>
1376
- </td>
1377
- </tr>
1378
- <tr valign="top" class="sbi_pro">
1379
- <th scope="row"><label><?php _e('White lists', 'instagram-feed'); ?></label></th>
1380
- <td>
1381
- <div class="sbi_white_list_names_wrapper">
1382
- <?php _e("No white lists currently created", 'instagram-feed'); ?>
1383
- </div>
1384
-
1385
- <input disabled class="button-secondary" type="submit" value="<?php esc_attr_e( 'Clear White Lists', 'instagram-feed' ); ?>" />
1386
- &nbsp;<a class="sbi_tooltip_link" href="JavaScript:void(0);" style="display: inline-block; margin-top: 5px;"><?php _e("What is this?", 'instagram-feed'); ?></a>
1387
- <p class="sbi_tooltip"><?php _e("This will remove all of the white lists from the database", 'instagram-feed'); ?></p>
1388
- </td>
1389
- </tr>
1390
-
1391
- </tbody>
1392
- </table>
1393
- </div>
1394
-
1395
-
1396
-
1397
- <hr id="customcss" />
1398
- <h3><?php _e('Misc', 'instagram-feed'); ?></h3>
1399
-
1400
- <table class="form-table">
1401
- <tbody>
1402
- <tr valign="top">
1403
- <td style="padding-bottom: 0;">
1404
- <?php _e('<strong style="font-size: 15px;">Custom CSS</strong><br />Enter your own custom CSS in the box below', 'instagram-feed'); ?>
1405
- </td>
1406
- </tr>
1407
- <tr valign="top">
1408
- <td>
1409
- <textarea name="sb_instagram_custom_css" id="sb_instagram_custom_css" style="width: 70%;" rows="7"><?php echo esc_textarea( stripslashes($sb_instagram_custom_css), 'instagram-feed' ); ?></textarea>
1410
- </td>
1411
- </tr>
1412
- <tr valign="top" id="customjs">
1413
- <td style="padding-bottom: 0;">
1414
- <?php _e('<strong style="font-size: 15px;">Custom JavaScript</strong><br />Enter your own custom JavaScript/jQuery in the box below', 'instagram-feed'); ?>
1415
- </td>
1416
- </tr>
1417
- <tr valign="top">
1418
- <td>
1419
- <textarea name="sb_instagram_custom_js" id="sb_instagram_custom_js" style="width: 70%;" rows="7"><?php echo esc_textarea( stripslashes($sb_instagram_custom_js), 'instagram-feed' ); ?></textarea>
1420
- </td>
1421
- </tr>
1422
- </tbody>
1423
- </table>
1424
- <table class="form-table">
1425
- <tbody>
1426
-
1427
- <tr valign="top">
1428
- <th scope="row"><label for="sb_instagram_ajax_theme" class="bump-left"><?php _e("Are you using an Ajax powered theme?", 'instagram-feed'); ?></label></th>
1429
- <td>
1430
- <input name="sb_instagram_ajax_theme" type="checkbox" id="sb_instagram_ajax_theme" <?php if($sb_instagram_ajax_theme == true) echo "checked"; ?> />
1431
- <label for="sb_instagram_ajax_theme"><?php _e('Yes', 'instagram-feed'); ?></label>
1432
- <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'instagram-feed'); ?></a>
1433
- <p class="sbi_tooltip"><?php _e("When navigating your site, if your theme uses Ajax to load content into your pages (meaning your page doesn't refresh) then check this setting. If you're not sure then please check with the theme author.", 'instagram-feed'); ?></p>
1434
- </td>
1435
- </tr>
1436
-
1437
- <tr valign="top">
1438
- <th scope="row"><label><?php _e('Cache error API recheck', 'instagram-feed'); ?></label></th>
1439
- <td>
1440
- <input type="checkbox" name="check_api" id="sb_instagram_check_api" <?php if($check_api == true) echo 'checked="checked"' ?> />
1441
- <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?'); ?></a>
1442
- <p class="sbi_tooltip"><?php _e("If your site uses caching, minification, or JavaScript concatenation, this option can help prevent missing cache problems with the feed.", 'instagram-feed'); ?></p>
1443
- </td>
1444
- </tr>
1445
- <tr valign="top">
1446
- <th><label><?php _e("Enable Backup Caching", 'instagram-feed'); ?></label></th>
1447
- <td class="sbi-customize-tab-opt">
1448
- <input name="sb_instagram_backup" type="checkbox" id="sb_instagram_backup" <?php if($sb_instagram_backup == true) echo "checked"; ?> />
1449
- <input id="sbi_clear_backups" class="button-secondary" type="submit" style="position: relative; top: -4px;" value="<?php esc_attr_e( 'Clear Backup Cache', 'instagram-feed' ); ?>" />
1450
- <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'instagram-feed'); ?></a>
1451
- <p class="sbi_tooltip"><?php _e('Every feed will save a duplicate version of itself in the database to be used if the normal cache is not available.', 'instagram-feed'); ?></p>
1452
- </td>
1453
- </tr>
1454
- <tr>
1455
- <th class="bump-left">
1456
- <label for="sb_instagram_cron" class="bump-left"><?php _e("Force cache to clear on interval", 'instagram-feed'); ?></label>
1457
- </th>
1458
- <td>
1459
- <select name="sb_instagram_cron">
1460
- <option value="unset" <?php if($sb_instagram_cron == "unset") echo 'selected="selected"' ?> > - </option>
1461
- <option value="yes" <?php if($sb_instagram_cron == "yes") echo 'selected="selected"' ?> ><?php _e('Yes', 'instagram-feed'); ?></option>
1462
- <option value="no" <?php if($sb_instagram_cron == "no") echo 'selected="selected"' ?> ><?php _e('No', 'instagram-feed'); ?></option>
1463
- </select>
1464
-
1465
- <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'instagram-feed'); ?></a>
1466
- <p class="sbi_tooltip"><?php _e("If you're experiencing an issue with the plugin not auto-updating then you can set this to 'Yes' to run a scheduled event behind the scenes which forces the plugin cache to clear on a regular basis and retrieve new data from Instagram.", 'instagram-feed'); ?></p>
1467
- </td>
1468
- </tr>
1469
- </tbody>
1470
- </table>
1471
- <table class="form-table">
1472
- <tbody>
1473
- <tr valign="top">
1474
- <th scope="row"><label><?php _e("Disable Icon Font", 'instagram-feed'); ?></label></th>
1475
- <td>
1476
- <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' ); ?>
1477
- </td>
1478
- </tr>
1479
- <tr>
1480
- <th scope="row"><label for="sbi_font_method"><?php _e("Icon Method", 'instagram-feed'); ?></label></th>
1481
- <td>
1482
- <select name="sbi_font_method" id="sbi_font_method" class="default-text">
1483
- <option value="svg" id="sbi-font_method" class="default-text" <?php if($sbi_font_method == 'svg') echo 'selected="selected"' ?>>SVG</option>
1484
- <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>
1485
- </select>
1486
- <a class="sbi_tooltip_link" href="JavaScript:void(0);"><?php _e('What does this mean?', 'instagram-feed'); ?></a>
1487
- <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>
1488
- </td>
1489
- </tr>
1490
- </tbody>
1491
- </table>
1492
-
1493
- <?php submit_button(); ?>
1494
-
1495
- </form>
1496
-
1497
- <p><i class="fa fa-chevron-circle-right" aria-hidden="true"></i>&nbsp; <?php _e('Next Step: <a href="?page=sb-instagram-feed&tab=display">Display your Feed</a>', 'instagram-feed'); ?></p>
1498
-
1499
- <p><i class="fa fa-life-ring" aria-hidden="true"></i>&nbsp; <?php _e('Need help setting up the plugin? Check out our <a href="https://smashballoon.com/instagram-feed/free/?utm_source=plugin-free&utm_campaign=sbi" target="_blank">setup directions</a>', 'instagram-feed'); ?></p>
1500
-
1501
-
1502
- <?php } //End Customize tab ?>
1503
-
1504
-
1505
-
1506
- <?php if( $sbi_active_tab == 'display' ) { //Start Display tab ?>
1507
-
1508
- <h3><?php _e('Display your Feed', 'instagram-feed'); ?></h3>
1509
- <p><?php _e("Copy and paste the following shortcode directly into the page, post or widget where you'd like the feed to show up:", 'instagram-feed'); ?></p>
1510
- <input type="text" value="[instagram-feed]" size="16" readonly="readonly" style="text-align: center;" onclick="this.focus();this.select()" title="<?php _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).', 'instagram-feed'); ?>" />
1511
-
1512
- <h3 style="padding-top: 10px;"><?php _e( 'Multiple Feeds', 'instagram-feed' ); ?></h3>
1513
- <p><?php _e("If you'd like to display multiple feeds then you can set different settings directly in the shortcode like so:", 'instagram-feed'); ?>
1514
- <code>[instagram-feed num=9 cols=3]</code></p>
1515
- <p><?php _e( 'You can display as many different feeds as you like, on either the same page or on different pages, by just using the shortcode options below. For example:', 'instagram-feed' ); ?><br />
1516
- <code>[instagram-feed]</code><br />
1517
- <code>[instagram-feed num=4 cols=4 showfollow=false]</code><br />
1518
- <code>[instagram-feed accesstoken="ANOTHER_ACCESS_TOKEN"]</code>
1519
- </p>
1520
- <p><?php _e("See the table below for a full list of available shortcode options:", 'instagram-feed'); ?></p>
1521
-
1522
- <p><span class="sbi_table_key"></span><?php _e('Pro version only', 'instagram-feed'); ?></p>
1523
-
1524
- <table class="sbi_shortcode_table">
1525
- <tbody>
1526
- <tr valign="top">
1527
- <th scope="row"><?php _e('Shortcode option', 'instagram-feed'); ?></th>
1528
- <th scope="row"><?php _e('Description', 'instagram-feed'); ?></th>
1529
- <th scope="row"><?php _e('Example', 'instagram-feed'); ?></th>
1530
- </tr>
1531
-
1532
- <tr class="sbi_table_header"><td colspan=3><?php _e("Configure Options", 'instagram-feed'); ?></td></tr>
1533
- <tr class="sbi_pro">
1534
- <td>type</td>
1535
- <td><?php _e("Display photos from a User ID (user)<br />Display posts from a Hashtag (hashtag)", 'instagram-feed'); ?></td>
1536
- <td><code>[instagram-feed type=user]</code><br /><code>[instagram-feed type=hashtag]</code></td>
1537
- </tr>
1538
- <tr>
1539
- <td>id</td>
1540
- <td><?php _e('Your Instagram User ID. This must be the ID associated with your Access Token.', 'instagram-feed'); ?></td>
1541
- <td><code>[instagram-feed id="1234567"]</code></td>
1542
- </tr>
1543
- <tr class="sbi_pro">
1544
- <td>hashtag</td>
1545
- <td><?php _e('Any hashtag. Separate multiple IDs by commas.', 'instagram-feed'); ?></td>
1546
- <td><code>[instagram-feed hashtag="#awesome"]</code></td>
1547
- </tr>
1548
-
1549
- <tr class="sbi_table_header"><td colspan=3><?php _e("Customize Options", 'instagram-feed'); ?></td></tr>
1550
- <tr>
1551
- <td>width</td>
1552
- <td><?php _e("The width of your feed. Any number.", 'instagram-feed'); ?></td>
1553
- <td><code>[instagram-feed width=50]</code></td>
1554
- </tr>
1555
- <tr>
1556
- <td>widthunit</td>
1557
- <td><?php _e("The unit of the width. 'px' or '%'", 'instagram-feed'); ?></td>
1558
- <td><code>[instagram-feed widthunit=%]</code></td>
1559
- </tr>
1560
- <tr>
1561
- <td>height</td>
1562
- <td><?php _e("The height of your feed. Any number.", 'instagram-feed'); ?></td>
1563
- <td><code>[instagram-feed height=250]</code></td>
1564
- </tr>
1565
- <tr>
1566
- <td>heightunit</td>
1567
- <td><?php _e("The unit of the height. 'px' or '%'", 'instagram-feed'); ?></td>
1568
- <td><code>[instagram-feed heightunit=px]</code></td>
1569
- </tr>
1570
- <tr>
1571
- <td>background</td>
1572
- <td><?php _e("The background color of the feed. Any hex color code.", 'instagram-feed'); ?></td>
1573
- <td><code>[instagram-feed background=#ffff00]</code></td>
1574
- </tr>
1575
- <tr>
1576
- <td>class</td>
1577
- <td><?php _e("Add a CSS class to the feed container", 'instagram-feed'); ?></td>
1578
- <td><code>[instagram-feed class=feedOne]</code></td>
1579
- </tr>
1580
-
1581
- <tr class="sbi_table_header"><td colspan=3><?php _e("Layout Options", 'instagram-feed'); ?></td></tr>
1582
- <tr class="sbi_pro">
1583
- <td>layout</td>
1584
- <td><?php _e("How posts are arranged visually in the feed. There are four layouts: Grid, Carousel Slider, Masonry Grid, or Highlight Grid. Options:", 'instagram-feed' ); ?> 'grid', 'carousel', 'masonry', or 'highlight'</td>
1585
- <td><code>[instagram-feed layout=grid]</code></td>
1586
- </tr>
1587
- <tr>
1588
- <td>num</td>
1589
- <td><?php _e("The number of photos to display initially. Maximum is 33.", 'instagram-feed'); ?></td>
1590
- <td><code>[instagram-feed num=10]</code></td>
1591
- </tr>
1592
- <tr class="sbi_pro">
1593
- <td>nummobile</td>
1594
- <td><?php _e("The number of photos to display initially for mobile screens (smaller than 480 pixels).", 'instagram-feed'); ?></td>
1595
- <td><code>[instagram-feed nummobile=6]</code></td>
1596
- </tr>
1597
- <tr>
1598
- <td>cols</td>
1599
- <td><?php _e("The number of columns in your feed. 1 - 10.", 'instagram-feed'); ?></td>
1600
- <td><code>[instagram-feed cols=5]</code></td>
1601
- </tr>
1602
- <tr class="sbi_pro">
1603
- <td>colsmobile</td>
1604
- <td><?php _e("The number of columns in your feed for mobile screens (smaller than 480 pixels).", 'instagram-feed'); ?></td>
1605
- <td><code>[instagram-feed colsmobile=2]</code></td>
1606
- </tr>
1607
- <tr>
1608
- <td>imagepadding</td>
1609
- <td><?php _e("The spacing around your photos", 'instagram-feed'); ?></td>
1610
- <td><code>[instagram-feed imagepadding=10]</code></td>
1611
- </tr>
1612
- <tr>
1613
- <td>imagepaddingunit</td>
1614
- <td><?php _e("The unit of the padding. 'px' or '%'", 'instagram-feed'); ?></td>
1615
- <td><code>[instagram-feed imagepaddingunit=px]</code></td>
1616
- </tr>
1617
-
1618
- <tr class="sbi_table_header"><td colspan=3><?php _e("Carousel Options", 'instagram-feed'); ?></td></tr>
1619
- <tr class="sbi_pro">
1620
- <td>carouselrows</td>
1621
- <td><?php _e("Choose 1 or 2 rows of posts in the carousel", 'instagram-feed'); ?></td>
1622
- <td><code>[instagram-feed carouselrows=1]</code></td>
1623
- </tr>
1624
- <tr class="sbi_pro">
1625
- <td>carouselloop</td>
1626
- <td><?php _e("Infinitely loop through posts or rewind", 'instagram-feed'); ?></td>
1627
- <td><code>[instagram-feed carouselloop=rewind]</code></td>
1628
- </tr>
1629
- <tr class="sbi_pro">
1630
- <td>carouselarrows</td>
1631
- <td><?php _e("Display directional arrows on the carousel", 'instagram-feed'); ?></td>
1632
- <td><code>[instagram-feed carouselarrows=true]</code></td>
1633
- </tr>
1634
- <tr class="sbi_pro">
1635
- <td>carouselpag</td>
1636
- <td><?php _e("Display pagination links below the carousel", 'instagram-feed'); ?></td>
1637
- <td><code>[instagram-feed carouselpag=true]</code></td>
1638
- </tr>
1639
- <tr class="sbi_pro">
1640
- <td>carouselautoplay</td>
1641
- <td><?php _e("Make the carousel autoplay", 'instagram-feed'); ?></td>
1642
- <td><code>[instagram-feed carouselautoplay=true]</code></td>
1643
- </tr>
1644
- <tr class="sbi_pro">
1645
- <td>carouseltime</td>
1646
- <td><?php _e("The interval time between slides for autoplay. Time in miliseconds.", 'instagram-feed'); ?></td>
1647
- <td><code>[instagram-feed carouseltime=8000]</code></td>
1648
- </tr>
1649
-
1650
- <tr class="sbi_table_header"><td colspan=3><?php _e("Highlight Options", 'instagram-feed'); ?></td></tr>
1651
- <tr class="sbi_pro">
1652
- <td>highlighttype</td>
1653
- <td><?php _e("Choose from 3 different ways of highlighting posts including by pattern, hashtag, post id or. Options:", 'instagram-feed'); ?> 'pattern', 'hashtag', 'id'.</td>
1654
- <td><code>[instagram-feed highlighttype=hashtag]</code></td>
1655
- </tr>
1656
- <tr class="sbi_pro">
1657
- <td>highlightpattern</td>
1658
- <td><?php _e("How often a post is highlighted.", 'instagram-feed'); ?></td>
1659
- <td><code>[instagram-feed highlightpattern=7]</code></td>
1660
- </tr>
1661
- <tr class="sbi_pro">
1662
- <td>highlightoffset</td>
1663
- <td><?php _e("When to start the highlight pattern.", 'instagram-feed'); ?></td>
1664
- <td><code>[instagram-feed highlightoffset=3]</code></td>
1665
- </tr>
1666
- <tr class="sbi_pro">
1667
- <td>highlighthashtag</td>
1668
- <td><?php _e("Highlight posts with these hashtags.", 'instagram-feed'); ?></td>
1669
- <td><code>[instagram-feed highlighthashtag=best]</code></td>
1670
- </tr>
1671
-
1672
-
1673
-
1674
-
1675
-
1676
- <tr class="sbi_table_header"><td colspan=3><?php _e("Photos Options", 'instagram-feed'); ?></td></tr>
1677
- <tr>
1678
- <td>sortby</td>
1679
- <td><?php _e("Sort the posts by Newest to Oldest (none) or Random (random)", 'instagram-feed'); ?></td>
1680
- <td><code>[instagram-feed sortby=random]</code></td>
1681
- </tr>
1682
- <tr>
1683
- <td>imageres</td>
1684
- <td><?php _e("The resolution/size of the photos including full, medium, thumbnail, and auto (based on size of image on page). Options:", 'instagram-feed'); ?> 'auto', full', 'medium' or 'thumb'.</td>
1685
- <td><code>[instagram-feed imageres=full]</code></td>
1686
- </tr>
1687
- <tr class="sbi_pro">
1688
- <td>media</td>
1689
- <td><?php _e("Display all media, only photos, or only videos", 'instagram-feed'); ?></td>
1690
- <td><code>[instagram-feed media=photos]</code></td>
1691
- </tr>
1692
- <tr class="sbi_pro">
1693
- <td>disablelightbox</td>
1694
- <td><?php _e("Whether to disable the photo Lightbox. It is enabled by default.", 'instagram-feed'); ?></td>
1695
- <td><code>[instagram-feed disablelightbox=true]</code></td>
1696
- </tr>
1697
- <tr>
1698
- <td>disablemobile</td>
1699
- <td><?php _e("Disable the mobile layout. Options:", 'instagram-feed'); ?> 'true' or 'false'.</td>
1700
- <td><code>[instagram-feed disablemobile=true]</code></td>
1701
- </tr>
1702
- <tr class="sbi_pro">
1703
- <td>captionlinks</td>
1704
- <td><?php _e("Whether to use urls in captions for the photo's link instead of linking to instagram.com.", 'instagram-feed'); ?></td>
1705
- <td><code>[instagram-feed captionlinks=true]</code></td>
1706
- </tr>
1707
-
1708
- <tr class="sbi_table_header"><td colspan=3><?php _e("Lightbox Comments Options", 'instagram-feed'); ?></td></tr>
1709
- <tr class="sbi_pro">
1710
- <td>lightboxcomments</td>
1711
- <td><?php _e("Whether to show comments in the lightbox for this feed.", 'instagram-feed'); ?></td>
1712
- <td><code>[instagram-feed lightboxcomments=true]</code></td>
1713
- </tr>
1714
- <tr class="sbi_pro">
1715
- <td>numcomments</td>
1716
- <td><?php _e("Number of comments to show starting from the most recent.", 'instagram-feed'); ?></td>
1717
- <td><code>[instagram-feed numcomments=10]</code></td>
1718
- </tr>
1719
-
1720
- <tr class="sbi_table_header"><td colspan=3><?php _e("Photos Hover Style Options", 'instagram-feed'); ?></td></tr>
1721
- <tr class="sbi_pro">
1722
- <td>hovercolor</td>
1723
- <td><?php _e("The background color when hovering over a photo. Any hex color code.", 'instagram-feed'); ?></td>
1724
- <td><code>[instagram-feed hovercolor=#ff0000]</code></td>
1725
- </tr>
1726
- <tr class="sbi_pro">
1727
- <td>hovertextcolor</td>
1728
- <td><?php _e("The text/icon color when hovering over a photo. Any hex color code.", 'instagram-feed'); ?></td>
1729
- <td><code>[instagram-feed hovertextcolor=#fff]</code></td>
1730
- </tr>
1731
- <tr class="sbi_pro">
1732
- <td>hoverdisplay</td>
1733
- <td><?php _e("The info to display when hovering over the photo such as the user name, post date, Instagram icon, location, caption, and like counts. Options:", 'instagram-feed'); ?><br />username, date, instagram, location, caption, likes</td>
1734
- <td><code>[instagram-feed hoverdisplay="date, location, likes"]</code></td>
1735
- </tr>
1736
-
1737
- <tr class="sbi_table_header"><td colspan=3><?php _e("Header Options", 'instagram-feed'); ?></td></tr>
1738
- <tr>
1739
- <td>showheader</td>
1740
- <td><?php _e("Whether to show the feed Header. Options:", 'instagram-feed'); ?> 'true' or 'false'.</td>
1741
- <td><code>[instagram-feed showheader=false]</code></td>
1742
- </tr>
1743
- <tr>
1744
- <td>showbio</td>
1745
- <td><?php _e("Display the bio in the header. Options:", 'instagram-feed'); ?> 'true' or 'false'</td>
1746
- <td><code>[instagram-feed showbio=true]</code></td>
1747
- </tr>
1748
- <tr>
1749
- <td>headersize</td>
1750
- <td><?php _e("Size of the header including small, medium and large. Options:", 'instagram-feed'); ?> small, medium, or large.</td>
1751
- <td><code>[instagram-feed headersize=medium]</code></td>
1752
- </tr>
1753
- <tr>
1754
- <td>headercolor</td>
1755
- <td><?php _e("The color of the Header text. Any hex color code.", 'instagram-feed'); ?></td>
1756
- <td><code>[instagram-feed headercolor=#333]</code></td>
1757
- </tr>
1758
-
1759
- <tr class="sbi_table_header"><td colspan=3><?php _e("'Load More' Button Options", 'instagram-feed'); ?></td></tr>
1760
- <tr>
1761
- <td>showbutton</td>
1762
- <td><?php _e("Whether to show the 'Load More' button. Options:", 'instagram-feed'); ?> 'true' or 'false'.</td>
1763
- <td><code>[instagram-feed showbutton=false]</code></td>
1764
- </tr>
1765
- <tr>
1766
- <td>buttoncolor</td>
1767
- <td><?php _e("The background color of the button. Any hex color code.", 'instagram-feed'); ?></td>
1768
- <td><code>[instagram-feed buttoncolor=#000]</code></td>
1769
- </tr>
1770
- <tr>
1771
- <td>buttontextcolor</td>
1772
- <td><?php _e("The text color of the button. Any hex color code.", 'instagram-feed'); ?></td>
1773
- <td><code>[instagram-feed buttontextcolor=#fff]</code></td>
1774
- </tr>
1775
- <tr>
1776
- <td>buttontext</td>
1777
- <td><?php _e("The text used for the button.", 'instagram-feed'); ?></td>
1778
- <td><code>[instagram-feed buttontext="Load More Photos"]</code></td>
1779
- </tr>
1780
-
1781
- <tr class="sbi_table_header"><td colspan=3><?php _e("'Follow on Instagram' Button Options", 'instagram-feed'); ?></td></tr>
1782
- <tr>
1783
- <td>showfollow</td>
1784
- <td><?php _e("Whether to show the 'Follow on Instagram' button. Options:", 'instagram-feed'); ?> 'true' or 'false'.</td>
1785
- <td><code>[instagram-feed showfollow=false]</code></td>
1786
- </tr>
1787
- <tr>
1788
- <td>followcolor</td>
1789
- <td><?php _e("The background color of the button. Any hex color code.", 'instagram-feed'); ?></td>
1790
- <td><code>[instagram-feed followcolor=#ff0000]</code></td>
1791
- </tr>
1792
- <tr>
1793
- <td>followtextcolor</td>
1794
- <td><?php _e("The text color of the button. Any hex color code.", 'instagram-feed'); ?></td>
1795
- <td><code>[instagram-feed followtextcolor=#fff]</code></td>
1796
- </tr>
1797
- <tr>
1798
- <td>followtext</td>
1799
- <td><?php _e("The text used for the button.", 'instagram-feed'); ?></td>
1800
- <td><code>[instagram-feed followtext="Follow me"]</code></td>
1801
- </tr>
1802
-
1803
- <tr class="sbi_table_header"><td colspan=3><?php _e("Caption Options", 'instagram-feed'); ?></td></tr>
1804
- <tr class="sbi_pro">
1805
- <td>showcaption</td>
1806
- <td><?php _e("Whether to show the photo caption. Options:", 'instagram-feed'); ?> 'true' or 'false'.</td>
1807
- <td><code>[instagram-feed showcaption=false]</code></td>
1808
- </tr>
1809
- <tr class="sbi_pro">
1810
- <td>captionlength</td>
1811
- <td><?php _e("The number of characters of the caption to display", 'instagram-feed'); ?></td>
1812
- <td><code>[instagram-feed captionlength=50]</code></td>
1813
- </tr>
1814
- <tr class="sbi_pro">
1815
- <td>captioncolor</td>
1816
- <td><?php _e("The text color of the caption. Any hex color code.", 'instagram-feed'); ?></td>
1817
- <td><code>[instagram-feed captioncolor=#000]</code></td>
1818
- </tr>
1819
- <tr class="sbi_pro">
1820
- <td>captionsize</td>
1821
- <td><?php _e("The size of the caption text. Any number.", 'instagram-feed'); ?></td>
1822
- <td><code>[instagram-feed captionsize=24]</code></td>
1823
- </tr>
1824
-
1825
- <tr class="sbi_table_header"><td colspan=3><?php _e("Likes &amp; Comments Options", 'instagram-feed'); ?></td></tr>
1826
- <tr class="sbi_pro">
1827
- <td>showlikes</td>
1828
- <td><?php _e("Whether to show the Likes &amp; Comments. Options:", 'instagram-feed'); ?> 'true' or 'false'.</td>
1829
- <td><code>[instagram-feed showlikes=false]</code></td>
1830
- </tr>
1831
- <tr class="sbi_pro">
1832
- <td>likescolor</td>
1833
- <td><?php _e("The color of the Likes &amp; Comments. Any hex color code.", 'instagram-feed'); ?></td>
1834
- <td><code>[instagram-feed likescolor=#FF0000]</code></td>
1835
- </tr>
1836
- <tr class="sbi_pro">
1837
- <td>likessize</td>
1838
- <td><?php _e("The size of the Likes &amp; Comments. Any number.", 'instagram-feed'); ?></td>
1839
- <td><code>[instagram-feed likessize=14]</code></td>
1840
- </tr>
1841
-
1842
- <tr class="sbi_table_header"><td colspan=3><?php _e("Post Filtering Options", 'instagram-feed'); ?></td></tr>
1843
- <tr class="sbi_pro">
1844
- <td>excludewords</td>
1845
- <td><?php _e("Remove posts which contain certain words or hashtags in the caption.", 'instagram-feed'); ?></td>
1846
- <td><code>[instagram-feed excludewords="bad, words"]</code></td>
1847
- </tr>
1848
- <tr class="sbi_pro">
1849
- <td>includewords</td>
1850
- <td><?php _e("Only display posts which contain certain words or hashtags in the caption.", 'instagram-feed'); ?></td>
1851
- <td><code>[instagram-feed includewords="sunshine"]</code></td>
1852
- </tr>
1853
-
1854
- <tr class="sbi_table_header"><td colspan=3><?php _e("Auto Load More on Scroll", 'instagram-feed'); ?></td></tr>
1855
- <tr class="sbi_pro">
1856
- <td>autoscroll</td>
1857
- <td><?php _e("Load more posts automatically as the user scrolls down the page.", 'instagram-feed'); ?></td>
1858
- <td><code>[instagram-feed autoscroll=true]</code></td>
1859
- </tr>
1860
- <tr class="sbi_pro">
1861
- <td>autoscrolldistance</td>
1862
- <td><?php _e("Distance before the end of feed or page that triggers the loading of more posts.", 'instagram-feed'); ?></td>
1863
- <td><code>[instagram-feed autoscrolldistance=200]</code></td>
1864
- </tr>
1865
-
1866
- </tbody>
1867
- </table>
1868
-
1869
- <p><i class="fa fa-life-ring" aria-hidden="true"></i>&nbsp; <?php _e('Need help setting up the plugin? Check out our <a href="https://smashballoon.com/instagram-feed/free/?utm_source=plugin-free&utm_campaign=sbi" target="_blank">setup directions</a>', 'instagram-feed'); ?></p>
1870
-
1871
- <?php } //End Display tab ?>
1872
-
1873
-
1874
- <?php if( $sbi_active_tab == 'support' ) { //Start Support tab ?>
1875
-
1876
- <div class="sbi_support">
1877
-
1878
- <br/>
1879
- <h3 style="padding-bottom: 10px;"><?php _e("Need help?", 'instagram-feed'); ?></h3>
1880
-
1881
- <p>
1882
- <span class="sbi-support-title"><i class="fa fa-life-ring" aria-hidden="true"></i>&nbsp; <a
1883
- href="https://smashballoon.com/instagram-feed/free/?utm_source=plugin-free&utm_campaign=sbi"
1884
- target="_blank"><?php _e( 'Setup Directions', 'instagram-feed' ); ?></a></span>
1885
- <?php _e( 'A step-by-step guide on how to setup and use the plugin.', 'instagram-feed' ); ?>
1886
- </p>
1887
-
1888
- <p>
1889
- <span class="sbi-support-title"><i class="fa fa-youtube-play" aria-hidden="true"></i>&nbsp; <a
1890
- href="https://www.youtube.com/embed/q6ZXVU4g970" target="_blank"
1891
- id="sbi-play-support-video"><?php _e( 'Watch a Video', 'instagram-feed' ); ?></a></span>
1892
- <?php _e( "Watch a short video demonstrating how to set up, customize and use the plugin.<br /><b>Please note</b> that the video shows the set up and use of the <b><a href='https://smashballoon.com/instagram-feed/?utm_source=plugin-free&utm_campaign=sbi' target='_blank'>Pro version</a></b> of the plugin, but the process is the same for this free version. The only difference is some of the features available.", 'instagram-feed' ); ?>
1893
-
1894
- <iframe id="sbi-support-video"
1895
- src="//www.youtube.com/embed/q6ZXVU4g970?theme=light&amp;showinfo=0&amp;controls=2" width="960"
1896
- height="540" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
1897
- </p>
1898
-
1899
- <p>
1900
- <span class="sbi-support-title"><i class="fa fa-question-circle" aria-hidden="true"></i>&nbsp; <a
1901
- href="https://smashballoon.com/instagram-feed/support/faq/?utm_source=plugin-free&utm_campaign=sbi"
1902
- target="_blank"><?php _e( 'FAQs and Docs', 'instagram-feed' ); ?></a></span>
1903
- <?php _e( 'View our expansive library of FAQs and documentation to help solve your problem as quickly as possible.', 'instagram-feed' ); ?>
1904
- </p>
1905
-
1906
- <div class="sbi-support-faqs">
1907
-
1908
- <ul>
1909
- <li><b><?php _e( 'FAQs', 'instagram-feed' ); ?></b></li>
1910
- <li>&bull;&nbsp; <?php _e( '<a href="https://smashballoon.com/my-photos-wont-load/?utm_source=plugin-free&utm_campaign=sbi" target="_blank">My Instagram Feed Won\'t Load</a>', 'instagram-feed' ); ?></li>
1911
- <li>&bull;&nbsp; <?php _e( '<a href="https://smashballoon.com/my-instagram-access-token-keep-expiring/?utm_source=plugin-free&utm_campaign=sbi" target="_blank">My Access Token Keeps Expiring</a>', 'instagram-feed' ); ?></li>
1912
- <li style="margin-top: 8px; font-size: 12px;"><a href="https://smashballoon.com/instagram-feed/support/faq/?utm_source=plugin-free&utm_campaign=sbi" target="_blank"><?php _e( 'See All', 'instagram-feed' ); ?><i class="fa fa-chevron-right" aria-hidden="true"></i></a></li>
1913
- </ul>
1914
-
1915
- <ul>
1916
- <li><b><?php _e("Documentation", 'instagram-feed'); ?></b></li>
1917
- <li>&bull;&nbsp; <?php _e( '<a href="https://smashballoon.com/instagram-feed/free?utm_source=plugin-free&utm_campaign=sbi" target="_blank">Installation and Configuration</a>', 'instagram-feed' ); ?></li>
1918
- <li>&bull;&nbsp; <?php _e( '<a href="https://smashballoon.com/display-multiple-instagram-feeds/?utm_source=plugin-free&utm_campaign=sbi" target="_blank">Displaying multiple feeds</a>', 'instagram-feed' ); ?></li>
1919
- <li>&bull;&nbsp; <?php _e( '<a href="https://smashballoon.com/instagram-feed-faq/customization/?utm_source=plugin-free&utm_campaign=sbi" target="_blank">Customizing your Feed</a>', 'instagram-feed' ); ?></li>
1920
- </ul>
1921
- </div>
1922
-
1923
- <p>
1924
- <span class="sbi-support-title"><i class="fa fa-envelope" aria-hidden="true"></i>&nbsp; <a
1925
- href="https://smashballoon.com/instagram-feed/support/?utm_source=plugin-free&utm_campaign=sbi"
1926
- target="_blank"><?php _e( 'Request Support', 'instagram-feed' ); ?></a></span>
1927
- <?php _e( 'Still need help? Submit a ticket and one of our support experts will get back to you as soon as possible.<br /><b>Important:</b> Please include your <b>System Info</b> below with all support requests.', 'instagram-feed' ); ?>
1928
- </p>
1929
- </div>
1930
-
1931
- <hr />
1932
-
1933
- <h3><?php _e('System Info &nbsp; <i style="color: #666; font-size: 11px; font-weight: normal;">Click the text below to select all</i>', 'instagram-feed'); ?></h3>
1934
-
1935
-
1936
-
1937
-
1938
- <?php $sbi_options = get_option('sb_instagram_settings'); ?>
1939
- <textarea readonly="readonly" onclick="this.focus();this.select()" title="To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac)." style="width: 100%; max-width: 960px; height: 500px; white-space: pre; font-family: Menlo,Monaco,monospace;">
1940
- ## SITE/SERVER INFO: ##
1941
- Site URL: <?php echo site_url() . "\n"; ?>
1942
- Home URL: <?php echo home_url() . "\n"; ?>
1943
- WordPress Version: <?php echo get_bloginfo( 'version' ) . "\n"; ?>
1944
- PHP Version: <?php echo PHP_VERSION . "\n"; ?>
1945
- Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?>
1946
-
1947
- ## ACTIVE PLUGINS: ##
1948
- <?php
1949
- $plugins = get_plugins();
1950
- $active_plugins = get_option( 'active_plugins', array() );
1951
-
1952
- foreach ( $plugins as $plugin_path => $plugin ) {
1953
- // If the plugin isn't active, don't show it.
1954
- if ( ! in_array( $plugin_path, $active_plugins ) )
1955
- continue;
1956
-
1957
- echo $plugin['Name'] . ': ' . $plugin['Version'] ."\n";
1958
- }
1959
- ?>
1960
-
1961
- ## PLUGIN SETTINGS: ##
1962
- sb_instagram_plugin_type => Instagram Feed Free
1963
- <?php
1964
- foreach( $sbi_options as $key => $val ) {
1965
- if ( is_array( $val ) ) {
1966
- foreach ( $val as $item ) {
1967
- if ( is_array( $item ) ) {
1968
- foreach ( $item as $key2 => $val2 ) {
1969
- echo "$key2 => $val2\n";
1970
- }
1971
- } else {
1972
- echo "$key => $item\n";
1973
- }
1974
- }
1975
- } else {
1976
- echo "$key => $val\n";
1977
- }
1978
- }
1979
- ?>
1980
-
1981
- ## API RESPONSE: ##
1982
- <?php
1983
- $con_accounts = isset( $sbi_options['connected_accounts'] ) ? $sbi_options['connected_accounts'] : array();
1984
- $first_at = '';
1985
- $i = 0;
1986
- if ( ! empty( $con_accounts ) ) {
1987
- foreach ( $con_accounts as $account ) {
1988
- if ( $i == 0 ) {
1989
- $first_at = $account['access_token'];
1990
- $i++;
1991
- }
1992
- }
1993
-
1994
- }
1995
-
1996
- $url = ! empty( $first_at ) ? 'https://api.instagram.com/v1/users/self/?access_token=' . sbi_maybe_clean( $first_at ) : 'no_at';
1997
- if ( $url !== 'no_at' ) {
1998
- $args = array(
1999
- 'timeout' => 60,
2000
- 'sslverify' => false
2001
- );
2002
- $result = wp_remote_get( $url, $args );
2003
-
2004
- if ( ! is_wp_error( $result ) ) {
2005
- $data = json_decode( $result['body'] );
2006
-
2007
- if ( isset( $data->data->id ) ) {
2008
- echo 'id: ' . $data->data->id . "\n";
2009
- echo 'username: ' . $data->data->username . "\n";
2010
- echo 'posts: ' . $data->data->counts->media . "\n";
2011
-
2012
- } else {
2013
- echo 'No id returned' . "\n";
2014
- echo 'code: ' . $data->meta->code . "\n";
2015
- if ( isset( $data->meta->error_message ) ) {
2016
- echo 'error_message: ' . $data->meta->error_message . "\n";
2017
- }
2018
- }
2019
- } else {
2020
- var_export( $result );
2021
- }
2022
-
2023
-
2024
- } else {
2025
- echo 'No Access Token';
2026
- }?>
2027
-
2028
- ## Invalid Tokens: ##
2029
- <?php
2030
- $sb_expired_tokens = get_option( 'sb_expired_tokens' );
2031
- if (is_array($sb_expired_tokens)){
2032
- $sb_expired_tokens = array_unique($sb_expired_tokens);
2033
- }
2034
- var_export($sb_expired_tokens);
2035
- ?>
2036
- </textarea>
2037
-
2038
- <?php
2039
- } //End Support tab
2040
- ?>
2041
-
2042
-
2043
- <div class="sbi_quickstart">
2044
- <h3><i class="fa fa-rocket" aria-hidden="true"></i>&nbsp; <?php _e('Display your feed', 'instagram-feed'); ?></h3>
2045
- <p><?php _e('Copy and paste this shortcode directly into the page, post or widget where you\'d like to display the feed:', 'instagram-feed'); ?> <input type="text" value="[instagram-feed]" size="15" readonly="readonly" style="text-align: center;" onclick="this.focus();this.select()" title="To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac)."></p>
2046
- <p><?php _e('Find out how to display <a href="?page=sb-instagram-feed&amp;tab=display">multiple feeds</a>.', 'instagram-feed'); ?></p>
2047
- </div>
2048
-
2049
- <a href="https://smashballoon.com/instagram-feed/demo/?utm_source=plugin-free&utm_campaign=sbi" target="_blank" class="sbi-pro-notice">
2050
- <img src="<?php echo plugins_url( 'img/instagram-pro-promo.png' , __FILE__ ) ?>" alt="<?php esc_attr_e( 'Instagram Feed Pro', 'instagram-feed' ); ?>">
2051
- </a>
2052
-
2053
- <p class="sbi_plugins_promo dashicons-before dashicons-admin-plugins"> <?php _e('Check out our other free plugins: <a href="https://wordpress.org/plugins/custom-facebook-feed/" target="_blank">Facebook</a> and <a href="https://wordpress.org/plugins/custom-twitter-feeds/" target="_blank">Twitter</a>.', 'instagram-feed' ); ?></p>
2054
-
2055
- <div class="sbi_share_plugin">
2056
- <h3><?php _e('Like the plugin? Help spread the word!', 'instagram-feed'); ?></h3>
2057
-
2058
- <!-- TWITTER -->
2059
- <a href="https://twitter.com/share" class="twitter-share-button" data-url="https://wordpress.org/plugins/instagram-feed/" data-text="Display beautifully clean, customizable, and responsive feeds from multiple Instagram accounts" data-via="smashballoon" data-dnt="true">Tweet</a>
2060
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
2061
- <style type="text/css">
2062
- #twitter-widget-0{ float: left; width: 100px !important; }
2063
- .IN-widget{ margin-right: 20px; }
2064
- </style>
2065
-
2066
- <!-- FACEBOOK -->
2067
- <div id="fb-root" style="display: none;"></div>
2068
- <script>(function(d, s, id) {
2069
- var js, fjs = d.getElementsByTagName(s)[0];
2070
- if (d.getElementById(id)) return;
2071
- js = d.createElement(s); js.id = id;
2072
- js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&appId=&version=v2.0";
2073
- fjs.parentNode.insertBefore(js, fjs);
2074
- }(document, 'script', 'facebook-jssdk'));</script>
2075
- <div class="fb-like" data-href="https://wordpress.org/plugins/instagram-feed/" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true" style="display: block; float: left; margin-right: 20px;"></div>
2076
-
2077
- <!-- LINKEDIN -->
2078
- <script src="//platform.linkedin.com/in.js" type="text/javascript">
2079
- lang: en_US
2080
- </script>
2081
- <script type="IN/Share" data-url="https://wordpress.org/plugins/instagram-feed/"></script>
2082
-
2083
- <!-- GOOGLE + -->
2084
- <script src="https://apis.google.com/js/platform.js" async defer></script>
2085
- <div class="g-plusone" data-size="medium" data-href="https://wordpress.org/plugins/instagram-feed/"></div>
2086
- </div>
2087
-
2088
- </div> <!-- end #sbi_admin -->
2089
-
2090
- <?php } //End Settings page
2091
-
2092
- function sb_instagram_admin_style() {
2093
- wp_register_style( 'sb_instagram_admin_css', plugins_url('css/sb-instagram-admin.css', __FILE__), array(), SBIVER );
2094
- wp_enqueue_style( 'sb_instagram_font_awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css' );
2095
- wp_enqueue_style( 'sb_instagram_admin_css' );
2096
- wp_enqueue_style( 'wp-color-picker' );
2097
- }
2098
- add_action( 'admin_enqueue_scripts', 'sb_instagram_admin_style' );
2099
-
2100
- function sb_instagram_admin_scripts() {
2101
- wp_enqueue_script( 'sb_instagram_admin_js', plugins_url( 'js/sb-instagram-admin.js' , __FILE__ ), array(), SBIVER );
2102
- wp_localize_script( 'sb_instagram_admin_js', 'sbiA', array(
2103
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
2104
- 'sbi_nonce' => wp_create_nonce( 'sbi-smash-balloon' )
2105
- )
2106
- );
2107
- if( !wp_script_is('jquery-ui-draggable') ) {
2108
- wp_enqueue_script(
2109
- array(
2110
- 'jquery',
2111
- 'jquery-ui-core',
2112
- 'jquery-ui-draggable'
2113
- )
2114
- );
2115
- }
2116
- wp_enqueue_script(
2117
- array(
2118
- 'hoverIntent',
2119
- 'wp-color-picker'
2120
- )
2121
- );
2122
- }
2123
- add_action( 'admin_enqueue_scripts', 'sb_instagram_admin_scripts' );
2124
-
2125
- // Add a Settings link to the plugin on the Plugins page
2126
- $sbi_plugin_file = 'instagram-feed/instagram-feed.php';
2127
- add_filter( "plugin_action_links_{$sbi_plugin_file}", 'sbi_add_settings_link', 10, 2 );
2128
-
2129
- //modify the link by unshifting the array
2130
- function sbi_add_settings_link( $links, $file ) {
2131
- $sbi_settings_link = '<a href="' . admin_url( 'admin.php?page=sb-instagram-feed' ) . '">' . __( 'Settings', 'instagram-feed' ) . '</a>';
2132
- array_unshift( $links, $sbi_settings_link );
2133
-
2134
- return $links;
2135
- }
2136
-
2137
-
2138
- //REVIEW REQUEST NOTICE
2139
-
2140
- // checks $_GET to see if the nag variable is set and what it's value is
2141
- function sbi_check_nag_get( $get, $nag, $option, $transient ) {
2142
- if ( isset( $_GET[$nag] ) && $get[$nag] == 1 ) {
2143
- update_option( $option, 'dismissed' );
2144
- } elseif ( isset( $_GET[$nag] ) && $get[$nag] == 'later' ) {
2145
- $time = 2 * WEEK_IN_SECONDS;
2146
- set_transient( $transient, 'waiting', $time );
2147
- update_option( $option, 'pending' );
2148
- }
2149
- }
2150
-
2151
- // will set a transient if the notice hasn't been dismissed or hasn't been set yet
2152
- function sbi_maybe_set_transient( $transient, $option ) {
2153
- $sbi_rating_notice_waiting = get_transient( $transient );
2154
- $notice_status = get_option( $option, false );
2155
-
2156
- if ( ! $sbi_rating_notice_waiting && !( $notice_status === 'dismissed' || $notice_status === 'pending' ) ) {
2157
- $time = 2 * WEEK_IN_SECONDS;
2158
- set_transient( $transient, 'waiting', $time );
2159
- update_option( $option, 'pending' );
2160
- }
2161
- }
2162
-
2163
- // generates the html for the admin notice
2164
- function sbi_rating_notice_html() {
2165
-
2166
- //Only show to admins
2167
- if ( current_user_can( 'manage_options' ) ){
2168
-
2169
- global $current_user;
2170
- $user_id = $current_user->ID;
2171
-
2172
- /* Check that the user hasn't already clicked to ignore the message */
2173
- if ( ! get_user_meta( $user_id, 'sbi_ignore_rating_notice') ) {
2174
-
2175
- _e("
2176
- <div class='sbi_notice sbi_review_notice'>
2177
- <img src='". plugins_url( 'instagram-feed/img/sbi-icon.png' ) ."' alt='Instagram Feed'>
2178
- <div class='ctf-notice-text'>
2179
- <p>It's great to see that you've been using the <strong>Instagram Feed</strong> plugin for a while now. Hopefully you're happy with it!&nbsp; If so, would you consider leaving a positive review? It really helps to support the plugin and helps others to discover it too!</p>
2180
- <p class='links'>
2181
- <a class='sbi_notice_dismiss' href='https://wordpress.org/support/plugin/instagram-feed/reviews/' target='_blank'>Sure, I'd love to!</a>
2182
- &middot;
2183
- <a class='sbi_notice_dismiss' href='" .esc_url( add_query_arg( 'sbi_ignore_rating_notice_nag', '1' ) ). "'>No thanks</a>
2184
- &middot;
2185
- <a class='sbi_notice_dismiss' href='" .esc_url( add_query_arg( 'sbi_ignore_rating_notice_nag', '1' ) ). "'>I've already given a review</a>
2186
- &middot;
2187
- <a class='sbi_notice_dismiss' href='" .esc_url( add_query_arg( 'sbi_ignore_rating_notice_nag', 'later' ) ). "'>Ask Me Later</a>
2188
- </p>
2189
- </div>
2190
- <a class='sbi_notice_close' href='" .esc_url( add_query_arg( 'sbi_ignore_rating_notice_nag', '1' ) ). "'><i class='fa fa-close'></i></a>
2191
- </div>
2192
- ");
2193
-
2194
- }
2195
-
2196
- }
2197
- }
2198
- function sb_instagram_clear_page_caches() {
2199
- if ( isset( $GLOBALS['wp_fastest_cache'] ) && method_exists( $GLOBALS['wp_fastest_cache'], 'deleteCache' ) ){
2200
- /* Clear WP fastest cache*/
2201
- $GLOBALS['wp_fastest_cache']->deleteCache();
2202
- }
2203
-
2204
- if ( function_exists( 'wp_cache_clear_cache' ) ) {
2205
- wp_cache_clear_cache();
2206
- }
2207
-
2208
- if ( class_exists('W3_Plugin_TotalCacheAdmin') ) {
2209
- $plugin_totalcacheadmin = & w3_instance('W3_Plugin_TotalCacheAdmin');
2210
-
2211
- $plugin_totalcacheadmin->flush_all();
2212
- }
2213
-
2214
- if ( function_exists( 'rocket_clean_domain' ) ) {
2215
- rocket_clean_domain();
2216
- }
2217
-
2218
- if ( class_exists( 'autoptimizeCache' ) ) {
2219
- /* Clear autoptimize */
2220
- autoptimizeCache::clearall();
2221
- }
2222
- }
2223
- /**
2224
- * Called via ajax to automatically save access token and access token secret
2225
- * retrieved with the big blue button
2226
- */
2227
- function sbi_auto_save_tokens() {
2228
- if ( current_user_can( 'edit_posts' ) ) {
2229
- wp_cache_delete ( 'alloptions', 'options' );
2230
-
2231
- $options = get_option( 'sb_instagram_settings', array() );
2232
- $new_access_token = isset( $_POST['access_token'] ) ? sanitize_text_field( $_POST['access_token'] ) : false;
2233
- $split_token = $new_access_token ? explode( '.', $new_access_token ) : array();
2234
- $new_user_id = isset( $split_token[0] ) ? $split_token[0] : '';
2235
-
2236
- $connected_accounts = isset( $options['connected_accounts'] ) ? $options['connected_accounts'] : array();
2237
- $test_connection_data = sbi_account_data_for_token( $new_access_token );
2238
-
2239
- $connected_accounts[ $new_user_id ] = array(
2240
- 'access_token' => sbi_get_parts( $new_access_token ),
2241
- 'user_id' => $test_connection_data['id'],
2242
- 'username' => $test_connection_data['username'],
2243
- 'is_valid' => $test_connection_data['is_valid'],
2244
- 'last_checked' => $test_connection_data['last_checked'],
2245
- 'profile_picture' => $test_connection_data['profile_picture']
2246
- );
2247
-
2248
- $options['connected_accounts'] = $connected_accounts;
2249
-
2250
- update_option( 'sb_instagram_settings', $options );
2251
-
2252
- echo json_encode( $connected_accounts[ $new_user_id ] );
2253
- }
2254
- die();
2255
- }
2256
- add_action( 'wp_ajax_sbi_auto_save_tokens', 'sbi_auto_save_tokens' );
2257
-
2258
- function sbi_auto_save_id() {
2259
- if ( current_user_can( 'edit_posts' ) && isset( $_POST['id'] ) ) {
2260
- $options = get_option( 'sb_instagram_settings', array() );
2261
-
2262
- $options['sb_instagram_user_id'] = array( sanitize_text_field( $_POST['id'] ) );
2263
-
2264
- update_option( 'sb_instagram_settings', $options );
2265
- }
2266
- die();
2267
- }
2268
- add_action( 'wp_ajax_sbi_auto_save_id', 'sbi_auto_save_id' );
2269
-
2270
- function sbi_test_token() {
2271
- $access_token = isset( $_POST['access_token'] ) ? sanitize_text_field( $_POST['access_token'] ) : false;
2272
- $options = get_option( 'sb_instagram_settings', array() );
2273
- $connected_accounts = isset( $options['connected_accounts'] ) ? $options['connected_accounts'] : array();
2274
-
2275
- if ( $access_token ) {
2276
- wp_cache_delete ( 'alloptions', 'options' );
2277
-
2278
- $split_token = explode( '.', $access_token );
2279
- $new_user_id = isset( $split_token[0] ) ? $split_token[0] : '';
2280
-
2281
- $test_connection_data = sbi_account_data_for_token( $access_token );
2282
-
2283
- if ( isset( $test_connection_data['error_message'] ) ) {
2284
- echo $test_connection_data['error_message'];
2285
- } elseif ( $test_connection_data !== false ) {
2286
- $username = $test_connection_data['username'] ? $test_connection_data['username'] : $connected_accounts[ $new_user_id ]['username'];
2287
- $user_id = $test_connection_data['id'] ? $test_connection_data['id'] : $connected_accounts[ $new_user_id ]['user_id'];
2288
- $profile_picture = $test_connection_data['profile_picture'] ? $test_connection_data['profile_picture'] : $connected_accounts[ $new_user_id ]['profile_picture'];
2289
-
2290
- $connected_accounts[ $new_user_id ] = array(
2291
- 'access_token' => sbi_get_parts( $access_token ),
2292
- 'user_id' => $user_id,
2293
- 'username' => $username,
2294
- 'is_valid' => $test_connection_data['is_valid'],
2295
- 'last_checked' => $test_connection_data['last_checked'],
2296
- 'profile_picture' => $profile_picture
2297
- );
2298
-
2299
- $options['connected_accounts'] = $connected_accounts;
2300
-
2301
- update_option( 'sb_instagram_settings', $options );
2302
-
2303
- $expired = get_option( 'sb_expired_tokens', array() );
2304
- $new_expired = array();
2305
- foreach ( $expired as $expired_token ) {
2306
- $split_token = explode( '.', $expired_token );
2307
- $old_user_id = isset( $split_token[0] ) ? $split_token[0] : '';
2308
- if ( $old_user_id !== $new_user_id ) {
2309
- $new_expired[] = $expired_token;
2310
- }
2311
- }
2312
- update_option( 'sb_expired_tokens', $new_expired );
2313
- //Delete all SBI transients
2314
- global $wpdb;
2315
- $table_name = $wpdb->prefix . "options";
2316
- $wpdb->query( "
2317
- DELETE
2318
- FROM $table_name
2319
- WHERE `option_name` LIKE ('%\_transient\_sbi\_%')
2320
- " );
2321
- $wpdb->query( "
2322
- DELETE
2323
- FROM $table_name
2324
- WHERE `option_name` LIKE ('%\_transient\_timeout\_sbi\_%')
2325
- " );
2326
- $wpdb->query( "
2327
- DELETE
2328
- FROM $table_name
2329
- WHERE `option_name` LIKE ('%\_transient\_&sbi\_%')
2330
- " );
2331
- $wpdb->query( "
2332
- DELETE
2333
- FROM $table_name
2334
- WHERE `option_name` LIKE ('%\_transient\_timeout\_&sbi\_%')
2335
- " );
2336
-
2337
- echo json_encode( $connected_accounts[ $new_user_id ] );
2338
- } else {
2339
- echo 'A successful connection could not be made. Please make sure your Access Token is valid.';
2340
- }
2341
-
2342
- }
2343
-
2344
- die();
2345
- }
2346
- add_action( 'wp_ajax_sbi_test_token', 'sbi_test_token' );
2347
-
2348
- //sbi_clear_backups
2349
- function sbi_clear_backups() {
2350
- $nonce = isset( $_POST['sbi_nonce'] ) ? sanitize_text_field( $_POST['sbi_nonce'] ) : '';
2351
-
2352
- if ( ! wp_verify_nonce( $nonce, 'sbi-smash-balloon' ) ) {
2353
- die ( 'You did not do this the right way!' );
2354
- }
2355
-
2356
- //Delete all transients
2357
- global $wpdb;
2358
- $table_name = $wpdb->prefix . "options";
2359
- $wpdb->query( "
2360
- DELETE
2361
- FROM $table_name
2362
- WHERE `option_name` LIKE ('%!sbi\_%')
2363
- " );
2364
- $wpdb->query( "
2365
- DELETE
2366
- FROM $table_name
2367
- WHERE `option_name` LIKE ('%\_transient\_&sbi\_%')
2368
- " );
2369
- $wpdb->query( "
2370
- DELETE
2371
- FROM $table_name
2372
- WHERE `option_name` LIKE ('%\_transient\_timeout\_&sbi\_%')
2373
- " );
2374
-
2375
- die();
2376
- }
2377
- add_action( 'wp_ajax_sbi_clear_backups', 'sbi_clear_backups' );
2378
-
2379
- function sbi_delete_account() {
2380
- $access_token = isset( $_POST['access_token'] ) ? sanitize_text_field( $_POST['access_token'] ) : false;
2381
- $options = get_option( 'sb_instagram_settings', array() );
2382
- $connected_accounts = isset( $options['connected_accounts'] ) ? $options['connected_accounts'] : array();
2383
-
2384
- if ( $access_token ) {
2385
- wp_cache_delete ( 'alloptions', 'options' );
2386
-
2387
- $split_token = explode( '.', $access_token );
2388
- $new_user_id = isset( $split_token[0] ) ? $split_token[0] : '';
2389
-
2390
- unset( $connected_accounts[ $new_user_id ] );
2391
-
2392
- $options['connected_accounts'] = $connected_accounts;
2393
-
2394
- update_option( 'sb_instagram_settings', $options );
2395
-
2396
- }
2397
-
2398
- die();
2399
- }
2400
- add_action( 'wp_ajax_sbi_delete_account', 'sbi_delete_account' );
2401
-
2402
- function sbi_account_data_for_token( $access_token ) {
2403
- $return = array(
2404
- 'id' => false,
2405
- 'username' => false,
2406
- 'is_valid' => false,
2407
- 'last_checked' => time()
2408
- );
2409
- $url = 'https://api.instagram.com/v1/users/self/?access_token=' . sbi_maybe_clean( $access_token );
2410
- $args = array(
2411
- 'timeout' => 60,
2412
- 'sslverify' => false
2413
- );
2414
- $result = wp_remote_get( $url, $args );
2415
-
2416
- if ( ! is_wp_error( $result ) ) {
2417
- $data = json_decode( $result['body'] );
2418
- } else {
2419
- $data = array();
2420
- }
2421
-
2422
- if ( isset( $data->data->id ) ) {
2423
- $return['id'] = $data->data->id;
2424
- $return['username'] = $data->data->username;
2425
- $return['is_valid'] = true;
2426
- $return['profile_picture'] = $data->data->profile_picture;
2427
-
2428
- } elseif ( isset( $data->error_type ) && $data->error_type === 'OAuthRateLimitException' ) {
2429
- $return['error_message'] = 'This account\'s access token is currently over the rate limit. Try removing this access token from all feeds and wait an hour before reconnecting.';
2430
- } else {
2431
- $return = false;
2432
-
2433
- }
2434
-
2435
- return $return;
2436
- }
2437
-
2438
- function sbi_get_connected_accounts_data( $sb_instagram_at ) {
2439
- $sbi_options = get_option( 'sb_instagram_settings' );
2440
- $return = array();
2441
- $return['connected_accounts'] = isset( $sbi_options['connected_accounts'] ) ? $sbi_options['connected_accounts'] : array();
2442
-
2443
- if ( empty( $connected_accounts ) && ! empty( $sb_instagram_at ) ) {
2444
- $tokens = explode(',', $sb_instagram_at );
2445
- $user_ids = array();
2446
-
2447
- foreach ( $tokens as $token ) {
2448
- $account = sbi_account_data_for_token( $token );
2449
- if ( isset( $account['is_valid'] ) ) {
2450
- $split = explode( '.', $token );
2451
- $return['connected_accounts'][ $split[0] ] = array(
2452
- 'access_token' => sbi_get_parts( $token ),
2453
- 'user_id' => $split[0],
2454
- 'username' => '',
2455
- 'is_valid' => true,
2456
- 'last_checked' => time(),
2457
- 'profile_picture' => ''
2458
- );
2459
- $user_ids[] = $split[0];
2460
- }
2461
-
2462
- }
2463
-
2464
- $sbi_options['connected_accounts'] = $return['connected_accounts'];
2465
- $sbi_options['sb_instagram_at'] = '';
2466
- $sbi_options['sb_instagram_user_id'] = $user_ids;
2467
-
2468
- $return['user_ids'] = $user_ids;
2469
-
2470
- update_option( 'sb_instagram_settings', $sbi_options );
2471
- delete_option( 'sb_expired_tokens' );
2472
- }
2473
-
2474
- return $return;
2475
- }
2476
-
2477
- function sbi_after_connection() {
2478
-
2479
- if ( isset( $_POST['access_token'] ) ) {
2480
- $access_token = sanitize_text_field( $_POST['access_token'] );
2481
- $account_info = sbi_account_data_for_token( $access_token );
2482
- echo json_encode( $account_info );
2483
- }
2484
-
2485
- die();
2486
- }
2487
- add_action( 'wp_ajax_sbi_after_connection', 'sbi_after_connection' );
2488
-
2489
- function sbi_process_admin_notices() {
2490
- // variables to define certain terms
2491
- $transient = 'instagram_feed_rating_notice_waiting';
2492
- $option = 'sbi_rating_notice';
2493
- $nag = 'sbi_ignore_rating_notice_nag';
2494
-
2495
- sbi_check_nag_get( $_GET, $nag, $option, $transient );
2496
- sbi_maybe_set_transient( $transient, $option );
2497
- $notice_status = get_option( $option, false );
2498
-
2499
- // only display the notice if the time offset has passed and the user hasn't already dismissed it
2500
- if ( get_transient( $transient ) !== 'waiting' && $notice_status !== 'dismissed' ) {
2501
- add_action( 'admin_notices', 'sbi_rating_notice_html' );
2502
- }
2503
- }
2504
- add_action( 'admin_init', 'sbi_process_admin_notices' );
2505
-