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

Version Description

  • Small Bug Fixed

=

Download this release

Release Info

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

Code changes from version 2.0 to 2.1

Files changed (4) hide show
  1. enjoyinstagram.php +73 -50
  2. img/gift2016.jpg +0 -0
  3. img/gift2016_dashboard.jpg +0 -0
  4. readme.txt +10 -4
enjoyinstagram.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Enjoy Instagram
4
  Plugin URI: http://www.mediabeta.com/enjoy-instagram/
5
  Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
6
- Version: 2.0
7
  Author: F. Prestipino, F. Di Pane - Mediabeta Srl
8
  Author URI: http://www.mediabeta.com/team/
9
  */
@@ -130,6 +130,9 @@ class Settings_enjoyinstagram_Plugin {
130
  </div>
131
 
132
  </div>
 
 
 
133
  </div>
134
  </h2>
135
 
@@ -218,46 +221,54 @@ function get_user_info($access_token){
218
  }
219
  function get_hash($hashtag,$count){
220
 
221
- $access_token = get_option('enjoyinstagram_access_token');
222
-
223
-
224
- $url = 'https://api.instagram.com/v1/tags/'.$hashtag.'/media/recent?count='.$count.'&access_token='.$access_token;
225
- try {
226
- $curl_connection = curl_init($url);
227
- curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
228
- curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
229
- curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
230
-
231
- //Data are stored in $data
232
- $result = json_decode(curl_exec($curl_connection), true);
233
- curl_close($curl_connection);
234
- return $result;
235
- } catch(Exception $e) {
236
- return $e->getMessage();
 
 
 
 
 
237
  }
238
-
239
  }
240
  function get_hash_code($hashtag,$count){
241
 
242
- $access_token = get_option('enjoyinstagram_access_token');
243
-
244
-
245
- $url = 'https://api.instagram.com/v1/tags/'.$hashtag.'/media/recent?count='.$count.'&access_token='.$access_token;
246
- try {
247
- $curl_connection = curl_init($url);
248
- curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
249
- curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
250
- curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
251
-
252
- //Data are stored in $data
253
- $result = json_decode(curl_exec($curl_connection), true);
254
- $code = $result['meta']['code'];
255
- curl_close($curl_connection);
256
- return $code;
257
- } catch(Exception $e) {
258
- return $e->getMessage();
 
 
 
 
 
259
  }
260
-
261
  }
262
  function get_user($user,$count){
263
 
@@ -648,19 +659,31 @@ function isHttps() {
648
  }
649
  }
650
 
651
- /*
652
- function enjoy_notice() {
653
- ?>
654
- <div class="updated" id="">
655
- <p>Upgrade to <b style="color:#FF6E00;">Enjoy Instagram Premium</b> <a target="_blank" href="http://www.mediabetaprojects.com/enjoy-instagram-premium/">here</a><br />
656
- <b style="color:#FF6E00;">15% OFF</b> with this CODE: <b style="color:#FF6E00;">discount15</b><br />
657
- But only until <b>September 15</b></p>
658
- </div>
 
 
 
 
 
 
659
 
660
- <?php
 
 
 
 
 
 
 
 
661
  }
662
- add_action( 'admin_notices', 'enjoy_notice' );
663
- */
664
 
665
 
666
  add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
@@ -672,9 +695,9 @@ function my_custom_dashboard_widgets() {
672
  }
673
 
674
  function custom_dashboard_help() {
675
- echo '<p>Upgrade to <b>Enjoy Instagram Premium</b> <a href="http://www.mediabetaprojects.com/enjoy-instagram-premium/" target="_blank">here</a></p>
676
- <p><b>15% OFF</b> with this CODE: <b>discount15</b></p>
677
- <p>But only until September 15</p>'
678
  ;
679
  }
680
 
3
  Plugin Name: Enjoy Instagram
4
  Plugin URI: http://www.mediabeta.com/enjoy-instagram/
5
  Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
6
+ Version: 2.1
7
  Author: F. Prestipino, F. Di Pane - Mediabeta Srl
8
  Author URI: http://www.mediabeta.com/team/
9
  */
130
  </div>
131
 
132
  </div>
133
+ <div class="promo_enjoy">
134
+ <a target="_blank" href="http://www.mediabetaprojects.com/enjoy-instagram-premium/"><img src="<?php echo plugins_url('/img/gift2016.jpg',__FILE__); ?>" /></a>
135
+ </div>
136
  </div>
137
  </h2>
138
 
221
  }
222
  function get_hash($hashtag,$count){
223
 
224
+ $user_option = get_option('enjoy_instagram_options');
225
+ if(is_array($user_option) && count($user_option)>0) {
226
+ reset($user_option);
227
+ $first_key = key($user_option);
228
+ $access_token = $user_option[$first_key]['access_token'];
229
+
230
+
231
+ $url = 'https://api.instagram.com/v1/tags/' . $hashtag . '/media/recent?count=' . $count . '&access_token=' . $access_token;
232
+ try {
233
+ $curl_connection = curl_init($url);
234
+ curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
235
+ curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
236
+ curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
237
+
238
+ //Data are stored in $data
239
+ $result = json_decode(curl_exec($curl_connection), true);
240
+ curl_close($curl_connection);
241
+ return $result;
242
+ } catch (Exception $e) {
243
+ return $e->getMessage();
244
+ }
245
  }
 
246
  }
