AccessPress Instagram Feed - Version 1.0.5

Version Description

  • Fixed the css bug.
Download this release

Release Info

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

Code changes from version 1.0.4 to 1.0.5

accesspress-instagram-feed.php CHANGED
@@ -11,160 +11,184 @@ Text Domain:if-feed
11
  Domain Path: /languages/
12
  License: GPLv2 or later
13
  */
14
-
15
  //Decleration of the necessary constants for plugin
16
- if(!defined ( 'APIF_VERSION' ) ){
17
- define ( 'APIF_VERSION', '1.0.5' );
18
  }
19
 
20
- if( !defined( 'APIF_IMAGE_DIR' ) ){
21
- define( 'APIF_IMAGE_DIR', plugin_dir_url( __FILE__ ) .'images' );
22
  }
23
 
24
- if( !defined( 'APIF_JS_DIR' ) ){
25
- define ( 'APIF_JS_DIR', plugin_dir_url( __FILE__ ) . 'js' );
26
  }
27
 
28
- if( !defined( 'APIF_CSS_DIR' ) ){
29
- define ( 'APIF_CSS_DIR', plugin_dir_url( __FILE__ ) . 'css' );
30
  }
31
 
32
- if( !defined( 'APIF_INST_PATH' ) ){
33
- define ( 'APIF_INST_PATH', plugin_dir_path( __FILE__ ) );
34
  }
35
 
36
- if( !defined( 'APIF_LANG_DIR' ) ){
37
- define ( 'APIF_LANG_DIR', basename( dirname( __FILE__ ) ). '/languages/' );
38
  }
39
 
40
- if(!defined('APIF_TEXT_DOMAIN')){
41
- define( 'APIF_TEXT_DOMAIN', 'if-instagram-feed' );
42
  }
43
-
44
  //Include admin
45
 
 
46
  /**
47
  * Register of widgets
48
- **/
49
- include_once('inc/backend/widget.php');
50
- include_once('inc/backend/widgetside.php');
51
-
52
- if (!class_exists('IF_Class')) {
53
-
54
- class IF_Class {
55
-
56
- var $apif_settings;
57
-
58
- /**
59
- * Initializes the plugin functions
60
- */
61
- function __construct() {
62
- $this->apif_settings = get_option('apif_settings');
63
- register_activation_hook(__FILE__, array($this, 'load_default_settings')); //loads default settings for the plugin while activating the plugin
64
- add_action('init', array($this, 'plugin_text_domain')); //loads text domain for translation ready
65
- add_action('init', array($this, 'session_init')); //starts the session
66
- add_action('admin_menu', array($this, 'add_if_menu')); //adds plugin menu in wp-admin
67
- add_action('admin_enqueue_scripts', array($this, 'register_admin_assets')); //registers admin assests such as js and css
68
- add_action('wp_enqueue_scripts', array($this, 'register_frontend_assets')); //registers js and css for frontend
69
- add_action('admin_post_apif_settings_action', array($this, 'apif_settings_action')); //recieves the posted values from settings form
70
- add_action('admin_post_apif_restore_default', array($this, 'apif_restore_default')); //restores default settings;
71
- add_action('init', array($this, 'apif_shortcode')); //adds a shortcode
72
- add_action('widgets_init', array($this, 'register_apif_widget')); //registers the widget
73
- }
74
-
75
- /**
76
- * Plugin Translation
77
- */
78
- function plugin_text_domain() {
79
- load_plugin_textdomain('api-feed', false, basename(dirname(__FILE__)) . '/languages/');
80
- }
81
-
82
- /**
 
 
 
83
  * Load Default Settings
84
- * */
 
85
  function load_default_settings() {
86
- if (!get_option('apif_settings')) {
87
  $apif_settings = $this->get_default_settings();
88
- update_option('apif_settings', $apif_settings);
89
  }
90
- }
91
- /**
92
- * Plugin Admin Menu
93
- */
94
- function add_if_menu() {
95
- add_menu_page(__('AccessPress Instagram Feed', 'if-feed'), __('AccessPress Instagram Feed', 'if-feed'), 'manage_options', 'if-instagram-feed', array($this, 'main_page'), APIF_IMAGE_DIR.'/sc-icon.png');
96
  }
97
- //plugins backend admin page
98
- function main_page() {
99
- include( 'inc/backend/main-page.php' );
100
- }
101
- /**
102
- * Starts the session
103
- */
104
- function session_init() {
105
- if (!session_id()) {
106
- session_start();
107
- }
108
- }
109
  /**
110
- * Adds Shortcode
111
  */
112
- function apif_shortcode() {
113
- include('inc/frontend/shortcode.php');
114
- }
115
-
 
 
 
 
 
 
 
 
 
 
 
116
  /**
117
  * Returns Default Settings
118
  */
119
  function get_default_settings() {
120
- $apif_settings = array(
121
- 'username' => '',
122
- 'access_token' => '',
123
- 'user_id'=>'',
124
- 'instagram_mosaic' => 'mosaic'
125
- );
126
- return $apif_settings;
127
  }
128
-
129
  /**
130
  * Saves settings to database
131
  */
132
  function apif_settings_action() {
133
- if (!empty($_POST) && wp_verify_nonce($_POST['apif_settings_nonce'], 'apif_settings_action')) {
134
 
135
- include('inc/backend/save-settings.php');
136
  }
137
- }
138
- /**
139
  * Registering of backend js and css
140
  */
141
  function register_admin_assets() {
142
- if (isset($_GET['page']) && $_GET['page'] == 'if-instagram-feed') {
143
- wp_enqueue_style('sc-admin-css', APIF_CSS_DIR . '/backend.css', array(), APIF_VERSION);
144
- wp_enqueue_script('sc-admin-js', APIF_JS_DIR . '/backend.js', array('jquery', 'jquery-ui-sortable'), APIF_VERSION);
145
  }
146
  }
147
  /**
148
  * Registers Frontend Assets
149
- * */
 
150
  function register_frontend_assets() {
151
- wp_enqueue_style('lightbox', APIF_CSS_DIR . '/lightbox.css', array(), APIF_VERSION);
152
- wp_enqueue_style('owl-theme', APIF_CSS_DIR . '/owl.theme.css', array(), APIF_VERSION);
153
- wp_enqueue_style('owl-carousel', APIF_CSS_DIR . '/owl.carousel.css', array(), APIF_VERSION);
154
- wp_enqueue_style('apif-frontend-css', APIF_CSS_DIR . '/frontend.css', array(), APIF_VERSION);
155
- wp_enqueue_style('apsc-font-awesome',APIF_CSS_DIR.'/font-awesome.min.css',array(),APIF_VERSION);
156
- wp_enqueue_script('lightbox-js', APIF_JS_DIR. '/lightbox.js', array('jquery'), '2.8.1',true);
157
- wp_enqueue_script('apif-isotope-pkgd-min-js', APIF_JS_DIR. '/isotope.pkgd.min.js', array('jquery'), '2.2.0', true );
158
- wp_enqueue_script('owl-carousel-js', APIF_JS_DIR. '/owl.carousel.js', array('jquery'));
159
- wp_enqueue_script('apif-frontend-js', APIF_JS_DIR. '/frontend.js', array('jquery') ,'1.0'); }
160
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  /**
162
  * AccessPress Instagram Feed Widget
163
  */
164
  function register_apif_widget() {
165
- register_widget('APIF_Widget');
166
- register_widget('APIF_SideWidget');
167
  }
168
  }
169
  $sc_object = new IF_Class(); //initialization of plugin
170
- }
 
