Version Description
Release date July 14th 2020 * Fix: Images weren't optimized when they were added from the Upload function of the Gutenberg image block; * Fix: Scaled images when using relative paths now don't fail on domain issues; * Fix: Drop any notices that don't have ShortPixel Notice as SubClass; * Fix: Properly handle some situations when the .htaccess file is read-only; * Fix: Avoid the plugin crash in some specific situations when an invalid API Key was provided; * Fix: Notices were being displayed for the first time custom folders were added on a multisite install; * Fix: Optimize now wasn't displayed anymore as a button in Other Media for multisite installs; * Fix: In certain situations, when the image timestamp changed, the optimization was counting 2 credits; * Language: 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted.
Release Info
Developer | petredobrescu |
Plugin | ShortPixel Image Optimizer |
Version | 4.19.3 |
Comparing to | |
See all releases |
Code changes from version 4.19.2 to 4.19.3
- build/shortpixel/notices/src/NoticeController.php +17 -1
- class/Controller/AdminNoticesController.php +9 -1
- class/Controller/FileSystemController.php +16 -0
- class/Controller/SettingsController.php +2 -3
- class/Controller/View/OtherMediaViewController.php +4 -0
- class/Model/DirectoryOtherMediaModel.php +3 -3
- class/Model/EnvironmentModel.php +1 -0
- class/db/shortpixel-meta-facade.php +6 -1
- class/view/settings/part-advanced.php +2 -2
- class/wp-short-pixel.php +4 -1
- readme.txt +72 -40
- res/css/shortpixel-othermedia.css +5 -4
- res/scss/shortpixel-othermedia.scss +9 -2
- shortpixel-plugin.php +33 -29
- shortpixel_api.php +2 -1
- wp-shortpixel.php +2 -2
@@ -39,6 +39,14 @@ class NoticeController //extends ShortPixelController
|
|
39 |
return self::$instance;
|
40 |
}
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
/** Load Notices Config File, if any
|
43 |
*
|
44 |
* [ Future Use ]
|
@@ -67,7 +75,15 @@ class NoticeController //extends ShortPixelController
|
|
67 |
|
68 |
if ($notices !== false && is_array($notices))
|
69 |
{
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
$this->has_stored = true;
|
72 |
}
|
73 |
else {
|
39 |
return self::$instance;
|
40 |
}
|
41 |
|
42 |
+
/** Reset all notices, before loading them, to ensure on updates / activations one starts fresh */
|
43 |
+
public static function resetNotices()
|
44 |
+
{
|
45 |
+
$ns = __NAMESPACE__;
|
46 |
+
$ns = substr($ns, 0, strpos($ns, '\\')); // try to get first part of namespace
|
47 |
+
$result = delete_option($ns . '-notices');
|
48 |
+
}
|
49 |
+
|
50 |
/** Load Notices Config File, if any
|
51 |
*
|
52 |
* [ Future Use ]
|
75 |
|
76 |
if ($notices !== false && is_array($notices))
|
77 |
{
|
78 |
+
$checked = array();
|
79 |
+
foreach($notices as $noticeObj)
|
80 |
+
{
|
81 |
+
if (is_object($noticeObj) && $noticeObj instanceOf NoticeModel)
|
82 |
+
{
|
83 |
+
$checked[] = $noticeObj;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
self::$notices = $checked;
|
87 |
$this->has_stored = true;
|
88 |
}
|
89 |
else {
|
@@ -50,6 +50,11 @@ class AdminNoticesController extends \ShortPixel\Controller
|
|
50 |
return self::$instance;
|
51 |
}
|
52 |
|
|
|
|
|
|
|
|
|
|
|
53 |
/** Triggered when plugin is activated */
|
54 |
public static function resetCompatNotice()
|
55 |
{
|
@@ -293,7 +298,10 @@ class AdminNoticesController extends \ShortPixel\Controller
|
|
293 |
{
|
294 |
// $screen = get_current_screen();
|
295 |
$env = \wpSPIO()->env();
|
296 |
-
|
|
|
|
|
|
|
297 |
$quotaData = $stats;
|
298 |
$noticeController = Notices::getInstance();
|
299 |
|
50 |
return self::$instance;
|
51 |
}
|
52 |
|
53 |
+
public static function resetAllNotices()
|
54 |
+
{
|
55 |
+
Notices::resetNotices();
|
56 |
+
}
|
57 |
+
|
58 |
/** Triggered when plugin is activated */
|
59 |
public static function resetCompatNotice()
|
60 |
{
|
298 |
{
|
299 |
// $screen = get_current_screen();
|
300 |
$env = \wpSPIO()->env();
|
301 |
+
|
302 |
+
$statsSetting = is_array($settings->currentStats) ? $settings->currentStats : array();
|
303 |
+
$stats = $shortpixel->countAllIfNeeded($statsSetting, 86400);
|
304 |
+
|
305 |
$quotaData = $stats;
|
306 |
$noticeController = Notices::getInstance();
|
307 |
|
@@ -167,6 +167,22 @@ Class FileSystemController extends \ShortPixel\Controller
|
|
167 |
|
168 |
$parsed = parse_url($url); // returns array, null, or false.
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
if (! is_null($parsed) && $parsed !== false)
|
171 |
return $url;
|
172 |
|
167 |
|
168 |
$parsed = parse_url($url); // returns array, null, or false.
|
169 |
|
170 |
+
// Some hosts set the content dir to a relative path instead of a full URL. Api can't handle that, so add domain and such if this is the case.
|
171 |
+
if ( !isset($parsed['scheme']) ) {//no absolute URLs used -> we implement a hack
|
172 |
+
|
173 |
+
if (isset($parsed['host'])) // This is for URL's for // without http or https. hackhack.
|
174 |
+
{
|
175 |
+
$scheme = is_ssl() ? 'https:' : 'http:';
|
176 |
+
return $scheme. $url;
|
177 |
+
}
|
178 |
+
else
|
179 |
+
{
|
180 |
+
// From Metafacade. Multiple solutions /hacks.
|
181 |
+
$home_url = trailingslashit((function_exists("is_multisite") && is_multisite()) ? trim(network_site_url("/")) : trim(home_url()));
|
182 |
+
return $home_url . ltrim($url,'/');//get the file URL
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
if (! is_null($parsed) && $parsed !== false)
|
187 |
return $url;
|
188 |
|
@@ -225,16 +225,15 @@ class SettingsController extends \ShortPixel\Controller
|
|
225 |
if ($this->is_nginx)
|
226 |
return false;
|
227 |
|
228 |
-
if (file_exists(get_home_path() . 'htaccess') && is_writable(get_home_path() . 'htaccess'))
|
229 |
{
|
230 |
return true;
|
231 |
}
|
232 |
-
|
233 |
{
|
234 |
return true;
|
235 |
}
|
236 |
return false;
|
237 |
-
// (is_writable(get_home_path() . 'htaccess')) ? true : false;
|
238 |
}
|
239 |
|
240 |
protected function getMaxIntermediateImageSize() {
|
225 |
if ($this->is_nginx)
|
226 |
return false;
|
227 |
|
228 |
+
if (file_exists(get_home_path() . '.htaccess') && is_writable(get_home_path() . '.htaccess'))
|
229 |
{
|
230 |
return true;
|
231 |
}
|
232 |
+
elseif (! file_exists(get_home_path() . '.htaccess') && file_exists(get_home_path()) && is_writable(get_home_path()))
|
233 |
{
|
234 |
return true;
|
235 |
}
|
236 |
return false;
|
|
|
237 |
}
|
238 |
|
239 |
protected function getMaxIntermediateImageSize() {
|
@@ -538,6 +538,10 @@ class OtherMediaViewController extends \ShortPixel\Controller
|
|
538 |
}
|
539 |
}
|
540 |
|
|
|
|
|
|
|
|
|
541 |
return $this->renderActions($thisActions, $item, $file, $forceSingular);
|
542 |
}
|
543 |
|
538 |
}
|
539 |
}
|
540 |
|
541 |
+
|
542 |
+
if (count($thisActions) == 1)
|
543 |
+
$thisActions[0]['class'] .= 'button-smaller button button-primary';
|
544 |
+
|
545 |
return $this->renderActions($thisActions, $item, $file, $forceSingular);
|
546 |
}
|
547 |
|
@@ -84,9 +84,9 @@ class DirectoryOtherMediaModel extends DirectoryModel
|
|
84 |
}
|
85 |
else
|
86 |
{
|
87 |
-
$this->updated = $this->DBtoTimestamp($folder->ts_updated);
|
88 |
-
$this->created = $this->DBtoTimestamp($folder->ts_created);
|
89 |
-
$this->fileCount = $folder->file_count;
|
90 |
}
|
91 |
if (strlen($folder->name) == 0)
|
92 |
$this->name = basename($folder->path);
|
84 |
}
|
85 |
else
|
86 |
{
|
87 |
+
$this->updated = isset($folder->ts_updated) ? $this->DBtoTimestamp($folder->ts_updated) : time();
|
88 |
+
$this->created = isset($folder->ts_created) ? $this->DBtoTimestamp($folder->ts_created) : time();
|
89 |
+
$this->fileCount = isset($folder->file_count) ? $folder->file_count : 0;
|
90 |
}
|
91 |
if (strlen($folder->name) == 0)
|
92 |
$this->name = basename($folder->path);
|
@@ -136,6 +136,7 @@ class EnvironmentModel extends \ShortPixel\Model
|
|
136 |
'upload', // media library
|
137 |
'attachment', // edit media
|
138 |
'post', // post screen
|
|
|
139 |
'edit-post', // edit post
|
140 |
'new-post', // new post
|
141 |
'edit-page', // all pages
|
136 |
'upload', // media library
|
137 |
'attachment', // edit media
|
138 |
'post', // post screen
|
139 |
+
'page', // page editor
|
140 |
'edit-post', // edit post
|
141 |
'new-post', // new post
|
142 |
'edit-page', // all pages
|
@@ -612,7 +612,10 @@ class ShortPixelMetaFacade {
|
|
612 |
if (is_object($origFile))
|
613 |
{
|
614 |
//$origFile = $imageObj->getOriginalFile();
|
615 |
-
|
|
|
|
|
|
|
616 |
if (! $origFile->exists() && ! $no_exist_check )
|
617 |
{
|
618 |
list($origurl, $path) = $this->attemptRemoteDownload($origurl, $origFile->getFullPath(), $this->ID);
|
@@ -755,6 +758,8 @@ class ShortPixelMetaFacade {
|
|
755 |
if (! $no_exist_check)
|
756 |
$filePaths = ShortPixelAPI::CheckAndFixImagePaths($filePaths);//check for images to make sure they exist on disk
|
757 |
|
|
|
|
|
758 |
$result = array("URLs" => $urlList, "PATHs" => $filePaths, "sizesMissing" => $sizesMissing);
|
759 |
|
760 |
$cacheItem->setValue($result);
|
612 |
if (is_object($origFile))
|
613 |
{
|
614 |
//$origFile = $imageObj->getOriginalFile();
|
615 |
+
// $origurl = wp_get_original_image_url($this->ID);
|
616 |
+
$origurl = $fs->pathToUrl($origFile); // We use path to URL because it should be more reliable than core WP ( exceptions etc )
|
617 |
+
|
618 |
+
|
619 |
if (! $origFile->exists() && ! $no_exist_check )
|
620 |
{
|
621 |
list($origurl, $path) = $this->attemptRemoteDownload($origurl, $origFile->getFullPath(), $this->ID);
|
758 |
if (! $no_exist_check)
|
759 |
$filePaths = ShortPixelAPI::CheckAndFixImagePaths($filePaths);//check for images to make sure they exist on disk
|
760 |
|
761 |
+
// Apply any changes to URL before cache.
|
762 |
+
$urlList = apply_filters('shortpixel_image_urls', $urlList, $this->ID);
|
763 |
$result = array("URLs" => $urlList, "PATHs" => $filePaths, "sizesMissing" => $sizesMissing);
|
764 |
|
765 |
$cacheItem->setValue($result);
|
@@ -18,9 +18,9 @@ namespace ShortPixel;
|
|
18 |
} else {
|
19 |
if( !$this->is_htaccess_writable ){
|
20 |
$deliverWebpUnalteredDisabled = 'disabled'; // Disable
|
21 |
-
if( $deliverWebp == 3 ){
|
22 |
$deliverWebpAlteredDisabled = 'disabled'; // Disable
|
23 |
-
$deliverWebpUnalteredLabel = __('It looks like you recently moved from an Apache server to an NGINX server, while the option to use .htacces was in use. Please follow this tutorial to see how you could implement by yourself this functionality, outside of the WP plugin
|
24 |
} else {
|
25 |
$deliverWebpUnalteredLabel = __('It looks like your .htaccess file cannot be written. Please fix this and then return to refresh this page to enable this option.','shortpixel-image-optimiser');
|
26 |
}
|
18 |
} else {
|
19 |
if( !$this->is_htaccess_writable ){
|
20 |
$deliverWebpUnalteredDisabled = 'disabled'; // Disable
|
21 |
+
if( $view->data->deliverWebp == 3 ){
|
22 |
$deliverWebpAlteredDisabled = 'disabled'; // Disable
|
23 |
+
$deliverWebpUnalteredLabel = __('It looks like you recently moved from an Apache server to an NGINX server, while the option to use .htacces was in use. Please follow this tutorial to see how you could implement by yourself this functionality, outside of the WP plugin: ','shortpixel-image-optimiser') . '<a href="javascript:void(0)" data-beacon-article="5bfeb9de2c7d3a31944e78ee">Open article</a>';
|
24 |
} else {
|
25 |
$deliverWebpUnalteredLabel = __('It looks like your .htaccess file cannot be written. Please fix this and then return to refresh this page to enable this option.','shortpixel-image-optimiser');
|
26 |
}
|
@@ -2694,12 +2694,15 @@ class WPShortPixel {
|
|
2694 |
return $this->_settings->currentStats;
|
2695 |
} else {
|
2696 |
Log::addDebug("CURRENT STATS (not older than $time) ARE BEING CALCULATED...");
|
|
|
|
|
|
|
2697 |
$imageCount = WpShortPixelMediaLbraryAdapter::countAllProcessable($this->_settings);
|
2698 |
$quotaData['time'] = time();
|
2699 |
$quotaData['optimizePdfs'] = $this->_settings->optimizePdfs;
|
2700 |
//$quotaData['quotaData'] = $quotaData;
|
2701 |
foreach($imageCount as $key => $val) {
|
2702 |
-
|
2703 |
}
|
2704 |
|
2705 |
if($this->_settings->hasCustomFolders) {
|
2694 |
return $this->_settings->currentStats;
|
2695 |
} else {
|
2696 |
Log::addDebug("CURRENT STATS (not older than $time) ARE BEING CALCULATED...");
|
2697 |
+
if (! is_array($quotaData))
|
2698 |
+
$quotaData = array(); // quality control, we had issues here.
|
2699 |
+
|
2700 |
$imageCount = WpShortPixelMediaLbraryAdapter::countAllProcessable($this->_settings);
|
2701 |
$quotaData['time'] = time();
|
2702 |
$quotaData['optimizePdfs'] = $this->_settings->optimizePdfs;
|
2703 |
//$quotaData['quotaData'] = $quotaData;
|
2704 |
foreach($imageCount as $key => $val) {
|
2705 |
+
$quotaData[$key] = $val;
|
2706 |
}
|
2707 |
|
2708 |
if($this->_settings->hasCustomFolders) {
|
@@ -1,10 +1,10 @@
|
|
1 |
=== ShortPixel Image Optimizer ===
|
2 |
Contributors: ShortPixel
|
3 |
-
Tags:
|
4 |
Requires at least: 3.2.0
|
5 |
-
Tested up to: 5.
|
6 |
Requires PHP: 5.3
|
7 |
-
Stable tag: 4.19.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -12,12 +12,12 @@ Speed up your website & boost your SEO by compressing old & new images and PDFs.
|
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
**A freemium easy to use, comprehensive, stable and frequently updated image compression plugin supported by the friendly team that created it. :)**
|
16 |
|
17 |
-
Increase your website's SEO ranking, number of visitors and ultimately your sales by
|
18 |
ShortPixel is an easy to use, lightweight, install-and-forget-about-it <a href="https://shortpixel.com" target="_blank">image optimization</a> plugin that can compress all your past images and PDF documents with a single click. New images are automatically resized/rescaled and optimized on the fly, in the background. It's also compatible with any gallery, slider or ecommerce plugin.
|
19 |
|
20 |
-
**Ready for a quick DEMO? Test <a href="https://
|
21 |
|
22 |
Short Pixel uses minimal resources and works well with any shared, cloud, VPS or dedicated web hosting. It can optimize any image you have on your website even the images that aren't listed in Media Library like those in galleries like <a href="https://wordpress.org/plugins/nextgen-gallery/" target="_blank">NextGEN</a>, <a href="https://wordpress.org/plugins/modula-best-grid-gallery/" target="_blank">Modula</a> or added directly via FTP!
|
23 |
|
@@ -25,39 +25,39 @@ Both lossy and lossless image compression are available for the most common imag
|
|
25 |
We also offer **glossy** JPEG compression which is a very high quality lossy optimization algorithm. Specially designed for photographers!
|
26 |
Optimized images mean better user experience, better PageSpeed Insights or GTmetrix results, better Google PageRank and more visitors.
|
27 |
|
28 |
-
Make an instant <a href="http://shortpixel.com/image-compression-test" target="_blank">image compression test</a>
|
29 |
|
30 |
**Why is ShortPixel the best choice when it comes to image optimization or PDF compression?**
|
31 |
|
32 |
-
* popular plugin with over 200,000 active installations according to WordPress
|
33 |
-
* compress JPG, PNG, GIF (still or animated) images and also PDF documents
|
34 |
-
* option to automatically convert PNG to JPG if that will result in smaller images. Ideal for large images in PNG format.
|
35 |
-
* no file size limit
|
36 |
* option to freely convert any JPEG, PNG or GIF (even animated ones!) to **WebP** for more Google love. <a href="http://blog.shortpixel.com/how-webp-images-can-speed-up-your-site/" target="_blank">How to enable WebP?</a>
|
|
|
37 |
* option to include the generated WebP images into the front-end pages by using the `<picture>` tag instead of `<img>`
|
38 |
* compatible with WP Retina 2x - all **retina images** are automatically compressed. <a href="http://blog.shortpixel.com/how-to-use-optimized-retina-images-on-your-wordpress-site-for-best-user-experience-on-apple-devices/" target="_blank">How to benefit from Retina displays?</a>
|
39 |
-
* optimize thumbnails as well as featured images. You can also **select individual thumbnails to exclude** from optimization
|
40 |
* ability to optimize any image on your site including images in **NextGEN Gallery** and any other image galleries or sliders
|
41 |
-
*
|
42 |
-
* featured images can be automatically resized before being optimized with 2 different options. No need for additional plugins like Imsanity
|
43 |
* CMYK to RGB conversion
|
|
|
44 |
* **24h <a href="https://wordpress.org/support/plugin/shortpixel-image-optimiser/reviews/?filter=5" target="_blank">stellar support</a>** (24/7) directly from developers.
|
45 |
-
* easily **test lossy/lossless** versions of the images with a single click in your Media Library
|
46 |
-
* **great for photographers**: <a href="http://blog.shortpixel.com/how-much-smaller-can-be-images-without-exif-icc/" target="_blank">keep or remove EXIF</a> data from your images, compress
|
47 |
* works well with both HTTPS and HTTP websites
|
48 |
* uses progressive JPEG for larger images in order to speed up the image display
|
49 |
* you can run ShortPixel plugin on **multiple websites** or on a **multisite** with a **single API Key**
|
50 |
-
* it is **safe to test** and use the plugin: all the original images can be restored with a click, either one by one or in bulk
|
51 |
* 'Bulk' optimize all the existing images in Media Library or in any gallery with one click
|
52 |
* works great for **eCommerce websites using WooCommerce** or other plugins
|
53 |
* works great with NextGEN gallery, Foo Gallery and any other galleries and sliders
|
54 |
* compatible with WP Engine hosted websites and all the major hosting providers
|
55 |
* compatible with WPML and WPML Media plugins
|
56 |
-
*
|
|
|
57 |
* compatible with watermarking plugins
|
58 |
* option to deactivate auto-optimizing images on upload
|
59 |
-
* images that are
|
60 |
-
*
|
61 |
* 30 days optimization report with all image details and overall statistics
|
62 |
* We are GDPR compliant! <a href="https://shortpixel.com/privacy#gdpr" target="_blank">Read more.</a>
|
63 |
* **free optimization credits for non-profits**, <a href="https://shortpixel.com/contact" target="_blank">contact us</a> for details
|
@@ -78,6 +78,14 @@ Check out <a href="https://shortpixel.com/pricing" target="_blank">our prices</a
|
|
78 |
|
79 |
Help us spread the word by recommending ShortPixel to your friends and collect **100 lifetime monthly additional image credits for each referred active user**. Make money by promoting a great plugin with our <a href="https://shortpixel.com/free-sign-up-affiliate" target="_blank">50/50 affiliate program</a>.
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
**Get in touch!**
|
82 |
|
83 |
* Email <a href="https://shortpixel.com/contact" target="_blank">https://shortpixel.com/contact</a>
|
@@ -101,36 +109,47 @@ Let's get ShortPixel plugin running on your WordPress website:
|
|
101 |
|
102 |
== Frequently Asked Questions ==
|
103 |
|
104 |
-
= How does ShortPixel compare to other image optimisation plugins (e.g Smush, Imagify, TinyPNG, Kraken, EWWW)? =
|
105 |
-
ShortPixel has better compression rates
|
106 |
-
|
|
|
|
|
107 |
|
108 |
= Can I use the same API Key on multiple web sites? =
|
109 |
Yes, you can.
|
110 |
-
As long as you have available credits you can use a single API Key on as many websites as you wish!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
= Can I test/use the plugin for free? =
|
113 |
-
Yes you can.
|
114 |
We offer 100 free image optimization credits each month. Exceeding the monthly free quota will pause the optimization process till the quota is reset or extended by buying one of our plans.
|
115 |
|
116 |
= Can I optimize images that aren't in Media Library? =
|
117 |
Absolutely.
|
118 |
You can actually optimize any image you have on your site regardless of its place. You just need to add - in the Advanced section of the ShortPixel Settings - the folders where the images you want to optimize are located and ShortPixel will work its magic and do the rest.
|
119 |
|
120 |
-
= Can I optimize both past and new
|
121 |
Sure!
|
122 |
-
You can optimize all your past/current images using our "Bulk ShortPixel" page in your Media with a single click.
|
123 |
|
124 |
= A credit = an optimized image? =
|
125 |
Yes, that is correct.
|
126 |
-
|
127 |
|
128 |
= Can I restore my images? What happens with the originals? =
|
129 |
If you choose the "Image backup" option in Settings/ShortPixel then the original version of any optimized image or PDF will be saved in the backup folder.
|
130 |
The original image is needed if you want to restore an image or if you want to convert an image from lossy/glossy to lossless or viceversa.
|
131 |
|
132 |
= What types of formats can be optimized? =
|
133 |
-
ShortPixel
|
134 |
|
135 |
= Do you have one-time plans? =
|
136 |
Yes we do.
|
@@ -141,13 +160,13 @@ Let's get ShortPixel plugin running on your WordPress website:
|
|
141 |
If you choose the backup option then the originals will be saved in a separate folder so you can restore them should you ever need/want to do that.
|
142 |
|
143 |
= How does the plugin work? =
|
144 |
-
Our light-weight plugin sends the original images to our Image Optimization Cloud where they are compressed. ShortPixel then downloads the optimized images and the unoptimized originals are replaced with the
|
145 |
|
146 |
-
= Do you optimize
|
147 |
Yes, all the images processsed by ShortPixel are optimized in the Cloud. This takes the load off of your server and allows us to produce the best results.
|
148 |
|
149 |
= What payment methods are accepted? =
|
150 |
-
We accept payments via PayPal and
|
151 |
|
152 |
= How do I activate the API key on a multisite? =
|
153 |
You have to activate the plugin in the network admin and then activate it manually on each individual site in the multisite. Once you have done that, the Settings menu appears and you can add the API key for each individual site.
|
@@ -168,7 +187,7 @@ where `APIKEY` is the API Key received upon sign up.
|
|
168 |
Please also note that usually images in your Media Library have 3-5 thumbs associated and a credit will be used for each featured image or associated thumbnail that is optimized.
|
169 |
|
170 |
= Why shall I use a wordpress plugin and not an offline tool? =
|
171 |
-
Because ShortPixel algorithms were perfected while optimizing over
|
172 |
ShortPixel not only offers the best compression for JPEG, PNG, GIF and PDF files but it also saves you a lot of time. You just install it on your site and then ShortPixel will take care that all the images on your site are immediately optimized after upload.
|
173 |
|
174 |
= Does optimizing images affect my ALT tags? =
|
@@ -176,7 +195,7 @@ where `APIKEY` is the API Key received upon sign up.
|
|
176 |
|
177 |
= If I stop using ShortPixel will my images remain optimized? =
|
178 |
Absolutely!
|
179 |
-
Once optimized the images will remain optimized unless you explicitly choose to restore them. But why would you do that? :-)
|
180 |
|
181 |
= Do I have to pay monthly or one time? =
|
182 |
We have both options available.
|
@@ -201,7 +220,7 @@ where `APIKEY` is the API Key received upon sign up.
|
|
201 |
<a href="https://shortpixel.com/cli-docs">https://shortpixel.com/cli-docs</a>
|
202 |
|
203 |
= How does resizing work? =
|
204 |
-
If you choose the option to resize your
|
205 |
Using this option you can safely upload original images safely without needing to apply any pre-processing to make them smaller.
|
206 |
|
207 |
= Will ShortPixel work if my website is using CloudFare? =
|
@@ -232,7 +251,7 @@ just before returning the ShortPixel backup folder, usually /wp-content/uploads/
|
|
232 |
post ID is not always set, only if it's an image from Media Library;
|
233 |
|
234 |
`apply_filters('shortpixel_image_urls', $URLs, $post_id);`
|
235 |
-
filters the URLs that will be sent to
|
236 |
|
237 |
`apply_filters('shortpixel/db/chunk_size', $chunk);`
|
238 |
the `$chunk` is the value ShortPixel chooses to use as number of selected records in one query (based on total table size), some hosts work better with a different value;
|
@@ -245,7 +264,7 @@ will handle custom thumbnails like image-100x100_tl.jpg;
|
|
245 |
`define('SHORTPIXEL_CUSTOM_THUMB_INFIXES', '-uae');`
|
246 |
will handle custom thumbnails like image-uae-100x100.jpg;
|
247 |
|
248 |
-
`define('SHORTPIXEL_USE_DOUBLE_WEBP_EXTENSION', true);`
|
249 |
will tell the plugin to create double extensions for the WebP image counterparts, for example image.jpg.webp for image.jpg;
|
250 |
|
251 |
`define("SHORTPIXEL_NOFLOCK", true);`
|
@@ -275,12 +294,25 @@ Hide the Cloudflare settings by defining these constants in wp-config.php:
|
|
275 |
|
276 |
7. Check images optimization status, restore or reoptimize the image. (Media>Library)
|
277 |
|
278 |
-
8. Check image
|
279 |
|
280 |
9. Check other optimized images status - themes or other plugins' images. (Media>Other Media)
|
281 |
|
282 |
== Changelog ==
|
283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
= 4.19.2 =
|
285 |
|
286 |
Release date June 10th 2020
|
@@ -307,14 +339,14 @@ Release date June 4th 2020
|
|
307 |
* Fix for backup getting broken on IIS/Windows servers, because of the way Windows handles the paths;
|
308 |
* Compability fix for WooCommerce germanized PRO plugin, where the cart page was throwing a fatal error because of the PDF that ShortPixel was trying to optimize;
|
309 |
* Various fixes for other media screen, to make it more consistent with the Media Library;
|
310 |
-
* Language – 5 new strings added, 1 updated, 1 fuzzied, and 0 obsoleted.
|
311 |
|
312 |
= 4.18.1 =
|
313 |
|
314 |
Release date 20th May 2020
|
315 |
* Fix for a situation when running the bulk could result in duplicate images;
|
316 |
* Updated some old docs links;
|
317 |
-
* Language – 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted.
|
318 |
|
319 |
= 4.18.0 =
|
320 |
|
1 |
=== ShortPixel Image Optimizer ===
|
2 |
Contributors: ShortPixel
|
3 |
+
Tags: convert webp, optimize images, image optimization, resize, compressor, image, compression, optimize, image optimiser, image compression, compress pdf, compress jpg, compress png, performance, photography, smush, scale, pictures
|
4 |
Requires at least: 3.2.0
|
5 |
+
Tested up to: 5.5
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 4.19.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
**A freemium, easy to use, comprehensive, stable and frequently updated image compression plugin supported by the friendly team that created it. :)**
|
16 |
|
17 |
+
Increase your website's SEO ranking, number of visitors and ultimately your sales by optimising any image or PDF document on your website.
|
18 |
ShortPixel is an easy to use, lightweight, install-and-forget-about-it <a href="https://shortpixel.com" target="_blank">image optimization</a> plugin that can compress all your past images and PDF documents with a single click. New images are automatically resized/rescaled and optimized on the fly, in the background. It's also compatible with any gallery, slider or ecommerce plugin.
|
19 |
|
20 |
+
**Ready for a quick DEMO? Test <a href="https://sandboxwordpress.com/?htmldata=https://shortpixel.com/sp.html&slug=shortpixel-image-optimiser&redirect=plugins.php&title=Test%20SHORTPIXEL%20Now!&ga=UA-55918546-1" target="_blank">here</a> or <a href="https://wpsandbox.net/" target="_blank">here</a>.**
|
21 |
|
22 |
Short Pixel uses minimal resources and works well with any shared, cloud, VPS or dedicated web hosting. It can optimize any image you have on your website even the images that aren't listed in Media Library like those in galleries like <a href="https://wordpress.org/plugins/nextgen-gallery/" target="_blank">NextGEN</a>, <a href="https://wordpress.org/plugins/modula-best-grid-gallery/" target="_blank">Modula</a> or added directly via FTP!
|
23 |
|
25 |
We also offer **glossy** JPEG compression which is a very high quality lossy optimization algorithm. Specially designed for photographers!
|
26 |
Optimized images mean better user experience, better PageSpeed Insights or GTmetrix results, better Google PageRank and more visitors.
|
27 |
|
28 |
+
Make an instant <a href="http://shortpixel.com/image-compression-test" target="_blank">image compression test</a> of your site or <a href="http://shortpixel.com/online-image-compression" target="_blank">compress some images</a> to test our optimization algorithms.
|
29 |
|
30 |
**Why is ShortPixel the best choice when it comes to image optimization or PDF compression?**
|
31 |
|
32 |
+
* popular plugin with over 200,000 active installations - according to WordPress
|
33 |
+
* compress JPG (and its variations JPEG, JPEG 2000, JPEG XR), PNG, GIF (still or animated) images and also PDF documents
|
|
|
|
|
34 |
* option to freely convert any JPEG, PNG or GIF (even animated ones!) to **WebP** for more Google love. <a href="http://blog.shortpixel.com/how-webp-images-can-speed-up-your-site/" target="_blank">How to enable WebP?</a>
|
35 |
+
* option to automatically convert PNG to JPG if that will result in smaller images. Ideal for large images in PNG format
|
36 |
* option to include the generated WebP images into the front-end pages by using the `<picture>` tag instead of `<img>`
|
37 |
* compatible with WP Retina 2x - all **retina images** are automatically compressed. <a href="http://blog.shortpixel.com/how-to-use-optimized-retina-images-on-your-wordpress-site-for-best-user-experience-on-apple-devices/" target="_blank">How to benefit from Retina displays?</a>
|
38 |
+
* optimize thumbnails as well as featured images. You can also **select individual thumbnails to exclude** from optimization
|
39 |
* ability to optimize any image on your site including images in **NextGEN Gallery** and any other image galleries or sliders
|
40 |
+
* option to scale images down, with 2 different options, which is very useful to automatically resize large images. This applies to the featured images and there is no need for additional plugins like Imsanity
|
|
|
41 |
* CMYK to RGB conversion
|
42 |
+
* skip already optimized images
|
43 |
* **24h <a href="https://wordpress.org/support/plugin/shortpixel-image-optimiser/reviews/?filter=5" target="_blank">stellar support</a>** (24/7) directly from developers.
|
44 |
+
* easily **test lossy/glossy/lossless** versions of the images with a single click in your Media Library
|
45 |
+
* **great for photographers**: <a href="http://blog.shortpixel.com/how-much-smaller-can-be-images-without-exif-icc/" target="_blank">keep or remove EXIF</a> data from your images, compress photos with lossless option
|
46 |
* works well with both HTTPS and HTTP websites
|
47 |
* uses progressive JPEG for larger images in order to speed up the image display
|
48 |
* you can run ShortPixel plugin on **multiple websites** or on a **multisite** with a **single API Key**
|
49 |
+
* it is **safe to test** and use the plugin: all the original images are by default saved in a local backup that can be restored with a click, either one by one or in bulk
|
50 |
* 'Bulk' optimize all the existing images in Media Library or in any gallery with one click
|
51 |
* works great for **eCommerce websites using WooCommerce** or other plugins
|
52 |
* works great with NextGEN gallery, Foo Gallery and any other galleries and sliders
|
53 |
* compatible with WP Engine hosted websites and all the major hosting providers
|
54 |
* compatible with WPML and WPML Media plugins
|
55 |
+
* no file size limit
|
56 |
+
* integrates with Gravity Forms post_image field type optimizing the images upon upload
|
57 |
* compatible with watermarking plugins
|
58 |
* option to deactivate auto-optimizing images on upload
|
59 |
+
* no credits are used for the images that are optimised less that 5%
|
60 |
+
* direct integration with CloudFlare, either by using an API Key or a Token
|
61 |
* 30 days optimization report with all image details and overall statistics
|
62 |
* We are GDPR compliant! <a href="https://shortpixel.com/privacy#gdpr" target="_blank">Read more.</a>
|
63 |
* **free optimization credits for non-profits**, <a href="https://shortpixel.com/contact" target="_blank">contact us</a> for details
|
78 |
|
79 |
Help us spread the word by recommending ShortPixel to your friends and collect **100 lifetime monthly additional image credits for each referred active user**. Make money by promoting a great plugin with our <a href="https://shortpixel.com/free-sign-up-affiliate" target="_blank">50/50 affiliate program</a>.
|
80 |
|
81 |
+
**Other plugins by ShortPixel**
|
82 |
+
|
83 |
+
* Image optimization & CDN on the fly - <a href="https://wordpress.org/plugins/shortpixel-adaptive-images/" target="_blank">ShortPixel Adaptive Images</a>
|
84 |
+
* Easily replace images or files in Media Library - <a href="https://wordpress.org/plugins/enable-media-replace/" target="_blank">Enable Media Replace</a>
|
85 |
+
* Regenerate thumbnails plugin compatible with the other ShortPixel plugins - <a href="https://wordpress.org/plugins/regenerate-thumbnails-advanced/" target="_blank">reGenerate Thumbnails Advanced</a>
|
86 |
+
* Make sure you don't have huge images in your Media Library - <a href="https://wordpress.org/plugins/resize-image-after-upload/" target="_blank">Resize Image After Upload</a>
|
87 |
+
|
88 |
+
|
89 |
**Get in touch!**
|
90 |
|
91 |
* Email <a href="https://shortpixel.com/contact" target="_blank">https://shortpixel.com/contact</a>
|
109 |
|
110 |
== Frequently Asked Questions ==
|
111 |
|
112 |
+
= How does ShortPixel compare to other image optimisation plugins (e.g Smush, Imagify, TinyPNG, Kraken, EWWW, Optimole)? =
|
113 |
+
ShortPixel consistently has better compression rates along with more features, backup support and has very affordable one-time or monthly plans.
|
114 |
+
Here are a couple of independent reviews:
|
115 |
+
AuthorityHacker - "ShortPixel is our tool of choice, simply because it’s pretty much automated – we just let it do its thing." (<a href="https://www.authorityhacker.com/best-wordpress-image-optimizer/" target="_blank">read full review</a>)
|
116 |
+
WP Modula - "One of the reasons I’m personally a huge fan of ShortPixel is the built-in support for next-gen image formats like WebP." (<a href="https://wp-modula.com/the-best-wordpress-image-optimization-plugins/" target="_blank">read full review</a>)
|
117 |
|
118 |
= Can I use the same API Key on multiple web sites? =
|
119 |
Yes, you can.
|
120 |
+
As long as you have available credits, you can use a single API Key on as many websites as you wish!
|
121 |
+
|
122 |
+
= What plan is better for me? What do you recommend? =
|
123 |
+
Everyone has different needs, but generally, we recommend getting a One-Time plan to optimize your whole Media Library and then get a Monthly plan to optimize your future uploads. To learn more, have a look at <a href="https://help.shortpixel.com/article/30-monthly-plans-vs-one-time-plans" target="_blank">this comparison</a>
|
124 |
+
|
125 |
+
= I don't know how many thumbnails do I have, what plan should I take?
|
126 |
+
To know how many thumbnails you have, just install the plugin and go to Media > Bulk ShortPixel. The plugin will tell you how many thumbnails you've got. Based on this, have a look at <a href="https://shortpixel.com/pricing" target="_blank">our plans</a>
|
127 |
+
|
128 |
+
= Can I upgrade/downgrade easily my plan? =
|
129 |
+
Of course. You can upgrade or downgrade your plans in a couple of clicks from your account on shortpixel.com.
|
130 |
|
131 |
= Can I test/use the plugin for free? =
|
132 |
+
Yes, you can.
|
133 |
We offer 100 free image optimization credits each month. Exceeding the monthly free quota will pause the optimization process till the quota is reset or extended by buying one of our plans.
|
134 |
|
135 |
= Can I optimize images that aren't in Media Library? =
|
136 |
Absolutely.
|
137 |
You can actually optimize any image you have on your site regardless of its place. You just need to add - in the Advanced section of the ShortPixel Settings - the folders where the images you want to optimize are located and ShortPixel will work its magic and do the rest.
|
138 |
|
139 |
+
= Can I optimize images that are both past and new? =
|
140 |
Sure!
|
141 |
+
You can optimize all your past/current images and photos using our "Bulk ShortPixel" page in your Media with a single click.
|
142 |
|
143 |
= A credit = an optimized image? =
|
144 |
Yes, that is correct.
|
145 |
+
But please note that usually an image in Media Library has 3, 5 or more associated thumbs. Each optimized thumb requires a credit. In the rare cases when ShortPixel does not optimise the image (lossy) with at least 5%, the credit will not be consumed, though.
|
146 |
|
147 |
= Can I restore my images? What happens with the originals? =
|
148 |
If you choose the "Image backup" option in Settings/ShortPixel then the original version of any optimized image or PDF will be saved in the backup folder.
|
149 |
The original image is needed if you want to restore an image or if you want to convert an image from lossy/glossy to lossless or viceversa.
|
150 |
|
151 |
= What types of formats can be optimized? =
|
152 |
+
ShortPixel optimises JPEG (JPG, JPEG, JPEG 2000, JPEG XR), PNG, GIF (animated and still) and PDF type of files.
|
153 |
|
154 |
= Do you have one-time plans? =
|
155 |
Yes we do.
|
160 |
If you choose the backup option then the originals will be saved in a separate folder so you can restore them should you ever need/want to do that.
|
161 |
|
162 |
= How does the plugin work? =
|
163 |
+
Our light-weight plugin sends the original images to our Image Optimization Cloud where they are compressed. ShortPixel then downloads the optimized images and the unoptimized originals are replaced with the optimised versions.
|
164 |
|
165 |
+
= Do you optimize images in the cloud? =
|
166 |
Yes, all the images processsed by ShortPixel are optimized in the Cloud. This takes the load off of your server and allows us to produce the best results.
|
167 |
|
168 |
= What payment methods are accepted? =
|
169 |
+
We accept payments via card (Mastercard, Visa, Maestro, American Express, Discover, Diners Club, JCB, UnionPay), PayPal and Apple Pay.
|
170 |
|
171 |
= How do I activate the API key on a multisite? =
|
172 |
You have to activate the plugin in the network admin and then activate it manually on each individual site in the multisite. Once you have done that, the Settings menu appears and you can add the API key for each individual site.
|
187 |
Please also note that usually images in your Media Library have 3-5 thumbs associated and a credit will be used for each featured image or associated thumbnail that is optimized.
|
188 |
|
189 |
= Why shall I use a wordpress plugin and not an offline tool? =
|
190 |
+
Because ShortPixel algorithms were perfected while optimizing over 2 billion real-life images.
|
191 |
ShortPixel not only offers the best compression for JPEG, PNG, GIF and PDF files but it also saves you a lot of time. You just install it on your site and then ShortPixel will take care that all the images on your site are immediately optimized after upload.
|
192 |
|
193 |
= Does optimizing images affect my ALT tags? =
|
195 |
|
196 |
= If I stop using ShortPixel will my images remain optimized? =
|
197 |
Absolutely!
|
198 |
+
Once optimized, the images will remain optimized unless you explicitly choose to restore them. But why would you do that? :-)
|
199 |
|
200 |
= Do I have to pay monthly or one time? =
|
201 |
We have both options available.
|
220 |
<a href="https://shortpixel.com/cli-docs">https://shortpixel.com/cli-docs</a>
|
221 |
|
222 |
= How does resizing work? =
|
223 |
+
If you choose the option to resize images on your site, then the featured image can be resized to a predefined size while keeping its aspect and proportions intact. The associated thumbs won't be resized.
|
224 |
Using this option you can safely upload original images safely without needing to apply any pre-processing to make them smaller.
|
225 |
|
226 |
= Will ShortPixel work if my website is using CloudFare? =
|
251 |
post ID is not always set, only if it's an image from Media Library;
|
252 |
|
253 |
`apply_filters('shortpixel_image_urls', $URLs, $post_id);`
|
254 |
+
filters the URLs that will be sent to optimisation, `$URLs` is a plain array;
|
255 |
|
256 |
`apply_filters('shortpixel/db/chunk_size', $chunk);`
|
257 |
the `$chunk` is the value ShortPixel chooses to use as number of selected records in one query (based on total table size), some hosts work better with a different value;
|
264 |
`define('SHORTPIXEL_CUSTOM_THUMB_INFIXES', '-uae');`
|
265 |
will handle custom thumbnails like image-uae-100x100.jpg;
|
266 |
|
267 |
+
`define('SHORTPIXEL_USE_DOUBLE_WEBP_EXTENSION', true);`
|
268 |
will tell the plugin to create double extensions for the WebP image counterparts, for example image.jpg.webp for image.jpg;
|
269 |
|
270 |
`define("SHORTPIXEL_NOFLOCK", true);`
|
294 |
|
295 |
7. Check images optimization status, restore or reoptimize the image. (Media>Library)
|
296 |
|
297 |
+
8. Check image optimisation details. (Media>Library->Edit)
|
298 |
|
299 |
9. Check other optimized images status - themes or other plugins' images. (Media>Other Media)
|
300 |
|
301 |
== Changelog ==
|
302 |
|
303 |
+
= 4.19.3 =
|
304 |
+
|
305 |
+
Release date July 14th 2020
|
306 |
+
* Fix: Images weren't optimized when they were added from the Upload function of the Gutenberg image block;
|
307 |
+
* Fix: Scaled images when using relative paths now don't fail on domain issues;
|
308 |
+
* Fix: Drop any notices that don't have ShortPixel Notice as SubClass;
|
309 |
+
* Fix: Properly handle some situations when the .htaccess file is read-only;
|
310 |
+
* Fix: Avoid the plugin crash in some specific situations when an invalid API Key was provided;
|
311 |
+
* Fix: Notices were being displayed for the first time custom folders were added on a multisite install;
|
312 |
+
* Fix: Optimize now wasn't displayed anymore as a button in Other Media for multisite installs;
|
313 |
+
* Fix: In certain situations, when the image timestamp changed, the optimization was counting 2 credits;
|
314 |
+
* Language: 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted.
|
315 |
+
|
316 |
= 4.19.2 =
|
317 |
|
318 |
Release date June 10th 2020
|
339 |
* Fix for backup getting broken on IIS/Windows servers, because of the way Windows handles the paths;
|
340 |
* Compability fix for WooCommerce germanized PRO plugin, where the cart page was throwing a fatal error because of the PDF that ShortPixel was trying to optimize;
|
341 |
* Various fixes for other media screen, to make it more consistent with the Media Library;
|
342 |
+
* Language – 5 new strings added, 1 updated, 1 fuzzied, and 0 obsoleted.
|
343 |
|
344 |
= 4.18.1 =
|
345 |
|
346 |
Release date 20th May 2020
|
347 |
* Fix for a situation when running the bulk could result in duplicate images;
|
348 |
* Updated some old docs links;
|
349 |
+
* Language – 0 new strings added, 0 updated, 0 fuzzied, and 0 obsoleted.
|
350 |
|
351 |
= 4.18.0 =
|
352 |
|
@@ -67,7 +67,7 @@
|
|
67 |
display: inline-block;
|
68 |
border: 1px solid #ccc;
|
69 |
background-size: cover;
|
70 |
-
background-position: center;}
|
71 |
.shortpixel-other-media .list-overview .item .thumb img {
|
72 |
max-width: 60px;
|
73 |
max-height: 60px;
|
@@ -76,10 +76,11 @@
|
|
76 |
.shortpixel-other-media .list-overview .item .actions {
|
77 |
min-width: 105px; }
|
78 |
.shortpixel-other-media .list-overview .item .single-action {
|
79 |
-
text-align:
|
80 |
-
.shortpixel-other-media .list-overview .item .single-action
|
81 |
color: #fff;
|
82 |
-
text-decoration: none;
|
|
|
83 |
.shortpixel-other-media .list-overview .item .single-action .button-smaller {
|
84 |
width: 110px; }
|
85 |
.shortpixel-other-media .list-overview .item .multi-action-wrapper {
|
67 |
display: inline-block;
|
68 |
border: 1px solid #ccc;
|
69 |
background-size: cover;
|
70 |
+
background-position: center; }
|
71 |
.shortpixel-other-media .list-overview .item .thumb img {
|
72 |
max-width: 60px;
|
73 |
max-height: 60px;
|
76 |
.shortpixel-other-media .list-overview .item .actions {
|
77 |
min-width: 105px; }
|
78 |
.shortpixel-other-media .list-overview .item .single-action {
|
79 |
+
text-align: left; }
|
80 |
+
.shortpixel-other-media .list-overview .item .single-action a {
|
81 |
color: #fff;
|
82 |
+
text-decoration: none;
|
83 |
+
text-align: center; }
|
84 |
.shortpixel-other-media .list-overview .item .single-action .button-smaller {
|
85 |
width: 110px; }
|
86 |
.shortpixel-other-media .list-overview .item .multi-action-wrapper {
|
@@ -137,14 +137,21 @@
|
|
137 |
.actions
|
138 |
{
|
139 |
min-width: 105px;
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
.single-action
|
142 |
{
|
143 |
-
text-align:
|
144 |
-
|
145 |
{
|
146 |
color: #fff;
|
147 |
text-decoration: none;
|
|
|
|
|
148 |
}
|
149 |
.button-smaller
|
150 |
{
|
137 |
.actions
|
138 |
{
|
139 |
min-width: 105px;
|
140 |
+
|
141 |
+
div
|
142 |
+
{
|
143 |
+
//float: right;
|
144 |
+
}
|
145 |
}
|
146 |
.single-action
|
147 |
{
|
148 |
+
text-align: left;
|
149 |
+
a
|
150 |
{
|
151 |
color: #fff;
|
152 |
text-decoration: none;
|
153 |
+
text-align: center;
|
154 |
+
|
155 |
}
|
156 |
.button-smaller
|
157 |
{
|
@@ -60,7 +60,6 @@ class ShortPixelPlugin
|
|
60 |
$front = new Controller\FrontController();
|
61 |
$admin = Controller\AdminController::getInstance();
|
62 |
$adminNotices = Controller\AdminNoticesController::getInstance(); // Hook in the admin notices.
|
63 |
-
$notices = Notices::getInstance(); // This hooks the ajax listener
|
64 |
|
65 |
$this->initHooks();
|
66 |
|
@@ -73,33 +72,9 @@ class ShortPixelPlugin
|
|
73 |
public function init()
|
74 |
{
|
75 |
$this->shortPixel->loadHooks();
|
76 |
-
$admin = Controller\AdminController::getInstance();
|
77 |
-
|
78 |
-
if ($this->settings()->autoMediaLibrary)
|
79 |
-
{
|
80 |
-
// compat filter to shortcircuit this in cases. (see external - visualcomposer)
|
81 |
-
if (apply_filters('shortpixel/init/automedialibrary', true))
|
82 |
-
{
|
83 |
-
if($this->settings()->autoMediaLibrary && $this->settings()->png2jpg) {
|
84 |
-
add_action( 'wp_handle_upload', array($admin,'handlePng2JpgHook'));
|
85 |
-
// @todo Document what plugin does mpp
|
86 |
-
add_action( 'mpp_handle_upload', array($admin,'handlePng2JpgHook'));
|
87 |
-
}
|
88 |
-
add_action('wp_handle_replace', array($admin,'handleReplaceHook'));
|
89 |
|
90 |
-
|
91 |
|
92 |
-
add_filter( 'wp_generate_attachment_metadata', array($admin,'handleImageUploadHook'), 10, 2 );
|
93 |
-
// @todo Document what plugin does mpp
|
94 |
-
add_filter( 'mpp_generate_metadata', array($admin,'handleImageUploadHook'), 10, 2 );
|
95 |
-
}
|
96 |
-
}
|
97 |
-
}
|
98 |
-
elseif($this->settings()->frontBootstrap && $this->env()->is_front)
|
99 |
-
{
|
100 |
-
// if automedialibrary is off, but we do want to auto-optimize on the front, still load the hook.
|
101 |
-
add_filter( 'wp_generate_attachment_metadata', array($admin,'handleImageUploadHook'), 10, 2 );
|
102 |
-
}
|
103 |
}
|
104 |
|
105 |
/** Function to get plugin settings
|
@@ -154,6 +129,34 @@ class ShortPixelPlugin
|
|
154 |
|
155 |
add_action( 'shortpixel-thumbnails-before-regenerate', array( $this->shortPixel, 'thumbnailsBeforeRegenerateHook' ), 10, 1);
|
156 |
add_action( 'shortpixel-thumbnails-regenerated', array( $this->shortPixel, 'thumbnailsRegeneratedHook' ), 10, 4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
158 |
|
159 |
/** Hook in our admin pages */
|
@@ -373,11 +376,13 @@ class ShortPixelPlugin
|
|
373 |
|
374 |
\WpShortPixelDb::checkCustomTables();
|
375 |
|
376 |
-
Controller\AdminNoticesController::
|
|
|
|
|
377 |
Controller\AdminNoticesController::resetAPINotices();
|
378 |
Controller\AdminNoticesController::resetQuotaNotices();
|
379 |
Controller\AdminNoticesController::resetIntegrationNotices();
|
380 |
-
|
381 |
\WPShortPixelSettings::onActivate();
|
382 |
|
383 |
}
|
@@ -398,7 +403,6 @@ class ShortPixelPlugin
|
|
398 |
$log = $fs->getFile(SHORTPIXEL_BACKUP_FOLDER . "/shortpixel_log");
|
399 |
if ($log->exists())
|
400 |
$log->delete();
|
401 |
-
// @unlink(SHORTPIXEL_BACKUP_FOLDER . "/shortpixel_log");
|
402 |
}
|
403 |
|
404 |
public static function uninstallPlugin()
|
60 |
$front = new Controller\FrontController();
|
61 |
$admin = Controller\AdminController::getInstance();
|
62 |
$adminNotices = Controller\AdminNoticesController::getInstance(); // Hook in the admin notices.
|
|
|
63 |
|
64 |
$this->initHooks();
|
65 |
|
72 |
public function init()
|
73 |
{
|
74 |
$this->shortPixel->loadHooks();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
+
$notices = Notices::getInstance(); // This hooks the ajax listener
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
/** Function to get plugin settings
|
129 |
|
130 |
add_action( 'shortpixel-thumbnails-before-regenerate', array( $this->shortPixel, 'thumbnailsBeforeRegenerateHook' ), 10, 1);
|
131 |
add_action( 'shortpixel-thumbnails-regenerated', array( $this->shortPixel, 'thumbnailsRegeneratedHook' ), 10, 4);
|
132 |
+
|
133 |
+
$admin = Controller\AdminController::getInstance();
|
134 |
+
|
135 |
+
if ($this->settings()->autoMediaLibrary)
|
136 |
+
{
|
137 |
+
// compat filter to shortcircuit this in cases. (see external - visualcomposer)
|
138 |
+
if (apply_filters('shortpixel/init/automedialibrary', true))
|
139 |
+
{
|
140 |
+
if($this->settings()->autoMediaLibrary && $this->settings()->png2jpg) {
|
141 |
+
add_action( 'wp_handle_upload', array($admin,'handlePng2JpgHook'));
|
142 |
+
// @todo Document what plugin does mpp
|
143 |
+
add_action( 'mpp_handle_upload', array($admin,'handlePng2JpgHook'));
|
144 |
+
}
|
145 |
+
add_action('wp_handle_replace', array($admin,'handleReplaceHook'));
|
146 |
+
|
147 |
+
if($this->settings()->autoMediaLibrary) {
|
148 |
+
|
149 |
+
add_filter( 'wp_generate_attachment_metadata', array($admin,'handleImageUploadHook'), 10, 2 );
|
150 |
+
// @todo Document what plugin does mpp
|
151 |
+
add_filter( 'mpp_generate_metadata', array($admin,'handleImageUploadHook'), 10, 2 );
|
152 |
+
}
|
153 |
+
}
|
154 |
+
}
|
155 |
+
elseif($this->settings()->frontBootstrap && $this->env()->is_front)
|
156 |
+
{
|
157 |
+
// if automedialibrary is off, but we do want to auto-optimize on the front, still load the hook.
|
158 |
+
add_filter( 'wp_generate_attachment_metadata', array($admin,'handleImageUploadHook'), 10, 2 );
|
159 |
+
}
|
160 |
}
|
161 |
|
162 |
/** Hook in our admin pages */
|
376 |
|
377 |
\WpShortPixelDb::checkCustomTables();
|
378 |
|
379 |
+
Controller\AdminNoticesController::resetAllNotices();
|
380 |
+
|
381 |
+
/* Controller\AdminNoticesController::resetCompatNotice();
|
382 |
Controller\AdminNoticesController::resetAPINotices();
|
383 |
Controller\AdminNoticesController::resetQuotaNotices();
|
384 |
Controller\AdminNoticesController::resetIntegrationNotices();
|
385 |
+
*/
|
386 |
\WPShortPixelSettings::onActivate();
|
387 |
|
388 |
}
|
403 |
$log = $fs->getFile(SHORTPIXEL_BACKUP_FOLDER . "/shortpixel_log");
|
404 |
if ($log->exists())
|
405 |
$log->delete();
|
|
|
406 |
}
|
407 |
|
408 |
public static function uninstallPlugin()
|
@@ -112,7 +112,8 @@ class ShortPixelAPI {
|
|
112 |
throw new Exception(__('Invalid API Key', 'shortpixel-image-optimiser'));
|
113 |
}
|
114 |
|
115 |
-
|
|
|
116 |
|
117 |
$requestParameters = array(
|
118 |
'plugin_version' => SHORTPIXEL_IMAGE_OPTIMISER_VERSION,
|
112 |
throw new Exception(__('Invalid API Key', 'shortpixel-image-optimiser'));
|
113 |
}
|
114 |
|
115 |
+
// This filter, moved to facade GetuRls/Paths
|
116 |
+
// $URLs = apply_filters('shortpixel_image_urls', $URLs, $itemHandler->getId()) ;
|
117 |
|
118 |
$requestParameters = array(
|
119 |
'plugin_version' => SHORTPIXEL_IMAGE_OPTIMISER_VERSION,
|
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: ShortPixel Image Optimizer
|
4 |
* Plugin URI: https://shortpixel.com/
|
5 |
* Description: ShortPixel optimizes images automatically, while guarding the quality of your images. Check your <a href="options-general.php?page=wp-shortpixel-settings" target="_blank">Settings > ShortPixel</a> page on how to start optimizing your image library and make your website load faster.
|
6 |
-
* Version: 4.19.
|
7 |
* Author: ShortPixel
|
8 |
* Author URI: https://shortpixel.com
|
9 |
* Text Domain: shortpixel-image-optimiser
|
@@ -32,7 +32,7 @@ define('SHORTPIXEL_PLUGIN_DIR', __DIR__);
|
|
32 |
|
33 |
//define('SHORTPIXEL_AFFILIATE_CODE', '');
|
34 |
|
35 |
-
define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.19.
|
36 |
define('SHORTPIXEL_MAX_TIMEOUT', 10);
|
37 |
define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
|
38 |
define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
|
3 |
* Plugin Name: ShortPixel Image Optimizer
|
4 |
* Plugin URI: https://shortpixel.com/
|
5 |
* Description: ShortPixel optimizes images automatically, while guarding the quality of your images. Check your <a href="options-general.php?page=wp-shortpixel-settings" target="_blank">Settings > ShortPixel</a> page on how to start optimizing your image library and make your website load faster.
|
6 |
+
* Version: 4.19.3
|
7 |
* Author: ShortPixel
|
8 |
* Author URI: https://shortpixel.com
|
9 |
* Text Domain: shortpixel-image-optimiser
|
32 |
|
33 |
//define('SHORTPIXEL_AFFILIATE_CODE', '');
|
34 |
|
35 |
+
define('SHORTPIXEL_IMAGE_OPTIMISER_VERSION', "4.19.3");
|
36 |
define('SHORTPIXEL_MAX_TIMEOUT', 10);
|
37 |
define('SHORTPIXEL_VALIDATE_MAX_TIMEOUT', 15);
|
38 |
define('SHORTPIXEL_BACKUP', 'ShortpixelBackups');
|