Version Description
- Fixed Instagram update that stoped hashtags from working
- Fixed hellip that showed when using wp trim words
- Modified the function that saved images localy to only save as attachments
Download this release
Release Info
Developer | jetonr |
Plugin | Instagram Slider Widget |
Version | 1.4.1 |
Comparing to | |
See all releases |
Code changes from version 1.4.0 to 1.4.1
- assets/css/jr-insta-admin.css +4 -2
- assets/js/jr-insta-admin.js +11 -11
- instaram_slider.php +380 -351
- readme.txt +8 -3
assets/css/jr-insta-admin.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
.jr-container .donate { padding: 5px 15px 10px; display: inline-block; position: relative; color: #000; background: #ffd751; -webkit-border-radius: 5px; border-radius: 5px; border: 1px solid #b4b4b4; font-weight: bold; font-size: 14px; text-decoration: none; }
|
2 |
.jr-container .donate a { outline: 0; cursor: pointer }
|
3 |
-
.jr-container .donate span:before { color: #ce1f00; font: 400 20px/1 dashicons; font-family: dashicons; font-size: 24px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; line-height: 1; content: '\
|
4 |
.jr-container .pressthis a, .jr-container .pressthis-bookmarklet a,
|
5 |
.jr-container .pressthis a:active, .jr-container .pressthis-bookmarklet a:active,
|
6 |
.jr-container .pressthis a:focus, .jr-container .pressthis-bookmarklet a:focus,
|
@@ -26,4 +26,6 @@
|
|
26 |
.jr-container input:focus + .slider { box-shadow: 0 0 1px #0085ba; }
|
27 |
.jr-container input:checked + .slider:before { -webkit-transform: translateX(22px); -ms-transform: translateX(22px); transform: translateX(22px); }
|
28 |
.jr-container .slider.round { border-radius: 34px; }
|
29 |
-
.jr-container .slider.round:before { border-radius: 50%; }
|
|
|
|
1 |
.jr-container .donate { padding: 5px 15px 10px; display: inline-block; position: relative; color: #000; background: #ffd751; -webkit-border-radius: 5px; border-radius: 5px; border: 1px solid #b4b4b4; font-weight: bold; font-size: 14px; text-decoration: none; }
|
2 |
.jr-container .donate a { outline: 0; cursor: pointer }
|
3 |
+
.jr-container .donate span:before { color: #ce1f00; font: 400 20px/1 dashicons; font-family: dashicons; font-size: 24px; font-style: normal; font-variant: normal; font-weight: 400; font-stretch: normal; line-height: 1; content: '\f487'; position: relative; display: inline-block; top: 4px; margin-right: 4px; }
|
4 |
.jr-container .pressthis a, .jr-container .pressthis-bookmarklet a,
|
5 |
.jr-container .pressthis a:active, .jr-container .pressthis-bookmarklet a:active,
|
6 |
.jr-container .pressthis a:focus, .jr-container .pressthis-bookmarklet a:focus,
|
26 |
.jr-container input:focus + .slider { box-shadow: 0 0 1px #0085ba; }
|
27 |
.jr-container input:checked + .slider:before { -webkit-transform: translateX(22px); -ms-transform: translateX(22px); transform: translateX(22px); }
|
28 |
.jr-container .slider.round { border-radius: 34px; }
|
29 |
+
.jr-container .slider.round:before { border-radius: 50%; }
|
30 |
+
.jr-container .donate-buttons { text-align: center }
|
31 |
+
.jr-container .donate-button-link { cursor: pointer }
|
assets/js/jr-insta-admin.js
CHANGED
@@ -1,6 +1,12 @@
|
|
1 |
(function($) {
|
2 |
|
3 |
$(document).ready(function($){
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
// Hide Custom Url if image link is not set to custom url
|
6 |
$('body').on('change', '.jr-container select[id$="images_link"]', function(e){
|
@@ -29,19 +35,17 @@
|
|
29 |
var search_for = $(this);
|
30 |
if ( search_for.val() != 'username' ) {
|
31 |
search_for.closest('.jr-container').find('[id$="attachment"]:checkbox').closest('p').animate({opacity: 'hide' , height: 'hide'}, 200);
|
32 |
-
search_for.closest('.jr-container').find('select[id$="images_link"] option[value="local_image_url"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
33 |
search_for.closest('.jr-container').find('select[id$="images_link"] option[value="user_url"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
34 |
search_for.closest('.jr-container').find('select[id$="images_link"] option[value="attachment"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
35 |
-
search_for.closest('.jr-container').find('select[id$="images_link"]').val('
|
36 |
search_for.closest('.jr-container').find('select[id$="description"] option[value="username"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
37 |
search_for.closest('.jr-container').find('input[id$="blocked_users"]').closest('p').animate({opacity: 'show' , height: 'show'}, 200);
|
38 |
|
39 |
} else {
|
40 |
search_for.closest('.jr-container').find('[id$="attachment"]:checkbox').closest('p').animate({opacity: 'show' , height: 'show'}, 200);
|
41 |
-
search_for.closest('.jr-container').find('select[id$="images_link"] option[value="local_image_url"]').animate({opacity: 'show' , height: 'show'}, 200);
|
42 |
search_for.closest('.jr-container').find('select[id$="images_link"] option[value="user_url"]').animate({opacity: 'show' , height: 'show'}, 200);
|
43 |
search_for.closest('.jr-container').find('select[id$="images_link"] option[value="attachment"]').animate({opacity: 'show' , height: 'show'}, 200);
|
44 |
-
search_for.closest('.jr-container').find('select[id$="images_link"]').val('
|
45 |
search_for.closest('.jr-container').find('select[id$="description"] option[value="username"]').animate({opacity: 'show' , height: 'show'}, 200);
|
46 |
search_for.closest('.jr-container').find('input[id$="blocked_users"]').closest('p').animate({opacity: 'hide' , height: 'hide'}, 200);
|
47 |
|
@@ -52,15 +56,11 @@
|
|
52 |
$('body').on('change', '.jr-container [id$="attachment"]:checkbox', function(e){
|
53 |
var attachment = $(this);
|
54 |
if ( this.checked ) {
|
55 |
-
attachment.closest('.jr-container').find('.blocked-wrap').animate({opacity: 'show' , height: 'show'}, 200);
|
56 |
-
attachment.closest('.jr-container').find('select[id$="images_link"] option[value="local_image_url"]').animate({opacity: 'show' , height: 'show'}, 200);
|
57 |
attachment.closest('.jr-container').find('select[id$="images_link"] option[value="attachment"]').animate({opacity: 'show' , height: 'show'}, 200);
|
58 |
-
attachment.closest('.jr-container').find('select[id$="images_link"]').val('
|
59 |
} else {
|
60 |
-
attachment.closest('.jr-container').find('.blocked-wrap').animate({opacity: 'hide' , height: 'hide'}, 200);
|
61 |
-
attachment.closest('.jr-container').find('select[id$="images_link"] option[value="local_image_url"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
62 |
attachment.closest('.jr-container').find('select[id$="images_link"] option[value="attachment"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
63 |
-
attachment.closest('.jr-container').find('select[id$="images_link"]').val('
|
64 |
}
|
65 |
});
|
66 |
|
@@ -75,7 +75,7 @@
|
|
75 |
$(this).html('[ + Open ]');
|
76 |
}
|
77 |
advanced_container.toggle();
|
78 |
-
});
|
79 |
|
80 |
// Remove blocked images with ajax
|
81 |
$('body').on('click', '.jr-container .jr-delete-instagram-dupes', function(e){
|
1 |
(function($) {
|
2 |
|
3 |
$(document).ready(function($){
|
4 |
+
$('.donate-bitcoin-qr-address').hide();
|
5 |
+
$('.donate-button-link').on('click', function (e) {
|
6 |
+
e.preventDefault();
|
7 |
+
//$(this).slideUp(100);
|
8 |
+
$('.donate-bitcoin-qr-address').slideToggle();
|
9 |
+
});
|
10 |
|
11 |
// Hide Custom Url if image link is not set to custom url
|
12 |
$('body').on('change', '.jr-container select[id$="images_link"]', function(e){
|
35 |
var search_for = $(this);
|
36 |
if ( search_for.val() != 'username' ) {
|
37 |
search_for.closest('.jr-container').find('[id$="attachment"]:checkbox').closest('p').animate({opacity: 'hide' , height: 'hide'}, 200);
|
|
|
38 |
search_for.closest('.jr-container').find('select[id$="images_link"] option[value="user_url"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
39 |
search_for.closest('.jr-container').find('select[id$="images_link"] option[value="attachment"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
40 |
+
search_for.closest('.jr-container').find('select[id$="images_link"]').val('image_link');
|
41 |
search_for.closest('.jr-container').find('select[id$="description"] option[value="username"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
42 |
search_for.closest('.jr-container').find('input[id$="blocked_users"]').closest('p').animate({opacity: 'show' , height: 'show'}, 200);
|
43 |
|
44 |
} else {
|
45 |
search_for.closest('.jr-container').find('[id$="attachment"]:checkbox').closest('p').animate({opacity: 'show' , height: 'show'}, 200);
|
|
|
46 |
search_for.closest('.jr-container').find('select[id$="images_link"] option[value="user_url"]').animate({opacity: 'show' , height: 'show'}, 200);
|
47 |
search_for.closest('.jr-container').find('select[id$="images_link"] option[value="attachment"]').animate({opacity: 'show' , height: 'show'}, 200);
|
48 |
+
search_for.closest('.jr-container').find('select[id$="images_link"]').val('image_link');
|
49 |
search_for.closest('.jr-container').find('select[id$="description"] option[value="username"]').animate({opacity: 'show' , height: 'show'}, 200);
|
50 |
search_for.closest('.jr-container').find('input[id$="blocked_users"]').closest('p').animate({opacity: 'hide' , height: 'hide'}, 200);
|
51 |
|
56 |
$('body').on('change', '.jr-container [id$="attachment"]:checkbox', function(e){
|
57 |
var attachment = $(this);
|
58 |
if ( this.checked ) {
|
|
|
|
|
59 |
attachment.closest('.jr-container').find('select[id$="images_link"] option[value="attachment"]').animate({opacity: 'show' , height: 'show'}, 200);
|
60 |
+
attachment.closest('.jr-container').find('select[id$="images_link"]').val('image_link');
|
61 |
} else {
|
|
|
|
|
62 |
attachment.closest('.jr-container').find('select[id$="images_link"] option[value="attachment"]').animate({opacity: 'hide' , height: 'hide'}, 200);
|
63 |
+
attachment.closest('.jr-container').find('select[id$="images_link"]').val('image_link');
|
64 |
}
|
65 |
});
|
66 |
|
75 |
$(this).html('[ + Open ]');
|
76 |
}
|
77 |
advanced_container.toggle();
|
78 |
+
});
|
79 |
|
80 |
// Remove blocked images with ajax
|
81 |
$('body').on('click', '.jr-container .jr-delete-instagram-dupes', function(e){
|
instaram_slider.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Instagram Slider Widget
|
4 |
Plugin URI: http://instagram.jrwebstudio.com/
|
5 |
-
Version: 1.4.
|
6 |
Description: Instagram Slider Widget is a responsive slider widget that shows 12 latest images from a public Instagram user and up to 18 images from a hashtag.
|
7 |
Author: jetonr
|
8 |
Author URI: http://jrwebstudio.com/
|
@@ -14,16 +14,6 @@ License: GPLv2 or later
|
|
14 |
*/
|
15 |
add_action( 'widgets_init', array( 'JR_InstagramSlider', 'register_widget' ) );
|
16 |
|
17 |
-
if ( !ini_get( 'max_execution_time' ) || ini_get( 'max_execution_time' ) < 300 ) {
|
18 |
-
|
19 |
-
ini_set( 'max_execution_time', 300 );
|
20 |
-
|
21 |
-
$disabled = explode( ',', ini_get( 'disable_functions' ) );
|
22 |
-
if ( !in_array( 'set_time_limit', $disabled ) ) {
|
23 |
-
set_time_limit( 300 );
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
/**
|
28 |
* JR_InstagramSlider Class
|
29 |
*/
|
@@ -34,7 +24,11 @@ class JR_InstagramSlider extends WP_Widget {
|
|
34 |
*
|
35 |
* @var string
|
36 |
*/
|
37 |
-
const VERSION = '1.4.
|
|
|
|
|
|
|
|
|
38 |
|
39 |
/**
|
40 |
* Initialize the plugin by registering widget and loading public scripts
|
@@ -49,9 +43,6 @@ class JR_InstagramSlider extends WP_Widget {
|
|
49 |
)
|
50 |
);
|
51 |
|
52 |
-
// Add new Image Size
|
53 |
-
add_image_size( 'jr_insta_square', 640, 640, true );
|
54 |
-
|
55 |
// Shortcode
|
56 |
add_shortcode( 'jr_instagram', array( $this, 'shortcode' ) );
|
57 |
|
@@ -71,7 +62,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
71 |
add_filter( 'attachment_fields_to_edit', array( $this, 'insta_attachment_fields' ) , 10, 2 );
|
72 |
|
73 |
// Add action for single cron events
|
74 |
-
add_action( 'jr_insta_cron', array( $this, 'jr_cron_trigger' ), 10 , 3 );
|
75 |
}
|
76 |
|
77 |
/**
|
@@ -83,8 +74,8 @@ class JR_InstagramSlider extends WP_Widget {
|
|
83 |
'name' => __( 'Instagram Slider - Shortcode Generator', 'jrinstaslider' ),
|
84 |
'id' => 'jr-insta-shortcodes',
|
85 |
'description' => __( "1. Drag Instagram Slider widget here. 2. Fill in the fields and hit save. 3. Copy the shortocde generated at the bottom of the widget form and use it on posts or pages.", 'jrinstaslider' )
|
86 |
-
|
87 |
-
|
88 |
}
|
89 |
|
90 |
/**
|
@@ -109,8 +100,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
109 |
}
|
110 |
|
111 |
wp_enqueue_style( 'jr-insta-admin-styles', plugins_url( 'assets/css/jr-insta-admin.css', __FILE__ ), array(), self::VERSION );
|
112 |
-
|
113 |
-
wp_enqueue_script( 'jr-insta-admin-script', plugins_url( 'assets/js/jr-insta-admin.js', __FILE__ ), array( 'jquery' ), self::VERSION, true );
|
114 |
}
|
115 |
|
116 |
/**
|
@@ -196,7 +186,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
196 |
'images_number' => 5,
|
197 |
'columns' => 4,
|
198 |
'refresh_hour' => 5,
|
199 |
-
'image_size' => '
|
200 |
'image_link_rel' => '',
|
201 |
'image_link_class' => '',
|
202 |
'no_pin' => 0,
|
@@ -206,7 +196,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
206 |
'slidespeed' => 7000,
|
207 |
'description' => array( 'username', 'time','caption' ),
|
208 |
'support_author' => 0
|
209 |
-
|
210 |
|
211 |
$instance = wp_parse_args( (array) $instance, $defaults );
|
212 |
|
@@ -226,7 +216,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
226 |
<input class="widefat" id="<?php echo $this->get_field_id( 'blocked_users' ); ?>" name="<?php echo $this->get_field_name( 'blocked_users' ); ?>" value="<?php echo $instance['blocked_users']; ?>" />
|
227 |
<span class="jr-description"><?php _e( 'Enter usernames separated by commas whose images you don\'t want to show', 'jrinstaslider' ); ?></span>
|
228 |
</p>
|
229 |
-
<p class="<?php if ( 'username' != $instance['search_for'] ) echo 'hidden'; ?>"><strong><?php _e( 'Save
|
230 |
<label class="switch" for="<?php echo $this->get_field_id( 'attachment' ); ?>">
|
231 |
<input class="widefat" id="<?php echo $this->get_field_id( 'attachment' ); ?>" name="<?php echo $this->get_field_name( 'attachment' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['attachment'] ); ?> /><span class="slider round"></span></label>
|
232 |
<br><span class="jr-description"><?php _e( ' Turn on to save Instagram Images into WordPress media library.', 'jrinstaslider') ?></span>
|
@@ -237,157 +227,167 @@ class JR_InstagramSlider extends WP_Widget {
|
|
237 |
wp_nonce_field( 'jr_delete_instagram_dupes', 'delete_insta_dupes_nonce' );
|
238 |
}
|
239 |
?>
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
<
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
<
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
<
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
$
|
311 |
-
$
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
<
|
320 |
-
<
|
321 |
-
<input class="widefat" id="<?php echo $this->get_field_id( 'image_link_rel' ); ?>" name="<?php echo $this->get_field_name( 'image_link_rel' ); ?>" value="<?php echo $instance['image_link_rel']; ?>" />
|
322 |
-
<span class="jr-description"><?php _e( 'Specifies the relationship between the current page and the linked website', 'jrinstaslider' ); ?></span>
|
323 |
-
</p>
|
324 |
-
<p>
|
325 |
-
<label for="<?php echo $this->get_field_id( 'image_link_class' ); ?>"><?php _e( 'Image Link class', 'jrinstaslider' ); ?>:</label>
|
326 |
-
<input class="widefat" id="<?php echo $this->get_field_id( 'image_link_class' ); ?>" name="<?php echo $this->get_field_name( 'image_link_class' ); ?>" value="<?php echo $instance['image_link_class']; ?>" />
|
327 |
-
<span class="jr-description"><?php _e( 'Usefull if you are using jQuery lightbox plugins to open links', 'jrinstaslider' ); ?></span>
|
328 |
-
</p>
|
329 |
-
<p><strong><?php _e( 'Disable Pinning:', 'jrinstaslider' ); ?></strong>
|
330 |
-
<label class="switch" for="<?php echo $this->get_field_id( 'no_pin' ); ?>">
|
331 |
-
<input class="widefat" id="<?php echo $this->get_field_id( 'no_pin' ); ?>" name="<?php echo $this->get_field_name( 'no_pin' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['no_pin'] ); ?> /><span class="slider round"></span></label>
|
332 |
-
<br><span class="jr-description"><?php _e( 'Disable pinning for Pinterest on all images from this widget!', 'jrinstaslider') ?></span>
|
333 |
-
</p>
|
334 |
-
</div>
|
335 |
-
<div class="jr-slider-options <?php if ( 'thumbs' == $instance['template'] || 'thumbs-no-border' == $instance['template'] ) echo 'hidden'; ?>">
|
336 |
-
<h4 class="jr-advanced-title"><?php _e( 'Advanced Slider Options', 'jrinstaslider'); ?></h4>
|
337 |
<p>
|
338 |
-
<?php _e( '
|
339 |
-
<
|
340 |
-
<
|
341 |
-
<label class="jr-radio"><input type="radio" id="<?php echo $this->get_field_id( 'controls' ); ?>" name="<?php echo $this->get_field_name( 'controls' ); ?>" value="none" <?php checked( 'none', $instance['controls'] ); ?> /> <?php _e( 'No Navigation', 'jrinstaslider' ); ?></label>
|
342 |
</p>
|
343 |
<p>
|
344 |
-
<?php _e( '
|
345 |
-
<
|
346 |
-
<
|
347 |
</p>
|
348 |
-
<p>
|
349 |
-
<label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
<input class="small-text" id="<?php echo $this->get_field_id( 'caption_words' ); ?>" name="<?php echo $this->get_field_name( 'caption_words' ); ?>" value="<?php echo $instance['caption_words']; ?>" />
|
351 |
</label>
|
352 |
</p>
|
353 |
<p>
|
354 |
<label for="<?php echo $this->get_field_id( 'slidespeed' ); ?>"><?php _e( 'Slide Speed:', 'jrinstaslider' ); ?>
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
</div>
|
370 |
</div>
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
|
|
381 |
<p><strong><?php _e( 'Show "Powered by Link"', 'jrinstaslider' ); ?></strong>
|
382 |
<label class="switch" for="<?php echo $this->get_field_id( 'support_author' ); ?>">
|
383 |
<input class="widefat" id="<?php echo $this->get_field_id( 'support_author' ); ?>" name="<?php echo $this->get_field_name( 'support_author' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['support_author'] ); ?> /><span class="slider round"></span></label>
|
384 |
<br><span class="jr-description"><?php _e( 'When enabled, the author is notified and a backlink website is visible at the bottom of the plugin. <br> <strong>If you enable this option you will have privileged support from our team!</strong>', 'jrinstaslider') ?></span>
|
385 |
</p>
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
|
392 |
/**
|
393 |
* Selected array function echoes selected if in array
|
@@ -420,6 +420,16 @@ class JR_InstagramSlider extends WP_Widget {
|
|
420 |
}
|
421 |
}
|
422 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
|
424 |
/**
|
425 |
* Cron Trigger Function
|
@@ -429,24 +439,11 @@ class JR_InstagramSlider extends WP_Widget {
|
|
429 |
* @return [type] [description]
|
430 |
*/
|
431 |
public function jr_cron_trigger( $username, $refresh_hour, $images ) {
|
432 |
-
$search_for= array();
|
433 |
$search_for['username'] = $username;
|
434 |
$this->instagram_data( $search_for, $refresh_hour, $images, true );
|
435 |
}
|
436 |
|
437 |
-
|
438 |
-
/**
|
439 |
-
* Echoes the Display Instagram Images method
|
440 |
-
*
|
441 |
-
* @param array $args
|
442 |
-
*
|
443 |
-
* @return void
|
444 |
-
*/
|
445 |
-
public function instagram_images( $args ) {
|
446 |
-
echo $this->display_images( $args );
|
447 |
-
}
|
448 |
-
|
449 |
-
|
450 |
/**
|
451 |
* Runs the query for images and returns the html
|
452 |
*
|
@@ -462,12 +459,12 @@ class JR_InstagramSlider extends WP_Widget {
|
|
462 |
$attachment = isset( $args['attachment'] ) ? true : false;
|
463 |
$template = isset( $args['template'] ) ? $args['template'] : 'slider';
|
464 |
$orderby = isset( $args['orderby'] ) ? $args['orderby'] : 'rand';
|
465 |
-
$images_link = isset( $args['images_link'] ) ? $args['images_link'] : '
|
466 |
$custom_url = isset( $args['custom_url'] ) ? $args['custom_url'] : '';
|
467 |
$images_number = isset( $args['images_number'] ) ? absint( $args['images_number'] ) : 5;
|
468 |
$columns = isset( $args['columns'] ) ? absint( $args['columns'] ) : 4;
|
469 |
$refresh_hour = isset( $args['refresh_hour'] ) ? absint( $args['refresh_hour'] ) : 5;
|
470 |
-
$image_size = isset( $args['image_size'] ) ? $args['image_size'] : '
|
471 |
$image_link_rel = isset( $args['image_link_rel'] ) ? $args['image_link_rel'] : '';
|
472 |
$no_pin = isset( $args['no_pin'] ) ? $args['no_pin'] : 0;
|
473 |
$image_link_class = isset( $args['image_link_class'] ) ? $args['image_link_class'] : '';
|
@@ -504,7 +501,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
504 |
'link_class' => $image_link_class,
|
505 |
'no_pin' => $no_pin,
|
506 |
'caption_words' => $caption_words
|
507 |
-
|
508 |
|
509 |
$images_div_class = 'jr-insta-thumb';
|
510 |
$ul_class = ( $template == 'thumbs-no-border' ) ? 'thumbnails no-border jr_col_' . $columns : 'thumbnails jr_col_' . $columns;
|
@@ -566,13 +563,9 @@ class JR_InstagramSlider extends WP_Widget {
|
|
566 |
$output = __( 'No images found! <br> Try some other hashtag or username', 'jrinstaslider' );
|
567 |
|
568 |
if ( ( $search == 'user' && $attachment ) ) {
|
569 |
-
|
570 |
-
if (
|
571 |
-
|
572 |
-
} else {
|
573 |
-
if ( !wp_next_scheduled( 'jr_insta_cron', array( $search_for['username'], $refresh_hour, $images_number ) ) ) {
|
574 |
-
wp_schedule_single_event( time() + 20, 'jr_insta_cron', array( $search_for['username'], $refresh_hour, $images_number ) );
|
575 |
-
}
|
576 |
}
|
577 |
|
578 |
$opt_name = 'jr_insta_' . md5( $search . '_' . $search_for['username'] );
|
@@ -584,7 +577,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
584 |
'post_mime_type' => 'image',
|
585 |
'posts_per_page' => $images_number,
|
586 |
'no_found_rows' => true
|
587 |
-
|
588 |
|
589 |
if ( $orderby != 'rand' ) {
|
590 |
|
@@ -595,8 +588,8 @@ class JR_InstagramSlider extends WP_Widget {
|
|
595 |
$query_args['orderby'] = 'meta_value_num';
|
596 |
$query_args['order'] = $orderby[1];
|
597 |
}
|
598 |
-
|
599 |
-
if ( isset( $attachment_ids['saved_images'] ) ) {
|
600 |
|
601 |
$query_args['post__in'] = $attachment_ids['saved_images'];
|
602 |
|
@@ -607,8 +600,8 @@ class JR_InstagramSlider extends WP_Widget {
|
|
607 |
'key' => 'jr_insta_username',
|
608 |
'value' => $username,
|
609 |
'compare' => '='
|
610 |
-
|
611 |
-
|
612 |
}
|
613 |
|
614 |
$instagram_images = new WP_Query( $query_args );
|
@@ -619,21 +612,24 @@ class JR_InstagramSlider extends WP_Widget {
|
|
619 |
|
620 |
while ( $instagram_images->have_posts() ) : $instagram_images->the_post();
|
621 |
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
|
|
|
|
|
|
635 |
|
636 |
-
|
637 |
|
638 |
endwhile;
|
639 |
|
@@ -660,26 +656,21 @@ class JR_InstagramSlider extends WP_Widget {
|
|
660 |
|
661 |
foreach ( $images_data as $image_data ) {
|
662 |
|
663 |
-
if ( '
|
664 |
$template_args['link_to'] = $image_data['link'];
|
665 |
} elseif ( 'user_url' == $images_link ) {
|
666 |
$template_args['link_to'] = 'https://www.instagram.com/' . $username . '/';
|
|
|
|
|
667 |
} elseif ( 'custom_url' == $images_link ) {
|
668 |
$template_args['link_to'] = $custom_url;
|
669 |
}
|
670 |
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
$template_args['image'] = $image_data['url'];
|
677 |
-
}
|
678 |
-
|
679 |
-
$template_args['caption'] = $image_data['caption'];
|
680 |
-
$template_args['timestamp'] = $image_data['timestamp'];
|
681 |
-
$template_args['username'] = $image_data['username'];
|
682 |
-
$template_args['attachment'] = false;
|
683 |
|
684 |
$output .= $this->get_template( $template, $template_args );
|
685 |
}
|
@@ -713,25 +704,20 @@ class JR_InstagramSlider extends WP_Widget {
|
|
713 |
|
714 |
foreach ( $images_data as $image_data ) {
|
715 |
|
716 |
-
if ( '
|
717 |
$template_args['link_to'] = $image_data['link'];
|
718 |
} elseif ( 'user_url' == $images_link ) {
|
719 |
$template_args['link_to'] = 'https://www.instagram.com/' . $username . '/';
|
|
|
|
|
720 |
} elseif ( 'custom_url' == $images_link ) {
|
721 |
$template_args['link_to'] = $custom_url;
|
722 |
}
|
723 |
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
} else {
|
729 |
-
$template_args['image'] = $image_data['url'];
|
730 |
-
}
|
731 |
-
|
732 |
-
$template_args['caption'] = $image_data['caption'];
|
733 |
-
$template_args['timestamp'] = $image_data['timestamp'];
|
734 |
-
$template_args['username'] = $image_data['username'];
|
735 |
|
736 |
$output .= $this->get_template( $template, $template_args );
|
737 |
}
|
@@ -756,24 +742,22 @@ class JR_InstagramSlider extends WP_Widget {
|
|
756 |
private function get_template( $template, $args ) {
|
757 |
|
758 |
$link_to = isset( $args['link_to'] ) ? $args['link_to'] : false;
|
|
|
759 |
|
760 |
if ( ( $args['search_for'] == 'user' && $args['attachment'] !== true ) || $args['search_for'] == 'hashtag' ) {
|
761 |
$caption = $args['caption'];
|
762 |
$time = $args['timestamp'];
|
763 |
$username = $args['username'];
|
764 |
-
$image_url = $args['image'];
|
765 |
} else {
|
766 |
$attach_id = get_the_id();
|
767 |
$caption = get_the_excerpt();
|
768 |
$time = get_post_meta( $attach_id, 'jr_insta_timestamp', true );
|
769 |
$username = get_post_meta( $attach_id, 'jr_insta_username', true );
|
770 |
-
$image_url = wp_get_attachment_image_src( $attach_id, $args['image_size'] );
|
771 |
-
$image_url = $image_url[0];
|
772 |
}
|
773 |
|
774 |
-
$short_caption = wp_trim_words( $caption, 10 );
|
775 |
$short_caption = preg_replace("/[^A-Za-z0-9?! ]/","", $short_caption);
|
776 |
-
$caption = wp_trim_words( $caption, $args['caption_words'],
|
777 |
$nopin = ( 1 == $args['no_pin'] ) ? 'nopin="nopin"' : '';
|
778 |
|
779 |
$image_src = '<img src="' . $image_url . '" alt="' . $short_caption . '" title="' . $short_caption . '" '. $nopin . '/>';
|
@@ -923,13 +907,12 @@ class JR_InstagramSlider extends WP_Widget {
|
|
923 |
function powered_by_link( $support_author ) {
|
924 |
|
925 |
if ( $support_author ) {
|
926 |
-
|
927 |
$link = $this->domain_data();
|
928 |
|
929 |
if ( isset( $link['text'] ) && !empty( $link['text'] ) && isset( $link['domain'] ) && !empty( $link['domain'] ) ) {
|
930 |
-
$link = '<div style="clear:both;text-align:right;font-size:10px;"
|
931 |
} else if ( isset( $link['text'] ) && !empty( $link['text'] ) ) {
|
932 |
-
$link = '<div style="clear:both;text-align:right;font-size:10px;" >'.$link['text'].'</div>';
|
933 |
} else {
|
934 |
$link = '';
|
935 |
}
|
@@ -951,6 +934,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
951 |
*/
|
952 |
private function instagram_data( $search_for, $cache_hours, $nr_images, $attachment ) {
|
953 |
|
|
|
954 |
$blocked_users = isset( $search_for['blocked_users'] ) && !empty( $search_for['blocked_users'] ) ? $search_for['blocked_users'] : false;
|
955 |
if ( isset( $search_for['username'] ) && !empty( $search_for['username'] ) ) {
|
956 |
$search = 'user';
|
@@ -973,7 +957,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
973 |
'cache_hours' => $cache_hours,
|
974 |
'nr_images' => $nr_images,
|
975 |
'attachment' => $attachment
|
976 |
-
|
977 |
|
978 |
if ( true === $this->trigger_refresh_data( $instaData, $old_opts, $new_opts ) ) {
|
979 |
|
@@ -984,11 +968,13 @@ class JR_InstagramSlider extends WP_Widget {
|
|
984 |
$old_opts['cache_hours'] = $cache_hours;
|
985 |
$old_opts['nr_images'] = $nr_images;
|
986 |
$old_opts['attachment'] = $attachment;
|
987 |
-
|
988 |
if ( 'user' == $search ) {
|
989 |
-
$
|
|
|
990 |
} else {
|
991 |
-
$
|
|
|
992 |
|
993 |
}
|
994 |
|
@@ -998,72 +984,50 @@ class JR_InstagramSlider extends WP_Widget {
|
|
998 |
}
|
999 |
|
1000 |
if ( $response['response']['code'] == 200 ) {
|
1001 |
-
|
1002 |
-
$
|
1003 |
-
|
1004 |
-
// Compatibility for version of php where strstr() doesnt accept third parameter
|
1005 |
-
if ( version_compare( PHP_VERSION, '5.3.0', '>=' ) ) {
|
1006 |
-
$json = strstr( $json, '</script>', true );
|
1007 |
-
} else {
|
1008 |
-
$json = substr( $json, 0, strpos( $json, '</script>' ) );
|
1009 |
-
}
|
1010 |
-
|
1011 |
-
$json = rtrim( $json, ';' );
|
1012 |
-
|
1013 |
-
// Function json_last_error() is not available before PHP * 5.3.0 version
|
1014 |
-
if ( function_exists( 'json_last_error' ) ) {
|
1015 |
-
|
1016 |
-
( $results = json_decode( $json, true ) ) && json_last_error() == JSON_ERROR_NONE;
|
1017 |
-
|
1018 |
-
} else {
|
1019 |
-
|
1020 |
-
$results = json_decode( $json, true );
|
1021 |
-
}
|
1022 |
-
|
1023 |
if ( $results && is_array( $results ) ) {
|
1024 |
|
1025 |
if ( 'user' == $search ) {
|
1026 |
-
$entry_data = isset( $results['
|
1027 |
} else {
|
1028 |
-
$entry_data = isset( $results['
|
1029 |
}
|
1030 |
|
1031 |
|
1032 |
if ( empty( $entry_data ) ) {
|
1033 |
return __( 'No images found', 'jrinstaslider');
|
1034 |
}
|
1035 |
-
|
1036 |
-
$count = count($entry_data);
|
1037 |
-
|
1038 |
-
foreach ( $entry_data as $current => $result ) {
|
1039 |
|
1040 |
-
|
1041 |
-
$nr_images++;
|
1042 |
-
continue;
|
1043 |
-
}
|
1044 |
|
1045 |
if ( 'hashtag' == $search ) {
|
|
|
|
|
|
|
1046 |
if ( in_array( $result['owner']['id'], $blocked_users_array ) ) {
|
1047 |
$nr_images++;
|
1048 |
continue;
|
1049 |
-
}
|
|
|
|
|
|
|
|
|
|
|
1050 |
}
|
1051 |
|
|
|
1052 |
if ( $current >= $nr_images ) {
|
1053 |
break;
|
1054 |
}
|
1055 |
-
|
1056 |
-
$image_data['code'] = $result['code'];
|
1057 |
-
$image_data['username'] = 'user' == $search ? $search_string : false;
|
1058 |
-
$image_data['user_id'] = $result['owner']['id'];
|
1059 |
-
$image_data['caption'] = isset( $result['caption'] ) ? $this->sanitize( $result['caption'] ) : '';
|
1060 |
-
$image_data['id'] = $result['id'];
|
1061 |
-
$image_data['link'] = 'https://www.instagram.com/p/'. $result['code'] . '/';
|
1062 |
-
$image_data['popularity'] = (int) ( $result['comments']['count'] ) + ( $result['likes']['count'] );
|
1063 |
-
$image_data['timestamp'] = (float) $result['date'];
|
1064 |
-
$image_data['url'] = $result['display_src'];
|
1065 |
-
$image_data['url_thumbnail'] = $result['thumbnail_src'];
|
1066 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1067 |
if ( ( $search == 'hashtag' ) || ( $search == 'user' && !$attachment ) ) {
|
1068 |
|
1069 |
$instaData[] = $image_data;
|
@@ -1077,7 +1041,10 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1077 |
$this->update_wp_attachment( $old_opts['saved_images'][$image_data['id']], $image_data );
|
1078 |
|
1079 |
$instaData[$image_data['id']] = $old_opts['saved_images'][$image_data['id']];
|
1080 |
-
|
|
|
|
|
|
|
1081 |
|
1082 |
} else {
|
1083 |
|
@@ -1120,6 +1087,109 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1120 |
return $instaData;
|
1121 |
}
|
1122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1123 |
/**
|
1124 |
* Remove Duplicates
|
1125 |
* @return [type] [description]
|
@@ -1137,9 +1207,9 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1137 |
'key' => 'jr_insta_username',
|
1138 |
'compare' => '=',
|
1139 |
'value' => $username
|
1140 |
-
),
|
1141 |
),
|
1142 |
-
)
|
|
|
1143 |
|
1144 |
$savedinsta = new WP_Query( $savedinsta_args );
|
1145 |
|
@@ -1177,7 +1247,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1177 |
$post = $_POST;
|
1178 |
$return = array(
|
1179 |
'deleted' => $this->clean_duplicates( $post['username'] )
|
1180 |
-
|
1181 |
|
1182 |
wp_send_json( $return );
|
1183 |
}
|
@@ -1200,8 +1270,9 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1200 |
if ( isset( $user_ids[$user] ) ) {
|
1201 |
continue;
|
1202 |
}
|
1203 |
-
|
1204 |
-
$
|
|
|
1205 |
|
1206 |
if ( is_wp_error( $response ) ) {
|
1207 |
|
@@ -1210,30 +1281,11 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1210 |
|
1211 |
if ( $response['response']['code'] == 200 ) {
|
1212 |
|
1213 |
-
$
|
1214 |
-
|
1215 |
-
// Compatibility for version of php where strstr() doesnt accept third parameter
|
1216 |
-
if ( version_compare( PHP_VERSION, '5.3.0', '>=' ) ) {
|
1217 |
-
$json = strstr( $json, '</script>', true );
|
1218 |
-
} else {
|
1219 |
-
$json = substr( $json, 0, strpos( $json, '</script>' ) );
|
1220 |
-
}
|
1221 |
-
|
1222 |
-
$json = rtrim( $json, ';' );
|
1223 |
-
|
1224 |
-
// Function json_last_error() is not available before PHP * 5.3.0 version
|
1225 |
-
if ( function_exists( 'json_last_error' ) ) {
|
1226 |
-
|
1227 |
-
( $results = json_decode( $json, true ) ) && json_last_error() == JSON_ERROR_NONE;
|
1228 |
-
|
1229 |
-
} else {
|
1230 |
-
|
1231 |
-
$results = json_decode( $json, true );
|
1232 |
-
}
|
1233 |
|
1234 |
if ( $results && is_array( $results ) ) {
|
1235 |
|
1236 |
-
$user_id = isset( $results['
|
1237 |
|
1238 |
if ( $user_id ) {
|
1239 |
|
@@ -1262,9 +1314,10 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1262 |
* @param array image_data
|
1263 |
* @return void
|
1264 |
*/
|
1265 |
-
private function update_wp_attachment( $attachment_ID, $image_data ) {
|
1266 |
-
|
1267 |
update_post_meta( $attachment_ID, 'jr_insta_popularity', $image_data['popularity'] );
|
|
|
|
|
1268 |
}
|
1269 |
|
1270 |
/**
|
@@ -1278,48 +1331,24 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1278 |
*/
|
1279 |
private function save_wp_attachment( $image_data ) {
|
1280 |
|
1281 |
-
|
1282 |
-
$clean_url = esc_url( remove_query_arg( 'ig_cache_key', $image_data['url'] ) );
|
1283 |
-
|
1284 |
-
$image_info = pathinfo( $clean_url );
|
1285 |
|
1286 |
-
if ( !in_array( $image_info['extension'], array( 'jpg', 'jpe', 'jpeg'
|
1287 |
return false;
|
1288 |
}
|
1289 |
-
|
1290 |
-
// These files need to be included as dependencies when on the front end.
|
1291 |
-
if( !function_exists( 'download_url' ) || !function_exists( 'media_handle_sideload' ) ) {
|
1292 |
-
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
1293 |
-
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
1294 |
-
require_once( ABSPATH . 'wp-admin/includes/media.php' );
|
1295 |
-
}
|
1296 |
|
1297 |
-
$
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
|
|
1302 |
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
$file_array['tmp_name'] = '';
|
1308 |
|
1309 |
-
return $tmp->get_error_message();
|
1310 |
-
}
|
1311 |
-
|
1312 |
-
$id = media_handle_sideload( $file_array, 0, NULL, array(
|
1313 |
-
'post_excerpt' => $image_data['caption']
|
1314 |
-
) );
|
1315 |
-
|
1316 |
-
// If error storing permanently, unlink
|
1317 |
-
if ( is_wp_error( $id ) ) {
|
1318 |
-
|
1319 |
-
@unlink( $file_array['tmp_name'] );
|
1320 |
-
|
1321 |
-
return $id->get_error_message();
|
1322 |
-
}
|
1323 |
|
1324 |
unset( $image_data['caption'] );
|
1325 |
|
@@ -1348,7 +1377,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1348 |
"label" => __( "Instagram Username" ),
|
1349 |
"input" => "html",
|
1350 |
"html" => "<span style='line-height:31px'><a target='_blank' href='https://www.instagram.com/{$instagram_username}/'>{$instagram_username}</a></span>"
|
1351 |
-
|
1352 |
|
1353 |
$instagram_link = get_post_meta( $post->ID, 'jr_insta_link', true );
|
1354 |
if ( !empty( $instagram_link ) ) {
|
@@ -1356,7 +1385,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1356 |
"label" => __( "Instagram Image" ),
|
1357 |
"input" => "html",
|
1358 |
"html" => "<span style='line-height:31px'><a target='_blank' href='{$instagram_link}'>{$instagram_link}</a></span>"
|
1359 |
-
|
1360 |
}
|
1361 |
|
1362 |
$instagram_date = get_post_meta( $post->ID, 'jr_insta_timestamp', true );
|
@@ -1366,7 +1395,7 @@ class JR_InstagramSlider extends WP_Widget {
|
|
1366 |
"label" => __( "Posted on Instagram" ),
|
1367 |
"input" => "html",
|
1368 |
"html" => "<span style='line-height:31px'>{$instagram_date}</span>"
|
1369 |
-
|
1370 |
}
|
1371 |
}
|
1372 |
|
2 |
/*
|
3 |
Plugin Name: Instagram Slider Widget
|
4 |
Plugin URI: http://instagram.jrwebstudio.com/
|
5 |
+
Version: 1.4.1
|
6 |
Description: Instagram Slider Widget is a responsive slider widget that shows 12 latest images from a public Instagram user and up to 18 images from a hashtag.
|
7 |
Author: jetonr
|
8 |
Author URI: http://jrwebstudio.com/
|
14 |
*/
|
15 |
add_action( 'widgets_init', array( 'JR_InstagramSlider', 'register_widget' ) );
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
/**
|
18 |
* JR_InstagramSlider Class
|
19 |
*/
|
24 |
*
|
25 |
* @var string
|
26 |
*/
|
27 |
+
const VERSION = '1.4.1';
|
28 |
+
|
29 |
+
const USERNAME_URL = 'https://www.instagram.com/{username}/?__a=1';
|
30 |
+
|
31 |
+
const TAG_URL = 'https://www.instagram.com/explore/tags/{tag}/?__a=1';
|
32 |
|
33 |
/**
|
34 |
* Initialize the plugin by registering widget and loading public scripts
|
43 |
)
|
44 |
);
|
45 |
|
|
|
|
|
|
|
46 |
// Shortcode
|
47 |
add_shortcode( 'jr_instagram', array( $this, 'shortcode' ) );
|
48 |
|
62 |
add_filter( 'attachment_fields_to_edit', array( $this, 'insta_attachment_fields' ) , 10, 2 );
|
63 |
|
64 |
// Add action for single cron events
|
65 |
+
add_action( 'jr_insta_cron', array( $this, 'jr_cron_trigger' ), 10 , 3 );
|
66 |
}
|
67 |
|
68 |
/**
|
74 |
'name' => __( 'Instagram Slider - Shortcode Generator', 'jrinstaslider' ),
|
75 |
'id' => 'jr-insta-shortcodes',
|
76 |
'description' => __( "1. Drag Instagram Slider widget here. 2. Fill in the fields and hit save. 3. Copy the shortocde generated at the bottom of the widget form and use it on posts or pages.", 'jrinstaslider' )
|
77 |
+
)
|
78 |
+
);
|
79 |
}
|
80 |
|
81 |
/**
|
100 |
}
|
101 |
|
102 |
wp_enqueue_style( 'jr-insta-admin-styles', plugins_url( 'assets/css/jr-insta-admin.css', __FILE__ ), array(), self::VERSION );
|
103 |
+
wp_enqueue_script( 'jr-insta-admin-script', plugins_url( 'assets/js/jr-insta-admin.js', __FILE__ ), array( 'jquery' ), self::VERSION, true );
|
|
|
104 |
}
|
105 |
|
106 |
/**
|
186 |
'images_number' => 5,
|
187 |
'columns' => 4,
|
188 |
'refresh_hour' => 5,
|
189 |
+
'image_size' => 'standard',
|
190 |
'image_link_rel' => '',
|
191 |
'image_link_class' => '',
|
192 |
'no_pin' => 0,
|
196 |
'slidespeed' => 7000,
|
197 |
'description' => array( 'username', 'time','caption' ),
|
198 |
'support_author' => 0
|
199 |
+
);
|
200 |
|
201 |
$instance = wp_parse_args( (array) $instance, $defaults );
|
202 |
|
216 |
<input class="widefat" id="<?php echo $this->get_field_id( 'blocked_users' ); ?>" name="<?php echo $this->get_field_name( 'blocked_users' ); ?>" value="<?php echo $instance['blocked_users']; ?>" />
|
217 |
<span class="jr-description"><?php _e( 'Enter usernames separated by commas whose images you don\'t want to show', 'jrinstaslider' ); ?></span>
|
218 |
</p>
|
219 |
+
<p class="<?php if ( 'username' != $instance['search_for'] ) echo 'hidden'; ?>"><strong><?php _e( 'Save in Media Library: ', 'jrinstaslider' ); ?></strong>
|
220 |
<label class="switch" for="<?php echo $this->get_field_id( 'attachment' ); ?>">
|
221 |
<input class="widefat" id="<?php echo $this->get_field_id( 'attachment' ); ?>" name="<?php echo $this->get_field_name( 'attachment' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['attachment'] ); ?> /><span class="slider round"></span></label>
|
222 |
<br><span class="jr-description"><?php _e( ' Turn on to save Instagram Images into WordPress media library.', 'jrinstaslider') ?></span>
|
227 |
wp_nonce_field( 'jr_delete_instagram_dupes', 'delete_insta_dupes_nonce' );
|
228 |
}
|
229 |
?>
|
230 |
+
</p>
|
231 |
+
<p>
|
232 |
+
<label for="<?php echo $this->get_field_id( 'images_number' ); ?>"><strong><?php _e( 'Number of images to show:', 'jrinstaslider' ); ?></strong>
|
233 |
+
<input class="small-text" id="<?php echo $this->get_field_id( 'images_number' ); ?>" name="<?php echo $this->get_field_name( 'images_number' ); ?>" value="<?php echo $instance['images_number']; ?>" />
|
234 |
+
</label>
|
235 |
+
</p>
|
236 |
+
<p>
|
237 |
+
<label for="<?php echo $this->get_field_id( 'refresh_hour' ); ?>"><strong><?php _e( 'Check for new images every:', 'jrinstaslider' ); ?></strong>
|
238 |
+
<input class="small-text" id="<?php echo $this->get_field_id( 'refresh_hour' ); ?>" name="<?php echo $this->get_field_name( 'refresh_hour' ); ?>" value="<?php echo $instance['refresh_hour']; ?>" />
|
239 |
+
<span><?php _e('hours', 'jrinstaslider'); ?></span>
|
240 |
+
</label>
|
241 |
+
</p>
|
242 |
+
<p>
|
243 |
+
<label for="<?php echo $this->get_field_id( 'template' ); ?>"><strong><?php _e( 'Template', 'jrinstaslider' ); ?></strong>
|
244 |
+
<select class="widefat" name="<?php echo $this->get_field_name( 'template' ); ?>" id="<?php echo $this->get_field_id( 'template' ); ?>">
|
245 |
+
<option value="slider" <?php echo ($instance['template'] == 'slider') ? ' selected="selected"' : ''; ?>><?php _e( 'Slider - Normal', 'jrinstaslider' ); ?></option>
|
246 |
+
<option value="slider-overlay" <?php echo ($instance['template'] == 'slider-overlay') ? ' selected="selected"' : ''; ?>><?php _e( 'Slider - Overlay Text', 'jrinstaslider' ); ?></option>
|
247 |
+
<option value="thumbs" <?php echo ($instance['template'] == 'thumbs') ? ' selected="selected"' : ''; ?>><?php _e( 'Thumbnails', 'jrinstaslider' ); ?></option>
|
248 |
+
<option value="thumbs-no-border" <?php echo ($instance['template'] == 'thumbs-no-border') ? ' selected="selected"' : ''; ?>><?php _e( 'Thumbnails - Without Border', 'jrinstaslider' ); ?></option>
|
249 |
+
</select>
|
250 |
+
</label>
|
251 |
+
</p>
|
252 |
+
<p class="<?php if ( 'thumbs' != $instance['template'] && 'thumbs-no-border' != $instance['template'] ) echo 'hidden'; ?>">
|
253 |
+
<label for="<?php echo $this->get_field_id( 'columns' ); ?>"><strong><?php _e( 'Number of Columns:', 'jrinstaslider' ); ?></strong>
|
254 |
+
<input class="small-text" id="<?php echo $this->get_field_id( 'columns' ); ?>" name="<?php echo $this->get_field_name( 'columns' ); ?>" value="<?php echo $instance['columns']; ?>" />
|
255 |
+
<span class='jr-description'><?php _e('max is 10 ( only for thumbnails template )', 'jrinstaslider'); ?></span>
|
256 |
+
</label>
|
257 |
+
</p>
|
258 |
+
<p>
|
259 |
+
<label for="<?php echo $this->get_field_id( 'image_size' ); ?>"><strong><?php _e( 'Image format', 'jrinstaslider' ); ?></strong></label>
|
260 |
+
<select class="widefat" id="<?php echo $this->get_field_id( 'image_size' ); ?>" name="<?php echo $this->get_field_name( 'image_size' ); ?>">
|
261 |
+
<option value="thumbnail" <?php echo ($instance['image_size'] == 'thumbnail') ? ' selected="selected"' : ''; ?>><?php _e( 'Thumbnail - 150x150', 'jrinstaslider' ); ?></option>
|
262 |
+
<option value="low" <?php echo ($instance['image_size'] == 'low') ? ' selected="selected"' : ''; ?>><?php _e( 'Low - 320x320', 'jrinstaslider' ); ?></option>
|
263 |
+
<option value="standard" <?php echo ($instance['image_size'] == 'standard') ? ' selected="selected"' : ''; ?>><?php _e( 'Standard - 640x640', 'jrinstaslider' ); ?></option>
|
264 |
+
<option value="full" <?php echo ($instance['image_size'] == 'full') ? ' selected="selected"' : ''; ?>><?php _e( 'Full Size', 'jrinstaslider' ); ?></option>
|
265 |
+
</select>
|
266 |
+
<span class="jr-description"><?php _e( '<strong>Square - Cropped</strong> - option will show square cropped images in 640x640 pixels. <br/><strong>Original - No Crop</strong> - will display the original user uploaded image size.', 'jrinstaslider' ); ?></span>
|
267 |
+
</p>
|
268 |
+
<p>
|
269 |
+
<label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><strong><?php _e( 'Order by', 'jrinstaslider' ); ?></strong>
|
270 |
+
<select class="widefat" name="<?php echo $this->get_field_name( 'orderby' ); ?>" id="<?php echo $this->get_field_id( 'orderby' ); ?>">
|
271 |
+
<option value="date-ASC" <?php selected( $instance['orderby'], 'date-ASC', true); ?>><?php _e( 'Date - Ascending', 'jrinstaslider' ); ?></option>
|
272 |
+
<option value="date-DESC" <?php selected( $instance['orderby'], 'date-DESC', true); ?>><?php _e( 'Date - Descending', 'jrinstaslider' ); ?></option>
|
273 |
+
<option value="popular-ASC" <?php selected( $instance['orderby'], 'popular-ASC', true); ?>><?php _e( 'Popularity - Ascending', 'jrinstaslider' ); ?></option>
|
274 |
+
<option value="popular-DESC" <?php selected( $instance['orderby'], 'popular-DESC', true); ?>><?php _e( 'Popularity - Descending', 'jrinstaslider' ); ?></option>
|
275 |
+
<option value="rand" <?php selected( $instance['orderby'], 'rand', true); ?>><?php _e( 'Random', 'jrinstaslider' ); ?></option>
|
276 |
+
</select>
|
277 |
+
</label>
|
278 |
+
</p>
|
279 |
+
<p>
|
280 |
+
<label for="<?php echo $this->get_field_id( 'images_link' ); ?>"><strong><?php _e( 'Link to', 'jrinstaslider' ); ?></strong>
|
281 |
+
<select class="widefat" name="<?php echo $this->get_field_name( 'images_link' ); ?>" id="<?php echo $this->get_field_id( 'images_link' ); ?>">
|
282 |
+
<option value="image_link" <?php selected( $instance['images_link'], 'image_link', true); ?>><?php _e( 'Instagram Image', 'jrinstaslider' ); ?></option>
|
283 |
+
<option class="<?php if ( 'hashtag' == $instance['search_for'] ) echo 'hidden'; ?>" value="user_url" <?php selected( $instance['images_link'], 'user_url', true); ?>><?php _e( 'Instagram Profile', 'jrinstaslider' ); ?></option>
|
284 |
+
<option value="image_url" <?php selected( $instance['images_link'], 'image_url', true); ?>><?php _e( 'Image URL', 'jrinstaslider' ); ?></option>
|
285 |
+
<option class="<?php if ( ( !$instance['attachment'] ) || 'hashtag' == $instance['search_for'] ) echo 'hidden'; ?>" value="attachment" <?php selected( $instance['images_link'], 'attachment', true); ?>><?php _e( 'Attachment Page', 'jrinstaslider' ); ?></option>
|
286 |
+
<option value="custom_url" <?php selected( $instance['images_link'], 'custom_url', true ); ?>><?php _e( 'Custom Link', 'jrinstaslider' ); ?></option>
|
287 |
+
<option value="none" <?php selected( $instance['images_link'], 'none', true); ?>><?php _e( 'None', 'jrinstaslider' ); ?></option>
|
288 |
+
</select>
|
289 |
+
</label>
|
290 |
+
</p>
|
291 |
+
<p class="<?php if ( 'custom_url' != $instance['images_link'] ) echo 'hidden'; ?>">
|
292 |
+
<label for="<?php echo $this->get_field_id( 'custom_url' ); ?>"><?php _e( 'Custom link:', 'jrinstaslider'); ?></label>
|
293 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'custom_url' ); ?>" name="<?php echo $this->get_field_name( 'custom_url' ); ?>" value="<?php echo $instance['custom_url']; ?>" />
|
294 |
+
<span><?php _e('* use this field only if the above option is set to <strong>Custom Link</strong>', 'jrinstaslider'); ?></span>
|
295 |
+
</p>
|
296 |
+
<p>
|
297 |
+
<strong>Advanced Options</strong>
|
298 |
+
<?php
|
299 |
+
$advanced_class = '';
|
300 |
+
$advanced_text = '[ - Close ]';
|
301 |
+
if ( '' == trim( $instance['image_link_rel'] ) && '' == trim( $instance['image_link_class'] ) && '' == trim( $instance['image_size'] ) ) {
|
302 |
+
$advanced_class = 'hidden';
|
303 |
+
$advanced_text = '[ + Open ]';
|
304 |
+
}
|
305 |
+
?>
|
306 |
+
<a href="#" class="jr-advanced"><?php echo $advanced_text; ?></a>
|
307 |
+
</p>
|
308 |
+
<div class="jr-advanced-input <?php echo $advanced_class; ?>">
|
309 |
+
<div class="jr-image-options">
|
310 |
+
<h4 class="jr-advanced-title"><?php _e( 'Advanced Image Options', 'jrinstaslider'); ?></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
<p>
|
312 |
+
<label for="<?php echo $this->get_field_id( 'image_link_rel' ); ?>"><?php _e( 'Image Link rel attribute', 'jrinstaslider' ); ?>:</label>
|
313 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'image_link_rel' ); ?>" name="<?php echo $this->get_field_name( 'image_link_rel' ); ?>" value="<?php echo $instance['image_link_rel']; ?>" />
|
314 |
+
<span class="jr-description"><?php _e( 'Specifies the relationship between the current page and the linked website', 'jrinstaslider' ); ?></span>
|
|
|
315 |
</p>
|
316 |
<p>
|
317 |
+
<label for="<?php echo $this->get_field_id( 'image_link_class' ); ?>"><?php _e( 'Image Link class', 'jrinstaslider' ); ?>:</label>
|
318 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'image_link_class' ); ?>" name="<?php echo $this->get_field_name( 'image_link_class' ); ?>" value="<?php echo $instance['image_link_class']; ?>" />
|
319 |
+
<span class="jr-description"><?php _e( 'Usefull if you are using jQuery lightbox plugins to open links', 'jrinstaslider' ); ?></span>
|
320 |
</p>
|
321 |
+
<p><strong><?php _e( 'Disable Pinning:', 'jrinstaslider' ); ?></strong>
|
322 |
+
<label class="switch" for="<?php echo $this->get_field_id( 'no_pin' ); ?>">
|
323 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'no_pin' ); ?>" name="<?php echo $this->get_field_name( 'no_pin' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['no_pin'] ); ?> /><span class="slider round"></span></label>
|
324 |
+
<br><span class="jr-description"><?php _e( 'Disable pinning for Pinterest on all images from this widget!', 'jrinstaslider') ?></span>
|
325 |
+
</p>
|
326 |
+
</div>
|
327 |
+
<div class="jr-slider-options <?php if ( 'thumbs' == $instance['template'] || 'thumbs-no-border' == $instance['template'] ) echo 'hidden'; ?>">
|
328 |
+
<h4 class="jr-advanced-title"><?php _e( 'Advanced Slider Options', 'jrinstaslider'); ?></h4>
|
329 |
+
<p>
|
330 |
+
<?php _e( 'Slider Navigation Controls:', 'jrinstaslider' ); ?><br>
|
331 |
+
<label class="jr-radio"><input type="radio" id="<?php echo $this->get_field_id( 'controls' ); ?>" name="<?php echo $this->get_field_name( 'controls' ); ?>" value="prev_next" <?php checked( 'prev_next', $instance['controls'] ); ?> /> <?php _e( 'Prev & Next', 'jrinstaslider' ); ?></label>
|
332 |
+
<label class="jr-radio"><input type="radio" id="<?php echo $this->get_field_id( 'controls' ); ?>" name="<?php echo $this->get_field_name( 'controls' ); ?>" value="numberless" <?php checked( 'numberless', $instance['controls'] ); ?> /> <?php _e( 'Dotted', 'jrinstaslider' ); ?></label>
|
333 |
+
<label class="jr-radio"><input type="radio" id="<?php echo $this->get_field_id( 'controls' ); ?>" name="<?php echo $this->get_field_name( 'controls' ); ?>" value="none" <?php checked( 'none', $instance['controls'] ); ?> /> <?php _e( 'No Navigation', 'jrinstaslider' ); ?></label>
|
334 |
+
</p>
|
335 |
+
<p>
|
336 |
+
<?php _e( 'Slider Animation:', 'jrinstaslider' ); ?><br>
|
337 |
+
<label class="jr-radio"><input type="radio" id="<?php echo $this->get_field_id( 'animation' ); ?>" name="<?php echo $this->get_field_name( 'animation' ); ?>" value="slide" <?php checked( 'slide', $instance['animation'] ); ?> /> <?php _e( 'Slide', 'jrinstaslider' ); ?></label>
|
338 |
+
<label class="jr-radio"><input type="radio" id="<?php echo $this->get_field_id( 'animation' ); ?>" name="<?php echo $this->get_field_name( 'animation' ); ?>" value="fade" <?php checked( 'fade', $instance['animation'] ); ?> /> <?php _e( 'Fade', 'jrinstaslider' ); ?></label>
|
339 |
+
</p>
|
340 |
+
<p>
|
341 |
+
<label for="<?php echo $this->get_field_id( 'caption_words' ); ?>"><?php _e( 'Number of words in caption:', 'jrinstaslider' ); ?>
|
342 |
<input class="small-text" id="<?php echo $this->get_field_id( 'caption_words' ); ?>" name="<?php echo $this->get_field_name( 'caption_words' ); ?>" value="<?php echo $instance['caption_words']; ?>" />
|
343 |
</label>
|
344 |
</p>
|
345 |
<p>
|
346 |
<label for="<?php echo $this->get_field_id( 'slidespeed' ); ?>"><?php _e( 'Slide Speed:', 'jrinstaslider' ); ?>
|
347 |
+
<input class="small-text" id="<?php echo $this->get_field_id( 'slidespeed' ); ?>" name="<?php echo $this->get_field_name( 'slidespeed' ); ?>" value="<?php echo $instance['slidespeed']; ?>" />
|
348 |
+
<span><?php _e('milliseconds', 'jrinstaslider'); ?></span>
|
349 |
+
<span class='jr-description'><?php _e('1000 milliseconds = 1 second', 'jrinstaslider'); ?></span>
|
350 |
+
</label>
|
351 |
+
</p>
|
352 |
+
<p>
|
353 |
+
<label for="<?php echo $this->get_field_id('description'); ?>"><?php _e( 'Slider Text Description:', 'jrinstaslider' ); ?></label>
|
354 |
+
<select size=3 class='widefat' id="<?php echo $this->get_field_id('description'); ?>" name="<?php echo $this->get_field_name('description'); ?>[]" multiple="multiple">
|
355 |
+
<option class="<?php if ( 'hashtag' == $instance['search_for'] ) echo 'hidden'; ?>" value='username' <?php $this->selected( $instance['description'], 'username' ); ?>><?php _e( 'Username', 'jrinstaslider'); ?></option>
|
356 |
+
<option value='time'<?php $this->selected( $instance['description'], 'time' ); ?>><?php _e( 'Time', 'jrinstaslider'); ?></option>
|
357 |
+
<option value='caption'<?php $this->selected( $instance['description'], 'caption' ); ?>><?php _e( 'Caption', 'jrinstaslider'); ?></option>
|
358 |
+
</select>
|
359 |
+
<span class="jr-description"><?php _e( 'Hold ctrl and click the fields you want to show/hide on your slider. Leave all unselected to hide them all. Default all selected.', 'jrinstaslider') ?></span>
|
360 |
+
</p>
|
|
|
361 |
</div>
|
362 |
+
</div>
|
363 |
+
<?php $widget_id = preg_replace( '/[^0-9]/', '', $this->id ); if ( $widget_id != '' ) : ?>
|
364 |
+
<p>
|
365 |
+
<label for="jr_insta_shortcode"><?php _e('Shortcode of this Widget:', 'jrinstaslider'); ?></label>
|
366 |
+
<input id="jr_insta_shortcode" onclick="this.setSelectionRange(0, this.value.length)" type="text" class="widefat" value="[jr_instagram id="<?php echo $widget_id ?>"]" readonly="readonly" style="border:none; color:black; font-family:monospace;">
|
367 |
+
<span class="jr-description"><?php _e( 'Use this shortcode in any page or post to display images with this widget configuration!', 'jrinstaslider') ?></span>
|
368 |
+
</p>
|
369 |
+
<?php endif; ?>
|
370 |
+
<div class="jr-advanced-input">
|
371 |
+
<div class="jr-image-options">
|
372 |
+
<h4 class="jr-advanced-title"><?php _e( 'Help us, help you!', 'jrinstaslider'); ?></h4>
|
373 |
<p><strong><?php _e( 'Show "Powered by Link"', 'jrinstaslider' ); ?></strong>
|
374 |
<label class="switch" for="<?php echo $this->get_field_id( 'support_author' ); ?>">
|
375 |
<input class="widefat" id="<?php echo $this->get_field_id( 'support_author' ); ?>" name="<?php echo $this->get_field_name( 'support_author' ); ?>" type="checkbox" value="1" <?php checked( '1', $instance['support_author'] ); ?> /><span class="slider round"></span></label>
|
376 |
<br><span class="jr-description"><?php _e( 'When enabled, the author is notified and a backlink website is visible at the bottom of the plugin. <br> <strong>If you enable this option you will have privileged support from our team!</strong>', 'jrinstaslider') ?></span>
|
377 |
</p>
|
378 |
+
<div class="donate-buttons">
|
379 |
+
<img class="donate-button-link" src="http://ef3ae845b6eed6ec4024-8a0a46e5f1a5cc9854958bc3503f0f88.r40.cf1.rackcdn.com/donate_64.png" alt="Donate Ƀitcoin" />
|
380 |
+
<span class="donate-bitcoin-qr-address">
|
381 |
+
<p><strong>Scan the QR Code bellow with your wallet application, and donate only one Bitcoin :)</strong></p>
|
382 |
+
<span class="wallet-number">My Address: <code>1AeyXnxvFpL7paTjAwCkkTPG9YexGRKXUt</code></span>
|
383 |
+
<img src="https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=1AeyXnxvFpL7paTjAwCkkTPG9YexGRKXUt">
|
384 |
+
</span>
|
385 |
+
<a target="_blank" title="Donate with Paypal!" href="http://bit.ly/2EseW2p"><p class="donate"><span></span>Donate with Paypal!</p></a>
|
386 |
+
</div>
|
387 |
+
</div></div>
|
388 |
+
</div><br>
|
389 |
+
<?php
|
390 |
+
}
|
391 |
|
392 |
/**
|
393 |
* Selected array function echoes selected if in array
|
420 |
}
|
421 |
}
|
422 |
|
423 |
+
/**
|
424 |
+
* Echoes the Display Instagram Images method
|
425 |
+
*
|
426 |
+
* @param array $args
|
427 |
+
*
|
428 |
+
* @return void
|
429 |
+
*/
|
430 |
+
public function instagram_images( $args ) {
|
431 |
+
echo $this->display_images( $args );
|
432 |
+
}
|
433 |
|
434 |
/**
|
435 |
* Cron Trigger Function
|
439 |
* @return [type] [description]
|
440 |
*/
|
441 |
public function jr_cron_trigger( $username, $refresh_hour, $images ) {
|
442 |
+
$search_for = array();
|
443 |
$search_for['username'] = $username;
|
444 |
$this->instagram_data( $search_for, $refresh_hour, $images, true );
|
445 |
}
|
446 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
447 |
/**
|
448 |
* Runs the query for images and returns the html
|
449 |
*
|
459 |
$attachment = isset( $args['attachment'] ) ? true : false;
|
460 |
$template = isset( $args['template'] ) ? $args['template'] : 'slider';
|
461 |
$orderby = isset( $args['orderby'] ) ? $args['orderby'] : 'rand';
|
462 |
+
$images_link = isset( $args['images_link'] ) ? $args['images_link'] : 'image_url';
|
463 |
$custom_url = isset( $args['custom_url'] ) ? $args['custom_url'] : '';
|
464 |
$images_number = isset( $args['images_number'] ) ? absint( $args['images_number'] ) : 5;
|
465 |
$columns = isset( $args['columns'] ) ? absint( $args['columns'] ) : 4;
|
466 |
$refresh_hour = isset( $args['refresh_hour'] ) ? absint( $args['refresh_hour'] ) : 5;
|
467 |
+
$image_size = isset( $args['image_size'] ) ? $args['image_size'] : 'standard';
|
468 |
$image_link_rel = isset( $args['image_link_rel'] ) ? $args['image_link_rel'] : '';
|
469 |
$no_pin = isset( $args['no_pin'] ) ? $args['no_pin'] : 0;
|
470 |
$image_link_class = isset( $args['image_link_class'] ) ? $args['image_link_class'] : '';
|
501 |
'link_class' => $image_link_class,
|
502 |
'no_pin' => $no_pin,
|
503 |
'caption_words' => $caption_words
|
504 |
+
);
|
505 |
|
506 |
$images_div_class = 'jr-insta-thumb';
|
507 |
$ul_class = ( $template == 'thumbs-no-border' ) ? 'thumbnails no-border jr_col_' . $columns : 'thumbnails jr_col_' . $columns;
|
563 |
$output = __( 'No images found! <br> Try some other hashtag or username', 'jrinstaslider' );
|
564 |
|
565 |
if ( ( $search == 'user' && $attachment ) ) {
|
566 |
+
|
567 |
+
if ( !wp_next_scheduled( 'jr_insta_cron', array( $search_for['username'], $refresh_hour, $images_number ) ) ) {
|
568 |
+
wp_schedule_single_event( time(), 'jr_insta_cron', array( $search_for['username'], $refresh_hour, $images_number ) );
|
|
|
|
|
|
|
|
|
569 |
}
|
570 |
|
571 |
$opt_name = 'jr_insta_' . md5( $search . '_' . $search_for['username'] );
|
577 |
'post_mime_type' => 'image',
|
578 |
'posts_per_page' => $images_number,
|
579 |
'no_found_rows' => true
|
580 |
+
);
|
581 |
|
582 |
if ( $orderby != 'rand' ) {
|
583 |
|
588 |
$query_args['orderby'] = 'meta_value_num';
|
589 |
$query_args['order'] = $orderby[1];
|
590 |
}
|
591 |
+
|
592 |
+
if ( isset( $attachment_ids['saved_images'] ) && !empty( $attachment_ids['saved_images'] ) ) {
|
593 |
|
594 |
$query_args['post__in'] = $attachment_ids['saved_images'];
|
595 |
|
600 |
'key' => 'jr_insta_username',
|
601 |
'value' => $username,
|
602 |
'compare' => '='
|
603 |
+
)
|
604 |
+
);
|
605 |
}
|
606 |
|
607 |
$instagram_images = new WP_Query( $query_args );
|
612 |
|
613 |
while ( $instagram_images->have_posts() ) : $instagram_images->the_post();
|
614 |
|
615 |
+
$id = get_the_id();
|
616 |
+
|
617 |
+
if ( 'image_link' == $images_link ) {
|
618 |
+
$template_args['link_to'] = get_post_meta( $id, 'jr_insta_link', true );
|
619 |
+
} elseif ( 'user_url' == $images_link ) {
|
620 |
+
$template_args['link_to'] = 'https://www.instagram.com/' . $username . '/';
|
621 |
+
} elseif ( 'image_url' == $images_link ) {
|
622 |
+
$template_args['link_to'] = wp_get_attachment_url( $id );
|
623 |
+
} elseif ( 'attachment' == $images_link ) {
|
624 |
+
$template_args['link_to'] = get_permalink( $id );
|
625 |
+
} elseif ( 'custom_url' == $images_link ) {
|
626 |
+
$template_args['link_to'] = $custom_url;
|
627 |
+
}
|
628 |
+
|
629 |
+
$image_thumb_url = get_post_meta( $id, 'jr_insta_sizes', true );
|
630 |
+
$template_args['image'] = $image_thumb_url[$image_size];
|
631 |
|
632 |
+
$output .= $this->get_template( $template, $template_args );
|
633 |
|
634 |
endwhile;
|
635 |
|
656 |
|
657 |
foreach ( $images_data as $image_data ) {
|
658 |
|
659 |
+
if ( 'image_link' == $images_link ) {
|
660 |
$template_args['link_to'] = $image_data['link'];
|
661 |
} elseif ( 'user_url' == $images_link ) {
|
662 |
$template_args['link_to'] = 'https://www.instagram.com/' . $username . '/';
|
663 |
+
} elseif ( 'image_url' == $images_link ) {
|
664 |
+
$template_args['link_to'] = $image_data['url'];
|
665 |
} elseif ( 'custom_url' == $images_link ) {
|
666 |
$template_args['link_to'] = $custom_url;
|
667 |
}
|
668 |
|
669 |
+
$template_args['image'] = $image_data['sizes'][$image_size];
|
670 |
+
$template_args['caption'] = $image_data['caption'];
|
671 |
+
$template_args['timestamp'] = $image_data['timestamp'];
|
672 |
+
$template_args['username'] = $image_data['username'];
|
673 |
+
$template_args['attachment'] = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
|
675 |
$output .= $this->get_template( $template, $template_args );
|
676 |
}
|
704 |
|
705 |
foreach ( $images_data as $image_data ) {
|
706 |
|
707 |
+
if ( 'image_link' == $images_link ) {
|
708 |
$template_args['link_to'] = $image_data['link'];
|
709 |
} elseif ( 'user_url' == $images_link ) {
|
710 |
$template_args['link_to'] = 'https://www.instagram.com/' . $username . '/';
|
711 |
+
} elseif ( 'image_url' == $images_link ) {
|
712 |
+
$template_args['link_to'] = $image_data['url'];
|
713 |
} elseif ( 'custom_url' == $images_link ) {
|
714 |
$template_args['link_to'] = $custom_url;
|
715 |
}
|
716 |
|
717 |
+
$template_args['image'] = $image_data['sizes'][$image_size];
|
718 |
+
$template_args['caption'] = $image_data['caption'];
|
719 |
+
$template_args['timestamp'] = $image_data['timestamp'];
|
720 |
+
$template_args['username'] = $image_data['username'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
721 |
|
722 |
$output .= $this->get_template( $template, $template_args );
|
723 |
}
|
742 |
private function get_template( $template, $args ) {
|
743 |
|
744 |
$link_to = isset( $args['link_to'] ) ? $args['link_to'] : false;
|
745 |
+
$image_url = isset( $args['image'] ) ? $args['image'] : false;
|
746 |
|
747 |
if ( ( $args['search_for'] == 'user' && $args['attachment'] !== true ) || $args['search_for'] == 'hashtag' ) {
|
748 |
$caption = $args['caption'];
|
749 |
$time = $args['timestamp'];
|
750 |
$username = $args['username'];
|
|
|
751 |
} else {
|
752 |
$attach_id = get_the_id();
|
753 |
$caption = get_the_excerpt();
|
754 |
$time = get_post_meta( $attach_id, 'jr_insta_timestamp', true );
|
755 |
$username = get_post_meta( $attach_id, 'jr_insta_username', true );
|
|
|
|
|
756 |
}
|
757 |
|
758 |
+
$short_caption = wp_trim_words( $caption, 10, '' );
|
759 |
$short_caption = preg_replace("/[^A-Za-z0-9?! ]/","", $short_caption);
|
760 |
+
$caption = wp_trim_words( $caption, $args['caption_words'], '' );
|
761 |
$nopin = ( 1 == $args['no_pin'] ) ? 'nopin="nopin"' : '';
|
762 |
|
763 |
$image_src = '<img src="' . $image_url . '" alt="' . $short_caption . '" title="' . $short_caption . '" '. $nopin . '/>';
|
907 |
function powered_by_link( $support_author ) {
|
908 |
|
909 |
if ( $support_author ) {
|
|
|
910 |
$link = $this->domain_data();
|
911 |
|
912 |
if ( isset( $link['text'] ) && !empty( $link['text'] ) && isset( $link['domain'] ) && !empty( $link['domain'] ) ) {
|
913 |
+
$link = '<div style="clear:both;text-align:right;font-size:10px;" >Powered by <a href="'.$link['domain'].'" target="_blank">'.$link['text'].'</a></div>';
|
914 |
} else if ( isset( $link['text'] ) && !empty( $link['text'] ) ) {
|
915 |
+
$link = '<div style="clear:both;text-align:right;font-size:10px;" >Powered by '.$link['text'].'</div>';
|
916 |
} else {
|
917 |
$link = '';
|
918 |
}
|
934 |
*/
|
935 |
private function instagram_data( $search_for, $cache_hours, $nr_images, $attachment ) {
|
936 |
|
937 |
+
$nr_images = $nr_images <= 12 ? $nr_images : 12;
|
938 |
$blocked_users = isset( $search_for['blocked_users'] ) && !empty( $search_for['blocked_users'] ) ? $search_for['blocked_users'] : false;
|
939 |
if ( isset( $search_for['username'] ) && !empty( $search_for['username'] ) ) {
|
940 |
$search = 'user';
|
957 |
'cache_hours' => $cache_hours,
|
958 |
'nr_images' => $nr_images,
|
959 |
'attachment' => $attachment
|
960 |
+
);
|
961 |
|
962 |
if ( true === $this->trigger_refresh_data( $instaData, $old_opts, $new_opts ) ) {
|
963 |
|
968 |
$old_opts['cache_hours'] = $cache_hours;
|
969 |
$old_opts['nr_images'] = $nr_images;
|
970 |
$old_opts['attachment'] = $attachment;
|
971 |
+
|
972 |
if ( 'user' == $search ) {
|
973 |
+
$url = str_replace( '{username}', urlencode( trim( $search_string ) ), self::USERNAME_URL );
|
974 |
+
$response = wp_remote_get( $url, array( 'sslverify' => false, 'timeout' => 60 ) );
|
975 |
} else {
|
976 |
+
$url = str_replace( '{tag}', urlencode( trim( $search_string ) ), self::TAG_URL );
|
977 |
+
$response = wp_remote_get( $url, array( 'sslverify' => false, 'timeout' => 60 ) );
|
978 |
|
979 |
}
|
980 |
|
984 |
}
|
985 |
|
986 |
if ( $response['response']['code'] == 200 ) {
|
987 |
+
|
988 |
+
$results = json_decode( $response['body'], true );
|
989 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
990 |
if ( $results && is_array( $results ) ) {
|
991 |
|
992 |
if ( 'user' == $search ) {
|
993 |
+
$entry_data = isset( $results['user']['media']['nodes'] ) ? $results['user']['media']['nodes'] : array();
|
994 |
} else {
|
995 |
+
$entry_data = isset( $results['graphql']['hashtag']['edge_hashtag_to_media']['edges'] ) ? $results['graphql']['hashtag']['edge_hashtag_to_media']['edges'] : array();
|
996 |
}
|
997 |
|
998 |
|
999 |
if ( empty( $entry_data ) ) {
|
1000 |
return __( 'No images found', 'jrinstaslider');
|
1001 |
}
|
|
|
|
|
|
|
|
|
1002 |
|
1003 |
+
foreach ( $entry_data as $current => $result ) {
|
|
|
|
|
|
|
1004 |
|
1005 |
if ( 'hashtag' == $search ) {
|
1006 |
+
|
1007 |
+
$result = $result['node'];
|
1008 |
+
|
1009 |
if ( in_array( $result['owner']['id'], $blocked_users_array ) ) {
|
1010 |
$nr_images++;
|
1011 |
continue;
|
1012 |
+
}
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
if ( $result['is_video'] == true ) {
|
1016 |
+
$nr_images++;
|
1017 |
+
continue;
|
1018 |
}
|
1019 |
|
1020 |
+
|
1021 |
if ( $current >= $nr_images ) {
|
1022 |
break;
|
1023 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1024 |
|
1025 |
+
$image_data = $this->media_model( $result );
|
1026 |
+
|
1027 |
+
if ( 'user' == $search ) {
|
1028 |
+
$image_data['username'] = $search_string;
|
1029 |
+
}
|
1030 |
+
|
1031 |
if ( ( $search == 'hashtag' ) || ( $search == 'user' && !$attachment ) ) {
|
1032 |
|
1033 |
$instaData[] = $image_data;
|
1041 |
$this->update_wp_attachment( $old_opts['saved_images'][$image_data['id']], $image_data );
|
1042 |
|
1043 |
$instaData[$image_data['id']] = $old_opts['saved_images'][$image_data['id']];
|
1044 |
+
|
1045 |
+
} else {
|
1046 |
+
unset( $old_opts['saved_images'][$image_data['id']] );
|
1047 |
+
}
|
1048 |
|
1049 |
} else {
|
1050 |
|
1087 |
return $instaData;
|
1088 |
}
|
1089 |
|
1090 |
+
|
1091 |
+
/**
|
1092 |
+
* @param string $imageUrl
|
1093 |
+
*
|
1094 |
+
* @return array
|
1095 |
+
*/
|
1096 |
+
private function get_thumbnail_urls( $thumbnails ) {
|
1097 |
+
|
1098 |
+
$image_thumbnails = array();
|
1099 |
+
|
1100 |
+
foreach ( $thumbnails as $thumbnail ) {
|
1101 |
+
|
1102 |
+
switch ( $thumbnail['config_width'] ) {
|
1103 |
+
case '150':
|
1104 |
+
$image_thumbnails['thumbnail'] = $thumbnail['src'];
|
1105 |
+
break;
|
1106 |
+
case '320':
|
1107 |
+
$image_thumbnails['low'] = $thumbnail['src'];
|
1108 |
+
break;
|
1109 |
+
case '640':
|
1110 |
+
$image_thumbnails['standard'] = $thumbnail['src'];
|
1111 |
+
break;
|
1112 |
+
}
|
1113 |
+
}
|
1114 |
+
|
1115 |
+
return $image_thumbnails;
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
|
1119 |
+
/**
|
1120 |
+
* Media Model
|
1121 |
+
* @param [type] $medias_array [description]
|
1122 |
+
* @return [type] [description]
|
1123 |
+
*/
|
1124 |
+
private function media_model( $medias_array ) {
|
1125 |
+
|
1126 |
+
$medias_model = array();
|
1127 |
+
|
1128 |
+
foreach ( $medias_array as $prop => $value ) {
|
1129 |
+
|
1130 |
+
switch ( $prop ) {
|
1131 |
+
case 'id':
|
1132 |
+
$medias_model['id'] = $value;
|
1133 |
+
break;
|
1134 |
+
case 'code':
|
1135 |
+
case 'shortcode':
|
1136 |
+
$medias_model['code'] = $value;
|
1137 |
+
$medias_model['link'] = 'https://www.instagram.com/p/'. $value . '/';
|
1138 |
+
break;
|
1139 |
+
case 'owner':
|
1140 |
+
$medias_model['user_id'] = $value['id'];
|
1141 |
+
break;
|
1142 |
+
case 'caption':
|
1143 |
+
$medias_model['caption'] = $this->sanitize( $value );
|
1144 |
+
break;
|
1145 |
+
case 'edge_media_to_caption':
|
1146 |
+
if ( !empty( $value['edges'] ) ) {
|
1147 |
+
$first_caption = $value['edges'][0];
|
1148 |
+
if ( isset( $first_caption['node']['text'] ) ) {
|
1149 |
+
$medias_model['caption'] = $this->sanitize( $value['edges'][0]['node']['text'] );
|
1150 |
+
}
|
1151 |
+
}
|
1152 |
+
break;
|
1153 |
+
case 'date':
|
1154 |
+
case 'taken_at_timestamp':
|
1155 |
+
$medias_model['timestamp'] = (float) $value;
|
1156 |
+
break;
|
1157 |
+
case 'dimensions':
|
1158 |
+
$medias_model['height'] = $value['height'];
|
1159 |
+
$medias_model['width'] = $value['width'];
|
1160 |
+
break;
|
1161 |
+
case 'display_url':
|
1162 |
+
case 'display_src':
|
1163 |
+
$medias_model['url'] = $value;
|
1164 |
+
if ( isset( $medias_model['sizes'] ) ) {
|
1165 |
+
$medias_model['sizes']['full'] = $value;
|
1166 |
+
}
|
1167 |
+
break;
|
1168 |
+
case 'edge_liked_by':
|
1169 |
+
case 'likes':
|
1170 |
+
$medias_model['likes_count'] = $value['count'];
|
1171 |
+
break;
|
1172 |
+
case 'edge_media_to_comment':
|
1173 |
+
case 'comments':
|
1174 |
+
$medias_model['comment_count'] = $value['count'];
|
1175 |
+
break;
|
1176 |
+
case 'thumbnail_resources':
|
1177 |
+
$medias_model['sizes'] = $this->get_thumbnail_urls( $value );
|
1178 |
+
if ( isset( $medias_model['url'] ) ) {
|
1179 |
+
$medias_model['sizes']['full'] = $medias_model['url'];
|
1180 |
+
}
|
1181 |
+
break;
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
if ( isset( $medias_model['comment_count'] ) && isset( $medias_model['likes_count'] ) ) {
|
1185 |
+
$medias_model['popularity'] = (int) ( $medias_model['comment_count'] ) + ( $medias_model['likes_count'] );
|
1186 |
+
}
|
1187 |
+
}
|
1188 |
+
|
1189 |
+
return $medias_model;
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
|
1193 |
/**
|
1194 |
* Remove Duplicates
|
1195 |
* @return [type] [description]
|
1207 |
'key' => 'jr_insta_username',
|
1208 |
'compare' => '=',
|
1209 |
'value' => $username
|
|
|
1210 |
),
|
1211 |
+
),
|
1212 |
+
);
|
1213 |
|
1214 |
$savedinsta = new WP_Query( $savedinsta_args );
|
1215 |
|
1247 |
$post = $_POST;
|
1248 |
$return = array(
|
1249 |
'deleted' => $this->clean_duplicates( $post['username'] )
|
1250 |
+
);
|
1251 |
|
1252 |
wp_send_json( $return );
|
1253 |
}
|
1270 |
if ( isset( $user_ids[$user] ) ) {
|
1271 |
continue;
|
1272 |
}
|
1273 |
+
|
1274 |
+
$url = str_replace( '{username}', urlencode( trim( $user ) ), self::USERNAME_URL );
|
1275 |
+
$response = wp_remote_get( $url, array( 'sslverify' => false, 'timeout' => 60 ) );
|
1276 |
|
1277 |
if ( is_wp_error( $response ) ) {
|
1278 |
|
1281 |
|
1282 |
if ( $response['response']['code'] == 200 ) {
|
1283 |
|
1284 |
+
$results = json_decode( $response['body'], true );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1285 |
|
1286 |
if ( $results && is_array( $results ) ) {
|
1287 |
|
1288 |
+
$user_id = isset( $results['user']['id'] ) ? $results['user']['id'] : false;
|
1289 |
|
1290 |
if ( $user_id ) {
|
1291 |
|
1314 |
* @param array image_data
|
1315 |
* @return void
|
1316 |
*/
|
1317 |
+
private function update_wp_attachment( $attachment_ID, $image_data ) {
|
|
|
1318 |
update_post_meta( $attachment_ID, 'jr_insta_popularity', $image_data['popularity'] );
|
1319 |
+
update_post_meta( $attachment_ID, 'jr_insta_likes_count', $image_data['likes_count'] );
|
1320 |
+
update_post_meta( $attachment_ID, 'jr_insta_comment_count', $image_data['comment_count'] );
|
1321 |
}
|
1322 |
|
1323 |
/**
|
1331 |
*/
|
1332 |
private function save_wp_attachment( $image_data ) {
|
1333 |
|
1334 |
+
$image_info = pathinfo( $image_data['url'] );
|
|
|
|
|
|
|
1335 |
|
1336 |
+
if ( !in_array( $image_info['extension'], array( 'jpg', 'jpe', 'jpeg' ) ) ) {
|
1337 |
return false;
|
1338 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1339 |
|
1340 |
+
$attachment = array(
|
1341 |
+
'guid' => $image_data['url'],
|
1342 |
+
'post_mime_type' => 'image/jpeg',
|
1343 |
+
'post_title' => preg_replace( '/\.[^.]+$/', '', $image_info['basename'] ),
|
1344 |
+
'post_excerpt' => $image_data['caption']
|
1345 |
+
);
|
1346 |
|
1347 |
+
$attachment_metadata = array( 'width' => $image_data['width'], 'height' => $image_data['height'], 'file' => $image_info['basename'] );
|
1348 |
+
$attachment_metadata['sizes'] = array( 'full' => $attachment_metadata );
|
1349 |
+
$id = wp_insert_attachment( $attachment );
|
1350 |
+
wp_update_attachment_metadata( $id, $attachment_metadata );
|
|
|
1351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1352 |
|
1353 |
unset( $image_data['caption'] );
|
1354 |
|
1377 |
"label" => __( "Instagram Username" ),
|
1378 |
"input" => "html",
|
1379 |
"html" => "<span style='line-height:31px'><a target='_blank' href='https://www.instagram.com/{$instagram_username}/'>{$instagram_username}</a></span>"
|
1380 |
+
);
|
1381 |
|
1382 |
$instagram_link = get_post_meta( $post->ID, 'jr_insta_link', true );
|
1383 |
if ( !empty( $instagram_link ) ) {
|
1385 |
"label" => __( "Instagram Image" ),
|
1386 |
"input" => "html",
|
1387 |
"html" => "<span style='line-height:31px'><a target='_blank' href='{$instagram_link}'>{$instagram_link}</a></span>"
|
1388 |
+
);
|
1389 |
}
|
1390 |
|
1391 |
$instagram_date = get_post_meta( $post->ID, 'jr_insta_timestamp', true );
|
1395 |
"label" => __( "Posted on Instagram" ),
|
1396 |
"input" => "html",
|
1397 |
"html" => "<span style='line-height:31px'>{$instagram_date}</span>"
|
1398 |
+
);
|
1399 |
}
|
1400 |
}
|
1401 |
|
readme.txt
CHANGED
@@ -7,10 +7,10 @@ Tested up to: 4.7.2
|
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
-
Instagram Slider Widget is a responsive slider widget that shows 12 latest images from a public instagram user or
|
11 |
|
12 |
== Description ==
|
13 |
-
= Instagram Slider Widget is a responsive slider widget that shows 12 latest images from a public instagram user or
|
14 |
|
15 |
|
16 |
= Features =
|
@@ -22,7 +22,7 @@ Instagram Slider Widget is a responsive slider widget that shows 12 latest image
|
|
22 |
* For more info visit http://instagram.jrwebstudio.com
|
23 |
|
24 |
= Where can I get support =
|
25 |
-
I will try to respond to all on plugin support forum but users
|
26 |
|
27 |
= If you like this plugin. Rate it and Donate =
|
28 |
|
@@ -45,6 +45,11 @@ I will try to respond to all on plugin support forum but users showing back-link
|
|
45 |
3. Backend Configuration
|
46 |
|
47 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
48 |
= 1.4.0 =
|
49 |
* Fixed the issue where duplicate images were being inserted into Media Library
|
50 |
* Added a button in widget to remove previously created duplicate images
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
+
Instagram Slider Widget is a responsive slider widget that shows 12 latest images from a public instagram user or a hashtag.
|
11 |
|
12 |
== Description ==
|
13 |
+
= Instagram Slider Widget is a responsive slider widget that shows 12 latest images from a public instagram user or a hashtag. =
|
14 |
|
15 |
|
16 |
= Features =
|
22 |
* For more info visit http://instagram.jrwebstudio.com
|
23 |
|
24 |
= Where can I get support =
|
25 |
+
I will try to respond to all on plugin support forum but users who opt-in to send data usage will be more privileged!
|
26 |
|
27 |
= If you like this plugin. Rate it and Donate =
|
28 |
|
45 |
3. Backend Configuration
|
46 |
|
47 |
== Changelog ==
|
48 |
+
= 1.4.1 =
|
49 |
+
* Fixed Instagram update that stoped hashtags from working
|
50 |
+
* Fixed hellip that showed when using wp trim words
|
51 |
+
* Modified the function that saved images localy to only save as attachments
|
52 |
+
|
53 |
= 1.4.0 =
|
54 |
* Fixed the issue where duplicate images were being inserted into Media Library
|
55 |
* Added a button in widget to remove previously created duplicate images
|