Smush Image Compression and Optimization - Version 1.3.2

Version Description

Download this release

Release Info

Developer alexdunae
Plugin Icon 128x128 Smush Image Compression and Optimization
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.3.1 to 1.3.2

Files changed (2) hide show
  1. readme.txt +8 -4
  2. wp-smushit.php +11 -7
readme.txt CHANGED
@@ -1,13 +1,13 @@
1
  === WP Smush.it ===
2
  Plugin Name: WP Smush.it
3
- Version: 1.3.1
4
  Author: Dialect
5
  Author URI: http://dialect.ca/?wp_smush_it
6
  Contributors: alexdunae
7
  Tags: images, image, attachments, attachment
8
  Requires at least: 2.8
9
- Tested up to: 3.0.3
10
- Stable tag: 1.3.1
11
 
12
  Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress.
13
 
@@ -47,6 +47,10 @@ Plugin updates are announced on [http://www.twitter.com/TheCHANGELOG](http://www
47
 
48
  == Changelog ==
49
 
 
 
 
 
50
  = 1.3.1
51
  * handle images stored on other domains -- props to [ka-ri-ne](http://wordpress.org/support/profile/ka-ri-ne) for the fix
52
  * avoid time-out errors when working with larger files -- props to [Milan Dinić](http://wordpress.org/support/profile/dimadin) for the fix
@@ -114,7 +118,7 @@ Plugin updates are announced on [http://www.twitter.com/TheCHANGELOG](http://www
114
 
115
  == Contact and Credits ==
116
 
117
- Written by Alex Dunae at Dialect ([dialect.ca](http://dialect.ca/?wp_smush_it), e-mail 'alex' at 'dialect dot ca'), 2008-10.
118
 
119
  WP Smush.it includes a copy of the [PEAR JSON library](http://pear.php.net/pepr/pepr-proposal-show.php?id=198) written by Michal Migurski.
120
 
1
  === WP Smush.it ===
2
  Plugin Name: WP Smush.it
3
+ Version: 1.3.2
4
  Author: Dialect
5
  Author URI: http://dialect.ca/?wp_smush_it
6
  Contributors: alexdunae
7
  Tags: images, image, attachments, attachment
8
  Requires at least: 2.8
9
+ Tested up to: 3.0.4
10
+ Stable tag: 1.3.2
11
 
12
  Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress.
13
 
47
 
48
  == Changelog ==
49
 
50
+ = 1.3.2
51
+ * removed realpath() call
52
+ * IPv6 compat
53
+
54
  = 1.3.1
55
  * handle images stored on other domains -- props to [ka-ri-ne](http://wordpress.org/support/profile/ka-ri-ne) for the fix
56
  * avoid time-out errors when working with larger files -- props to [Milan Dinić](http://wordpress.org/support/profile/dimadin) for the fix
118
 
119
  == Contact and Credits ==
120
 
121
+ Written by Alex Dunae at Dialect ([dialect.ca](http://dialect.ca/?wp_smush_it), e-mail 'alex' at 'dialect dot ca'), 2008-11.
122
 
123
  WP Smush.it includes a copy of the [PEAR JSON library](http://pear.php.net/pepr/pepr-proposal-show.php?id=198) written by Michal Migurski.
124
 
wp-smushit.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Integrate the Smush.it API into WordPress.
4
- * @version 1.3.1
5
  * @package WP_SmushIt
6
  */
7
  /*
@@ -9,7 +9,7 @@ Plugin Name: WP Smush.it
9
  Plugin URI: http://dialect.ca/code/wp-smushit/
10
  Description: Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress.
11
  Author: Dialect
12
- Version: 1.3.1
13
  Author URI: http://dialect.ca/?wp_smush_it
14
  */
15
 
@@ -109,16 +109,20 @@ function wp_smushit_manual() {
109
  * @returns array
110
  */
111
  function wp_smushit($file) {
112
- // dont't run on localhost
113
- if( '127.0.0.1' == $_SERVER['SERVER_ADDR'] )
114
  return array($file, __('Not processed (local file)', WP_SMUSHIT_DOMAIN));
115
 
116
- // canonicalize path
117
- $file_path = realpath($file);
 
 
 
 
118
 
119
  // check that the file exists
120
  if ( FALSE === file_exists($file_path) || FALSE === is_file($file_path) ) {
121
- $msg = sprintf(__("Could not $file_path find <span class='code'>%s</span>", WP_SMUSHIT_DOMAIN), $file_path);
122
  return array($file, $msg);
123
  }
124
 
1
  <?php
2
  /**
3
  * Integrate the Smush.it API into WordPress.
4
+ * @version 1.3.2
5
  * @package WP_SmushIt
6
  */
7
  /*
9
  Plugin URI: http://dialect.ca/code/wp-smushit/
10
  Description: Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress.
11
  Author: Dialect
12
+ Version: 1.3.2
13
  Author URI: http://dialect.ca/?wp_smush_it
14
  */
15
 
109
  * @returns array
110
  */
111
  function wp_smushit($file) {
112
+ // dont't run on localhost, IPv4 and IPv6 checks
113
+ if( in_array($_SERVER['SERVER_ADDR'], array('127.0.0.1', '::1')) )
114
  return array($file, __('Not processed (local file)', WP_SMUSHIT_DOMAIN));
115
 
116
+ // canonicalize path - disabled 2011-02-1 troubleshooting 'Could not find...' errors.
117
+ // From the PHP docs: "The running script must have executable permissions on
118
+ // all directories in the hierarchy, otherwise realpath() will return FALSE."
119
+ // $file_path = realpath($file);
120
+
121
+ $file_path = $file;
122
 
123
  // check that the file exists
124
  if ( FALSE === file_exists($file_path) || FALSE === is_file($file_path) ) {
125
+ $msg = sprintf(__("Could not find <span class='code'>%s</span>", WP_SMUSHIT_DOMAIN), $file_path);
126
  return array($file, $msg);
127
  }
128