Smush Image Compression and Optimization - Version 1.6.5.2

Version Description

  • Corrected issues with Windows paths compare.
  • Added debug output option to help with user support issues.
Download this release

Release Info

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

Code changes from version 1.6.5.1 to 1.6.5.2

languages/wp_smushit-default.mo CHANGED
Binary file
languages/wp_smushit-default.po CHANGED
@@ -1,14 +1,14 @@
1
- # Translation of the WordPress plugin WP Smush.it 1.6.5.1 by WPMU DEV.
2
  # Copyright (C) 2013 WPMU DEV
3
  # This file is distributed under the same license as the WP Smush.it package.
4
  # FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
5
  #
6
  msgid ""
7
  msgstr ""
8
- "Project-Id-Version: WP Smush.it 1.6.5.1\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-smushit\n"
10
- "POT-Creation-Date: 2013-08-20 07:59-0500\n"
11
- "PO-Revision-Date: 2013-08-20 09:02-0500\n"
12
  "Last-Translator: Paul Menard <paul@codehooligans.com>\n"
13
  "Language-Team: \n"
14
  "MIME-Version: 1.0\n"
@@ -16,183 +16,215 @@ msgstr ""
16
  "Content-Transfer-Encoding: 8bit\n"
17
  "X-Poedit-Language: English\n"
18
 
19
- #: wp-smushit.php:104
20
  msgid "Use Smush.it on upload?"
21
  msgstr ""
22
 
23
- #: wp-smushit.php:106
24
  msgid "How many seconds should we wait for a response from Smush.it?"
25
  msgstr ""
26
 
27
- #: wp-smushit.php:120
 
 
 
 
28
  msgid "Automatically process on upload"
29
  msgstr ""
30
 
31
- #: wp-smushit.php:121
32
  msgid "Do not process on upload"
33
  msgstr ""
34
 
35
- #: wp-smushit.php:125
36
  #, php-format
37
  msgid "Temporarily disabled until %s"
38
  msgstr ""
39
 
40
- #: wp-smushit.php:178
 
 
 
 
41
  msgid "Bulk WP Smush.it"
42
  msgstr ""
43
 
44
- #: wp-smushit.php:182
45
  msgid "<p>You don't appear to have uploaded any images yet.</p>"
46
  msgstr ""
47
 
48
- #: wp-smushit.php:186
49
- msgid "<p>This tool will run all of the images in your media library through the WP Smush.it web service. It won't re-smush images that were successfully smushed before. It will retry images that were not successfully smushed.</p>"
50
  msgstr ""
51
 
52
- #: wp-smushit.php:188
53
- msgid "<p>It uploads each and every file to Yahoo! and then downloads the resulting file. Note: the Yahoo! Smush.it service does not support https:// urls. So the image MUST be accessible via the public internet over a non-SSL URL. It can take a long time.</p>"
54
  msgstr ""
55
 
56
- #: wp-smushit.php:190
57
- #, php-format
58
- msgid "<p>We found %d images in your media library. Be forewarned, <strong>it will take <em>at least</em> %d minutes</strong> to process all these images if they have never been smushed before.</p>"
59
  msgstr ""
60
 
61
- #: wp-smushit.php:192
62
- msgid "<p><em>N.B. If your server <tt>gzip</tt>s content you may not see the progress updates as your files are processed.</em></p>"
 
 
 
 
63
  msgstr ""
64
 
65
- #: wp-smushit.php:194
 
 
 
 
 
 
 
 
66
  #, php-format
67
  msgid "<p><strong>This is an experimental feature.</strong> Please post any feedback to the %s.</p>"
68
  msgstr ""
69
 
70
- #: wp-smushit.php:194
71
  msgid "WordPress WP Smush.it forums"
72
  msgstr ""
73
 
74
- #: wp-smushit.php:198
 
 
 
 
 
75
  msgid "Run all my images through WP Smush.it right now"
76
  msgstr ""
77
 
78
- #: wp-smushit.php:205
 
 
 
 
 
 
 
 
79
  msgid "Cheatin&#8217; uh?"
80
  msgstr ""
81
 
82
- #: wp-smushit.php:212
83
  #, php-format
84
  msgid "<p>Processing <strong>%s</strong>&hellip;<br />"
85
  msgstr ""
86
 
87
- #: wp-smushit.php:227
88
- #: wp-smushit.php:382
89
  msgid "No savings"
90
  msgstr ""
91
 
92
- #: wp-smushit.php:228
93
- #: wp-smushit.php:240
94
  msgid "<strong>already smushed</strong>"
95
  msgstr ""
96
 
97
- #: wp-smushit.php:256
98
  msgid "<hr /></p>Smush.it finished processing.</p>"
99
  msgstr ""
100
 
101
- #: wp-smushit.php:269
102
  msgid "You don't have permission to work with uploaded files."
103
  msgstr ""
104
 
105
- #: wp-smushit.php:273
106
  msgid "No attachment ID was provided."
107
  msgstr ""
108
 
109
- #: wp-smushit.php:307
110
  msgid "File path is empty"
111
  msgstr ""
112
 
113
- #: wp-smushit.php:311
114
  msgid "File URL is empty"
115
  msgstr ""
116
 
117
- #: wp-smushit.php:317
118
  msgid "Did not smush due to previous errors"
119
  msgstr ""
120
 
121
- #: wp-smushit.php:322
122
  #, php-format
123
  msgid "Could not find <span class='code'>%s</span>"
124
  msgstr ""
125
 
126
- #: wp-smushit.php:327
127
  #, php-format
128
  msgid "<span class='code'>%s</span> is not writable"
129
  msgstr ""
130
 
131
- #: wp-smushit.php:333
132
  #, php-format
133
  msgid "<span style=\"color:#FF0000;\">Skipped (%s) Unable to Smush due to Yahoo 1mb size limits. See <a href=\"http://developer.yahoo.com/yslow/smushit/faq.html#faq_restrict\">FAQ</a></span>"
134
  msgstr ""
135
 
136
- #: wp-smushit.php:338
137
  #, php-format
138
  msgid "<span class='code'>%s</span> must be within the website directory (<span class='code'>%s</span>)"
139
  msgstr ""
140
 
141
- #: wp-smushit.php:349
142
  #, php-format
143
  msgid "<span class='code'>%s</span> must be within the website home URL (<span class='code'>%s</span>)"
144
  msgstr ""
145
 
146
- #: wp-smushit.php:359
147
  msgid "Error posting to Smush.it"
148
  msgstr ""
149
 
150
- #: wp-smushit.php:365
151
- #: wp-smushit.php:379
152
  msgid "Bad response from Smush.it"
153
  msgstr ""
154
 
155
- #: wp-smushit.php:385
156
  msgid "Smush.it error: "
157
  msgstr ""
158
 
159
- #: wp-smushit.php:385
160
  msgid "unknown error"
161
  msgstr ""
162
 
163
- #: wp-smushit.php:386
164
  #, php-format
165
  msgid " while processing <span class='code'>%s</span> (<span class='code'>%s</span>)"
166
  msgstr ""
167
 
168
- #: wp-smushit.php:402
169
  #, php-format
170
  msgid "Error downloading file (%s)"
171
  msgstr ""
172
 
173
- #: wp-smushit.php:406
174
  #, php-format
175
  msgid "Unable to locate Smuch.it downloaded file (%s)"
176
  msgstr ""
177
 
178
- #: wp-smushit.php:420
179
  #, php-format
180
  msgid "Reduced by %01.1f%% (%s)"
181
  msgstr ""
182
 
183
- #: wp-smushit.php:527
184
  msgid "WP Smush.it requires WordPress 2.8 or greater"
185
  msgstr ""
186
 
187
- #: wp-smushit.php:567
188
  msgid "Re-smush"
189
  msgstr ""
190
 
191
- #: wp-smushit.php:570
192
  msgid "Not processed"
193
  msgstr ""
