AccessPress Instagram Feed - Version 2.1.1

Version Description

  • Updated the follow widget - Added an option to disable the header div, Added option to link images to instagram.
  • Done the bug fixing for the options available for follow widget.
Download this release

Release Info

Developer Access Keys
Plugin Icon 128x128 AccessPress Instagram Feed
Version 2.1.1
Comparing to
See all releases

Code changes from version 2.1.0 to 2.1.1

accesspress-instagram-feed.php CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
4
  Plugin name: AccessPress Instagram Feed
5
  Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed/
6
  Description: A plugin to add various instagram widgets with dynamic configuration options.
7
- Version: 2.1.0
8
  Author: AccessPress Themes
9
  Author URI: http://accesspressthemes.com
10
  Text Domain:accesspress-instagram-feed
@@ -14,7 +14,7 @@ License: GPLv2 or later
14
 
15
  //Decleration of the necessary constants for plugin
16
  if( !defined( 'APIF_VERSION' ) ) {
17
- define( 'APIF_VERSION', '2.1.0' );
18
  }
19
 
20
  if( !defined( 'APIF_IMAGE_DIR' ) ) {
4
  Plugin name: AccessPress Instagram Feed
5
  Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed/
6
  Description: A plugin to add various instagram widgets with dynamic configuration options.
7
+ Version: 2.1.1
8
  Author: AccessPress Themes
9
  Author URI: http://accesspressthemes.com
10
  Text Domain:accesspress-instagram-feed
14
 
15
  //Decleration of the necessary constants for plugin
16
  if( !defined( 'APIF_VERSION' ) ) {
17
+ define( 'APIF_VERSION', '2.1.1' );
18
  }
19
 
20
  if( !defined( 'APIF_IMAGE_DIR' ) ) {
css/frontend.css CHANGED
@@ -196,13 +196,19 @@ span.instagram_like_count {
196
  width: 31.33%;
197
  float: left;
198
  margin-right: 3%;
199
- margin-bottom: 3%;
200
  list-style: none;
201
  overflow: hidden;
202
- height: 100px
 
203
 
204
  }
205
 
 
 
 
 
 
206
  .instagram-widget li:nth-child(3n){
207
  margin-right: 0
208
  }
@@ -215,11 +221,11 @@ span.instagram_like_count {
215
  line-height: normal;
216
  position: relative;
217
  }
218
- .widget_apif_sidewidget .profile{
219
  background:#295988;
220
  padding:10px;
221
  }
222
- .widget_apif_sidewidget .profile-img{
223
  width:15%;
224
  border:1px solid #ffffff;
225
  overflow: hidden;
@@ -228,14 +234,14 @@ span.instagram_like_count {
228
  vertical-align: middle;
229
 
230
  }
231
- .widget_apif_sidewidget .profile-img img{
232
  width:100%;
233
  height:100%;
234
  border-radius: 100%;
235
  display: inline-block;
236
  vertical-align: middle;
237
  }
238
- .widget_apif_sidewidget .profile-name{
239
  font-size:16px;
240
  font-weight:bold;
241
  text-transform: uppercase;
@@ -246,13 +252,14 @@ span.instagram_like_count {
246
  vertical-align: middle;
247
  margin-left: 10px;
248
  }
249
- .widget_apif_sidewidget .profile-follow{
250
  background: #F8F8F8;
251
  padding:5px;
252
  border-bottom:1px solid #eeeeee;
253
  position:relative;
 
254
  }
255
- .widget_apif_sidewidget .profile-follow>div{
256
  float:left;
257
  width:25%;
258
  text-align:center;
@@ -260,14 +267,14 @@ span.instagram_like_count {
260
  font-size:12px;
261
  color:#295988;
262
  }
263
- .widget_apif_sidewidget .profile-follow>div>span{
264
  display: block;
265
  font-weight:normal;
266
  font-size:10px;
267
  color:#999999;
268
  text-transform: capitalize;
269
  }
270
- .widget_apif_sidewidget .profile-follow .follow{
271
  position:absolute;
272
  top:0;
273
  right:0;
@@ -278,7 +285,7 @@ span.instagram_like_count {
278
  .widget_apif_sidewidget .follow-inner {
279
  height: 100%;
280
  }
281
- .widget_apif_sidewidget .profile-follow .follow a{
282
  display: inline-block;
283
  width:100%;
284
  padding:5px 0px;
@@ -289,7 +296,7 @@ span.instagram_like_count {
289
  font-weight:bold;
290
  font-size:10px;
291
  }
292
- .widget_apif_sidewidget .profile-follow .follow a:hover{
293
  background:transparent;
294
  color:#275A89;
295
  border:1px solid #275A89;
196
  width: 31.33%;
197
  float: left;
198
  margin-right: 3%;
199
+ margin-bottom: 1%;
200
  list-style: none;
201
  overflow: hidden;
202
+ height: auto;
203
+ padding-top: 5px;
204
 
205
  }
206
 
207
+ .widget_apif_sidewidget > :last-child {
208
+ margin-bottom: 0;
209
+ padding-top: 3px;
210
+ }
211
+
212
  .instagram-widget li:nth-child(3n){
213
  margin-right: 0
214
  }
221
  line-height: normal;
222
  position: relative;
223
  }
224
+ .widget_apif_sidewidget .apif-profile{
225
  background:#295988;
226
  padding:10px;
227
  }
228
+ .widget_apif_sidewidget .apif-profile-img{
229
  width:15%;
230
  border:1px solid #ffffff;
231
  overflow: hidden;
234
  vertical-align: middle;
235
 
236
  }
237
+ .widget_apif_sidewidget .apif-profile-img img{
238
  width:100%;
239
  height:100%;
240
  border-radius: 100%;
241
  display: inline-block;
242
  vertical-align: middle;
243
  }
244
+ .widget_apif_sidewidget .apif-profile-name{
245
  font-size:16px;
246
  font-weight:bold;
247
  text-transform: uppercase;
252
  vertical-align: middle;
253
  margin-left: 10px;
254
  }
255
+ .widget_apif_sidewidget .apif-profile-follow{
256
  background: #F8F8F8;
257
  padding:5px;
258
  border-bottom:1px solid #eeeeee;
259
  position:relative;
260
+ min-height: 45px;
261
  }
262
+ .widget_apif_sidewidget .apif-profile-follow>div{
263
  float:left;
264
  width:25%;
265
  text-align:center;
267
  font-size:12px;
268
  color:#295988;
269
  }
270
+ .widget_apif_sidewidget .apif-profile-follow>div>span{
271
  display: block;
272
  font-weight:normal;
273
  font-size:10px;
274
  color:#999999;
275
  text-transform: capitalize;
276
  }
277
+ .widget_apif_sidewidget .apif-profile-follow .follow{
278
  position:absolute;
279
  top:0;
280
  right:0;
285
  .widget_apif_sidewidget .follow-inner {
286
  height: 100%;
287
  }
288
+ .widget_apif_sidewidget .apif-profile-follow .follow a{
289
  display: inline-block;
290
  width:100%;
291
  padding:5px 0px;
296
  font-weight:bold;
297
  font-size:10px;
298
  }
299
+ .widget_apif_sidewidget .apif-profile-follow .follow a:hover{
300
  background:transparent;
301
  color:#275A89;
302
  border:1px solid #275A89;
inc/backend/widgetside.php CHANGED
@@ -31,11 +31,13 @@ class APIF_SideWidget extends WP_Widget {
31
  echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
32
  }
33
 
34
- $instagram_num_img = isset($instance['instagram_num_img']) ? $instance['instagram_num_img']:'12';
35
- $instance_post = (isset($instance['instance_post']) && $instance['instance_post']==1)?'true':'false';
 
36
  $instance_followers = (isset($instance['instance_followers']) && $instance['instance_followers']==1)?'true':'false';
37
  $instance_following = (isset($instance['instance_following']) && $instance['instance_following']==1)?'true':'false';
38
- $instance_follow = (isset($instance['instance_follow']) && $instance['instance_follow']==1)?'true':'false';
 
39
 
40
 
41
  global $apif_settings, $insta;
@@ -50,38 +52,51 @@ class APIF_SideWidget extends WP_Widget {
50
  $response = json_decode($connection['body'], true);
51
  ?>
52
  <div class="instagram-header">
53
- <header class="profile clearfix">
54
- <div class="profile-img">
55
- <img src="<?php echo $response['data']['profile_picture']; ?>"/>
56
- </div>
57
- <div class="profile-name">
58
- <?php echo $response['data']['full_name']; ?>
59
- </div>
60
- </header>
61
- <header class="profile-follow clearfix">
62
- <div class="post">
63
- <?php echo $response['data']['counts']['media']; ?>
64
- <span>post</span>
65
- </div>
66
- <div class="followers">
67
- <?php echo $response['data']['counts']['followed_by']; ?>
68
- <span>followers</span>
69
- </div>
70
- <div class="following">
71
- <?php echo $response['data']['counts']['follows']; ?>
72
- <span>following</span>
73
  </div>
74
- <div class="follow">
75
- <div class="follow-inner">
76
- <div class="table-outer">
77
- <div class="table-inner">
78
- <a href="https://instagram.com/<?php echo $apif_settings['username']; ?>" target='_blank' title='Follow <?php echo $apif_settings['username']; ?>' >follow</a>
79
- <?php //echo $response['data']['link']; ?>
80
- </div>
81
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  </div>
83
  </div>
84
- </header>
85
  </div>
86
  <?php
87
 
@@ -103,8 +118,12 @@ class APIF_SideWidget extends WP_Widget {
103
  }
104
  $j++;
105
  $img = $vm['images']['thumbnail']['url'];
106
- ?>
107
- <li><img src="<?php echo esc_url($img); ?>"></li>
 
 
 
 
108
  <?php
109
  }
110
  echo '</ul>';
@@ -121,12 +140,13 @@ class APIF_SideWidget extends WP_Widget {
121
  */
122
  public function form($instance) {
123
  $title = isset($instance['title'])?$instance['title']:'';
124
- $instagram_num_img = isset($instance['instagram_num_img'])?$instance['instagram_num_img']:'';
125
-
126
- $instance_post = isset($instance['instance_post'])?$instance['instance_post']:'';
127
- $instance_followers = isset($instance['instance_followers'])?$instance['instance_followers']:'';
128
- $instance_following = isset($instance['instance_following'])?$instance['instance_following']:'';
129
- $instance_follow = isset($instance['instance_follow'])?$instance['instance_follow']:'';
 
130
 
131
  ?>
132
  <p>
@@ -146,24 +166,33 @@ class APIF_SideWidget extends WP_Widget {
146
  </select>
147
  </p>
148
  <p>
149
- <label for="<?php echo $this->get_field_id('instance_post'); ?>"><?php _e('Display Instagram Post :', 'accesspress-instagram-feed'); ?></label>
 
 
 
 
150
  <input class="widefat" id="<?php echo $this->get_field_id('instance_post'); ?>" name="<?php echo $this->get_field_name('instance_post'); ?>" type="checkbox" value="1" <?php checked($instance_post,true);?>/>
151
  </p>
152
 
153
  <p>
154
- <label for="<?php echo $this->get_field_id('instance_followers'); ?>"><?php _e('Display Followers :', 'accesspress-instagram-feed'); ?></label>
155
  <input class="widefat" id="<?php echo $this->get_field_id('instance_followers'); ?>" name="<?php echo $this->get_field_name('instance_followers'); ?>" type="checkbox" value="1" <?php checked($instance_followers,true);?>/>
156
  </p>
157
 
158
  <p>
159
- <label for="<?php echo $this->get_field_id('instance_following'); ?>"><?php _e('Display Instagram Following :', 'accesspress-instagram-feed'); ?></label>
160
  <input class="widefat" id="<?php echo $this->get_field_id('instance_following'); ?>" name="<?php echo $this->get_field_name('instance_following'); ?>" type="checkbox" value="1" <?php checked($instance_following,true);?>/>
161
  </p>
162
 
163
  <p>
164
- <label for="<?php echo $this->get_field_id('instance_follow'); ?>"><?php _e('Display Instagram Follow Button :', 'accesspress-instagram-feed'); ?></label>
165
  <input class="widefat" id="<?php echo $this->get_field_id('instance_follow'); ?>" name="<?php echo $this->get_field_name('instance_follow'); ?>" type="checkbox" value="1" <?php checked($instance_follow,true);?>/>
166
  </p>
 
 
 
 
 
167
  <?php
168
  }
169
 
@@ -182,10 +211,12 @@ class APIF_SideWidget extends WP_Widget {
182
  $instance['title'] = (!empty($new_instance['title']) ) ? sanitize_text_field($new_instance['title']) : '';
183
  $instance['instagram_num_img'] = (!empty($new_instance['instagram_num_img']) ) ? sanitize_text_field($new_instance['instagram_num_img']) : '';
184
 
 
185
  $instance['instance_post'] = (!empty($new_instance['instance_post']) ) ? sanitize_text_field($new_instance['instance_post']) : '';
186
  $instance['instance_followers'] = (!empty($new_instance['instance_followers']) ) ? sanitize_text_field($new_instance['instance_followers']) : '';
187
  $instance['instance_following'] = (!empty($new_instance['instance_following']) ) ? sanitize_text_field($new_instance['instance_following']) : '';
188
  $instance['instance_follow'] = (!empty($new_instance['instance_follow']) ) ? sanitize_text_field($new_instance['instance_follow']) : '';
 
189
  return $instance;
190
  }
191
  }
31
  echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
32
  }
33
 
34
+ $instagram_num_img = isset($instance['instagram_num_img']) ? $instance['instagram_num_img']:'12';
35
+ $instance_header = (isset($instance['hide_header']) && $instance['hide_header']==1)?'true':'false';
36
+ $instance_post = (isset($instance['instance_post']) && $instance['instance_post']==1)?'true':'false';
37
  $instance_followers = (isset($instance['instance_followers']) && $instance['instance_followers']==1)?'true':'false';
38
  $instance_following = (isset($instance['instance_following']) && $instance['instance_following']==1)?'true':'false';
39
+ $instance_follow = (isset($instance['instance_follow']) && $instance['instance_follow']==1)?'true':'false';
40
+ $instance_image_link= (isset($instance['instance_image_link']) && $instance['instance_image_link']==1) ? 'true' : 'false';
41
 
42
 
43
  global $apif_settings, $insta;
52
  $response = json_decode($connection['body'], true);
53
  ?>
54
  <div class="instagram-header">
55
+
56
+ <?php if($instance_header != 'true'){ ?>
57
+ <div class="apif-profile clearfix">
58
+ <div class="apif-profile-img">
59
+ <img src="<?php echo $response['data']['profile_picture']; ?>"/>
60
+ </div>
61
+ <div class="apif-profile-name">
62
+ <?php echo $response['data']['full_name']; ?>
63
+ </div>
 
 
 
 
 
 
 
 
 
 
 
64
  </div>
65
+ <?php } ?>
66
+
67
+ <?php if($instance_post != 'true' || $instance_followers != 'true' || $instance_following != 'true' || $instance_follow != 'true'): ?>
68
+ <div class="apif-profile-follow clearfix">
69
+ <div class="post">
70
+ <?php if($instance_post != 'true'): ?>
71
+ <?php echo $response['data']['counts']['media']; ?>
72
+ <span>post</span>
73
+ <?php endif; ?>
74
+ </div>
75
+ <div class="followers">
76
+ <?php if($instance_followers != 'true'): ?>
77
+ <?php echo $response['data']['counts']['followed_by']; ?>
78
+ <span>followers</span>
79
+ <?php endif; ?>
80
+ </div>
81
+ <div class="following">
82
+ <?php if($instance_following != 'true'): ?>
83
+ <?php echo $response['data']['counts']['follows']; ?>
84
+ <span>following</span>
85
+ <?php endif; ?>
86
+ </div>
87
+ <div class="follow">
88
+ <?php if($instance_follow != 'true'): ?>
89
+ <div class="follow-inner">
90
+ <div class="table-outer">
91
+ <div class="table-inner">
92
+ <a href="https://instagram.com/<?php echo $apif_settings['username']; ?>" target='_blank' title='Follow <?php echo $apif_settings['username']; ?>' >follow</a>
93
+ </div>
94
+ </div>
95
+ </div>
96
+ <?php endif; ?>
97
  </div>
98
  </div>
99
+ <?php endif; ?>
100
  </div>
101
  <?php
102
 
118
  }
119
  $j++;
120
  $img = $vm['images']['thumbnail']['url'];
121
+ ?>
122
+ <?php if($instance_image_link == 'true'){ ?>
123
+ <li><a href='<?php echo $vm['link']; ?>' target='_blank'><img src="<?php echo esc_url($img); ?>" alt='<?php echo $vm['caption']['text']; ?>' /></a></li>
124
+ <?php }else{ ?>
125
+ <li><img src="<?php echo esc_url($img); ?>" alt='<?php echo $vm['caption']['text']; ?>' /></li>
126
+ <?php } ?>
127
  <?php
128
  }
129
  echo '</ul>';
140
  */
141
  public function form($instance) {
142
  $title = isset($instance['title'])?$instance['title']:'';
143
+ $instagram_num_img = isset($instance['instagram_num_img']) ? $instance['instagram_num_img']:'';
144
+ $instance_header = isset($instance['hide_header']) ? $instance['hide_header']:'';
145
+ $instance_post = isset($instance['instance_post']) ? $instance['instance_post']:'';
146
+ $instance_followers = isset($instance['instance_followers']) ? $instance['instance_followers']:'';
147
+ $instance_following = isset($instance['instance_following']) ? $instance['instance_following']:'';
148
+ $instance_follow = isset($instance['instance_follow']) ? $instance['instance_follow']:'';
149
+ $instance_image_link = isset($instance['instance_image_link']) ? $instance['instance_image_link']:'';
150
 
151
  ?>
152
  <p>
166
  </select>
167
  </p>
168
  <p>
169
+ <label for="<?php echo $this->get_field_id('hide_header'); ?>"><?php _e('Hide Header :', 'accesspress-instagram-feed'); ?></label>
170
+ <input class="widefat" id="<?php echo $this->get_field_id('hide_header'); ?>" name="<?php echo $this->get_field_name('hide_header'); ?>" type="checkbox" value="1" <?php checked($instance_header,true);?>/>
171
+ </p>
172
+ <p>
173
+ <label for="<?php echo $this->get_field_id('instance_post'); ?>"><?php _e('Hide Instagram Post :', 'accesspress-instagram-feed'); ?></label>
174
  <input class="widefat" id="<?php echo $this->get_field_id('instance_post'); ?>" name="<?php echo $this->get_field_name('instance_post'); ?>" type="checkbox" value="1" <?php checked($instance_post,true);?>/>
175
  </p>
176
 
177
  <p>
178
+ <label for="<?php echo $this->get_field_id('instance_followers'); ?>"><?php _e('Hide Followers :', 'accesspress-instagram-feed'); ?></label>
179
  <input class="widefat" id="<?php echo $this->get_field_id('instance_followers'); ?>" name="<?php echo $this->get_field_name('instance_followers'); ?>" type="checkbox" value="1" <?php checked($instance_followers,true);?>/>
180
  </p>
181
 
182
  <p>
183
+ <label for="<?php echo $this->get_field_id('instance_following'); ?>"><?php _e('Hide Instagram Following :', 'accesspress-instagram-feed'); ?></label>
184
  <input class="widefat" id="<?php echo $this->get_field_id('instance_following'); ?>" name="<?php echo $this->get_field_name('instance_following'); ?>" type="checkbox" value="1" <?php checked($instance_following,true);?>/>
185
  </p>
186
 
187
  <p>
188
+ <label for="<?php echo $this->get_field_id('instance_follow'); ?>"><?php _e('Hide Instagram Follow Button :', 'accesspress-instagram-feed'); ?></label>
189
  <input class="widefat" id="<?php echo $this->get_field_id('instance_follow'); ?>" name="<?php echo $this->get_field_name('instance_follow'); ?>" type="checkbox" value="1" <?php checked($instance_follow,true);?>/>
190
  </p>
191
+
192
+ <p>
193
+ <label for="<?php echo $this->get_field_id('instance_image_link'); ?>"><?php _e('Link Images to Instagram :', 'accesspress-instagram-feed'); ?></label>
194
+ <input class="widefat" id="<?php echo $this->get_field_id('instance_image_link'); ?>" name="<?php echo $this->get_field_name('instance_image_link'); ?>" type="checkbox" value="1" <?php checked($instance_image_link,true);?>/>
195
+ </p>
196
  <?php
197
  }
198
 
211
  $instance['title'] = (!empty($new_instance['title']) ) ? sanitize_text_field($new_instance['title']) : '';
212
  $instance['instagram_num_img'] = (!empty($new_instance['instagram_num_img']) ) ? sanitize_text_field($new_instance['instagram_num_img']) : '';
213
 
214
+ $instance['hide_header'] = (!empty($new_instance['hide_header']) ) ? sanitize_text_field($new_instance['hide_header']) : '';
215
  $instance['instance_post'] = (!empty($new_instance['instance_post']) ) ? sanitize_text_field($new_instance['instance_post']) : '';
216
  $instance['instance_followers'] = (!empty($new_instance['instance_followers']) ) ? sanitize_text_field($new_instance['instance_followers']) : '';
217
  $instance['instance_following'] = (!empty($new_instance['instance_following']) ) ? sanitize_text_field($new_instance['instance_following']) : '';
218
  $instance['instance_follow'] = (!empty($new_instance['instance_follow']) ) ? sanitize_text_field($new_instance['instance_follow']) : '';
219
+ $instance['instance_image_link'] = (!empty($new_instance['instance_image_link']) ) ? sanitize_text_field($new_instance['instance_image_link']) : '';
220
  return $instance;
221
  }
222
  }
inc/frontend/instagram-feed.php CHANGED
@@ -5,7 +5,7 @@ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
5
  $username = !empty($apif_settings['username']) ? $apif_settings['username'] : ''; // your username
6
  $access_token = !empty($apif_settings['access_token']) ? $apif_settings['access_token'] : '';
7
  $layout = $apif_settings['instagram_mosaic'];
8
- $image_like = $apif_settings['active'];
9
  $count = 7; // number of images to show
10
  require_once('instagram.php');
11
  $ins_media = $insta->userMedia();
5
  $username = !empty($apif_settings['username']) ? $apif_settings['username'] : ''; // your username
6
  $access_token = !empty($apif_settings['access_token']) ? $apif_settings['access_token'] : '';
7
  $layout = $apif_settings['instagram_mosaic'];
8
+ $image_like = isset($apif_settings['active']) ? $apif_settings['active'] : '';
9
  $count = 7; // number of images to show
10
  require_once('instagram.php');
11
  $ins_media = $insta->userMedia();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: instagram, instagram feed, instagram tag, instagram slider, instagarm mosa
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.5
7
- Stable tag: 2.1.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -130,6 +130,10 @@ Once you install the plugin , you can check some general documentation about how
130
  5. Backend Display Settings Section
131
 
132
  == Changelog ==
 
 
 
 
133
  = 2.1.0 =
134
  * Done the bug fixings and optimization of code.
135
  * Done the plugin compactibility test for wordpress version 4.5
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.5
7
+ Stable tag: 2.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
130
  5. Backend Display Settings Section
131
 
132
  == Changelog ==
133
+ = 2.1.1 =
134
+ * Updated the follow widget - Added an option to disable the header div, Added option to link images to instagram.
135
+ * Done the bug fixing for the options available for follow widget.
136
+
137
  = 2.1.0 =
138
  * Done the bug fixings and optimization of code.
139
  * Done the plugin compactibility test for wordpress version 4.5