AccessPress Instagram Feed - Version 4.0.0

Version Description

  • Made plugin compatible with latest changes in instagram api.
  • Fixed slider issue and added setting to display videos
Download this release

Release Info

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

Code changes from version 3.1.5 to 4.0.0

accesspress-instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin name: AccessPress iFeeds
4
  Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed/
5
  Description: Display feeds of your instagram using shortcode and widgets.
6
- Version: 3.1.5
7
  Author: AccessPress Themes
8
  Author URI: http://accesspressthemes.com
9
  Text Domain: accesspress-instagram-feed
@@ -13,7 +13,7 @@ License: GPLv2 or later
13
 
14
  //Decleration of the necessary constants for plugin
15
  if( !defined( 'APIF_VERSION' ) ) {
16
- define( 'APIF_VERSION', '3.1.5' );
17
  }
18
 
19
  if( !defined( 'APIF_IMAGE_DIR' ) ) {
@@ -81,7 +81,7 @@ if( !class_exists( 'IF_Class' ) ) {
81
  'demo' => '<a href="http://demo.accesspressthemes.com/wordpress-plugins/accesspress-instagram-feeds/" target="_blank"><span class="dashicons dashicons-welcome-view-site"></span>Live Demo</a>',
82
  'doc' => '<a href="https://accesspressthemes.com/documentation/accesspress-instagram-feeds/" target="_blank"><span class="dashicons dashicons-media-document"></span>Documentation</a>',
83
  'support' => '<a href="http://accesspressthemes.com/support" target="_blank"><span class="dashicons dashicons-admin-users"></span>Support</a>',
84
- 'pro' => '<a href="https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-instagram-feed-pro%2F14291754" target="_blank"><span class="dashicons dashicons-cart"></span>Premium version</a>'
85
  );
86
  $links = array_merge( $links, $new_links );
87
  }
@@ -92,7 +92,7 @@ if( !class_exists( 'IF_Class' ) ) {
92
  function admin_footer_text( $text ){
93
  if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'if-instagram-feed') {
94
  $link = 'https://wordpress.org/support/plugin/accesspress-instagram-feed/reviews/#new-post';
95
- $pro_link = 'https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-instagram-feed-pro%2F14291754';
96
  $text = 'Enjoyed AccessPress iFeeds? <a href="' . $link . '" target="_blank">Please leave us a ★★★★★ rating</a> We really appreciate your support! | Try premium version of <a href="' . $pro_link . '" target="_blank">AccessPress Instagram Feeds Pro</a> - more features, more power!';
97
  return $text;
98
  } else {
@@ -106,7 +106,7 @@ if( !class_exists( 'IF_Class' ) ) {
106
  exit();
107
  }
108
  if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'apif-premium' ) {
109
- wp_redirect( 'https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-instagram-feed-pro%2F14291754' );
110
  exit();
111
  }
112
  }
3
  Plugin name: AccessPress iFeeds
4
  Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed/
5
  Description: Display feeds of your instagram using shortcode and widgets.
6
+ Version: 4.0.0
7
  Author: AccessPress Themes
8
  Author URI: http://accesspressthemes.com
9
  Text Domain: accesspress-instagram-feed
13
 
14
  //Decleration of the necessary constants for plugin
15
  if( !defined( 'APIF_VERSION' ) ) {
16
+ define( 'APIF_VERSION', '4.0.0' );
17
  }
18
 
19
  if( !defined( 'APIF_IMAGE_DIR' ) ) {
81
  'demo' => '<a href="http://demo.accesspressthemes.com/wordpress-plugins/accesspress-instagram-feeds/" target="_blank"><span class="dashicons dashicons-welcome-view-site"></span>Live Demo</a>',
82
  'doc' => '<a href="https://accesspressthemes.com/documentation/accesspress-instagram-feeds/" target="_blank"><span class="dashicons dashicons-media-document"></span>Documentation</a>',
83
  'support' => '<a href="http://accesspressthemes.com/support" target="_blank"><span class="dashicons dashicons-admin-users"></span>Support</a>',
84
+ 'pro' => '<a href="https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed-pro/" target="_blank"><span class="dashicons dashicons-cart"></span>Premium version</a>'
85
  );
86
  $links = array_merge( $links, $new_links );
87
  }
92
  function admin_footer_text( $text ){
93
  if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'if-instagram-feed') {
94
  $link = 'https://wordpress.org/support/plugin/accesspress-instagram-feed/reviews/#new-post';
95
+ $pro_link = 'https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed-pro/';
96
  $text = 'Enjoyed AccessPress iFeeds? <a href="' . $link . '" target="_blank">Please leave us a ★★★★★ rating</a> We really appreciate your support! | Try premium version of <a href="' . $pro_link . '" target="_blank">AccessPress Instagram Feeds Pro</a> - more features, more power!';
97
  return $text;
98
  } else {
106
  exit();
107
  }
108
  if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'apif-premium' ) {
109
+ wp_redirect( 'https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed-pro/' );
110
  exit();
111
  }
112
  }
css/backend.css CHANGED
@@ -88,6 +88,9 @@ clear:both;
88
  vertical-align: top;
89
  width: 200px;
90
  }
 
 
 
91
  .apsc-option-field > input[type="text"],
92
  .apsc-option-wrapper input[type="text"],
93
  .apsc-option-wrapper input[type="number"] {
88
  vertical-align: top;
89
  width: 200px;
90
  }
91
+ #apsc-board-display-settings .apsc-option-inner-wrapper label{
92
+ width:430px;
93
+ }
94
  .apsc-option-field > input[type="text"],
95
  .apsc-option-wrapper input[type="text"],
96
  .apsc-option-wrapper input[type="number"] {
css/frontend.css CHANGED
@@ -26,7 +26,8 @@
26
  margin-bottom: 0;
27
  }
28
 
