AccessPress Instagram Feed - Version 4.0.3

Version Description

  • No more required to create an app in developer platform
  • Added login button to easily get user profile detail
Download this release

Release Info

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

Code changes from version 4.0.2 to 4.0.3

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: 4.0.2
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', '4.0.2' );
17
  }
18
 
19
  if( !defined( 'APIF_IMAGE_DIR' ) ) {
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.3
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.3' );
17
  }
18
 
19
  if( !defined( 'APIF_IMAGE_DIR' ) ) {
css/backend.css CHANGED
@@ -798,8 +798,8 @@ min-height: 40px; margin:20px 0px 0 0; clear: both; display: block; text-align:
798
  .apif-upgrade-banner {width: 100%; clear: both; float: none; text-align: center;}
799
  }
800
  #login_with_instagram{
801
- background: #72b73f;
802
- padding: 6px;
803
  margin-top: 6px;
804
  width: 148px;
805
  text-align: center;
798
  .apif-upgrade-banner {width: 100%; clear: both; float: none; text-align: center;}
799
  }
800
  #login_with_instagram{
801
+ background: #00749e;
802
+ padding: 14px;
803
  margin-top: 6px;
804
  width: 148px;
805
  text-align: center;
inc/backend/boards/instagram-profiles.php CHANGED
@@ -1,138 +1,119 @@
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 = esc_attr($apif_settings['app_id']);
10
- } else {
11
- $app_id = '1150049435376377';
12
- }
13
- if (isset($apif_settings['app_secret']) && $apif_settings['app_secret'] != '') {
14
- $app_secret = esc_attr($apif_settings['app_secret']);
15
- } else {
16
- $app_secret = '5eab5bf8ad269da35069be8e0f2db96f';
17
- }
18
- if (isset($apif_settings['username']) && $apif_settings['username'] != '') {
19
- $username = esc_attr($apif_settings['username']);
20
- } else {
21
- $username = '';
22
- }
23
- if (isset($apif_settings['user_id']) && $apif_settings['user_id'] != '') {
24
- $user_id = esc_attr($apif_settings['user_id']);
25
- } else {
26
- $user_id = '';
27
- }
28
- if (isset($apif_settings['access_token']) && $apif_settings['access_token'] != '') {
29
- $access_token = esc_attr($apif_settings['access_token']);
30
- } else {
31
- $access_token = '';
32
- }
33
- ?>
34
- <!--Instagram-->
35
- <div class="apsc-option-outer-wrapper">
36
- <h4><?php _e('Plugin Settings', 'accesspress-instagram-feed') ?></h4>
37
- <div class="updated settings-error notice is-dismissible">
38
- <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>
39
- <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 authorize 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'); ?>
40
- </b></p>
41
- </div>
42
- <br/>
43
- <div class="apsc-option-extra">
44
- <div class='apsc-option-inner-wrapper'>
45
- <label for='instagram_appid'><?php _e('Your instagram appid', 'accesspress-instagram-feed'); ?></label>
46
- <input type='text' id='instagram-app-id' placeholder="Enter your app id" name='instagram[app_id]' value='<?php
47
- if (isset($apif_settings['app_id'])) {
48
- echo esc_attr($apif_settings['app_id']);
49
- }
50
- ?>' />
51
- </div>
52
- <div class='apsc-option-inner-wrapper'>
53
- <label for='instagram_appsecret'><?php _e('Your instagram appsecret', 'accesspress-instagram-feed'); ?></label>
54
- <input type='text' id='instagram-app-secret' placeholder="Enter your app secret" name='instagram[app_secret]' value='<?php
55
- if (isset($apif_settings['app_secret'])) {
56
- echo esc_attr($apif_settings['app_secret']);
57
- }
58
- ?>' />
59
- </div>
60
- <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>
61
- <div id="login_with_instagram">
62
- <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>
63
- </div>
64
- <div class="apsc-option-inner-wrapper">
65
- <label for='instagram_username'><?php _e('Your instagram username', 'accesspress-instagram-feed'); ?></label>
66
- <div class="apsc-option-field">
67
- <input type="text" name="instagram[username]" id='instagram_username' value="<?php
68
- if (isset($_GET["username"])) {
69
- echo esc_attr($_GET["username"]);
70
- } else {
71
- echo esc_attr($username);
72
- }
73
- ?>"/>
74
- <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>
75
- </div>
76
- </div>
77
- <div class="apsc-option-inner-wrapper">
78
- <label for='instagram_user_id'><?php _e('Your instagram user ID', 'accesspress-instagram-feed'); ?></label>
79
- <div class="apsc-option-field">
80
- <input type="text" name="instagram[user_id]" id='instagram_user_id' value="<?php
81
- if (isset($_GET["userid"])) {
82
- echo esc_attr($_GET["userid"]);
83
- } else {
84
- echo esc_attr($user_id);
85
- }
86
- ?>"/><?php //var_dump($user_id); ?>
87
- <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>
88
- </div>
89
- </div>
90
- <div class="apsc-option-inner-wrapper">
91
- <label for='instagram_access_token'><?php _e('Your instagram access token', 'accesspress-instagram-feed'); ?></label>
92
- <div class="apsc-option-field">
93
- <!--<input type="text" name="instagram[access_token]" id='instagram_access_token' value="<?php echo esc_attr($access_token); ?>"/>-->
94
- <input type="text" name="instagram[access_token]" id='instagram_access_token' value="<?php
95
- if (isset($_GET["access_token"])) {
96
- echo esc_attr($_GET["access_token"]);
97
- } else {
98
- echo esc_attr($access_token);
99
- }
100
- ?>"/>
101
- <div class="apsc-option-note">
102
- <?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'); ?>
103
- <?php _e("Please don't forget to click save button.", 'accesspress-instagram-feed'); ?>
104
- </div>
105
- </div>
106
- </div>
107
-
108
-
109
- <div class="apsc-option-inner-wrapper">
110
- <label for='enablecache'><?php _e('Enable Cache?', 'accesspress-instagram-feed'); ?></label>
111
- <div class="apsc-option-field">
112
- <input type="checkbox" name="instagram[enable_cache]" id="enablecache" value="1" <?php
113
- if (isset($apif_settings['enable_cache'])) {
114
- checked($apif_settings['enable_cache'], '1');
115
- }
116
- ?> />
117
- <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>
118
- </div>
119
- </div>
120
-
121
- <div class="apsc-option-inner-wrapper">
122
- <label for='enablecache'><?php _e('Cache Period', 'accesspress-instagram-feed'); ?></label>
123
- <div class="apsc-option-field">
124
- <input type="number" step="0.01" min='0' max='24' name="instagram[cache_period]" value="<?php
125
- if (isset($apif_settings['cache_period']) && $apif_settings['cache_period'] != '') {
126
- echo esc_attr($apif_settings['cache_period']);
127
- }
128
- ?>" />
129
- <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>
130
- </div>
131
- </div>
132
-
133
- </div>
134
- </div>
135
- <!--Instagram-->
136
- <?php include (APIF_INST_PATH . '/inc/backend/submit-button.php'); ?>
137
- </div>
138
- </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 = esc_attr($apif_settings['app_id']);
10
+ } else {
11
+ $app_id = '1195004343537123774';
12
+ }
13
+ if (isset($apif_settings['app_secret']) && $apif_settings['app_secret'] != '') {
14
+ $app_secret = esc_attr($apif_settings['app_secret']);
15
+ } else {
16
+ $app_secret = '5ea56ffgtyhjhje4560f2db96f';
17
+ }
18
+ if (isset($apif_settings['username']) && $apif_settings['username'] != '') {
19
+ $username = esc_attr($apif_settings['username']);
20
+ } else {
21
+ $username = '';
22
+ }
23
+ if (isset($apif_settings['user_id']) && $apif_settings['user_id'] != '') {
24
+ $user_id = esc_attr($apif_settings['user_id']);
25
+ } else {
26
+ $user_id = '';
27
+ }
28
+ if (isset($apif_settings['access_token']) && $apif_settings['access_token'] != '') {
29
+ $access_token = esc_attr($apif_settings['access_token']);
30
+ } else {
31
+ $access_token = '';
32
+ }
33
+ ?>
34
+ <!--Instagram-->
35
+ <div class="apsc-option-outer-wrapper">
36
+ <h4><?php _e('Plugin Settings', 'accesspress-instagram-feed') ?></h4>
37
+ <div class="updated settings-error notice is-dismissible">
38
+ <p><b><?php _e("Note: In this plugin, we have used instagram basic display api.On using basic display api, you can fetch your medias 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, other public profile user's medias 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>
39
+ </div>
40
+ <br/>
41
+ <div class="apsc-option-extra">
42
+ <div id="login_with_instagram">
43
+ <a target="_self" href="https://demo.accesspressthemes.com/wordpress-plugins/insta-feed/basic-api/index.php?back_url=<?php echo admin_url('admin.php?page=if-instagram-feed'); ?>">Login with Instagram</a>
44
+ </div>
45
+ <div class="apsc-option-inner-wrapper">
46
+ <label for='instagram_username'><?php _e('Your instagram username', 'accesspress-instagram-feed'); ?></label>
47
+ <div class="apsc-option-field">
48
+ <input type="text" name="instagram[username]" id='instagram_username' value="<?php
49
+ if (isset($_GET["username"])) {
50
+ echo esc_attr($_GET["username"]);
51
+ } else {
52
+ echo esc_attr($username);
53
+ }
54
+ ?>"/>
55
+ <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>
56
+ </div>
57
+ </div>
58
+ <div class="apsc-option-inner-wrapper">
59
+ <label for='instagram_user_id'><?php _e('Your instagram user ID', 'accesspress-instagram-feed'); ?></label>
60
+ <div class="apsc-option-field">
61
+ <input type="text" name="instagram[user_id]" id='instagram_user_id' value="<?php
62
+ if (isset($_GET["userid"])) {
63
+ echo esc_attr($_GET["userid"]);
64
+ } else {
65
+ echo esc_attr($user_id);
66
+ }
67
+ ?>"/><?php //var_dump($user_id); ?>
68
+ <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>
69
+ </div>
70
+ </div>
71
+ <div class="apsc-option-inner-wrapper">
72
+ <label for='instagram_access_token'><?php _e('Your instagram access token', 'accesspress-instagram-feed'); ?></label>
73
+ <div class="apsc-option-field">
74
+ <!--<input type="text" name="instagram[access_token]" id='instagram_access_token' value="<?php echo esc_attr($access_token); ?>"/>-->
75
+ <input type="text" name="instagram[access_token]" id='instagram_access_token' value="<?php
76
+ if (isset($_GET["access_token"])) {
77
+ echo esc_attr($_GET["access_token"]);
78
+ } else {
79
+ echo esc_attr($access_token);
80
+ }
81
+ ?>"/>
82
+ <div class="apsc-option-note">
83
+ <?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'); ?>
84
+ <?php _e("Please don't forget to click save button.", 'accesspress-instagram-feed'); ?>
85
+ </div>
86
+ </div>
87
+ </div>
88
+
89
+
90
+ <div class="apsc-option-inner-wrapper">
91
+ <label for='enablecache'><?php _e('Enable Cache?', 'accesspress-instagram-feed'); ?></label>
92
+ <div class="apsc-option-field">
93
+ <input type="checkbox" name="instagram[enable_cache]" id="enablecache" value="1" <?php
94
+ if (isset($apif_settings['enable_cache'])) {
95
+ checked($apif_settings['enable_cache'], '1');
96
+ }
97
+ ?> />
98
+ <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>
99
+ </div>
100
+ </div>
101
+
102
+ <div class="apsc-option-inner-wrapper">
103
+ <label for='enablecache'><?php _e('Cache Period', 'accesspress-instagram-feed'); ?></label>
104
+ <div class="apsc-option-field">
105
+ <input type="number" step="0.01" min='0' max='24' name="instagram[cache_period]" value="<?php
106
+ if (isset($apif_settings['cache_period']) && $apif_settings['cache_period'] != '') {
107
+ echo esc_attr($apif_settings['cache_period']);
108
+ }
109
+ ?>" />
110
+ <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>
111
+ </div>
112
+ </div>
113
+
114
+ </div>
115
+ </div>
116
+ <!--Instagram-->
117
+ <?php include (APIF_INST_PATH . '/inc/backend/submit-button.php'); ?>
118
+ </div>
119
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/frontend/instagram-feed.php CHANGED
@@ -1,242 +1,256 @@
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
- $followmefontsize = !empty($apif_settings['followmefontsize']) ? esc_attr($apif_settings['followmefontsize']) : '';
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 esc_url($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 esc_attr($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 esc_url($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 esc_attr($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
- </div>
140
- </div>
141
- <?php
142
- $i++;
143
- endforeach;
144
- }
145
- ?>
146
- </div>
147
- </section>
148
- <?php
149
- } else if ($layout == 'slider') {
150
- ?>
151
- <?php
152
- $j = 0;
153
- if (isset($ins_media['meta']['error_message'])) {
154
- ?>
155
- <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
156
- <?php } if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
157
- ?>
158
- <div id="owl-demo" class="apif-owl-carousel owl-carousel">
159
- <?php
160
- foreach ($ins_media['data'] as $vm):
161
- if ($count == $j) {
162
- break;
163
- }
164
- $j++;
165
- $imgslider = $vm['media_url'];
166
- $img_alt = $vm['caption'];
167
- //echo $img_alt;
168
- //die($img_alt);
169
- ?>
170
- <div class="item">
171
- <?php
172
- if ($vm['media_type'] == "VIDEO") {
173
- $video_link = $vm['media_url'];
174
- ?>
175
- <div id="inline-1" style="width:100%;height:100%">
176
- <video controls style="width:100%;height:100%">
177
- <source src="<?php echo esc_url($video_link); ?>" type="video/mp4">
178
- Your browser does not support the video tag.
179
- </video>
180
- </div>
181
- <?php } else { ?>
182
- <img src="<?php echo esc_url($imgslider); ?>" alt='<?php echo esc_attr($img_alt); ?>'/>
183
- <?php } ?>
184
- </div>
185
- <?php
186
- endforeach;
187
- ?>
188
- </div>
189
- <?php } ?>
190
-
191
- <?php } else if ($layout == 'grid_rotator') { ?>
192
- <?php
193
- if (isset($ins_media['meta']['error_message'])) {
194
- ?>
195
- <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
196
- <?php } else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
197
- ?>
198
- <div class="ri-grid apif-ri-grid">
199
- <img class="ri-loading-image" src="<?php echo esc_attr(APIF_IMAGE_DIR) . '/ripple.gif'; ?>"/>
200
- <ul>
201
- <?php
202
- foreach ($ins_media['data'] as $vm):
203
- $img_alt = $vm['caption'];
204
- $img = $vm['media_url'];
205
- $image_url = APIF_IMAGE_DIR . '/image-square.png';
206
- $image = $vm['media_url'];
207
- $link = $vm['permalink'];
208
- $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
209
- ?>
210
- <li style="position:relative">
211
- <?php
212
- if ($vm['media_type'] == "VIDEO") {
213
- $video_link = $vm['media_url'];
214
- ?>
215
- <!--<a href="<?php //echo $link ?>" target="_blank">-->
216
- <!--<div id="inline-1" style="width:100%;height:100%;position:relative">-->
217
- <!--<a href="<?php //echo $link ?>" target="_blank">-->
218
- <video controls style="width:inherit !important;height:100%;position:relative;right:0;display:block">
219
- <source src="<?php echo esc_url($video_link); ?>" type="video/mp4">
220
- Your browser does not support the video tag.
221
- </video>
222
- <!--</a>-->
223
- <!--</div>/-->
224
- <!--</a>-->
225
- <?php } else { ?>
226
- <a href="<?php echo esc_url($link); ?>" target="_blank">
227
- <img src="<?php echo esc_url($image); ?>" alt='<?php echo strip_tags(substr($vm['caption'], 0, 20)); ?>'>
228
- </a>
229
- <?php } ?>
230
- </li>
231
- <?php endforeach; ?>
232
- </ul>
233
- </div>
234
- <?php } ?>
235
- <?php
236
- }?>
237
- <style>
238
- span.follow{
239
- font-size:<?php if (isset($followmefontsize) && $followmefontsize != "") {
240
- echo $followmefontsize ;
241
- }?>px;
242
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ $followmefontsize = !empty($apif_settings['followmefontsize']) ? esc_attr($apif_settings['followmefontsize']) : '';
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
+ if (isset($vm['caption'])) {
63
+ $img_alt = $vm['caption'];
64
+ } else {
65
+ $img_alt = '';
66
+ }
67
+ $img = $vm['media_url'];
68
+ ?>
69
+ <?php
70
+ if ($i <= 2 || $i == 6 || $i == 7) {
71
+ $masonary_class = 'grid-small';
72
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
73
+ $image = $vm['media_url'];
74
+ } elseif ($i == 4 || $i == 5) {
75
+ $masonary_class = 'grid-medium';
76
+ $image_url = APIF_IMAGE_DIR . '/image-rect.png';
77
+ $image = $vm['media_url'];
78
+ } elseif ($i == 3) {
79
+ $masonary_class = 'grid-large';
80
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
81
+ $image = $vm['media_url'];
82
+ }
83
+ $link = $vm['permalink'];
84
+ $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
85
+ ?>
86
+ <div class="masonry_elem columns isotope-item element-itemif <?php echo esc_attr($masonary_class); ?>">
87
+ <div class="thumb-elem large-mosaic-elem small-mosaic-elem hovermove large-mosaic-elem">
88
+ <header class="thumb-elem-header">
89
+ <?php
90
+ if ($layout == 'mosaic_lightview') {
91
+ ?>
92
+ <div class="featimg">
93
+ <?php
94
+ if ($vm['media_type'] == "VIDEO") {
95
+ $video_link = $vm['media_url'];
96
+ ?>
97
+ <a class="example-image-link" href="<?php echo esc_url($video_link); ?>" data-lightbox="example-set">
98
+ <div id="inline-1" style="width:100%;height:100%">
99
+ <video controls style="width:100%;height:100%">
100
+ <source src="<?php echo esc_url($video_link); ?>" type="video/mp4">
101
+ Your browser does not support the video tag.
102
+ </video>
103
+ </div>
104
+ </a>
105
+ <?php } else { ?>
106
+ <a class="example-image-link" href="<?php echo esc_url($img); ?>" data-lightbox="example-set">
107
+ <img class="the-thumb" src="<?php echo esc_url($image); ?>" alt='<?php echo esc_attr($img_alt); ?>'>
108
+ <img class="transparent-image" src="<?php echo esc_url($image_url); ?>" alt='Transparent Image'>
109
+ </a>
110
+ <?php } ?>
111
+ </div>
112
+ <a href="https://instagram.com/<?php echo esc_attr($username); ?>" target="_blank" class="image-hover">
113
+ <span class="follow"><?php echo esc_attr($followmetext); ?></span>
114
+ <span class="follow_icon">
115
+ <img src="<?php echo $flow_icon; ?>"/>
116
+ </span>
117
+ </a>
118
+ <?php } if ($layout == 'mosaic') { ?>
119
+ <div class="featimg">
120
+ <?php
121
+ if ($vm['media_type'] == "VIDEO") {
122
+ $video_link = $vm['media_url'];
123
+ ?>
124
+ <!--<div id="inline-1" style="width:100%;height:100%">-->
125
+ <video class="the-thumb" controls style="width:100%;height:100%">
126
+ <source class="the-thumb" src="<?php echo esc_url($video_link); ?>" type="video/mp4">
127
+ Your browser does not support the video tag.
128
+ </video>
129
+ <!--</div>-->
130
+ <?php } else { ?>
131
+ <img class="the-thumb" src="<?php echo esc_url($image); ?>">
132
+ <img class="transparent-image" src="<?php echo esc_url($image_url); ?>">
133
+ <?php } ?>
134
+ </div>
135
+ <a href="https://instagram.com/<?php echo esc_attr($username); ?>" target="_blank" class="image-hover">
136
+ <span class="follow"><?php echo esc_attr($followmetext); ?></span>
137
+ <span class="follow_icon">
138
+ <img src="<?php echo $flow_icon; ?>"/>
139
+ </span>
140
+ </a>
141
+ <?php } ?>
142
+ </header>
143
+ </div>
144
+ </div>
145
+ <?php
146
+ $i++;
147
+ endforeach;
148
+ }
149
+ ?>
150
+ </div>
151
+ </section>
152
+ <?php
153
+ } else if ($layout == 'slider') {
154
+ ?>
155
+ <?php
156
+ $j = 0;
157
+ if (isset($ins_media['meta']['error_message'])) {
158
+ ?>
159
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
160
+ <?php } if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
161
+ ?>
162
+ <div id="owl-demo" class="apif-owl-carousel owl-carousel">
163
+ <?php
164
+ foreach ($ins_media['data'] as $vm):
165
+ if ($count == $j) {
166
+ break;
167
+ }
168
+ $j++;
169
+ $imgslider = $vm['media_url'];
170
+ if (isset($vm['caption'])) {
171
+ $img_alt = $vm['caption'];
172
+ } else {
173
+ $img_alt = '';
174
+ }
175
+ //echo $img_alt;
176
+ //die($img_alt);
177
+ ?>
178
+ <div class="item">
179
+ <?php
180
+ if ($vm['media_type'] == "VIDEO") {
181
+ $video_link = $vm['media_url'];
182
+ ?>
183
+ <div id="inline-1" style="width:100%;height:100%">
184
+ <video controls style="width:100%;height:100%">
185
+ <source src="<?php echo esc_url($video_link); ?>" type="video/mp4">
186
+ Your browser does not support the video tag.
187
+ </video>
188
+ </div>
189
+ <?php } else { ?>
190
+ <img src="<?php echo esc_url($imgslider); ?>" alt='<?php echo esc_attr($img_alt); ?>'/>
191
+ <?php } ?>
192
+ </div>
193
+ <?php
194
+ endforeach;
195
+ ?>
196
+ </div>
197
+ <?php } ?>
198
+
199
+ <?php } else if ($layout == 'grid_rotator') { ?>
200
+ <?php
201
+ if (isset($ins_media['meta']['error_message'])) {
202
+ ?>
203
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
204
+ <?php } else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
205
+ ?>
206
+ <div class="ri-grid apif-ri-grid">
207
+ <img class="ri-loading-image" src="<?php echo esc_attr(APIF_IMAGE_DIR) . '/ripple.gif'; ?>"/>
208
+ <ul>
209
+ <?php
210
+ foreach ($ins_media['data'] as $vm):
211
+ if (isset($vm['caption'])) {
212
+ $img_alt = $vm['caption'];
213
+ } else {
214
+ $img_alt = '';
215
+ }
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 esc_url($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 esc_url($link); ?>" target="_blank">
239
+ <img src="<?php echo esc_url($image); ?>" alt='<?php echo strip_tags(substr($img_alt, 0, 20)); ?>'>
240
+ </a>
241
+ <?php } ?>
242
+ </li>
243
+ <?php endforeach; ?>
244
+ </ul>
245
+ </div>
246
+ <?php } ?>
247
+ <?php }
248
+ ?>
249
+ <style>
250
+ span.follow{
251
+ font-size:<?php
252
+ if (isset($followmefontsize) && $followmefontsize != "") {
253
+ echo $followmefontsize;
254
+ }
255
+ ?>px;
256
+ </style>
inc/frontend/instagram-grid-rotator.php CHANGED
@@ -64,28 +64,32 @@ $ins_media = $response;
64
  if (isset($ins_media['meta']['error_message'])) {
65
  ?>
66
  <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
67
- <?php } else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
68
  ?>
69
  <div class="ri-grid ri-grid-<?php echo $rand_no; ?> apif-ri-grid">
70
  <img class="ri-loading-image" src="<?php echo esc_attr(APIF_IMAGE_DIR) . '/ripple.gif'; ?>"/>
71
  <ul>
72
- <?php
73
- foreach ($ins_media['data'] as $vm):
74
- $img = $vm['media_url'];
75
- $image_url = APIF_IMAGE_DIR . '/image-square.png';
76
- $image = esc_url($vm['media_url']);
77
-
78
- $link = esc_url($vm['permalink']);
79
- $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
80
- ?>
 
 
 
 
81
  <li>
82
- <?php
83
- if ($vm['media_type'] == "VIDEO") {
84
- $video_link = esc_url($vm['media_url']);
85
- ?>
86
- <!--<a href="<?php //echo $link ?>" target="_blank">-->
87
  <!--<div id="inline-1" style="width:100%;height:100%;position:relative">-->
88
- <!--<a href="<?php //echo $link ?>" target="_blank">-->
89
  <video controls style="width:inherit !important;height:100%;position:relative;right:0;display:block">
90
  <source src="<?php echo $video_link; ?>" type="video/mp4">
91
  Your browser does not support the video tag.
@@ -94,8 +98,9 @@ if (isset($ins_media['meta']['error_message'])) {
94
  <!--</div>-->
95
  <!--</a>-->
96
  <?php } else { ?>
97
- <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>
98
- <?php }
 
99
  endforeach;
100
  ?>
101
  </ul>
64
  if (isset($ins_media['meta']['error_message'])) {
65
  ?>
66
  <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
67
+ <?php } else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
68
  ?>
69
  <div class="ri-grid ri-grid-<?php echo $rand_no; ?> apif-ri-grid">
70
  <img class="ri-loading-image" src="<?php echo esc_attr(APIF_IMAGE_DIR) . '/ripple.gif'; ?>"/>
71
  <ul>
72
+ <?php
73
+ foreach ($ins_media['data'] as $vm):
74
+ $img = $vm['media_url'];
75
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
76
+ $image = esc_url($vm['media_url']);
77
+ if (isset($vm['caption'])) {
78
+ $img_alt = $vm['caption'];
79
+ } else {
80
+ $img_alt = '';
81
+ }
82
+ $link = esc_url($vm['permalink']);
83
+ $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
84
+ ?>
85
  <li>
86
+ <?php
87
+ if ($vm['media_type'] == "VIDEO") {
88
+ $video_link = esc_url($vm['media_url']);
89
+ ?>
90
+ <!--<a href="<?php //echo $link ?>" target="_blank">-->
91
  <!--<div id="inline-1" style="width:100%;height:100%;position:relative">-->
92
+ <!--<a href="<?php //echo $link ?>" target="_blank">-->
93
  <video controls style="width:inherit !important;height:100%;position:relative;right:0;display:block">
94
  <source src="<?php echo $video_link; ?>" type="video/mp4">
95
  Your browser does not support the video tag.
98
  <!--</div>-->
99
  <!--</a>-->
100
  <?php } else { ?>
101
+ <a href="<?php echo $link ?>" target="_blank"><img src="<?php echo esc_url($image); ?>" alt='<?php echo strip_tags(substr($img_alt, 0, 20)); ?>'></a></li>
102
+ <?php
103
+ }
104
  endforeach;
105
  ?>
106
  </ul>
inc/frontend/instagram-masaic-light.php CHANGED
@@ -46,7 +46,11 @@ if (isset($ins_media_masaic['meta']['error_message'])) {
46
  }
47
  $j++;
48
  $img = $vm['media_url'];
49
- $img_alt = $vm['caption'];
 
 
 
 
50
  ?>
51
  <?php
52
  if ($i <= 2 || $i == 6 || $i == 7) {
46
  }
47
  $j++;
48
  $img = $vm['media_url'];
49
+ if (isset($vm['caption'])) {
50
+ $img_alt = $vm['caption'];
51
+ } else {
52
+ $img_alt = '';
53
+ }
54
  ?>
55
  <?php
56
  if ($i <= 2 || $i == 6 || $i == 7) {
inc/frontend/instagram-slider.php CHANGED
@@ -1,66 +1,70 @@
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
- $user_id = !empty($apif_settings['user_id']) ? $apif_settings['user_id'] : '';
9
- $count = 10; // number of images to show
10
- require_once('instagram.php');
11
- if ($username == '' && $access_token == '') {
12
- $response = array('meta' => array('error_message' => 'Username and access token field is empty. Please configure.'));
13
- } else if ($username == '') {
14
- $response = array('meta' => array('error_message' => 'Username field is empty.'));
15
- } else if ($access_token == '') {
16
- $response = array('meta' => array('error_message' => 'Access token field is empty.'));
17
- } else {
18
- $response = $insta->userMedia();
19
- }
20
-
21
- if ($response == NULL) {
22
- $response = array('meta' => array('error_message' => 'Username field is empty.'));
23
- }
24
-
25
- $ins_media_slider = $response;
26
- ?>
27
- <?php
28
- $j = 0;
29
- if (isset($ins_media_slider['meta']['error_message'])) {
30
- ?>
31
- <h1 class="widget-title-insta"><span><?php echo $ins_media_slider['meta']['error_message']; ?></span></h1>
32
- <?php } else if (is_array($ins_media_slider['data']) || is_object($ins_media_slider['data'])) {
33
- ?>
34
- <div id="owl-demo" class="apif-owl-carousel owl-carousel">
35
- <?php
36
- foreach ($ins_media_slider['data'] as $vm):
37
- if ($count == $j) {
38
- break;
39
- }
40
- $j++;
41
- $imgslider = $vm['media_url'];
42
- $img_alt = $vm['caption'];
43
- ?>
44
- <div class="item">
45
- <?php
46
- if ($vm['media_type'] == "VIDEO") {
47
- $video_link = esc_url($vm['media_url']);
48
- ?>
49
- <div id="inline-1" style="width:100%;height:100%">
50
- <video controls style="width:100%;height:100%">
51
- <source src="<?php echo $video_link; ?>" type="video/mp4">
52
- Your browser does not support the video tag.
53
- </video>
54
- </div>
55
- <?php } else { ?>
56
- <img src="<?php echo esc_url($imgslider); ?>" alt='<?php echo esc_attr($img_alt); ?>'/>
57
- <?php } ?>
58
- </div>
59
-
60
- <?php
61
- endforeach;
62
- ?>
63
- </div>
64
- <?php
65
- }
66
- ?>
 
 
 
 
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
+ $user_id = !empty($apif_settings['user_id']) ? $apif_settings['user_id'] : '';
9
+ $count = 10; // number of images to show
10
+ require_once('instagram.php');
11
+ if ($username == '' && $access_token == '') {
12
+ $response = array('meta' => array('error_message' => 'Username and access token field is empty. Please configure.'));
13
+ } else if ($username == '') {
14
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
15
+ } else if ($access_token == '') {
16
+ $response = array('meta' => array('error_message' => 'Access token field is empty.'));
17
+ } else {
18
+ $response = $insta->userMedia();
19
+ }
20
+
21
+ if ($response == NULL) {
22
+ $response = array('meta' => array('error_message' => 'Username field is empty.'));
23
+ }
24
+
25
+ $ins_media_slider = $response;
26
+ ?>
27
+ <?php
28
+ $j = 0;
29
+ if (isset($ins_media_slider['meta']['error_message'])) {
30
+ ?>
31
+ <h1 class="widget-title-insta"><span><?php echo $ins_media_slider['meta']['error_message']; ?></span></h1>
32
+ <?php } else if (is_array($ins_media_slider['data']) || is_object($ins_media_slider['data'])) {
33
+ ?>
34
+ <div id="owl-demo" class="apif-owl-carousel owl-carousel">
35
+ <?php
36
+ foreach ($ins_media_slider['data'] as $vm):
37
+ if ($count == $j) {
38
+ break;
39
+ }
40
+ $j++;
41
+ $imgslider = $vm['media_url'];
42
+ if (isset($vm['caption'])) {
43
+ $img_alt = $vm['caption'];
44
+ } else {
45
+ $img_alt = '';
46
+ }
47
+ ?>
48
+ <div class="item">
49
+ <?php
50
+ if ($vm['media_type'] == "VIDEO") {
51
+ $video_link = esc_url($vm['media_url']);
52
+ ?>
53
+ <div id="inline-1" style="width:100%;height:100%">
54
+ <video controls style="width:100%;height:100%">
55
+ <source src="<?php echo $video_link; ?>" type="video/mp4">
56
+ Your browser does not support the video tag.
57
+ </video>
58
+ </div>
59
+ <?php } else { ?>
60
+ <img src="<?php echo esc_url($imgslider); ?>" alt='<?php echo esc_attr($img_alt); ?>'/>
61
+ <?php } ?>
62
+ </div>
63
+
64
+ <?php
65
+ endforeach;
66
+ ?>
67
+ </div>
68
+ <?php
69
+ }
70
+ ?>
inc/frontend/instagram-widget.php CHANGED
@@ -43,7 +43,11 @@ require_once('instagram.php');
43
  }
44
  $j++;
45
  $img = $vm['media_url'];
46
- $img_alt = $vm['caption'];
 
 
 
 
47
  ?>
48
  <?php
49
  if ($i <= 2 || $i == 6 || $i == 7) {
43
  }
44
  $j++;
45
  $img = $vm['media_url'];
46
+ if (isset($vm['caption'])) {
47
+ $img_alt = $vm['caption'];
48
+ } else {
49
+ $img_alt = '';
50
+ }
51
  ?>
52
  <?php
53
  if ($i <= 2 || $i == 6 || $i == 7) {
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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.5.1
7
- Stable tag: 4.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -130,6 +130,10 @@ Once you install the plugin , you can check some general documentation about how
130
  4. Backend Display Settings Section
131
 
132
  == Changelog ==
 
 
 
 
133
  = 4.0.2 =
134
  * Refined code to fix feed not showing for slider,grid on using shortcode
135
  * Added settings to change font size as set in backend for follow me text
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.7
7
+ Stable tag: 4.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
130
  4. Backend Display Settings Section
131
 
132
  == Changelog ==
133
+ = 4.0.3 =
134
+ * No more required to create an app in developer platform
135
+ * Added login button to easily get user profile detail
136
+
137
  = 4.0.2 =
138
  * Refined code to fix feed not showing for slider,grid on using shortcode
139
  * Added settings to change font size as set in backend for follow me text