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

Version Description

Download this release

Release Info

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

Code changes from version 5.0.6 to 5.0.7

assets/css/enjoy-instagram.css CHANGED
@@ -21,4 +21,11 @@
21
 
22
  .ei-media-type-video:hover:before {
23
  opacity: 1;
 
 
 
 
 
 
 
24
  }
21
 
22
  .ei-media-type-video:hover:before {
23
  opacity: 1;
24
+ }
25
+
26
+ #swipebox-title {
27
+ background-color: #000;
28
+ padding: 20px 50px 20px 50px;
29
+ text-align: left;
30
+ line-height: 1.7;
31
  }
enjoyinstagram.php CHANGED
@@ -2,13 +2,13 @@
2
  /*
3
  Plugin Name: Enjoy Plugin for Instagram
4
  Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
5
- Version: 5.0.6
6
  Author: Mediabeta Srl
7
  Text Domain: enjoy-instagram-instagram-responsive-images-gallery-and-carousel
8
  Author URI: http://www.mediabeta.com/team/
9
  */
10
 
11
- ! defined( 'ENJOYINSTAGRAM_VERSION' ) && define( 'ENJOYINSTAGRAM_VERSION', '5.0.6' );
12
  ! defined( 'ENJOYINSTAGRAM_FILE' ) && define( 'ENJOYINSTAGRAM_FILE', __FILE__ );
13
  ! defined( 'ENJOYINSTAGRAM_URL' ) && define( 'ENJOYINSTAGRAM_URL', plugin_dir_url( __FILE__ ) );
14
  ! defined( 'ENJOYINSTAGRAM_DIR' ) && define( 'ENJOYINSTAGRAM_DIR', plugin_dir_path( __FILE__ ) );
2
  /*
3
  Plugin Name: Enjoy Plugin for Instagram
4
  Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
5
+ Version: 5.0.7
6
  Author: Mediabeta Srl
7
  Text Domain: enjoy-instagram-instagram-responsive-images-gallery-and-carousel
8
  Author URI: http://www.mediabeta.com/team/
9
  */
10
 
11
+ ! defined( 'ENJOYINSTAGRAM_VERSION' ) && define( 'ENJOYINSTAGRAM_VERSION', '5.0.7' );
12
  ! defined( 'ENJOYINSTAGRAM_FILE' ) && define( 'ENJOYINSTAGRAM_FILE', __FILE__ );
13
  ! defined( 'ENJOYINSTAGRAM_URL' ) && define( 'ENJOYINSTAGRAM_URL', plugin_dir_url( __FILE__ ) );
14
  ! defined( 'ENJOYINSTAGRAM_DIR' ) && define( 'ENJOYINSTAGRAM_DIR', plugin_dir_path( __FILE__ ) );
