Skip to content

Commit

Permalink
Merge branch 'branch-1.8.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Screenfeed committed Oct 24, 2018
2 parents e914395 + 491db5a commit 654aa25
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 52 deletions.
2 changes: 0 additions & 2 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,6 @@ p.imagify-section-title.imagify-section-title {
ul.imagify-datas-list.imagify-datas-list {
margin: 0 auto;
color: #555;
font-size: 10px;
}
ul.imagify-datas-list .big {
font-size: 12px;
Expand Down Expand Up @@ -1211,7 +1210,6 @@ ul.imagify-datas-details.imagify-datas-details {
/* Media edition */
.compat-field-imagify .imagify-datas-actions-links a,
.misc-pub-imagify .imagify-datas-actions-links a {
font-size: 10px;
float: left;
width: 50%;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/css/admin.min.css

Large diffs are not rendered by default.

20 changes: 2 additions & 18 deletions assets/images/icon-lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 17 additions & 17 deletions imagify.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Imagify
* Plugin URI: https://wordpress.org/plugins/imagify/
* Description: Dramaticaly reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwidth using Imagify, the new most advanced image optimization tool.
* Version: 1.8.2
* Version: 1.8.3
* Author: WP Media
* Author URI: https://wp-media.me/
* Licence: GPLv2
Expand All @@ -17,26 +17,26 @@
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );

// Imagify defines.
define( 'IMAGIFY_VERSION' , '1.8.2' );
define( 'IMAGIFY_WP_MIN' , '4.0' );
define( 'IMAGIFY_SLUG' , 'imagify' );
define( 'IMAGIFY_FILE' , __FILE__ );
define( 'IMAGIFY_PATH' , realpath( plugin_dir_path( IMAGIFY_FILE ) ) . '/' );
define( 'IMAGIFY_INC_PATH' , realpath( IMAGIFY_PATH . 'inc/' ) . '/' );
define( 'IMAGIFY_ADMIN_PATH' , realpath( IMAGIFY_INC_PATH . 'admin' ) . '/' );
define( 'IMAGIFY_COMMON_PATH' , realpath( IMAGIFY_INC_PATH . 'common' ) . '/' );
define( 'IMAGIFY_VERSION', '1.8.3' );
define( 'IMAGIFY_WP_MIN', '4.0' );
define( 'IMAGIFY_SLUG', 'imagify' );
define( 'IMAGIFY_FILE', __FILE__ );
define( 'IMAGIFY_PATH', realpath( plugin_dir_path( IMAGIFY_FILE ) ) . '/' );
define( 'IMAGIFY_INC_PATH', realpath( IMAGIFY_PATH . 'inc/' ) . '/' );
define( 'IMAGIFY_ADMIN_PATH', realpath( IMAGIFY_INC_PATH . 'admin' ) . '/' );
define( 'IMAGIFY_COMMON_PATH', realpath( IMAGIFY_INC_PATH . 'common' ) . '/' );
define( 'IMAGIFY_FUNCTIONS_PATH', realpath( IMAGIFY_INC_PATH . 'functions' ) . '/' );
define( 'IMAGIFY_CLASSES_PATH' , realpath( IMAGIFY_INC_PATH . 'classes' ) . '/' );
define( 'IMAGIFY_CLASSES_PATH', realpath( IMAGIFY_INC_PATH . 'classes' ) . '/' );
define( 'IMAGIFY_3RD_PARTY_PATH', realpath( IMAGIFY_INC_PATH . '3rd-party' ) . '/' );
define( 'IMAGIFY_URL' , plugin_dir_url( IMAGIFY_FILE ) );
define( 'IMAGIFY_INC_URL' , IMAGIFY_URL . 'inc/' );
define( 'IMAGIFY_ADMIN_URL' , IMAGIFY_INC_URL . 'admin/' );
define( 'IMAGIFY_ASSETS_URL' , IMAGIFY_URL . 'assets/' );
define( 'IMAGIFY_ASSETS_JS_URL' , IMAGIFY_ASSETS_URL . 'js/' );
define( 'IMAGIFY_URL', plugin_dir_url( IMAGIFY_FILE ) );
define( 'IMAGIFY_INC_URL', IMAGIFY_URL . 'inc/' );
define( 'IMAGIFY_ADMIN_URL', IMAGIFY_INC_URL . 'admin/' );
define( 'IMAGIFY_ASSETS_URL', IMAGIFY_URL . 'assets/' );
define( 'IMAGIFY_ASSETS_JS_URL', IMAGIFY_ASSETS_URL . 'js/' );
define( 'IMAGIFY_ASSETS_CSS_URL', IMAGIFY_ASSETS_URL . 'css/' );
define( 'IMAGIFY_ASSETS_IMG_URL', IMAGIFY_ASSETS_URL . 'images/' );
define( 'IMAGIFY_MAX_BYTES' , 5242880 );
define( 'IMAGIFY_INT_MAX' , PHP_INT_MAX - 30 );
define( 'IMAGIFY_MAX_BYTES', 5242880 );
define( 'IMAGIFY_INT_MAX', PHP_INT_MAX - 30 );

add_action( 'plugins_loaded', '_imagify_init' );
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,16 @@ public function is_s3_setup() {
*/
public function get_s3_info() {
global $as3cf;
return $as3cf ? $as3cf->get_attachment_s3_info( $this->id ) : false;

if ( ! $as3cf ) {
return false;
}

if ( method_exists( $as3cf, 'get_attachment_s3_info' ) ) {
return $as3cf->get_attachment_s3_info( $this->id );
}

return $as3cf->get_attachment_provider_info( $this->id );
}

/**
Expand Down Expand Up @@ -823,7 +832,11 @@ protected function get_file_from_s3( $file_path ) {
$s3_object['key'] = $directory . $this->filesystem->file_name( $file_path );

// Retrieve file from S3.
$as3cf->plugin_compat->copy_s3_file_to_server( $s3_object, $file_path );
if ( method_exists( $as3cf->plugin_compat, 'copy_s3_file_to_server' ) ) {
$as3cf->plugin_compat->copy_s3_file_to_server( $s3_object, $file_path );
} else {
$as3cf->plugin_compat->copy_provider_file_to_server( $s3_object, $file_path );
}

return $this->filesystem->exists( $file_path ) ? $file_path : false;
}
Expand Down Expand Up @@ -859,7 +872,11 @@ protected function maybe_send_attachment_to_s3( $metadata = null, $attachment_pa
return false;
}

$s3_data = $as3cf->upload_attachment_to_s3( $this->id, $metadata, $attachment_path, false, $remove_local_files );
if ( method_exists( $as3cf, 'upload_attachment_to_s3' ) ) {
$s3_data = $as3cf->upload_attachment_to_s3( $this->id, $metadata, $attachment_path, false, $remove_local_files );
} else {
$s3_data = $as3cf->upload_attachment( $this->id, $metadata, $attachment_path, false, $remove_local_files );
}

return ! is_wp_error( $s3_data );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ public function maybe_copy_files_from_s3( $ids, $results, $optimization_level )
$s3_object['key'] = $directory . $this->filesystem->file_name( $file_path );

// Retrieve file from S3.
$as3cf->plugin_compat->copy_s3_file_to_server( $s3_object, $file_path );
if ( method_exists( $as3cf->plugin_compat, 'copy_s3_file_to_server' ) ) {
$as3cf->plugin_compat->copy_s3_file_to_server( $s3_object, $file_path );
} else {
$as3cf->plugin_compat->copy_provider_file_to_server( $s3_object, $file_path );
}

unset( $s3_data[ $id ], $ids[ $id ] );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function init() {
return;
}

if ( defined( 'IMAGIFY_DISPLAY_PARTNERS' ) && false === IMAGIFY_DISPLAY_PARTNERS ) {
if ( defined( 'IMAGIFY_DISPLAY_PARTNERS' ) && ! IMAGIFY_DISPLAY_PARTNERS ) {
return;
}

Expand Down
10 changes: 8 additions & 2 deletions inc/functions/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ function imagify_sanitize_context( $context ) {
* @param string $class Name of the class to include.
*/
function imagify_autoload( $class ) {
static $strtolower;

if ( ! isset( $strtolower ) ) {
$strtolower = function_exists( 'mb_strtolower' ) ? 'mb_strtolower' : 'strtolower';
}

// Generic classes.
$classes = array(
'Imagify_Abstract_Attachment' => 1,
Expand Down Expand Up @@ -218,7 +224,7 @@ function imagify_autoload( $class ) {
);

if ( isset( $classes[ $class ] ) ) {
$class = str_replace( '_', '-', strtolower( $class ) );
$class = str_replace( '_', '-', call_user_func( $strtolower, $class ) );
include IMAGIFY_CLASSES_PATH . 'class-' . $class . '.php';
return;
}
Expand All @@ -242,7 +248,7 @@ function imagify_autoload( $class ) {

if ( isset( $classes[ $class ] ) ) {
$folder = $classes[ $class ];
$class = str_replace( '_', '-', strtolower( $class ) );
$class = str_replace( '_', '-', call_user_func( $strtolower, $class ) );
include IMAGIFY_3RD_PARTY_PATH . $folder . '/inc/classes/class-' . $class . '.php';
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "imagify",
"description": "Imagify Image Optimizer. Dramatically reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwidth.",
"version": "1.8.2",
"version": "1.8.3",
"homepage": "https://wordpress.org/plugins/imagify/",
"license": "GPL-2.0",
"private": true,
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: wp_media, GregLone
Tags: compress image, images, performance, optimization, photos, upload, resize, gif, png, jpg, reduce image size, retina
Requires at least: 4.0.0
Tested up to: 4.9.8
Stable tag: 1.8.2
Stable tag: 1.8.3

Dramatically reduce image file sizes without losing quality, make your website load faster, boost your SEO and save money on your bandwidth.

Expand Down Expand Up @@ -138,6 +138,12 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
4. Other Media Page

== Changelog ==
= 1.8.3 - 2018/11/24 =
* Improvement: compatibility with new version of WP Offload Media plugin.
* Improvement: some wording about AXIF Data and the 2MB limit.
* Bug Fix: the lock icon now displays correctly.
* Bug Fix: a text encoding issue with some server configurations.

= 1.8.2 - 2018/09/12 =
* New: display partnership links (can be removed).
* Improvement: display a small spinner when opening a folder in the custom folders selector.
Expand Down
2 changes: 1 addition & 1 deletion views/page-bulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
<?php
printf(
/* translators: %s is a file size. */
esc_html__( 'All images greater than %s will be optimized when using a paid plan.', 'imagify' ),
esc_html__( 'All images greater than %s (after resizing, if any) will be optimized when using a paid plan.', 'imagify' ),
esc_html( imagify_size_format( get_imagify_max_image_size() ) )
);
?>
Expand Down
8 changes: 4 additions & 4 deletions views/page-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@

<p class="imagify-setting-line">
<?php
$info = __( 'Keep all EXIF data from your images. EXIF are informations stored in your pictures like shutter speed, exposure compensation, ISO, etc...', 'imagify' );
$info .= '<a href="' . esc_url( imagify_get_external_url( 'exif' ) ) . '" target="_blank">' . __( 'Learn more', 'imagify' ) . '</a><br/><br/>';
$info .= __( 'If you are a photographer, you may be interested in this option if you are displaying on your pages some info like the model of your camera.', 'imagify' );
$info = __( 'EXIF data is information stored in your pictures like shutter speed, exposure compensation, ISO, etc...', 'imagify' );
$info .= ' <a href="' . esc_url( imagify_get_external_url( 'exif' ) ) . '" target="_blank">' . __( 'Learn more', 'imagify' ) . '</a><br/><br/>';
$info .= __( 'If you are a photographer, you may be interested in this option if you are displaying info like the model of your camera on your pages. Also, keeping EXIF data can fix some colorimetric problems.', 'imagify' );

$settings->field_checkbox( array(
'option_name' => 'exif',
'label' => __( 'EXIF Data', 'imagify' ),
'label' => __( 'Keep all EXIF data from your images', 'imagify' ),
'info' => $info,
) );
?>
Expand Down

0 comments on commit 654aa25

Please sign in to comment.