11
  Domain Path: /languages/
12
  License: GPLv2 or later
13
  */
 
14
  //Decleration of the necessary constants for plugin
15
+ if( !defined( 'APIF_VERSION' ) ) {
16
+ define( 'APIF_VERSION', '1.0.5' );
17
  }
18
 
19
+ if( !defined( 'APIF_IMAGE_DIR' ) ) {
20
+ define( 'APIF_IMAGE_DIR', plugin_dir_url( __FILE__ ) . 'images' );
21
  }
22
 
23
+ if( !defined( 'APIF_JS_DIR' ) ) {
24
+ define( 'APIF_JS_DIR', plugin_dir_url( __FILE__ ) . 'js' );
25
  }
26
 
27
+ if( !defined( 'APIF_CSS_DIR' ) ) {
28
+ define( 'APIF_CSS_DIR', plugin_dir_url( __FILE__ ) . 'css' );
29
  }
30
 
31
+ if( !defined( 'APIF_INST_PATH' ) ) {
32
+ define( 'APIF_INST_PATH', plugin_dir_path( __FILE__ ) );
33
  }
34
 
35
+ if( !defined( 'APIF_LANG_DIR' ) ) {
36
+ define( 'APIF_LANG_DIR', basename( dirname( __FILE__ ) ) . '/languages/' );
37
  }
38
 
39
+ if( !defined( 'APIF_TEXT_DOMAIN' ) ) {
40
+ define( 'APIF_TEXT_DOMAIN', 'if-instagram-feed' );
41
  }
 
42
  //Include admin
43
 
