Version Description
- Fixed:
- Stats not updated on resizing images
- CSS conflict in Media Library
Download this release
Release Info
Developer | UmeshSingla |
Plugin | Smush Image Compression and Optimization |
Version | 2.3.1 |
Comparing to | |
See all releases |
Code changes from version 2.3 to 2.3.1
- assets/css/wp-smushit-admin.css +6 -2
- languages/wp-smushit.pot +45 -45
- lib/class-wp-smush-admin.php +15 -1
- lib/class-wp-smush-resize.php +4 -0
- lib/class-wp-smush-ui.php +50 -10
- readme.txt +8 -2
- uninstall.php +3 -1
- wp-smush.php +43 -4
assets/css/wp-smushit-admin.css
CHANGED
@@ -86,7 +86,7 @@ Smush button transformation
|
|
86 |
margin: 15px 20px 15px 0;
|
87 |
}
|
88 |
|
89 |
-
.wpmud .toggle .toggle-checkbox:focus
|
90 |
background: #c1c1c1;
|
91 |
}
|
92 |
|
@@ -1073,7 +1073,11 @@ small.smush-setting-description {
|
|
1073 |
}
|
1074 |
|
1075 |
.compat-item .compat-field-wp_smush {
|
1076 |
-
|
|
|
|
|
|
|
|
|
1077 |
}
|
1078 |
|
1079 |
.smushit [tooltip], .compat-field-wp_smush [tooltip] {
|
86 |
margin: 15px 20px 15px 0;
|
87 |
}
|
88 |
|
89 |
+
.wpmud .toggle .toggle-checkbox:focus + .toggle-label:before {
|
90 |
background: #c1c1c1;
|
91 |
}
|
92 |
|
1073 |
}
|
1074 |
|
1075 |
.compat-item .compat-field-wp_smush {
|
1076 |
+
display: table-row;
|
1077 |
+
}
|
1078 |
+
|
1079 |
+
.manage-column.column-smushit {
|
1080 |
+
width: 260px;
|
1081 |
}
|
1082 |
|
1083 |
.smushit [tooltip], .compat-field-wp_smush [tooltip] {
|
languages/wp-smushit.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the WP Smush package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: WP Smush 2.3\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wp-smushit\n"
|
7 |
-
"POT-Creation-Date: 2016-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -25,11 +25,11 @@ msgid "Oops, we could not do this..."
|
|
25 |
msgstr ""
|
26 |
|
27 |
#: assets/shared-ui/plugin-ui.php:225 extras/free-dashboard/module.php:406
|
28 |
-
#: extras/free-dashboard/module.php:445 lib/class-wp-smush-ui.php:
|
29 |
msgid "Saving"
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: assets/shared-ui/plugin-ui.php:254 lib/class-wp-smush-ui.php:
|
33 |
msgid "Dismiss"
|
34 |
msgstr ""
|
35 |
|
@@ -113,7 +113,7 @@ msgstr ""
|
|
113 |
msgid "Allow smushing images directly through NextGen Gallery settings."
|
114 |
msgstr ""
|
115 |
|
116 |
-
#: lib/class-wp-smush-admin.php:210 lib/class-wp-smush-ui.php:
|
117 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:70
|
118 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:89
|
119 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:91
|
@@ -186,7 +186,7 @@ msgstr ""
|
|
186 |
msgid "All Done!"
|
187 |
msgstr ""
|
188 |
|
189 |
-
#: lib/class-wp-smush-admin.php:907 lib/class-wp-smush-admin.php:
|
190 |
msgid "Settings"
|
191 |
msgstr ""
|
192 |
|
@@ -218,16 +218,16 @@ msgstr ""
|
|
218 |
msgid "Yay! All images are optimised as per your current settings."
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: lib/class-wp-smush-admin.php:1342 lib/class-wp-smush-ui.php:
|
222 |
msgid "You have images that need smushing. %sBulk smush now!%s"
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: lib/class-wp-smush-admin.php:
|
226 |
-
#: lib/class-wp-smush-ui.php:
|
227 |
msgid "WP Smush Pro"
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: lib/class-wp-smush-admin.php:
|
231 |
msgid "Woohoo! Your latest Smush update %s allows you to %sauto resize%s all your images, how cool is that! %sFind out more here >>%s"
|
232 |
msgstr ""
|
233 |
|
@@ -327,144 +327,144 @@ msgstr ""
|
|
327 |
msgid "UPDATE SETTINGS"
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: lib/class-wp-smush-ui.php:
|
331 |
msgid "%sPRO ONLY%s"
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: lib/class-wp-smush-ui.php:
|
335 |
msgid "ADVANCED SETTINGS"
|
336 |
msgstr ""
|
337 |
|
338 |
-
#: lib/class-wp-smush-ui.php:
|
339 |
msgid "Width"
|
340 |
msgstr ""
|
341 |
|
342 |
-
#: lib/class-wp-smush-ui.php:
|
343 |
msgid "Height"
|
344 |
msgstr ""
|
345 |
|
346 |
-
#: lib/class-wp-smush-ui.php:
|
347 |
msgid "Currently, your largest thumbnail size is set at %s%dpx wide x %dpx high%s. Anything above 2048px in width or height is huge and not recommended."
|
348 |
msgstr ""
|
349 |
|
350 |
-
#: lib/class-wp-smush-ui.php:
|
351 |
msgid "Just to let you know, the width you've entered is less than your largest thumbnail and may result in pixelation."
|
352 |
msgstr ""
|
353 |
|
354 |
-
#: lib/class-wp-smush-ui.php:
|
355 |
msgid "Just to let you know, the height you’ve entered is less than your largest thumbnail and may result in pixelation."
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: lib/class-wp-smush-ui.php:
|
359 |
msgid "TRY WP SMUSH PRO - DEV TEAM"
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: lib/class-wp-smush-ui.php:
|
363 |
msgid "BOOST YOUR PERFORMANCE - HUMMINGBIRD"
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: lib/class-wp-smush-ui.php:
|
367 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:423
|
368 |
msgid "No attachments found - Upload some images"
|
369 |
msgstr ""
|
370 |
|
371 |
-
#: lib/class-wp-smush-ui.php:
|
372 |
msgid "We haven’t found any images in your %smedia library%s yet so there’s no smushing to be done! Once you upload images, reload this page and start playing!"
|
373 |
msgstr ""
|
374 |
|
375 |
-
#: lib/class-wp-smush-ui.php:
|
376 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:428
|
377 |
msgid "UPLOAD IMAGES"
|
378 |
msgstr ""
|
379 |
|
380 |
-
#: lib/class-wp-smush-ui.php:
|
381 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:433
|
382 |
msgid "All images are smushed and up to date. Awesome!"
|
383 |
msgstr ""
|
384 |
|
385 |
-
#: lib/class-wp-smush-ui.php:
|
386 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:438
|
387 |
msgid "BULK SMUSH NOW"
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: lib/class-wp-smush-ui.php:
|
391 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:446
|
392 |
msgid "%s, you have %s%s%d%s image%s that needs smushing!"
|
393 |
msgid_plural "%s, you have %s%s%d%s images%s that need smushing!"
|
394 |
msgstr[0] ""
|
395 |
msgstr[1] ""
|
396 |
|
397 |
-
#: lib/class-wp-smush-ui.php:
|
398 |
msgid "You can %sUpgrade to Pro%s to bulk smush all your images with one click."
|
399 |
msgstr ""
|
400 |
|
401 |
-
#: lib/class-wp-smush-ui.php:
|
402 |
msgid "Free users can smush 50 images with each click."
|
403 |
msgstr ""
|
404 |
|
405 |
-
#: lib/class-wp-smush-ui.php:
|
406 |
msgid "Enable Super-smush in the Settings area to get even more savings with almost no noticeable quality loss."
|
407 |
msgstr ""
|
408 |
|
409 |
-
#: lib/class-wp-smush-ui.php:
|
410 |
msgid "%sBulk smush is currently running.%s You need to keep this page open."
|
411 |
msgstr ""
|
412 |
|
413 |
-
#: lib/class-wp-smush-ui.php:
|
414 |
msgid "%s%d%s of %d attachments have been smushed."
|
415 |
msgstr ""
|
416 |
|
417 |
-
#: lib/class-wp-smush-ui.php:
|
418 |
msgid "CANCEL"
|
419 |
msgstr ""
|
420 |
|
421 |
-
#: lib/class-wp-smush-ui.php:
|
422 |
msgid "%s, you have %s%s%d%s image%s that needs re-compressing!"
|
423 |
msgid_plural "%s, you have %s%s%d%s images%s that need re-compressing!"
|
424 |
msgstr[0] ""
|
425 |
msgstr[1] ""
|
426 |
|
427 |
-
#: lib/class-wp-smush-ui.php:
|
428 |
msgid "Skip"
|
429 |
msgstr ""
|
430 |
|
431 |
-
#: lib/class-wp-smush-ui.php:
|
432 |
msgid "Your settings have been updated!"
|
433 |
msgstr ""
|
434 |
|
435 |
-
#: lib/class-wp-smush-ui.php:
|
436 |
msgid "Automatic smushing is %senabled%s. Newly uploaded images will be automagically compressed."
|
437 |
msgstr ""
|
438 |
|
439 |
-
#: lib/class-wp-smush-ui.php:
|
440 |
msgid "Automatic smushing is %sdisabled%s. Newly uploaded images will need to be manually smushed."
|
441 |
msgstr ""
|
442 |
|
443 |
-
#: lib/class-wp-smush-ui.php:
|
444 |
msgid "Thanks for installing Smush. We hope you like it!"
|
445 |
msgstr ""
|
446 |
|
447 |
-
#: lib/class-wp-smush-ui.php:
|
448 |
msgid "And hey, if you do, you can now try out Smush Pro for double the smushy goodness (benchmarked), entirely for free!"
|
449 |
msgstr ""
|
450 |
|
451 |
-
#: lib/class-wp-smush-ui.php:
|
452 |
msgid "Try Smush Pro for Free"
|
453 |
msgstr ""
|
454 |
|
455 |
-
#: lib/class-wp-smush-ui.php:
|
456 |
msgid "Thanks for updating Smush. Did you know that you can now try the Smush Pro for FREE?!"
|
457 |
msgstr ""
|
458 |
|
459 |
-
#: lib/class-wp-smush-ui.php:
|
460 |
msgid "Yep, Super Smush your images for double the savings, save originals and batch Smush thousands of images all at once.... no charge!"
|
461 |
msgstr ""
|
462 |
|
463 |
-
#: lib/class-wp-smush-ui.php:
|
464 |
msgid "Did you know WP Smush Pro delivers up to 10x better compression, allows you to smush your originals and removes any bulk smushing limits? – %sTry it absolutely FREE%s"
|
465 |
msgstr ""
|
466 |
|
467 |
-
#: lib/class-wp-smush-ui.php:
|
468 |
msgid "Try WP Smush Pro for FREE"
|
469 |
msgstr ""
|
470 |
|
@@ -615,11 +615,11 @@ msgstr ""
|
|
615 |
msgid "Reduced by %s ( %01.1f%% )"
|
616 |
msgstr ""
|
617 |
|
618 |
-
#: wp-smush.php:
|
619 |
msgid "Get Fast"
|
620 |
msgstr ""
|
621 |
|
622 |
-
#: wp-smush.php:
|
623 |
msgid "WP Smush Free was deactivated. You have WP Smush Pro active!"
|
624 |
msgstr ""
|
625 |
#. Plugin Name of the plugin/theme
|
2 |
# This file is distributed under the same license as the WP Smush package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: WP Smush 2.3.1\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/wp-smushit\n"
|
7 |
+
"POT-Creation-Date: 2016-06-01 08:25:36+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
25 |
msgstr ""
|
26 |
|
27 |
#: assets/shared-ui/plugin-ui.php:225 extras/free-dashboard/module.php:406
|
28 |
+
#: extras/free-dashboard/module.php:445 lib/class-wp-smush-ui.php:726
|
29 |
msgid "Saving"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: assets/shared-ui/plugin-ui.php:254 lib/class-wp-smush-ui.php:726
|
33 |
msgid "Dismiss"
|
34 |
msgstr ""
|
35 |
|
113 |
msgid "Allow smushing images directly through NextGen Gallery settings."
|
114 |
msgstr ""
|
115 |
|
116 |
+
#: lib/class-wp-smush-admin.php:210 lib/class-wp-smush-ui.php:667
|
117 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:70
|
118 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:89
|
119 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:91
|
186 |
msgid "All Done!"
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: lib/class-wp-smush-admin.php:907 lib/class-wp-smush-admin.php:1731
|
190 |
msgid "Settings"
|
191 |
msgstr ""
|
192 |
|
218 |
msgid "Yay! All images are optimised as per your current settings."
|
219 |
msgstr ""
|
220 |
|
221 |
+
#: lib/class-wp-smush-admin.php:1342 lib/class-wp-smush-ui.php:642
|
222 |
msgid "You have images that need smushing. %sBulk smush now!%s"
|
223 |
msgstr ""
|
224 |
|
225 |
+
#: lib/class-wp-smush-admin.php:1732 lib/class-wp-smush-ui.php:536
|
226 |
+
#: lib/class-wp-smush-ui.php:667
|
227 |
msgid "WP Smush Pro"
|
228 |
msgstr ""
|
229 |
|
230 |
+
#: lib/class-wp-smush-admin.php:1735
|
231 |
msgid "Woohoo! Your latest Smush update %s allows you to %sauto resize%s all your images, how cool is that! %sFind out more here >>%s"
|
232 |
msgstr ""
|
233 |
|
327 |
msgid "UPDATE SETTINGS"
|
328 |
msgstr ""
|
329 |
|
330 |
+
#: lib/class-wp-smush-ui.php:224
|
331 |
msgid "%sPRO ONLY%s"
|
332 |
msgstr ""
|
333 |
|
334 |
+
#: lib/class-wp-smush-ui.php:226
|
335 |
msgid "ADVANCED SETTINGS"
|
336 |
msgstr ""
|
337 |
|
338 |
+
#: lib/class-wp-smush-ui.php:363
|
339 |
msgid "Width"
|
340 |
msgstr ""
|
341 |
|
342 |
+
#: lib/class-wp-smush-ui.php:366
|
343 |
msgid "Height"
|
344 |
msgstr ""
|
345 |
|
346 |
+
#: lib/class-wp-smush-ui.php:369
|
347 |
msgid "Currently, your largest thumbnail size is set at %s%dpx wide x %dpx high%s. Anything above 2048px in width or height is huge and not recommended."
|
348 |
msgstr ""
|
349 |
|
350 |
+
#: lib/class-wp-smush-ui.php:370
|
351 |
msgid "Just to let you know, the width you've entered is less than your largest thumbnail and may result in pixelation."
|
352 |
msgstr ""
|
353 |
|
354 |
+
#: lib/class-wp-smush-ui.php:371
|
355 |
msgid "Just to let you know, the height you’ve entered is less than your largest thumbnail and may result in pixelation."
|
356 |
msgstr ""
|
357 |
|
358 |
+
#: lib/class-wp-smush-ui.php:457
|
359 |
msgid "TRY WP SMUSH PRO - DEV TEAM"
|
360 |
msgstr ""
|
361 |
|
362 |
+
#: lib/class-wp-smush-ui.php:473
|
363 |
msgid "BOOST YOUR PERFORMANCE - HUMMINGBIRD"
|
364 |
msgstr ""
|
365 |
|
366 |
+
#: lib/class-wp-smush-ui.php:500
|
367 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:423
|
368 |
msgid "No attachments found - Upload some images"
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: lib/class-wp-smush-ui.php:502
|
372 |
msgid "We haven’t found any images in your %smedia library%s yet so there’s no smushing to be done! Once you upload images, reload this page and start playing!"
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: lib/class-wp-smush-ui.php:505
|
376 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:428
|
377 |
msgid "UPLOAD IMAGES"
|
378 |
msgstr ""
|
379 |
|
380 |
+
#: lib/class-wp-smush-ui.php:510
|
381 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:433
|
382 |
msgid "All images are smushed and up to date. Awesome!"
|
383 |
msgstr ""
|
384 |
|
385 |
+
#: lib/class-wp-smush-ui.php:515
|
386 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:438
|
387 |
msgid "BULK SMUSH NOW"
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: lib/class-wp-smush-ui.php:534
|
391 |
#: lib/nextgen-integration/class-wp-smush-nextgen-admin.php:446
|
392 |
msgid "%s, you have %s%s%d%s image%s that needs smushing!"
|
393 |
msgid_plural "%s, you have %s%s%d%s images%s that need smushing!"
|
394 |
msgstr[0] ""
|
395 |
msgstr[1] ""
|
396 |
|
397 |
+
#: lib/class-wp-smush-ui.php:536
|
398 |
msgid "You can %sUpgrade to Pro%s to bulk smush all your images with one click."
|
399 |
msgstr ""
|
400 |
|
401 |
+
#: lib/class-wp-smush-ui.php:537
|
402 |
msgid "Free users can smush 50 images with each click."
|
403 |
msgstr ""
|
404 |
|
405 |
+
#: lib/class-wp-smush-ui.php:546
|
406 |
msgid "Enable Super-smush in the Settings area to get even more savings with almost no noticeable quality loss."
|
407 |
msgstr ""
|
408 |
|
409 |
+
#: lib/class-wp-smush-ui.php:569
|
410 |
msgid "%sBulk smush is currently running.%s You need to keep this page open."
|
411 |
msgstr ""
|
412 |
|
413 |
+
#: lib/class-wp-smush-ui.php:579
|
414 |
msgid "%s%d%s of %d attachments have been smushed."
|
415 |
msgstr ""
|
416 |
|
417 |
+
#: lib/class-wp-smush-ui.php:584
|
418 |
msgid "CANCEL"
|
419 |
msgstr ""
|
420 |
|
421 |
+
#: lib/class-wp-smush-ui.php:620
|
422 |
msgid "%s, you have %s%s%d%s image%s that needs re-compressing!"
|
423 |
msgid_plural "%s, you have %s%s%d%s images%s that need re-compressing!"
|
424 |
msgstr[0] ""
|
425 |
msgstr[1] ""
|
426 |
|
427 |
+
#: lib/class-wp-smush-ui.php:621
|
428 |
msgid "Skip"
|
429 |
msgstr ""
|
430 |
|
431 |
+
#: lib/class-wp-smush-ui.php:635
|
432 |
msgid "Your settings have been updated!"
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: lib/class-wp-smush-ui.php:669
|
436 |
msgid "Automatic smushing is %senabled%s. Newly uploaded images will be automagically compressed."
|
437 |
msgstr ""
|
438 |
|
439 |
+
#: lib/class-wp-smush-ui.php:669
|
440 |
msgid "Automatic smushing is %sdisabled%s. Newly uploaded images will need to be manually smushed."
|
441 |
msgstr ""
|
442 |
|
443 |
+
#: lib/class-wp-smush-ui.php:698
|
444 |
msgid "Thanks for installing Smush. We hope you like it!"
|
445 |
msgstr ""
|
446 |
|
447 |
+
#: lib/class-wp-smush-ui.php:699
|
448 |
msgid "And hey, if you do, you can now try out Smush Pro for double the smushy goodness (benchmarked), entirely for free!"
|
449 |
msgstr ""
|
450 |
|
451 |
+
#: lib/class-wp-smush-ui.php:700 lib/class-wp-smush-ui.php:704
|
452 |
msgid "Try Smush Pro for Free"
|
453 |
msgstr ""
|
454 |
|
455 |
+
#: lib/class-wp-smush-ui.php:702
|
456 |
msgid "Thanks for updating Smush. Did you know that you can now try the Smush Pro for FREE?!"
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: lib/class-wp-smush-ui.php:703
|
460 |
msgid "Yep, Super Smush your images for double the savings, save originals and batch Smush thousands of images all at once.... no charge!"
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: lib/class-wp-smush-ui.php:750
|
464 |
msgid "Did you know WP Smush Pro delivers up to 10x better compression, allows you to smush your originals and removes any bulk smushing limits? – %sTry it absolutely FREE%s"
|
465 |
msgstr ""
|
466 |
|
467 |
+
#: lib/class-wp-smush-ui.php:750
|
468 |
msgid "Try WP Smush Pro for FREE"
|
469 |
msgstr ""
|
470 |
|
615 |
msgid "Reduced by %s ( %01.1f%% )"
|
616 |
msgstr ""
|
617 |
|
618 |
+
#: wp-smush.php:140
|
619 |
msgid "Get Fast"
|
620 |
msgstr ""
|
621 |
|
622 |
+
#: wp-smush.php:193
|
623 |
msgid "WP Smush Free was deactivated. You have WP Smush Pro active!"
|
624 |
msgstr ""
|
625 |
#. Plugin Name of the plugin/theme
|
lib/class-wp-smush-admin.php
CHANGED
@@ -1698,6 +1698,12 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
1698 |
return true;
|
1699 |
}
|
1700 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1701 |
//Do not show for new installations
|
1702 |
$install_type = get_site_option( 'wp-smush-install-type', false );
|
1703 |
|
@@ -1713,9 +1719,17 @@ if ( ! class_exists( 'WpSmushitAdmin' ) ) {
|
|
1713 |
|
1714 |
//Handles the dismiss action
|
1715 |
$js_url = WP_SMUSH_URL . 'assets/js/notice.js';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1716 |
|
1717 |
$settings_link = '<a href="' . admin_url( 'upload.php?page=wp-smush-bulk#wp-smush-settings-box' ) . '" title="' . esc_html__( "Settings", "wp-smushit" ) . '">';
|
1718 |
-
$upgrade_link = '<a href="' . $
|
1719 |
?>
|
1720 |
<div class="notice notice-info is-dismissible wp-smush-update-info">
|
1721 |
<p><?php printf( esc_html__( "Woohoo! Your latest Smush update %s allows you to %sauto resize%s all your images, how cool is that! %sFind out more here >>%s", 'wp-smushit' ), WP_SMUSH_VERSION, $settings_link, '</a>', $upgrade_link, '</a>' ); ?></p>
|
1698 |
return true;
|
1699 |
}
|
1700 |
|
1701 |
+
//Get Plugin dir, Return if it's WP Smush Pro installation
|
1702 |
+
$dir_path = get_plugin_dir();
|
1703 |
+
if ( ! empty( $dir_path ) && strpos( $dir_path, 'wp-smush-pro' ) !== false ) {
|
1704 |
+
return true;
|
1705 |
+
}
|
1706 |
+
|
1707 |
//Do not show for new installations
|
1708 |
$install_type = get_site_option( 'wp-smush-install-type', false );
|
1709 |
|
1719 |
|
1720 |
//Handles the dismiss action
|
1721 |
$js_url = WP_SMUSH_URL . 'assets/js/notice.js';
|
1722 |
+
$upgrade_url = add_query_arg(
|
1723 |
+
array(
|
1724 |
+
'utm_source' => 'Smush-Free',
|
1725 |
+
'utm_medium' => 'Banner',
|
1726 |
+
'utm_campaign' => 'now-with-resizing'
|
1727 |
+
),
|
1728 |
+
$this->upgrade_url
|
1729 |
+
);
|
1730 |
|
1731 |
$settings_link = '<a href="' . admin_url( 'upload.php?page=wp-smush-bulk#wp-smush-settings-box' ) . '" title="' . esc_html__( "Settings", "wp-smushit" ) . '">';
|
1732 |
+
$upgrade_link = '<a href="' . esc_url( $upgrade_url ) . '" title="' . esc_html__( "WP Smush Pro", "wp-smushit" ) . '">';
|
1733 |
?>
|
1734 |
<div class="notice notice-info is-dismissible wp-smush-update-info">
|
1735 |
<p><?php printf( esc_html__( "Woohoo! Your latest Smush update %s allows you to %sauto resize%s all your images, how cool is that! %sFind out more here >>%s", 'wp-smushit' ), WP_SMUSH_VERSION, $settings_link, '</a>', $upgrade_link, '</a>' ); ?></p>
|
lib/class-wp-smush-resize.php
CHANGED
@@ -97,6 +97,7 @@ if ( ! class_exists( 'WpSmushResize' ) ) {
|
|
97 |
if ( ! empty( $mime ) && ! $mime_supported = apply_filters( 'wp_smush_resmush_mime_supported', $mime_supported, $mime ) ) {
|
98 |
return false;
|
99 |
}
|
|
|
100 |
//Check if already resized
|
101 |
$resize_meta = get_post_meta( $id, WP_SMUSH_PREFIX . 'resize_savings', true );
|
102 |
if ( ! empty( $resize_meta ) ) {
|
@@ -166,6 +167,9 @@ if ( ! class_exists( 'WpSmushResize' ) ) {
|
|
166 |
$replaced = $this->replcae_original_image( $file_path, $resize, $id, $meta );
|
167 |
|
168 |
if ( $replaced ) {
|
|
|
|
|
|
|
169 |
//Updated File size
|
170 |
$u_file_size = filesize( $file_path );
|
171 |
|
97 |
if ( ! empty( $mime ) && ! $mime_supported = apply_filters( 'wp_smush_resmush_mime_supported', $mime_supported, $mime ) ) {
|
98 |
return false;
|
99 |
}
|
100 |
+
|
101 |
//Check if already resized
|
102 |
$resize_meta = get_post_meta( $id, WP_SMUSH_PREFIX . 'resize_savings', true );
|
103 |
if ( ! empty( $resize_meta ) ) {
|
167 |
$replaced = $this->replcae_original_image( $file_path, $resize, $id, $meta );
|
168 |
|
169 |
if ( $replaced ) {
|
170 |
+
//Clear Stat Cache, Else the size obtained is same as the original file size
|
171 |
+
clearstatcache();
|
172 |
+
|
173 |
//Updated File size
|
174 |
$u_file_size = filesize( $file_path );
|
175 |
|
lib/class-wp-smush-ui.php
CHANGED
@@ -213,8 +213,15 @@ if ( ! class_exists( 'WpSmushBulkUi' ) ) {
|
|
213 |
//For Basic User, Show advanced settings in a separate box
|
214 |
if ( ! $WpSmush->is_pro() ) {
|
215 |
echo $div_end;
|
216 |
-
|
217 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
|
219 |
$this->container_header( 'wp-smush-premium', 'wp-smush-pro-settings-box', esc_html__( "ADVANCED SETTINGS", "wp-smushit" ), $pro_only, false ); ?>
|
220 |
<div class="box-content"><?php
|
@@ -426,14 +433,23 @@ if ( ! class_exists( 'WpSmushBulkUi' ) ) {
|
|
426 |
*/
|
427 |
function wp_smush_promo() {
|
428 |
global $wpsmushit_admin;
|
429 |
-
$this->container_header( 'wp-smush-pro-adv', 'wp-smush-pro-promo', "FANCY A FREE SUPER SMUSH?" );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
<div class="box-content">
|
431 |
<p class="wp-smush-promo-content roboto-medium">You can now get Smush Pro... for FREE!</p>
|
432 |
<p class="wp-smush-promo-content wp-smush-promo-content-2 roboto-medium">No obligation, no contracts, no
|
433 |
catches. You'll get Smush Pro plus 100+ WPMU DEV plugins, Defender, Hummingbird & 24/7 WP support
|
434 |
for absolutely nothing for 14 days.</p>
|
435 |
<span class="wp-smush-pro-cta tc">
|
436 |
-
<a href="<?php echo esc_url( $
|
437 |
class="button button-cta button-green" target="_blank">FIND OUT MORE</a>
|
438 |
</span>
|
439 |
</div>
|
@@ -501,6 +517,14 @@ if ( ! class_exists( 'WpSmushBulkUi' ) ) {
|
|
501 |
//Show the notice only if there are remaining images and if we aren't showing a notice for resmush
|
502 |
if ( $wpsmushit_admin->remaining_count > 0 ) {
|
503 |
$class = count( $wpsmushit_admin->resmush_ids ) > 0 ? ' hidden' : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
504 |
?>
|
505 |
<div class="wp-smush-notice wp-smush-remaining<?php echo $class; ?>" tabindex="0">
|
506 |
<i class="dev-icon">
|
@@ -509,7 +533,7 @@ if ( ! class_exists( 'WpSmushBulkUi' ) ) {
|
|
509 |
<span class="wp-smush-notice-text"><?php
|
510 |
printf( _n( "%s, you have %s%s%d%s image%s that needs smushing!", "%s, you have %s%s%d%s images%s that need smushing!", $wpsmushit_admin->remaining_count, "wp-smushit" ), $wpsmushit_admin->get_user_name(), '<strong>', '<span class="wp-smush-remaining-count">', $wpsmushit_admin->remaining_count, '</span>', '</strong>' );
|
511 |
if( !$WpSmush->is_pro() ) {
|
512 |
-
printf( '<br />' . esc_html__("You can %sUpgrade to Pro%s to bulk smush all your images with one click.", "wp-smushit") .'<br />', '<a href="' . esc_url( $
|
513 |
esc_html_e("Free users can smush 50 images with each click.", "wp-smushit");
|
514 |
}?>
|
515 |
</span>
|
@@ -675,10 +699,18 @@ if ( ! class_exists( 'WpSmushBulkUi' ) ) {
|
|
675 |
$notice_content = esc_html__( "And hey, if you do, you can now try out Smush Pro for double the smushy goodness (benchmarked), entirely for free!", "wp-smushit" );
|
676 |
$button_content = esc_html__( "Try Smush Pro for Free", "wp-smushit" );
|
677 |
} else {
|
678 |
-
$notice_heading =
|
679 |
$notice_content = '<br />' . esc_html__( "Yep, Super Smush your images for double the savings, save originals and batch Smush thousands of images all at once.... no charge!", "wp-smushit" );
|
680 |
$button_content = esc_html__( "Try Smush Pro for Free", "wp-smushit" );
|
681 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
<link rel="stylesheet" type="text/css" href="<?php echo esc_url( $css_url ); ?>" />
|
683 |
<div class="notice smush-notice" style="display: none;">
|
684 |
<div class="smush-notice-logo"><span></span></div>
|
@@ -688,7 +720,7 @@ if ( ! class_exists( 'WpSmushBulkUi' ) ) {
|
|
688 |
<?php echo $notice_content; ?>
|
689 |
</div>
|
690 |
<div class="smush-notice-cta">
|
691 |
-
<a href="<?php echo esc_url( $
|
692 |
<?php echo $button_content; ?>
|
693 |
</a>
|
694 |
<button class="smush-notice-dismiss smush-dismiss-welcome" data-msg="<?php esc_html_e( 'Saving', 'wp-smushit'); ?>"><?php esc_html_e( 'Dismiss', "wp-smushit" ); ?></button>
|
@@ -704,10 +736,18 @@ if ( ! class_exists( 'WpSmushBulkUi' ) ) {
|
|
704 |
global $WpSmush, $wpsmushit_admin;
|
705 |
if ( $WpSmush->is_pro() ) {
|
706 |
return;
|
707 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
708 |
<div class="wp-smush-super-smush-promo">
|
709 |
<div class="wp-smush-super-smush-content"><?php
|
710 |
-
printf( esc_html__("Did you know WP Smush Pro delivers up to 10x better compression, allows you to smush your originals and removes any bulk smushing limits? – %sTry it absolutely FREE%s", "wp-smushit"), '<a href="' . esc_url( $
|
711 |
</div>
|
712 |
</div>
|
713 |
<?php
|
213 |
//For Basic User, Show advanced settings in a separate box
|
214 |
if ( ! $WpSmush->is_pro() ) {
|
215 |
echo $div_end;
|
216 |
+
$upgrade_url = add_query_arg(
|
217 |
+
array(
|
218 |
+
'utm_source' => 'Smush-Free',
|
219 |
+
'utm_medium' => 'Banner',
|
220 |
+
'utm_campaign'=> 'pro-only-advanced-settings'
|
221 |
+
),
|
222 |
+
$wpsmushit_admin->upgrade_url
|
223 |
+
);
|
224 |
+
$pro_only = sprintf( esc_html__( '%sPRO ONLY%s', 'wp-smushit' ), '<a href="' . esc_url( $upgrade_url ) . '" target="_blank">', '</a>' );
|
225 |
|
226 |
$this->container_header( 'wp-smush-premium', 'wp-smush-pro-settings-box', esc_html__( "ADVANCED SETTINGS", "wp-smushit" ), $pro_only, false ); ?>
|
227 |
<div class="box-content"><?php
|
433 |
*/
|
434 |
function wp_smush_promo() {
|
435 |
global $wpsmushit_admin;
|
436 |
+
$this->container_header( 'wp-smush-pro-adv', 'wp-smush-pro-promo', "FANCY A FREE SUPER SMUSH?" );
|
437 |
+
$upgrade_url = add_query_arg(
|
438 |
+
array(
|
439 |
+
'utm_source' => 'Smush-Free',
|
440 |
+
'utm_medium' => 'Banner',
|
441 |
+
'utm_campaign' => 'settings-sidebar'
|
442 |
+
),
|
443 |
+
$wpsmushit_admin->upgrade_url
|
444 |
+
);
|
445 |
+
?>
|
446 |
<div class="box-content">
|
447 |
<p class="wp-smush-promo-content roboto-medium">You can now get Smush Pro... for FREE!</p>
|
448 |
<p class="wp-smush-promo-content wp-smush-promo-content-2 roboto-medium">No obligation, no contracts, no
|
449 |
catches. You'll get Smush Pro plus 100+ WPMU DEV plugins, Defender, Hummingbird & 24/7 WP support
|
450 |
for absolutely nothing for 14 days.</p>
|
451 |
<span class="wp-smush-pro-cta tc">
|
452 |
+
<a href="<?php echo esc_url( $upgrade_url ); ?>"
|
453 |
class="button button-cta button-green" target="_blank">FIND OUT MORE</a>
|
454 |
</span>
|
455 |
</div>
|
517 |
//Show the notice only if there are remaining images and if we aren't showing a notice for resmush
|
518 |
if ( $wpsmushit_admin->remaining_count > 0 ) {
|
519 |
$class = count( $wpsmushit_admin->resmush_ids ) > 0 ? ' hidden' : '';
|
520 |
+
$upgrade_url = add_query_arg(
|
521 |
+
array(
|
522 |
+
'utm_source' => 'Smush-Free',
|
523 |
+
'utm_medium' => 'Banner',
|
524 |
+
'utm_campaign' => 'yellow-bulk-smush-upsell'
|
525 |
+
),
|
526 |
+
$wpsmushit_admin->upgrade_url
|
527 |
+
);
|
528 |
?>
|
529 |
<div class="wp-smush-notice wp-smush-remaining<?php echo $class; ?>" tabindex="0">
|
530 |
<i class="dev-icon">
|
533 |
<span class="wp-smush-notice-text"><?php
|
534 |
printf( _n( "%s, you have %s%s%d%s image%s that needs smushing!", "%s, you have %s%s%d%s images%s that need smushing!", $wpsmushit_admin->remaining_count, "wp-smushit" ), $wpsmushit_admin->get_user_name(), '<strong>', '<span class="wp-smush-remaining-count">', $wpsmushit_admin->remaining_count, '</span>', '</strong>' );
|
535 |
if( !$WpSmush->is_pro() ) {
|
536 |
+
printf( '<br />' . esc_html__("You can %sUpgrade to Pro%s to bulk smush all your images with one click.", "wp-smushit") .'<br />', '<a href="' . esc_url( $upgrade_url ). '" target="_blank" title="' . esc_html__("WP Smush Pro", "wp-smushit") . '">', '</a>' );
|
537 |
esc_html_e("Free users can smush 50 images with each click.", "wp-smushit");
|
538 |
}?>
|
539 |
</span>
|
699 |
$notice_content = esc_html__( "And hey, if you do, you can now try out Smush Pro for double the smushy goodness (benchmarked), entirely for free!", "wp-smushit" );
|
700 |
$button_content = esc_html__( "Try Smush Pro for Free", "wp-smushit" );
|
701 |
} else {
|
702 |
+
$notice_heading = esc_html__( "Thanks for updating Smush. Did you know that you can now try the Smush Pro for FREE?!", "wp-smushit" );
|
703 |
$notice_content = '<br />' . esc_html__( "Yep, Super Smush your images for double the savings, save originals and batch Smush thousands of images all at once.... no charge!", "wp-smushit" );
|
704 |
$button_content = esc_html__( "Try Smush Pro for Free", "wp-smushit" );
|
705 |
+
}
|
706 |
+
$upgrade_url = add_query_arg(
|
707 |
+
array(
|
708 |
+
'utm_source' => 'Smush-Free',
|
709 |
+
'utm_medium' => 'Banner',
|
710 |
+
'utm_campaign' => 'try-pro-free'
|
711 |
+
),
|
712 |
+
$wpsmushit_admin->upgrade_url
|
713 |
+
);?>
|
714 |
<link rel="stylesheet" type="text/css" href="<?php echo esc_url( $css_url ); ?>" />
|
715 |
<div class="notice smush-notice" style="display: none;">
|
716 |
<div class="smush-notice-logo"><span></span></div>
|
720 |
<?php echo $notice_content; ?>
|
721 |
</div>
|
722 |
<div class="smush-notice-cta">
|
723 |
+
<a href="<?php echo esc_url( $upgrade_url ); ?>" class="smush-notice-act button-primary" target="_blank">
|
724 |
<?php echo $button_content; ?>
|
725 |
</a>
|
726 |
<button class="smush-notice-dismiss smush-dismiss-welcome" data-msg="<?php esc_html_e( 'Saving', 'wp-smushit'); ?>"><?php esc_html_e( 'Dismiss', "wp-smushit" ); ?></button>
|
736 |
global $WpSmush, $wpsmushit_admin;
|
737 |
if ( $WpSmush->is_pro() ) {
|
738 |
return;
|
739 |
+
}
|
740 |
+
$upgrade_url = add_query_arg(
|
741 |
+
array(
|
742 |
+
'utm_source' => 'Smush-Free',
|
743 |
+
'utm_medium' => 'Banner',
|
744 |
+
'utm_campaign' => 'smush-lady-upgrade'
|
745 |
+
),
|
746 |
+
$wpsmushit_admin->upgrade_url
|
747 |
+
); ?>
|
748 |
<div class="wp-smush-super-smush-promo">
|
749 |
<div class="wp-smush-super-smush-content"><?php
|
750 |
+
printf( esc_html__("Did you know WP Smush Pro delivers up to 10x better compression, allows you to smush your originals and removes any bulk smushing limits? – %sTry it absolutely FREE%s", "wp-smushit"), '<a href="' . esc_url( $upgrade_url ). '" target="_blank" title="' . esc_html__("Try WP Smush Pro for FREE", "wp-smushit") . '">', '</a>' ); ?>
|
751 |
</div>
|
752 |
</div>
|
753 |
<?php
|
readme.txt
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
=== WP Smush - Image Optimization ===
|
2 |
Plugin Name: WP Smush - Image Optimization
|
3 |
-
Version: 2.3
|
4 |
Author: WPMU DEV
|
5 |
Author URI: http://premium.wpmudev.org/
|
6 |
Contributors: WPMUDEV, alexdunae
|
7 |
Tags: image optimization, image compression, attachment,Attachments,compress,Compress Image File,Compress Image Size,Compress JPG,Compressed JPG, Compression Image,Image,Images,JPG,Optimise,Optimize,Photo,Photos,Pictures,PNG,Reduce Image Size,Smush,Smush.it,Upload,WordPress Compression,WordPress Image Tool,Yahoo, Yahoo Smush.it
|
8 |
Requires at least: 3.5
|
9 |
Tested up to: 4.5.2
|
10 |
-
Stable tag: 2.3
|
11 |
License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
12 |
|
13 |
Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://premium.wpmudev.org/">WPMU DEV</a> WordPress Smush API.
|
@@ -91,6 +91,12 @@ Yahoo's Smush.it API is gone forever. So WPMU DEV built our own free API that is
|
|
91 |
|
92 |
== Changelog ==
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
= 2.3 =
|
95 |
|
96 |
* Fixed:
|
1 |
=== WP Smush - Image Optimization ===
|
2 |
Plugin Name: WP Smush - Image Optimization
|
3 |
+
Version: 2.3.1
|
4 |
Author: WPMU DEV
|
5 |
Author URI: http://premium.wpmudev.org/
|
6 |
Contributors: WPMUDEV, alexdunae
|
7 |
Tags: image optimization, image compression, attachment,Attachments,compress,Compress Image File,Compress Image Size,Compress JPG,Compressed JPG, Compression Image,Image,Images,JPG,Optimise,Optimize,Photo,Photos,Pictures,PNG,Reduce Image Size,Smush,Smush.it,Upload,WordPress Compression,WordPress Image Tool,Yahoo, Yahoo Smush.it
|
8 |
Requires at least: 3.5
|
9 |
Tested up to: 4.5.2
|
10 |
+
Stable tag: 2.3.1
|
11 |
License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
12 |
|
13 |
Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://premium.wpmudev.org/">WPMU DEV</a> WordPress Smush API.
|
91 |
|
92 |
== Changelog ==
|
93 |
|
94 |
+
= 2.3.1 =
|
95 |
+
|
96 |
+
* Fixed:
|
97 |
+
* Stats not updated on resizing images
|
98 |
+
* CSS conflict in Media Library
|
99 |
+
|
100 |
= 2.3 =
|
101 |
|
102 |
* Fixed:
|
uninstall.php
CHANGED
@@ -32,7 +32,8 @@ $smushit_keys = array(
|
|
32 |
'hide_upgrade_notice',
|
33 |
'hide_update_info',
|
34 |
'install-type',
|
35 |
-
'lossy-updated'
|
|
|
36 |
);
|
37 |
|
38 |
//Cache Keys
|
@@ -57,6 +58,7 @@ if ( ! is_multisite() ) {
|
|
57 |
foreach ( $smushit_keys as $key ) {
|
58 |
$key = 'wp-smush-' . $key;
|
59 |
delete_option( $key );
|
|
|
60 |
}
|
61 |
//Delete Cache data
|
62 |
foreach ( $cache_keys as $key ) {
|
32 |
'hide_upgrade_notice',
|
33 |
'hide_update_info',
|
34 |
'install-type',
|
35 |
+
'lossy-updated',
|
36 |
+
'version'
|
37 |
);
|
38 |
|
39 |
//Cache Keys
|
58 |
foreach ( $smushit_keys as $key ) {
|
59 |
$key = 'wp-smush-' . $key;
|
60 |
delete_option( $key );
|
61 |
+
delete_site_option( $key );
|
62 |
}
|
63 |
//Delete Cache data
|
64 |
foreach ( $cache_keys as $key ) {
|
wp-smush.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Smush
|
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/wp-smushit/
|
5 |
Description: Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://premium.wpmudev.org/">WPMU DEV</a> WordPress Smush API.
|
6 |
Author: WPMU DEV
|
7 |
-
Version: 2.3
|
8 |
Author URI: http://premium.wpmudev.org/
|
9 |
Textdomain: wp-smushit
|
10 |
*/
|
@@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
35 |
* Constants
|
36 |
*/
|
37 |
$prefix = 'WP_SMUSH_';
|
38 |
-
$version = '2.3';
|
39 |
|
40 |
/**
|
41 |
* Set the default timeout for API request and AJAX timeout
|
@@ -109,10 +109,20 @@ if ( ! function_exists( 'wp_smush_email_message' ) ) {
|
|
109 |
return $message;
|
110 |
}
|
111 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
if ( is_admin() ) {
|
114 |
|
115 |
-
$dir_path =
|
|
|
116 |
//Only for wordpress.org members
|
117 |
if ( strpos( $dir_path, 'wp-smushit' ) !== false ) {
|
118 |
require_once( WP_SMUSH_DIR . 'extras/free-dashboard/module.php' );
|
@@ -185,4 +195,33 @@ if ( ! function_exists( 'smush_deactivated' ) ) {
|
|
185 |
delete_option( 'smush_deactivated' );
|
186 |
}
|
187 |
}
|
188 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/wp-smushit/
|
5 |
Description: Reduce image file sizes, improve performance and boost your SEO using the free <a href="https://premium.wpmudev.org/">WPMU DEV</a> WordPress Smush API.
|
6 |
Author: WPMU DEV
|
7 |
+
Version: 2.3.1
|
8 |
Author URI: http://premium.wpmudev.org/
|
9 |
Textdomain: wp-smushit
|
10 |
*/
|
35 |
* Constants
|
36 |
*/
|
37 |
$prefix = 'WP_SMUSH_';
|
38 |
+
$version = '2.3.1';
|
39 |
|
40 |
/**
|
41 |
* Set the default timeout for API request and AJAX timeout
|
109 |
return $message;
|
110 |
}
|
111 |
}
|
112 |
+
/**
|
113 |
+
* Returns the dir path for the plugin
|
114 |
+
*
|
115 |
+
* @return string
|
116 |
+
*/
|
117 |
+
function get_plugin_dir() {
|
118 |
+
$dir_path = plugin_dir_path( __FILE__ );
|
119 |
+
return $dir_path;
|
120 |
+
}
|
121 |
|
122 |
if ( is_admin() ) {
|
123 |
|
124 |
+
$dir_path = get_plugin_dir();
|
125 |
+
|
126 |
//Only for wordpress.org members
|
127 |
if ( strpos( $dir_path, 'wp-smushit' ) !== false ) {
|
128 |
require_once( WP_SMUSH_DIR . 'extras/free-dashboard/module.php' );
|
195 |
delete_option( 'smush_deactivated' );
|
196 |
}
|
197 |
}
|
198 |
+
}
|
199 |
+
|
200 |
+
//Check if a existing install or new
|
201 |
+
function smush_activated() {
|
202 |
+
|
203 |
+
$version = get_site_option( WP_SMUSH_PREFIX . 'version' );
|
204 |
+
|
205 |
+
//If the version is not saved or if the version is not same as the current version,
|
206 |
+
if ( ! $version || WP_SMUSH_VERSION != $version ) {
|
207 |
+
global $wpdb;
|
208 |
+
//Check if there are any existing smush stats
|
209 |
+
$query = "SELECT meta_id FROM {$wpdb->postmeta} WHERE meta_key=%s LIMIT 1";
|
210 |
+
$results = $wpdb->get_var( $wpdb->prepare( $query, 'wp-smpro-smush-data' ) );
|
211 |
+
|
212 |
+
if ( $results ) {
|
213 |
+
update_option( 'wp-smush-install-type', 'existing' );
|
214 |
+
}else{
|
215 |
+
//Check for existing settings
|
216 |
+
if( false !== get_site_option( WP_SMUSH_PREFIX . 'auto' ) || false !== get_option( WP_SMUSH_PREFIX . 'auto' ) ) {
|
217 |
+
update_option( 'wp-smush-install-type', 'existing' );
|
218 |
+
}
|
219 |
+
}
|
220 |
+
|
221 |
+
//Store the plugin version in db
|
222 |
+
update_site_option( WP_SMUSH_PREFIX . 'version', WP_SMUSH_VERSION );
|
223 |
+
}
|
224 |
+
|
225 |
+
}
|
226 |
+
|
227 |
+
register_activation_hook( __FILE__, 'smush_activated' );
|