29
- .thumb-view .thumb-elem.hovermove header.thumb-elem-header .featimg img.the-thumb{
 
30
  width: 130%;
31
  height: auto;
32
  position: absolute;
@@ -306,7 +307,7 @@ span.instagram_like_count {
306
  }
307
 
308
 
309
- .widget_apif_sidewidget li img{
310
  /* transition: transform .2s ease-in-out;
311
  -webkit-transition: transform .2s ease-in-out;
312
  -moz-transition: transform .2s ease-in-out;
@@ -327,7 +328,7 @@ span.instagram_like_count {
327
 
328
  }
329
 
330
- .widget_apif_sidewidget li img:hover{
331
  /* transform: scale(1);
332
  -webkit-transform: scale(1);
333
  -moz-transform: scale(1);*/
26
  margin-bottom: 0;
27
  }
28
 
29
+ .thumb-view .thumb-elem.hovermove header.thumb-elem-header .featimg img.the-thumb,
30
+ .thumb-view .thumb-elem.hovermove header.thumb-elem-header .featimg source.the-thumb{
31
  width: 130%;
32
  height: auto;
33
  position: absolute;
307
  }
308
 
309
 
310
+ .widget_apif_sidewidget li img,.widget_apif_sidewidget li video{
311
  /* transition: transform .2s ease-in-out;
312
  -webkit-transition: transform .2s ease-in-out;
313
  -moz-transition: transform .2s ease-in-out;
328
 
329
  }
330
 
331
+ .widget_apif_sidewidget li img:hover,.widget_apif_sidewidget li video:hover{
332
  /* transform: scale(1);
333
  -webkit-transform: scale(1);
334
  -moz-transform: scale(1);*/
inc/backend/boards/about.php CHANGED
@@ -30,41 +30,11 @@
30
  <div class="wpmdia-halfseperator"></div>
31
  <p><strong><?php _e('For premium upgrade, please go here:', 'accesspress-instagram-feed'); ?></strong>
32
  <br />
33
- <a href="https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-instagram-feed-pro%2F14291754" target="_blank" class="wpmm-upgrade-btn" target="_blank">Upgrade To Pro</a>
34
  </p>
35
 
36
  <div class="halfseperator"></div>
37
 
38
- <h3>Themes Compatible with the Plugin :</h3>
39
- <strong>AccessPress iFeeds</strong> works best with every WordPress theme.
40
- <p><strong>AND IF THIS PLUGIN HAS IMPRESSED YOU, THEN YOU WOULD ENJOY OUR OTHER PROJECTS TOO. DO CHECK THESE OUT :</strong></p>
41
- <ul>
42
- <li>
43
- <a href="https://wpallclub.com/">WPAll Club</a> - A complete WordPress resources club. WordPress tutorials, blogs, curated free and premium themes and plugins, WordPress deals, offers, hosting info and more.</li>
44
-
45
- <li><a href="https://themeforest.net/user/accesskeys/portfolio">Premium WordPress Themes</a> - 6 premium WordPress themes well suited for all sort of websites. Professional, well coded and highly configurable themes for you. </li>
46
-
47
- <li><a href="https://codecanyon.net/user/accesskeys/portfolio?Ref=AccessKeys">Premium WordPress Plugins</a> - 45+ premium WordPress plugins of many different types. High user ratings, great quality and best sellers in CodeCanyon marketplace.</li>
48
-
49
- <li><a href="https://accesspressthemes.com/">AccessPress Themes</a> - AccessPress Themes has 50+ beautiful and elegant, fully responsive, multipurpose themes to meet your need for free and commercial basis.</li>
50
-
51
- <li><a href="https://8degreethemes.com/">8Degree Themes</a> - 8Degree Themes offers 15+ free WordPress themes and 16+ premium WordPress themes carefully crafted with creativity.</li>
52
- </ul>
53
-
54
- <h3>Other products by AccessPress themes </h3>
55
- <div class="product">
56
- <div class="logo-product"><img src="<?php echo APIF_IMAGE_DIR;?>/aplite.png" alt="<?php esc_attr_e('AccessPress Social Counter','accesspress-instagram-feed'); ?>" /></div>
57
- <div class="productext"><p><strong>AccessPress Lite</strong> - A very popular Free WordPress theme, available in WordPress.org<br />
58
- <a href="http://accesspressthemes.com/wordpress-themes/accesspress-lite/" target="_blank">http://accesspressthemes.com/wordpress-themes/accesspress-lite/</a></p>
59
- </div>
60
- </div>
61
-
62
- <div class="product">
63
- <div class="logo-product"><img src="<?php echo APIF_IMAGE_DIR;?>/appro.png" alt="<?php esc_attr_e('AccessPress Social Counter','accesspress-instagram-feed'); ?>" /></div>
64
- <div class="productext"><p><strong>AccessPress Pro</strong> - Premium version of AccessPress lite<br />
65
- <a href="http://accesspressthemes.com/wordpress-themes/accesspress-lite/" target="_blank">http://accesspressthemes.com/wordpress-themes/accesspress-pro/</a></p>
66
- </div>
67
- </div>
68
 
69
  <div class="seperator"></div><div class="dottedline"></div><div class="seperator"></div>
70
 
30
  <div class="wpmdia-halfseperator"></div>
31
  <p><strong><?php _e('For premium upgrade, please go here:', 'accesspress-instagram-feed'); ?></strong>
32
  <br />
33
+ <a href="https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed-pro/" target="_blank" class="wpmm-upgrade-btn" target="_blank">Upgrade To Pro</a>
34
  </p>
35
 
36
  <div class="halfseperator"></div>
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  <div class="seperator"></div><div class="dottedline"></div><div class="seperator"></div>
40
 
inc/backend/boards/display-settings.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php defined( 'ABSPATH' ) or die( "No script kiddies please!" ); ?>
2
  <div class="apsc-boards-tabs" id="apsc-board-display-settings" style="display: none">
3
  <div class="apsc-tab-wrapper">
4
- <div class="apsc-option-inner-wrapper">
5
  <div class="apsc-option-field">
6
  <div class="apsc-option-inner-wrapper">
7
- <label style="float:left;"><?php _e('Image Like', 'accesspress-instagram-feed') ?></label>
8
- <div class="apsc-option-field"><input type="checkbox" name="instagram[active]" value="1" class="apsc-counter-activation-trigger" <?php if(isset($apif_settings['active'])){ checked( $apif_settings['active'], '1'); } ?>/><?php _e('Show/Hide', 'accesspress-instagram-feed'); ?></div>
9
  </div>
10
  </div>
11
- </div>
12
 
13
  <div class="apsc-option-inner-wrapper">
14
  <label style="width:30%;"><?php _e('Choose Themes Layout', 'accesspress-instagram-feed'); ?></label>
@@ -18,15 +18,16 @@
18
  <div class="apsc-theme-image"><img src="<?php echo APIF_IMAGE_DIR.'/themes/massonary.png';?>"/></div>
19
  </label>
20
  <label class="apsc-layouts-preview">
21
- <input type="radio" name="instagram[instagram_mosaic]" value="mosaic_lightview" <?php if($apif_settings['instagram_mosaic']=='mosaic_lightview'){?>checked="checked"<?php }?>/><?php _e('Mosaic LightBox Layout', 'accesspress-instagram-feed'); ?>
22
  <div class="apsc-theme-image"><img src="<?php echo APIF_IMAGE_DIR.'/themes/lightbox.png';?>"/></div>
 
23
  </label>
24
  <label class="apsc-layouts-preview">
25
- <input type="radio" name="instagram[instagram_mosaic]" value="slider" <?php if($apif_settings['instagram_mosaic']=='slider'){?>checked="checked"<?php }?>/><?php _e('Slider Layout', 'accesspress-instagram-feed'); ?>
26
  <div class="apsc-theme-image"><img src="<?php echo APIF_IMAGE_DIR.'/themes/slider.png';?>"/></div>
27
  </label>
28
  <label class="apsc-layouts-preview">
29
- <input type="radio" name="instagram[instagram_mosaic]" value="grid_rotator" <?php if($apif_settings['instagram_mosaic']=='grid_rotator'){?>checked="checked"<?php }?>/><?php _e('Grid Rotator', 'accesspress-instagram-feed'); ?>
30
  <div class="apsc-theme-image"><img src="<?php echo APIF_IMAGE_DIR.'/themes/grid-rotator.png';?>"/></div>
31
  </label>
32
  </div>
1
  <?php defined( 'ABSPATH' ) or die( "No script kiddies please!" ); ?>
2
  <div class="apsc-boards-tabs" id="apsc-board-display-settings" style="display: none">
3
  <div class="apsc-tab-wrapper">
4
+ <!-- <div class="apsc-option-inner-wrapper">
5
  <div class="apsc-option-field">
6
  <div class="apsc-option-inner-wrapper">
7
+ <label style="float:left;"><?php //_e('Image Like', 'accesspress-instagram-feed') ?></label>
8
+ <div class="apsc-option-field"><input type="checkbox" name="instagram[active]" value="1" class="apsc-counter-activation-trigger" <?php //if(isset($apif_settings['active'])){ checked( $apif_settings['active'], '1'); } ?>/><?php //_e('Show/Hide', 'accesspress-instagram-feed'); ?></div>
9
  </div>
10
  </div>
11
+ </div>-->
12
 
13
  <div class="apsc-option-inner-wrapper">
14
  <label style="width:30%;"><?php _e('Choose Themes Layout', 'accesspress-instagram-feed'); ?></label>
18
  <div class="apsc-theme-image"><img src="<?php echo APIF_IMAGE_DIR.'/themes/massonary.png';?>"/></div>
19
  </label>
20
  <label class="apsc-layouts-preview">
21
+ <input type="radio" name="instagram[instagram_mosaic]" value="mosaic_lightview" <?php if(isset($apif_settings['instagram_mosaic']) && $apif_settings['instagram_mosaic']=='mosaic_lightview'){?>checked="checked"<?php }?>/><?php _e('Mosaic LightBox Layout', 'accesspress-instagram-feed'); ?>
22
  <div class="apsc-theme-image"><img src="<?php echo APIF_IMAGE_DIR.'/themes/lightbox.png';?>"/></div>
23
+ <div class="apsc-option-note"><p><?php _e("Note:Lightbox feature won't work for videos.Please, update your free plugin to pro to get more features on lightbox as well as in designs.", 'accesspress-instagram-feed'); ?></p></div>
24
  </label>
25
  <label class="apsc-layouts-preview">
26
+ <input type="radio" name="instagram[instagram_mosaic]" value="slider" <?php if(isset($apif_settings['instagram_mosaic']) && $apif_settings['instagram_mosaic']=='slider'){?>checked="checked"<?php }?>/><?php _e('Slider Layout', 'accesspress-instagram-feed'); ?>
27
  <div class="apsc-theme-image"><img src="<?php echo APIF_IMAGE_DIR.'/themes/slider.png';?>"/></div>
28
  </label>
29
  <label class="apsc-layouts-preview">
30
+ <input type="radio" name="instagram[instagram_mosaic]" value="grid_rotator" <?php if(isset($apif_settings['instagram_mosaic']) && $apif_settings['instagram_mosaic']=='grid_rotator'){?>checked="checked"<?php }?>/><?php _e('Grid Rotator', 'accesspress-instagram-feed'); ?>
31
  <div class="apsc-theme-image"><img src="<?php echo APIF_IMAGE_DIR.'/themes/grid-rotator.png';?>"/></div>
32
  </label>
33
  </div>
inc/backend/boards/how-to-use.php CHANGED
@@ -1,36 +1,33 @@
1
  <?php defined( 'ABSPATH' ) or die( "No script kiddies please!" ); ?>
2
  <div class="apsc-boards-tabs" id="apsc-board-how_to_use-settings" style="display:none">
3
 
4
- <div class="apsp-sub-title">Plugin configuration video</div>
5
- <iframe width="700" height="315" src="https://www.youtube.com/embed/qZqV0Y8AVTA" frameborder="0" allowfullscreen></iframe>
6
-
7
- <div class="apsp-sub-title">AccessPress iFeeds - 4 Different Layout Shortcode</div>
8
  <div class="apsc-tab-wrapper">
9
- <div class="apsp-sub-title">Mosaic View Layout</div>
10
- <p>Use the shortcode <code>[ap_instagram_feed]</code> to display your instagram feed within your content.</p>
11
  <p>Use the function <code><?php echo "&lt;?php do_shortcode('[ap_instagram_feed]'); ?&gt;"; ?></code> to display within template or theme files.</p>
12
  </div>
13
 
14
  <div class="apsc-tab-wrapper">
15
- <div class="apsp-sub-title">Mosaic View LightBox Layout</div>
16
- <p>Use the shortcode <code>[ap_instagram_mosaic_lightview]</code> to display your instagram feed within your content.</p>
17
  <p>Use the function <code><?php echo "&lt;?php do_shortcode('[ap_instagram_mosaic_lightview]'); ?&gt;"; ?></code> to display within template or theme files.</p>
18
  </div>
19
 
20
  <div class="apsc-tab-wrapper">
21
- <div class="apsp-sub-title">Slider Layout</div>
22
- <p>Use the shortcode <code>[ap_instagram_slider]</code> to display your instagram feed within your content.</p>
23
  <p>Use the function <code><?php echo "&lt;?php do_shortcode('[ap_instagram_slider]'); ?&gt;"; ?></code> to display within template or theme files.</p>
24
  </div>
25
 
26
  <div class="apsc-tab-wrapper">
27
- <div class="apsp-sub-title">Grid rotator Layout</div>
28
- <p>Use the shortcode <code>[ap_instagram_grid_rotator]</code> to display your instagram feed within your content.</p>
29
  <p>Use the function <code><?php echo "&lt;?php do_shortcode('[ap_instagram_grid_rotator]'); ?&gt;"; ?></code> to display within template or theme files.</p>
30
  </div>
31
 
32
  <div class="apsc-tab-wrapper">
33
- <div class="apsp-sub-title">Online Documentation</div>
34
- <p>For the complete documentation please visit:<br /> <a href='https://accesspressthemes.com/documentation/accesspress-instagram-feeds/' target="_blank">https://accesspressthemes.com/documentation/accesspress-instagram-feeds/</a></p>
35
  </div>
36
  </div>
1
  <?php defined( 'ABSPATH' ) or die( "No script kiddies please!" ); ?>
2
  <div class="apsc-boards-tabs" id="apsc-board-how_to_use-settings" style="display:none">
3
 
4
+ <div class="apsp-sub-title"><?php _e('AccessPress iFeeds - 4 Different Layout Shortcode', 'accesspress-instagram-feed'); ?></div>
 
 
 
5
  <div class="apsc-tab-wrapper">
6
+ <div class="apsp-sub-title"><?php _e('Mosaic View Layout', 'accesspress-instagram-feed'); ?></div>
7
+ <p><?php _e('Use the shortcode <code>[ap_instagram_feed]</code> to display your instagram feed within your content.', 'accesspress-instagram-feed'); ?></p>
8
  <p>Use the function <code><?php echo "&lt;?php do_shortcode('[ap_instagram_feed]'); ?&gt;"; ?></code> to display within template or theme files.</p>
9
  </div>
10
 
11
  <div class="apsc-tab-wrapper">
12
+ <div class="apsp-sub-title"><?php _e('Mosaic View LightBox Layout', 'accesspress-instagram-feed'); ?></div>
13
+ <p><?php _e('Use the shortcode <code>[ap_instagram_mosaic_lightview]</code> to display your instagram feed within your content.', 'accesspress-instagram-feed'); ?></p>
14
  <p>Use the function <code><?php echo "&lt;?php do_shortcode('[ap_instagram_mosaic_lightview]'); ?&gt;"; ?></code> to display within template or theme files.</p>
15
  </div>
16
 
17
  <div class="apsc-tab-wrapper">
18
+ <div class="apsp-sub-title"><?php _e('Slider Layout', 'accesspress-instagram-feed'); ?></div>
19
+ <p><?php _e('Use the shortcode <code>[ap_instagram_slider]</code> to display your instagram feed within your content.', 'accesspress-instagram-feed'); ?></p>
20
  <p>Use the function <code><?php echo "&lt;?php do_shortcode('[ap_instagram_slider]'); ?&gt;"; ?></code> to display within template or theme files.</p>
21
  </div>
22
 
23
  <div class="apsc-tab-wrapper">
24
+ <div class="apsp-sub-title"><?php _e('Grid rotator Layout', 'accesspress-instagram-feed'); ?></div>
25
+ <p><?php _e('Use the shortcode <code>[ap_instagram_grid_rotator]</code> to display your instagram feed within your content.', 'accesspress-instagram-feed'); ?></p>
26
  <p>Use the function <code><?php echo "&lt;?php do_shortcode('[ap_instagram_grid_rotator]'); ?&gt;"; ?></code> to display within template or theme files.</p>
27
  </div>
28
 
29
  <div class="apsc-tab-wrapper">
30
+ <div class="apsp-sub-title"><?php _e('Online Documentation<', 'accesspress-instagram-feed'); ?>/div>
31
+ <p><?php _e('For the complete documentation please visit:', 'accesspress-instagram-feed'); ?><br /> <a href='https://accesspressthemes.com/documentation/accesspress-instagram-feeds/' target="_blank">https://accesspressthemes.com/documentation/accesspress-instagram-feeds/</a></p>
32
  </div>
33
  </div>
inc/backend/boards/instagram-profiles.php CHANGED
@@ -1,106 +1,135 @@
1
- <?php defined( 'ABSPATH' ) or die( "No script kiddies please!" ); ?>
2
  <div class="apsc-boards-tabs" id="apsc-board-social-profile-settings">
3
  <div class="apsc-tab-wrapper">
4
- <?php
5
- $username = '';
6
- $user_id = '';
7
- $access_token = '';
8
- if(isset($_GET['access_token'])){
9
- $access_token = $_GET['access_token'];
10
- $url = 'https://api.instagram.com/v1/users/self/?access_token=' . $_GET['access_token'];
11
- $content = wp_remote_get( $url );
12
- if( !isset( $content->errors ) ){
13
- $response = wp_remote_retrieve_body( $content );
14
- $json = json_decode( $response, true );
15
- if(!empty($json['data'])){
16
- $username = $json['data']['username'];
17
- $user_id = $json['data']['id'];
18
- }
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
- }else{
21
- if(isset($apif_settings['username']) && $apif_settings['username'] !=''){
 
22
  $username = $apif_settings['username'];
23
- }
24
- if(isset($apif_settings['user_id']) && $apif_settings['user_id'] !=''){
25
  $user_id = $apif_settings['user_id'];
26
- }
27
- if(isset($apif_settings['access_token']) && $apif_settings['access_token'] !=''){
28
  $access_token = $apif_settings['access_token'];
29
- }
30
  }
 
31
  ?>
32
  <!--Instagram-->
33
  <div class="apsc-option-outer-wrapper">
34
  <h4><?php _e('Plugin Settings', 'accesspress-instagram-feed') ?></h4>
35
  <div class="updated settings-error notice is-dismissible">
36
- <p><b><?php _e('Note: In order to get access token, you need to first login to your instagram account already on your browser side. So, before clicking on below button, please open new browser and login to your instagram account and then click on below Get Access Token button to get access token.', 'accesspress-instagram-feed'); ?>
37
- </b></p>
 
 
 
 
38
  </div>
39
  <br/>
40
  <div class="apsc-option-extra">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  <div class="apsc-option-inner-wrapper">
42
  <label for='instagram_username'><?php _e('Your instagram username', 'accesspress-instagram-feed'); ?></label>
43
  <div class="apsc-option-field">
44
- <input type="text" name="instagram[username]" id='instagram_username' value="<?php echo esc_attr($username);?>"/>
45
- <div class="apsc-option-note"><?php _e('Note: If not loaded automatically after clicking <strong>Get Access Token</strong> button provided below, please enter the instagram username.', 'accesspress-instagram-feed'); ?></div>
 
 
46
  </div>
47
  </div>
48
  <div class="apsc-option-inner-wrapper">
49
  <label for='instagram_user_id'><?php _e('Your instagram user ID(Optional)', 'accesspress-instagram-feed'); ?></label>
50
  <div class="apsc-option-field">
51
- <input type="text" name="instagram[user_id]" id='instagram_user_id' value="<?php echo $user_id;?>"/>
52
- <div class="apsc-option-note"><?php _e('Note: If not loaded automatically after clicking <strong>Get Access Token</strong> button provided below, please get your instagram user id from the below access token input field, after receiving access token.The first numbers before "." (dot) is your instagram user id.', 'accesspress-instagram-feed'); ?></div>
 
 
53
  </div>
54
  </div>
55
  <div class="apsc-option-inner-wrapper">
56
  <label for='instagram_access_token'><?php _e('Your instagram access token', 'accesspress-instagram-feed'); ?></label>
57
  <div class="apsc-option-field">
58
- <input type="text" name="instagram[access_token]" id='instagram_access_token' value="<?php echo esc_attr($access_token); ?>"/>
 
 
 
59
  <div class="apsc-option-note">
60
- <?php _e('Please enter the instagram Access Token.You can get this by clicking the below link. If new access token not received in the above Instagram access token field, please copy the access token from the url above after access_token=', 'accesspress-instagram-feed'); ?>
61
  <?php _e("Please don't forget to click save button.", 'accesspress-instagram-feed'); ?>
62
- <?php
63
- $return_url = urlencode(admin_url('admin.php?page=if-instagram-feed')) . '&response_type=token&state='. admin_url('admin.php?if-instagram-feed').'&hl=en';
64
- // $new_url = urlencode(admin_url('admin.php?page=if-instagram-feed')) . '&response_type=token';
65
- ?>
66
- <div id="login_with_instagram">
67
- <?php
68
- /*
69
- <a href="https://api.instagram.com/oauth/authorize/?client_id=54da896cf80343ecb0e356ac5479d9ec&scope=basic+public_content&redirect_uri=http://api.web-dorado.com/instagram/?return_url=<?php echo $new_url;?>">Get Access Token</a>
70
- <a href="https://api.instagram.com/oauth/authorize/?client_id=54da896cf80343ecb0e356ac5479d9ec&scope=basic+likes&redirect_uri=http://api.web-dorado.com/instagram/?return_url=<?php echo $return_url; ?>"> */?>
71
- <a href="https://api.instagram.com/oauth/authorize/?client_id=2e26528b804b40e0915be84e044f9990&scope=basic&redirect_uri=http://demo.accesspressthemes.com/wordpress-plugins/accesspress-instagram-feeds/get_access_token/index.php?return_url=<?php echo $return_url; ?>"><?php _e('Get New Access Token', 'accesspress-instagram-feed'); ?></a>
72
- </div>
73
- </div>
74
- </div>
75
- </div>
76
 
77
- <!-- <div class="apsc-option-inner-wrapper">
78
- <label for='instagram_user_id'>< ?php _e('Instagram User ID(Optional)', 'accesspress-instagram-feed'); ?></label>
79
- <div class="apsc-option-field">
80
- <input type="text" name="instagram[user_id]" id='instagram_user_id' value="< ?php echo esc_attr($apif_settings['user_id']);?>"/>
81
- <div class="apsc-option-note">< ?php _e('Please get your instagram user id from the below access token input field, after receiving access token. The first numbers before . is your instagram user id', 'accesspress-instagram-feed'); ?></div>
82
- </div>
83
- </div> -->
84
 
85
- <div class="apsc-option-inner-wrapper">
86
- <label for='enablecache'><?php _e('Enable Cache?', 'accesspress-instagram-feed'); ?></label>
87
  <div class="apsc-option-field">
88
- <input type="checkbox" name="instagram[enable_cache]" id="enablecache" value="1" <?php if(isset($apif_settings['enable_cache'])){ checked($apif_settings['enable_cache'], '1'); } ?> />
 
 
89
  <div class="apsc-option-note"><?php _e('Please enable this option if you want to use the cache on the first load.', 'accesspress-instagram-feed'); ?></div>
90
  </div>
91
- </div>
92
 
93
- <div class="apsc-option-inner-wrapper">
94
- <label for='enablecache'><?php _e('Cache Period', 'accesspress-instagram-feed'); ?></label>
95
  <div class="apsc-option-field">
96
- <input type="number" step="0.01" min='0' max='24' name="instagram[cache_period]" value="<?php if(isset($apif_settings['cache_period']) && $apif_settings['cache_period'] != ''){ echo $apif_settings['cache_period']; } ?>" />
 
 
97
  <div class="apsc-option-note"><?php _e('Please set the value in hours only. Default if left empty is set to 24.', 'accesspress-instagram-feed'); ?></div>
98
  </div>
99
- </div>
100
 
101
  </div>
102
  </div>
103
  <!--Instagram-->
104
- <?php include (APIF_INST_PATH . '/inc/backend/submit-button.php'); ?>
105
  </div>
106
  </div>
1
+ <?php defined('ABSPATH') or die("No script kiddies please!"); ?>
2
  <div class="apsc-boards-tabs" id="apsc-board-social-profile-settings">
3
  <div class="apsc-tab-wrapper">
4
+ <?php
5
+ $username = '';
6
+ $user_id = '';
7
+ $access_token = '';
8
+ if(isset($apif_settings['app_id']) && $apif_settings['app_id'] !=''){
9
+ $app_id=$apif_settings['app_id'];
10
+ }
11
+ else{
12
+ $app_id='1150049435376376';
13
+ }
14
+ if(isset($apif_settings['app_secret']) && $apif_settings['app_secret'] !=''){
15
+ $app_secret = $apif_settings['app_secret'];
16
+ }
17
+ else{
18
+ $app_secret='5eab5bf8ad269da35069be8e0f2db96e';
19
+ }
20
+ if (isset($_GET['access_token'])) {
21
+ $access_token = $_GET['access_token'];
22
+ $url = 'https://api.instagram.com/v1/users/self/?access_token=' . $_GET['access_token'];
23
+ $content = wp_remote_get($url);
24
+ if (!isset($content->errors)) {
25
+ $response = wp_remote_retrieve_body($content);
26
+ $json = json_decode($response, true);
27
+ if (!empty($json['data'])) {
28
+ $username = $json['data']['username'];
29
+ $user_id = $json['data']['id'];
30
  }
31
+ }
32
+ } else {
33
+ if (isset($apif_settings['username']) && $apif_settings['username'] != '') {
34
  $username = $apif_settings['username'];
35
+ }
36
+ if (isset($apif_settings['user_id']) && $apif_settings['user_id'] != '') {
37
  $user_id = $apif_settings['user_id'];
38
+ }
39
+ if (isset($apif_settings['access_token']) && $apif_settings['access_token'] != '') {
40
  $access_token = $apif_settings['access_token'];
 
41
  }
42
+ }
43
  ?>
44
  <!--Instagram-->
45
  <div class="apsc-option-outer-wrapper">
46
  <h4><?php _e('Plugin Settings', 'accesspress-instagram-feed') ?></h4>
47
  <div class="updated settings-error notice is-dismissible">
48
+ <p><b><?php _e("Note: After the latest changes in instagram api,you either need to create instagram or facebook app.In this plugin, we have used instagram basic display api for which you need have instagram app.On using basic display api, you can fetch normal feeds and get your profile's username and media count.Basic display api has provided only few of these criteria to fetch.But if you want to get more data such as get instagram likes count,comments count,your profile picture and hashtag based search,please upgrade to pro version of this plugin where we have used instagram graph api.", 'accesspress-instagram-feed'); ?></b></p></br>
49
+ <hr><p><b><?php _e("In order to get instagram app id and app secret, you need to first go to developers.facebook.com then create new app.In settings page add your site url.Setup instagram basic display api from products list.You will see option to create app there inside basic display api page.Create app then go to basic display of instagram basic display scroll, down a little you should see button that says add/remove instagram tester inside user token generator, click on it then you will be redirected to user roles page, go to the bottom of page.There will see button that says add instagram tester click on it.A popup will come that will ask you to enter your instagram username, find your account and click on submit.Then,open your instagram profile in another tab.Go to your profile click on settings icon.Go to apps and websites.Go to tester invites tab and you will see request from the app you created.Accept the request and again go to basic display page.Put redirect url as 'https://demo.accesspressthemes.com/wordpress-plugins/insta-feed/basic-api/index.php' , then paste it into Valid oauth redirect url. Enter url of homepage of your website in Deauthorize callback url and enter url of privacy policy of your website that states how you will use instagram profile data of user in Data deletion request url fields and save it.Finally copy your instagram app id and app secret and then paste them in their respective field in plugin's backend.First of all, save the settings and then click on get access token button.You should now be redirected to instagram auhtorize page where it says your app will access your profile info and media.Click on authorize button and now you should be redirected to plugins backend with your username,user id and access token field filled already.Now,save settings.", 'accesspress-instagram-feed'); ?>
50
+ </b></p>
51
+ </div>
52
+ <div class="apsc-option-note">
53
+ <p>
54
  </div>
55
  <br/>
56
  <div class="apsc-option-extra">
57
+ <div class='apsc-option-inner-wrapper'>
58
+ <label for='instagram_appid'><?php _e('Your instagram appid', 'accesspress-instagram-feed'); ?></label>
59
+ <input type='text' id='instagram-app-id' placeholder="Enter your app id" name='instagram[app_id]' value='<?php
60
+ if (isset($apif_settings['app_id'])) {
61
+ echo $apif_settings['app_id'];
62
+ }
63
+ ?>' />
64
+ </div>
65
+ <div class='apsc-option-inner-wrapper'>
66
+ <label for='instagram_appsecret'><?php _e('Your instagram appsecret', 'accesspress-instagram-feed'); ?></label>
67
+ <input type='text' id='instagram-app-secret' placeholder="Enter your app secret" name='instagram[app_secret]' value='<?php
68
+ if (isset($apif_settings['app_secret'])) {
69
+ echo $apif_settings['app_secret'];
70
+ }
71
+ ?>' />
72
+ </div>
73
+ <div class="apsc-option-note"><?php _e('Note: After entering your app id and app secret remember to save changes first,then only proceed toward getting access token', 'accesspress-instagram-feed'); ?></div>
74
+ <div id="login_with_instagram">
75
+ <a target="_self" href="https://demo.accesspressthemes.com/wordpress-plugins/insta-feed/basic-api/index.php?app_id=<?php echo $app_id; ?>&app_secret=<?php echo $app_secret; ?>&back_url=<?php echo admin_url('admin.php?page=if-instagram-feed'); ?>">Get access token</a>
76
+ </div>
77
  <div class="apsc-option-inner-wrapper">
78
  <label for='instagram_username'><?php _e('Your instagram username', 'accesspress-instagram-feed'); ?></label>
79
  <div class="apsc-option-field">
80
+ <input type="text" name="instagram[username]" id='instagram_username' value="<?php if(isset($_GET["username"])){
81
+ echo $_GET["username"];}else{
82
+ echo esc_attr($username);}?>"/>
83
+ <div class="apsc-option-note"><?php _e('Note: If not loaded automatically after clicking <strong>Get Access Token</strong> button provided above, please enter the instagram username.', 'accesspress-instagram-feed'); ?></div>
84
  </div>
85
  </div>
86
  <div class="apsc-option-inner-wrapper">
87
  <label for='instagram_user_id'><?php _e('Your instagram user ID(Optional)', 'accesspress-instagram-feed'); ?></label>
88
  <div class="apsc-option-field">
89
+ <input type="text" name="instagram[user_id]" id='instagram_user_id' value="<?php if(isset($_GET["userid"])){
90
+ echo $_GET["userid"];}else{
91
+ echo esc_attr($user_id);}?>"/><?php //var_dump($user_id);?>
92
+ <div class="apsc-option-note"><?php _e('Note: If not loaded automatically after clicking <strong>Get Access Token</strong> button provided above, please check if you have followed every step mentioned above properly.', 'accesspress-instagram-feed'); ?></div>
93
  </div>
94
  </div>
95
  <div class="apsc-option-inner-wrapper">
96
  <label for='instagram_access_token'><?php _e('Your instagram access token', 'accesspress-instagram-feed'); ?></label>
97
  <div class="apsc-option-field">
98
+ <!--<input type="text" name="instagram[access_token]" id='instagram_access_token' value="<?php echo esc_attr($access_token); ?>"/>-->
99
+ <input type="text" name="instagram[access_token]" id='instagram_access_token' value="<?php if(isset($_GET["access_token"])){
100
+ echo $_GET["access_token"];}else{
101
+ echo esc_attr($access_token);}?>"/>
102
  <div class="apsc-option-note">