194
 
195
- #: wp-smushit.php:573
196
  msgid "Smush.it now!"
197
  msgstr ""
198
 
1
+ # Translation of the WordPress plugin WP Smush.it 1.6.5.2 by WPMU DEV.
2
  # Copyright (C) 2013 WPMU DEV
3
  # This file is distributed under the same license as the WP Smush.it package.
4
  # FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
5
  #
6
  msgid ""
7
  msgstr ""
8
+ "Project-Id-Version: WP Smush.it 1.6.5.2\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-smushit\n"
10
+ "POT-Creation-Date: 2013-09-02 08:12-0500\n"
11
+ "PO-Revision-Date: 2013-09-02 09:13-0500\n"
12
  "Last-Translator: Paul Menard <paul@codehooligans.com>\n"
13
  "Language-Team: \n"
14
  "MIME-Version: 1.0\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
  "X-Poedit-Language: English\n"
18
 
19
+ #: wp-smushit.php:110
20
  msgid "Use Smush.it on upload?"
21
  msgstr ""
22
 
23
+ #: wp-smushit.php:113
24
  msgid "How many seconds should we wait for a response from Smush.it?"
25
  msgstr ""
26
 
27
+ #: wp-smushit.php:116
28
+ msgid "Enable debug processing"
29
+ msgstr ""
30
+
31
+ #: wp-smushit.php:131
32
  msgid "Automatically process on upload"
33
  msgstr ""
34
 
35
+ #: wp-smushit.php:132
36
  msgid "Do not process on upload"
37
  msgstr ""
38
 
39
+ #: wp-smushit.php:136
40
  #, php-format
41
  msgid "Temporarily disabled until %s"
42
  msgstr ""
43
 
44
+ #: wp-smushit.php:150
45
+ msgid "If you are having trouble with the plugin enable this option can reveal some information about your system needed for support."
46
+ msgstr ""
47
+
48
+ #: wp-smushit.php:195
49
  msgid "Bulk WP Smush.it"
50
  msgstr ""
51
 
52
+ #: wp-smushit.php:199
53
  msgid "<p>You don't appear to have uploaded any images yet.</p>"
54
  msgstr ""
55
 
56
+ #: wp-smushit.php:203
57
+ msgid "<p>This tool will run all of the images in your media library through the WP Smush.it web service. Any image already processed will not be reprocessed. Any new images or unsuccessful attempts will be processed.</p>"
58
  msgstr ""
59
 
60
+ #: wp-smushit.php:204
61
+ msgid "<p>As part of the Yahoo! Smush.it API this plugin wil provide a URL to each of your images to be processed. The Yahoo! service will download the image via the URL. The Yahoo Smush.it service will then return a URL to this plugin of the new version of the image. This image will be downloaded and replace the original image on your server.</p>"
62
  msgstr ""
63
 
64
+ #: wp-smushit.php:206
65
+ msgid "<p>Limitations of using the Yahoo Smush.it API</p>"
 
66
  msgstr ""
67
 
68
+ #: wp-smushit.php:209
69
+ msgid "The image MUST be less than 1 megabyte in size. This is a limit of the Yahoo! service not this plugin."
70
+ msgstr ""
71
+
72
+ #: wp-smushit.php:210
73
+ msgid "The image MUST be accessible via a non-https URL. The Yahoo! Smush.it service will not handle https:// image URLs. This is a limit of the Yahoo! service not this plugin."
74
  msgstr ""
75
 
76
+ #: wp-smushit.php:211
77
+ msgid "The image MUST publicly accessible server. As the Yahoo! Smush.it service needs to download the image via a URL the image needs to be on a public server and not a local local development system. This is a limit of the Yahoo! service not this plugin."
78
+ msgstr ""
79
+
80
+ #: wp-smushit.php:212
81
+ msgid "The image MUST be local to the site. This plugin cannot update images stored on Content Delivery Networks (CDN)"
82
+ msgstr ""
83
+
84
+ #: wp-smushit.php:215
85
  #, php-format
86
  msgid "<p><strong>This is an experimental feature.</strong> Please post any feedback to the %s.</p>"
87
  msgstr ""
88
 
89
+ #: wp-smushit.php:215
90
  msgid "WordPress WP Smush.it forums"
91
  msgstr ""
92
 
93
+ #: wp-smushit.php:219
94
+ #, php-format
95
+ msgid "<p>We found %d images in your media library. Be forewarned, <strong>it will take <em>at least</em> %d minutes</strong> to process all these images if they have never been smushed before.</p>"
96
+ msgstr ""
97
+
98
+ #: wp-smushit.php:222
99
  msgid "Run all my images through WP Smush.it right now"
100
  msgstr ""
101
 
102
+ #: wp-smushit.php:223
103
+ msgid "<p><em>N.B. If your server <tt>gzip</tt>s content you may not see the progress updates as your files are processed.</em></p>"
104
+ msgstr ""
105
+
106
+ #: wp-smushit.php:226
107
+ msgid "<p>DEBUG mode is currently enabled. To disable see the Settings > Media page.</p>"
108
+ msgstr ""
109
+
110
+ #: wp-smushit.php:234
111
  msgid "Cheatin&#8217; uh?"
112
  msgstr ""
113
 
114
+ #: wp-smushit.php:241
115
  #, php-format
116
  msgid "<p>Processing <strong>%s</strong>&hellip;<br />"
117
  msgstr ""
118
 
119
+ #: wp-smushit.php:251
120
+ #: wp-smushit.php:409
121
  msgid "No savings"
122
  msgstr ""
123
 
124
+ #: wp-smushit.php:252
125
+ #: wp-smushit.php:264
126
  msgid "<strong>already smushed</strong>"
127
  msgstr ""
128
 
129
+ #: wp-smushit.php:280
130
  msgid "<hr /></p>Smush.it finished processing.</p>"
131
  msgstr ""
132
 
133
+ #: wp-smushit.php:293
134
  msgid "You don't have permission to work with uploaded files."
135
  msgstr ""
136
 
137
+ #: wp-smushit.php:297
138
  msgid "No attachment ID was provided."
139
  msgstr ""
140
 
141
+ #: wp-smushit.php:323
142
  msgid "File path is empty"
143
  msgstr ""
144
 
145
+ #: wp-smushit.php:327
146
  msgid "File URL is empty"
147
  msgstr ""
148
 
149
+ #: wp-smushit.php:333
150
  msgid "Did not smush due to previous errors"
151
  msgstr ""
152
 
153
+ #: wp-smushit.php:338
154
  #, php-format
155
  msgid "Could not find <span class='code'>%s</span>"
156
  msgstr ""
157
 
158
+ #: wp-smushit.php:343
159
  #, php-format
160
  msgid "<span class='code'>%s</span> is not writable"
161
  msgstr ""
162
 
163
+ #: wp-smushit.php:348
164
  #, php-format
165
  msgid "<span style=\"color:#FF0000;\">Skipped (%s) Unable to Smush due to Yahoo 1mb size limits. See <a href=\"http://developer.yahoo.com/yslow/smushit/faq.html#faq_restrict\">FAQ</a></span>"
166
  msgstr ""
167
 
168
+ #: wp-smushit.php:359
169
  #, php-format
170
  msgid "<span class='code'>%s</span> must be within the website directory (<span class='code'>%s</span>)"
171
  msgstr ""
172
 
173
+ #: wp-smushit.php:371
174
  #, php-format
175
  msgid "<span class='code'>%s</span> must be within the website home URL (<span class='code'>%s</span>)"
176
  msgstr ""
177
 
178
+ #: wp-smushit.php:382
179
  msgid "Error posting to Smush.it"
180
  msgstr ""
181
 
182
+ #: wp-smushit.php:388
183
+ #: wp-smushit.php:406
184
  msgid "Bad response from Smush.it"
185
  msgstr ""
186
 
187
+ #: wp-smushit.php:412
188
  msgid "Smush.it error: "