44
+
45
  /**
46
  * Register of widgets
47
+ *
48
+ */
49
+ include_once( 'inc/backend/widget.php' );
50
+ include_once( 'inc/backend/widgetside.php' );
51
+
52
+ if( !class_exists( 'IF_Class' ) ) {
53
+
54
+ class IF_Class {
55
+
56
+ var $apif_settings;
57
+ /**
58
+ * Initializes the plugin functions
59
+ */
60
+ function __construct() {
61
+ $this->apif_settings = get_option( 'apif_settings' );
62
+ register_activation_hook( __FILE__, array($this, 'load_default_settings') ); //loads default settings for the plugin while activating the plugin
63
+ add_action( 'init', array($this, 'plugin_text_domain') ); //loads text domain for translation ready
64
+ add_action( 'init', array($this, 'session_init') ); //starts the session
65
+ add_action( 'admin_menu', array($this, 'add_if_menu') ); //adds plugin menu in wp-admin
66
+ add_action( 'admin_enqueue_scripts', array($this, 'register_admin_assets') ); //registers admin assests such as js and css
67
+ add_action( 'wp_enqueue_scripts', array($this, 'register_frontend_assets') ); //registers js and css for frontend
68
+ add_action( 'admin_post_apif_settings_action', array($this, 'apif_settings_action') ); //recieves the posted values from settings form
69
+ add_action( 'admin_post_apif_restore_default', array($this, 'apif_restore_default') ); //restores default settings;
70
+ add_shortcode( 'ap_instagram_feed', array($this, 'ap_instagram_feed') );
71
+ add_shortcode( 'ap_instagram_widget', array($this, 'ap_instagram_widget') );
72
+ add_shortcode( 'ap_instagram_slider', array($this, 'ap_instagram_slider') );
73
+ add_shortcode( 'ap_instagram_mosaic_lightview', array($this, 'ap_instagram_mosaic_light') );
74
+
75
+ add_action( 'widgets_init', array($this, 'register_apif_widget') ); //registers the widget
76
+
77
+ }
78
+ /**
79
+ * Plugin Translation
80
+ */
81
+ function plugin_text_domain() {
82
+ load_plugin_textdomain( 'api-feed', false, basename( dirname( __FILE__ ) ) . '/languages/' );
83
+ }
84
+ /**
85
  * Load Default Settings
86
+ *
87
+ */
88
  function load_default_settings() {
89
+ if( !get_option( 'apif_settings' ) ) {
90
  $apif_settings = $this->get_default_settings();
91
+ update_option( 'apif_settings', $apif_settings );
92
  }
 
 
 
 
 
 
93
  }
 
 
 
 
 
 
 
 
 
 
 
 
94
  /**
95
+ * Plugin Admin Menu
96
  */
97
+ function add_if_menu() {
98
+ add_menu_page( __( 'AccessPress Instagram Feed', 'if-feed' ), __( 'AccessPress Instagram Feed', 'if-feed' ), 'manage_options', 'if-instagram-feed', array($this, 'main_page'), APIF_IMAGE_DIR . '/sc-icon.png' );
99
+ }
100
+ //plugins backend admin page
101
+ function main_page() {
102
+ include( 'inc/backend/main-page.php' );
103
+ }
104
+ /**
105
+ * Starts the session
106
+ */
107
+ function session_init() {
108
+ if( !session_id() ) {
109
+ session_start();
110
+ }
111
+ }
112
  /**
113
  * Returns Default Settings
114
  */
115
  function get_default_settings() {
116
+ $apif_settings = array('username' => '', 'access_token' => '', 'user_id' => '', 'instagram_mosaic' => 'mosaic');
117
+ return $apif_settings;
 
 
 
 
 
118
  }
 
119
  /**
120
  * Saves settings to database
121
  */
122
  function apif_settings_action() {
123
+ if( !empty( $_POST ) && wp_verify_nonce( $_POST['apif_settings_nonce'], 'apif_settings_action' ) ) {
124
 
125
+ include( 'inc/backend/save-settings.php' );
126
  }
127
+ }
128
+ /**
129
  * Registering of backend js and css
130
  */
131
  function register_admin_assets() {
132
+ if( isset( $_GET['page'] ) && $_GET['page'] == 'if-instagram-feed' ) {
133
+ wp_enqueue_style( 'sc-admin-css', APIF_CSS_DIR . '/backend.css', array(), APIF_VERSION );
134
+ wp_enqueue_script( 'sc-admin-js', APIF_JS_DIR . '/backend.js', array('jquery', 'jquery-ui-sortable'), APIF_VERSION );
135
  }
136
  }
137
  /**
138
  * Registers Frontend Assets
139
+ *
140
+ */
141
  function register_frontend_assets() {
142
+ wp_enqueue_style( 'lightbox', APIF_CSS_DIR . '/lightbox.css', array(), APIF_VERSION );
143
+ wp_enqueue_style( 'owl-theme', APIF_CSS_DIR . '/owl.theme.css', array(), APIF_VERSION );
144
+ wp_enqueue_style( 'owl-carousel', APIF_CSS_DIR . '/owl.carousel.css', array(), APIF_VERSION );
145
+ wp_enqueue_style( 'apif-frontend-css', APIF_CSS_DIR . '/frontend.css', array(), APIF_VERSION );
146
+ wp_enqueue_style( 'apsc-font-awesome', APIF_CSS_DIR . '/font-awesome.min.css', array(), APIF_VERSION );
147
+ wp_enqueue_script( 'lightbox-js', APIF_JS_DIR . '/lightbox.js', array('jquery'), '2.8.1', true );
148
+ wp_enqueue_script( 'apif-isotope-pkgd-min-js', APIF_JS_DIR . '/isotope.pkgd.min.js', array('jquery'), '2.2.0', true );
149
+ wp_enqueue_script( 'owl-carousel-js', APIF_JS_DIR . '/owl.carousel.js', array('jquery') );
150
+ wp_enqueue_script( 'apif-frontend-js', APIF_JS_DIR . '/frontend.js', array('jquery'), '1.0' );
151
+ }
152
+ //instagram feed shortcode
153
+ function ap_instagram_feed() {
154
+ ob_start();
155
+ include( 'inc/frontend/instagram-feed.php' );
156
+ $html = ob_get_contents();
157
+ ob_get_clean();
158
+ return $html;
159
+ }
160
+ // instagram widget shortcode
161
+ function ap_instagram_widget() {
162
+ ob_start();
163
+ include( 'inc/frontend/instagram-widget.php' );
164
+ $html = ob_get_contents();
165
+ ob_get_clean();
166
+ return $html;
167
+ }
168
+ //mosaic light shortcode
169
+ function ap_instagram_mosaic_light() {
170
+ ob_start();
171
+ include( 'inc/frontend/instagram-masaic-light.php' );
172
+ $html = ob_get_contents();
173
+ ob_get_clean();
174
+ return $html;
175
+ }
176
+ //slider shortcode
177
+ function ap_instagram_slider() {
178
+ ob_start();
179
+ include( 'inc/frontend/instagram-slider.php' );
180
+ $html = ob_get_contents();
181
+ ob_get_clean();
182
+ return $html;
183
+ }
184
  /**
185
  * AccessPress Instagram Feed Widget
186
  */
187
  function register_apif_widget() {
188
+ register_widget( 'APIF_Widget' );
189
+ register_widget( 'APIF_SideWidget' );
190
  }
191
  }
192
  $sc_object = new IF_Class(); //initialization of plugin
193
+
194
+ }
css/frontend.css CHANGED
@@ -312,6 +312,9 @@ span.instagram_like_count {
312
  transition: opacity 0.35s, transform 0.35s;
313
  -webkit-transform: translate3d(-10px,0, 0);
314
  transform: translate3d(-10px,0,0);
 
 
 
315
  }