103
+ <?php _e('Please enter the instagram Access Token.You can get this by clicking the above button. If new access token not received in the above Instagram access token field, please check if you have followed every step mentioned above properly.', 'accesspress-instagram-feed'); ?>
104
  <?php _e("Please don't forget to click save button.", 'accesspress-instagram-feed'); ?>
105
+ </div>
106
+ </div>
107
+ </div>
 
 
 
 
 
 
 
 
 
 
 
108
 
 
 
 
 
 
 
 
109
 
110
+ <div class="apsc-option-inner-wrapper">
111
+ <label for='enablecache'><?php _e('Enable Cache?', 'accesspress-instagram-feed'); ?></label>
112
  <div class="apsc-option-field">
113
+ <input type="checkbox" name="instagram[enable_cache]" id="enablecache" value="1" <?php if (isset($apif_settings['enable_cache'])) {
114
+ checked($apif_settings['enable_cache'], '1');
115
+ } ?> />
116
  <div class="apsc-option-note"><?php _e('Please enable this option if you want to use the cache on the first load.', 'accesspress-instagram-feed'); ?></div>
117
  </div>
118
+ </div>
119
 
120
+ <div class="apsc-option-inner-wrapper">
121
+ <label for='enablecache'><?php _e('Cache Period', 'accesspress-instagram-feed'); ?></label>
122
  <div class="apsc-option-field">
123
+ <input type="number" step="0.01" min='0' max='24' name="instagram[cache_period]" value="<?php if (isset($apif_settings['cache_period']) && $apif_settings['cache_period'] != '') {
124
+ echo $apif_settings['cache_period'];
125
+ } ?>" />
126
  <div class="apsc-option-note"><?php _e('Please set the value in hours only. Default if left empty is set to 24.', 'accesspress-instagram-feed'); ?></div>
127
  </div>
128
+ </div>
129
 
130
  </div>
131
  </div>
132
  <!--Instagram-->
133
+ <?php include (APIF_INST_PATH . '/inc/backend/submit-button.php'); ?>
134
  </div>
135
  </div>
inc/backend/main-page.php CHANGED
@@ -93,7 +93,7 @@ $apif_settings = get_option( 'apif_settings' );
93
  <img src="<?php echo APIF_IMAGE_DIR.'/upgrade/ap-instagram-feeds-pro-advertisement.png'; ?>" alt='upgrade-banner-top'/>
94
  <div class="apif-button-wrap-bckend">
95
  <a href='http://demo.accesspressthemes.com/wordpress-plugins/accesspress-instagram-feeds-pro/' class="apif-demo-btn" target='_blank' />Demo</a>
96
- <a href='https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-instagram-feed-pro%2F14291754' target="_blank" class="apif-upgrade-btn"/>Upgrade To Pro</a>
97
  </div>
98
  <img src="<?php echo APIF_IMAGE_DIR.'/upgrade/upgrade-bottom.png'; ?>" alt='upgrade-banner-bottom'/>
99
  </div>
93
  <img src="<?php echo APIF_IMAGE_DIR.'/upgrade/ap-instagram-feeds-pro-advertisement.png'; ?>" alt='upgrade-banner-top'/>
94
  <div class="apif-button-wrap-bckend">
95
  <a href='http://demo.accesspressthemes.com/wordpress-plugins/accesspress-instagram-feeds-pro/' class="apif-demo-btn" target='_blank' />Demo</a>
96
+ <a href='https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed-pro/' target="_blank" class="apif-upgrade-btn"/>Upgrade To Pro</a>
97
  </div>
98
  <img src="<?php echo APIF_IMAGE_DIR.'/upgrade/upgrade-bottom.png'; ?>" alt='upgrade-banner-bottom'/>
99
  </div>
inc/backend/save-settings.php CHANGED
@@ -4,7 +4,10 @@ foreach( $_POST['instagram'] as $key=>$val ){
4
  $$key = sanitize_text_field($val);
5
  }
6
  $apif_settings = array();
 
 
7
  $apif_settings['username'] = $username;
 
8
  $apif_settings['access_token'] = $access_token;
9
  $apif_settings['enable_cache'] = isset($enable_cache) ? $enable_cache:'';
10
  $apif_settings['cache_period'] = $cache_period;
4
  $$key = sanitize_text_field($val);
5
  }
6
  $apif_settings = array();
7
+ $apif_settings['app_id'] = $app_id;
8
+ $apif_settings['app_secret'] = $app_secret;
9
  $apif_settings['username'] = $username;
10
+ $apif_settings['user_id'] = $user_id;
11
  $apif_settings['access_token'] = $access_token;
12
  $apif_settings['enable_cache'] = isset($enable_cache) ? $enable_cache:'';
13
  $apif_settings['cache_period'] = $cache_period;
inc/backend/widgetside.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  defined('ABSPATH') or die("No script kiddies please!");
 
3
  /**
4
  * Adds AccessPress Instagram Feed Widget
5
  */
@@ -31,16 +32,16 @@ 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_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
  global $insta;
43
- $apif_settings = get_option( 'apif_settings' );
44
  $username = !empty($apif_settings['username']) ? $apif_settings['username'] : '';
45
  $user_id = !empty($apif_settings['user_id']) ? $apif_settings['user_id'] : '';
46
  $social_profile_url = 'https://instagram.com/' . $username;
@@ -48,104 +49,142 @@ class APIF_SideWidget extends WP_Widget {
48
  require_once(APIF_INST_PATH . 'inc/frontend/instagram.php');
49
  ?>
50
  <?php
51
- if($username == '' && $access_token ==''){
52
- $response = array('meta'=>array('error_message'=>'Username and access token field is empty. Please configure.'));
53
-
54
- }else if($username == ''){
55
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
56
-
57
- }else if ($access_token == ''){
58
- $response = array('meta'=>array('error_message'=>'Access token field is empty.'));
59
- }else{
60
- $response = $insta->userInfo();
61
- }
62
-
63
- if($response == NULL){
64
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
65
- }
66
-
67
- if(isset($response['meta']['error_message'])){ ?>
68
- <h1 class="widget-title-insta"><span><?php echo $response['meta']['error_message']; ?></span></h1>
69
- <?php
70
- }else{ ?>
71
- <div class="instagram-header">
72
- <?php if($instance_header != 'true'){ ?>
73
- <div class="apif-profile clearfix">
74
- <div class="apif-profile-img">
75
- <img src="<?php echo $response['data']['profile_picture']; ?>" />
76
- </div>
77
- <div class="apif-profile-name">
78
- <?php echo $response['data']['full_name']; ?>
79
- </div>
80
- </div>
81
- <?php } ?>
82
 
83
- <?php if($instance_post != 'true' || $instance_followers != 'true' || $instance_following != 'true' || $instance_follow != 'true'): ?>
84
- <div class="apif-profile-follow clearfix">
85
- <div class="post">
86
- <?php if($instance_post != 'true'): ?>
87
- <?php echo $response['data']['counts']['media']; ?>
88
- <span>post</span>
89
- <?php endif; ?>
90
- </div>
91
- <div class="followers">
92
- <?php if($instance_followers != 'true'): ?>
93
- <?php echo $response['data']['counts']['followed_by']; ?>
94
- <span>followers</span>
95
- <?php endif; ?>
96
- </div>
97
- <div class="following">
98
- <?php if($instance_following != 'true'): ?>
99
- <?php echo $response['data']['counts']['follows']; ?>
100
- <span>following</span>
101
- <?php endif; ?>
102
- </div>
103
- <div class="follow">
104
- <?php if($instance_follow != 'true'): ?>
105
- <div class="follow-inner">
106
- <div class="table-outer">
107
- <div class="table-inner">
108
- <a href="https://instagram.com/<?php echo $apif_settings['username']; ?>" target='_blank' title='Follow <?php echo $apif_settings['username']; ?>' >follow</a>
109
- </div>
110
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  </div>
112
- <?php endif; ?>
113
  </div>
114
- </div>
115
- <?php endif; ?>
 
 
116
 
117
- <?php
118
- ///////////////////////////Display the user's instagram images/////////////////////////////////////////////////////////
119
- $count = $instagram_num_img;
120
- $ins_media = $insta->userMedia();
121
- $j = 0;
122
- if(isset($ins_media['meta']['error_message'])){
123
- ?>
124
- <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
125
- <?php
126
- } else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
127
- echo '<ul class="instagram-widget clear">';
128
- foreach ($ins_media['data'] as $vm) {
129
- if ($count == $j) {
130
- break;
131
- }
132
- $j++;
133
- $img = $vm['images']['thumbnail']['url'];
 
 
 
 
 
 
134
  ?>
135
- <?php if($instance_image_link == 'true'){ ?>
136
- <li><a href='<?php echo $vm['link']; ?>' target='_blank'><img src="<?php echo esc_url($img); ?>" alt='<?php echo $vm['caption']['text']; ?>' /></a></li>
137
- <?php }else{ ?>
138
- <li><img src="<?php echo esc_url($img); ?>" alt='<?php echo $vm['caption']['text']; ?>' /></li>
139
- <?php } ?>
140
- <?php
141
- }
142
- echo '</ul>';
143
- } ?>
144
- </div>
145
- <?php
146
- } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  <?php echo $args['after_widget']; ?>
148
- <?php
149
  }
