Kraken.io Image Optimizer - Version 1.0.5.6

Version Description

  • Rolled back to old way of replacing images in light of reported issues.
Download this release

Release Info

Developer karim79
Plugin Icon 128x128 Kraken.io Image Optimizer
Version 1.0.5.6
Comparing to
See all releases

Code changes from version 1.0.5.5 to 1.0.5.6

Files changed (2) hide show
  1. kraken.php +9 -23
  2. readme.txt +4 -1
kraken.php CHANGED
@@ -21,8 +21,8 @@
21
  * Plugin URI: http://wordpress.org/plugins/kraken-image-optimizer/
22
  * Description: This plugin allows you to optimize your WordPress images through the Kraken API, the world's most advanced image optimization solution.
23
  * Author: Karim Salman
24
- * Version: 1.0.5.5
25
- * Stable Tag: 1.0.5.5
26
  * Author URI: https://kraken.io
27
  * License GPL2
28
  */
@@ -445,27 +445,13 @@ if ( !class_exists( 'Wp_Kraken' ) ) {
445
 
446
  function replace_image( $image_path, $kraked_url ) {
447
  $rv = false;
448
- $fp = fopen($image_path, 'w+');
449
- $ch = curl_init();
450
- $headers = array();
451
- $headers[] = "Connection: keep-alive";
452
- $headers[] = "Keep-Alive: 300";
453
- curl_setopt($ch, CURLOPT_URL, $kraked_url);
454
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
455
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
456
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
457
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
458
- curl_setopt($ch, CURLOPT_AUTOREFERER, false);
459
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
460
- curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
461
- curl_setopt($ch, CURLOPT_FAILONERROR, true);
462
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
463
- curl_setopt($ch, CURLOPT_TIMEOUT, 120);
464
- curl_setopt($ch, CURLOPT_FILE, $fp);
465
- $rv = curl_exec($ch) !== false;
466
- curl_close($ch);
467
- fclose($fp);
468
- return $rv;
469
  }
470
 
471
  function optimize_image( $image_path, $type ) {
21
  * Plugin URI: http://wordpress.org/plugins/kraken-image-optimizer/
22
  * Description: This plugin allows you to optimize your WordPress images through the Kraken API, the world's most advanced image optimization solution.
23
  * Author: Karim Salman
24
+ * Version: 1.0.5.6
25
+ * Stable Tag: 1.0.5.6
26
  * Author URI: https://kraken.io
27
  * License GPL2
28
  */
445
 
446
  function replace_image( $image_path, $kraked_url ) {
447
  $rv = false;
448
+ $ch = curl_init( $kraked_url );
449
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
450
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
451
+ curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 0 );
452
+ $result = curl_exec( $ch );
453
+ $rv = file_put_contents( $image_path, $result );
454
+ return $rv !== false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  }
456
 
457
  function optimize_image( $image_path, $type ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: Image Optimizer, Image Optimiser, Optimize, Images, Media, Performance, SE
4
  Requires at least: 3.0.1
5
  Tested up to: 4.1
6
  Donate link: https://kraken.io
7
- Stable tag: 1.0.5.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
 
@@ -94,6 +94,9 @@ You will need to switch the Media Library from the Thumbnail view to the List vi
94
 
95
  == Changelog ==
96
 
 
 
 
97
  = 1.0.5.5 =
98
  * Fixed potentially breaking change to do with new PHP syntax.
99
 
4
  Requires at least: 3.0.1
5
  Tested up to: 4.1
6
  Donate link: https://kraken.io
7
+ Stable tag: 1.0.5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10
 
94
 
95
  == Changelog ==
96
 
97
+ = 1.0.5.6 =
98
+ * Rolled back to old way of replacing images in light of reported issues.
99
+
100
  = 1.0.5.5 =
101
  * Fixed potentially breaking change to do with new PHP syntax.
102