Version Description
- Fix: Fix cases where images appear blurry with automatic layout
- Fix: Minor bug fixes
Download this release
Release Info
Developer | chrisakelley |
Plugin | Photo Gallery by Envira – Responsive Image Gallery for WordPress |
Version | 1.5.6.1 |
Comparing to | |
See all releases |
Code changes from version 1.5.6 to 1.5.6.1
- envira-gallery-lite.php +2 -2
- includes/admin/ajax.php +20 -3
- includes/admin/review.php +2 -2
- includes/global/common.php +12 -2
- includes/global/shortcode.php +5 -8
- readme.txt +5 -0
envira-gallery-lite.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Envira Gallery is best responsive WordPress gallery plugin. This is the lite version.
|
6 |
* Author: Thomas Griffin
|
7 |
* Author URI: http://enviragallery.com
|
8 |
-
* Version: 1.5.6
|
9 |
* Text Domain: envira-gallery
|
10 |
*
|
11 |
* Envira Gallery is free software: you can redistribute it and/or modify
|
@@ -53,7 +53,7 @@ class Envira_Gallery_Lite {
|
|
53 |
*
|
54 |
* @var string
|
55 |
*/
|
56 |
-
public $version = '1.5.6';
|
57 |
|
58 |
/**
|
59 |
* The name of the plugin.
|
5 |
* Description: Envira Gallery is best responsive WordPress gallery plugin. This is the lite version.
|
6 |
* Author: Thomas Griffin
|
7 |
* Author URI: http://enviragallery.com
|
8 |
+
* Version: 1.5.6.1
|
9 |
* Text Domain: envira-gallery
|
10 |
*
|
11 |
* Envira Gallery is free software: you can redistribute it and/or modify
|
53 |
*
|
54 |
* @var string
|
55 |
*/
|
56 |
+
public $version = '1.5.6.1';
|
57 |
|
58 |
/**
|
59 |
* The name of the plugin.
|
includes/admin/ajax.php
CHANGED
@@ -831,11 +831,28 @@ function envira_gallery_editor_get_galleries() {
|
|
831 |
$thumbnail = wp_get_attachment_image_src( $key, 'thumbnail' );
|
832 |
}
|
833 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
834 |
// Add gallery to results
|
835 |
$results[] = array(
|
836 |
-
'id' => $
|
837 |
-
'slug' => $
|
838 |
-
'title' => $
|
839 |
'thumbnail' => ( ( isset( $thumbnail ) && is_array( $thumbnail ) ) ? $thumbnail[0] : '' ),
|
840 |
'action' => 'gallery', // Tells the editor modal whether this is a Gallery or Album for the shortcode output
|
841 |
);
|
831 |
$thumbnail = wp_get_attachment_image_src( $key, 'thumbnail' );
|
832 |
}
|
833 |
|
834 |
+
if ( ! empty( $gallery['config']['title'] ) ) {
|
835 |
+
$gallery_title = $gallery['config']['title'];
|
836 |
+
} else {
|
837 |
+
$gallery_title = false;
|
838 |
+
}
|
839 |
+
|
840 |
+
// Check to make sure variables are there
|
841 |
+
$gallery_id = false;
|
842 |
+
$gallery_config_slug = false;
|
843 |
+
|
844 |
+
if ( isset( $gallery['id'] ) ) {
|
845 |
+
$gallery_id = $gallery['id'];
|
846 |
+
}
|
847 |
+
if ( isset( $gallery['config']['slug'] ) ) {
|
848 |
+
$gallery_config_slug = $gallery['config']['slug'];
|
849 |
+
}
|
850 |
+
|
851 |
// Add gallery to results
|
852 |
$results[] = array(
|
853 |
+
'id' => $gallery_id,
|
854 |
+
'slug' => $gallery_config_slug,
|
855 |
+
'title' => $gallery_title,
|
856 |
'thumbnail' => ( ( isset( $thumbnail ) && is_array( $thumbnail ) ) ? $thumbnail[0] : '' ),
|
857 |
'action' => 'gallery', // Tells the editor modal whether this is a Gallery or Album for the shortcode output
|
858 |
);
|
includes/admin/review.php
CHANGED
@@ -152,8 +152,8 @@ class Envira_Lite_Review {
|
|
152 |
// We have a candidate! Output a review message.
|
153 |
?>
|
154 |
<div class="notice notice-info is-dismissible envira-review-notice">
|
155 |
-
<p><?php _e( 'Hey, I noticed you created a photo gallery with Envira - that’s awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation
|
156 |
-
<p><strong><?php _e( '~ Syed Balkhi<br>Co-Founder of
|
157 |
<p>
|
158 |
<a href="https://wordpress.org/support/plugin/envira-gallery-lite/reviews/?filter=5#new-post" class="envira-dismiss-review-notice envira-review-out" target="_blank" rel="noopener"><?php _e( 'Ok, you deserve it', 'envira-gallery-lite' ); ?></a><br>
|
159 |
<a href="#" class="envira-dismiss-review-notice" target="_blank" rel="noopener"><?php _e( 'Nope, maybe later', 'envira-gallery-lite' ); ?></a><br>
|
152 |
// We have a candidate! Output a review message.
|
153 |
?>
|
154 |
<div class="notice notice-info is-dismissible envira-review-notice">
|
155 |
+
<p><?php _e( 'Hey, I noticed you created a photo gallery with Envira - that’s awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?', 'envira-gallery-lite' ); ?></p>
|
156 |
+
<p><strong><?php _e( '~ Syed Balkhi<br>Co-Founder of Envira Gallery', 'envira-gallery-lite' ); ?></strong></p>
|
157 |
<p>
|
158 |
<a href="https://wordpress.org/support/plugin/envira-gallery-lite/reviews/?filter=5#new-post" class="envira-dismiss-review-notice envira-review-out" target="_blank" rel="noopener"><?php _e( 'Ok, you deserve it', 'envira-gallery-lite' ); ?></a><br>
|
159 |
<a href="#" class="envira-dismiss-review-notice" target="_blank" rel="noopener"><?php _e( 'Nope, maybe later', 'envira-gallery-lite' ); ?></a><br>
|
includes/global/common.php
CHANGED
@@ -790,7 +790,11 @@ class Envira_Gallery_Common {
|
|
790 |
// Don't resize images that don't belong to this site's URL
|
791 |
// Strip ?lang=fr from blog's URL - WPML adds this on
|
792 |
// and means our next statement fails
|
793 |
-
|
|
|
|
|
|
|
|
|
794 |
|
795 |
// WPML check - if there is a /fr or any domain in the url, then remove that from the $site_url
|
796 |
if ( defined('ICL_LANGUAGE_CODE') ) {
|
@@ -945,7 +949,8 @@ class Envira_Gallery_Common {
|
|
945 |
$file_path = $wp_upload_dir['basedir'] . $matches[0];
|
946 |
} else {
|
947 |
$pathinfo = parse_url( $url );
|
948 |
-
$uploads_dir = is_multisite() ? '/files/' : '/wp-content/';
|
|
|
949 |
$file_path = ABSPATH . str_replace( dirname( $_SERVER['SCRIPT_NAME'] ) . '/', '', strstr( $pathinfo['path'], $uploads_dir ) );
|
950 |
$file_path = preg_replace( '/(\/\/)/', '/', $file_path );
|
951 |
}
|
@@ -955,6 +960,11 @@ class Envira_Gallery_Common {
|
|
955 |
return new WP_Error( 'envira-gallery-error-no-file', __( 'No file could be found for the image URL specified.', 'envira-gallery' ) );
|
956 |
}
|
957 |
|
|
|
|
|
|
|
|
|
|
|
958 |
// Get original image size.
|
959 |
$size = @getimagesize( $file_path );
|
960 |
|
790 |
// Don't resize images that don't belong to this site's URL
|
791 |
// Strip ?lang=fr from blog's URL - WPML adds this on
|
792 |
// and means our next statement fails
|
793 |
+
if ( is_multisite() ) {
|
794 |
+
$site_url = preg_replace( '/\?.*/', '', network_site_url() );
|
795 |
+
} else {
|
796 |
+
$site_url = preg_replace( '/\?.*/', '', get_bloginfo( 'url' ) );
|
797 |
+
}
|
798 |
|
799 |
// WPML check - if there is a /fr or any domain in the url, then remove that from the $site_url
|
800 |
if ( defined('ICL_LANGUAGE_CODE') ) {
|
949 |
$file_path = $wp_upload_dir['basedir'] . $matches[0];
|
950 |
} else {
|
951 |
$pathinfo = parse_url( $url );
|
952 |
+
// $uploads_dir = is_multisite() ? '/files/' : '/wp-content/';
|
953 |
+
$uploads_dir = is_multisite() ? '/files/' : '/' . str_replace( ABSPATH, '', WP_CONTENT_DIR ) . '/';
|
954 |
$file_path = ABSPATH . str_replace( dirname( $_SERVER['SCRIPT_NAME'] ) . '/', '', strstr( $pathinfo['path'], $uploads_dir ) );
|
955 |
$file_path = preg_replace( '/(\/\/)/', '/', $file_path );
|
956 |
}
|
960 |
return new WP_Error( 'envira-gallery-error-no-file', __( 'No file could be found for the image URL specified.', 'envira-gallery' ) );
|
961 |
}
|
962 |
|
963 |
+
// Attempt to stream and import the image if it does not exist based on URL provided.
|
964 |
+
if ( ! file_exists( $file_path ) ) {
|
965 |
+
return new WP_Error( 'envira-gallery-error-no-file', __( 'No file could be found for the image URL specified.', 'envira-gallery' ) );
|
966 |
+
}
|
967 |
+
|
968 |
// Get original image size.
|
969 |
$size = @getimagesize( $file_path );
|
970 |
|
includes/global/shortcode.php
CHANGED
@@ -357,12 +357,7 @@ class Envira_Gallery_Shortcode {
|
|
357 |
$caption = $item['title'];
|
358 |
|
359 |
// Determine if we create a link.
|
360 |
-
|
361 |
-
// "Turn off the lightbox then the image shouldn't be clicked"
|
362 |
-
|
363 |
-
if ( envira_mobile_detect()->isMobile() && !$this->get_config( 'lightbox_enabled', $data ) ) {
|
364 |
-
$create_link = false;
|
365 |
-
} else if ( ! empty( $item['link'] ) ) {
|
366 |
$create_link = true;
|
367 |
} else {
|
368 |
$create_link = false;
|
@@ -1427,13 +1422,15 @@ class Envira_Gallery_Shortcode {
|
|
1427 |
} else {
|
1428 |
|
1429 |
$row_height = $retina ? intval( $this->get_config( 'justified_row_height', $data ) ) * 2 : intval( $this->get_config( 'justified_row_height', $data ) );
|
|
|
1430 |
|
1431 |
-
|
|
|
1432 |
|
1433 |
// Get the full image
|
1434 |
$src = apply_filters( 'envira_gallery_retina_image_src', wp_get_attachment_image_src( $id, 'medium' ), $id, $item, $data, $this->is_mobile );
|
1435 |
|
1436 |
-
} elseif ( $row_height <= 640 && ! $
|
1437 |
|
1438 |
$src = apply_filters( 'envira_gallery_retina_image_src', wp_get_attachment_image_src( $id, 'large' ), $id, $item, $data, $this->is_mobile );
|
1439 |
|
357 |
$caption = $item['title'];
|
358 |
|
359 |
// Determine if we create a link.
|
360 |
+
if ( ! empty( $item['link'] ) ) {
|
|
|
|
|
|
|
|
|
|
|
361 |
$create_link = true;
|
362 |
} else {
|
363 |
$create_link = false;
|
1422 |
} else {
|
1423 |
|
1424 |
$row_height = $retina ? intval( $this->get_config( 'justified_row_height', $data ) ) * 2 : intval( $this->get_config( 'justified_row_height', $data ) );
|
1425 |
+
$crop = $this->get_config( 'crop', $data );
|
1426 |
|
1427 |
+
//200 fixes the 4:3 crop issue
|
1428 |
+
if ( $row_height <= 200 && ! $crop ){
|
1429 |
|
1430 |
// Get the full image
|
1431 |
$src = apply_filters( 'envira_gallery_retina_image_src', wp_get_attachment_image_src( $id, 'medium' ), $id, $item, $data, $this->is_mobile );
|
1432 |
|
1433 |
+
} elseif ( $row_height <= 640 && ! $crop ){
|
1434 |
|
1435 |
$src = apply_filters( 'envira_gallery_retina_image_src', wp_get_attachment_image_src( $id, 'large' ), $id, $item, $data, $this->is_mobile );
|
1436 |
|
readme.txt
CHANGED
@@ -185,6 +185,11 @@ Also, I'm an <a href="https://thomasgriffin.io" rel="me" title="WordPress Develo
|
|
185 |
|
186 |
== Changelog ==
|
187 |
|
|
|
|
|
|
|
|
|
|
|
188 |
= 1.5.6 =
|
189 |
|
190 |
* Fix: PHP optimizations to improve performance
|
185 |
|
186 |
== Changelog ==
|
187 |
|
188 |
+
= 1.5.6.1 =
|
189 |
+
|
190 |
+
* Fix: Fix cases where images appear blurry with automatic layout
|
191 |
+
* Fix: Minor bug fixes
|
192 |
+
|
193 |
= 1.5.6 =
|
194 |
|
195 |
* Fix: PHP optimizations to improve performance
|