189
  msgstr ""
190
 
191
+ #: wp-smushit.php:412
192
  msgid "unknown error"
193
  msgstr ""
194
 
195
+ #: wp-smushit.php:413
196
  #, php-format
197
  msgid " while processing <span class='code'>%s</span> (<span class='code'>%s</span>)"
198
  msgstr ""
199
 
200
+ #: wp-smushit.php:429
201
  #, php-format
202
  msgid "Error downloading file (%s)"
203
  msgstr ""
204
 
205
+ #: wp-smushit.php:433
206
  #, php-format
207
  msgid "Unable to locate Smuch.it downloaded file (%s)"
208
  msgstr ""
209
 
210
+ #: wp-smushit.php:447
211
  #, php-format
212
  msgid "Reduced by %01.1f%% (%s)"
213
  msgstr ""
214
 
215
+ #: wp-smushit.php:545
216
  msgid "WP Smush.it requires WordPress 2.8 or greater"
217
  msgstr ""
218
 
219
+ #: wp-smushit.php:585
220
  msgid "Re-smush"
221
  msgstr ""
222
 
223
+ #: wp-smushit.php:588
224
  msgid "Not processed"
225
  msgstr ""
226
 
227
+ #: wp-smushit.php:591
228
  msgid "Smush.it now!"
229
  msgstr ""
230
 
languages/wp_smushit-default.pot CHANGED
@@ -1,4 +1,4 @@
1
- # Translation of the WordPress plugin WP Smush.it 1.6.5.1 by WPMU DEV.
2
  # Copyright (C) 2013 WPMU DEV
3
  # This file is distributed under the same license as the WP Smush.it package.
4
  # FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
@@ -6,9 +6,9 @@
6
  #, fuzzy
7
  msgid ""
8
  msgstr ""
9
- "Project-Id-Version: WP Smush.it 1.6.5.1\n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-smushit\n"
11
- "POT-Creation-Date: 2013-08-20 07:59-0500\n"
12
  "PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,131 +16,179 @@ msgstr ""
16
  "Content-Type: text/plain; charset=utf-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
 
19
- #: wp-smushit.php:104
20
  msgid "Use Smush.it on upload?"
21
  msgstr ""
22
 
23
- #: wp-smushit.php:106
24
  msgid "How many seconds should we wait for a response from Smush.it?"
25
  msgstr ""
26
 
27
- #: wp-smushit.php:120
 
 
 
 
28
  msgid "Automatically process on upload"
29
  msgstr ""
30
 
31
- #: wp-smushit.php:121
32
  msgid "Do not process on upload"
33
  msgstr ""
34
 
35
- #: wp-smushit.php:125
36
  #, php-format
37
  msgid "Temporarily disabled until %s"
38
  msgstr ""
39
 
40
- #: wp-smushit.php:178
 
 
 
 
 
 
41
  msgid "Bulk WP Smush.it"
42
  msgstr ""
43
 
44
- #: wp-smushit.php:182
45
  msgid "<p>You don't appear to have uploaded any images yet.</p>"
46
  msgstr ""
47
 
48
- #: wp-smushit.php:186
49
  msgid ""
50
  "<p>This tool will run all of the images in your media library through the WP "
51
- "Smush.it web service. It won't re-smush images that were successfully "
52
- "smushed before. It will retry images that were not successfully smushed.</p>"
53
  msgstr ""
54
 
55
- #: wp-smushit.php:188
56
  msgid ""
57
- "<p>It uploads each and every file to Yahoo! and then downloads the resulting "
58
- "file. Note: the Yahoo! Smush.it service does not support https:// urls. So "
59
- "the image MUST be accessible via the public internet over a non-SSL URL. It "
60
- "can take a long time.</p>"
 
61
  msgstr ""
62
 
63
- #: wp-smushit.php:190
64
- #, php-format
 
 
 
65
  msgid ""
66
- "<p>We found %d images in your media library. Be forewarned, <strong>it will "
67
- "take <em>at least</em> %d minutes</strong> to process all these images if "
68
- "they have never been smushed before.</p>"
69
  msgstr ""
70
 
71
- #: wp-smushit.php:192
72
  msgid ""
73
- "<p><em>N.B. If your server <tt>gzip</tt>s content you may not see the "
74
- "progress updates as your files are processed.</em></p>"
 
 
 
 
 
 
 
 
 
75
  msgstr ""
76
 
77
- #: wp-smushit.php:194
 
 
 
 
 
 
78
  #, php-format
79
  msgid ""
80
  "<p><strong>This is an experimental feature.</strong> Please post any "
81
  "feedback to the %s.</p>"
82
  msgstr ""
83
 
84
- #: wp-smushit.php:194
85
  msgid "WordPress WP Smush.it forums"
86
  msgstr ""
87
 
88
- #: wp-smushit.php:198
 
 
 
 
 
 
 
 
89
  msgid "Run all my images through WP Smush.it right now"
90
  msgstr ""
91
 
92
- #: wp-smushit.php:205
 
 
 
 
 
 
 
 
 
 
 
 
93
  msgid "Cheatin&#8217; uh?"
94
  msgstr ""
95
 
96
- #: wp-smushit.php:212
97
  #, php-format
98
  msgid "<p>Processing <strong>%s</strong>&hellip;<br />"
99
  msgstr ""
100
 
101
- #: wp-smushit.php:227 wp-smushit.php:382
102
  msgid "No savings"
103
  msgstr ""
104
 
105
- #: wp-smushit.php:228 wp-smushit.php:240
106
  msgid "<strong>already smushed</strong>"
107
  msgstr ""
108
 
109
- #: wp-smushit.php:256
110
  msgid "<hr /></p>Smush.it finished processing.</p>"
111
  msgstr ""
112
 
113
- #: wp-smushit.php:269
114
  msgid "You don't have permission to work with uploaded files."
115
  msgstr ""
116
 
117
- #: wp-smushit.php:273
118
  msgid "No attachment ID was provided."
119
  msgstr ""
120
 
121
- #: wp-smushit.php:307
122
  msgid "File path is empty"
123
  msgstr ""
124
 
125
- #: wp-smushit.php:311
126
  msgid "File URL is empty"
127
  msgstr ""
128
 
129
- #: wp-smushit.php:317
130
  msgid "Did not smush due to previous errors"
131
  msgstr ""
132
 
133
- #: wp-smushit.php:322
134
  #, php-format
135
  msgid "Could not find <span class='code'>%s</span>"
136
  msgstr ""
137
 
138
- #: wp-smushit.php:327
139
  #, php-format
140
  msgid "<span class='code'>%s</span> is not writable"
141
  msgstr ""
142
 
143
- #: wp-smushit.php:333
144
  #, php-format
145
  msgid ""
146
  "<span style=\"color:#FF0000;\">Skipped (%s) Unable to Smush due to Yahoo 1mb "
@@ -148,70 +196,70 @@ msgid ""
148
  "html#faq_restrict\">FAQ</a></span>"
149
  msgstr ""
150
 
151
- #: wp-smushit.php:338
152
  #, php-format
153
  msgid ""
154
  "<span class='code'>%s</span> must be within the website directory (<span "
155
  "class='code'>%s</span>)"
156
  msgstr ""
157
 
158
- #: wp-smushit.php:349
159
  #, php-format
160
  msgid ""
161
  "<span class='code'>%s</span> must be within the website home URL (<span "
162
  "class='code'>%s</span>)"
163
  msgstr ""
164
 
165
- #: wp-smushit.php:359
166
  msgid "Error posting to Smush.it"
167
  msgstr ""
168
 
169
- #: wp-smushit.php:365 wp-smushit.php:379
170
  msgid "Bad response from Smush.it"
171
  msgstr ""
172
 
173
- #: wp-smushit.php:385
174
  msgid "Smush.it error: "
175
  msgstr ""
176
 