316
 
317
  .widget_apif_sidewidget li img:hover{
@@ -321,4 +324,16 @@ span.instagram_like_count {
321
  -webkit-transform: translate3d(0,0,0);
322
  transform: translate3d(0,0,0);
323
  opacity: 1
324
- }
 
 
 
 
 
 
 
 
 
 
 
 
312
  transition: opacity 0.35s, transform 0.35s;
313
  -webkit-transform: translate3d(-10px,0, 0);
314
  transform: translate3d(-10px,0,0);
315
+
316
+
317
+
318
  }
319
 
320
  .widget_apif_sidewidget li img:hover{
324
  -webkit-transform: translate3d(0,0,0);
325
  transform: translate3d(0,0,0);
326
  opacity: 1
327
+ }
328
+
329
+ /*.apif-widget-wrapper span.follow {
330
+ font-size: 10px;
331
+ margin-left:-20px;
332
+
333
+ .apif-widget-wrapper .image-hover{
334
+ padding:0;
335
+ }
336
+ .apif-widget-wrapper .fa-heart-o:before {
337
+ content: "\f08a";
338
+ font-size: 16px;
339
+ }*/
inc/backend/widget.php CHANGED
@@ -26,7 +26,9 @@ class APIF_Widget extends WP_Widget {
26
  */
27
  public function widget($args, $instance) {
28
 
29
- echo $args['before_widget'];
 
 
30
  if (!empty($instance['title'])) {
31
  echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
32
  }
@@ -37,17 +39,19 @@ class APIF_Widget extends WP_Widget {
37
  }
38
  else if(isset($instance['layout']) && $instance['layout'] == 'layout-2')
39
  {
40
- echo do_shortcode('[ap_instagram_mosaic_lightview]');
41
  }
42
  else if(isset($instance['layout']) && $instance['layout'] == 'layout-3')
43
  {
44
- echo do_shortcode('[ap_instagram_slider]');
45
  }
46
  else
47
  {
48
  echo do_shortcode('[ap_instagram_feed]');
49
  }
50
-
 
 
51
  echo $args['after_widget'];
52
  }
53
 
@@ -64,17 +68,17 @@ class APIF_Widget extends WP_Widget {
64
  ?>
65
  <p>
66
 
67
- <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'if-feed'); ?></label>
68
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>"/>
69
  </p>
70
  <p>
71
 
72
- <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Layout :', 'if-feed'); ?></label>
73
  <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>" name="<?php echo $this->get_field_name('layout'); ?>" >
74
  <option value="">Default</option>
75
  <?php for($i=1;$i<=3;$i++){
76
 
77
- if($i == '1'){ $name = 'Mosaic'; } else if($i == '2'){ $name = 'Mosaic LightBox'; }
78
  else if($i == '3') { $name = 'Slider'; }
79
  ?>
80
  <option value="layout-<?php echo $i;?>" <?php selected($layout,'layout-'.$i);?>><?php echo $name; ?> Layout</option>
26
  */
27
  public function widget($args, $instance) {
28
 
29
+ echo $args['before_widget']; ?>
30
+ <div class='apif-widget-wrapper'>
31
+ <?php
32
  if (!empty($instance['title'])) {
33
  echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
34
  }
39
  }
40
  else if(isset($instance['layout']) && $instance['layout'] == 'layout-2')
41
  {
42
+ echo do_shortcode('[ap_instagram_mosaic_lightview]');
43
  }
44
  else if(isset($instance['layout']) && $instance['layout'] == 'layout-3')
45
  {
46
+ echo do_shortcode('[ap_instagram_slider]');
47
  }
48
  else
49
  {
50
  echo do_shortcode('[ap_instagram_feed]');
51
  }
52
+ ?>
53
+ </div>
54
+ <?php
55
  echo $args['after_widget'];
56
  }
57
 
68
  ?>
69
  <p>
70
 
71
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'if-feed'); ?></label>
72
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>"/>
73
  </p>
