Enjoy Instagram feed on website with WordPress Widget and Shortcode - Version 4.0.1

Version Description

  • Bug fix for user access token
  • Add default option value to avoid empty shortcodes
Download this release

Release Info

Developer mediabeta
Plugin Icon 128x128 Enjoy Instagram feed on website with WordPress Widget and Shortcode
Version 4.0.1
Comparing to
See all releases

Code changes from version 4.0.0 to 4.0.1

enjoyinstagram.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: Enjoy Plugin for Instagram
4
  Plugin URI: http://www.mediabeta.com/enjoy-instagram/
5
  Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
6
- Version: 4.0.0
7
  Author: Mediabeta Srl
8
  Author URI: http://www.mediabeta.com/team/
9
  */
10
 
11
- ! defined( 'ENJOYINSTAGRAM_VERSION' ) && define( 'ENJOYINSTAGRAM_VERSION', '4.0.0' );
12
  ! defined( 'ENJOYINSTAGRAM_FILE' ) && define( 'ENJOYINSTAGRAM_FILE', __FILE__ );
13
  ! defined( 'ENJOYINSTAGRAM_URL' ) && define( 'ENJOYINSTAGRAM_URL', plugin_dir_url( __FILE__ ) );
14
  ! defined( 'ENJOYINSTAGRAM_DIR' ) && define( 'ENJOYINSTAGRAM_DIR', plugin_dir_path( __FILE__ ) );
3
  Plugin Name: Enjoy Plugin for Instagram
4
  Plugin URI: http://www.mediabeta.com/enjoy-instagram/
5
  Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
6
+ Version: 4.0.1
7
  Author: Mediabeta Srl
8
  Author URI: http://www.mediabeta.com/team/
9
  */
10
 
11
+ ! defined( 'ENJOYINSTAGRAM_VERSION' ) && define( 'ENJOYINSTAGRAM_VERSION', '4.0.1' );
12
  ! defined( 'ENJOYINSTAGRAM_FILE' ) && define( 'ENJOYINSTAGRAM_FILE', __FILE__ );
13
  ! defined( 'ENJOYINSTAGRAM_URL' ) && define( 'ENJOYINSTAGRAM_URL', plugin_dir_url( __FILE__ ) );
14
  ! defined( 'ENJOYINSTAGRAM_DIR' ) && define( 'ENJOYINSTAGRAM_DIR', plugin_dir_path( __FILE__ ) );