150
 
151
  /**
@@ -156,15 +195,14 @@ class APIF_SideWidget extends WP_Widget {
156
  * @param array $instance Previously saved values from database.
157
  */
158
  public function form($instance) {
159
- $title = isset($instance['title'])?$instance['title']:'';
160
- $instagram_num_img = isset($instance['instagram_num_img']) ? $instance['instagram_num_img']:'';
161
- $instance_header = isset($instance['hide_header']) ? $instance['hide_header']:'';
162
- $instance_post = isset($instance['instance_post']) ? $instance['instance_post']:'';
163
- $instance_followers = isset($instance['instance_followers']) ? $instance['instance_followers']:'';
164
- $instance_following = isset($instance['instance_following']) ? $instance['instance_following']:'';
165
- $instance_follow = isset($instance['instance_follow']) ? $instance['instance_follow']:'';
166
- $instance_image_link = isset($instance['instance_image_link']) ? $instance['instance_image_link']:'';
167
-
168
  ?>
169
  <p>
170
 
@@ -175,40 +213,40 @@ class APIF_SideWidget extends WP_Widget {
175
 
176
  <label for="<?php echo $this->get_field_id('instagram_num_img'); ?>"><?php _e('Number of Image:', 'accesspress-instagram-feed'); ?></label>
177
  <select class="widefat" id="<?php echo $this->get_field_id('instagram_num_img'); ?>" name="<?php echo $this->get_field_name('instagram_num_img'); ?>" >
178
- <?php for($i=1;$i<=21;$i++){
179
- ?>
180
- <option value="<?php echo $i;?>" <?php selected( $instagram_num_img,''.$i ); ?>><?php echo $i; ?></option>
181
- <?php
182
- }?>
183
  </select>
184
  </p>
185
  <p>
186
  <label for="<?php echo $this->get_field_id('hide_header'); ?>"><?php _e('Hide Header :', 'accesspress-instagram-feed'); ?></label>
187
- <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);?>/>
188
  </p>
189
  <p>
190
  <label for="<?php echo $this->get_field_id('instance_post'); ?>"><?php _e('Hide Instagram Post :', 'accesspress-instagram-feed'); ?></label>
191
- <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);?>/>
192
  </p>
193
 
194
  <p>
195
  <label for="<?php echo $this->get_field_id('instance_followers'); ?>"><?php _e('Hide Followers :', 'accesspress-instagram-feed'); ?></label>
196
- <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);?>/>
197
  </p>
198
 
199
  <p>
200
  <label for="<?php echo $this->get_field_id('instance_following'); ?>"><?php _e('Hide Instagram Following :', 'accesspress-instagram-feed'); ?></label>
201
- <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);?>/>
202
  </p>
203
 
204
  <p>
205
  <label for="<?php echo $this->get_field_id('instance_follow'); ?>"><?php _e('Hide Instagram Follow Button :', 'accesspress-instagram-feed'); ?></label>
206
- <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);?>/>
207
  </p>
208
 
209
  <p>
210
  <label for="<?php echo $this->get_field_id('instance_image_link'); ?>"><?php _e('Link Images to Instagram :', 'accesspress-instagram-feed'); ?></label>
211
- <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);?>/>
212
  </p>
213
  <?php
214
  }
@@ -236,6 +274,8 @@ class APIF_SideWidget extends WP_Widget {
236
  $instance['instance_image_link'] = (!empty($new_instance['instance_image_link']) ) ? sanitize_text_field($new_instance['instance_image_link']) : '';
237
  return $instance;
238
  }
 
239
  }
 
240
  // class APIF_Widget
241
  ?>
1
  <?php
2
  defined('ABSPATH') or die("No script kiddies please!");
3
+
4
  /**
5
  * Adds AccessPress Instagram Feed Widget
6
  */
32
  echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
33
  }
34
 
35
+ $instagram_num_img = isset($instance['instagram_num_img']) ? $instance['instagram_num_img'] : '12';
36
+ $instance_header = (isset($instance['hide_header']) && $instance['hide_header'] == 1) ? 'true' : 'false';
37
+ $instance_post = (isset($instance['instance_post']) && $instance['instance_post'] == 1) ? 'true' : 'false';
38
+ $instance_followers = (isset($instance['instance_followers']) && $instance['instance_followers'] == 1) ? 'true' : 'false';
39
+ $instance_following = (isset($instance['instance_following']) && $instance['instance_following'] == 1) ? 'true' : 'false';
40
+ $instance_follow = (isset($instance['instance_follow']) && $instance['instance_follow'] == 1) ? 'true' : 'false';
41
+ $instance_image_link = (isset($instance['instance_image_link']) && $instance['instance_image_link'] == 1) ? 'true' : 'false';
42
 
43
  global $insta;
44
+ $apif_settings = get_option('apif_settings');
45
  $username = !empty($apif_settings['username']) ? $apif_settings['username'] : '';
46
  $user_id = !empty($apif_settings['user_id']) ? $apif_settings['user_id'] : '';
47
  $social_profile_url = 'https://instagram.com/' . $username;
49
  require_once(APIF_INST_PATH . 'inc/frontend/instagram.php');
50
  ?>
51
  <?php
52
+ if ($username == '' && $access_token == '') {
53
+ $response = array('meta' => array('error_message' => 'Username and access token field is empty. Please configure.'));
54
+ } else if ($username == '') {
55
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
56
+ } else if ($access_token == '') {
57
+ $response = array('meta' => array('error_message' => 'Access token field is empty.'));
58
+ } else {
59
+ $response = $insta->userInfo();
60
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ if ($response == NULL) {
63
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
64
+ }
65
+
66
+ if (isset($response['meta']['error_message'])) {
67
+ ?>
68
+ <h1 class="widget-title-insta"><span><?php echo $response['meta']['error_message']; ?></span></h1>
69
+ <?php } else {
70
+ ?>
71
+ <div class="instagram-header">
72
+ <?php if ($instance_header != 'true') { ?>
73
+ <div class="apif-profile clearfix">
74
+ <!-- <div class="apif-profile-img">
75
+ <img src="<?php //echo $response['data']['profile_picture']; ?>" />
76
+ </div>-->
77
+ <?php //print_r($response);?>
78
+ <div class="apif-profile-name">
79
+ <?php echo $response['username']; ?>
80
+ </div>
81
+ </div>
82
+ <?php } ?>
83
+
84
+ <?php if ($instance_post != 'true' || $instance_followers != 'true' || $instance_following != 'true' || $instance_follow != 'true'): ?>
85
+ <div class="apif-profile-follow clearfix">
86
+ <div class="post">
87
+ <?php if ($instance_post != 'true'): ?>
88
+ <?php echo $response['media_count']; ?>
89
+ <span>post</span>
90
+ <?php endif; ?>
91
+ </div>
92
+ <!-- <div class="followers">
93
+ <?php // if($instance_followers != 'true'): ?>
94
+ //<?php //echo $response['data']['counts']['followed_by']; ?>
95
+ <span>followers</span>
96
+ <?php // endif; ?>
97
+ </div>-->
98
+ <!-- <div class="following">
99
+ <?php // if($instance_following != 'true'): ?>
100
+ <?php //echo $response['data']['counts']['follows']; ?>
101
+ <span>following</span>
102
+ <?php //endif; ?>
103
+ </div>-->
104
+ <div class="follow">
105
+ <?php if ($instance_follow != 'true'): ?>
106
+ <div class="follow-inner">
107
+ <div class="table-outer">
108
+ <div class="table-inner">
109
+ <a href="https://instagram.com/<?php echo $apif_settings['username']; ?>" target='_blank' title='Follow <?php echo $apif_settings['username']; ?>' >follow</a>
110
  </div>
111
+ </div>
112
  </div>
113
+ <?php endif; ?>
114
+ </div>
115
+ </div>
116
+ <?php endif; ?>
117
 
118
+ <?php
119
+ ///////////////////////////Display the user's instagram images/////////////////////////////////////////////////////////
120
+ $count = $instagram_num_img;
121
+ $ins_media = $insta->userMedia();
122
+ $j = 0;
123
+ if (isset($ins_media['meta']['error_message'])) {
124
+ ?>
125
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
126
+ <?php
127
+ } else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
128
+ echo '<ul class="instagram-widget clear">';
129
+ foreach ($ins_media['data'] as $vm) {
130
+ if ($count == $j) {
131
+ break;
132
+ }
133
+ $j++;
134
+ $img = $vm['media_url'];
135
+ ?>
136
+ <?php if ($instance_image_link == 'true') { ?>
137
+ <li><a href='<?php echo $vm['permalink']; ?>' target='_blank'>
138
+ <?php
139
+ if ($vm['media_type'] == "VIDEO") {
140
+ $video_link = $vm['media_url'];
141
  ?>
142
+ <!--<a href="<?php //echo $link ?>" target="_blank">-->
143
+ <div id="inline-1" style="width:100%;height:100%;position:relative">
144
+ <!--<a href="<?php //echo $link ?>" target="_blank">-->
145
+ <video controls style="width:100% !important;height:100%;position:relative;right:0;display:block">
146
+ <source src="<?php echo $video_link; ?>" type="video/mp4">
147
+ Your browser does not support the video tag.
148
+ </video>
149
+ <!--</a>-->
150
+ </div>
151
+ <!--</a>-->
152
+ <?php } else { ?>
153
+ <img src="<?php echo esc_url($img); ?>" alt='<?php echo $vm['caption']; ?>' />
154
+ <?php } ?>
155
+ </a>
156
+ </li>
157
+ <?php } else { ?>
158
+ <li>
159
+ <?php
160
+ if ($vm['media_type'] == "VIDEO") {
161
+ $video_link = $vm['media_url'];
162
+ ?>
163
+ <!--<a href="<?php //echo $link ?>" target="_blank">-->
164
+ <div id="inline-1" style="width:100%;height:100%;position:relative">
165
+ <!--<a href="<?php //echo $link ?>" target="_blank">-->
166
+ <video controls style="width:100% !important;height:100%;position:relative;right:0;display:block">
167
+ <source src="<?php echo $video_link; ?>" type="video/mp4">
168
+ Your browser does not support the video tag.
169
+ </video>
170
+ <!--</a>-->
171
+ </div>
172
+ <!--</a>-->
173
+ <?php } else { ?>
174
+ <img src="<?php echo esc_url($img); ?>" alt='<?php echo $vm['caption']; ?>' />
175
+ <?php } ?>
176
+ </li>
177
+ <?php } ?>
178
+ <?php
179
+ }
180
+ echo '</ul>';
181
+ }
182
+ ?>
183
+ </div>
184
+ <?php }
185
+ ?>
186
  <?php echo $args['after_widget']; ?>
187
+ <?php
188
  }
189
 
190
  /**
195
  * @param array $instance Previously saved values from database.
196
  */
197
  public function form($instance) {
198
+ $title = isset($instance['title']) ? $instance['title'] : '';
199
+ $instagram_num_img = isset($instance['instagram_num_img']) ? $instance['instagram_num_img'] : '';
200
+ $instance_header = isset($instance['hide_header']) ? $instance['hide_header'] : '';
201
+ $instance_post = isset($instance['instance_post']) ? $instance['instance_post'] : '';
202
+ $instance_followers = isset($instance['instance_followers']) ? $instance['instance_followers'] : '';
203
+ $instance_following = isset($instance['instance_following']) ? $instance['instance_following'] : '';
204
+ $instance_follow = isset($instance['instance_follow']) ? $instance['instance_follow'] : '';
205
+ $instance_image_link = isset($instance['instance_image_link']) ? $instance['instance_image_link'] : '';
 
206
  ?>
207
  <p>
208
 
213
 
214
  <label for="<?php echo $this->get_field_id('instagram_num_img'); ?>"><?php _e('Number of Image:', 'accesspress-instagram-feed'); ?></label>
215
  <select class="widefat" id="<?php echo $this->get_field_id('instagram_num_img'); ?>" name="<?php echo $this->get_field_name('instagram_num_img'); ?>" >
216
+ <?php for ($i = 1; $i <= 21; $i++) {
217
+ ?>
218
+ <option value="<?php echo $i; ?>" <?php selected($instagram_num_img, '' . $i); ?>><?php echo $i; ?></option>
219
+ <?php }
220
+ ?>
221
  </select>
222
  </p>
223
  <p>
224
  <label for="<?php echo $this->get_field_id('hide_header'); ?>"><?php _e('Hide Header :', 'accesspress-instagram-feed'); ?></label>
225
+ <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); ?>/>
226
  </p>
227
  <p>
228
  <label for="<?php echo $this->get_field_id('instance_post'); ?>"><?php _e('Hide Instagram Post :', 'accesspress-instagram-feed'); ?></label>
229
+ <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); ?>/>
230
  </p>
231
 
232
  <p>
233
  <label for="<?php echo $this->get_field_id('instance_followers'); ?>"><?php _e('Hide Followers :', 'accesspress-instagram-feed'); ?></label>
234
+ <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); ?>/>
235
  </p>
236
 
237
  <p>
238
  <label for="<?php echo $this->get_field_id('instance_following'); ?>"><?php _e('Hide Instagram Following :', 'accesspress-instagram-feed'); ?></label>
239
+ <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); ?>/>
240
  </p>
241
 
242
  <p>
243
  <label for="<?php echo $this->get_field_id('instance_follow'); ?>"><?php _e('Hide Instagram Follow Button :', 'accesspress-instagram-feed'); ?></label>
244
+ <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); ?>/>
245
  </p>
246
 
247
  <p>
248
  <label for="<?php echo $this->get_field_id('instance_image_link'); ?>"><?php _e('Link Images to Instagram :', 'accesspress-instagram-feed'); ?></label>
249
+ <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); ?>/>
250
  </p>
251
  <?php
