Smush Image Compression and Optimization - Version 1.2.8

Version Description

  • fixed path checking on Windows servers
Download this release

Release Info

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

Code changes from version 1.2.7 to 1.2.8

Files changed (2) hide show
  1. readme.txt +6 -2
  2. wp-smushit.php +7 -7
readme.txt CHANGED
@@ -1,13 +1,13 @@
1
  === WP Smush.it ===
2
  Plugin Name: WP Smush.it
3
- Version: 1.2.7
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.5
9
  Tested up to: 2.9.1
10
- Stable tag: 1.2.7
11
 
12
  Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress.
13
 
@@ -48,6 +48,9 @@ Plugin updates are announced on [http://www.twitter.com/TheCHANGELOG](http://www
48
  1. Done!
49
 
50
  == Changelog ==
 
 
 
51
  = 1.2.7 =
52
  * update to workaround WordPress's new JSON compat layer (see [trac ticket](http://core.trac.wordpress.org/ticket/11827))
53
 
@@ -107,3 +110,4 @@ Written by Alex Dunae at Dialect ([dialect.ca](http://dialect.ca/?wp_smush_it),
107
  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.
108
 
109
  Smush.it was created by [Nicole Sullivan](http://www.stubbornella.org/content/) and [Stoyan Stefanov](http://phpied.com/).
 
1
  === WP Smush.it ===
2
  Plugin Name: WP Smush.it
3
+ Version: 1.2.8
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.5
9
  Tested up to: 2.9.1
10
+ Stable tag: 1.2.8
11
 
12
  Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress.
13
 
48
  1. Done!
49
 
50
  == Changelog ==
51
+ = 1.2.8 =
52
+ * fixed path checking on Windows servers
53
+
54
  = 1.2.7 =
55
  * update to workaround WordPress's new JSON compat layer (see [trac ticket](http://core.trac.wordpress.org/ticket/11827))
56
 
110
  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.
111
 
112
  Smush.it was created by [Nicole Sullivan](http://www.stubbornella.org/content/) and [Stoyan Stefanov](http://phpied.com/).
113
+
wp-smushit.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Integrate the Smush.it API into WordPress.
4
- * @version 1.2.7
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.2.7
13
  Author URI: http://dialect.ca/?wp_smush_it
14
  */
15
 
@@ -31,7 +31,7 @@ define('SMUSHIT_BASE_URL', 'http://smushit.com/');
31
 
32
  define('WP_SMUSHIT_DOMAIN', 'wp_smushit');
33
 
34
- define('WP_SMUSHIT_UA', 'WP Smush.it/1.2.7 (+http://dialect.ca/code/wp-smushit)');
35
 
36
  define('WP_SMUSHIT_GIF_TO_PNG', intval(get_option('wp_smushit_gif_to_png')));
37
 
@@ -56,7 +56,7 @@ add_action('manage_media_custom_column', 'wp_smushit_custom_column', 10, 2);
56
  add_action('admin_menu', 'wp_smushit_add_pages');
57
  add_action('admin_init', 'wp_smushit_init');
58
  add_action('admin_action_wp_smushit_manual', 'wp_smushit_manual');
59
- add_action('admin_action_wp_smushit_theme', 'wp_smushit_theme');
60
 
61
 
62
  /**
@@ -73,7 +73,7 @@ function wp_smushit_init() {
73
  }
74
 
75
  function wp_smushit_add_pages() {
76
- add_submenu_page('themes.php', 'Smush.it', 'WP Smush.it', 8, dirname(__FILE__) . '/theme.php');
77
  add_options_page(__('WP Smush.it Options', WP_SMUSHIT_DOMAIN), 'WP Smush.it', 8, dirname(__FILE__) . '/options.php');
78
  add_filter( 'plugin_action_links', 'wp_smushit_filter_plugin_actions', 10, 2 );
79
  }
@@ -133,7 +133,7 @@ function wp_smushit_manual() {
133
  */
134
  function wp_smushit($file) {
135
  // dont't run on localhost
136
- if( '127.0.0.1' == $_SERVER['SERVER_ADDR'] && FALSE )
137
  return array($file, __('Not processed (local file)', WP_SMUSHIT_DOMAIN));
138
 
139
  // canonicalize path
@@ -152,7 +152,7 @@ function wp_smushit($file) {
152
  }
153
 
154
  // check that the file is within the WP_CONTENT_DIR
155
- if ( 0 !== stripos($file_path, WP_CONTENT_DIR) || FALSE) {
156
  $msg = sprintf(__("<span class='code'>%s</span> must be within the content directory (<span class='code'>%s</span>)", WP_SMUSHIT_DOMAIN), htmlentities($file_path), WP_CONTENT_DIR);
157
 
158
  return array($file, $msg);
1
  <?php
2
  /**
3
  * Integrate the Smush.it API into WordPress.
4
+ * @version 1.2.8
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.2.8
13
  Author URI: http://dialect.ca/?wp_smush_it
14
  */
15
 
31
 
32
  define('WP_SMUSHIT_DOMAIN', 'wp_smushit');
33
 
34
+ define('WP_SMUSHIT_UA', 'WP Smush.it/1.2.8 (+http://dialect.ca/code/wp-smushit)');
35
 
36
  define('WP_SMUSHIT_GIF_TO_PNG', intval(get_option('wp_smushit_gif_to_png')));
37
 
56
  add_action('admin_menu', 'wp_smushit_add_pages');
57
  add_action('admin_init', 'wp_smushit_init');
58
  add_action('admin_action_wp_smushit_manual', 'wp_smushit_manual');
59
+ //add_action('admin_action_wp_smushit_theme', 'wp_smushit_theme');
60
 
61
 
62
  /**
73
  }
74
 
75
  function wp_smushit_add_pages() {
76
+ //add_submenu_page('themes.php', 'Smush.it', 'WP Smush.it', 8, dirname(__FILE__) . '/theme.php');
77
  add_options_page(__('WP Smush.it Options', WP_SMUSHIT_DOMAIN), 'WP Smush.it', 8, dirname(__FILE__) . '/options.php');
78
  add_filter( 'plugin_action_links', 'wp_smushit_filter_plugin_actions', 10, 2 );
79
  }
133
  */
134
  function wp_smushit($file) {
135
  // dont't run on localhost
136
+ if( '127.0.0.1' == $_SERVER['SERVER_ADDR'] )
137
  return array($file, __('Not processed (local file)', WP_SMUSHIT_DOMAIN));
138
 
139
  // canonicalize path
152
  }
153
 
154
  // check that the file is within the WP_CONTENT_DIR
155
+ if ( 0 !== stripos($file_path, realpath(WP_CONTENT_DIR)) ) {
156
  $msg = sprintf(__("<span class='code'>%s</span> must be within the content directory (<span class='code'>%s</span>)", WP_SMUSHIT_DOMAIN), htmlentities($file_path), WP_CONTENT_DIR);
157
 
158
  return array($file, $msg);