177
- #: wp-smushit.php:385
178
  msgid "unknown error"
179
  msgstr ""
180
 
181
- #: wp-smushit.php:386
182
  #, php-format
183
  msgid ""
184
  " while processing <span class='code'>%s</span> (<span class='code'>%s</span>)"
185
  msgstr ""
186
 
187
- #: wp-smushit.php:402
188
  #, php-format
189
  msgid "Error downloading file (%s)"
190
  msgstr ""
191
 
192
- #: wp-smushit.php:406
193
  #, php-format
194
  msgid "Unable to locate Smuch.it downloaded file (%s)"
195
  msgstr ""
196
 
197
- #: wp-smushit.php:420
198
  #, php-format
199
  msgid "Reduced by %01.1f%% (%s)"
200
  msgstr ""
201
 
202
- #: wp-smushit.php:527
203
  msgid "WP Smush.it requires WordPress 2.8 or greater"
204
  msgstr ""
205
 
206
- #: wp-smushit.php:567
207
  msgid "Re-smush"
208
  msgstr ""
209
 
210
- #: wp-smushit.php:570
211
  msgid "Not processed"
212
  msgstr ""
213
 
214
- #: wp-smushit.php:573
215
  msgid "Smush.it now!"
216
  msgstr ""
217
 
1
+ # Translation of the WordPress plugin WP Smush.it 1.6.5.2 by WPMU DEV.
2
  # Copyright (C) 2013 WPMU DEV
3
  # This file is distributed under the same license as the WP Smush.it package.
4
  # FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
6
  #, fuzzy
7
  msgid ""
8
  msgstr ""
9
+ "Project-Id-Version: WP Smush.it 1.6.5.2\n"
10
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-smushit\n"
11
+ "POT-Creation-Date: 2013-09-02 08:12-0500\n"
12
  "PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
16
  "Content-Type: text/plain; charset=utf-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
 
19
+ #: wp-smushit.php:110
20
  msgid "Use Smush.it on upload?"
21
  msgstr ""
22
 
23
+ #: wp-smushit.php:113
24
  msgid "How many seconds should we wait for a response from Smush.it?"
25
  msgstr ""
26
 
27
+ #: wp-smushit.php:116
28
+ msgid "Enable debug processing"
29
+ msgstr ""
30
+
31
+ #: wp-smushit.php:131
32
  msgid "Automatically process on upload"
33
  msgstr ""
34
 
35
+ #: wp-smushit.php:132
36
  msgid "Do not process on upload"
37
  msgstr ""
38
 
39
+ #: wp-smushit.php:136
40
  #, php-format
41
  msgid "Temporarily disabled until %s"
42
  msgstr ""
43
 
44
+ #: wp-smushit.php:150
45
+ msgid ""
46
+ "If you are having trouble with the plugin enable this option can reveal some "
47
+ "information about your system needed for support."
48
+ msgstr ""
49
+
50
+ #: wp-smushit.php:195
51
  msgid "Bulk WP Smush.it"
52
  msgstr ""
53
 
54
+ #: wp-smushit.php:199
55
  msgid "<p>You don't appear to have uploaded any images yet.</p>"
56
  msgstr ""
57
 
58
+ #: wp-smushit.php:203
59
  msgid ""
60
  "<p>This tool will run all of the images in your media library through the WP "
61
+ "Smush.it web service. Any image already processed will not be reprocessed. "
62
+ "Any new images or unsuccessful attempts will be processed.</p>"
63
  msgstr ""
64
 
65
+ #: wp-smushit.php:204
66
  msgid ""
67
+ "<p>As part of the Yahoo! Smush.it API this plugin wil provide a URL to each "
68
+ "of your images to be processed. The Yahoo! service will download the image "
69
+ "via the URL. The Yahoo Smush.it service will then return a URL to this "
70
+ "plugin of the new version of the image. This image will be downloaded and "
71
+ "replace the original image on your server.</p>"
72
  msgstr ""
73
 
74
+ #: wp-smushit.php:206
75
+ msgid "<p>Limitations of using the Yahoo Smush.it API</p>"
76
+ msgstr ""
77
+
78
+ #: wp-smushit.php:209
79
  msgid ""
80
+ "The image MUST be less than 1 megabyte in size. This is a limit of the "
81
+ "Yahoo! service not this plugin."
 
82
  msgstr ""
83
 
84
+ #: wp-smushit.php:210
85
  msgid ""
86
+ "The image MUST be accessible via a non-https URL. The Yahoo! Smush.it "
87
+ "service will not handle https:// image URLs. This is a limit of the Yahoo! "
88
+ "service not this plugin."
89
+ msgstr ""
90
+
91
+ #: wp-smushit.php:211
92
+ msgid ""
93
+ "The image MUST publicly accessible server. As the Yahoo! Smush.it service "
94
+ "needs to download the image via a URL the image needs to be on a public "
95
+ "server and not a local local development system. This is a limit of the "
96
+ "Yahoo! service not this plugin."
97
  msgstr ""
98
 
99
+ #: wp-smushit.php:212
100
+ msgid ""
101
+ "The image MUST be local to the site. This plugin cannot update images stored "
102
+ "on Content Delivery Networks (CDN)"
103
+ msgstr ""
104
+
105
+ #: wp-smushit.php:215
106
  #, php-format
107
  msgid ""
108
  "<p><strong>This is an experimental feature.</strong> Please post any "
109
  "feedback to the %s.</p>"
110
  msgstr ""
111
 
112
+ #: wp-smushit.php:215
113
  msgid "WordPress WP Smush.it forums"
114
  msgstr ""
115
 
116
+ #: wp-smushit.php:219
117
+ #, php-format
118
+ msgid ""
119
+ "<p>We found %d images in your media library. Be forewarned, <strong>it will "
120
+ "take <em>at least</em> %d minutes</strong> to process all these images if "
121
+ "they have never been smushed before.</p>"
122
+ msgstr ""
123
+
124
+ #: wp-smushit.php:222
125
  msgid "Run all my images through WP Smush.it right now"
126
  msgstr ""
127
 
128
+ #: wp-smushit.php:223
129
+ msgid ""
130
+ "<p><em>N.B. If your server <tt>gzip</tt>s content you may not see the "
131
+ "progress updates as your files are processed.</em></p>"
132
+ msgstr ""
133
+
134
+ #: wp-smushit.php:226
135
+ msgid ""
136
+ "<p>DEBUG mode is currently enabled. To disable see the Settings > Media page."
137
+ "</p>"
138
+ msgstr ""
139
+
140
+ #: wp-smushit.php:234
141
  msgid "Cheatin&#8217; uh?"
142
  msgstr ""
143
 
144
+ #: wp-smushit.php:241
145
  #, php-format
146
  msgid "<p>Processing <strong>%s</strong>&hellip;<br />"
147
  msgstr ""
148
 
149
+ #: wp-smushit.php:251 wp-smushit.php:409
150
  msgid "No savings"
151
  msgstr ""
152
 
153
+ #: wp-smushit.php:252 wp-smushit.php:264
154
  msgid "<strong>already smushed</strong>"
155
  msgstr ""
156
 
157
+ #: wp-smushit.php:280
158
  msgid "<hr /></p>Smush.it finished processing.</p>"
159
  msgstr ""
160
 
161
+ #: wp-smushit.php:293
162
  msgid "You don't have permission to work with uploaded files."
163
  msgstr ""
164
 
165
+ #: wp-smushit.php:297
166
  msgid "No attachment ID was provided."
167
  msgstr ""
168
 
169
+ #: wp-smushit.php:323
170
  msgid "File path is empty"
171
  msgstr ""
172
 
173
+ #: wp-smushit.php:327
174
  msgid "File URL is empty"
175
  msgstr ""
176
 
177
+ #: wp-smushit.php:333
178
  msgid "Did not smush due to previous errors"
179
  msgstr ""
180
 