252
  }
274
  $instance['instance_image_link'] = (!empty($new_instance['instance_image_link']) ) ? sanitize_text_field($new_instance['instance_image_link']) : '';
275
  return $instance;
276
  }
277
+
278
  }
279
+
280
  // class APIF_Widget
281
  ?>
inc/frontend/instagram-feed.php CHANGED
@@ -1,202 +1,248 @@
1
  <?php
2
- defined( 'ABSPATH' ) or die( "No script kiddies please!" );
3
- global $apif_settings, $insta;
4
- $apif_settings = get_option( 'apif_settings' );
5
- $username = !empty($apif_settings['username']) ? $apif_settings['username'] : ''; // your username
6
- $access_token = !empty($apif_settings['access_token']) ? $apif_settings['access_token'] : '';
7
- $enable_cache = (isset($apif_settings['enable_cache']) && $apif_settings['enable_cache'] == 1)?1:0;
8
- $cache_period = (isset($apif_settings['cache_period']) && $apif_settings['cache_period'] == 1)?intval($apif_settings['cache_period']):'24';
 
9
 
10
- $followmetext = !empty($apif_settings['followmetext']) ? $apif_settings['followmetext'] : __('Follow Me','accesspress-instagram-feed');
11
- $layout = $apif_settings['instagram_mosaic'];
12
- $image_like = isset($apif_settings['active']) ? $apif_settings['active'] : '';
13
- $count = 7; // number of images to show
14
- require_once('instagram.php');
15
-
16
- if($username == '' && $access_token ==''){
17
- $response = array('meta'=>array('error_message'=>'Username and access token field is empty. Please configure.'));
18
 
19
- }else if($username == ''){
20
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
 
 
 
 
 
21
 
22
- }else if ($access_token == ''){
23
- $response = array('meta'=>array('error_message'=>'Access token field is empty.'));
24
- }else{
25
-
26
- if($enable_cache){
27
- $recent_feed_transient_name = 'recent_feed_transient';
28
- $recent_feed_transient = get_transient($recent_feed_transient_name);
29
- if (false === $recent_feed_transient) {
30
- $response = $insta->userMedia();
31
- set_transient($recent_feed_transient_name, $response, $cache_period * HOUR_IN_SECONDS );
32
- }else{
33
- $response = $recent_feed_transient;
34
- }
35
- }else{
36
  $response = $insta->userMedia();
 
 
 
37
  }
 
 
38
  }
 
39
 
40
- if($response == NULL){
41
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
42
- }
43
 
44
- $ins_media = $response;
45
 
46
- if ($layout == 'mosaic' || $layout == 'mosaic_lightview') { ?>
47
- <section id="apif-main-wrapper" class="thumb-view">
48
- <div class="row masonry for-mosaic isotope ifgrid">
 
 
 
 
 
 
 
49
  <?php
50
- $i = 1;
51
- $j = 0;
52
- if(isset($ins_media['meta']['error_message'])){
 
 
 
 
 
53
  ?>
54
- <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
55
  <?php
56
- }else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
57
- foreach ($ins_media['data'] as $vm):
58
- if ($count == $j) {
59
- break;
60
- }
61
- $j++;
62
- $img_alt = $vm['caption']['text'];
63
- $img = $vm['images']['standard_resolution']['url'];
64
- ?>
65
- <?php
66
- if ($i <= 2 || $i == 6 || $i == 7) {
67
- $masonary_class = 'grid-small';
68
- $image_url = APIF_IMAGE_DIR . '/image-square.png';
69
- $image = $vm['images']['low_resolution']['url'];
70
- } elseif ($i == 4 || $i == 5) {
71
- $masonary_class = 'grid-medium';
72
- $image_url = APIF_IMAGE_DIR . '/image-rect.png';
73
- $image = $vm['images']['standard_resolution']['url'];
74
- } elseif ($i == 3) {
75
- $masonary_class = 'grid-large';
76
- $image_url = APIF_IMAGE_DIR . '/image-square.png';
77
- $image = $vm['images']['standard_resolution']['url'];
78
- }
79
- $link = $vm["link"];
80
- $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
81
- ?>
82
- <div class="masonry_elem columns isotope-item element-itemif <?php echo esc_attr($masonary_class); ?>">
83
- <div class="thumb-elem large-mosaic-elem small-mosaic-elem hovermove large-mosaic-elem">
84
- <header class="thumb-elem-header">
85
- <?php
86
- if ($layout == 'mosaic_lightview') {
87
- ?>
88
- <div class="featimg">
 
 
 
89
  <a class="example-image-link" href="<?php echo esc_url($img); ?>" data-lightbox="example-set">
90
- <img class="the-thumb" src="<?php echo esc_url($image); ?>" alt='<?php echo esc_attr( $img_alt ); ?>'>
91
  <img class="transparent-image" src="<?php echo esc_url($image_url); ?>" alt='Transparent Image'>
92
  </a>
93
- </div>
94
- <a href="https://instagram.com/<?php echo $username; ?>" target="_blank" class="image-hover">
95
- <span class="follow"><?php echo esc_attr($followmetext);?></span>
96
- <span class="follow_icon">
97
- <img src="<?php echo $flow_icon; ?>"/>
98
- </span>
99
- </a>
100
- <?php } if ($layout == 'mosaic') { ?>
101
- <div class="featimg">
 
 
 
 
 
 
 
 
 
 
 
 
102
  <img class="the-thumb" src="<?php echo esc_url($image); ?>">
103
  <img class="transparent-image" src="<?php echo esc_url($image_url); ?>">
104
- </div>
105
- <a href="https://instagram.com/<?php echo $username; ?>" target="_blank" class="image-hover">
106
- <span class="follow"><?php echo esc_attr($followmetext);?></span>
107
- <span class="follow_icon">
108
- <img src="<?php echo $flow_icon; ?>"/>
109
- </span>
110
- </a>
111
- <?php } ?>
112
- </header>
113
- <?php if ($image_like == '1') : ?>
114
- <!-- Image like count section start -->
115
- <span class="instagram_like_count">
116
- <p class="instagram_imge_like">
117
- <span class="insta like_image">
118
- <i class="fa fa-heart-o fa-2x"></i>
119
- </span>
120
- <span class="count"><?php echo $likes = $vm['likes']['count']; ?></span>
121
- </p>
122
  </span>
123
- <!-- Image like count section end -->
124
- <?php endif; ?>
125
- </div>
 
 
126
  </div>
127
- <?php
128
- $i++;
129
- endforeach;
130
- }
131
- ?>
132
- </div>
133
- </section>
134
- <?php
135
- } else if ($layout == 'slider') {
 
 
 
 
 
 
 
 
136
  ?>
 
137
  <?php
138
- $j = 0;
139
- if(isset($ins_media['meta']['error_message'])){
140
- ?>
141
- <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
142
- <?php
143
- } if (is_array($ins_media['data']) || is_object($ins_media['data'])) { ?>
144
- <div id="owl-demo" class="owl-carousel">
 
 
 
 
145
  <?php
146
- foreach ($ins_media['data'] as $vm):
147
- if ($count == $j) {
148
- break;
149
- }
150
- $j++;
151
- $imgslider = $vm['images']['standard_resolution']['url'];
152
- $img_alt = $vm['caption']['text'];
153
- echo $img_alt;
154
  ?>
155
- <div class="item">
156
- <img src="<?php echo esc_url($imgslider); ?>" alt='<?php echo esc_attr( $img_alt ); ?>'/>
157
- <?php if ($image_like == '1') : ?>
158
- <!-- Image like count section start -->
159
- <span class="instagram_like_count">
160
- <p class="instagram_imge_like">
161
- <span class="insta like_image">
162
- <i class="fa fa-heart-o fa-2x"></i>
163
- </span>
164
- <span class="count"><?php echo $likes = $vm['likes']['count']; ?></span>
165
- </p>
166
- </span>
167
- <!-- Image like count section end -->
168
- <?php endif; ?>
169
  </div>
170
- <?php
171
- endforeach;
172
- ?>
173
  </div>
174
- <?php } ?>
175
-
176
- <?php }else if($layout == 'grid_rotator'){ ?>
177
- <?php
178
- if(isset($ins_media['meta']['error_message'])){
179
  ?>
180
- <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
181
- <?php
182
- }else if (is_array($ins_media['data']) || is_object($ins_media['data'])) { ?>
183
- <div class="ri-grid apif-ri-grid">
184
- <img class="ri-loading-image" src="<?php echo APIF_IMAGE_DIR. '/ripple.gif'; ?>"/>
185
- <ul>
 
 
 
 
 
 
 
186
  <?php
187
- foreach ($ins_media['data'] as $vm):
188
- $img_alt = $vm['caption']['text'];
189
- $img = $vm['images']['standard_resolution']['url'];
190
- $image_url = APIF_IMAGE_DIR . '/image-square.png';
191
- $image = $vm['images']['standard_resolution']['url'];
192
- $link = $vm["link"];
193
- $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
194
- ?>
195
- <li><a href="<?php echo $link ?>" target="_blank"><img src="<?php echo esc_url($image); ?>" alt='<?php echo strip_tags(substr($vm['caption']['text'], 0, 20)); ?>'></a></li>
196
  <?php
197
- endforeach; ?>
198
- </ul>
199
- </div>
200
- <?php } ?>
201
- <?php
202
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ defined('ABSPATH') or die("No script kiddies please!");
3
+ global $apif_settings, $insta;
4
+ $apif_settings = get_option('apif_settings');
5
+ $username = !empty($apif_settings['username']) ? $apif_settings['username'] : ''; // your username
6
+ $access_token = !empty($apif_settings['access_token']) ? $apif_settings['access_token'] : '';
7
+ $user_id = !empty($apif_settings['user_id']) ? $apif_settings['user_id'] : '';
8
+ $enable_cache = (isset($apif_settings['enable_cache']) && $apif_settings['enable_cache'] == 1) ? 1 : 0;
9
+ $cache_period = (isset($apif_settings['cache_period']) && $apif_settings['cache_period'] == 1) ? intval($apif_settings['cache_period']) : '24';
10
 
11
+ $followmetext = !empty($apif_settings['followmetext']) ? $apif_settings['followmetext'] : __('Follow Me', 'accesspress-instagram-feed');
12
+ $layout = $apif_settings['instagram_mosaic'];
13
+ $image_like = isset($apif_settings['active']) ? $apif_settings['active'] : '';
14
+ $count = 7; // number of images to show
15
+ require_once('instagram.php');
 
 
 
16
 
17
+ if ($username == '' && $access_token == '') {
18
+ $response = array('meta' => array('error_message' => 'Username and access token field is empty. Please configure.'));
19
+ } else if ($username == '') {
20
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
21
+ } else if ($access_token == '') {
22
+ $response = array('meta' => array('error_message' => 'Access token field is empty.'));
23
+ } else {
24
 
25
+ if ($enable_cache) {
26
+ $recent_feed_transient_name = 'recent_feed_transient';
27
+ $recent_feed_transient = get_transient($recent_feed_transient_name);
28
+ if (false === $recent_feed_transient) {
 
 
 
 
 
 
 
 
 
 
29
  $response = $insta->userMedia();
30
+ set_transient($recent_feed_transient_name, $response, $cache_period * HOUR_IN_SECONDS);
31
+ } else {
32
+ $response = $recent_feed_transient;
33
  }
34
+ } else {
35
+ $response = $insta->userMedia();
36
  }
37
+ }
38
 
39
+ if ($response == NULL) {
40
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
41
+ }
42
 
43
+ $ins_media = $response;
44
 
45
+ if ($layout == 'mosaic' || $layout == 'mosaic_lightview') {
46
+ ?>
47
+ <section id="apif-main-wrapper" class="thumb-view">
48
+ <div class="row masonry for-mosaic isotope ifgrid">
49
+ <?php
50
+ $i = 1;
51
+ $j = 0;
52
+ if (isset($ins_media['meta']['error_message'])) {
53
+ ?>
54
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
55
  <?php
56
+ } else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
57
+ foreach ($ins_media['data'] as $vm):
58
+ if ($count == $j) {
59
+ break;
60
+ }
61
+ $j++;
62
+ $img_alt = $vm['caption'];
63
+ $img = $vm['media_url'];
64
  ?>
 
65
  <?php
66
+ if ($i <= 2 || $i == 6 || $i == 7) {
67
+ $masonary_class = 'grid-small';
68
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
69
+ $image = $vm['media_url'];
70
+ } elseif ($i == 4 || $i == 5) {
71
+ $masonary_class = 'grid-medium';
72
+ $image_url = APIF_IMAGE_DIR . '/image-rect.png';
73
+ $image = $vm['media_url'];
74
+ } elseif ($i == 3) {
75
+ $masonary_class = 'grid-large';
76
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
77
+ $image = $vm['media_url'];
78
+ }
79
+ $link = $vm['permalink'];
80
+ $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
81
+ ?>
82
+ <div class="masonry_elem columns isotope-item element-itemif <?php echo esc_attr($masonary_class); ?>">
83
+ <div class="thumb-elem large-mosaic-elem small-mosaic-elem hovermove large-mosaic-elem">
84
+ <header class="thumb-elem-header">
85
+ <?php
86
+ if ($layout == 'mosaic_lightview') {
87
+ ?>
88
+ <div class="featimg">
89
+ <?php
90
+ if ($vm['media_type'] == "VIDEO") {
91
+ $video_link = $vm['media_url'];
92
+ ?>
93
+ <a class="example-image-link" href="<?php echo esc_url($video_link); ?>" data-lightbox="example-set">
94
+ <div id="inline-1" style="width:100%;height:100%">
95
+ <video controls style="width:100%;height:100%">
96
+ <source src="<?php echo $video_link; ?>" type="video/mp4">
97
+ Your browser does not support the video tag.
98
+ </video>
99
+ </div>
100
+ </a>
101
+ <?php } else { ?>
102
  <a class="example-image-link" href="<?php echo esc_url($img); ?>" data-lightbox="example-set">
103
+ <img class="the-thumb" src="<?php echo esc_url($image); ?>" alt='<?php echo esc_attr($img_alt); ?>'>
104
  <img class="transparent-image" src="<?php echo esc_url($image_url); ?>" alt='Transparent Image'>
105
  </a>
106
+ <?php } ?>
107
+ </div>
108
+ <a href="https://instagram.com/<?php echo $username; ?>" target="_blank" class="image-hover">
109
+ <span class="follow"><?php echo esc_attr($followmetext); ?></span>
110
+ <span class="follow_icon">
111
+ <img src="<?php echo $flow_icon; ?>"/>
112
+ </span>
113
+ </a>
114
+ <?php } if ($layout == 'mosaic') { ?>
115
+ <div class="featimg">
116
+ <?php
117
+ if ($vm['media_type'] == "VIDEO") {
118
+ $video_link = $vm['media_url'];
119
+ ?>
120
+ <!--<div id="inline-1" style="width:100%;height:100%">-->
121
+ <video class="the-thumb" controls style="width:100%;height:100%">
122
+ <source class="the-thumb" src="<?php echo $video_link; ?>" type="video/mp4">
123
+ Your browser does not support the video tag.
124
+ </video>
125
+ <!--</div>-->
126
+ <?php } else { ?>
127
  <img class="the-thumb" src="<?php echo esc_url($image); ?>">
128
  <img class="transparent-image" src="<?php echo esc_url($image_url); ?>">
129
+ <?php } ?>
130
+ </div>
131
+ <a href="https://instagram.com/<?php echo $username; ?>" target="_blank" class="image-hover">
132
+ <span class="follow"><?php echo esc_attr($followmetext); ?></span>
133
+ <span class="follow_icon">
134
+ <img src="<?php echo $flow_icon; ?>"/>
135
+ </span>
136
+ </a>
137
+ <?php } ?>
138
+ </header>
139
+ <?php //if ($image_like == '1') : ?>
140
+ <!-- Image like count section start -->
141
+ <!-- <span class="instagram_like_count">
142
+ <p class="instagram_imge_like">
143
+ <span class="insta like_image">
144
+ <i class="fa fa-heart-o fa-2x"></i>
 
 
145
  </span>
146
+ <span class="count"><?php echo $likes = $vm['like_count']; ?></span>
147
+ </p>
148
+ </span>-->
149
+ <!-- Image like count section end -->
150
+ <?php //endif; ?>
151
  </div>
152
+ </div>
153
+ <?php
154
+ $i++;
155
+ endforeach;
156
+ }
157
+ ?>
158
+ </div>
159
+ </section>
160
+ <?php
161
+ } else if ($layout == 'slider') {
162
+ ?>
163
+ <?php
164
+ $j = 0;
165
+ if (isset($ins_media['meta']['error_message'])) {
166
+ ?>
167
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
168
+ <?php } if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
169
  ?>
170
+ <div id="owl-demo" class="apif-owl-carousel owl-carousel">
171
  <?php
172
+ foreach ($ins_media['data'] as $vm):
173
+ if ($count == $j) {
174
+ break;
175
+ }
176
+ $j++;
177
+ $imgslider = $vm['media_url'];
178
+ $img_alt = $vm['caption'];
179
+ //echo $img_alt;
180
+ //die($img_alt);
181
+ ?>
182
+ <div class="item">
183
  <?php
184
+ if ($vm['media_type'] == "VIDEO") {
185
+ $video_link = $vm['media_url'];
 
 
 
 
 
 
186
  ?>
187
+ <div id="inline-1" style="width:100%;height:100%">
188
+ <video controls style="width:100%;height:100%">
189
+ <source src="<?php echo $video_link; ?>" type="video/mp4">
190
+ Your browser does not support the video tag.
191
+ </video>
 
 
 
 
 
 
 
 
 
192
  </div>
193
+ <?php } else { ?>
194
+ <img src="<?php echo esc_url($imgslider); ?>" alt='<?php echo esc_attr($img_alt); ?>'/>
195
+ <?php } ?>
196
  </div>
197
+ <?php
198
+ endforeach;
 
 
 
199
  ?>
200
+ </div>
201
+ <?php } ?>
202
+
203
+ <?php } else if ($layout == 'grid_rotator') { ?>
204
+ <?php
205
+ if (isset($ins_media['meta']['error_message'])) {
206
+ ?>
207
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
208
+ <?php } else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
209
+ ?>
210
+ <div class="ri-grid apif-ri-grid">
211
+ <img class="ri-loading-image" src="<?php echo APIF_IMAGE_DIR . '/ripple.gif'; ?>"/>
212
+ <ul>
213
  <?php
214
+ foreach ($ins_media['data'] as $vm):
215
+ $img_alt = $vm['caption'];
216
+ $img = $vm['media_url'];
217
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
218
+ $image = $vm['media_url'];
219
+ $link = $vm['permalink'];
220
+ $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
221
+ ?>
222
+ <li style="position:relative">
223
  <?php
224
+ if ($vm['media_type'] == "VIDEO") {
225
+ $video_link = $vm['media_url'];
226
+ ?>
227
+ <!--<a href="<?php //echo $link ?>" target="_blank">-->
228
+ <!--<div id="inline-1" style="width:100%;height:100%;position:relative">-->
229
+ <!--<a href="<?php //echo $link ?>" target="_blank">-->
230
+ <video controls style="width:inherit !important;height:100%;position:relative;right:0;display:block">
231
+ <source src="<?php echo $video_link; ?>" type="video/mp4">
232
+ Your browser does not support the video tag.
233
+ </video>
234
+ <!--</a>-->
235
+ <!--</div>/-->
236
+ <!--</a>-->
237
+ <?php } else { ?>
238
+ <a href="<?php echo $link ?>" target="_blank">
239
+ <img src="<?php echo esc_url($image); ?>" alt='<?php echo strip_tags(substr($vm['caption'], 0, 20)); ?>'>
240
+ </a>
241
+ <?php } ?>
242
+ </li>
243
+ <?php endforeach; ?>
244
+ </ul>
245
+ </div>
246
+ <?php } ?>
247
+ <?php
248
+ }
inc/frontend/instagram-grid-rotator.php CHANGED
@@ -1,87 +1,102 @@
1
  <?php