74
  <p>
75
 
76
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Layout :', 'if-feed'); ?></label>
77
  <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>" name="<?php echo $this->get_field_name('layout'); ?>" >
78
  <option value="">Default</option>
79
  <?php for($i=1;$i<=3;$i++){
80
 
81
+ if($i == '1'){ $name = 'Mosaic'; } else if($i == '2'){ $name = 'Mosaic LightBox'; }
82
  else if($i == '3') { $name = 'Slider'; }
83
  ?>
84
  <option value="layout-<?php echo $i;?>" <?php selected($layout,'layout-'.$i);?>><?php echo $name; ?> Layout</option>
inc/backend/widgetside.php CHANGED
@@ -31,7 +31,7 @@ class APIF_SideWidget extends WP_Widget {
31
  echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
32
  }
33
 
34
- $instagram_num_img = isset($instance['instagram_num_img'])?$instance['instagram_num_img']:'12';
35
  $instance_post = (isset($instance['instance_post']) && $instance['instance_post']==1)?'true':'false';
36
  $instance_followers = (isset($instance['instance_followers']) && $instance['instance_followers']==1)?'true':'false';
37
  $instance_following = (isset($instance['instance_following']) && $instance['instance_following']==1)?'true':'false';
@@ -39,6 +39,7 @@ class APIF_SideWidget extends WP_Widget {
39
 
40
 
41
  global $apif_settings, $insta;
 
42
  $username = !empty($apif_settings['username']) ? $apif_settings['username'] : '';
43
  $user_id = !empty($apif_settings['user_id']) ? $apif_settings['user_id'] : '';
44
  $social_profile_url = 'https://instagram.com/' . $username;
@@ -74,7 +75,7 @@ global $apif_settings, $insta;
74
  <div class="follow-inner">
75
  <div class="table-outer">
76
  <div class="table-inner">
77
- <a href="#">follow</a>
78
  <?php //echo $response['data']['link']; ?>
79
  </div>
80
  </div>
@@ -137,10 +138,9 @@ global $apif_settings, $insta;
137
 
138
  <label for="<?php echo $this->get_field_id('instagram_num_img'); ?>"><?php _e('Number of Image:', 'if-feed'); ?></label>
139
  <select class="widefat" id="<?php echo $this->get_field_id('instagram_num_img'); ?>" name="<?php echo $this->get_field_name('instagram_num_img'); ?>" >
140
- <option value="">Default</option>
141
  <?php for($i=1;$i<=21;$i++){
142
  ?>
143
- <option value="<?php echo $i;?>" <?php selected($instagram_num_img,''.$i);?>><?php echo $i; ?></option>
144
  <?php
145
  }?>
146
  </select>
31
  echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
32
  }
33
 
34
+ $instagram_num_img = isset($instance['instagram_num_img']) ? $instance['instagram_num_img']:'12';
35
  $instance_post = (isset($instance['instance_post']) && $instance['instance_post']==1)?'true':'false';
36
  $instance_followers = (isset($instance['instance_followers']) && $instance['instance_followers']==1)?'true':'false';
37
  $instance_following = (isset($instance['instance_following']) && $instance['instance_following']==1)?'true':'false';
39
 
40
 
41
  global $apif_settings, $insta;
42
+ // var_dump($apif_settings);
43
  $username = !empty($apif_settings['username']) ? $apif_settings['username'] : '';
44
  $user_id = !empty($apif_settings['user_id']) ? $apif_settings['user_id'] : '';
45
  $social_profile_url = 'https://instagram.com/' . $username;
75
  <div class="follow-inner">
76
  <div class="table-outer">
77
  <div class="table-inner">
78
+ <a href="https://instagram.com/<?php echo $apif_settings['username']; ?>" target='_blank' title='Follow <?php echo $apif_settings['username']; ?>' >follow</a>
79
  <?php //echo $response['data']['link']; ?>
80
  </div>
81
  </div>
138
 
139
  <label for="<?php echo $this->get_field_id('instagram_num_img'); ?>"><?php _e('Number of Image:', 'if-feed'); ?></label>
140
  <select class="widefat" id="<?php echo $this->get_field_id('instagram_num_img'); ?>" name="<?php echo $this->get_field_name('instagram_num_img'); ?>" >
 
141
  <?php for($i=1;$i<=21;$i++){
142
  ?>
143
+ <option value="<?php echo $i;?>" <?php selected( $instagram_num_img,''.$i ); ?>><?php echo $i; ?></option>
144
  <?php
145
  }?>
146
  </select>
inc/frontend/instagram-feed.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $apif_settings, $insta;
3
+ $apif_settings = $this->apif_settings;
4
+ $username = !empty($apif_settings['username']) ? $apif_settings['username'] : ''; // your username
5
+ $access_token = !empty($apif_settings['access_token']) ? $apif_settings['access_token'] : '';
6
+ $layout = $apif_settings['instagram_mosaic'];
7
+ $image_like = $apif_settings['active'];
8
+ $count = 7; // number of images to show
9
+ require_once('instagram.php');
10
+
11
+ if ($layout == 'mosaic' || $layout == 'mosaic_lightview') {
12
+ ?>
13
+ <section id="main" class="thumb-view">
14
+ <div class="row masonry for-mosaic isotope ifgrid">
15
+ <?php
16
+ $ins_media = $insta->userMedia();
17
+ $i = 1;
18
+ $j = 0;
19
+ if(isset($ins_media['meta']['error_message'])){
20
+ ?>
21
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
22
+ <?php
23
+ }else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
24
+ foreach ($ins_media['data'] as $vm):
25
+ if ($count == $j) {
26
+ break;
27
+ }
28
+ $j++;
29
+ $img = $vm['images']['standard_resolution']['url'];
30
+ ?>
31
+ <?php
32
+ if ($i <= 2 || $i == 6 || $i == 7) {
33
+ $masonary_class = 'grid-small';
34
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
35
+ $image = $vm['images']['low_resolution']['url'];
36
+ } elseif ($i == 4 || $i == 5) {
37
+ $masonary_class = 'grid-medium';
38
+ $image_url = APIF_IMAGE_DIR . '/image-rect.png';
39
+ $image = $vm['images']['standard_resolution']['url'];
40
+ } elseif ($i == 3) {
41
+ $masonary_class = 'grid-large';
42
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
43
+ $image = $vm['images']['standard_resolution']['url'];
44
+ }
45
+ $link = $vm["link"];
46
+ $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
47
+ ?>
48
+ <div class="masonry_elem columns isotope-item element-itemif <?php echo esc_attr($masonary_class); ?>">
49
+ <div class="thumb-elem large-mosaic-elem small-mosaic-elem hovermove large-mosaic-elem">
50
+ <header class="thumb-elem-header">
51
+ <?php
52
+ if ($layout == 'mosaic_lightview') {
53
+ ?>
54
+ <div class="featimg">
55
+ <a class="example-image-link" href="<?php echo esc_url($img); ?>" data-lightbox="example-set">
56
+ <img class="the-thumb" src="<?php echo esc_url($image); ?>">
57
+ <img class="transparent-image" src="<?php echo esc_url($image_url); ?>">
58
+ </a>
59
+ </div>
60
+ <a href="<?php echo $link; ?>" target="_blank" class="image-hover">
61
+ <span class="follow">Follow Me</span>
62
+ <span class="follow_icon">
63
+ <img src="<?php echo $flow_icon; ?>"/>
64
+ </span>
65
+ </a>
66
+ <?php } if ($layout == 'mosaic') { ?>
67
+ <div class="featimg">
68
+ <img class="the-thumb" src="<?php echo esc_url($image); ?>">
69
+ <img class="transparent-image" src="<?php echo esc_url($image_url); ?>">
70
+ </div>
71
+ <a href="<?php echo $link; ?>" target="_blank" class="image-hover">
72
+ <span class="follow">Follow Me</span>
73
+ <span class="follow_icon">
74
+ <img src="<?php echo $flow_icon; ?>"/>
75
+ </span>
76
+ </a>
77
+ <?php } ?>
78
+ </header>
79
+ <?php if ($image_like == '1') : ?>
80
+ <!-- Image like cound section start -->
81
+ <span class="instagram_like_count">
82
+ <p class="instagram_imge_like">
83
+ <span class="insta like_image">
84
+ <i class="fa fa-heart-o fa-2x"></i>
85
+ </span>
86
+ <span class="count"><?php echo $likes = $vm['likes']['count']; ?></span>
87
+ </p>
88
+ </span>
89
+ <!-- Image like cound section end -->
90
+ <?php endif; ?>
91
+ </div>
92
+ </div>
93
+ <?php
94
+ $i++;
95
+ endforeach;
96
+ }
97
+ ?>
98
+ </div>
99
+ </section>
100
+ <?php
101
+ } else if ($layout == 'slider') {
102
+ ?>
103
+ <div id="owl-demo" class="owl-carousel">
104
+ <?php
105
+ $ins_media_slider = $insta->userMedia();
106
+ $j = 0;
107
+ if(isset($ins_media['meta']['error_message'])){
108
+ ?>
109
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
110
+ <?php
111
+ } if (is_array($ins_media_slider['data']) || is_object($ins_media_slider['data'])) {
112
+ foreach ($ins_media_slider['data'] as $vm):
113
+ if ($count == $j) {
114
+ break;
115
+ }
116
+ $j++;
117
+ $imgslider = $vm['images']['standard_resolution']['url'];
118
+ ?>
119
+ <div class="item">
120
+ <img src="<?php echo esc_url($imgslider); ?>" />
121
+ <?php if ($image_like == '1') : ?>
122
+ <!-- Image like cound section start -->
123
+ <span class="instagram_like_count">
124
+ <p class="instagram_imge_like">
125
+ <span class="insta like_image">
126
+ <i class="fa fa-heart-o fa-2x"></i>
127
+ </span>
128
+ <span class="count"><?php echo $likes = $vm['likes']['count']; ?></span>
129
+ </p>
130
+ </span>
131
+ <!-- Image like cound section end -->
132
+ <?php endif; ?>
133
+ </div>
134
+ <?php
135
+ endforeach;
136
+ } ?>
137
+ </div>
138
+
139
+ <?php }
140
+
inc/frontend/instagram-masaic-light.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $apif_settings, $insta;
3
+ $apif_settings = $this->apif_settings;
4
+ $username = $apif_settings['username']; // your username
5
+ $access_token = $apif_settings['access_token'];
6
+ $image_like = $apif_settings['active'];
7
+ $count = 7; // number of images to show
8
+ require_once('instagram.php');
9
+ ?>
10
+ <section id="main" class="thumb-view">
11
+ <div class="row masonry for-mosaic isotope ifgrid">
12
+ <?php
13
+ $ins_media_masaic = $insta->userMedia();
14
+ $i = 1;
15
+ $j = 0;
16
+ if(isset($ins_media['meta']['error_message'])){
17
+ ?>
18
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
19
+ <?php
20
+ }else if (is_array($ins_media_masaic['data']) || is_object($ins_media_masaic['data'])) {
21
+ foreach ($ins_media_masaic['data'] as $vm):
22
+ if ($count == $j) {
23
+ break;
24
+ }
25
+ $j++;
26
+ $img = $vm['images']['standard_resolution']['url'];
27
+ ?>
28
+ <?php
29
+ if ($i <= 2 || $i == 6 || $i == 7) {
30
+ $masonary_class = 'grid-small';
31
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
32
+ $image = $vm['images']['low_resolution']['url'];
33
+ } elseif ($i == 4 || $i == 5) {
34
+ $masonary_class = 'grid-medium';
35
+ $image_url = APIF_IMAGE_DIR . '/image-rect.png';
36
+ $image = $vm['images']['low_resolution']['url'];
37
+ } elseif ($i == 3) {
38
+ $masonary_class = 'grid-large';
39
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
40
+ $image = $vm['images']['standard_resolution']['url'];
41
+ }
42
+ $link = $vm["link"];
43
+ $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
44
+ ?>
45
+ <div class="masonry_elem columns isotope-item element-itemif <?php echo esc_attr($masonary_class); ?>">
46
+ <div class="thumb-elem large-mosaic-elem small-mosaic-elem hovermove large-mosaic-elem">
47
+ <header class="thumb-elem-header">
48
+ <div class="featimg">
49
+ <a class="example-image-link" href="<?php echo esc_url($img); ?>" data-lightbox="example-set">
50
+ <img class="the-thumb" src="<?php echo esc_url($image); ?>">
51
+ <img class="transparent-image" src="<?php echo esc_url($image_url); ?>">
52
+ </a>
53
+ </div>
54
+ <a href="<?php echo $link; ?>" target="_blank" class="image-hover">
55
+ <span class="follow">Follow Me</span>
56
+ <span class="follow_icon">
57
+ <img src="<?php echo $flow_icon; ?>"/>
58
+ </span>
59
+ </a>
60
+ </header>
61
+ <?php if ($image_like == '1') : ?>
62
+ <!-- Image like cound section start -->
63
+ <span class="instagram_like_count">
64
+ <p class="instagram_imge_like">
65
+ <span class="insta like_image">
66
+ <i class="fa fa-heart-o fa-2x"></i>
67
+ </span>
68
+ <span class="count"><?php echo $likes = $vm['likes']['count']; ?></span>
69
+ </p>
70
+ </span>
71
+ <!-- Image like cound section end -->
72
+ <?php endif; ?>
73
+ </div>
74
+ </div>
75
+ <?php
76
+ $i++;
77
+ endforeach;
78
+ }
79
+ ?>
80
+ </div>
81
+ </section>
inc/frontend/instagram-slider.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $apif_settings, $insta;
3
+ $apif_settings = $this->apif_settings;
4
+ $username = $apif_settings['username']; // your username
5
+ $access_token = $apif_settings['access_token'];
6
+ $image_like = $apif_settings['active'];
7
+ $count = 10; // number of images to show
8
+ require_once('instagram.php');
9
+ ?>
10
+ <div id="owl-demo" class="owl-carousel">
11
+ <?php
12
+ $ins_media_slider = $insta->userMedia();
13
+ $j = 0;
14
+ if(isset($ins_media['meta']['error_message'])){
15
+ ?>
16
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
17
+ <?php
18
+ }else if (is_array($ins_media_slider['data']) || is_object($ins_media_slider['data'])) {
19
+ foreach ($ins_media_slider['data'] as $vm):
20
+ if ($count == $j) {
21
+ break;
22
+ }
23
+ $j++;
24
+ $imgslider = $vm['images']['standard_resolution']['url'];
25
+ ?>
26
+ <div class="item">
27
+ <img src="<?php echo esc_url($imgslider); ?>" />
28
+ <?php if ($image_like == '1') : ?>
29
+ <!-- Image like cound section start -->
30
+ <span class="instagram_like_count">
31
+ <p class="instagram_imge_like">
32
+ <span class="insta like_image">
33
+ <i class="fa fa-heart-o fa-2x"></i>
34
+ </span>
35
+ <span class="count"><?php echo $likes = $vm['likes']['count']; ?></span>
36
+ </p>
37
+ </span>
38
+ <!-- Image like cound section end -->
39
+ <?php endif; ?>
40
+ </div>
41
+
42
+ <?php
43
+ endforeach;
44
+ }
45
+ ?>
46
+ </div>
inc/frontend/instagram-widget.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $apif_settings, $insta;
3
+ $apif_settings = $this->apif_settings;
4
+ $username = $apif_settings['username']; // your username
5
+ $access_token = $apif_settings['access_token'];
6
+ $layout = $apif_settings['instagram_mosaic'];
7
+ $image_like = $apif_settings['active'];
8
+ $count = 7; // number of images to show
9
+ require_once('instagram.php');
10
+ ?>
11
+ <section id="main" class="thumb-view">
12
+ <div class="row masonry for-mosaic isotope ifgrid">
13
+ <?php
14
+ $ins_media = $insta->userMedia();
15
+ $i = 1;
16
+ $j = 0;
17
+ if(isset($ins_media['meta']['error_message'])){
18
+ ?>
19
+ <h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
20
+ <?php
21
+ }else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
22
+ foreach ($ins_media['data'] as $vm):
23
+ if ($count == $j) {
24
+ break;
25
+ }
26
+ $j++;
27
+ $img = $vm['images']['standard_resolution']['url'];
28
+ ?>
29
+ <?php
30
+ if ($i <= 2 || $i == 6 || $i == 7) {
31
+ $masonary_class = 'grid-small';
32
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
33
+ $image = $vm['images']['low_resolution']['url'];
34
+ } elseif ($i == 4 || $i == 5) {
35
+ $masonary_class = 'grid-medium';
36
+ $image_url = APIF_IMAGE_DIR . '/image-rect.png';
37
+ $image = $vm['images']['standard_resolution']['url'];
38
+ } elseif ($i == 3) {
39
+ $masonary_class = 'grid-large';
40
+ $image_url = APIF_IMAGE_DIR . '/image-square.png';
41
+ $image = $vm['images']['standard_resolution']['url'];
42
+ }
43
+ $link = $vm["link"];
44
+ $flow_icon = APIF_IMAGE_DIR . '/sc-icon.png';
45
+ ?>
46
+ <div class="masonry_elem columns isotope-item element-itemif <?php echo esc_attr($masonary_class); ?>">
47
+ <div class="thumb-elem large-mosaic-elem small-mosaic-elem hovermove large-mosaic-elem">
48
+ <header class="thumb-elem-header">
49
+ <div class="featimg">
50
+ <img class="the-thumb" src="<?php echo esc_url($image); ?>">
51
+ <img class="transparent-image" src="<?php echo esc_url($image_url); ?>">
52
+ </div>
53
+ <a href="<?php echo $link; ?>" target="_blank" class="image-hover">
54
+ <span class="follow">Follow Me</span>
55
+ <span class="follow_icon">
56
+ <img src="<?php echo $flow_icon; ?>"/>
57
+ </span>
58
+ </a>
59
+ </header>
60
+ <?php if ($image_like == '1') : ?>
61
+ <!-- Image like cound section start -->
62
+ <span class="instagram_like_count">
63
+ <p class="instagram_imge_like">
64
+ <span class="insta like_image">
65
+ <i class="fa fa-heart-o fa-2x"></i>
66
+ </span>
67
+ <span class="count"><?php echo $likes = $vm['likes']['count']; ?></span>
68
+ </p>
69
+ </span>
70
+ <!-- Image like cound section end -->
71
+ <?php endif; ?>
72
+ </div>
73
+ </div>
74
+ <?php
75
+ $i++;
76
+ endforeach;
77
+ }
78
+ ?>
79
+ </div>
80
+ </section>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: instagram, instagram feed, instagram tag, instagram slider, instagarm mosa
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.3
7
- Stable tag: 1.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -95,6 +95,9 @@ Once you install the plugin , you can check some general documentation about how
95
  5. Backend Display Settings Section
96
 
97
  == Changelog ==
 
 
 
98
 
99
  = 1.0.5 =
100
  * Fixed the css bug.
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.3
7
+ Stable tag: 1.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
95
  5. Backend Display Settings Section
96
 
97
  == Changelog ==
98
+ = 1.0.6 =
99
+ * Fixed the issue for shortcode always displaying at the top of the content screen. Now the shortcode can be used anywhere within content.
100
+ * Added the follow link to the follow button in the instagram feeds widget.
101
 
102
  = 1.0.5 =
103
  * Fixed the css bug.