181
+ #: wp-smushit.php:338
182
  #, php-format
183
  msgid "Could not find <span class='code'>%s</span>"
184
  msgstr ""
185
 
186
+ #: wp-smushit.php:343
187
  #, php-format
188
  msgid "<span class='code'>%s</span> is not writable"
189
  msgstr ""
190
 
191
+ #: wp-smushit.php:348
192
  #, php-format
193
  msgid ""
194
  "<span style=\"color:#FF0000;\">Skipped (%s) Unable to Smush due to Yahoo 1mb "
196
  "html#faq_restrict\">FAQ</a></span>"
197
  msgstr ""
198
 
199
+ #: wp-smushit.php:359
200
  #, php-format
201
  msgid ""
202
  "<span class='code'>%s</span> must be within the website directory (<span "
203
  "class='code'>%s</span>)"
204
  msgstr ""
205
 
206
+ #: wp-smushit.php:371
207
  #, php-format
208
  msgid ""
209
  "<span class='code'>%s</span> must be within the website home URL (<span "
210
  "class='code'>%s</span>)"
211
  msgstr ""
212
 
213
+ #: wp-smushit.php:382
214
  msgid "Error posting to Smush.it"
215
  msgstr ""
216
 
217
+ #: wp-smushit.php:388 wp-smushit.php:406
218
  msgid "Bad response from Smush.it"
219
  msgstr ""
220
 
221
+ #: wp-smushit.php:412
222
  msgid "Smush.it error: "
223
  msgstr ""
224
 
225
+ #: wp-smushit.php:412
226
  msgid "unknown error"
227
  msgstr ""
228
 
229
+ #: wp-smushit.php:413
230
  #, php-format
231
  msgid ""
232
  " while processing <span class='code'>%s</span> (<span class='code'>%s</span>)"
233
  msgstr ""
234
 
235
+ #: wp-smushit.php:429
236
  #, php-format
237
  msgid "Error downloading file (%s)"
238
  msgstr ""
239
 
240
+ #: wp-smushit.php:433
241
  #, php-format
242
  msgid "Unable to locate Smuch.it downloaded file (%s)"
243
  msgstr ""
244
 
245
+ #: wp-smushit.php:447
246
  #, php-format
247
  msgid "Reduced by %01.1f%% (%s)"
248
  msgstr ""
249
 
250
+ #: wp-smushit.php:545
251
  msgid "WP Smush.it requires WordPress 2.8 or greater"
252
  msgstr ""
253
 
254
+ #: wp-smushit.php:585
255
  msgid "Re-smush"
256
  msgstr ""
257
 
258
+ #: wp-smushit.php:588
259
  msgid "Not processed"
260
  msgstr ""
261
 
262
+ #: wp-smushit.php:591
263
  msgid "Smush.it now!"
264
  msgstr ""
265
 
readme.txt CHANGED
@@ -1,13 +1,13 @@
1
  === WP Smush.it ===
2
  Plugin Name: WP Smush.it
3
- Version: 1.6.5.1
4
  Author: WPMU DEV
5
  Author URI: http://premium.wpmudev.org
6
  Contributors: WPMUDEV, alexdunae
7
  Tags: images, image, attachments, attachment, Smush.it
8
  Requires at least: 3.5
9
  Tested up to: 3.6
10
- Stable tag: 1.6.5.1
11
  License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
12
 
13
  Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress.
@@ -72,6 +72,10 @@ This will give us a good foundation to start adding some new features!
72
 
73
  == Changelog ==
74
 
 
 
 
 
75
  = 1.6.5.1 =
76
  * Correct Settings > Media issue causing settings to report warnings and not save.
77
  * Corrected some processing logic to better handling or image path. Images still need to be within ABSPATH of site
1
  === WP Smush.it ===
2
  Plugin Name: WP Smush.it
3
+ Version: 1.6.5.2
4
  Author: WPMU DEV
5
  Author URI: http://premium.wpmudev.org
6
  Contributors: WPMUDEV, alexdunae
7
  Tags: images, image, attachments, attachment, Smush.it
8
  Requires at least: 3.5
9
  Tested up to: 3.6
10
+ Stable tag: 1.6.5.2
11
  License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
12
 
13
  Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress.
72
 
73
  == Changelog ==
74
 
75
+ = 1.6.5.2 =
76
+ * Corrected issues with Windows paths compare.
77
+ * Added debug output option to help with user support issues.
78
+
79
  = 1.6.5.1 =
80
  * Correct Settings > Media issue causing settings to report warnings and not save.
81
  * Corrected some processing logic to better handling or image path. Images still need to be within ABSPATH of site
wp-smushit.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Smush.it
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-smushit/
5
  Description: Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress.
6
  Author: WPMU DEV
7
- Version: 1.6.5.1
8
  Author URI: http://premium.wpmudev.org/
9
  Textdomain: wp_smushit
10
  */
@@ -31,11 +31,15 @@ along with this program; if not, write to the Free Software
31
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32
  */
33
 
 
 
 
 