2
- defined( 'ABSPATH' ) or die( "No script kiddies please!" );
3
- global $apif_settings, $insta;
4
- $apif_settings = get_option( 'apif_settings' );
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();
12
- $rand_no = rand();
13
- if($username == '' && $access_token ==''){
14
- $response = array('meta'=>array('error_message'=>'Username and access token field is empty. Please configure.'));
 
 
 
 
 
 
 
15
 
16
- }else if($username == ''){
17
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
 
18
 
19
- }else if ($access_token == ''){
20
- $response = array('meta'=>array('error_message'=>'Access token field is empty.'));
21
- }else{
22
- $response = $insta->userMedia();
23
- }
24
-
25
- if($response == NULL){
26
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
27
- }
28
-
29
- $ins_media = $response;
30
  ?>
31
 
32
  <script type="text/javascript">
33
- jQuery(document).ready(function($){
34
- $( '.ri-grid-<?php echo $rand_no; ?>' ).gridrotator({
35
- rows : '2',
36
- columns : '5',
37
- maxStep : 2,
38
- interval : 2000,
39
- preventClick : false,
40
- w1024 : {
41
- rows : '2',
42
- columns : '5'
43
- },
44
- w768 : {
45
- rows : '2',
46
- columns : '5'
47
- },
48
- w480 : {
49
- rows : '2',
50
- columns : '5'
51
- },
52
- w320 : {
53
- rows : '2',
54
- columns : '5'
55
- },
56
- w240 : {
57
- rows : '2',
58
- columns : '5'
59
- }
60
- });
61
-
62
  });
 
 
63
  </script>
64
- <?php
65
- if(isset($ins_media['meta']['error_message'])){
66
- ?>
67
- <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
68
- <?php
69
- }else if (is_array($ins_media['data']) || is_object($ins_media['data'])) { ?>
70
- <div class="ri-grid ri-grid-<?php echo $rand_no; ?> apif-ri-grid">
71
- <img class="ri-loading-image" src="<?php echo APIF_IMAGE_DIR. '/ripple.gif'; ?>"/>
72
- <ul>
73
- <?php
74
- foreach ($ins_media['data'] as $vm):
75
- $img = $vm['images']['standard_resolution']['url'];
76
- $image_url = APIF_IMAGE_DIR . '/image-square.png';
77
- $image = $vm['images']['standard_resolution']['url'];
78
 
79
- $link = $vm["link"];
80
- $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
 
 
 
 
 
81
  ?>
82
- <li><a href="<?php echo $link ?>" target="_blank"><img src="<?php echo esc_url($image); ?>" alt='<?php echo strip_tags(substr($vm['caption']['text'], 0, 20)); ?>'></a></li>
83
- <?php
84
- endforeach; ?>
85
- </ul>
86
- </div>
87
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ defined('ABSPATH') or die("No script kiddies please!");
3
+ global $apif_settings, $insta;
4
+ $apif_settings = get_option('apif_settings');
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();
12
+ $rand_no = rand();
13
+ if ($username == '' && $access_token == '') {
14
+ $response = array('meta' => array('error_message' => 'Username and access token field is empty. Please configure.'));
15
+ } else if ($username == '') {
16
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
17
+ } else if ($access_token == '') {
18
+ $response = array('meta' => array('error_message' => 'Access token field is empty.'));
19
+ } else {
20
+ $response = $insta->userMedia();
21
+ }
22
 
23
+ if ($response == NULL) {
24
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
25
+ }
26
 
27
+ $ins_media = $response;
 
 
 
 
 
 
 
 
 
 
28
  ?>
29
 
30
  <script type="text/javascript">
31
+ jQuery(document).ready(function ($) {
32
+ $('.ri-grid-<?php echo $rand_no; ?>').gridrotator({
33
+ rows: '2',
34
+ columns: '5',
35
+ maxStep: 2,
36
+ interval: 2000,
37
+ preventClick: false,
38
+ w1024: {
39
+ rows: '2',
40
+ columns: '5'
41
+ },
42
+ w768: {
43
+ rows: '2',
44
+ columns: '5'
45
+ },
46
+ w480: {
47
+ rows: '2',
48
+ columns: '5'
49
+ },
50
+ w320: {
51
+ rows: '2',
52
+ columns: '5'
53
+ },
54
+ w240: {
55
+ rows: '2',
56
+ columns: '5'
57
+ }
 
 
58
  });
59
+
60
+ });
61
  </script>
62
+ <?php
63
+ if (isset($ins_media['meta']['error_message'])) {
64
+ ?>
65
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
66
+ <?php } else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
67
+ ?>
68
+ <div class="ri-grid ri-grid-<?php echo $rand_no; ?> apif-ri-grid">
69
+ <img class="ri-loading-image" src="<?php echo APIF_IMAGE_DIR . '/ripple.gif'; ?>"/>
70
+ <ul>
71
+ <?php
72
+ foreach ($ins_media['data'] as $vm):
73
+ $img = $vm['media_url'];
74
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
75
+ $image = $vm['media_url'];
76
 
77
+ $link = $vm['permalink'];
78
+ $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
79
+ ?>
80
+ <li>
81
+ <?php
82
+ if ($vm['media_type'] == "VIDEO") {
83
+ $video_link = $vm['media_url'];
84
  ?>
85
+ <!--<a href="<?php //echo $link ?>" target="_blank">-->
86
+ <!--<div id="inline-1" style="width:100%;height:100%;position:relative">-->
87
+ <!--<a href="<?php //echo $link ?>" target="_blank">-->
88
+ <video controls style="width:inherit !important;height:100%;position:relative;right:0;display:block">
89
+ <source src="<?php echo $video_link; ?>" type="video/mp4">
90
+ Your browser does not support the video tag.
91
+ </video>
92
+ <!--</a>-->
93
+ <!--</div>-->
94
+ <!--</a>-->
95
+ <?php } else { ?>
96
+ <a href="<?php echo $link ?>" target="_blank"><img src="<?php echo esc_url($image); ?>" alt='<?php echo strip_tags(substr($vm['caption'], 0, 20)); ?>'></a></li>
97
+ <?php }
98
+ endforeach;
99
+ ?>
100
+ </ul>
101
+ </div>
102
+ <?php } ?>
inc/frontend/instagram-masaic-light.php CHANGED
@@ -1,105 +1,105 @@
1
  <?php
2
- defined( 'ABSPATH' ) or die( "No script kiddies please!" );
3
  global $apif_settings, $insta;
4
- $apif_settings = get_option( 'apif_settings' );
5
  $username = $apif_settings['username']; // your username
6
  $access_token = $apif_settings['access_token'];
7
- $followmetext = !empty($apif_settings['followmetext']) ? $apif_settings['followmetext'] : __('Follow Me','accesspress-instagram-feed');
8
  $image_like = $apif_settings['active'];
9
  $count = 7; // number of images to show
10
  require_once('instagram.php');
11
  // $ins_media_masaic = $insta->userMedia();
12
  $rand_no = rand();
13
- if($username == '' && $access_token ==''){
14
- $response = array('meta'=>array('error_message'=>'Username and access token field is empty. Please configure.'));
 
 
 
 
 
 
 
15
 
16
- }else if($username == ''){
17
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
18
-
19
- }else if ($access_token == ''){
20
- $response = array('meta'=>array('error_message'=>'Access token field is empty.'));
21
- }else{
22
- $response = $insta->userMedia();
23
- }
24
-
25
- if($response == NULL){
26
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
27
- }
28
-
29
- $ins_media_masaic = $response;
30
- // var_dump($response);
31
- // die();
32
 
 
 
 
33
  ?>
34
  <section id="apif-main-wrapper-1" class="thumb-view">
35
  <div class="row masonry for-mosaic isotope ifgrid">
36
- <?php
37
- $i = 1;
38
- $j = 0;
39
- if(isset($ins_media_masaic['meta']['error_message'])){
40
- ?>
41
- <h1 class="widget-title-insta"><span><?php echo $ins_media_masaic['meta']['error_message']; ?></span></h1>
42
  <?php
43
- }else if (is_array($ins_media_masaic['data']) || is_object($ins_media_masaic['data'])) {
44
  foreach ($ins_media_masaic['data'] as $vm):
45
  if ($count == $j) {
46
  break;
47
  }
48
  $j++;
49
- $img = $vm['images']['standard_resolution']['url'];
50
- $img_alt = $vm['caption']['text'];
51
  ?>
52
  <?php
53
  if ($i <= 2 || $i == 6 || $i == 7) {
54
  $masonary_class = 'grid-small';
55
  $image_url = APIF_IMAGE_DIR . '/image-square.png';
56
- $image = $vm['images']['low_resolution']['url'];
57
  } elseif ($i == 4 || $i == 5) {
58
  $masonary_class = 'grid-medium';
59
  $image_url = APIF_IMAGE_DIR . '/image-rect.png';
60
- $image = $vm['images']['low_resolution']['url'];
61
  } elseif ($i == 3) {
62
  $masonary_class = 'grid-large';
63
  $image_url = APIF_IMAGE_DIR . '/image-square.png';
64
- $image = $vm['images']['standard_resolution']['url'];
65
  }
66
- $link = $vm["link"];
67
  $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
68
  ?>
69
  <div class="masonry_elem columns isotope-item element-itemif <?php echo esc_attr($masonary_class); ?>">
70
  <div class="thumb-elem large-mosaic-elem small-mosaic-elem hovermove large-mosaic-elem">
71
  <header class="thumb-elem-header">
72
  <div class="featimg">
73
- <a class="example-image-link" href="<?php echo esc_url($img); ?>" data-lightbox="example-set">
74
- <img class="the-thumb" src="<?php echo esc_url($image); ?>" alt='<?php echo esc_attr( $img_alt ); ?>'>
75
- <img class="transparent-image" src="<?php echo esc_url($image_url); ?>" alt='Transparent Image'>
76
- </a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  </div>
78
  <a href="https://instagram.com/<?php echo $username; ?>" target="_blank" class="image-hover">
79
- <span class="follow"><?php echo esc_attr($followmetext);?></span>
80
  <span class="follow_icon">
81
  <img src="<?php echo $flow_icon; ?>" alt='Follow'/>
82
  </span>
83
  </a>
84
  </header>
85
- <?php if ($image_like == '1') : ?>
86
- <!-- Image like count section start -->
87
- <span class="instagram_like_count">
88
- <p class="instagram_imge_like">
89
- <span class="insta like_image">
90
- <i class="fa fa-heart-o fa-2x"></i>
91
- </span>
92
- <span class="count"><?php echo $likes = $vm['likes']['count']; ?></span>
93
- </p>
94
- </span>
95
- <!-- Image like count section end -->
96
- <?php endif; ?>
97
  </div>
98
  </div>
99
- <?php
100
- $i++;
101
- endforeach;
102
- }
103
- ?>
104
  </div>