includes/class.enjoyinstagram-api-connection.php CHANGED
@@ -113,14 +113,15 @@ class EnjoyInstagram_Api_Connection {
113
 
114
  // for basic display api users
115
  if ( empty( $accounts ) ) {
116
- $accounts[] = 'me';
117
  }
118
 
119
- foreach ( $accounts as $segment ) {
120
 
121
- $profile = $this->get_user_profile( $segment, $access_token, $is_business_profile );
122
  if ( $profile ) {
123
- $profiles[] = $profile;
 
124
  }
125
  }
126
 
@@ -217,27 +218,28 @@ class EnjoyInstagram_Api_Connection {
217
  */
218
  public function get_business_accounts( $access_token ) {
219
 
220
- $data = $this->_get_remote_data( 'me/accounts', array( 'access_token' => $access_token ), true );
 
 
 
 
 
221
  $accounts = array();
222
 
223
- if ( empty( $data ) || empty( $data['data'] ) || ! is_array( $data['data'] ) ) {
224
  return $accounts;
225
  }
226
 
227
  foreach ( $data['data'] as $account ) {
228
- $account_data = $this->_get_remote_data( $account['id'],
229
- array(
230
- 'fields' => 'instagram_business_account',
231
- 'access_token' => $access_token
232
- ),
233
- true
234
- );
235
 
236
- if ( empty( $account_data ) || empty( $account_data['instagram_business_account'] ) || empty( $account_data['instagram_business_account']['id'] ) ) {
237
  continue;
238
  }
239
 
240
- $accounts[] = $account_data['instagram_business_account']['id'];
 
 
 
241
  }
242
 
243
  return $accounts;
113
 
114
  // for basic display api users
115
  if ( empty( $accounts ) ) {
116
+ $accounts[] = [ 'id' => 'me', 'access_token' => $access_token ];
117
  }
118
 
119
+ foreach ( $accounts as $acc ) {
120
 
121
+ $profile = $this->get_user_profile( $acc['id'], $acc['access_token'], $is_business_profile );
122
  if ( $profile ) {
123
+ $profile['access_token'] = $acc['access_token'];
124
+ $profiles[] = $profile;
125
  }
126
  }
127
 
218
  */
219
  public function get_business_accounts( $access_token ) {
220
 
221
+ $data = $this->_get_remote_data( 'me/accounts', array(
222
+ 'access_token' => $access_token,
223
+ 'fields' => 'instagram_business_account,access_token,name',
224
+ 'limit' => 500
225
+ ), true );
226
+
227
  $accounts = array();
228
 
229
+ if ( is_wp_error( $data ) || ! isset( $data['data'] ) ) {
230
  return $accounts;
231
  }
232
 
233
  foreach ( $data['data'] as $account ) {
 
 
 
 
 
 
 
234
 
235
+ if ( empty( $account['instagram_business_account'] ) || empty( $account['instagram_business_account']['id'] ) ) {
236
  continue;
237
  }
238
 
239
+ $accounts[] = [
240
+ 'id' => $account['instagram_business_account']['id'],
241
+ 'access_token' => $account['access_token']
242
+ ];
243
  }
244
 
245
  return $accounts;
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.google.com/url?q=https%3A%2F%2Fwww.paypal.com%2Fcgi-bin
4
  Tags: social feed, instagram carousel, social media feed, instagram widget, instagram feed
5
  Requires at least: 4.0
6
  Tested up to: 5.4
7
- Version: 5.0.6
8
- Stable tag: 5.0.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -16,7 +16,7 @@ Formerly “Enjoy Instagram Feed”. Embed social feed on your WordPress website
16
  = Embed Instagram feed on website by hashtag and public Instagram account. Add Social feed with Carousel and Grid view using simple shortcodes and widget. =
17
 
18
  == Important ==
19
- After June 29, 2020 Instagram will change its API.
20
  Our plugin has already moved to the new stable Instagram API: Basic Display API for Personal account and Graph API for Business one.
21
  DOWNLOAD AND INSTALL OUR LATEST VERSION.
22
 
4
  Tags: social feed, instagram carousel, social media feed, instagram widget, instagram feed
5
  Requires at least: 4.0
6
  Tested up to: 5.4
7
+ Version: 5.0.7
8
+ Stable tag: 5.0.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
16
  = Embed Instagram feed on website by hashtag and public Instagram account. Add Social feed with Carousel and Grid view using simple shortcodes and widget. =
17
 
18
  == Important ==
19
+ Since June 29, 2020 Instagram changed its API.
20
  Our plugin has already moved to the new stable Instagram API: Basic Display API for Personal account and Graph API for Business one.
21
  DOWNLOAD AND INSTALL OUR LATEST VERSION.
22
 
templates/shortcodes/carousel.php CHANGED
@@ -67,4 +67,11 @@ if ( ! defined( 'ABSPATH' ) ) {
67
  </a>
68
  </div>
69
  <?php endforeach; ?>
70
- </div>
 
 
 
 
 
 
 
67
  </a>
68
  </div>
69
  <?php endforeach; ?>
70
+ </div>
71
+ <script type="text/javascript">
72
+ ;( function( $ ) {
73
+
74
+ $( '.swipebox' ).swipebox();
75
+
76
+ } )( jQuery );
77
+ </script>