247
  function get_hash_code($hashtag,$count){
248
 
249
+ $user_option = get_option('enjoy_instagram_options');
250
+ if(is_array($user_option) && count($user_option)>0) {
251
+ reset($user_option);
252
+ $first_key = key($user_option);
253
+ $access_token = $user_option[$first_key]['access_token'];
254
+
255
+
256
+ $url = 'https://api.instagram.com/v1/tags/' . $hashtag . '/media/recent?count=' . $count . '&access_token=' . $access_token;
257
+ try {
258
+ $curl_connection = curl_init($url);
259
+ curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
260
+ curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
261
+ curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
262
+
263
+ //Data are stored in $data
264
+ $result = json_decode(curl_exec($curl_connection), true);
265
+ $code = $result['meta']['code'];
266
+ curl_close($curl_connection);
267
+ return $code;
268
+ } catch (Exception $e) {
269
+ return $e->getMessage();
270
+ }
271
  }
 
272
  }
273
  function get_user($user,$count){
274
 
659
  }
660
  }
661
 
662
+ add_action('admin_notices', 'example_admin_notice');
663
+
664
+ function example_admin_notice() {
665
+ global $current_user ;
666
+ $user_id = $current_user->ID;
667
+ /* Check that the user hasn't already clicked to ignore the message */
668
+ if ( ! get_user_meta($user_id, 'ignore_enjoy_notice') ) {
669
+ echo '<div style="padding: 20px;border:1px solid #ccc;background: #fff;margin-top: 20px;"><div class="promo_enjoy">
670
+ <a target="_blank" href="http://www.mediabetaprojects.com/enjoy-instagram-premium/"><img src="'.plugins_url('/img/gift2016.jpg',__FILE__).'" /></a>
671
+ </div>';
672
+ printf(__('It not interesting to me | <a href="%1$s">Hide Notice</a>'), '?ignore_enjoy=0');
673
+ echo '</div>';
674
+ }
675
+ }
676
 
677
+ add_action('admin_init', 'ignore_enjoy');
678
+
679
+ function ignore_enjoy() {
680
+ global $current_user;
681
+ $user_id = $current_user->ID;
682
+ /* If user clicks to ignore the notice, add that to their user meta */
683
+ if ( isset($_GET['ignore_enjoy']) && '0' == $_GET['ignore_enjoy'] ) {
684
+ add_user_meta($user_id, 'ignore_enjoy_notice', 'true', true);
685
+ }
686
  }
 
 
687
 
688
 
689
  add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
695
  }
696
 
697
  function custom_dashboard_help() {
698
+ echo '<div class="promo_enjoy">
699
+ <a href="http://www.mediabetaprojects.com/enjoy-instagram-premium/" target="_blank"><img src="'.plugins_url('/img/gift2016_dashboard.jpg',__FILE__).'" style="width:100%;"/></a>
700
+ </div>'
701
  ;
702
  }
703
 
img/gift2016.jpg ADDED
Binary file
img/gift2016_dashboard.jpg ADDED
Binary file
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: Instagram plugin, Instagram, Instagram gallery, Instagram images, Lightbox Instagram,Grid Instagram view, Instagram responsive, Instagram touch, Instagram photos,Instagram posts, Instagram page, Instagram widgets
5
  Requires at least: 3.0.1
6
  Tested up to: 4.4
7
- Version: 2
8
- Stable tag: 2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -13,7 +13,9 @@ Instagram on your website with shortcodes and widgets! Images of Instagram profi
13
 
14
  == Description ==
15
 
16
- = Visualize Instagram Photos in your website! =
 
 
17
 
18
  Publish easily Instagram photos in your pages, posts, sidebars thanks to simple shortcodes and widgets.
19
 
@@ -133,6 +135,8 @@ Repeat Step 01 and Step 02 again.
133
  * Bug Fix
134
  = 2.0 =
135
  * New Instagram API
 
 
136
 
137
  == Upgrade Notice ==
138
 
@@ -169,4 +173,6 @@ Repeat Step 01 and Step 02 again.
169
  = 1.6.5 =
170
  * Bug Fix
171
  = 2.0 =
172
- * New Instagram API
 
 
4
  Tags: Instagram plugin, Instagram, Instagram gallery, Instagram images, Lightbox Instagram,Grid Instagram view, Instagram responsive, Instagram touch, Instagram photos,Instagram posts, Instagram page, Instagram widgets
5
  Requires at least: 3.0.1
6
  Tested up to: 4.4
7
+ Version: 2.1
8
+ Stable tag: 2.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
13
 
14
  == Description ==
15
 
16
+ = "Enjoy Instagram supports the new Instagram API, released 17th November 2015" =
17
+
18
+ = Show Instagram Photos in your website! =
19
 
20
  Publish easily Instagram photos in your pages, posts, sidebars thanks to simple shortcodes and widgets.
21
 
135
  * Bug Fix
136
  = 2.0 =
137
  * New Instagram API
138
+ = 2.1 =
139
+ * Small Bug Fixed
140
 
141
  == Upgrade Notice ==
142
 
173
  = 1.6.5 =
174
  * Bug Fix
175
  = 2.0 =
176
+ * New Instagram API
177
+ = 2.1 =
178
+ * Small Bug Fixed