105
  </section>
1
  <?php
2
+ defined('ABSPATH') or die("No script kiddies please!");
3
  global $apif_settings, $insta;
4
+ $apif_settings = get_option('apif_settings');
5
  $username = $apif_settings['username']; // your username
6
  $access_token = $apif_settings['access_token'];
7
+ $followmetext = !empty($apif_settings['followmetext']) ? $apif_settings['followmetext'] : __('Follow Me', 'accesspress-instagram-feed');
8
  $image_like = $apif_settings['active'];
9
  $count = 7; // number of images to show
10
  require_once('instagram.php');
11
  // $ins_media_masaic = $insta->userMedia();
12
  $rand_no = rand();
13
+ if ($username == '' && $access_token == '') {
14
+ $response = array('meta' => array('error_message' => 'Username and access token field is empty. Please configure.'));
15
+ } else if ($username == '') {
16
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
17
+ } else if ($access_token == '') {
18
+ $response = array('meta' => array('error_message' => 'Access token field is empty.'));
19
+ } else {
20
+ $response = $insta->userMedia();
21
+ }
22
 
23
+ if ($response == NULL) {
24
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
25
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
+ $ins_media_masaic = $response;
28
+ // var_dump($response);
29
+ // die();
30
  ?>
31
  <section id="apif-main-wrapper-1" class="thumb-view">
32
  <div class="row masonry for-mosaic isotope ifgrid">
33
+ <?php
34
+ $i = 1;
35
+ $j = 0;
36
+ if (isset($ins_media_masaic['meta']['error_message'])) {
37
+ ?>
38
+ <h1 class="widget-title-insta"><span><?php echo $ins_media_masaic['meta']['error_message']; ?></span></h1>
39
  <?php
40
+ } else if (is_array($ins_media_masaic['data']) || is_object($ins_media_masaic['data'])) {
41
  foreach ($ins_media_masaic['data'] as $vm):
42
  if ($count == $j) {
43
  break;
44
  }
45
  $j++;
46
+ $img = $vm['media_url'];
47
+ $img_alt = $vm['caption'];
48
  ?>
49
  <?php
50
  if ($i <= 2 || $i == 6 || $i == 7) {
51
  $masonary_class = 'grid-small';
52
  $image_url = APIF_IMAGE_DIR . '/image-square.png';
53
+ $image = $vm['media_url'];
54
  } elseif ($i == 4 || $i == 5) {
55
  $masonary_class = 'grid-medium';
56
  $image_url = APIF_IMAGE_DIR . '/image-rect.png';
57
+ $image = $vm['media_url'];
58
  } elseif ($i == 3) {
59
  $masonary_class = 'grid-large';
60
  $image_url = APIF_IMAGE_DIR . '/image-square.png';
61
+ $image = $vm['media_url'];
62
  }
63
+ $link = $vm['permalink'];
64
  $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
65
  ?>
66
  <div class="masonry_elem columns isotope-item element-itemif <?php echo esc_attr($masonary_class); ?>">
67
  <div class="thumb-elem large-mosaic-elem small-mosaic-elem hovermove large-mosaic-elem">
68
  <header class="thumb-elem-header">
69
  <div class="featimg">
70
+ <?php
71
+ if ($vm['media_type'] == "VIDEO") {
72
+ $video_link = $vm['media_url'];
73
+ ?>
74
+ <a class="example-image-link" href="<?php echo esc_url($video_link); ?>" data-lightbox="example-set">
75
+ <div id="inline-1" style="width:100%;height:100%">
76
+ <video controls style="width:100%;height:100%">
77
+ <source src="<?php echo $video_link; ?>" type="video/mp4">
78
+ Your browser does not support the video tag.
79
+ </video>
80
+ </div>
81
+ </a>
82
+ <?php } else { ?>
83
+ <a class="example-image-link" href="<?php echo esc_url($img); ?>" data-lightbox="example-set">
84
+ <img class="the-thumb" src="<?php echo esc_url($image); ?>" alt='<?php echo esc_attr($img_alt); ?>'>
85
+ <img class="transparent-image" src="<?php echo esc_url($image_url); ?>" alt='Transparent Image'>
86
+ </a>
87
+ <?php } ?>
88
  </div>
89
  <a href="https://instagram.com/<?php echo $username; ?>" target="_blank" class="image-hover">
90
+ <span class="follow"><?php echo esc_attr($followmetext); ?></span>
91
  <span class="follow_icon">
92
  <img src="<?php echo $flow_icon; ?>" alt='Follow'/>
93
  </span>
94
  </a>
95
  </header>
96
+
 
 
 
 
 
 
 
 
 
 
 
97
  </div>
98
  </div>
99
+ <?php
100
+ $i++;
101
+ endforeach;
102
+ }
103
+ ?>
104
  </div>
105
  </section>
inc/frontend/instagram-slider.php CHANGED
@@ -1,67 +1,65 @@
1
  <?php
2
- defined( 'ABSPATH' ) or die( "No script kiddies please!" );
3
  global $apif_settings, $insta;
4
- $apif_settings = get_option( 'apif_settings' );
5
- $username = $apif_settings['username']; // your username
6
- $access_token = $apif_settings['access_token'];
7
- $image_like = $apif_settings['active'];
8
- $count = 10; // number of images to show
9
- require_once('instagram.php');
10
- if($username == '' && $access_token ==''){
11
- $response = array('meta'=>array('error_message'=>'Username and access token field is empty. Please configure.'));
 
 
 
 
 
 
 
12
 
13
- }else if($username == ''){
14
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
 
15
 
16
- }else if ($access_token == ''){
17
- $response = array('meta'=>array('error_message'=>'Access token field is empty.'));
18
- }else{
19
- $response = $insta->userMedia();
20
- }
21
-
22
- if($response == NULL){
23
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
24
- }
25
-
26
- $ins_media_slider = $response;
27
  ?>
28
- <?php
29
- $j = 0;
30
- if(isset($ins_media_slider['meta']['error_message'])){
31
- ?>
32
- <h1 class="widget-title-insta"><span><?php echo $ins_media_slider['meta']['error_message']; ?></span></h1>
 
 
 
 
 
 
 
 
 
33
  <?php
34
- }else if (is_array($ins_media_slider['data']) || is_object($ins_media_slider['data'])) { ?>
35
- <div id="owl-demo" class="apif-owl-carousel owl-carousel">
36
- <?php
37
- foreach ($ins_media_slider['data'] as $vm):
38
- if ($count == $j) {
39
- break;
40
- }
41
- $j++;
42
- $imgslider = $vm['images']['standard_resolution']['url'];
43
- $img_alt = $vm['caption']['text'];
44
- ?>
45
- <div class="item">
46
- <img src="<?php echo esc_url($imgslider); ?>" alt='<?php echo esc_attr( $img_alt ); ?>'/>
47
- <?php if ($image_like == '1') : ?>
48
- <!-- Image like cound section start -->
49
- <span class="instagram_like_count">
50
- <p class="instagram_imge_like">
51
- <span class="insta like_image">
52
- <i class="fa fa-heart-o fa-2x"></i>
53
- </span>
54
- <span class="count"><?php echo $likes = $vm['likes']['count']; ?></span>
55
- </p>
56
- </span>
57
- <!-- Image like cound section end -->
58
- <?php endif; ?>
59
- </div>
60
-
61
- <?php
62
- endforeach;
63
  ?>
 
 
 
 
 
 
 
 
 
64
  </div>
65
- <?php
66
- }
 
67
  ?>
 
 
 
 
1
  <?php
2
+ defined('ABSPATH') or die("No script kiddies please!");
3
  global $apif_settings, $insta;
4
+ $apif_settings = get_option('apif_settings');
5
+ $username = $apif_settings['username']; // your username
6
+ $access_token = $apif_settings['access_token'];
7
+ $image_like = $apif_settings['active'];
8
+ $count = 10; // number of images to show
9
+ require_once('instagram.php');
10
+ if ($username == '' && $access_token == '') {
11
+ $response = array('meta' => array('error_message' => 'Username and access token field is empty. Please configure.'));
12
+ } else if ($username == '') {
13
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
14
+ } else if ($access_token == '') {
15
+ $response = array('meta' => array('error_message' => 'Access token field is empty.'));
16
+ } else {
17
+ $response = $insta->userMedia();
18
+ }
19
 
20
+ if ($response == NULL) {
21
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
22
+ }
23
 
24
+ $ins_media_slider = $response;
25
+ ?>
26
+ <?php
27
+ $j = 0;
28
+ if (isset($ins_media_slider['meta']['error_message'])) {
 
 
 
 
 
 
29
  ?>
30
+ <h1 class="widget-title-insta"><span><?php echo $ins_media_slider['meta']['error_message']; ?></span></h1>
31
+ <?php } else if (is_array($ins_media_slider['data']) || is_object($ins_media_slider['data'])) {
32
+ ?>
33
+ <div id="owl-demo" class="apif-owl-carousel owl-carousel">
34
+ <?php
35
+ foreach ($ins_media_slider['data'] as $vm):
36
+ if ($count == $j) {
37
+ break;
38
+ }
39
+ $j++;
40
+ $imgslider = $vm['media_url'];
41
+ $img_alt = $vm['caption'];
42
+ ?>
43
+ <div class="item">
44
  <?php
45
+ if ($vm['media_type'] == "VIDEO") {
46
+ $video_link = $vm['media_url'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  ?>
48
+ <div id="inline-1" style="width:100%;height:100%">
49
+ <video controls style="width:100%;height:100%">
50
+ <source src="<?php echo $video_link; ?>" type="video/mp4">
51
+ Your browser does not support the video tag.
52
+ </video>
53
+ </div>
54
+ <?php } else { ?>
55
+ <img src="<?php echo esc_url($imgslider); ?>" alt='<?php echo esc_attr($img_alt); ?>'/>
56
+ <?php } ?>
57
  </div>
58
+
59
+ <?php
60
+ endforeach;
61
  ?>
62
+ </div>
63
+ <?php
64
+ }
65
+ ?>
inc/frontend/instagram-widget.php CHANGED
@@ -1,97 +1,98 @@
1
  <?php
2
- defined( 'ABSPATH' ) or die( "No script kiddies please!" );
3
- global $insta;
4
- $apif_settings = get_option( 'apif_settings' );
5
- $username = $apif_settings['username']; // your username
6
- $access_token = $apif_settings['access_token'];
7
- $layout = $apif_settings['instagram_mosaic'];
8
- $followmetext = !empty($apif_settings['followmetext']) ? $apif_settings['followmetext'] : __('Follow Me','accesspress-instagram-feed');
9
- $image_like = isset($apif_settings['active']) ? $apif_settings['active']: '0';
10
- $count = 7; // number of images to show
11
- require_once('instagram.php');
12
- ?>
13
- <section id="main" class="thumb-view">
14
- <div class="row masonry for-mosaic isotope ifgrid">
15
- <?php
16
- if($username == '' && $access_token ==''){
17
- $response = array('meta'=>array('error_message'=>'Username and access token field is empty. Please configure.'));
18
- }else if($username == ''){
19
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
20
- }else if ($access_token == ''){
21
- $response = array('meta'=>array('error_message'=>'Access token field is empty.'));
22
- }else{
23
- $response = $insta->userMedia();
24
- }
25
- if($response == NULL){
26
- $response = array('meta'=>array('error_message'=>'Username field is empty.'));
27
- }
28
 
29
- $ins_media = $response;
30
 
31
- $i = 1;
32
- $j = 0;
33
- if(isset($ins_media['meta']['error_message'])){
 
 
 
 
 
 
 
 
 
 
 
34
  ?>
35
- <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
36
  <?php
37
- }else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
38
- foreach ($ins_media['data'] as $vm):
39
- if ($count == $j) {
40
- break;
41
- }
42
- $j++;
43
- $img = $vm['images']['standard_resolution']['url'];
44
- $img_alt = $vm['caption']['text'];
45
- ?>
46
- <?php
47
- if ($i <= 2 || $i == 6 || $i == 7) {
48
- $masonary_class = 'grid-small';
49
- $image_url = APIF_IMAGE_DIR . '/image-square.png';
50
- $image = $vm['images']['low_resolution']['url'];
51
- } elseif ($i == 4 || $i == 5) {
52
- $masonary_class = 'grid-medium';
53
- $image_url = APIF_IMAGE_DIR . '/image-rect.png';
54
- $image = $vm['images']['standard_resolution']['url'];
55
- } elseif ($i == 3) {
56
- $masonary_class = 'grid-large';
57
- $image_url = APIF_IMAGE_DIR . '/image-square.png';
58
- $image = $vm['images']['standard_resolution']['url'];
59
- }
60
- $link = $vm["link"];
61
- $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
62
- ?>
63
- <div class="masonry_elem columns isotope-item element-itemif <?php echo esc_attr($masonary_class); ?>">
64
- <div class="thumb-elem large-mosaic-elem small-mosaic-elem hovermove large-mosaic-elem">
65
- <header class="thumb-elem-header">
66
- <div class="featimg">
67
- <img class="the-thumb" src="<?php echo esc_url($image); ?>" alt='<?php echo esc_attr( $img_alt ); ?>'>
 
68
  <img class="transparent-image" src="<?php echo esc_url($image_url); ?>" alt='Transparent Image'>
69
- </div>
70
- <a href="https://instagram.com/<?php echo $username; ?>" target="_blank" class="image-hover">
71
- <span class="follow"><?php echo esc_attr($followmetext);?></span>
72
- <span class="follow_icon">
73
- <img src="<?php echo $flow_icon; ?>" alt="Follow"/>
74
- </span>
75
- </a>
76
- </header>
77
- <?php if ($image_like == '1') : ?>
78
- <!-- Image like cound section start -->
79
- <span class="instagram_like_count">
80
- <p class="instagram_imge_like">
81
- <span class="insta like_image">
82
- <i class="fa fa-heart-o fa-2x"></i>
83
- </span>
84
- <span class="count"><?php echo $likes = $vm['likes']['count']; ?></span>
85
- </p>
86
  </span>
87
- <!-- Image like cound section end -->
88
- <?php endif; ?>
89
- </div>
90
  </div>
91
- <?php
92
- $i++;
93
- endforeach;
94
- }
95
- ?>
96
- </div>
 
97
  </section>
1
  <?php
2
+ defined('ABSPATH') or die("No script kiddies please!");
3
+ global $insta;
4
+ $apif_settings = get_option('apif_settings');
5
+ $username = $apif_settings['username']; // your username
6
+ $access_token = $apif_settings['access_token'];
7
+ $layout = $apif_settings['instagram_mosaic'];
8
+ $followmetext = !empty($apif_settings['followmetext']) ? $apif_settings['followmetext'] : __('Follow Me', 'accesspress-instagram-feed');
9
+ $image_like = isset($apif_settings['active']) ? $apif_settings['active'] : '0';
10
+ $count = 7; // number of images to show
11
+ require_once('instagram.php');
12
+ ?>
13
+ <section id="main" class="thumb-view">
14
+ <div class="row masonry for-mosaic isotope ifgrid">
15
+ <?php
16
+ if ($username == '' && $access_token == '') {
17
+ $response = array('meta' => array('error_message' => 'Username and access token field is empty. Please configure.'));
18
+ } else if ($username == '') {
19
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
20
+ } else if ($access_token == '') {
21
+ $response = array('meta' => array('error_message' => 'Access token field is empty.'));
22
+ } else {
23
+ $response = $insta->userMedia();
24
+ }
25
+ if ($response == NULL) {
26
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
27
+ }
28
 
29
+ $ins_media = $response;
30
 
31
+ $i = 1;
32
+ $j = 0;
33
+ if (isset($ins_media['meta']['error_message'])) {
34
+ ?>
35
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
36
+ <?php
37
+ } else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
38
+ foreach ($ins_media['data'] as $vm):
39
+ if ($count == $j) {
40
+ break;
41
+ }
42
+ $j++;
43
+ $img = $vm['media_url'];
44
+ $img_alt = $vm['caption'];
45
  ?>
 
46
  <?php
47
+ if ($i <= 2 || $i == 6 || $i == 7) {
48
+ $masonary_class = 'grid-small';
49
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
50
+ $image = $vm['media_url'];
51
+ } elseif ($i == 4 || $i == 5) {
52
+ $masonary_class = 'grid-medium';
53
+ $image_url = APIF_IMAGE_DIR . '/image-rect.png';
54
+ $image = $vm['media_url'];
55
+ } elseif ($i == 3) {
56
+ $masonary_class = 'grid-large';
57
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
58
+ $image = $vm['media_url'];
59
+ }
60
+ $link = $vm['permalink'];
61
+ $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
62
+ ?>
63
+ <div class="masonry_elem columns isotope-item element-itemif <?php echo esc_attr($masonary_class); ?>">
64
+ <div class="thumb-elem large-mosaic-elem small-mosaic-elem hovermove large-mosaic-elem">
65
+ <header class="thumb-elem-header">
66
+ <div class="featimg">
67
+ <?php
68
+ if ($vm['media_type'] == "VIDEO") {
69
+ $video_link = $vm['media_url'];
70
+ ?>
71
+ <div id="inline-1" style="width:100%;height:100%">
72
+ <video controls style="width:100%;height:100%">
73
+ <source src="<?php echo $video_link; ?>" type="video/mp4">
74
+ Your browser does not support the video tag.
75
+ </video>
76
+ </div>
77
+ <?php } else { ?>
78
+ <img class="the-thumb" src="<?php echo esc_url($image); ?>" alt='<?php echo esc_attr($img_alt); ?>'>
79
  <img class="transparent-image" src="<?php echo esc_url($image_url); ?>" alt='Transparent Image'>
80
+ <?php } ?>
81
+ </div>
82
+ <a href="https://instagram.com/<?php echo $username; ?>" target="_blank" class="image-hover">
83
+ <span class="follow"><?php echo esc_attr($followmetext); ?></span>
84
+ <span class="follow_icon">
85
+ <img src="<?php echo $flow_icon; ?>" alt="Follow"/>
 
 
 
 
 
 
 
 
 
 
 
86
  </span>
87
+ </a>
88
+ </header>
89
+
90
  </div>
91
+ </div>
92
+ <?php
93
+ $i++;
94
+ endforeach;
95
+ }
96
+ ?>
97
+ </div>
98
  </section>
