From 2195bf9226cb6496c72c7f0067ebc6cb57ca986f Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Fri, 22 Jul 2016 10:15:26 +0000 Subject: [PATCH] code < 80 char per line --- readme.txt | 2 +- wp-resized2cache.php | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/readme.txt b/readme.txt index fd90d4d..2553db4 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://paypal.me/petermolnar/3 Tags: image, cache, image quality, Requires at least: 3.0 Tested up to: 4.4.2 -Stable tag: 0.3 +Stable tag: 0.3.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html diff --git a/wp-resized2cache.php b/wp-resized2cache.php index 82d5f09..1fb96b5 100644 --- a/wp-resized2cache.php +++ b/wp-resized2cache.php @@ -3,7 +3,7 @@ Plugin Name: wp-resized2cache Plugin URI: https://github.com/petermolnar/wp-resized2cache Description: Sharpen, enchance and move resized images to cache folder -Version: 0.3 +Version: 0.3.1 Author: Peter Molnar Author URI: http://petermolnar.eu/ License: GPLv3 @@ -100,12 +100,11 @@ function jpeg_quality () { function sharpen( $resized ) { if ( ! class_exists( '\Imagick' ) ) { - debug('Please install Imagick extension; otherwise this plugin will not work as well as it should.', 4); + debug( 'Please install Imagick extension' + . 'otherwise this plugin will not work as well as it should.', 4); } /* - preg_match ( '/(.*)-([0-9]+)x([0-9]+)\.([0-9A-Za-z]{2,4})/', $resized, $details ); - * 0 => original var * 1 => full original file path without extension * 2 => resized size w @@ -134,7 +133,11 @@ function sharpen( $resized ) { $imagick->setImageCompression( \Imagick::COMPRESSION_JPEG ); $imagick->setImageCompressionQuality( jpeg_quality() ); $imagick->setInterlaceScheme( \Imagick::INTERLACE_PLANE ); - $imagick = \apply_filters( "wp_resized2cache_imagick", $imagick, $resized ); + $imagick = \apply_filters( + "wp_resized2cache_imagick", + $imagick, + $resized + ); $imagick->writeImage($cached); $imagick->destroy(); } @@ -219,10 +222,13 @@ function debug( $message, $level = LOG_NOTICE ) { } /** - * + * test if an object is actually a post */ function is_post ( &$post ) { - if ( !empty($post) && is_object($post) && isset($post->ID) && !empty($post->ID) ) + if ( ! empty( $post ) && + is_object( $post ) && + isset( $post->ID ) && + ! empty( $post->ID ) ) return true; return false;