includes/class.enjoyinstagram-api-connection.php CHANGED
@@ -17,10 +17,10 @@ class EnjoyInstagram_Api_Connection {
17
  protected static $instance;
18
 
19
  /**
20
- * Users array
21
- * @var array
22
  */
23
- public $users = array();
24
 
25
  /**
26
  * Returns single instance of the class
@@ -42,8 +42,7 @@ class EnjoyInstagram_Api_Connection {
42
  * @return void
43
  */
44
  private function __construct(){
45
- $this->users = get_option('enjoy_instagram_options', array());
46
- $this->users = array_filter( $this->users );
47
  }
48
 
49
  /**
@@ -129,18 +128,6 @@ class EnjoyInstagram_Api_Connection {
129
  return $res;
130
  }
131
 
132
- /**
133
- * Get access token for given user
134
- *
135
- * @since 9.0.0
136
- * @param string $user
137
- * @return string
138
- * @author Francesco Licandro
139
- */
140
- public function get_user_access_token( $user ) {
141
- return isset( $this->users[$user]['access_token'] ) ? $this->users[$user]['access_token'] : '';
142
- }
143
-
144
  /**
145
  * Get user info
146
  *
@@ -151,13 +138,10 @@ class EnjoyInstagram_Api_Connection {
151
  * @return array
152
  */
153
  public function get_user_info( $access_token = '', $user = '' ){
154
- if( ! $access_token && ! $user ) {
155
  return array();
156
  }
157
 
158
- // get access token if missing
159
- ! $access_token && $access_token = $this->get_user_access_token( $user );
160
-
161
  $url = 'https://api.instagram.com/v1/users/self/?access_token='.$access_token;
162
  return $this->_curl_connect( $url );
163
  }
@@ -172,19 +156,14 @@ class EnjoyInstagram_Api_Connection {
172
  * @return array|boolean
173
  */
174
  public function get_user_by_name( $user, $count, $account_name, $hashtag = '' ){
175
- if( ! $user ) {
176
- // get first
177
- reset( $this->users );
178
- $user = key( $this->users );
179
- }
180
- $access_token = $this->get_user_access_token( $user );
181
- if( ! $access_token ) {
182
  return false;
183
  }
184
 
185
  $user_name = strtolower( $account_name ); // sanitization
186
  $user_id = '';
187
- $url = "https://api.instagram.com/v1/users/search?q=".$user_name."&access_token=".$access_token;
188
  $json = $this->_curl_connect( $url );
189
  if( empty( $json ) || ! isset( $json['data'] ) ) {
190
  return false;
@@ -215,9 +194,8 @@ class EnjoyInstagram_Api_Connection {
215
  * @return array|boolean
216
  */
217
  public function get_user( $user, $count, $hashtag = "" ){
218
- $access_token = $this->get_user_access_token( $user );
219
  $hashtags = explode( ',', $hashtag );
220
- $url = 'https://api.instagram.com/v1/users/self/media/recent?count='.$count.'&access_token='.$access_token;
221
 
222
  return $this->_get_data( $url, $count, $hashtags );
223
  }
@@ -232,13 +210,12 @@ class EnjoyInstagram_Api_Connection {
232
  * @return string
233
  */
234
  public function get_user_code( $user, $count ){
235
- if( ! $user ) {
236
- // get first
237
- reset( $this->users );
238
- $user = key( $this->users );
239
  }
240
- $access_token = $this->get_user_access_token( $user );
241
- $url = 'https://api.instagram.com/v1/users/self/media/recent?count='.$count.'&access_token='.$access_token;
242
  $result = $this->_curl_connect( $url );
243
 
244
  return isset( $result['meta']['code'] ) ? $result['meta']['code'] : '';
@@ -255,14 +232,12 @@ class EnjoyInstagram_Api_Connection {
255
  */
256
  public function get_media( $user, $media ){
257
 
258
- if( ! $user ) {
259
- // get first
260
- reset( $this->users );
261
- $user = key( $this->users );
262
- }
263
- $access_token = $this->get_user_access_token( $user );
264
- $url = 'https://api.instagram.com/v1/media/'.$media.'?access_token='.$access_token;
265
- return $this->_curl_connect( $url );
266
  }
267
 
268
  /**
@@ -275,8 +250,12 @@ class EnjoyInstagram_Api_Connection {
275
  * @return array
276
  */
277
  public function get_likes( $user, $count ){
278
- $access_token = $this->get_user_access_token( $user );
279
- $url = 'https://api.instagram.com/v1/users/self/media/liked?count='.$count.'&access_token='.$access_token;
 
 
 
 
280
 
281
  return $this->_get_data( $url, $count, array() );
282
  }
@@ -291,8 +270,12 @@ class EnjoyInstagram_Api_Connection {
291
  * @return string
292
  */
293
  public function get_likes_code($user,$count){
294
- $access_token = $this->get_user_access_token( $user );
295
- $url = 'https://api.instagram.com/v1/users/self/media/liked?count='.$count.'&access_token='.$access_token;
 
 
 
 
296
  $result = $this->_curl_connect( $url );
297
 
298
  return isset( $result['meta']['code'] ) ? $result['meta']['code'] : '';
@@ -308,10 +291,12 @@ class EnjoyInstagram_Api_Connection {
308
  * @return array
309
  */
310
  public function get_hash( $hashtag, $count ){
 
 
 
 
 
311
  // get first
312
- reset( $this->users );
313
- $first_key = key( $this->users );
314
- $access_token = $this->get_user_access_token( $first_key );
315
  $hashtags = explode("%2C", $hashtag);
316
  $result = array();
317
  $res['data'] = array();
@@ -327,7 +312,7 @@ class EnjoyInstagram_Api_Connection {
327
  if( $i ){
328
  $url = $result[$ht][$i-1]['pagination']['next_url'];
329
  } else {
330
- $url = 'https://api.instagram.com/v1/tags/'.$ht.'/media/recent?count='.$count.'&access_token='.$access_token;
331
  }
332
 
333
  $result[$ht][$i] = $this->_curl_connect( $url );
@@ -363,10 +348,11 @@ class EnjoyInstagram_Api_Connection {
363
  */
364
  public function get_hash_code( $hashtag, $count ){
365
 
366
- reset( $this->users );
367
- $first_key = key( $this->users );
368
- $access_token = $this->get_user_access_token( $first_key );
369
- $url = 'https://api.instagram.com/v1/tags/'.$hashtag.'/media/recent?count='.$count.'&access_token='.$access_token;
 
370
  $result = $this->_curl_connect( $url );
371
 
372
  return isset( $result['meta']['code'] ) ? $result['meta']['code'] : '';
17
  protected static $instance;
18
 
19
  /**
20
+ * String Access Token
21
+ * @var string
22
  */
23
+ public $access_token = '';
24
 
25
  /**
26
  * Returns single instance of the class
42
  * @return void
43
  */
44
  private function __construct(){
45
+ $this->access_token = get_option('enjoyinstagram_access_token', '');
 
46
  }
47
 
48
  /**
128
  return $res;
129
  }
130
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  /**
132
  * Get user info
133
  *
138
  * @return array
139
  */
140
  public function get_user_info( $access_token = '', $user = '' ){
141
+ if( ! $access_token ) {
142
  return array();
143
  }
144
 
 
 
 
145
  $url = 'https://api.instagram.com/v1/users/self/?access_token='.$access_token;
146
  return $this->_curl_connect( $url );
147
  }
156
  * @return array|boolean
157
  */
158
  public function get_user_by_name( $user, $count, $account_name, $hashtag = '' ){
159
+
160
+ if( ! $this->access_token ) {
 
 
 
 
 
161
  return false;
162
  }
163
 
164
  $user_name = strtolower( $account_name ); // sanitization
165
  $user_id = '';
166
+ $url = "https://api.instagram.com/v1/users/search?q=".$user_name."&access_token=".$this->access_token;
167
  $json = $this->_curl_connect( $url );
168
  if( empty( $json ) || ! isset( $json['data'] ) ) {
169
  return false;
194
  * @return array|boolean
195
  */
196
  public function get_user( $user, $count, $hashtag = "" ){
 
197
  $hashtags = explode( ',', $hashtag );
198
+ $url = 'https://api.instagram.com/v1/users/self/media/recent?count='.$count.'&access_token='.$this->access_token;
199
 
200
  return $this->_get_data( $url, $count, $hashtags );
201
  }
210
  * @return string
211
  */
212
  public function get_user_code( $user, $count ){
213
+
214
+ if( ! $this->access_token ) {
215
+ return '';
 
216
  }
217
+
218
+ $url = 'https://api.instagram.com/v1/users/self/media/recent?count='.$count.'&access_token='.$this->access_token;
219
  $result = $this->_curl_connect( $url );
220
 
221
  return isset( $result['meta']['code'] ) ? $result['meta']['code'] : '';
232
  */
233
  public function get_media( $user, $media ){
234
 
235
+ if( ! $this->access_token ) {
236
+ return array();
237
+ }
238
+
239
+ $url = 'https://api.instagram.com/v1/media/'.$media.'?access_token='.$this->access_token;
240
+ return $this->_curl_connect( $url );
 
 
241
  }
242
 
243
  /**
250
  * @return array
251
  */
252
  public function get_likes( $user, $count ){
253
+
254
+ if( ! $this->access_token ) {
255
+ return array();
256
+ }
257
+
258
+ $url = 'https://api.instagram.com/v1/users/self/media/liked?count='.$count.'&access_token='.$this->access_token;
259
 
260
  return $this->_get_data( $url, $count, array() );
261
  }
270
  * @return string
271
  */
272
  public function get_likes_code($user,$count){
273
+
274
+ if( ! $this->access_token ) {
275
+ return '';
276
+ }
277
+
278
+ $url = 'https://api.instagram.com/v1/users/self/media/liked?count='.$count.'&access_token='.$this->access_token;
279
  $result = $this->_curl_connect( $url );
280
 
281
  return isset( $result['meta']['code'] ) ? $result['meta']['code'] : '';
291
  * @return array
292
  */
293
  public function get_hash( $hashtag, $count ){
294
+
295
+ if( ! $this->access_token ) {
296
+ return array();
297
+ }
298
+
299
  // get first
 
 
 
300
  $hashtags = explode("%2C", $hashtag);
301
  $result = array();
302
  $res['data'] = array();
312
  if( $i ){
313
  $url = $result[$ht][$i-1]['pagination']['next_url'];
314
  } else {
315
+ $url = 'https://api.instagram.com/v1/tags/'.$ht.'/media/recent?count='.$count.'&access_token='.$this->access_token;
316
  }
317
 
318
  $result[$ht][$i] = $this->_curl_connect( $url );
348
  */
349
  public function get_hash_code( $hashtag, $count ){
350
 
351
+ if( ! $this->access_token ) {
352
+ return '';
353
+ }
354
+
355
+ $url = 'https://api.instagram.com/v1/tags/'.$hashtag.'/media/recent?count='.$count.'&access_token='.$this->access_token;
356
  $result = $this->_curl_connect( $url );
357
 
358
  return isset( $result['meta']['code'] ) ? $result['meta']['code'] : '';
includes/class.enjoyinstagram-shortcodes.php CHANGED
@@ -137,7 +137,7 @@ class EnjoyInstagram_Shortcodes {
137
  */
138
  protected function _get_shortcode_data( $type = '' ){
139
  $data = array();
140
- ! $type && $type = get_option('enjoyinstagram_user_or_hashtag');
141
  if( $type == 'hashtag' ){
142
  $result = EnjoyInstagram_Api_Connection()->get_hash( urlencode( get_option('enjoyinstagram_hashtag') ), 20 );
143
  } else {
@@ -168,12 +168,13 @@ class EnjoyInstagram_Shortcodes {
168
  ), $atts ) );
169
 
170
  $client = get_option( 'enjoyinstagram_access_token', '' );
171
- if( ! $client || is_null( $client ) ) {
 
172
  return '';
173
  }
174
 
175
- $items_num = get_option('enjoyinstagram_carousel_items_number');
176
- $nav = get_option('enjoyinstagram_carousel_navigation');
177
  $result = $this->_get_shortcode_data();
178
  if( empty( $result ) ) {
179
  return '';
@@ -196,12 +197,12 @@ class EnjoyInstagram_Shortcodes {
196
  */
197
  public function grid_shortcode( $atts ) {
198
  extract( shortcode_atts( array(
199
- 'rows' => get_option('enjoyinstagram_grid_rows'),
200
- 'cols' => get_option('enjoyinstagram_grid_cols')
201
  ), $atts ) );
202
 
203
  $client = get_option( 'enjoyinstagram_access_token', '' );
204
- if( ! $client || is_null( $client ) ) {
205
  return '';
206
  }
207
 
@@ -234,7 +235,7 @@ class EnjoyInstagram_Shortcodes {
234
  ), $atts));
235
 
236
  $client = get_option( 'enjoyinstagram_access_token', '' );
237
- if( ! $client || is_null( $client ) ) {
238
  return '';
239
  }
240
 
@@ -265,7 +266,7 @@ class EnjoyInstagram_Shortcodes {
265
  ), $atts ) );
266
 
267
  $client = get_option( 'enjoyinstagram_access_token', '' );
268
- if( ! $client || is_null( $client ) ) {
269
  return '';
270
  }
271
 
137
  */
138
  protected function _get_shortcode_data( $type = '' ){
139
  $data = array();
140
+ ! $type && $type = get_option('enjoyinstagram_user_or_hashtag', 'user');
141
  if( $type == 'hashtag' ){
142
  $result = EnjoyInstagram_Api_Connection()->get_hash( urlencode( get_option('enjoyinstagram_hashtag') ), 20 );
143
  } else {
168
  ), $atts ) );
169
 
170
  $client = get_option( 'enjoyinstagram_access_token', '' );
171
+
172
+ if( ! $client ) {
173
  return '';
174
  }
175
 
176
+ $items_num = get_option('enjoyinstagram_carousel_items_number', '4');
177
+ $nav = get_option('enjoyinstagram_carousel_navigation', 'false');
178
  $result = $this->_get_shortcode_data();
179
  if( empty( $result ) ) {
180
  return '';
197
  */
198
  public function grid_shortcode( $atts ) {
199
  extract( shortcode_atts( array(
200
+ 'rows' => get_option('enjoyinstagram_grid_rows', '2'),
201
+ 'cols' => get_option('enjoyinstagram_grid_cols', '5')
202
  ), $atts ) );
203
 
204
  $client = get_option( 'enjoyinstagram_access_token', '' );
205
+ if( ! $client ) {
206
  return '';
207
  }
208
 
235
  ), $atts));
236
 
237
  $client = get_option( 'enjoyinstagram_access_token', '' );
238
+ if( ! $client ) {
239
  return '';
240
  }
241
 
266
  ), $atts ) );
267
 
268
  $client = get_option( 'enjoyinstagram_access_token', '' );
269
+ if( ! $client ) {
270
  return '';
271
  }
272
 
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.google.com/url?q=https%3A%2F%2Fwww.paypal.com%2Fcgi-bin
4
  Tags: Instagram, Instagram feed, Instagram grid, Instagram carousel, Widget Instagram, Embed Instagram, Embed Instagram feed, Instagram feed on website, responsive carousel, WordPress carousel, Instagram gallery, Instagram WordPress, Instagram pictures
5
  Requires at least: 3.0.1
6
  Tested up to: 4.9
7
- Version: 4.0.0
8
- Stable tag: 4.0.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -192,6 +192,9 @@ In the Setting section yon can customize grid and/or Carousel view
192
 
193
  == Changelog ==
194
 
 
 
 
195
  = 4.0.0 =
196
  * Code rewritten and optimized
197
  * Code Ready for localization
4
  Tags: Instagram, Instagram feed, Instagram grid, Instagram carousel, Widget Instagram, Embed Instagram, Embed Instagram feed, Instagram feed on website, responsive carousel, WordPress carousel, Instagram gallery, Instagram WordPress, Instagram pictures
5
  Requires at least: 3.0.1
6
  Tested up to: 4.9
7
+ Version: 4.0.1
8
+ Stable tag: 4.0.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
192
 
193
  == Changelog ==
194
 
195
+ = 4.0.1 =
196
+ * Bug fix for user access token
197
+ * Add default option value to avoid empty shortcodes
198
  = 4.0.0 =
199
  * Code rewritten and optimized
200
  * Code Ready for localization
templates/admin/enjoyinstagram-advanced-settings.php CHANGED
@@ -41,23 +41,23 @@ if (!defined('ABSPATH')) {
41
  </div>
42
  <div class="ei_settings_float_block">
43
  <input type="radio"
44
- name="enjoyinstagram_user_or_hashtag" <?php checked('user', get_option('enjoyinstagram_user_or_hashtag')) ?>
45
  value="user">
46
  <?php _ex('of Your Profile', 'option label', 'enjoyinstagram'); ?><br/><br/>
47
  <input type="radio"
48
- name="enjoyinstagram_user_or_hashtag" <?php checked('hashtag', get_option('enjoyinstagram_user_or_hashtag')) ?>
49
  value="hashtag">
50
  <?php _ex('by Hashtag', 'option label', 'enjoyinstagram'); ?><br/>
51
  </div>
52
  <div class="ei_settings_float_block">
53
  <div id="enjoyinstagram_user_or_hashtag_user"
54
- class="desc" <?php if (get_option('enjoyinstagram_user_or_hashtag') != 'user') echo 'style="display:none;"'; ?>>
55
  <input type="text" class="ei_disabled" id="enjoyinstagram_user" disabled
56
  value="<?php echo get_option('enjoyinstagram_user_username'); ?>"
57
  name="enjoyinstagram_user"/>
58
  </div>
59
  <div id="enjoyinstagram_user_or_hashtag_hashtag"
60
- class="desc" <?php if (get_option('enjoyinstagram_user_or_hashtag') != 'hashtag') echo 'style="display:none;"'; ?>>
61
  #<input type="text" id="enjoyinstagram_hashtag" required
62
  value="<?php echo get_option('enjoyinstagram_hashtag'); ?>"
63
  name="enjoyinstagram_hashtag"/>
@@ -91,7 +91,7 @@ if (!defined('ABSPATH')) {
91
  <select name="enjoyinstagram_carousel_items_number" class="ei_sel"
92
  id="enjoyinstagram_carousel_items_number">
93
  <?php for ($i = 1; $i <= 10; $i++): ?>
94
- <option value="<?php echo $i ?>" <?php selected($i, get_option('enjoyinstagram_carousel_items_number')); ?>>
95
  <?php echo "&nbsp;" . $i; ?>
96
  </option>
97
  <?php endfor; ?>
@@ -107,10 +107,10 @@ if (!defined('ABSPATH')) {
107
  <div class="ei_settings_float_block">
108
  <select name="enjoyinstagram_carousel_navigation" class="ei_sel"
109
  id="enjoyinstagram_carousel_navigation">
110
- <option value="true" <?php selected('true', get_option('enjoyinstagram_carousel_navigation')); ?>>
111
  <?php _e('Yes', 'enjoyinstagram'); ?>
112
  </option>
113
- <option value="false" <?php selected('false', get_option('enjoyinstagram_carousel_navigation')); ?>>
114
  <?php _e('No', 'enjoyinstagram'); ?>
115
  </option>
116
  </select>
@@ -140,7 +140,7 @@ if (!defined('ABSPATH')) {
140
  <div class="ei_settings_float_block">
141
  <select name="enjoyinstagram_grid_cols" id="enjoyinstagram_grid_cols" class="ei_sel">
142
  <?php for ($i = 1; $i <= 10; $i++) : ?>
143
- <option value="<?php echo $i ?>" <?php selected($i, get_option('enjoyinstagram_grid_cols')); ?>>
144
  <?php echo "&nbsp;" . $i; ?>
145
  </option>
146
  <?php endfor; ?>
@@ -157,7 +157,7 @@ if (!defined('ABSPATH')) {
157
  <div class="ei_settings_float_block">
158
  <select name="enjoyinstagram_grid_rows" id="enjoyinstagram_grid_rows" class="ei_sel">
159
  <?php for ($i = 1; $i <= 10; $i++) : ?>
160
- <option value="<?php echo $i ?>" <?php selected($i, get_option('enjoyinstagram_grid_rows')); ?>>
161
  <?php echo "&nbsp;" . $i; ?>
162
  </option>
163
  <?php endfor; ?>
41
  </div>
42
  <div class="ei_settings_float_block">
43
  <input type="radio"
44
+ name="enjoyinstagram_user_or_hashtag" <?php checked('user', get_option('enjoyinstagram_user_or_hashtag', 'user')) ?>
45
  value="user">
46
  <?php _ex('of Your Profile', 'option label', 'enjoyinstagram'); ?><br/><br/>
47
  <input type="radio"
48
+ name="enjoyinstagram_user_or_hashtag" <?php checked('hashtag', get_option('enjoyinstagram_user_or_hashtag', 'user')) ?>
49
  value="hashtag">
50
  <?php _ex('by Hashtag', 'option label', 'enjoyinstagram'); ?><br/>
51
  </div>
52
  <div class="ei_settings_float_block">
53
  <div id="enjoyinstagram_user_or_hashtag_user"
54
+ class="desc" <?php if (get_option('enjoyinstagram_user_or_hashtag', 'user') != 'user') echo 'style="display:none;"'; ?>>
55
  <input type="text" class="ei_disabled" id="enjoyinstagram_user" disabled
56
  value="<?php echo get_option('enjoyinstagram_user_username'); ?>"
57
  name="enjoyinstagram_user"/>
58
  </div>
59
  <div id="enjoyinstagram_user_or_hashtag_hashtag"
60
+ class="desc" <?php if (get_option('enjoyinstagram_user_or_hashtag', 'user') != 'hashtag') echo 'style="display:none;"'; ?>>
61
  #<input type="text" id="enjoyinstagram_hashtag" required
62
  value="<?php echo get_option('enjoyinstagram_hashtag'); ?>"
63
  name="enjoyinstagram_hashtag"/>
91
  <select name="enjoyinstagram_carousel_items_number" class="ei_sel"
92
  id="enjoyinstagram_carousel_items_number">
93
  <?php for ($i = 1; $i <= 10; $i++): ?>
94
+ <option value="<?php echo $i ?>" <?php selected($i, get_option('enjoyinstagram_carousel_items_number', '4')); ?>>
95
  <?php echo "&nbsp;" . $i; ?>
96
  </option>
97
  <?php endfor; ?>
107
  <div class="ei_settings_float_block">
108
  <select name="enjoyinstagram_carousel_navigation" class="ei_sel"
109
  id="enjoyinstagram_carousel_navigation">
110
+ <option value="true" <?php selected('true', get_option('enjoyinstagram_carousel_navigation', 'false')); ?>>
111
  <?php _e('Yes', 'enjoyinstagram'); ?>
112
  </option>
113
+ <option value="false" <?php selected('false', get_option('enjoyinstagram_carousel_navigation', 'false')); ?>>
114
  <?php _e('No', 'enjoyinstagram'); ?>
115
  </option>
116
  </select>
140
  <div class="ei_settings_float_block">
141
  <select name="enjoyinstagram_grid_cols" id="enjoyinstagram_grid_cols" class="ei_sel">
142
  <?php for ($i = 1; $i <= 10; $i++) : ?>
143
+ <option value="<?php echo $i ?>" <?php selected($i, get_option('enjoyinstagram_grid_cols', '5')); ?>>
144
  <?php echo "&nbsp;" . $i; ?>
145
  </option>
146
  <?php endfor; ?>
157
  <div class="ei_settings_float_block">
158
  <select name="enjoyinstagram_grid_rows" id="enjoyinstagram_grid_rows" class="ei_sel">
159
  <?php for ($i = 1; $i <= 10; $i++) : ?>
160
+ <option value="<?php echo $i ?>" <?php selected($i, get_option('enjoyinstagram_grid_rows', '2')); ?>>
161
  <?php echo "&nbsp;" . $i; ?>
162
  </option>
163
  <?php endfor; ?>