34
  if ( !class_exists( 'WpSmushit' ) ) {
35
 
36
  class WpSmushit {
37
 
38
- var $version = "1.6.5.1";
39
 
40
  /**
41
  * Constructor
@@ -45,10 +49,6 @@ class WpSmushit {
45
  }
46
  function __construct( ) {
47
 
48
- if ( !function_exists( 'download_url' ) ) {
49
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
50
- }
51
-
52
  /**
53
  * Constants
54
  */
@@ -67,6 +67,12 @@ class WpSmushit {
67
 
68
  define( 'WP_SMUSHIT_AUTO', intval( get_option( 'wp_smushit_smushit_auto', 0) ) );
69
  define( 'WP_SMUSHIT_TIMEOUT', intval( get_option( 'wp_smushit_smushit_timeout', 60) ) );
 
 
 
 
 
 
70
 
71
  /*
72
  Each service has a setting specifying whether it should be used automatically on upload.
@@ -101,13 +107,18 @@ class WpSmushit {
101
  function register_settings( ) {
102
  add_settings_section( 'wp_smushit_settings', 'WP Smush.it', array( &$this, 'settings_cb' ), 'media' );
103
 
104
- add_settings_field( 'wp_smushit_smushit_auto', __( 'Use Smush.it on upload?', WP_SMUSHIT_DOMAIN ), array( &$this, 'render_auto_opts' ),
105
- 'media', 'wp_smushit_settings' );
 
106
  add_settings_field( 'wp_smushit_smushit_timeout', __( 'How many seconds should we wait for a response from Smush.it?', WP_SMUSHIT_DOMAIN ),
107
  array( &$this, 'render_timeout_opts' ), 'media', 'wp_smushit_settings' );
108
 
 
 
 
109
  register_setting( 'media', 'wp_smushit_smushit_auto' );
110
  register_setting( 'media', 'wp_smushit_smushit_timeout' );
 
111
  }
112
 
113
  function settings_cb( ) {
@@ -133,6 +144,12 @@ class WpSmushit {
133
  printf( "<input type='text' name='%1\$s' id='%1\$s' value='%2\%d'>", esc_attr( $key ), intval( get_option( $key, 60 ) ) );
134
  }
135
 
 
 
 
 
 
 
136
  // default is 6hrs
137
  function temporarily_disable( $seconds = 21600 ) {
138
  update_option( 'wp_smushit_smushit_auto', time() + $seconds );
@@ -178,28 +195,40 @@ class WpSmushit {
178
  <div id="icon-upload" class="icon32"><br /></div><h2><?php _e( 'Bulk WP Smush.it', WP_SMUSHIT_DOMAIN ) ?></h2>
179
  <?php
180
 
181
- if ( sizeof($attachments) < 1 ):
182
  _e( "<p>You don't appear to have uploaded any images yet.</p>", WP_SMUSHIT_DOMAIN );
183
- else:
184
- if ( empty($_POST) && !$auto_start ): // instructions page
185
 
186
- _e( "<p>This tool will run all of the images in your media library through the WP Smush.it web service. It won't re-smush images that were successfully smushed before. It will retry images that were not successfully smushed.</p>", WP_SMUSHIT_DOMAIN );
187
-
188
- _e( "<p>It uploads each and every file to Yahoo! and then downloads the resulting file. Note: the Yahoo! Smush.it service does not support https:// urls. So the image MUST be accessible via the public internet over a non-SSL URL. It can take a long time.</p>", WP_SMUSHIT_DOMAIN );
189
-
190
- printf( __( "<p>We found %d images in your media library. Be forewarned, <strong>it will take <em>at least</em> %d minutes</strong> to process all these images if they have never been smushed before.</p>", WP_SMUSHIT_DOMAIN ), sizeof($attachments), sizeof($attachments) * 3 / 60 );
191
-
192
- _e( "<p><em>N.B. If your server <tt>gzip</tt>s content you may not see the progress updates as your files are processed.</em></p>", WP_SMUSHIT_DOMAIN );
193
-
194
- printf( __( "<p><strong>This is an experimental feature.</strong> Please post any feedback to the %s.</p>", WP_SMUSHIT_DOMAIN ), '<a href="http://wordpress.org/tags/wp-smushit">'. __( 'WordPress WP Smush.it forums', WP_SMUSHIT_DOMAIN ). '</a>' );
195
- ?>
196
- <form method="post" action="">
197
- <?php wp_nonce_field( 'wp-smushit-bulk', '_wpnonce'); ?>
198
- <button type="submit" class="button-secondary action"><?php _e( 'Run all my images through WP Smush.it right now', WP_SMUSHIT_DOMAIN ) ?></button>
199
- </form>
200
-
201
- <?php
202
- else: // run the script
 
 
 
 
 
 
 
 
 
 
 
 
203
 
204
  if ( !wp_verify_nonce( $_REQUEST['_wpnonce'], 'wp-smushit-bulk' ) || !current_user_can( 'edit_others_posts' ) ) {
205
  wp_die( __( 'Cheatin&#8217; uh?' ) );
@@ -211,13 +240,8 @@ class WpSmushit {
211
  foreach( $attachments as $attachment ) {
212
  printf( __("<p>Processing <strong>%s</strong>&hellip;<br />", WP_SMUSHIT_DOMAIN), esc_html( $attachment->post_name ) );
213
  $original_meta = wp_get_attachment_metadata( $attachment->ID, true );
214
- //if (isset($original_meta['wp_smushit']))
215
- // unset($original_meta['wp_smushit']);
216
 
217
  $meta = $this->resize_from_meta_data( $original_meta, $attachment->ID, false );
218
- //echo "meta<pre>"; print_r($meta); echo "</pre>";
219
- //die();
220
-
221
  printf( "&mdash; [original] %d x %d: ", intval($meta['width']), intval($meta['height']) );
222
 
223
  if ((isset( $original_meta['wp_smushit'] ))
@@ -254,8 +278,8 @@ class WpSmushit {
254
  flush();
255
  }
256
  _e('<hr /></p>Smush.it finished processing.</p>', WP_SMUSHIT_DOMAIN);
257
- endif;
258
- endif;
259
  ?>
260
  </div>
261
  <?php
@@ -294,14 +318,6 @@ class WpSmushit {
294
  * @returns array
295
  */
296
  function do_smushit( $file_path = '', $file_url = '' ) {
297
- // don't run on localhost, IPv4 and IPv6 checks
298
- // if( in_array($_SERVER['SERVER_ADDR'], array('127.0.0.1', '::1')) )
299
- // return array($file, __('Not processed (local file)', WP_SMUSHIT_DOMAIN));
300
-
301
- // canonicalize path - disabled 2011-02-1 troubleshooting 'Could not find...' errors.
302
- // From the PHP docs: "The running script must have executable permissions on
303
- // all directories in the hierarchy, otherwise realpath() will return false."
304
- // $file_path = realpath($file);
305
 
306
  if (empty($file_path)) {
307
  return __( "File path is empty", WP_SMUSHIT_DOMAIN );
@@ -329,21 +345,27 @@ class WpSmushit {
329
 
330
  $file_size = filesize( $file_path );
331
  if ( $file_size > WP_SMUSHIT_MAX_BYTES ) {
332
- //return sprintf(__("<a href='http://developer.yahoo.com/yslow/smushit/faq.html#faq_restrict'>Too big</a> for Smush.it (%s)", WP_SMUSHIT_DOMAIN), $this->format_bytes($file_size));
333
  return sprintf(__('<span style="color:#FF0000;">Skipped (%s) Unable to Smush due to Yahoo 1mb size limits. See <a href="http://developer.yahoo.com/yslow/smushit/faq.html#faq_restrict">FAQ</a></span>', WP_SMUSHIT_DOMAIN), $this->format_bytes($file_size));
334
  }
335
 
336
  // check that the file is within the WP_CONTENT_DIR
337
- if (stripos(realpath($file_path), realpath(ABSPATH)) !== 0) {
 
 
 
 
 
 
338
  return sprintf( __( "<span class='code'>%s</span> must be within the website directory (<span class='code'>%s</span>)", WP_SMUSHIT_DOMAIN ),
339
- htmlentities( $file_path ), ABSPATH);
340
  }
341
 
342
  // The Yahoo! Smush.it service does not working with https images.
343
  $file_url = str_replace('https://', 'http://', $file_url);
344
-
345
- $home_url = get_option('home');
346
- $home_url = str_replace('https://', 'http://', $home_url);
 
347
 
348
  if (stripos($file_url, $home_url) !== 0) {
349
  return sprintf( __( "<span class='code'>%s</span> must be within the website home URL (<span class='code'>%s</span>)", WP_SMUSHIT_DOMAIN ),
@@ -352,6 +374,7 @@ class WpSmushit {
352
 
353
  //echo "calling _post(". $file_url .")<br />";
354
  $data = $this->_post( $file_url );
 
355
  //echo "returned from _post data<pre>"; print_r($data); echo "</pre>";
356
 
357
  if ( false === $data ) {
@@ -373,6 +396,10 @@ class WpSmushit {
373
  $json = new Services_JSON( );
374
  $data = $json->decode( $data );
375
  }
 
 
 
 
376
  //echo "returned from _post data<pre>"; print_r($data); echo "</pre>";
377
 
378
  if ( !isset( $data->dest_size ) )
@@ -451,38 +478,23 @@ class WpSmushit {
451
  return $meta;
452
  }
453
 
454
- //$file_path = $meta['file'];
455
- //$store_absolute_path = true;
456
- //$upload_dir = wp_upload_dir();
457
- //$upload_path = trailingslashit( $upload_dir['basedir'] );
458
-
459
- // WordPress >= 2.6.2: determine the absolute $file_path (http://core.trac.wordpress.org/changeset/8796)
460
- //if ( false === strpos($file_path, $upload_path) ) {
461
- // $store_absolute_path = false;
462
- // $file_path = $upload_path . $file_path;
463
- //}
464
-
465
  $attachment_file_path = get_attached_file($ID);
466
- //echo "attachment_file_path=[". $attachment_file_path ."]<br />";
 
 
467
  $attachment_file_url = wp_get_attachment_url($ID);
468
- //echo "attachment_file_url=[". $attachment_file_url ."]<br />";
 
 
469
 
470
  if ( $force_resmush || $this->should_resmush( @$meta['wp_smushit'] ) ) {
471
  $meta['wp_smushit'] = $this->do_smushit($attachment_file_path, $attachment_file_url);
472
  }
473
 
474
- // strip absolute path for Wordpress >= 2.6.2
475
- //if ( false === $store_absolute_path ) {
476
- // $meta['file'] = str_replace($upload_path, '', $meta['file']);
477
- //}
478
-
479
  // no resized versions, so we can exit
480
  if ( !isset( $meta['sizes'] ) )
481
  return $meta;
482
 
483
- // meta sizes don't contain a path, so we calculate one
484
- //$base_dir = trailingslashit( dirname($file_path) );
485
-
486
  foreach($meta['sizes'] as $size_key => $size_data) {
487
  if ( !$force_resmush && $this->should_resmush( @$meta['sizes'][$size_key]['wp_smushit'] ) === false ) {
488
  continue;
@@ -491,10 +503,14 @@ class WpSmushit {
491
  // We take the original image. The 'sizes' will all match the same URL and
492
  // path. So just get the dirname and rpelace the filename.
493
  $attachment_file_path_size = trailingslashit(dirname($attachment_file_path)) . $size_data['file'];
494
- //echo "attachment_file_path_size=[". $attachment_file_path_size ."]<br />";
 
 
495
 
496
  $attachment_file_url_size = trailingslashit(dirname($attachment_file_url)) . $size_data['file'];
497
- //echo "attachment_file_url_size=[". $attachment_file_url_size ."]<br />";
 
 
498
 
499
  $meta['sizes'][$size_key]['wp_smushit'] = $this->do_smushit( $attachment_file_path_size, $attachment_file_url_size ) ;
500
 
@@ -515,7 +531,9 @@ class WpSmushit {
515
  $req = sprintf( SMUSHIT_REQ_URL, urlencode( $file_url ) );
516
 
517
  $data = false;
518
-
 
 
519
  if ( function_exists( 'wp_remote_get' ) ) {
520
  $response = wp_remote_get( $req, array('user-agent' => WP_SMUSHIT_UA, 'timeout' => WP_SMUSHIT_TIMEOUT ) );
521
  if ( !$response || is_wp_error( $response ) ) {
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-smushit/
5
  Description: Reduce image file sizes and improve performance using the <a href="http://smush.it/">Smush.it</a> API within WordPress.
6
  Author: WPMU DEV
7
+ Version: 1.6.5.2
8
  Author URI: http://premium.wpmudev.org/
9
  Textdomain: wp_smushit
10
  */
31
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32
  */
33
 
34
+ if ( !function_exists( 'download_url' ) ) {
35
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
36
+ }
37
+
38
  if ( !class_exists( 'WpSmushit' ) ) {
39
 
40
  class WpSmushit {
41
 
42
+ var $version = "1.6.5.2";
43
 
44
  /**
45
  * Constructor
49
  }
50
  function __construct( ) {
51
 
 
 
 
 
52
  /**
53
  * Constants
54
  */
67
 
68
  define( 'WP_SMUSHIT_AUTO', intval( get_option( 'wp_smushit_smushit_auto', 0) ) );
69
  define( 'WP_SMUSHIT_TIMEOUT', intval( get_option( 'wp_smushit_smushit_timeout', 60) ) );
70
+
71
+ if ((!isset($_GET['action'])) || ($_GET['action'] != "wp_smushit_manual")) {
72
+ define( 'WP_SMUSHIT_DEBUG', get_option( 'wp_smushit_smushit_debug', '') );
73
+ } else {
74
+ define( 'WP_SMUSHIT_DEBUG', '' );
75
+ }
76
 
77
  /*
78
  Each service has a setting specifying whether it should be used automatically on upload.
107
  function register_settings( ) {
108
  add_settings_section( 'wp_smushit_settings', 'WP Smush.it', array( &$this, 'settings_cb' ), 'media' );
109
 
110
+ add_settings_field( 'wp_smushit_smushit_auto', __( 'Use Smush.it on upload?', WP_SMUSHIT_DOMAIN ),
111
+ array( &$this, 'render_auto_opts' ), 'media', 'wp_smushit_settings' );
112
+
113
  add_settings_field( 'wp_smushit_smushit_timeout', __( 'How many seconds should we wait for a response from Smush.it?', WP_SMUSHIT_DOMAIN ),
114
  array( &$this, 'render_timeout_opts' ), 'media', 'wp_smushit_settings' );
115
 
116
+ add_settings_field( 'wp_smushit_smushit_debug', __( 'Enable debug processing', WP_SMUSHIT_DOMAIN ),
117
+ array( &$this, 'render_debug_opts' ), 'media', 'wp_smushit_settings' );
118
+
119
  register_setting( 'media', 'wp_smushit_smushit_auto' );
120
  register_setting( 'media', 'wp_smushit_smushit_timeout' );
121
+ register_setting( 'media', 'wp_smushit_smushit_debug' );
122
  }
123
 
124
  function settings_cb( ) {
144
  printf( "<input type='text' name='%1\$s' id='%1\$s' value='%2\%d'>", esc_attr( $key ), intval( get_option( $key, 60 ) ) );
145
  }
146
 
147
+ function render_debug_opts( ) {
148
+ $key = 'wp_smushit_smushit_debug';
149
+ $val = get_option( $key );
150
+ ?><input type="checkbox" name="<?php echo $key ?>" <?php if ($val) { echo ' checked="checked" '; } ?>/> <?php _e( 'If you are having trouble with the plugin enable this option can reveal some information about your system needed for support.', WP_SMUSHIT_DOMAIN );
151
+ }
152
+
153
  // default is 6hrs
154
  function temporarily_disable( $seconds = 21600 ) {
155
  update_option( 'wp_smushit_smushit_auto', time() + $seconds );
195
  <div id="icon-upload" class="icon32"><br /></div><h2><?php _e( 'Bulk WP Smush.it', WP_SMUSHIT_DOMAIN ) ?></h2>
196
  <?php
197
 
198
+ if ( sizeof($attachments) < 1 ) {
199
  _e( "<p>You don't appear to have uploaded any images yet.</p>", WP_SMUSHIT_DOMAIN );
200
+ } else {
201
+ if ( empty($_POST) && !$auto_start ){ // instructions page
202
 
203
+ _e("<p>This tool will run all of the images in your media library through the WP Smush.it web service. Any image already processed will not be reprocessed. Any new images or unsuccessful attempts will be processed.</p>", WP_SMUSHIT_DOMAIN );
204
+ _e("<p>As part of the Yahoo! Smush.it API this plugin wil provide a URL to each of your images to be processed. The Yahoo! service will download the image via the URL. The Yahoo Smush.it service will then return a URL to this plugin of the new version of the image. This image will be downloaded and replace the original image on your server.</p>", WP_SMUSHIT_DOMAIN );
205
+
206
+ _e('<p>Limitations of using the Yahoo Smush.it API</p>', WP_SMUSHIT_DOMAIN);
207
+ ?>
208
+ <ol>
209
+ <li><?php _e('The image MUST be less than 1 megabyte in size. This is a limit of the Yahoo! service not this plugin.', WP_SMUSHIT_DOMAIN); ?></li>
210
+ <li><?php _e('The image MUST be accessible via a non-https URL. The Yahoo! Smush.it service will not handle https:// image URLs. This is a limit of the Yahoo! service not this plugin.', WP_SMUSHIT_DOMAIN); ?></li>
211
+ <li><?php _e('The image MUST publicly accessible server. As the Yahoo! Smush.it service needs to download the image via a URL the image needs to be on a public server and not a local local development system. This is a limit of the Yahoo! service not this plugin.', WP_SMUSHIT_DOMAIN); ?></li>
212
+ <li><?php _e('The image MUST be local to the site. This plugin cannot update images stored on Content Delivery Networks (CDN)', WP_SMUSHIT_DOMAIN); ?></li>
213
+ </ol>
214
+ <?php
215
+ printf( __( "<p><strong>This is an experimental feature.</strong> Please post any feedback to the %s.</p>", WP_SMUSHIT_DOMAIN ), '<a href="http://wordpress.org/tags/wp-smushit">'. __( 'WordPress WP Smush.it forums', WP_SMUSHIT_DOMAIN ). '</a>' );
216
+
217
+ ?>
218
+ <hr />
219
+ <?php printf( __( "<p>We found %d images in your media library. Be forewarned, <strong>it will take <em>at least</em> %d minutes</strong> to process all these images if they have never been smushed before.</p>", WP_SMUSHIT_DOMAIN ), sizeof($attachments), sizeof($attachments) * 3 / 60 ); ?>
220
+ <form method="post" action="">
221
+ <?php wp_nonce_field( 'wp-smushit-bulk', '_wpnonce'); ?>
222
+ <button type="submit" class="button-secondary action"><?php _e( 'Run all my images through WP Smush.it right now', WP_SMUSHIT_DOMAIN ) ?></button>
223
+ <?php _e( "<p><em>N.B. If your server <tt>gzip</tt>s content you may not see the progress updates as your files are processed.</em></p>", WP_SMUSHIT_DOMAIN ); ?>
224
+ <?php
225
+ if (WP_SMUSHIT_DEBUG) {
226
+ _e( "<p>DEBUG mode is currently enabled. To disable see the Settings > Media page.</p>", WP_SMUSHIT_DOMAIN );
227
+ }
228
+ ?>
229
+ </form>
230
+ <?php
231
+ } else { // run the script
232
 
233
  if ( !wp_verify_nonce( $_REQUEST['_wpnonce'], 'wp-smushit-bulk' ) || !current_user_can( 'edit_others_posts' ) ) {
234
  wp_die( __( 'Cheatin&#8217; uh?' ) );
240
  foreach( $attachments as $attachment ) {
241
  printf( __("<p>Processing <strong>%s</strong>&hellip;<br />", WP_SMUSHIT_DOMAIN), esc_html( $attachment->post_name ) );
242
  $original_meta = wp_get_attachment_metadata( $attachment->ID, true );
 
 
243
 
244
  $meta = $this->resize_from_meta_data( $original_meta, $attachment->ID, false );
 
 
 
245
  printf( "&mdash; [original] %d x %d: ", intval($meta['width']), intval($meta['height']) );
246
 
247
  if ((isset( $original_meta['wp_smushit'] ))
278
  flush();
279
  }
280
  _e('<hr /></p>Smush.it finished processing.</p>', WP_SMUSHIT_DOMAIN);
281
+ }
282
+ }
283
  ?>
284
  </div>
285
  <?php
318
  * @returns array
319
  */
320
  function do_smushit( $file_path = '', $file_url = '' ) {
 
 
 
 
 
 
 
 
321
 
322
  if (empty($file_path)) {
323
  return __( "File path is empty", WP_SMUSHIT_DOMAIN );
345
 
346
  $file_size = filesize( $file_path );
347
  if ( $file_size > WP_SMUSHIT_MAX_BYTES ) {
 
348
  return sprintf(__('<span style="color:#FF0000;">Skipped (%s) Unable to Smush due to Yahoo 1mb size limits. See <a href="http://developer.yahoo.com/yslow/smushit/faq.html#faq_restrict">FAQ</a></span>', WP_SMUSHIT_DOMAIN), $this->format_bytes($file_size));
349
  }
350
 
351
  // check that the file is within the WP_CONTENT_DIR
352
+ // But first convert the slashes to be uniform. Really with WP would already do this!
353
+ $file_path_tmp = str_replace('\\', '/', realpath($file_path));
354
+ $ABSPATH_tmp = str_replace('\\', '/', ABSPATH);
355
+ if (WP_SMUSHIT_DEBUG) {
356
+ echo "DEBUG: file_path [". $file_path_tmp ."] ABSPATH [". $ABSPATH_tmp ."]<br />";
357
+ }
358
+ if (stripos( $file_path_tmp, $ABSPATH_tmp) !== 0) {
359
  return sprintf( __( "<span class='code'>%s</span> must be within the website directory (<span class='code'>%s</span>)", WP_SMUSHIT_DOMAIN ),
360
+ htmlentities( $file_path_tmp ), $ABSPATH_tmp);
361
  }
362
 
363
  // The Yahoo! Smush.it service does not working with https images.
364
  $file_url = str_replace('https://', 'http://', $file_url);
365
+ $home_url = str_replace('https://', 'http://', get_option('home'));
366
+ if (WP_SMUSHIT_DEBUG) {
367
+ echo "DEBUG: file_url [". $file_url ."] home_url [". $home_url ."]<br />";
368
+ }
369
 
370
  if (stripos($file_url, $home_url) !== 0) {
371
  return sprintf( __( "<span class='code'>%s</span> must be within the website home URL (<span class='code'>%s</span>)", WP_SMUSHIT_DOMAIN ),
374
 
375
  //echo "calling _post(". $file_url .")<br />";
376
  $data = $this->_post( $file_url );
377
+
378
  //echo "returned from _post data<pre>"; print_r($data); echo "</pre>";
379
 
380
  if ( false === $data ) {
396
  $json = new Services_JSON( );
397
  $data = $json->decode( $data );
398
  }
399
+ if (WP_SMUSHIT_DEBUG) {
400
+ echo "DEBUG: return from API: data<pre>"; print_r($data); echo "</pre>";
401
+ }
402
+
403
  //echo "returned from _post data<pre>"; print_r($data); echo "</pre>";
404
 
405
  if ( !isset( $data->dest_size ) )
478
  return $meta;
479
  }
480
 
 
 
 
 
 
 
 
 
 
 
 
481
  $attachment_file_path = get_attached_file($ID);
482
+ if (WP_SMUSHIT_DEBUG) {
483
+ echo "DEBUG: attachment_file_path=[". $attachment_file_path ."]<br />";
484
+ }
485
  $attachment_file_url = wp_get_attachment_url($ID);
486
+ if (WP_SMUSHIT_DEBUG) {
487
+ echo "DEBUG: attachment_file_url=[". $attachment_file_url ."]<br />";
488
+ }
489
 
490
  if ( $force_resmush || $this->should_resmush( @$meta['wp_smushit'] ) ) {
491
  $meta['wp_smushit'] = $this->do_smushit($attachment_file_path, $attachment_file_url);
492
  }
493
 
 
 
 
 
 
494
  // no resized versions, so we can exit
495
  if ( !isset( $meta['sizes'] ) )
496
  return $meta;
497
 
 
 
 
498
  foreach($meta['sizes'] as $size_key => $size_data) {
499
  if ( !$force_resmush && $this->should_resmush( @$meta['sizes'][$size_key]['wp_smushit'] ) === false ) {
500
  continue;
503
  // We take the original image. The 'sizes' will all match the same URL and
504
  // path. So just get the dirname and rpelace the filename.
505
  $attachment_file_path_size = trailingslashit(dirname($attachment_file_path)) . $size_data['file'];
506
+ if (WP_SMUSHIT_DEBUG) {
507
+ echo "DEBUG: attachment_file_path_size=[". $attachment_file_path_size ."]<br />";
508
+ }
509
 
510
  $attachment_file_url_size = trailingslashit(dirname($attachment_file_url)) . $size_data['file'];
511
+ if (WP_SMUSHIT_DEBUG) {
512
+ echo "DEBUG: attachment_file_url_size=[". $attachment_file_url_size ."]<br />";
513
+ }
514
 
515
  $meta['sizes'][$size_key]['wp_smushit'] = $this->do_smushit( $attachment_file_path_size, $attachment_file_url_size ) ;
516
 
531
  $req = sprintf( SMUSHIT_REQ_URL, urlencode( $file_url ) );
532
 
533
  $data = false;
534
+ if (WP_SMUSHIT_DEBUG) {
535
+ echo "DEBUG: Calling API: [". $req."]<br />";
536
+ }
537
  if ( function_exists( 'wp_remote_get' ) ) {
538
  $response = wp_remote_get( $req, array('user-agent' => WP_SMUSHIT_UA, 'timeout' => WP_SMUSHIT_TIMEOUT ) );
539
  if ( !$response || is_wp_error( $response ) ) {