inc/frontend/instagram.php CHANGED
@@ -3,21 +3,22 @@ class InstaWCD{
3
  function userID(){
4
  $username = strtolower($this->username); // sanitization
5
  $token = $this->access_token;
 
6
 
7
- if(!empty($username) && !empty($token)) {
8
- $url = "https://api.instagram.com/v1/users/search?q=".$username."&access_token=".$token;
9
- $get = wp_remote_get($url);
10
- $response = wp_remote_retrieve_body( $get );
11
- $json = json_decode($response);
12
- if(isset($json->data)){
13
- foreach($json->data as $user){
14
- if($user->username == $username){
15
- return $user->id;
16
- }
17
- }
18
- }
19
- return '00000000'; // return this if nothing is found
20
- }
21
  }
22
 
23
  function get_remote_data_from_instagram_in_json($url){
@@ -29,6 +30,9 @@ class InstaWCD{
29
  }else{
30
  $response = wp_remote_retrieve_body( $content );
31
  $json = json_decode( $response, true );
 
 
 
32
  return $json;
33
  }
34
  }
@@ -39,7 +43,10 @@ class InstaWCD{
39
  */
40
  function userMedia(){
41
  // $url = 'https://api.instagram.com/v1/users/'.$this->userID().'/media/recent/?access_token='.$this->access_token;
42
- $url = 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' . $this->access_token;
 
 
 
43
  $json = self::get_remote_data_from_instagram_in_json( $url );
44
  return $json;
45
  }
@@ -47,11 +54,16 @@ class InstaWCD{
47
  //retrive user info
48
  function userInfo(){
49
  //$url = 'https://api.instagram.com/v1/users/' . $this->userID() . '?access_token=' . $this->access_token;
50
- $url = 'https://api.instagram.com/v1/users/self/?access_token=' . $this->access_token;
 
 
 
51
  $json = self:: get_remote_data_from_instagram_in_json( $url );
 
52
  return $json;
53
  }
54
  }
55
  $insta = new InstaWCD();
56
  $insta->username = $username;
57
  $insta->access_token = $access_token;
 
3
  function userID(){
4
  $username = strtolower($this->username); // sanitization
5
  $token = $this->access_token;
6
+ $user_id = $this->user_id;
7
 
8
+ // if(!empty($username) && !empty($token)) {
9
+ // $url = "https://api.instagram.com/v1/users/search?q=".$username."&access_token=".$token;
10
+ // $get = wp_remote_get($url);
11
+ // $response = wp_remote_retrieve_body( $get );
12
+ // $json = json_decode($response);
13
+ // if(isset($json->data)){
14
+ // foreach($json->data as $user){
15
+ // if($user->username == $username){
16
+ // return $user->id;
17
+ // }
18
+ // }
19
+ // }
20
+ // return '00000000'; // return this if nothing is found
21
+ // }
22
  }
23
 
24
  function get_remote_data_from_instagram_in_json($url){
30
  }else{
31
  $response = wp_remote_retrieve_body( $content );
32
  $json = json_decode( $response, true );
33
+ // echo "<pre>";
34
+ // print_r($json);
35
+ // echo "</pre>";
36
  return $json;
37
  }
38
  }
43
  */
44
  function userMedia(){
45
  // $url = 'https://api.instagram.com/v1/users/'.$this->userID().'/media/recent/?access_token='.$this->access_token;
46
+ //$url = 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' . $this->access_token;
47
+ $token = $this->access_token;
48
+ $user_id = $this->user_id;
49
+ $url = 'https://graph.instagram.com/'.$user_id.'/media?fields=id,caption,media_type,media_url,permalink,thumbnail_url,timestamp,username&access_token=' . $token .'';
50
  $json = self::get_remote_data_from_instagram_in_json( $url );
51
  return $json;
52
  }
54
  //retrive user info
55
  function userInfo(){
56
  //$url = 'https://api.instagram.com/v1/users/' . $this->userID() . '?access_token=' . $this->access_token;
57
+ //$url = 'https://api.instagram.com/v1/users/self/?access_token=' . $this->access_token;
58
+ $token = $this->access_token;
59
+ $user_id = $this->user_id;
60
+ $url = 'https://graph.instagram.com/'.$user_id.'?fields=id,username,media_count,account_type&access_token=' . $token .'';
61
  $json = self:: get_remote_data_from_instagram_in_json( $url );
62
+ //print_r($json);
63
  return $json;
64
  }
65
  }
66
  $insta = new InstaWCD();
67
  $insta->username = $username;
68
  $insta->access_token = $access_token;
69
+ $insta->user_id=$user_id;
js/frontend.js CHANGED
@@ -70,10 +70,14 @@ function initHoverEffectForThumbView() {
70
  var mouseY = e.pageY - thisElem.offset().top;
71
  var mouseDistX = (mouseX / centerX) * 100 - 100;
72
  var mouseDistY = (mouseY / centerY) * 100 - 100;
73
- thisElem.find('img.the-thumb').css({
74
- 'left': -(mouseDistX/6.64) - 15 + "%",
75
- 'top': -(mouseDistY/6.64) - 15 + "%"
76
- });
 
 
 
 
77
  });
78
 
79
  thisElem.find('.thumb-elem-section:not(.no-feat-img)').fadeIn('fast');
70
  var mouseY = e.pageY - thisElem.offset().top;
71
  var mouseDistX = (mouseX / centerX) * 100 - 100;
72
  var mouseDistY = (mouseY / centerY) * 100 - 100;
73
+ // thisElem.find('img.the-thumb').css({
74
+ // 'left': -(mouseDistX/6.64) - 15 + "%",
75
+ // 'top': -(mouseDistY/6.64) - 15 + "%"
76
+ // });
77
+ // thisElem.find('source.the-thumb').css({
78
+ // 'left': -(mouseDistX/6.64) - 15 + "%",
79
+ // 'top': -(mouseDistY/6.64) - 15 + "%"
80
+ // });
81
  });
82
 
83
  thisElem.find('.thumb-elem-section:not(.no-feat-img)').fadeIn('fast');
readme.txt CHANGED
@@ -3,14 +3,14 @@ Contributors: Access Keys
3
  Tags: instagram, instagram feed, instagram tag, instagram slider, instagarm mosaic view, instagarm mosaic layout, instagram lightbox, social media instagram, social network, masonry layout, masonry lightbox, instagarm masonry view, grid rotator, grid rotatory
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
- Tested up to: 5.3
7
- Stable tag: 3.1.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  == Description =
12
 
13
- [Homepage](https://accesspressthemes.com/) | [Documentation](https://accesspressthemes.com/documentation/accesspress-instagram-feeds/) | [Support](https://accesspressthemes.com/support) | [Demo](http://demo.accesspressthemes.com/wordpress-plugins/accesspress-instagram-feeds/) | [Premium Version](https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-instagram-feed-pro%2F14291754)
14
 
15
  <strong>AccessPress iFeeds</strong> is a <strong>Free WordPress plugin</strong> to display your post image in mosaic, grid or slider view of your instagram account. A perfect plugin to show your instagram feeds and encourage more to join your network.
16
 
@@ -40,7 +40,7 @@ All you have to do is either use a widget or shortcode to display your instagram
40
 
41
  ★ Supports your recent media and hashtag.
42
 
43
- ★ Add Instagram feeds to sidebars using wloidgets.
44
 
45
  ★ 10 different layout to choose.
46
 
@@ -68,7 +68,7 @@ All you have to do is either use a widget or shortcode to display your instagram
68
 
69
  = Premium upgrade =
70
 
71
- For premium upgrade please go [here](https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-instagram-feed-pro%2F14291754)
72
 
73
  = Shortcode =
74
  * Use the shortcode [ap_instagram_feed] to display your instagram feed within your content mosaic layout.
@@ -84,29 +84,9 @@ For premium upgrade please go [here](https://1.envato.market/c/1302794/275988/44
84
  = Some Useful Links =
85
  * <strong>Support Email</strong>: support@accesspressthemes.com
86
  * <strong>Support Forum Link</strong>: http://accesspressthemes.com/support/
87
- * <strong>Website Link</strong>: http://accesspressthemes.com/
88
- * <strong>Youtube channel link</strong>: https://www.youtube.com/watch?v=TjZNcVG3fDE
89
- * <strong>Facebook link</strong>: https://www.facebook.com/AccessPressThemes
90
 
91
- For a easy installation guide checkout the Installation tab above.
92
-
93
- [More WordPress Resources](http://wpallclub.com/)
94
-
95
- == Themes Compatible with the Plugin: ==
96
-
97
- <strong>AccessPress iFeeds </strong> works best with every WordPress theme. Its even more remarkable when used with popular themes like VMagazine and AccessPress Parallax.
98
-
99
- AND IF THIS PLUGIN HAS IMPRESSED YOU, THEN YOU WOULD ENJOY OUR OTHER PROJECTS TOO. DO CHECK THESE OUT :
100
-
101
- [WPAll Club](https://wpallclub.com/) - A complete WordPress resources club. WordPress tutorials, blogs, curated free and premium themes and plugins, WordPress deals, offers, hosting info and more.
102
 
103
- [Premium WordPress Themes](https://themeforest.net/user/accesskeys/portfolio) - 6 premium WordPress themes well suited for all sort of websites. Professional, well coded and highly configurable themes for you.
104
-
105
- [Premium WordPress Plugins](https://codecanyon.net/user/accesskeys/portfolio?Ref=AccessKeys) - 45+ premium WordPress plugins of many different types. High user ratings, great quality and best sellers in CodeCanyon marketplace.
106
-
107
- [AccessPress Themes](https://accesspressthemes.com/) - AccessPress Themes has 50+ beautiful and elegant, fully responsive, multipurpose themes to meet your need for free and commercial basis.
108
-
109
- [8Degree Themes](https://8degreethemes.com/) - 8Degree Themes offers 15+ free WordPress themes and 16+ premium WordPress themes carefully crafted with creativity.
110
 
111
  == Installation ==
112
 
@@ -150,6 +130,10 @@ Once you install the plugin , you can check some general documentation about how
150
  4. Backend Display Settings Section
151
 
152
  == Changelog ==
 
 
 
 
153
  = 3.1.5 =
154
  * Few Refinement work on backend done.
155
 
3
  Tags: instagram, instagram feed, instagram tag, instagram slider, instagarm mosaic view, instagarm mosaic layout, instagram lightbox, social media instagram, social network, masonry layout, masonry lightbox, instagarm masonry view, grid rotator, grid rotatory
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
+ Tested up to: 5.4.2
7
+ Stable tag: 4.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  == Description =
12
 
13
+ [Documentation](https://accesspressthemes.com/documentation/accesspress-instagram-feeds/) | [Support](https://accesspressthemes.com/support) | [Demo](http://demo.accesspressthemes.com/wordpress-plugins/accesspress-instagram-feeds/) | [Premium Version](https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed-pro/)
14
 
15
  <strong>AccessPress iFeeds</strong> is a <strong>Free WordPress plugin</strong> to display your post image in mosaic, grid or slider view of your instagram account. A perfect plugin to show your instagram feeds and encourage more to join your network.
16
 
40
 
41
  ★ Supports your recent media and hashtag.
42
 
43
+ ★ Add Instagram feeds to sidebars using widgets.
44
 
45
  ★ 10 different layout to choose.
46
 
68
 
69
  = Premium upgrade =
70
 
71
+ For premium upgrade please go [here](https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed-pro/)
72
 
73
  = Shortcode =
74
  * Use the shortcode [ap_instagram_feed] to display your instagram feed within your content mosaic layout.
84
  = Some Useful Links =
85
  * <strong>Support Email</strong>: support@accesspressthemes.com
86
  * <strong>Support Forum Link</strong>: http://accesspressthemes.com/support/
 
 
 
87
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
+ For a easy installation guide checkout the Installation tab above.
 
 
 
 
 
 
90
 
91
  == Installation ==
92
 
130
  4. Backend Display Settings Section
131
 
132
  == Changelog ==
133
+ = 4.0.0 =
134
+ * Made plugin compatible with latest changes in instagram api.
135
+ * Fixed slider issue and added setting to display videos
136
+
137
  = 3.1.5 =
138
  * Few Refinement work on backend done.
139