Version Description
- Local thumbnail cache
Download this release
Release Info
Developer | designemotions |
Plugin | Enjoy Instagram feed on website with WordPress Widget and Shortcode |
Version | 5.2.0 |
Comparing to | |
See all releases |
Code changes from version 5.1.0 to 5.2.0
- enjoyinstagram.php +3 -2
- includes/class.enjoyinstagram-admin.php +1 -0
- includes/class.enjoyinstagram-api-connection.php +1 -1
- includes/class.enjoyinstagram-db.php +13 -11
- includes/class.enjoyinstagram-shortcodes.php +14 -0
- includes/class.enjoyinstagram.php +26 -0
- includes/functions.enjoyinstagram.php +109 -0
- index.php +0 -2
- readme.txt +5 -5
- templates/admin/diagnostic.php +5 -1
enjoyinstagram.php
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
* Plugin Name: Enjoy Instagram
|
12 |
* Plugin URI: https://www.mediabetaprojects.com/enjoy-instagram-premium/
|
13 |
* Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
|
14 |
-
* Version: 5.
|
15 |
* Requires at least: 4.0
|
16 |
* Requires PHP: 7.2
|
17 |
* Author: Mediabeta Srl
|
@@ -22,7 +22,7 @@
|
|
22 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
23 |
*/
|
24 |
|
25 |
-
! defined( 'ENJOYINSTAGRAM_VERSION' ) && define( 'ENJOYINSTAGRAM_VERSION', '5.
|
26 |
! defined( 'ENJOYINSTAGRAM_FILE' ) && define( 'ENJOYINSTAGRAM_FILE', __FILE__ );
|
27 |
! defined( 'ENJOYINSTAGRAM_URL' ) && define( 'ENJOYINSTAGRAM_URL', plugin_dir_url( __FILE__ ) );
|
28 |
! defined( 'ENJOYINSTAGRAM_DIR' ) && define( 'ENJOYINSTAGRAM_DIR', plugin_dir_path( __FILE__ ) );
|
@@ -32,6 +32,7 @@
|
|
32 |
! defined( 'ENJOYINSTAGRAM_APP_ID' ) && define( 'ENJOYINSTAGRAM_APP_ID', '1367115243477960' );
|
33 |
! defined( 'ENJOYINSTAGRAM_GRAPH_API_REDIRECT' ) && define( 'ENJOYINSTAGRAM_GRAPH_API_REDIRECT', 'https://www.mediabetaprojects.com/enjoy-instagram-api/graph-api-redirect.php' );
|
34 |
! defined( 'ENJOYINSTAGRAM_BASIC_DISPLAY_API_REDIRECT' ) && define( 'ENJOYINSTAGRAM_BASIC_DISPLAY_API_REDIRECT', 'https://www.mediabetaprojects.com/enjoy-instagram-api/basic-display-redirect.php' );
|
|
|
35 |
|
36 |
register_activation_hook( __FILE__, 'enjoyinstagram_require_activation_class' );
|
37 |
function enjoyinstagram_require_activation_class() {
|
11 |
* Plugin Name: Enjoy Instagram
|
12 |
* Plugin URI: https://www.mediabetaprojects.com/enjoy-instagram-premium/
|
13 |
* Description: Instagram Responsive Images Gallery and Carousel, works with Shortcodes and Widgets.
|
14 |
+
* Version: 5.2.0
|
15 |
* Requires at least: 4.0
|
16 |
* Requires PHP: 7.2
|
17 |
* Author: Mediabeta Srl
|
22 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
23 |
*/
|
24 |
|
25 |
+
! defined( 'ENJOYINSTAGRAM_VERSION' ) && define( 'ENJOYINSTAGRAM_VERSION', '5.2.0' );
|
26 |
! defined( 'ENJOYINSTAGRAM_FILE' ) && define( 'ENJOYINSTAGRAM_FILE', __FILE__ );
|
27 |
! defined( 'ENJOYINSTAGRAM_URL' ) && define( 'ENJOYINSTAGRAM_URL', plugin_dir_url( __FILE__ ) );
|
28 |
! defined( 'ENJOYINSTAGRAM_DIR' ) && define( 'ENJOYINSTAGRAM_DIR', plugin_dir_path( __FILE__ ) );
|
32 |
! defined( 'ENJOYINSTAGRAM_APP_ID' ) && define( 'ENJOYINSTAGRAM_APP_ID', '1367115243477960' );
|
33 |
! defined( 'ENJOYINSTAGRAM_GRAPH_API_REDIRECT' ) && define( 'ENJOYINSTAGRAM_GRAPH_API_REDIRECT', 'https://www.mediabetaprojects.com/enjoy-instagram-api/graph-api-redirect.php' );
|
34 |
! defined( 'ENJOYINSTAGRAM_BASIC_DISPLAY_API_REDIRECT' ) && define( 'ENJOYINSTAGRAM_BASIC_DISPLAY_API_REDIRECT', 'https://www.mediabetaprojects.com/enjoy-instagram-api/basic-display-redirect.php' );
|
35 |
+
! defined( 'ENJOYINSTAGRAM_CACHE_DIR_NAME' ) && define( 'ENJOYINSTAGRAM_CACHE_DIR_NAME', 'ei-cache' );
|
36 |
|
37 |
register_activation_hook( __FILE__, 'enjoyinstagram_require_activation_class' );
|
38 |
function enjoyinstagram_require_activation_class() {
|
includes/class.enjoyinstagram-admin.php
CHANGED
@@ -430,6 +430,7 @@ class EnjoyInstagram_Admin {
|
|
430 |
|
431 |
$id = trim( $_GET['user_id'] );
|
432 |
EnjoyInstagram_DB()->delete_media_by_user( $id );
|
|
|
433 |
|
434 |
// redirect to main settings page
|
435 |
wp_redirect( $this->build_admin_url( 'users-settings' ) );
|
430 |
|
431 |
$id = trim( $_GET['user_id'] );
|
432 |
EnjoyInstagram_DB()->delete_media_by_user( $id );
|
433 |
+
ei_delete_cached_images();
|
434 |
|
435 |
// redirect to main settings page
|
436 |
wp_redirect( $this->build_admin_url( 'users-settings' ) );
|
includes/class.enjoyinstagram-api-connection.php
CHANGED
@@ -320,7 +320,7 @@ class EnjoyInstagram_Api_Connection {
|
|
320 |
if ( isset( $media['thumbnail_url'] ) ) {
|
321 |
$thumb = $media['thumbnail_url'];
|
322 |
} else if ( $media['media_type'] === 'IMAGE' || $media['media_type'] === 'CAROUSEL_ALBUM' ) {
|
323 |
-
$thumb = $media['permalink'] . 'media';
|
324 |
}
|
325 |
|
326 |
$return[] = array(
|
320 |
if ( isset( $media['thumbnail_url'] ) ) {
|
321 |
$thumb = $media['thumbnail_url'];
|
322 |
} else if ( $media['media_type'] === 'IMAGE' || $media['media_type'] === 'CAROUSEL_ALBUM' ) {
|
323 |
+
$thumb = $media['permalink'] . 'media/';
|
324 |
}
|
325 |
|
326 |
$return[] = array(
|
includes/class.enjoyinstagram-db.php
CHANGED
@@ -28,7 +28,7 @@ class EnjoyInstagram_DB {
|
|
28 |
*
|
29 |
* @var string
|
30 |
*/
|
31 |
-
protected $db_version = '1.0.
|
32 |
|
33 |
/**
|
34 |
* Single plugin instance
|
@@ -98,7 +98,6 @@ class EnjoyInstagram_DB {
|
|
98 |
$sqls['enjoy_instagram_media'] = "CREATE TABLE IF NOT EXISTS $this->main_table (
|
99 |
id bigint(20) NOT NULL AUTO_INCREMENT,
|
100 |
image_id varchar(255) DEFAULT '' NOT NULL,
|
101 |
-
image_ids varchar(255) DEFAULT '' NOT NULL,
|
102 |
image_link varchar(255) DEFAULT '' NOT NULL,
|
103 |
image_url text DEFAULT '' NOT NULL,
|
104 |
thumbnail_url text DEFAULT '' NOT NULL,
|
@@ -135,6 +134,9 @@ class EnjoyInstagram_DB {
|
|
135 |
$wpdb->query( "ALTER TABLE {$this->main_table} ADD thumbnail_url text DEFAULT '' NOT NULL AFTER image_url" );
|
136 |
delete_option( 'enjoyinstagram_sync_times' );
|
137 |
break;
|
|
|
|
|
|
|
138 |
}
|
139 |
|
140 |
update_option( 'enjoy_instagram_installed_db_version', $this->db_version );
|
@@ -167,7 +169,7 @@ class EnjoyInstagram_DB {
|
|
167 |
}
|
168 |
|
169 |
foreach ( $where as $condition ) {
|
170 |
-
! isset( $condition['compare'] ) && $condition['compare']
|
171 |
! isset( $condition['relation'] ) && $condition['relation'] = 'AND';
|
172 |
|
173 |
$value = $condition['value'];
|
@@ -229,7 +231,7 @@ class EnjoyInstagram_DB {
|
|
229 |
* Moderate an image
|
230 |
*
|
231 |
* @param string $type
|
232 |
-
* @param array
|
233 |
*
|
234 |
* @return boolean
|
235 |
* @author Francesco Licandro
|
@@ -260,9 +262,9 @@ class EnjoyInstagram_DB {
|
|
260 |
/**
|
261 |
* Get media for shortcode by user
|
262 |
*
|
263 |
-
* @param string
|
264 |
-
* @param array
|
265 |
-
* @param boolean|string
|
266 |
* @param boolean|integer $limit
|
267 |
*
|
268 |
* @return array
|
@@ -274,7 +276,7 @@ class EnjoyInstagram_DB {
|
|
274 |
|
275 |
( $limit === false ) && $limit = get_option( 'enjoyinstagram_images_captured', 20 );
|
276 |
|
277 |
-
$where
|
278 |
$moderate !== false && $where .= " AND moderate = '{$moderate}'";
|
279 |
|
280 |
if ( ! empty( $hashtags ) ) {
|
@@ -285,7 +287,7 @@ class EnjoyInstagram_DB {
|
|
285 |
return array();
|
286 |
}
|
287 |
|
288 |
-
$ids
|
289 |
$where .= " AND id IN ('{$ids}')";
|
290 |
}
|
291 |
|
@@ -300,8 +302,8 @@ class EnjoyInstagram_DB {
|
|
300 |
/**
|
301 |
* Get images id by hashtags
|
302 |
*
|
303 |
-
* @param array
|
304 |
-
* @param boolean
|
305 |
* @param int|bool $limit
|
306 |
*
|
307 |
* @return array
|
28 |
*
|
29 |
* @var string
|
30 |
*/
|
31 |
+
protected $db_version = '1.0.5';
|
32 |
|
33 |
/**
|
34 |
* Single plugin instance
|
98 |
$sqls['enjoy_instagram_media'] = "CREATE TABLE IF NOT EXISTS $this->main_table (
|
99 |
id bigint(20) NOT NULL AUTO_INCREMENT,
|
100 |
image_id varchar(255) DEFAULT '' NOT NULL,
|
|
|
101 |
image_link varchar(255) DEFAULT '' NOT NULL,
|
102 |
image_url text DEFAULT '' NOT NULL,
|
103 |
thumbnail_url text DEFAULT '' NOT NULL,
|
134 |
$wpdb->query( "ALTER TABLE {$this->main_table} ADD thumbnail_url text DEFAULT '' NOT NULL AFTER image_url" );
|
135 |
delete_option( 'enjoyinstagram_sync_times' );
|
136 |
break;
|
137 |
+
case '1.0.5':
|
138 |
+
wp_mkdir_p( ei_get_cache_path() );
|
139 |
+
break;
|
140 |
}
|
141 |
|
142 |
update_option( 'enjoy_instagram_installed_db_version', $this->db_version );
|
169 |
}
|
170 |
|
171 |
foreach ( $where as $condition ) {
|
172 |
+
! isset( $condition['compare'] ) && $condition['compare'] = '=';
|
173 |
! isset( $condition['relation'] ) && $condition['relation'] = 'AND';
|
174 |
|
175 |
$value = $condition['value'];
|
231 |
* Moderate an image
|
232 |
*
|
233 |
* @param string $type
|
234 |
+
* @param array $args
|
235 |
*
|
236 |
* @return boolean
|
237 |
* @author Francesco Licandro
|
262 |
/**
|
263 |
* Get media for shortcode by user
|
264 |
*
|
265 |
+
* @param string $user
|
266 |
+
* @param array $hashtags
|
267 |
+
* @param boolean|string $moderate
|
268 |
* @param boolean|integer $limit
|
269 |
*
|
270 |
* @return array
|
276 |
|
277 |
( $limit === false ) && $limit = get_option( 'enjoyinstagram_images_captured', 20 );
|
278 |
|
279 |
+
$where = "user = '{$user}'";
|
280 |
$moderate !== false && $where .= " AND moderate = '{$moderate}'";
|
281 |
|
282 |
if ( ! empty( $hashtags ) ) {
|
287 |
return array();
|
288 |
}
|
289 |
|
290 |
+
$ids = implode( "','", $ids );
|
291 |
$where .= " AND id IN ('{$ids}')";
|
292 |
}
|
293 |
|
302 |
/**
|
303 |
* Get images id by hashtags
|
304 |
*
|
305 |
+
* @param array $hashtags
|
306 |
+
* @param boolean $moderate
|
307 |
* @param int|bool $limit
|
308 |
*
|
309 |
* @return array
|
includes/class.enjoyinstagram-shortcodes.php
CHANGED
@@ -279,6 +279,20 @@ class EnjoyInstagram_Shortcodes {
|
|
279 |
}
|
280 |
}
|
281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
$medias = array_merge( $medias, $temp_medias );
|
283 |
}
|
284 |
}
|
279 |
}
|
280 |
}
|
281 |
|
282 |
+
$count = 0;
|
283 |
+
|
284 |
+
foreach ( $temp_medias as $media ) {
|
285 |
+
|
286 |
+
// cache 15 images a time
|
287 |
+
if ( $count >= 10 ) {
|
288 |
+
break;
|
289 |
+
}
|
290 |
+
|
291 |
+
if ( ei_maybe_cache_image( $media['image_id'], $media['image_url'] ) ) {
|
292 |
+
$count ++;
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
$medias = array_merge( $medias, $temp_medias );
|
297 |
}
|
298 |
}
|
includes/class.enjoyinstagram.php
CHANGED
@@ -29,6 +29,11 @@ final class EnjoyInstagram {
|
|
29 |
*/
|
30 |
public $settings;
|
31 |
|
|
|
|
|
|
|
|
|
|
|
32 |
/**
|
33 |
* Returns single instance of the class
|
34 |
*
|
@@ -234,6 +239,7 @@ final class EnjoyInstagram {
|
|
234 |
return;
|
235 |
}
|
236 |
|
|
|
237 |
$this->_sync( $user, $to_sync );
|
238 |
}
|
239 |
|
@@ -254,6 +260,11 @@ final class EnjoyInstagram {
|
|
254 |
return;
|
255 |
}
|
256 |
|
|
|
|
|
|
|
|
|
|
|
257 |
$api = EnjoyInstagram_Api_Connection();
|
258 |
$medias = $api->get_user_media( $user_data, 33, $offset );
|
259 |
|
@@ -268,11 +279,24 @@ final class EnjoyInstagram {
|
|
268 |
return;
|
269 |
}
|
270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
foreach ( $medias['data'] as $media ) {
|
272 |
if ( empty( $media['image_id'] ) ) {
|
273 |
continue;
|
274 |
}
|
275 |
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
$media_id = EnjoyInstagram_DB()->add_in_main_table( $media );
|
277 |
if ( $media_id && ! empty( $media['tags'] ) ) {
|
278 |
foreach ( $media['tags'] as $tag ) {
|
@@ -284,6 +308,8 @@ final class EnjoyInstagram {
|
|
284 |
);
|
285 |
}
|
286 |
}
|
|
|
|
|
287 |
}
|
288 |
|
289 |
// continue sync
|
29 |
*/
|
30 |
public $settings;
|
31 |
|
32 |
+
/**
|
33 |
+
* @var int
|
34 |
+
*/
|
35 |
+
private $_processed = 0;
|
36 |
+
|
37 |
/**
|
38 |
* Returns single instance of the class
|
39 |
*
|
239 |
return;
|
240 |
}
|
241 |
|
242 |
+
$this->_processed = 0;
|
243 |
$this->_sync( $user, $to_sync );
|
244 |
}
|
245 |
|
260 |
return;
|
261 |
}
|
262 |
|
263 |
+
$limit = get_option( 'enjoyinstagram_images_captured', 20 );
|
264 |
+
if ( $this->_processed >= $limit ) {
|
265 |
+
return;
|
266 |
+
}
|
267 |
+
|
268 |
$api = EnjoyInstagram_Api_Connection();
|
269 |
$medias = $api->get_user_media( $user_data, 33, $offset );
|
270 |
|
279 |
return;
|
280 |
}
|
281 |
|
282 |
+
$cache_path = ei_get_cache_path();
|
283 |
+
|
284 |
+
// ensure cache path exists
|
285 |
+
if ( ! file_exists( $cache_path ) ) {
|
286 |
+
wp_mkdir_p( $cache_path );
|
287 |
+
}
|
288 |
+
|
289 |
foreach ( $medias['data'] as $media ) {
|
290 |
if ( empty( $media['image_id'] ) ) {
|
291 |
continue;
|
292 |
}
|
293 |
|
294 |
+
if ( $this->_processed >= $limit ) {
|
295 |
+
break;
|
296 |
+
}
|
297 |
+
|
298 |
+
ei_maybe_cache_image( $media['image_id'], $media['image_url'] );
|
299 |
+
|
300 |
$media_id = EnjoyInstagram_DB()->add_in_main_table( $media );
|
301 |
if ( $media_id && ! empty( $media['tags'] ) ) {
|
302 |
foreach ( $media['tags'] as $tag ) {
|
308 |
);
|
309 |
}
|
310 |
}
|
311 |
+
|
312 |
+
$this->_processed ++;
|
313 |
}
|
314 |
|
315 |
// continue sync
|
includes/functions.enjoyinstagram.php
CHANGED
@@ -239,6 +239,17 @@ if ( ! function_exists( 'enjoyinstagram_format_media_for_shortcode' ) ) {
|
|
239 |
$media['thumbnail_url'] = ENJOYINSTAGRAM_ASSETS_URL . '/images/video_placeholder.jpeg';
|
240 |
}
|
241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
$media['images'] = array(
|
243 |
'thumbnail' => array( 'url' => $media['thumbnail_url'] ),
|
244 |
'standard_resolution' => array( 'url' => $media['image_url'] )
|
@@ -387,3 +398,101 @@ if ( ! function_exists( 'enjoyinstagram_extract_hashtags' ) ) {
|
|
387 |
return $matches[3];
|
388 |
}
|
389 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
$media['thumbnail_url'] = ENJOYINSTAGRAM_ASSETS_URL . '/images/video_placeholder.jpeg';
|
240 |
}
|
241 |
|
242 |
+
// fix for 24 oct 2020, facebook deperecated the old url
|
243 |
+
if ( 'image' === $media['type'] ) {
|
244 |
+
$media['thumbnail_url'] = $media['image_url'];
|
245 |
+
}
|
246 |
+
|
247 |
+
$thumb_cache_exists = file_exists( ei_get_cached_image( $media['image_id'], 320 ) );
|
248 |
+
|
249 |
+
if ( $thumb_cache_exists ) {
|
250 |
+
$media['thumbnail_url'] = ei_get_cached_image_url( $media['image_id'], 320 );
|
251 |
+
}
|
252 |
+
|
253 |
$media['images'] = array(
|
254 |
'thumbnail' => array( 'url' => $media['thumbnail_url'] ),
|
255 |
'standard_resolution' => array( 'url' => $media['image_url'] )
|
398 |
return $matches[3];
|
399 |
}
|
400 |
}
|
401 |
+
|
402 |
+
/**
|
403 |
+
* @return string
|
404 |
+
*
|
405 |
+
* @since 5.2.0
|
406 |
+
*/
|
407 |
+
function ei_get_cache_url() {
|
408 |
+
$upload = wp_upload_dir();
|
409 |
+
$base_url = $upload['baseurl'];
|
410 |
+
|
411 |
+
if ( is_ssl() ) {
|
412 |
+
str_replace( 'http:', 'https:', $base_url );
|
413 |
+
}
|
414 |
+
|
415 |
+
return apply_filters( 'ei_cache_url', trailingslashit( $base_url ) . ENJOYINSTAGRAM_CACHE_DIR_NAME );
|
416 |
+
}
|
417 |
+
|
418 |
+
/**
|
419 |
+
* @return string
|
420 |
+
*
|
421 |
+
* @since 5.2.0
|
422 |
+
*/
|
423 |
+
function ei_get_cache_path() {
|
424 |
+
$upload = wp_upload_dir();
|
425 |
+
|
426 |
+
return apply_filters( 'ei_cache_path', trailingslashit( $upload['basedir'] ) . ENJOYINSTAGRAM_CACHE_DIR_NAME );
|
427 |
+
}
|
428 |
+
|
429 |
+
/**
|
430 |
+
* @param string $media_id
|
431 |
+
* @param int $size
|
432 |
+
*
|
433 |
+
* @return string
|
434 |
+
*
|
435 |
+
* @since 5.2.0
|
436 |
+
*/
|
437 |
+
function ei_get_cached_image( $media_id, $size ) {
|
438 |
+
return trailingslashit( ei_get_cache_path() ) . $media_id . '_' . $size . '.jpg';
|
439 |
+
}
|
440 |
+
|
441 |
+
/**
|
442 |
+
* @param string $media_id
|
443 |
+
* @param int $size
|
444 |
+
*
|
445 |
+
* @return string
|
446 |
+
*
|
447 |
+
* @since 5.2.0
|
448 |
+
*/
|
449 |
+
function ei_get_cached_image_url( $media_id, $size ) {
|
450 |
+
return trailingslashit( ei_get_cache_url() ) . basename( ei_get_cached_image( $media_id, $size ) );
|
451 |
+
}
|
452 |
+
|
453 |
+
/**
|
454 |
+
* @since 5.2.0
|
455 |
+
*/
|
456 |
+
function ei_delete_cached_images() {
|
457 |
+
$image_files = glob( trailingslashit( ei_get_cache_path() ) . '*' );
|
458 |
+
foreach ( $image_files as $file ) { // iterate files
|
459 |
+
if ( is_file( $file ) ) {
|
460 |
+
unlink( $file );
|
461 |
+
}
|
462 |
+
}
|
463 |
+
}
|
464 |
+
|
465 |
+
/**
|
466 |
+
* @param string $id
|
467 |
+
* @param string $url
|
468 |
+
*
|
469 |
+
* @return bool
|
470 |
+
*/
|
471 |
+
function ei_maybe_cache_image( $id, $url ) {
|
472 |
+
|
473 |
+
$resize_sizes = apply_filters( 'ei_resize_sizes', array( 320, 640 ) );
|
474 |
+
|
475 |
+
foreach ( $resize_sizes as $width ) {
|
476 |
+
|
477 |
+
if ( ! is_int( $width ) ) {
|
478 |
+
continue;
|
479 |
+
}
|
480 |
+
|
481 |
+
$cached_file = ei_get_cached_image( $id, $width );
|
482 |
+
|
483 |
+
if ( ! file_exists( $cached_file ) ) {
|
484 |
+
$editor = wp_get_image_editor( $url );
|
485 |
+
|
486 |
+
if ( is_wp_error( $editor ) ) {
|
487 |
+
return false;
|
488 |
+
}
|
489 |
+
|
490 |
+
$editor->resize( $width, null );
|
491 |
+
if ( ! $editor->save( $cached_file ) ) {
|
492 |
+
return false;
|
493 |
+
}
|
494 |
+
}
|
495 |
+
}
|
496 |
+
|
497 |
+
return true;
|
498 |
+
}
|
index.php
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
# Silence is golden.
|
|
|
|
readme.txt
CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.google.com/url?q=https%3A%2F%2Fwww.paypal.com%2Fcgi-bin
|
|
4 |
Tags: social feed, instagram carousel, social media feed, instagram widget, instagram feed
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 5.5.1
|
7 |
-
Version: 5.
|
8 |
-
Stable tag: 5.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -29,7 +29,7 @@ Enjoy Social Feed Plugin for WordPress is responsive and optimized for mobile de
|
|
29 |
|
30 |
Once you have installed our plugin Enjoy Social Feed Plugin for WordPress, thanks to the presence of the icon on the editor, you are able to use shortcodes and to embed feed in just one single line.
|
31 |
|
32 |
-
= Here is Live Demo for Enjoy Social Feed Plugin for WordPress: = [
|
33 |
|
34 |
= Enjoy Social Feed Plugin for WordPress allows Instagram video visualization for browser supporting HTML5 =
|
35 |
|
@@ -212,8 +212,8 @@ In the Setting section yon can customize grid and/or Carousel view
|
|
212 |
|
213 |
== Changelog ==
|
214 |
|
215 |
-
= 5.
|
216 |
-
*
|
217 |
= 5.0.9 =
|
218 |
* Instagram cdn url refresh rate
|
219 |
= 5.0.8 =
|
4 |
Tags: social feed, instagram carousel, social media feed, instagram widget, instagram feed
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 5.5.1
|
7 |
+
Version: 5.2.0
|
8 |
+
Stable tag: 5.2.0
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
29 |
|
30 |
Once you have installed our plugin Enjoy Social Feed Plugin for WordPress, thanks to the presence of the icon on the editor, you are able to use shortcodes and to embed feed in just one single line.
|
31 |
|
32 |
+
= Here is Live Demo for Enjoy Social Feed Plugin for WordPress: = [http://www.mediabetaprojects.com/enjoy-instagram-premium/instagram-feeds-in-your-website-enjoy-instagram-free/](http://www.mediabetaprojects.com/enjoy-instagram-premium/instagram-feeds-in-your-website-enjoy-instagram-free/)
|
33 |
|
34 |
= Enjoy Social Feed Plugin for WordPress allows Instagram video visualization for browser supporting HTML5 =
|
35 |
|
212 |
|
213 |
== Changelog ==
|
214 |
|
215 |
+
= 5.2.0 =
|
216 |
+
* Local thumbnail cache
|
217 |
= 5.0.9 =
|
218 |
* Instagram cdn url refresh rate
|
219 |
= 5.0.8 =
|
templates/admin/diagnostic.php
CHANGED
@@ -17,6 +17,10 @@ PHP Version: <?php echo phpversion() . "\n" ?>
|
|
17 |
SAPI: <?php echo php_sapi_name() . "\n" ?>
|
18 |
WEB Server: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n" ?>
|
19 |
|
|
|
|
|
|
|
|
|
20 |
## USERS: ##
|
21 |
<?php
|
22 |
|
@@ -78,4 +82,4 @@ foreach ( $plugins as $plugin_path => $plugin ) {
|
|
78 |
<a id="ei_reset_db" class="button-secondary"
|
79 |
href="<?php echo wp_nonce_url( EnjoyInstagram_Admin()->build_admin_url( 'diagnostic',
|
80 |
array( 'action' => 'reset-db' ) ), 'reset-db' ) ?>"><?php _e( 'Re-install Database' ) ?></a>
|
81 |
-
</p>
|
17 |
SAPI: <?php echo php_sapi_name() . "\n" ?>
|
18 |
WEB Server: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n" ?>
|
19 |
|
20 |
+
## Cache ##
|
21 |
+
Path: <?php echo (file_exists(ei_get_cache_path()) ? ei_get_cache_path() : 'Unable to create ' . ei_get_cache_path()) . "\n"; ?>
|
22 |
+
Images in cache: <?php echo count(glob( trailingslashit( ei_get_cache_path() ) . '*' )) . "\n"; ?>
|
23 |
+
|
24 |
## USERS: ##
|
25 |
<?php
|
26 |
|
82 |
<a id="ei_reset_db" class="button-secondary"
|
83 |
href="<?php echo wp_nonce_url( EnjoyInstagram_Admin()->build_admin_url( 'diagnostic',
|
84 |
array( 'action' => 'reset-db' ) ), 'reset-db' ) ?>"><?php _e( 'Re-install Database' ) ?></a>
|
85 |
+
</p>
|