BlossomThemes Social Feed - Version 1.1.4

Version Description

  • Instagram Admin Notice Added
Download this release

Release Info

Developer blossomthemes
Plugin Icon 128x128 BlossomThemes Social Feed
Version 1.1.4
Comparing to
See all releases

Code changes from version 1.1.0 to 1.1.4

README.txt CHANGED
@@ -1,14 +1,14 @@
1
  === BlossomThemes Instagram Feed ===
2
  Contributors: blossomthemes
3
  Donate link: https://blossomthemes.com
4
- Tags: comments, spam
5
  Requires at least: 4.3
6
- Tested up to: 4.9
7
- Stable tag: 1.1.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Show instagram feed on your website using shortcode and widget.
12
 
13
  == Description ==
14
 
@@ -20,20 +20,24 @@ The plugin generates shortcode and widget. So, you can show your Instagram feed
20
 
21
  The plugin is very easy to use.
22
 
23
- Generating your Instagram Shortcode:
24
 
25
  Once activated, a menu named “BlossomThemes Instagram Feed” will be created on the WordPress dashboard.
26
 
27
- Go to BlossomThemes Instagram Feed. Then, on the General tab, enter your Instagram username, select number of photos to display (max. 20), select number of photos per row (max. 5 photos per row), select whether to enable or disable comments and likes and then click on “Save Changes”.
28
 
29
  Then, go to Usage tab, copy the shortcode and use it on your posts. As easy as that!
30
 
31
- Using Widget:
32
 
33
  The plugin will create a widget called “BlossomThemes: Instagram”. So, go to Appearance> Widgets on your Admin dashboard, select the BlossomThemes: Instagram widget and place it in the desired sidebar.
34
 
35
  If you do not enter the Instagram username in the widget, the username assigned on the main plugin page (on BlossomThemes Instagram Feed) will be used.
36
 
 
 
 
 
37
  == Installation ==
38
  **From your WordPress dashboard**
39
 
@@ -41,44 +45,19 @@ If you do not enter the Instagram username in the widget, the username assigned
41
  2. Search for 'BlossomThemes Instagram Feed' and install the plugin.
42
  3. Activate ‘BlossomThemes Instagram Feed’ from your Plugins page.
43
 
 
44
 
45
- == Changelog ==
46
-
47
- = 1.0.0 =
48
- * Initial release
49
-
50
- = 1.0.1 =
51
- * Compatibility tested
52
-
53
- = 1.0.2 =
54
- * Issue fixed
55
-
56
- = 1.0.3 =
57
- * No username issue fixed
58
 
59
- = 1.0.4 =
60
- * Function changed
61
-
62
- = 1.0.5 =
63
- * API updated
64
-
65
- = 1.0.6 =
66
- * API updated
67
-
68
- = 1.0.7 =
69
- * Notice Fixed
70
-
71
- = 1.0.8 =
72
- * Resource Minification
73
- * Image size load smaller
74
-
75
- = 1.0.9 =
76
- * Image size for shortcode
77
 
78
- = 1.1.0 =
79
- * Instagram widget follow text issue fixed
80
 
81
- == Upgrade Notice ==
 
82
 
83
  = 1.1.0 =
84
  * Instagram widget follow text issue fixed
@@ -112,4 +91,4 @@ If you do not enter the Instagram username in the widget, the username assigned
112
  * Compatibility tested
113
 
114
  = 1.0.0 =
115
- * Initial release
1
  === BlossomThemes Instagram Feed ===
2
  Contributors: blossomthemes
3
  Donate link: https://blossomthemes.com
4
+ Tags: instagram, popup, responsive, insta widget
5
  Requires at least: 4.3
6
+ Tested up to: 5.0.3
7
+ Stable tag: 1.1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Show Instagram Feed on your website using shortcode and widget.
12
 
13
  == Description ==
14
 
20
 
21
  The plugin is very easy to use.
22
 
23
+ = Generating your Instagram Shortcode =
24
 
25
  Once activated, a menu named “BlossomThemes Instagram Feed” will be created on the WordPress dashboard.
26
 
27
+ Go to BlossomThemes Instagram Feed. Then, on the General tab, click Connect with Instagram, copy and enter the Access Token, enter your Instagram username, select number of photos to display (max. 20), select number of photos per row (max. 5 photos per row), select whether to enable or disable comments and likes and then click on “Save Changes”.
28
 
29
  Then, go to Usage tab, copy the shortcode and use it on your posts. As easy as that!
30
 
31
+ = Using Widget =
32
 
33
  The plugin will create a widget called “BlossomThemes: Instagram”. So, go to Appearance> Widgets on your Admin dashboard, select the BlossomThemes: Instagram widget and place it in the desired sidebar.
34
 
35
  If you do not enter the Instagram username in the widget, the username assigned on the main plugin page (on BlossomThemes Instagram Feed) will be used.
36
 
