Skip to content

Commit

Permalink
Merge branch 'branch-1.8.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Screenfeed committed Dec 18, 2018
2 parents ea57993 + dfaec52 commit 8359d58
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
4 changes: 2 additions & 2 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.4
* Version: 1.8.4.1
* Author: WP Media
* Author URI: https://wp-media.me/
* Licence: GPLv2
Expand All @@ -17,7 +17,7 @@
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );

// Imagify defines.
define( 'IMAGIFY_VERSION', '1.8.4' );
define( 'IMAGIFY_VERSION', '1.8.4.1' );
define( 'IMAGIFY_WP_MIN', '4.0' );
define( 'IMAGIFY_SLUG', 'imagify' );
define( 'IMAGIFY_FILE', __FILE__ );
Expand Down
36 changes: 29 additions & 7 deletions inc/classes/class-imagify.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Imagify extends Imagify_Deprecated {
*
* @var string
*/
const VERSION = '1.2';
const VERSION = '1.2.1';
/**
* The Imagify API endpoint.
*
Expand Down Expand Up @@ -454,10 +454,9 @@ private function curl_http_call( $url, $args = array() ) {
return new WP_Error( 'curl', 'cURL isn\'t installed on the server.' );
}

$url = self::API_ENDPOINT . $url;

try {
$ch = @curl_init();
$url = self::API_ENDPOINT . $url;
$ch = @curl_init();

if ( ! is_resource( $ch ) ) {
throw new Exception( 'Could not initialize a new cURL handle' );
Expand Down Expand Up @@ -489,13 +488,36 @@ private function curl_http_call( $url, $args = array() ) {
curl_setopt( $ch, CURLOPT_POSTFIELDS, $args['post_data'] );
}

if ( defined( 'CURLOPT_PROTOCOLS' ) ) {
curl_setopt( $ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS );
}

$user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ) );

curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HEADER, false );
curl_setopt( $ch, CURLOPT_HTTPHEADER, $this->headers );
curl_setopt( $ch, CURLOPT_TIMEOUT, $args['timeout'] );
@curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 0 );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $args['timeout'] );
curl_setopt( $ch, CURLOPT_USERAGENT, $user_agent );
@curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, false );
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );

/**
* Tell which http version to use with cURL during image optimization.
*
* @since 1.8.4.1
* @author Grégory Viguier
*
* @param $use_version_1_0 bool True to use version 1.0. False for 1.1. Default is true.
*/
if ( apply_filters( 'imagify_curl_http_version_1_0', true ) ) {
curl_setopt( $ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 );
} else {
curl_setopt( $ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
}

$response = curl_exec( $ch );
$error = curl_error( $ch );
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.4",
"version": "1.8.4.1",
"homepage": "https://wordpress.org/plugins/imagify/",
"license": "GPL-2.0",
"private": true,
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ When the plugin is disabled, your existing images remain optimized. Backups of t
4. Other Media Page

== Changelog ==
= 1.8.4.1 - 2018/12/18 =
* Improvement: prevent "unknown error" messages that some users are getting since yesterday.

= 1.8.4 - 2018/11/12 =
* Improvement: automatic optimization is delayed further, it now happens after the image original data is stored in the database. This new process should be more reliable.
* Improvement: compatibility with wordpress.com.
Expand Down

0 comments on commit 8359d58

Please sign in to comment.