37
+ = Video Link =
38
+
39
+ [How to authorize Instagram account for BlossomThemes Instagram Feed Plugin?](https://www.youtube.com/watch?v=U4tkwdtgkt0)
40
+
41
  == Installation ==
42
  **From your WordPress dashboard**
43
 
45
  2. Search for 'BlossomThemes Instagram Feed' and install the plugin.
46
  3. Activate ‘BlossomThemes Instagram Feed’ from your Plugins page.
47
 
48
+ == Screenshots ==
49
 
50
+ 1. General Tab Backend
51
+ 2. Usage Tab Backend
52
+ 3. BlossomThemes Instagram Widget
 
 
 
 
 
 
 
 
 
 
53
 
54
+ == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
+ = 1.1.4 =
57
+ * Instagram Admin Notice Added
58
 
59
+ = 1.1.3 =
60
+ * Instagram API integration
61
 
62
  = 1.1.0 =
63
  * Instagram widget follow text issue fixed
91
  * Compatibility tested
92
 
93
  = 1.0.0 =
94
+ * Minor design fixes and code clean-up
admin/class-blossomthemes-instagram-feed-admin.php CHANGED
@@ -116,7 +116,7 @@ class Blossomthemes_Instagram_Feed_Admin {
116
  */
117
  public function blossomthemes_instagram_feed_register_settings(){
118
  //The third parameter is a function that will validate input values.
119
- register_setting( 'blossomthemes_instagram_feed_settings', 'blossomthemes_instagram_feed_settings', '' );
120
  }
121
 
122
  /**
@@ -129,4 +129,64 @@ class Blossomthemes_Instagram_Feed_Admin {
129
  $blossom_themes_settings = new BlossomThemes_Instagram_Feed_Settings();
130
  $blossom_themes_settings->blossomthemes_instagram_feed_backend_settings();
131
  }
132
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  */
117
  public function blossomthemes_instagram_feed_register_settings(){
118
  //The third parameter is a function that will validate input values.
119
+ register_setting( 'blossomthemes_instagram_feed_settings', 'blossomthemes_instagram_feed_settings', array($this, 'sanitize') );
120
  }
121
 
122
  /**
129
  $blossom_themes_settings = new BlossomThemes_Instagram_Feed_Settings();
130
  $blossom_themes_settings->blossomthemes_instagram_feed_backend_settings();
131
  }
132
+
133
+ public function sanitize( $input ) {
134
+ $result = array();
135
+
136
+ $result['access-token'] = sanitize_text_field( $input['access-token'] );
137
+
138
+ $validation_result = Blossomthemes_Instagram_Feed_API::is_access_token_valid( $result['access-token'] );
139
+
140
+ if ( $validation_result !== true ) {
141
+ $access_token_error_message = __( 'Access Token rejected by Instagram API. Please add valid Access Token.', 'blossomthemes-instagram-feed' );
142
+
143
+ if ( is_wp_error( $validation_result ) ) {
144
+ $access_token_error_message = $validation_result->get_error_message();
145
+ }
146
+
147
+ if ( $validation_result !== true ) {
148
+ add_settings_error(
149
+ 'blossomthemes_instagram_feed_settings',
150
+ esc_attr( 'blossomthemes_instagram_feed_invalid_access_token' ),
151
+ $access_token_error_message,
152
+ 'error'
153
+ );
154
+ }
155
+
156
+ $input['access-token'] = '';
157
+ }
158
+
159
+ Blossomthemes_Instagram_Feed_API::reset_cache();
160
+
161
+ return $input;
162
+ }
163
+
164
+ function blossomthemes_instagram_feed_admin_notice(){
165
+ global $current_user ;
166
+ $user_id = $current_user->ID;
167
+ $meta = get_user_meta($user_id, 'blossomthemes_instagram_admin_notice');
168
+ $screen = get_current_screen();
169
+
170
+ /* Check that the user hasn't already clicked to ignore the message */
171
+ if ( !$meta && isset($screen->parent_file) && $screen->parent_file !='class-blossomthemes-instagram-feed-admin.php') {
172
+
173
+ echo '<div class="error notice is-dismissible" style="position:relative"><p>';
174
+
175
+ echo '<strong>'.'Please configure BlossomThemes Instagram Feed</strong><br /><br/> If you have just installed or updated this plugin, please go to the <strong><a href="admin.php?page=class-blossomthemes-instagram-feed-admin.php">Settings Page</a> and connect it with your Instagram account.</strong> You can ignore this message if you have already configured it. | '.'<strong><a href="' . esc_url( wp_nonce_url( add_query_arg( 'btif-dismiss', 'dismiss_admin_notices' ), 'confirm=0' ) ) .'" class="dismiss-notice" target="_parent">' . __( 'Dismiss this notice', 'blossomthemes-instagram-feed' ) . '</a></strong>';
176
+
177
+ echo "</p></div>";
178
+ }
179
+ }
180
+
181
+ function blossomthemes_instagram_feed_ignore_admin_notice() {
182
+ global $current_user;
183
+ $user_id = $current_user->ID;
184
+
185
+ /* If user clicks to ignore the notice, add that to their user meta */
186
+ if ( isset( $_GET['btif-dismiss'] ) && check_admin_referer( 'confirm=0' ) || ( Blossomthemes_Instagram_Feed_API::getInstance()->is_configured() ) ) {
187
+
188
+ update_user_meta($user_id, 'blossomthemes_instagram_admin_notice', 1);
189
+ }
190
+ }
191
+
192
+ }
admin/css/blossomthemes-instagram-feed-admin.css ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .btss-backend-sidebar {
2
+ display: inline-block;
3
+ float: right;
4
+ width: 20%
5
+ }
6
+
7
+ .btss-backend-sidebar .thumbnail {
8
+ padding: 12px;
9
+ line-height: 1.4em;
10
+ font-size: 13px;
11
+ border: 1px solid #e5e5e5;
12
+ box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
13
+ background: #fff;
14
+ margin-bottom: 20px
15
+ }
16
+
17
+ form.btif-settings-form {
18
+ background: #fff;
19
+ padding: 10px;
20
+ width: 78%;
21
+ float: left
22
+ }
23
+
24
+ .thumbnail-review {
25
+ background: #fff;
26
+ padding: 12px;
27
+ margin: 0
28
+ }
29
+
30
+ .btif-option-field-wrap label {
31
+ margin: 10px 15px 10px 0;
32
+ display: inline-block;
33
+ font-weight: 600
34
+ }
35
+
36
+ .btif-inner-wrap .nav-tab-active,
37
+ .btif-inner-wrap .nav-tab-active:focus,
38
+ .btif-inner-wrap .nav-tab-active:focus:active,
39
+ .btif-inner-wrap .nav-tab-active:hover {
40
+ border-bottom: 1px solid #fff;
41
+ background: #fff;
42
+ color: #000
43
+ }
44
+
45
+ .btif-inner-wrap {
46
+ background: #fff;
47
+ width: 77.5%;
48
+ float: left;
49
+ padding: 15px;
50
+ border: 1px solid #ddd
51
+ }
52
+
53
+ .blossomthemes-instagram-feed-settings {
54
+ display: none
55
+ }
56
+
57
+ .blossomthemes-instagram-feed-settings.general {
58
+ display: block
59
+ }
60
+
61
+ div#blossomthemes-instagram-feed-settings-usage .shortcode-usage {
62
+ width: 30%
63
+ }
64
+
65
+ .btif-option-field-wrap label {
66
+ width: 150px;
67
+ padding-right: 20px;
68
+ margin: 0;
69
+ }
70
+ .btif-option-field-wrap input[type="text"],
71
+ .btif-option-field-wrap input[type="number"],
72
+ .btif-option-field-wrap select {
73
+ width: 320px;
74
+ height: 35px;
75
+ box-shadow: none;
76
+ }
77
+
78
+ .btif-option-field-wrap {
79
+ margin-bottom: 25px;
80
+ }
81
+
82
+ p.btif-description {
83
+ margin-left: 175px;
84
+ font-style: italic;
85
+ }
86
+
87
+ .btif-settings-form .button-connect {
88
+ margin-bottom: 40px;
89
+ }
90
+
91
+ .btif-settings-form .blossomthemes-instagram-feed-settings-submit {
92
+ border-top: 1px solid rgba(0,0,0,0.1);
93
+ margin-top: 40px;
94
+ }
admin/css/blossomthemes-instagram-feed-admin.min.css CHANGED
@@ -1 +1 @@
1
- .btss-backend-sidebar{display:inline-block;float:right;width:20%}.btss-backend-sidebar .thumbnail{padding:12px;line-height:1.4em;font-size:13px;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;margin-bottom:20px}form.btif-settings-form{background:#fff;padding:10px;width:78%;float:left}.thumbnail-review{background:#fff;padding:12px;margin:0}.btif-option-field-wrap label{margin:10px 15px 10px 0;display:inline-block;font-weight:600}.btif-inner-wrap .nav-tab-active,.btif-inner-wrap .nav-tab-active:focus,.btif-inner-wrap .nav-tab-active:focus:active,.btif-inner-wrap .nav-tab-active:hover{border-bottom:1px solid #fff;background:#fff;color:#000}.btif-inner-wrap{background:#fff;width:77.5%;float:left;padding:15px;border:1px solid #ddd}.blossomthemes-instagram-feed-settings{display:none}.blossomthemes-instagram-feed-settings.general{display:block}div#blossomthemes-instagram-feed-settings-usage .shortcode-usage{width:30%}
1
+ .btss-backend-sidebar{display:inline-block;float:right;width:20%}.btss-backend-sidebar .thumbnail{padding:12px;line-height:1.4em;font-size:13px;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;margin-bottom:20px}form.btif-settings-form{background:#fff;padding:10px;width:78%;float:left}.thumbnail-review{background:#fff;padding:12px;margin:0}.btif-option-field-wrap label{margin:10px 15px 10px 0;display:inline-block;font-weight:600}.btif-inner-wrap .nav-tab-active,.btif-inner-wrap .nav-tab-active:focus,.btif-inner-wrap .nav-tab-active:focus:active,.btif-inner-wrap .nav-tab-active:hover{border-bottom:1px solid #fff;background:#fff;color:#000}.btif-inner-wrap{background:#fff;width:77.5%;float:left;padding:15px;border:1px solid #ddd}.blossomthemes-instagram-feed-settings{display:none}.blossomthemes-instagram-feed-settings.general{display:block}div#blossomthemes-instagram-feed-settings-usage .shortcode-usage{width:30%}.btif-option-field-wrap label{width:150px;padding-right:20px;margin:0}.btif-option-field-wrap input[type="text"],.btif-option-field-wrap input[type="number"],.btif-option-field-wrap select{width:320px;height:35px;box-shadow:none}.btif-option-field-wrap{margin-bottom:25px}p.btif-description{margin-left:175px;font-style:italic}.btif-settings-form .button-connect{margin-bottom:40px}.btif-settings-form .blossomthemes-instagram-feed-settings-submit{border-top:1px solid rgba(0,0,0,.1);margin-top:40px}
admin/css/images/logo.png ADDED
Binary file
admin/css/images/rara-logo.png DELETED
Binary file
blossomthemes-instagram-feed.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: BlossomThemes Instagram Feed
16
  * Plugin URI: https://wordpress.org/plugins/blossomthemes-instagram-feed
17
  * Description: Show instagram feed on your website using shortcode and widget.
18
- * Version: 1.1.0
19
  * Author: blossomthemes
20
  * Author URI: https://blossomthemes.com
21
  * License: GPL-2.0+
15
  * Plugin Name: BlossomThemes Instagram Feed
16
  * Plugin URI: https://wordpress.org/plugins/blossomthemes-instagram-feed
17
  * Description: Show instagram feed on your website using shortcode and widget.
18
+ * Version: 1.1.4
19
  * Author: blossomthemes
20
  * Author URI: https://blossomthemes.com
21
  * License: GPL-2.0+
includes/class-blossomthemes-instagram-feed-api.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Blossomthemes_Instagram_Feed_API {
4
+ /**
5
+ * @var Blossomthemes_Instagram_Feed_API The reference to *Singleton* instance of this class
6
+ */
7
+ private static $instance;
8
+
9
+ /**
10
+ * Instagram Access Token
11
+ *
12
+ * @var string
13
+ */
14
+ protected $access_token;
15
+
16
+ /**
17
+ * Returns the *Singleton* instance of this class.
18
+ *
19
+ * @return Blossomthemes_Instagram_Feed_API The *Singleton* instance.
20
+ */
21
+ public static function getInstance()
22
+ {
23
+ if ( null === self::$instance ) {
24
+ self::$instance = new self();
25
+ }
26
+ return self::$instance;
27
+ }
28
+
29
+ protected function __construct() {
30
+ $options = get_option( 'blossomthemes_instagram_feed_settings' );
31
+ $token = isset ( $options['access-token'] ) ? $options['access-token'] : '';
32
+ $this->access_token = $token;
33
+ }
34
+
35
+ /**
36
+ * @param $screen_name string Instagram username
37
+ * @param $image_limit int Number of images to retrieve
38
+ * @param $image_width int Desired image width to retrieve
39
+ *
40
+ * @return array|bool Array of tweets or false if method fails
41
+ */
42
+ public function get_items( $image_limit, $photo_size ) {
43
+
44
+ $transient = 'blossomthemes_instagram_is_configured';
45
+
46
+ if ( false !== ( $data = get_transient( $transient ) ) && is_object( $data ) && ! empty( $data->data ) ) {
47
+
48
+ return $this->processing_response_data( $data, $photo_size, $image_limit );
49
+ }
50
+
51
+ $api_image_limit = 30;
52
+ $response = wp_remote_get( sprintf( 'https://api.instagram.com/v1/users/self/media/recent/?access_token=%s&count=%s', $this->access_token, $api_image_limit ) );
53
+
54
+ if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
55
+ set_transient( $transient, false, MINUTE_IN_SECONDS );
56
+
57
+ return false;
58
+ }
59
+
60
+ $data = json_decode( wp_remote_retrieve_body( $response ) );
61
+
62
+ if ( ! empty( $data->data ) ) {
63
+ set_transient( $transient, $data, 30 * MINUTE_IN_SECONDS );
64
+ } else {
65
+ set_transient( $transient, false, MINUTE_IN_SECONDS );
66
+
67
+ return false;
68
+ }
69
+
70
+ return $this->processing_response_data( $data, $photo_size, $image_limit );
71
+ }
72
+
73
+ public function processing_response_data( $data, $photo_size, $image_limit ) {
74
+
75
+ $result = array();
76
+ $username = '';
77
+
78
+ $i = 0;
79
+ foreach ( $data->data as $key => $item ) {
80
+
81
+ if ( empty( $username ) ) {
82
+ $username = $item->user->username;
83
+ }
84
+
85
+ if ( $i < $image_limit ) {
86
+
87
+ $result[] = array(
88
+ 'link' => $item->link,
89
+ 'image-standard' => $item->images->standard_resolution->url,
90
+ 'image-url' => $item->images->$photo_size->url,
91
+ 'likes_count' => ! empty( $item->likes->count ) ? esc_attr( $item->likes->count ) : 0,
92
+ 'comments_count' => ! empty( $item->comments->count ) ? esc_attr( $item->comments->count ) : 0
93
+ );
94
+ }
95
+ $i++;
96
+ }
97
+
98
+ $result = array( 'items' => $result, 'username' => $username );
99
+
100
+ return $result;
101
+ }
102
+
103
+ /**
104
+ * Check if given access token is valid for Instagram Api.
105
+ */
106
+ public static function is_access_token_valid( $access_token ) {
107
+ $response = wp_remote_get( sprintf( 'https://api.instagram.com/v1/users/self/?access_token=%s', $access_token ) );
108
+
109
+ if ( is_wp_error( $response ) ) {
110
+ return $response;
111
+ }
112
+
113
+ if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
114
+ return false;
115
+ }
116
+
117
+ return true;
118
+ }
119
+
120
+ public function is_configured() {
121
+ $transient = 'blossomthemes_instagram_is_configured';
122
+
123
+ if ( false !== ( $result = get_transient( $transient ) ) ) {
124
+
125
+ if ( 'yes' === $result ) {
126
+ return true;
127
+ }
128
+
129
+ if ( 'no' === $result ) {
130
+ return false;
131
+ }
132
+ }
133
+
134
+ $condition = $this->is_access_token_valid( $this->access_token );
135
+
136
+ if ( true === $condition ) {
137
+ set_transient( $transient, 'yes', DAY_IN_SECONDS );
138
+
139
+ return true;
140
+ }
141
+
142
+ set_transient( $transient, 'no', DAY_IN_SECONDS );
143
+
144
+ return false;
145
+ }
146
+
147
+ public static function reset_cache() {
148
+ delete_transient( 'blossomthemes_instagram_is_configured' );
149
+ }
150
+
151
+ public function get_access_token() {
152
+ return $this->access_token;
153
+ }
154
+
155
+ public function set_access_token( $access_token ) {
156
+ $this->access_token = $access_token;
157
+ }
158
+
159
+ }
includes/class-blossomthemes-instagram-feed-settings.php CHANGED
@@ -12,16 +12,13 @@ class BlossomThemes_Instagram_Feed_Settings
12
  {
13
  function blossomthemes_instagram_feed_backend_settings()
14
  {
15
-
 
16
  ?>
17
- <div class="wrap btif-wrap">
18
- <?php if (isset($_GET['settings-updated']) && esc_attr($_GET['settings-updated']) == 'true'){ ?>
19
- <div id="setting-error-settings_updated" class="updated settings-error notice is-dismissible">
20
- <p><strong><?php _e('Settings updated.','blossomthemes-instagram-feed');?></strong></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php _e('Dismiss this notice.','blossomthemes-instagram-feed');?></span></button>
21
- </div>
22
- <?php } ?>
23
  <div class="btif-header">
24
- <h3><?php _e( 'BlossomThemes Instagram Feed', 'blossomthemes-notification-bars' ); ?></h3>
25
  </div>
26
  <div class="btif-inner-wrap">
27
  <h2 class="nav-tab-wrapper">
@@ -31,13 +28,59 @@ class BlossomThemes_Instagram_Feed_Settings
31
  <form method="post" action="options.php" class="btif-settings-form">
32
  <?php
33
  $options = get_option( 'blossomthemes_instagram_feed_settings', true );
34
- $size = isset( $options['photo_size'] ) ? esc_attr( $options['photo_size'] ):'img_thumb';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  ?>
36
  <div class="blossomthemes-instagram-feed-settings general" id="blossomthemes-instagram-feed-settings-general">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  <div class="btif-option-field-wrap">
38
  <label for="blossomthemes_instagram_feed_settings[username]"><?php _e('Username', 'blossomthemes-instagram-feed'); ?></label>
39
  <input id="blossomthemes_instagram_feed_settings[username]" name="blossomthemes_instagram_feed_settings[username]" type="text" value="<?php echo isset( $options['username'] ) ? esc_attr( $options['username'] ):''; ?>">
40
  </div>
 
41
  <div class="btif-option-field-wrap">
42
  <label for="blossomthemes_instagram_feed_settings[photos]"><?php _e('Number of Photos', 'blossomthemes-instagram-feed'); ?></label>
43
  <input min="1" max="20" id="blossomthemes_instagram_feed_settings[photos]" name="blossomthemes_instagram_feed_settings[photos]" type="number" value="<?php echo isset( $options['photos'] ) ? esc_attr( $options['photos'] ):'10'; ?>">
@@ -45,11 +88,15 @@ class BlossomThemes_Instagram_Feed_Settings
45
  <div class="btif-option-field-wrap">
46
  <label for="blossomthemes_instagram_feed_settings[photo_size]"><?php esc_html_e( 'Photo size', 'blossomthemes-instagram-feed' ); ?></label>
47
  <select id="blossomthemes_instagram_feed_settings[photo_size]" name="blossomthemes_instagram_feed_settings[photo_size]">
48
- <option value="img_thumb" <?php selected( 'img_thumb', $size ) ?>><?php esc_html_e( 'Thumbnail', 'blossomthemes-instagram-feed' ); ?></option>
49
- <option value="img_low" <?php selected( 'img_low', $size ) ?>><?php esc_html_e( 'Small', 'blossomthemes-instagram-feed' ); ?></option>
50
- <option value="img_standard" <?php selected( 'img_standard', $size ) ?>><?php esc_html_e( 'Large', 'blossomthemes-instagram-feed' ); ?></option>
51
  </select>
52
  </div>
 
 
 
 
53
  <div class="btif-option-field-wrap">
54
  <label for="blossomthemes_instagram_feed_settings[follow_me]"><?php _e('Profile Link Text', 'blossomthemes-instagram-feed'); ?></label>
55
  <input id="blossomthemes_instagram_feed_settings[follow_me]" name="blossomthemes_instagram_feed_settings[follow_me]" type="text" value="<?php echo isset( $options['follow_me'] ) ? esc_attr( $options['follow_me'] ):'Follow Me!'; ?>">
@@ -71,8 +118,8 @@ class BlossomThemes_Instagram_Feed_Settings
71
  <div class="wp-tm--option-wrapper">
72
  <div class="wp-tm-option-field">
73
  <label class="wp-tm-plain-label">
74
- <div class="tm-option-side-note"> <?php _e('Copy this Shortcode to display your instagram gallery in pages/posts => ') ?><br>
75
- <input type="text" readonly="readonly" class="shortcode-usage" value="[blossomthemes_instagram_feed]" >
76
  </div>
77
  </label>
78
  </div>
@@ -81,8 +128,8 @@ class BlossomThemes_Instagram_Feed_Settings
81
  <div class="wp-tm--option-wrapper">
82
  <div class="wp-tm-option-field">
83
  <label class="wp-tm-plain-label">
84
- <div class="tm-option-side-note"> <?php _e('Copy the PHP Function below to display your instagram gallery in templates :') ?> <br>
85
- <textarea rows="2" cols="50" name="shortcode-function" readonly="readonly">&lt;?php echo do_shortcode("[blossomthemes_instagram_feed]"); ?&gt; </textarea>
86
  </div>
87
  </label>
88
 
12
  {
13
  function blossomthemes_instagram_feed_backend_settings()
14
  {
15
+ $oauth_url = 'https://instagram.com/oauth/authorize/?client_id=8dc488eba3d54eb9806eb27eabb8cd03&response_type=token&redirect_uri=https://blossomthemes.com/instagram/';
16
+ // $oauth_url = 'https://instagram.com/oauth/authorize/?client_id=291228964f8746a9933b6a51c6dcb750&response_type=token&redirect_uri=http://localhost/blossom/wordpress/blossom-insta-check/';
17
  ?>
18
+ <div class="btif-wrap">
19
+ <?php settings_errors(); ?>
 
 
 
 
20
  <div class="btif-header">
21
+ <h3><?php _e( 'BlossomThemes Instagram Feed', 'blossomthemes-instagram-feed' ); ?></h3>
22
  </div>
23
  <div class="btif-inner-wrap">
24
  <h2 class="nav-tab-wrapper">
28
  <form method="post" action="options.php" class="btif-settings-form">
29
  <?php
30
  $options = get_option( 'blossomthemes_instagram_feed_settings', true );
31
+ $size = isset( $options['photo_size'] ) ? esc_attr( $options['photo_size'] ):'low_resolution';
32
+ $sizes = array(
33
+ 'img_thumb' => 'thumbnail',
34
+ 'img_low' => 'low_resolution',
35
+ 'img_standard' => 'standard_resolution'
36
+ );
37
+
38
+ if ( array_key_exists( $size, $sizes ) )
39
+ {
40
+ foreach ( $sizes as $key => $value )
41
+ {
42
+ if($size == $key)
43
+ $size = $value;
44
+ }
45
+ }
46
  ?>
47
  <div class="blossomthemes-instagram-feed-settings general" id="blossomthemes-instagram-feed-settings-general">
48
+
49
+ <div class="btif-option-field-wrap">
50
+
51
+ <h2><?php _e('Connect with Instagram', 'blossomthemes-instagram-feed'); ?></h2>
52
+
53
+ <p><?php _e( 'To get started click the button below. You’ll be prompted to authorize BlossomThemes Instagram Feed to access your Instagram photos.', 'blossomthemes-instagram-feed' ); ?></p>
54
+
55
+ <p class="description"><?php _e( 'Due to recent Instagram API changes it is no longer possible to display photos from a different Instagram account than yours. The widget will automatically display the latest photos of the account which was authorized on this page.', 'blossomthemes-instagram-feed' ); ?></p>
56
+
57
+ <br />
58
+
59
+
60
+ <a class="button button-connect" target="_blank" href="<?php echo esc_url( $oauth_url ); ?>">
61
+ <?php if ( ! Blossomthemes_Instagram_Feed_API::getInstance()->is_configured() ) : ?>
62
+ <span><?php _e( 'Connect with Instagram', 'blossomthemes-instagram-feed' ); ?></span>
63
+ <?php else: ?>
64
+ <span class="btif-instagarm-connected"><?php _e( 'Re-connect with Instagram', 'blossomthemes-instagram-feed' ); ?></span>
65
+ <?php endif; ?>
66
+ </a>
67
+
68
+ <p><label for="blossomthemes_instagram_feed_settings[access-token]"><?php _e('Access Token', 'blossomthemes-instagram-feed'); ?></label>
69
+ <input class="" id="blossomthemes_instagram_feed_settings[access-token]" name="blossomthemes_instagram_feed_settings[access-token]" type="text" value="<?php echo isset( $options['access-token'] ) ? esc_attr( $options['access-token'] ):''; ?>"></p>
70
+
71
+ <p class="btif-description">
72
+ <?php
73
+ _e('Access Token is used as key to access your photos from Instagram so they can be displayed.', 'blossomthemes-instagram-feed');
74
+ ?>
75
+ </p>
76
+
77
+ </div>
78
+
79
  <div class="btif-option-field-wrap">
80
  <label for="blossomthemes_instagram_feed_settings[username]"><?php _e('Username', 'blossomthemes-instagram-feed'); ?></label>
81
  <input id="blossomthemes_instagram_feed_settings[username]" name="blossomthemes_instagram_feed_settings[username]" type="text" value="<?php echo isset( $options['username'] ) ? esc_attr( $options['username'] ):''; ?>">
82
  </div>
83
+
84
  <div class="btif-option-field-wrap">
85
  <label for="blossomthemes_instagram_feed_settings[photos]"><?php _e('Number of Photos', 'blossomthemes-instagram-feed'); ?></label>
86
  <input min="1" max="20" id="blossomthemes_instagram_feed_settings[photos]" name="blossomthemes_instagram_feed_settings[photos]" type="number" value="<?php echo isset( $options['photos'] ) ? esc_attr( $options['photos'] ):'10'; ?>">
88
  <div class="btif-option-field-wrap">
89
  <label for="blossomthemes_instagram_feed_settings[photo_size]"><?php esc_html_e( 'Photo size', 'blossomthemes-instagram-feed' ); ?></label>
90
  <select id="blossomthemes_instagram_feed_settings[photo_size]" name="blossomthemes_instagram_feed_settings[photo_size]">
91
+ <option value="thumbnail" <?php selected( 'thumbnail', $size ) ?>><?php esc_html_e( 'Thumbnail', 'blossomthemes-instagram-feed' ); ?></option>
92
+ <option value="low_resolution" <?php selected( 'low_resolution', $size ) ?>><?php esc_html_e( 'Small', 'blossomthemes-instagram-feed' ); ?></option>
93
+ <option value="standard_resolution" <?php selected( 'standard_resolution', $size ) ?>><?php esc_html_e( 'Large', 'blossomthemes-instagram-feed' ); ?></option>
94
  </select>
95
  </div>
96
+ <div class="btif-option-field-wrap">
97
+ <label for="blossomthemes_instagram_feed_settings[photos_row]"><?php _e('Photos Per Row', 'blossomthemes-instagram-feed'); ?></label>
98
+ <input min="1" max="20" id="blossomthemes_instagram_feed_settings[photos_row]" name="blossomthemes_instagram_feed_settings[photos_row]" type="number" value="<?php echo isset( $options['photos_row'] ) ? esc_attr( $options['photos_row'] ):'5'; ?>">
99
+ </div>
100
  <div class="btif-option-field-wrap">
101
  <label for="blossomthemes_instagram_feed_settings[follow_me]"><?php _e('Profile Link Text', 'blossomthemes-instagram-feed'); ?></label>
102
  <input id="blossomthemes_instagram_feed_settings[follow_me]" name="blossomthemes_instagram_feed_settings[follow_me]" type="text" value="<?php echo isset( $options['follow_me'] ) ? esc_attr( $options['follow_me'] ):'Follow Me!'; ?>">
118
  <div class="wp-tm--option-wrapper">
119
  <div class="wp-tm-option-field">
120
  <label class="wp-tm-plain-label">
121
+ <div class="tm-option-side-note"> <?php _e('Copy this Shortcode to display your instagram gallery in pages/posts => ', 'blossomthemes-instagram-feed') ?><br>
122
+ <input type="text" readonly="readonly" class="shortcode-usage" value="[blossomthemes_instagram_feed]" onClick="this.setSelectionRange(0, this.value.length)">
123
  </div>
124
  </label>
125
  </div>
128
  <div class="wp-tm--option-wrapper">
129
  <div class="wp-tm-option-field">
130
  <label class="wp-tm-plain-label">
131
+ <div class="tm-option-side-note"> <?php _e('Copy the PHP Function below to display your instagram gallery in templates :', 'blossomthemes-instagram-feed') ?> <br>
132
+ <textarea rows="2" cols="50" name="shortcode-function" readonly="readonly" onClick="this.setSelectionRange(0, this.value.length)">&lt;?php echo do_shortcode("[blossomthemes_instagram_feed]"); ?&gt; </textarea>
133
  </div>
134
  </label>
135
 
includes/class-blossomthemes-instagram-feed-shortcodes.php CHANGED
@@ -15,68 +15,90 @@ class BlossomThemes_Instagram_Feed_Shortcodes
15
 
16
  function blossomthemes_instagram_feed_sc(){
17
  ob_start();
18
- $options = get_option( 'blossomthemes_instagram_feed_settings', true );
19
-
20
- if( !isset( $options['username'] ) || $options['username'] == '' )
21
- {
22
- return;
23
- }
24
 
25
- $obj = new InstagramSpider;
26
- $photos = absint($options['photos']);
27
- $photo_size = isset( $options['photo_size'] ) ? esc_attr( $options['photo_size'] ) :'img_thumb';
28
  $photos_row = isset( $options['photos_row'] ) ? esc_attr( $options['photos_row'] ) :'5';
29
  $instaUrl = 'https://www.instagram.com/';
30
  $instaUrl .= $options['username'];
31
-
32
- $instaItems = $obj->getUserItems($options['username']);
33
  $profile_link_text = isset( $options['follow_me'] ) ? esc_attr( $options['follow_me'] ):'Follow Me!';
34
- echo '<ul class="popup-gallery photos-'.$photos_row.'">';
35
- $i=0;
36
- if($instaItems)
37
- {
38
- foreach ($instaItems as $key) {
39
- if( $i<$photos )
40
- {
41
- echo '<li><a href="'.esc_url($key['img_standard']).'"><img src="'.esc_url($key[$photo_size]).'"></a>';
42
- if( isset( $options['meta'] ) )
43
- {
44
- echo '<div class="instagram-meta"><span class="like"><i class="fa fa-heart"></i>'.$key['likes'].'</span>'.'<span class="comment"><i class="fa fa-comment"></i>'.$key['comments'].'</span>'.'</div>';
45
- }
46
- echo '</li>';
47
- }
48
- $i++;
49
- }
50
- echo '</ul>';
51
- echo
52
- '<script>
53
- jQuery(document).ready(function($){
54
- $(".popup-gallery").magnificPopup({
55
- delegate: "a",
56
- type: "image",
57
- gallery:{
58
- enabled:true
59
- }
60
- });
61
 
62
- $(".popup-modal").magnificPopup({
63
- type: "inline",
64
- preloader: false,
65
- focus: "#username",
66
- modal: true
67
- });
68
- $(document).on("click", ".popup-modal-dismiss", function (e) {
69
- e.preventDefault();
70
- $.magnificPopup.close();
71
- });
72
- });
73
- </script>';
74
- echo '<span class="insta-icon"><i class="fab fa-instagram"></i></span>'.' <a class="profile-link" href="'.esc_url($instaUrl).'" target="_blank">'.esc_attr($profile_link_text).'</a>';
75
- $output = ob_get_clean();
76
- return $output;
77
- }
78
- else{
79
- echo '<b style="color:red;">'.__('Invalid or Private Username Used!','blossomthemes-instagram-feed').'</b>';
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
  }
15
 
16
  function blossomthemes_instagram_feed_sc(){
17
  ob_start();
 
 
 
 
 
 
18
 
19
+ $options = get_option( 'blossomthemes_instagram_feed_settings', true );
20
+ $photos = absint($options['photos']);
21
+ $photo_size = isset( $options['photo_size'] ) ? esc_attr( $options['photo_size'] ) :'low_resolution';
22
  $photos_row = isset( $options['photos_row'] ) ? esc_attr( $options['photos_row'] ) :'5';
23
  $instaUrl = 'https://www.instagram.com/';
24
  $instaUrl .= $options['username'];
 
 
25
  $profile_link_text = isset( $options['follow_me'] ) ? esc_attr( $options['follow_me'] ):'Follow Me!';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
+ if ( Blossomthemes_Instagram_Feed_API::getInstance()->is_configured() ) :
28
+
29
+ $this->api = Blossomthemes_Instagram_Feed_API::getInstance();
30
+
31
+ $items = $this->api->get_items( $photos, $photo_size );
32
+
33
+ if ( ! is_array( $items ) ) {
34
+ echo '<b style="color:red;">'.__('No posts available!','blossomthemes-instagram-feed').'</b>';
35
+ } else {
36
+
37
+ $count = 0;
38
+ ?>
39
+ <ul class="popup-gallery photos-<?php echo $photos_row;?>">
40
+
41
+ <?php foreach ( $items['items'] as $item ) : ?>
42
+ <?php
43
+ $link = $item['link'];
44
+ $img_standard = $item['image-standard'];
45
+ $src = $item['image-url'];
46
+ $likes = $item['likes_count'];
47
+ $comments = $item['comments_count'];
48
+ ?>
49
+
50
+ <li>
51
+
52
+ <a href="<?php echo esc_url($img_standard); ?>">
53
+ <img src="<?php echo esc_url($src); ?>">
54
+ </a>
55
+ <?php if( isset( $options['meta'] ) )
56
+ {
57
+ echo '<div class="instagram-meta"><span class="like"><i class="fa fa-heart"></i>'.$likes.'</span>'.'<span class="comment"><i class="fa fa-comment"></i>'.$comments.'</span>'.'</div>';
58
+ }?>
59
+ </li>
60
+
61
+ <?php if ( ++$count === $photos ) break; ?>
62
+
63
+ <?php endforeach; ?>
64
+
65
+ </ul>
66
+ <?php echo
67
+ '<script>
68
+ jQuery(document).ready(function($){
69
+ $(".popup-gallery").magnificPopup({
70
+ delegate: "a",
71
+ type: "image",
72
+ gallery:{
73
+ enabled:true
74
+ }
75
+ });
76
+
77
+ $(".popup-modal").magnificPopup({
78
+ type: "inline",
79
+ preloader: false,
80
+ focus: "#username",
81
+ modal: true
82
+ });
83
+ $(document).on("click", ".popup-modal-dismiss", function (e) {
84
+ e.preventDefault();
85
+ $.magnificPopup.close();
86
+ });
87
+ });
88
+ </script>';
89
+ echo ' <a class="profile-link" href="'.esc_url($instaUrl).'" target="_blank"><span class="insta-icon"><i class="fab fa-instagram"></i></span>'.esc_attr($profile_link_text).'</a>';
90
+ }
91
+ else:
92
+ if ( current_user_can( 'edit_theme_options' ) ) {
93
+ ?>
94
+ <p>
95
+ <?php _e( 'BlossomThemes Instagram Feed misconfigured, check plugin &amp; widget settings.', 'blossomthemes-instagram-feed' ); ?>
96
+ </p>
97
+ <?php
98
+ }
99
+ endif;
100
+ $output = ob_get_contents();
101
+ ob_end_clean();
102
+ return $output;
103
  }
104
  }
includes/class-blossomthemes-instagram-feed.php CHANGED
@@ -135,12 +135,12 @@ class Blossomthemes_Instagram_Feed {
135
  /**
136
  * The class responsible for defining all actions in the settings page
137
  */
138
- require_once BTIF_BASE_PATH . '/includes/vendor/InstagramSpider.php';
139
 
140
  /**
141
- * The class responsible for defining all actions in the settings page
142
  */
143
- require_once BTIF_BASE_PATH . '/includes/widgets/widget-blossomthemes-instagram-feed.php';
144
 
145
 
146
  $this->loader = new Blossomthemes_Instagram_Feed_Loader();
@@ -179,6 +179,8 @@ class Blossomthemes_Instagram_Feed {
179
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
180
  $this->loader->add_action( 'admin_menu', $plugin_admin, 'blossomthemes_instagram_feed_settings_page' );
181
  $this->loader->add_action( 'admin_init', $plugin_admin, 'blossomthemes_instagram_feed_register_settings' );
 
 
182
 
183
  }
184
 
135
  /**
136
  * The class responsible for defining all actions in the settings page
137
  */
138
+ require_once BTIF_BASE_PATH . '/includes/widgets/widget-blossomthemes-instagram-feed.php';
139
 
140
  /**
141
+ * The class responsible for defining shortcode for the plugin
142
  */
143
+ require_once BTIF_BASE_PATH . '/includes/class-blossomthemes-instagram-feed-api.php';
144
 
145
 
146
  $this->loader = new Blossomthemes_Instagram_Feed_Loader();
179
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
180
  $this->loader->add_action( 'admin_menu', $plugin_admin, 'blossomthemes_instagram_feed_settings_page' );
181
  $this->loader->add_action( 'admin_init', $plugin_admin, 'blossomthemes_instagram_feed_register_settings' );
182
+ $this->loader->add_action('admin_notices', $plugin_admin, 'blossomthemes_instagram_feed_admin_notice');
183
+ $this->loader->add_action('admin_init', $plugin_admin, 'blossomthemes_instagram_feed_ignore_admin_notice');
184
 
185
  }
186
 
includes/template/backend/sidebar.php CHANGED
@@ -1,13 +1,12 @@
1
  <div class="btss-backend-sidebar">
2
  <div class="thumbnail">
3
- <h4><?php _e('More WordPress Themes and Plugins?', 'blossomthemes-instagram-feeds');?></h4>
4
- <div class="support-thumb"><img src="<?php echo esc_url(BTIF_FILE_URL) ?>\admin\css\images\rara-logo.png" style="
5
- max-width: 100%;"></div>
6
- <p class="text-justify"><?php _e('Visit us at: ','blossomthemes-instagram-feeds'); ?></p>
7
- <p class="text-center"><a href="https://raratheme.com" target="_blank" class="button button-primary"><?php _e( 'Rara Theme', 'blossomthemes-instagram-feeds' ); ?></a></p>
8
  </div>
9
  <div class="thumbnail-review">
10
- <p class="text-justify"><?php _e("Please fill free to leave us a review, if you found this plugin helpful.","blossomthemes-instagram-feeds");?></p>
11
- <p class="text-center"><a href="https://wordpress.org/support/plugin/blossomthemes-instagram-feed/reviews" target="_blank" class="button button-primary"><?php _e( 'Leave a Review', 'blossomthemes-instagram-feeds' ); ?></a></p>
12
  </div>
13
  </div>
1
  <div class="btss-backend-sidebar">
2
  <div class="thumbnail">
3
+ <h4><?php _e('More WordPress Themes and Plugins?', 'blossomthemes-instagram-feed');?></h4>
4
+ <div class="support-thumb"><img src="<?php echo esc_url(BTIF_FILE_URL) ?>\admin\css\images\logo.png" style="max-width: 100%;"></div>
5
+ <p class="text-justify"><?php _e('Visit us at: ','blossomthemes-instagram-feed'); ?></p>
6
+ <p class="text-center"><a href="https://blossomthemes.com" target="_blank" class="button button-primary"><?php _e( 'Blossom Themes', 'blossomthemes-instagram-feed' ); ?></a></p>
 
7
  </div>
8
  <div class="thumbnail-review">
9
+ <p class="text-justify"><?php _e("Please fill free to leave us a review, if you found this plugin helpful.","blossomthemes-instagram-feed");?></p>
10
+ <p class="text-center"><a href="https://wordpress.org/support/plugin/blossomthemes-instagram-feed/reviews" target="_blank" class="button button-primary"><?php _e( 'Leave a Review', 'blossomthemes-instagram-feed' ); ?></a></p>
11
  </div>
12
  </div>
includes/vendor/InstagramSpider.php DELETED
@@ -1,248 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Instagram Spider [MOD : WP - Insta Gallery]
5
- * @author Karan Singh
6
- * @version 1.3.8
7
- * @depends RUSpider
8
- * @description script to get instagram media by using Username and Tag-name. added WP (wp_remote_request) to run in WP.
9
- */
10
-
11
- // loading dependencies
12
- class InstagramSpider
13
- {
14
-
15
- protected $instagram;
16
-
17
- // handle raw result from server, for further processing in your app
18
- public $instagramResult;
19
-
20
- public $messages;
21
-
22
- public function __construct()
23
- {
24
- $this->instagram = 'https://www.instagram.com/';
25
- $this->messages = array();
26
- }
27
-
28
- /**
29
- * takes username and return items list array
30
- *
31
- * @param string $username
32
- * @return array|false
33
- */
34
- public function getUserItems($username = '')
35
- {
36
- $username = urlencode((string) $username); // non-english string support
37
- if (empty($username)) {
38
- $this->messages[] = 'Please provide a valid username';
39
- return false;
40
- }
41
-
42
- // $inURL = $this->instagram . $username . '/media/';
43
- $inURL = $this->instagram . $username . '/?__a=1';
44
- // For next 12 images, use ID of the last item (maxId = media.nodes[11].id) in the max_id param: /{USER_NAME}/?__a=1&max_id={maxId}
45
- $instaRes = $this->igSpider($inURL);
46
- $instaRes = @json_decode($instaRes);
47
-
48
- $items = array();
49
-
50
- // new API update Mar1418
51
- if (isset($instaRes->graphql->user->edge_owner_to_timeline_media->edges)) {
52
- $instaItems = $instaRes->graphql->user->edge_owner_to_timeline_media->edges;
53
- if (! empty($instaItems) && is_array($instaItems)) {
54
- foreach ($instaItems as $res) {
55
-
56
- if (! isset($res->node->display_url)) {
57
- continue;
58
- }
59
-
60
- $type = 'image';
61
- if (isset($res->node->is_video) && (true === $res->node->is_video)) {
62
- $type = 'video';
63
- }
64
-
65
- $items[] = array(
66
- 'img_standard' => $res->node->display_url,
67
- 'img_low' => $res->node->thumbnail_src,
68
- 'img_thumb' => $res->node->thumbnail_resources[0]->src,
69
- 'likes' => $res->node->edge_liked_by->count,
70
- 'comments' => $res->node->edge_media_to_comment->count,
71
- 'caption' => '',
72
- 'code' => $res->node->shortcode,
73
- 'type' => $type
74
- );
75
- }
76
- }
77
- }
78
-
79
- // if empty, continus with the HTML API
80
- if (empty($items)) {
81
- $inURL = $this->instagram . $username . '/';
82
- $items = $this->getFromHtmlAPI($inURL);
83
- }
84
-
85
- return empty($items) ? false : $items;
86
- }
87
-
88
- /**
89
- * takes #Tag name and return items list array
90
- *
91
- * @param string $tag
92
- * @param
93
- * boolean get top posts (10 posts)
94
- * @return array|false
95
- */
96
- public function getTagItems($tag = '', $getTopItems = false)
97
- {
98
- $tag = urlencode((string) $tag);
99
- if (empty($tag)) {
100
- $this->messages[] = 'Please provide a valid # tag';
101
- return false;
102
- }
103
- $inURL = $this->instagram . 'explore/tags/' . $tag . '/?__a=1';
104
- $instaRes = $this->igSpider($inURL);
105
- $instaRes = json_decode($instaRes);
106
-
107
- $items = array();
108
- // continue to next API : API updated on Jan 03 17
109
- if (isset($instaRes->graphql->hashtag->edge_hashtag_to_media->edges)) {
110
- $instaItems = $instaRes->graphql->hashtag->edge_hashtag_to_media->edges;
111
-
112
- // get top posts
113
- if ($getTopItems && isset($instaRes->graphql->hashtag->edge_hashtag_to_top_posts->edges)) {
114
- $instaItems = $instaRes->graphql->hashtag->edge_hashtag_to_top_posts->edges;
115
- }
116
-
117
- if (! empty($instaItems) && is_array($instaItems)) {
118
- foreach ($instaItems as $res) {
119
-
120
- if (! isset($res->node->display_url)) {
121
- continue;
122
- }
123
-
124
- $type = 'image';
125
- if (isset($res->node->is_video) && (true === $res->node->is_video)) {
126
- $type = 'video';
127
- }
128
-
129
- $items[] = array(
130
- 'img_standard' => $res->node->display_url,
131
- 'img_low' => $res->node->thumbnail_src,
132
- 'img_thumb' => $res->node->thumbnail_resources[0]->src,
133
- 'likes' => $res->node->edge_liked_by->count,
134
- 'comments' => $res->node->edge_media_to_comment->count,
135
- 'caption' => '',
136
- 'code' => $res->node->shortcode,
137
- 'type' => $type
138
- );
139
- }
140
- }
141
- }
142
-
143
- // if empty, continus with the HTML API
144
- if (empty($items)) {
145
- $inURL = $this->instagram . 'explore/tags/' . $tag . '/';
146
- $items = $this->getFromHtmlAPI($inURL);
147
- }
148
-
149
- return empty($items) ? false : $items;
150
- }
151
-
152
- /**
153
- * takes page URL and return items list array
154
- *
155
- * @param
156
- * string url
157
- * @return array
158
- */
159
- protected function getFromHtmlAPI($inURL = '')
160
- {
161
- $instaRes = $this->igSpider($inURL);
162
-
163
- $items = array();
164
-
165
- if (! empty($instaRes)) {
166
- $insta_json = explode('window._sharedData = ', $instaRes);
167
- $insta_json = explode(';</script>', $insta_json[1]);
168
- $instaArray = json_decode($insta_json[0], true);
169
-
170
- $nodes = array();
171
- if (isset($instaArray['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media']['edges'])) {
172
- $nodes = $instaArray['entry_data']['ProfilePage'][0]['graphql']['user']['edge_owner_to_timeline_media']['edges'];
173
- } else if (isset($instaArray['entry_data']['TagPage'][0]['graphql']['hashtag']['edge_hashtag_to_media']['edges'])) {
174
- $nodes = $instaArray['entry_data']['TagPage'][0]['graphql']['hashtag']['edge_hashtag_to_media']['edges'];
175
- }
176
- if (! empty($nodes) && is_array($nodes)) {
177
- foreach ($nodes as $node) {
178
- if (! isset($node['node']['display_url'])) {
179
- continue;
180
- }
181
-
182
- $node = $node['node'];
183
-
184
- $type = 'image';
185
- if (isset($node['is_video']) && (true === $node['is_video'])) {
186
- $type = 'video';
187
- }
188
-
189
- $items[] = array(
190
- 'img_standard' => $node['display_url'],
191
- 'img_low' => $node['thumbnail_src'],
192
- 'img_thumb' => $node['thumbnail_resources'][0]['src'],
193
- 'likes' => $node['edge_liked_by']['count'],
194
- 'comments' => $node['edge_media_to_comment']['count'],
195
- 'caption' => '',
196
- 'code' => $node['shortcode'],
197
- 'type' => $type
198
- );
199
- }
200
- }
201
- }
202
-
203
- return empty($items) ? false : $items;
204
- }
205
-
206
- /**
207
- * takes URL string and return URL content
208
- *
209
- * @param string $url
210
- * @return string|boolean
211
- */
212
- public function igSpider($url = '')
213
- {
214
- if (empty($url) || (! filter_var($url, FILTER_VALIDATE_URL))) {
215
- $this->messages[] = 'Please provide a Valid URL';
216
- return false;
217
- }
218
- $instaItems = '';
219
-
220
- // get results if script executed in WP
221
- if (function_exists('wp_remote_request')) {
222
- $result = wp_remote_request($url);
223
- if (is_wp_error($result)) {
224
- $this->messages[] = 'WP Error: ' . implode(', ', $result->get_error_messages());
225
- } else {
226
- if (200 !== wp_remote_retrieve_response_code($result)) {
227
- $this->messages[] = 'Invalid response from Instagram.';
228
- } else {
229
- if (! empty($result['body'])) {
230
- $instaItems = $result['body'];
231
- }
232
- }
233
- }
234
- } else {
235
- $this->messages[] = 'Error: running outside WP.';
236
- }
237
-
238
- $this->instagramResult = $instaItems;
239
- return $instaItems;
240
- }
241
-
242
- // return messages array
243
- public function getMessages()
244
- {
245
- return array_unique($this->messages);
246
- }
247
- }
248
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/widgets/widget-blossomthemes-instagram-feed.php CHANGED
@@ -39,13 +39,28 @@ class BlossomThemes_Instagram_Widget extends WP_Widget {
39
 
40
  $title = empty( $instance['title'] ) ? '' : $instance['title'];
41
  $limit = empty( $instance['number'] ) ? 6 : $instance['number'];
42
- $size = empty( $instance['size'] ) ? 'img_thumb' : $instance['size'];
43
  $per_row = empty( $instance['per_row'] ) ? 5 : $instance['per_row'];
44
  $options = get_option( 'blossomthemes_instagram_feed_settings', true );
45
  $username = empty( $instance['username'] ) ? $options['username'] : $instance['username'];
46
  $profile_link = 'https://www.instagram.com/'.$username ;
47
  $profile_link_text = 'Follow Me!';
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  if( isset( $instance['profile_link_text'] ) && $instance['profile_link_text']!='' )
50
  {
51
  $profile_link_text = $instance['profile_link_text'];
@@ -55,32 +70,43 @@ class BlossomThemes_Instagram_Widget extends WP_Widget {
55
  echo $args['before_widget'];
56
 
57
  if ( $title ) echo $args['before_title'] . apply_filters( 'widget_title', $title, $instance, $this->id_base ) . $args['after_title'];
58
- if ( $username != '' )
59
- {
 
 
 
60
  $ran = rand(1,100); $ran++;
61
- require_once BTIF_BASE_PATH . '/includes/vendor/InstagramSpider.php';
62
- ob_start();
63
- $obj = new InstagramSpider;
64
- $photos_row = isset( $per_row ) ? esc_attr( $per_row ) :'5';
65
- $instaItems = $obj->getUserItems($username);
66
  add_filter('widget_text','do_shortcode');
67
-
68
- echo '<ul class="popup-gallery-'.$ran.' photos-'.$photos_row.'">';
69
- $i=0;
70
- if($instaItems)
71
- {
72
- foreach ($instaItems as $key) {
73
- if( $i<$limit )
 
74
  {
75
- echo '<li><a href="'.esc_url($key['img_standard']).'"><img src="'.esc_url($key[$size]).'"></a>';
 
 
 
 
 
 
 
76
  if( isset( $meta ) && $meta == 'true' )
77
  {
78
- echo '<div class="instagram-meta"><span class="like"><i class="fa fa-heart"></i>'.$key['likes'].'</span>'.'<span class="comment"><i class="fa fa-comment"></i>'.$key['comments'].'</span>'.'</div>';
79
  }
80
  echo '</li>';
 
 
81
  }
82
- $i++;
83
- }
84
  echo '</ul>';
85
  echo
86
  '<script>
@@ -106,14 +132,20 @@ class BlossomThemes_Instagram_Widget extends WP_Widget {
106
  });
107
  </script>';
108
  echo '<a class="profile-link" href="'.esc_url($profile_link).'" target="_blank">'.esc_attr($profile_link_text).'</a>';
109
- $output = ob_get_clean();
110
- echo $output;
111
- }
112
- else{
113
- echo '<b style="color:red;">'.__('Invalid or Private Username Used!','blossomthemes-instagram-feed').'</b>';
 
 
 
 
114
  }
115
- echo $args['after_widget'];
116
  }
 
 
 
117
  }
118
 
119
  /**
@@ -127,7 +159,7 @@ class BlossomThemes_Instagram_Widget extends WP_Widget {
127
  $default = array(
128
  'title' => __( 'Instagram', 'blossomthemes-instagram-feed' ),
129
  'number' => 6,
130
- 'size' => 'img_standard',
131
  'per_row' => 5
132
  );
133
  $instance = wp_parse_args( (array) $instance, $default );
@@ -135,7 +167,6 @@ class BlossomThemes_Instagram_Widget extends WP_Widget {
135
  $username = empty( $instance['username'] ) ? $options['username'] : $instance['username'];
136
  $title = empty( $instance['title'] ) ? '' : $instance['title'];
137
  $limit = empty( $instance['number'] ) ? 6 : $instance['number'];
138
- $size = empty( $instance['size'] ) ? 'img_standard' : $instance['size'];
139
  $per_row = empty( $instance['per_row'] ) ? 5 : $instance['per_row'];
140
  $profile_link = 'https://www.instagram.com/'.$username;
141
  $profile_link_text = 'Follow Me!';
@@ -145,7 +176,35 @@ class BlossomThemes_Instagram_Widget extends WP_Widget {
145
  }
146
 
147
  $meta = !isset( $instance['meta'] ) ? '' : $instance['meta'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
149
  <p>
150
  <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'blossomthemes-instagram-feed' ); ?></label>
151
  <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
@@ -164,9 +223,9 @@ class BlossomThemes_Instagram_Widget extends WP_Widget {
164
  <p>
165
  <label for="<?php echo esc_attr( $this->get_field_id( 'size' ) ); ?>"><?php esc_html_e( 'Photo size', 'blossomthemes-instagram-feed' ); ?></label>
166
  <select id="<?php echo esc_attr( $this->get_field_id( 'size' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'size' ) ); ?>" class="widefat">
167
- <option value="img_thumb" <?php selected( 'img_thumb', $size ) ?>><?php esc_html_e( 'Thumbnail', 'blossomthemes-instagram-feed' ); ?></option>
168
- <option value="img_low" <?php selected( 'img_low', $size ) ?>><?php esc_html_e( 'Small', 'blossomthemes-instagram-feed' ); ?></option>
169
- <option value="img_standard" <?php selected( 'img_standard', $size ) ?>><?php esc_html_e( 'Large', 'blossomthemes-instagram-feed' ); ?></option>
170
  </select>
171
  </p>
172
 
39
 
40
  $title = empty( $instance['title'] ) ? '' : $instance['title'];
41
  $limit = empty( $instance['number'] ) ? 6 : $instance['number'];
 
42
  $per_row = empty( $instance['per_row'] ) ? 5 : $instance['per_row'];
43
  $options = get_option( 'blossomthemes_instagram_feed_settings', true );
44
  $username = empty( $instance['username'] ) ? $options['username'] : $instance['username'];
45
  $profile_link = 'https://www.instagram.com/'.$username ;
46
  $profile_link_text = 'Follow Me!';
47
 
48
+ $size = empty( $instance['size'] ) ? 'low_resolution' : $instance['size'];
49
+ $sizes = array(
50
+ 'img_thumb' => 'thumbnail',
51
+ 'img_low' => 'low_resolution',
52
+ 'img_standard' => 'standard_resolution'
53
+ );
54
+
55
+ if ( array_key_exists( $size, $sizes ) )
56
+ {
57
+ foreach ( $sizes as $key => $value )
58
+ {
59
+ if($size == $key)
60
+ $size = $value;
61
+ }
62
+ }
63
+
64
  if( isset( $instance['profile_link_text'] ) && $instance['profile_link_text']!='' )
65
  {
66
  $profile_link_text = $instance['profile_link_text'];
70
  echo $args['before_widget'];
71
 
72
  if ( $title ) echo $args['before_title'] . apply_filters( 'widget_title', $title, $instance, $this->id_base ) . $args['after_title'];
73
+
74
+ ob_start();
75
+
76
+ if ( Blossomthemes_Instagram_Feed_API::getInstance()->is_configured() ) {
77
+
78
  $ran = rand(1,100); $ran++;
79
+
80
+ $this->api = Blossomthemes_Instagram_Feed_API::getInstance();
81
+ $items = $this->api->get_items( $limit, $size );
82
+
 
83
  add_filter('widget_text','do_shortcode');
84
+
85
+ if ( ! is_array( $items ) ) {
86
+ echo '<b style="color:red;">'.__('No posts available!','blossomthemes-instagram-feed').'</b>';
87
+ } else {
88
+ $count = 0;
89
+ echo '<ul class="popup-gallery-'.$ran.' photos-'.$per_row.'">';
90
+
91
+ foreach ( $items['items'] as $item )
92
  {
93
+ $link = $item['link'];
94
+ $img_standard = $item['image-standard'];
95
+ $src = $item['image-url'];
96
+ $likes = $item['likes_count'];
97
+ $comments = $item['comments_count'];
98
+
99
+ echo '<li><a href="'.esc_url($img_standard).'"><img src="'.esc_url($src).'"></a>';
100
+
101
  if( isset( $meta ) && $meta == 'true' )
102
  {
103
+ echo '<div class="instagram-meta"><span class="like"><i class="fa fa-heart"></i>'.$likes.'</span>'.'<span class="comment"><i class="fa fa-comment"></i>'.$comments.'</span>'.'</div>';
104
  }
105
  echo '</li>';
106
+
107
+ if ( ++$count === $limit ) break;
108
  }
109
+
 
110
  echo '</ul>';
111
  echo
112
  '<script>
132
  });
133
  </script>';
134
  echo '<a class="profile-link" href="'.esc_url($profile_link).'" target="_blank">'.esc_attr($profile_link_text).'</a>';
135
+ }
136
+ }
137
+ else{
138
+ if ( current_user_can( 'edit_theme_options' ) ) {
139
+ ?>
140
+ <p>
141
+ <?php _e( 'BlossomThemes Instagram Feed Widget misconfigured, check plugin &amp; widget settings.', 'blossomthemes-instagram-feed' ); ?>
142
+ </p>
143
+ <?php
144
  }
 
145
  }
146
+ $output = ob_get_clean();
147
+ echo $output;
148
+ echo $args['after_widget'];
149
  }
150
 
151
  /**
159
  $default = array(
160
  'title' => __( 'Instagram', 'blossomthemes-instagram-feed' ),
161
  'number' => 6,
162
+ 'size' => 'low_resolution',
163
  'per_row' => 5
164
  );
165
  $instance = wp_parse_args( (array) $instance, $default );
167
  $username = empty( $instance['username'] ) ? $options['username'] : $instance['username'];
168
  $title = empty( $instance['title'] ) ? '' : $instance['title'];
169
  $limit = empty( $instance['number'] ) ? 6 : $instance['number'];
 
170
  $per_row = empty( $instance['per_row'] ) ? 5 : $instance['per_row'];
171
  $profile_link = 'https://www.instagram.com/'.$username;
172
  $profile_link_text = 'Follow Me!';
176
  }
177
 
178
  $meta = !isset( $instance['meta'] ) ? '' : $instance['meta'];
179
+
180
+ $size = empty( $instance['size'] ) ? 'low_resolution' : $instance['size'];
181
+ $sizes = array(
182
+ 'img_thumb' => 'thumbnail',
183
+ 'img_low' => 'low_resolution',
184
+ 'img_standard' => 'standard_resolution'
185
+ );
186
+
187
+ if ( array_key_exists( $size, $sizes ) )
188
+ {
189
+ foreach ( $sizes as $key => $value )
190
+ {
191
+ if($size == $key)
192
+ $size = $value;
193
+ }
194
+ }
195
  ?>
196
+
197
+ <?php if ( ! Blossomthemes_Instagram_Feed_API::getInstance()->is_configured() ) : ?>
198
+
199
+ <p><b style="color: red;">
200
+ <?php
201
+ printf( __( 'Please configure <a href="%1$s">Plugin Settings</a> before using this widget.', 'blossomthemes-instagram-feed' ),
202
+ admin_url( 'admin.php?page=class-blossomthemes-instagram-feed-admin.php' ) );
203
+ ?>
204
+ </b></p>
205
+
206
+ <?php endif; ?>
207
+
208
  <p>
209
  <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'blossomthemes-instagram-feed' ); ?></label>
210
  <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
223
  <p>
224
  <label for="<?php echo esc_attr( $this->get_field_id( 'size' ) ); ?>"><?php esc_html_e( 'Photo size', 'blossomthemes-instagram-feed' ); ?></label>
225
  <select id="<?php echo esc_attr( $this->get_field_id( 'size' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'size' ) ); ?>" class="widefat">
226
+ <option value="thumbnail" <?php selected( 'thumbnail', $size ) ?>><?php esc_html_e( 'Thumbnail', 'blossomthemes-instagram-feed' ); ?></option>
227
+ <option value="low_resolution" <?php selected( 'low_resolution', $size ) ?>><?php esc_html_e( 'Small', 'blossomthemes-instagram-feed' ); ?></option>
228
+ <option value="standard_resolution" <?php selected( 'standard_resolution', $size ) ?>><?php esc_html_e( 'Large', 'blossomthemes-instagram-feed' ); ?></option>
229
  </select>
230
  </p>
231
 
languages/blossomthemes-instagram-feed.pot CHANGED
@@ -1,122 +1,214 @@
1
- #, fuzzy
 
2
  msgid ""
3
  msgstr ""
4
- "Project-Id-Version: PACKAGE VERSION\n"
5
- "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2018-03-19 05:30+0000\n"
7
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
- "Last-Translator: \n"
9
- "Language-Team: \n"
10
- "Language: \n"
11
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
12
  "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Loco https://localise.biz/"
 
 
 
16
 
17
- #: includes/class-blossomthemes-instagram-feed-settings.php:20
18
- msgid "Settings updated."
19
  msgstr ""
20
 
21
- #: includes/class-blossomthemes-instagram-feed-settings.php:20
22
- msgid "Dismiss this notice."
23
  msgstr ""
24
 
25
- #: includes/class-blossomthemes-instagram-feed-settings.php:28
 
 
 
 
26
  msgid "General"
27
  msgstr ""
28
 
29
- #: includes/class-blossomthemes-instagram-feed-settings.php:29
30
  msgid "Usage"
31
  msgstr ""
32
 
33
- #: includes/class-blossomthemes-instagram-feed-settings.php:37
34
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  msgid "Username"
36
  msgstr ""
37
 
38
- #: includes/class-blossomthemes-instagram-feed-settings.php:41
39
  msgid "Number of Photos"
40
  msgstr ""
41
 
42
- #: includes/class-blossomthemes-instagram-feed-settings.php:45
43
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  msgid "Profile Link Text"
45
  msgstr ""
46
 
47
- #: includes/class-blossomthemes-instagram-feed-settings.php:51
 
 
 
 
48
  msgid "Uses"
49
  msgstr ""
50
 
51
- #: includes/class-blossomthemes-instagram-feed-settings.php:53
52
  msgid "Display via Shortcode"
53
  msgstr ""
54
 
55
- #: includes/class-blossomthemes-instagram-feed-settings.php:63
 
 
 
 
56
  msgid "Display via PHP Function"
57
  msgstr ""
58
 
59
- #. Base ID
60
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:25
61
- msgid "BlossomThemes: Instagram"
62
  msgstr ""
63
 
64
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:26
65
- msgid "A Instagram Widget that displays your latest Instagram photos."
 
66
  msgstr ""
67
 
68
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:128
69
- msgid "Instagram"
 
 
70
  msgstr ""
71
 
72
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:144
73
- msgid "Title"
74
  msgstr ""
75
 
76
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:154
77
- msgid "Number of photos"
78
  msgstr ""
79
 
80
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:159
81
- msgid "Photo size"
82
  msgstr ""
83
 
84
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:161
85
- msgid "Thumbnail"
86
  msgstr ""
87
 
88
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:162
89
- msgid "Small"
90
  msgstr ""
91
 
92
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:163
93
- msgid "Large"
94
  msgstr ""
95
 
96
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:168
97
- msgid "Photos Per Row"
98
  msgstr ""
99
 
100
- #: includes/widgets/widget-blossomthemes-instagram-feed.php:173
101
- msgid "Display Comments/Likes"
 
 
102
  msgstr ""
103
 
104
- #. Name of the plugin
105
- msgid "BlossomThemes Instagram Feed"
106
  msgstr ""
107
 
108
- #. Description of the plugin
109
- msgid "Show instagram feed on your website using shortcode and widget."
 
 
110
  msgstr ""
111
 
112
- #. URI of the plugin
 
 
 
 
 
 
 
 
 
 
 
 
113
  msgid "https://wordpress.org/plugins/blossomthemes-instagram-feed"
114
  msgstr ""
115
 
116
- #. Author of the plugin
 
 
 
 
117
  msgid "blossomthemes"
118
  msgstr ""
119
 
120
- #. Author URI of the plugin
121
  msgid "https://blossomthemes.com"
122
- msgstr ""
1
+ # Copyright (C) 2019 blossomthemes
2
+ # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: BlossomThemes Instagram Feed 1.1.3\n"
6
+ "Report-Msgid-Bugs-To: "
7
+ "https://wordpress.org/support/plugin/blossomthemes-instagram-feed\n"
8
+ "POT-Creation-Date: 2019-01-24 09:53:41+00:00\n"
 
 
 
 
9
  "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "X-Generator: grunt-wp-i18n 1.0.3\n"
16
 
17
+ #: admin/class-blossomthemes-instagram-feed-admin.php:141
18
+ msgid "Access Token rejected by Instagram API. Please add valid Access Token."
19
  msgstr ""
20
 
21
+ #: admin/class-blossomthemes-instagram-feed-admin.php:175
22
+ msgid "Dismiss this notice"
23
  msgstr ""
24
 
25
+ #. Plugin Name of the plugin/theme
26
+ msgid "BlossomThemes Instagram Feed"
27
+ msgstr ""
28
+
29
+ #: includes/class-blossomthemes-instagram-feed-settings.php:25
30
  msgid "General"
31
  msgstr ""
32
 
33
+ #: includes/class-blossomthemes-instagram-feed-settings.php:26
34
  msgid "Usage"
35
  msgstr ""
36
 
37
+ #: includes/class-blossomthemes-instagram-feed-settings.php:51
38
+ #: includes/class-blossomthemes-instagram-feed-settings.php:62
39
+ msgid "Connect with Instagram"
40
+ msgstr ""
41
+
42
+ #: includes/class-blossomthemes-instagram-feed-settings.php:53
43
+ msgid ""
44
+ "To get started click the button below. You’ll be prompted to authorize "
45
+ "BlossomThemes Instagram Feed to access your Instagram photos."
46
+ msgstr ""
47
+
48
+ #: includes/class-blossomthemes-instagram-feed-settings.php:55
49
+ msgid ""
50
+ "Due to recent Instagram API changes it is no longer possible to display "
51
+ "photos from a different Instagram account than yours. The widget will "
52
+ "automatically display the latest photos of the account which was authorized "
53
+ "on this page."
54
+ msgstr ""
55
+
56
+ #: includes/class-blossomthemes-instagram-feed-settings.php:64
57
+ msgid "Re-connect with Instagram"
58
+ msgstr ""
59
+
60
+ #: includes/class-blossomthemes-instagram-feed-settings.php:68
61
+ msgid "Access Token"
62
+ msgstr ""
63
+
64
+ #: includes/class-blossomthemes-instagram-feed-settings.php:73
65
+ msgid ""
66
+ "Access Token is used as key to access your photos from Instagram so they "
67
+ "can be displayed."
68
+ msgstr ""
69
+
70
+ #: includes/class-blossomthemes-instagram-feed-settings.php:80
71
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:214
72
  msgid "Username"
73
  msgstr ""
74
 
75
+ #: includes/class-blossomthemes-instagram-feed-settings.php:85
76
  msgid "Number of Photos"
77
  msgstr ""
78
 
79
+ #: includes/class-blossomthemes-instagram-feed-settings.php:89
80
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:224
81
+ msgid "Photo size"
82
+ msgstr ""
83
+
84
+ #: includes/class-blossomthemes-instagram-feed-settings.php:91
85
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:226
86
+ msgid "Thumbnail"
87
+ msgstr ""
88
+
89
+ #: includes/class-blossomthemes-instagram-feed-settings.php:92
90
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:227
91
+ msgid "Small"
92
+ msgstr ""
93
+
94
+ #: includes/class-blossomthemes-instagram-feed-settings.php:93
95
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:228
96
+ msgid "Large"
97
+ msgstr ""
98
+
99
+ #: includes/class-blossomthemes-instagram-feed-settings.php:97
100
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:233
101
+ msgid "Photos Per Row"
102
+ msgstr ""
103
+
104
+ #: includes/class-blossomthemes-instagram-feed-settings.php:101
105
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:243
106
  msgid "Profile Link Text"
107
  msgstr ""
108
 
109
+ #: includes/class-blossomthemes-instagram-feed-settings.php:105
110
+ msgid "Show Likes/Comments"
111
+ msgstr ""
112
+
113
+ #: includes/class-blossomthemes-instagram-feed-settings.php:115
114
  msgid "Uses"
115
  msgstr ""
116
 
117
+ #: includes/class-blossomthemes-instagram-feed-settings.php:117
118
  msgid "Display via Shortcode"
119
  msgstr ""
120
 
121
+ #: includes/class-blossomthemes-instagram-feed-settings.php:121
122
+ msgid "Copy this Shortcode to display your instagram gallery in pages/posts => "
123
+ msgstr ""
124
+
125
+ #: includes/class-blossomthemes-instagram-feed-settings.php:127
126
  msgid "Display via PHP Function"
127
  msgstr ""
128
 
129
+ #: includes/class-blossomthemes-instagram-feed-settings.php:131
130
+ msgid "Copy the PHP Function below to display your instagram gallery in templates :"
 
131
  msgstr ""
132
 
133
+ #: includes/class-blossomthemes-instagram-feed-shortcodes.php:34
134
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:86
135
+ msgid "Invalid or Private Username Used!"
136
  msgstr ""
137
 
138
+ #: includes/class-blossomthemes-instagram-feed-shortcodes.php:95
139
+ msgid ""
140
+ "BlossomThemes Instagram Feed misconfigured, check plugin &amp; widget "
141
+ "settings."
142
  msgstr ""
143
 
144
+ #: includes/template/backend/sidebar.php:3
145
+ msgid "More WordPress Themes and Plugins?"
146
  msgstr ""
147
 
148
+ #: includes/template/backend/sidebar.php:5
149
+ msgid "Visit us at: "
150
  msgstr ""
151
 
152
+ #: includes/template/backend/sidebar.php:6
153
+ msgid "Blossom Themes"
154
  msgstr ""
155
 
156
+ #: includes/template/backend/sidebar.php:9
157
+ msgid "Please fill free to leave us a review, if you found this plugin helpful."
158
  msgstr ""
159
 
160
+ #: includes/template/backend/sidebar.php:10
161
+ msgid "Leave a Review"
162
  msgstr ""
163
 
164
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:25
165
+ msgid "BlossomThemes: Instagram"
166
  msgstr ""
167
 
168
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:26
169
+ msgid "A Instagram Widget that displays your latest Instagram photos."
170
  msgstr ""
171
 
172
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:141
173
+ msgid ""
174
+ "BlossomThemes Instagram Feed Widget misconfigured, check plugin &amp; "
175
+ "widget settings."
176
  msgstr ""
177
 
178
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:160
179
+ msgid "Instagram"
180
  msgstr ""
181
 
182
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:201
183
+ msgid ""
184
+ "Please configure <a href=\"%1$s\">Plugin Settings</a> before using this "
185
+ "widget."
186
  msgstr ""
187
 
188
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:209
189
+ msgid "Title"
190
+ msgstr ""
191
+
192
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:219
193
+ msgid "Number of photos"
194
+ msgstr ""
195
+
196
+ #: includes/widgets/widget-blossomthemes-instagram-feed.php:239
197
+ msgid "Display Comments/Likes"
198
+ msgstr ""
199
+
200
+ #. Plugin URI of the plugin/theme
201
  msgid "https://wordpress.org/plugins/blossomthemes-instagram-feed"
202
  msgstr ""
203
 
204
+ #. Description of the plugin/theme
205
+ msgid "Show instagram feed on your website using shortcode and widget."
206
+ msgstr ""
207
+
208
+ #. Author of the plugin/theme
209
  msgid "blossomthemes"
210
  msgstr ""
211
 
212
+ #. Author URI of the plugin/theme
213
  msgid "https://blossomthemes.com"
214
+ msgstr ""
public/css/blossomthemes-instagram-feed-public.min.css CHANGED
@@ -1 +1 @@
1
- #primary .page .entry-content .popup-gallery li .instagram-meta,#primary .post .entry-content .popup-gallery li .instagram-meta,.widget_btif_instagram_widget ul li .instagram-meta{left:0;bottom:0;color:#fff;filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#a6000000', GradientType=0 )}.white-popup-block{background:#FFF;padding:20px 30px;text-align:left;max-width:650px;margin:40px auto;position:relative}.widget_btif_instagram_widget ul:after{content:'';display:block;clear:both}.widget_btif_instagram_widget ul{margin:0 -1px!important}.widget_btif_instagram_widget ul li{float:left;width:33.3333%;padding:0 1px!important;margin:0 0 2px!important;position:relative}.widget_btif_instagram_widget ul li .instagram-meta{position:absolute;width:100%;padding:5px 10px;opacity:0;-webkit-transition:linear .2s;-moz-transition:linear .2s;transition:linear .2s;background:-moz-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%);background:-webkit-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%);background:linear-gradient(to bottom,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%)}.widget_btif_instagram_widget ul.photos-4 li .instagram-meta,.widget_btif_instagram_widget ul.photos-5 li .instagram-meta{display:none}.widget_btif_instagram_widget ul li:hover .instagram-meta{opacity:1}.widget_btif_instagram_widget ul li .instagram-meta .fa-comment{float:right}.widget_btif_instagram_widget ul li img{vertical-align:top;width:100%}.widget_btif_instagram_widget ul.photos-1 li{width:100%}.widget_btif_instagram_widget ul.photos-2 li{width:50%}.widget_btif_instagram_widget ul.photos-4 li{width:25%}.widget_btif_instagram_widget ul.photos-5 li{width:20%}#primary .page .entry-content .popup-gallery,#primary .post .entry-content .popup-gallery{margin:0 -1px;padding:0;list-style:none}#primary .page .entry-content .popup-gallery:after,#primary .post .entry-content .popup-gallery:after{content:'';display:block;clear:both}#primary .page .entry-content .popup-gallery li,#primary .post .entry-content .popup-gallery li{float:left;width:33.3333%;padding:0 1px;margin:0 0 2px;position:relative}#primary .page .entry-content .popup-gallery li .instagram-meta,#primary .post .entry-content .popup-gallery li .instagram-meta{position:absolute;width:100%;padding:5px 10px;opacity:0;-webkit-transition:linear .2s;-moz-transition:linear .2s;transition:linear .2s;background:-moz-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%);background:-webkit-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%);background:linear-gradient(to bottom,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%)}#primary .page .entry-content .popup-gallery li:hover .instagram-meta,#primary .post .entry-content .popup-gallery li:hover .instagram-meta{opacity:1}#primary .page .entry-content .popup-gallery li .instagram-meta .fa-comment,#primary .post .entry-content .popup-gallery li .instagram-meta .fa-comment{float:right}#primary .page .entry-content .popup-gallery li img,#primary .post .entry-content .popup-gallery li img{vertical-align:top;width:100%}#primary .page .entry-content .popup-gallery.photos-1 li,#primary .post .entry-content .popup-gallery.photos-1 li{width:100%}#primary .page .entry-content .popup-gallery.photos-2 li,#primary .post .entry-content .popup-gallery.photos-2 li{width:50%}#primary .page .entry-content .popup-gallery.photos-4 li,#primary .post .entry-content .popup-gallery.photos-4 li{width:25%}#primary .page .entry-content .popup-gallery.photos-5 li,#primary .post .entry-content .popup-gallery.photos-5 li{width:20%}@media only screen and (max-width:767px){#primary .page .entry-content .popup-gallery.photos-2 li,#primary .page .entry-content .popup-gallery.photos-4 li,#primary .page .entry-content .popup-gallery.photos-5 li,#primary .post .entry-content .popup-gallery.photos-2 li,#primary .post .entry-content .popup-gallery.photos-4 li,#primary .post .entry-content .popup-gallery.photos-5 li,.widget_btif_instagram_widget ul.photos-2 li,.widget_btif_instagram_widget ul.photos-4 li,.widget_btif_instagram_widget ul.photos-5 li{width:100%}}
1
+ #primary .page .entry-content .popup-gallery li .instagram-meta,#primary .post .entry-content .popup-gallery li .instagram-meta,.widget_btif_instagram_widget ul li .instagram-meta{left:0;bottom:0;color:#fff;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#a6000000',GradientType=0)}.white-popup-block{background:#FFF;padding:20px 30px;text-align:left;max-width:650px;margin:40px auto;position:relative}.widget_btif_instagram_widget ul:after{content:'';display:block;clear:both}.widget_btif_instagram_widget ul{margin:0 -1px!important}.widget_btif_instagram_widget ul li{float:left;width:33.3333%;padding:0 1px!important;margin:0 0 2px!important;position:relative}.widget_btif_instagram_widget ul li .instagram-meta{position:absolute;width:100%;padding:5px 10px;opacity:0;-webkit-transition:linear .2s;-moz-transition:linear .2s;transition:linear .2s;background:-moz-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%);background:-webkit-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%);background:linear-gradient(to bottom,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%)}.widget_btif_instagram_widget ul.photos-4 li .instagram-meta,.widget_btif_instagram_widget ul.photos-5 li .instagram-meta{display:none}.widget_btif_instagram_widget ul li:hover .instagram-meta{opacity:1}.widget_btif_instagram_widget ul li .instagram-meta .fa-comment{float:right}.widget_btif_instagram_widget ul li img{vertical-align:top;width:100%}.widget_btif_instagram_widget ul.photos-1 li{width:100%}.widget_btif_instagram_widget ul.photos-2 li{width:50%}.widget_btif_instagram_widget ul.photos-4 li{width:25%}.widget_btif_instagram_widget ul.photos-5 li{width:20%}#primary .page .entry-content .popup-gallery,#primary .post .entry-content .popup-gallery{margin:0 -1px;padding:0;list-style:none}#primary .page .entry-content .popup-gallery:after,#primary .post .entry-content .popup-gallery:after{content:'';display:block;clear:both}#primary .page .entry-content .popup-gallery li,#primary .post .entry-content .popup-gallery li{float:left;width:33.3333%;padding:0 1px;margin:0 0 2px;position:relative}#primary .page .entry-content .popup-gallery li .instagram-meta,#primary .post .entry-content .popup-gallery li .instagram-meta{position:absolute;width:100%;padding:5px 10px;opacity:0;-webkit-transition:linear .2s;-moz-transition:linear .2s;transition:linear .2s;background:-moz-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%);background:-webkit-linear-gradient(top,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%);background:linear-gradient(to bottom,rgba(0,0,0,0) 0,rgba(0,0,0,.65) 100%);display:flex;flex:1;flex-wrap:wrap;justify-content:flex-end;align-items:center}#primary .page .entry-content .popup-gallery li:hover .instagram-meta,#primary .post .entry-content .popup-gallery li:hover .instagram-meta{opacity:1}#primary .page .entry-content .popup-gallery li .instagram-meta span,#primary .post .entry-content .popup-gallery li .instagram-meta span{display:flex;flex:auto;align-items:center}#primary .page .entry-content .popup-gallery li .instagram-meta span.comment,#primary .post .entry-content .popup-gallery li .instagram-meta span.comment{justify-content:flex-end}#primary .page .entry-content .popup-gallery li .instagram-meta span svg,#primary .post .entry-content .popup-gallery li .instagram-meta span svg{margin-right:5px}#primary .page .entry-content .popup-gallery li img,#primary .post .entry-content .popup-gallery li img{vertical-align:top;width:100%}#primary .page .entry-content .popup-gallery.photos-1 li,#primary .post .entry-content .popup-gallery.photos-1 li{width:100%}#primary .page .entry-content .popup-gallery.photos-2 li,#primary .post .entry-content .popup-gallery.photos-2 li{width:50%}#primary .page .entry-content .popup-gallery.photos-4 li,#primary .post .entry-content .popup-gallery.photos-4 li{width:25%}#primary .page .entry-content .popup-gallery.photos-5 li,#primary .post .entry-content .popup-gallery.photos-5 li{width:20%}@media only screen and (max-width:767px){#primary .page .entry-content .popup-gallery.photos-2 li,#primary .page .entry-content .popup-gallery.photos-4 li,#primary .page .entry-content .popup-gallery.photos-5 li,#primary .post .entry-content .popup-gallery.photos-2 li,#primary .post .entry-content .popup-gallery.photos-4 li,#primary .post .entry-content .popup-gallery.photos-5 li,.widget_btif_instagram_widget ul.photos-2 li,.widget_btif_instagram_widget ul.photos-4 li,.widget_btif_instagram_widget ul.photos-5 li{width:100%}}