[WordPress] 外掛分享: ShortPixel Image Optimizer – Optimize Images, Convert WebP & AVIF

WordPress 外掛 ShortPixel Image Optimizer – Optimize Images, Convert WebP & AVIF 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「ShortPixel Image Optimizer – Optimize Images, Convert WebP & AVIF」是 2014-11-04 上架。
  • 目前有 300000 個安裝啟用數。
  • 上一次更新是 2025-04-13,距離現在已有 21 天。
  • 外掛最低要求 WordPress 4.8.0 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
  • 有 782 人給過評分。
  • 論壇上目前有 1 個提問,問題解答率 100% ,不低,算是個很有心解決問題的開發者團隊了!

外掛協作開發者

shortpixel |

外掛標籤

resize | convert webp | compress images | optimize images | image optimization |

內容簡介

這是一個免費的圖片壓縮外掛程式,擁有易於使用、全面、輕量、穩定和頻繁更新的特點,由友善的團隊開發和支援。

透過此外掛程式優化您網站上任何圖片或 PDF 文件,可以提升您的網站 SEO 排名、訪客數目並最終提高銷售量。
ShortPixel 是一個易於使用、輕量、安裝後即可忘記的圖片優化外掛程式,可透過單一點擊來壓縮您過去的所有圖片和 PDF 文件。新的圖片會在後台自動進行調整大小、縮放和優化。該外掛程式也與任何畫廊、滑塊或電子商務外掛程式兼容。

您準備要看快速 DEMO 嗎?可以在 這裡 和這裡 測試我們提供的插件。
或者您可以使用 WP Staging 創建舞台機的副本,在那裡進行測試。

ShortPixel 使用的資源很少,並且能夠與任何共享、雲端、VPS 或專用的網頁主機良好的合作。它可以優化您網站上的任何圖片,即使是那些未列入多媒體庫的圖像,例如畫廊中的圖像,例如 NextGEN、Modula 或直接通過 FTP 添加的圖像!

最常見的圖像類型(JPG、PNG、GIF、WebP 和 AVIF)加上 PDF 文件都可以提供有損和無損圖像壓縮。
我們還提供高品質有損壓縮的「光澤 JPEG 壓縮」演算法,特別為攝影師設計!
優化的圖像代表更好的用戶體驗、更好的 PageSpeed Insights 或 GTmetrix 結果、更好的 Google PageRank 和更多的訪客。

透過 ShortPixel 您可以快速進行網站上圖片的壓縮測試,只需單一點擊即可進行,您也可以壓縮圖片以測試我們的優化演算法。

新方案:ShortPixel Unlimited

這是單一網站擁有者的完美月費方案。
它允許您使用 ShortPixel Image Optimizer 在您的網站上優化無限數量的圖像。
詳細了解請參閱我們的專頁。

新增!HEIC 文件支援
透過 ShortPixel 您現在可以直接從 iPhone 上新增 Apple 格式 (HEIC) 的圖像。它們將會自動轉換為 JPG,並根據您的設定進行優化。輕鬆!了解更多。

智能剪輯

透過此新功能,您網站上使用的所有縮略圖不僅進行了優化,還重新生成,以完整顯示圖像的主題。
所有縮略圖都完整地顯示主題,並且看起來與 WordPress 創建的縮略圖一樣一致。這對於電子商務和其他圖像是賣點的網站非常理想。詳細例子參見這裡。

為什麼 ShortPixel 是優化圖像或 PDF 壓縮的最佳選擇?

擁有超過 300,000 個活躍安裝,是一個受到 WordPress 認可的受歡迎插件。

原文外掛簡介

🚀 The Ultimate Image Optimization Plugin for WordPress
⚡ Boost your site’s speed instantly! Optimize images and PDFs with one click, bulk compress to WebP and AVIF, use lazy loading, and resize images.
Increase your website’s SEO ranking, number of visitors, and ultimately your sales by optimising any image or PDF document on your website.
The ShortPixel plugin is a lightweight, user-friendly, install-and-forget solution for image optimization.
It is designed to work with any website type, whether it’s a small blog or a large WooCommerce-powered online store with tens of thousands of products.
Additionally, it’s an excellent choice for agencies, offering unlimited image optimization credits for a flat monthly fee.
🎬 Ready for a Quick DEMO of our Top Image Optimization Tool?
Test our plugin here.
Make an instant image compression test of your site or compress some images to test our optimization algorithms.
💡 Why is ShortPixel the best choice for image optimization or PDF compression?
🆕 New! Prevent AI Data Mining
Decide whether AI bots can use your images for machine learning (ML) training, or block them entirely.
🌍 Faster Websites for Global Audiences
The ShortPixel plugin now includes a built-in global Content Delivery Network (CDN). This powerful feature ensures that ShortPixel-optimized WebP and AVIF images are delivered quickly and efficiently to any location worldwide, minimizing delays and improving load times.
By leveraging this built-in solution, you enhance the user experience, reduce server strain, boost SEO performance, and simplify website management — all with minimal effort.
📸 Resize and Compress Images Without Losing Quality

Popular plugin with over 300,000 active installations – according to WordPress
Compress JPG (and its variations: JPEG, JPEG 2000, JPEG XR), PNG, GIF (still or animated) images, and also PDF documents.
Option to automatically convert PNG to JPG if that results in smaller images (ideal for large PNG pictures).
CMYK to RGB conversion.
Progressive JPEG is used whenever it leads to a smaller image.

🌟 Lossy and Lossless image compression
Both Lossy and Lossless image compression are available for the most common image types (JPG, PNG, GIF, WebP, and AVIF) plus PDF files.
We also offer Glossy JPEG compression which is a very high-quality lossy optimization algorithm. Especially designed for photographers or for high-quality product pictures.
Optimized images lead to a better user experience, improved PageSpeed Insights or GTmetrix results, higher Google PageRank, and more visitors.
🔄 Convert WebP and AVIF Formats

Option to automatically convert JPEG, PNG, or GIF to WebP and AVIF for better performance and improved Google ranking.
Animated GIFs can be automatically converted to much smaller animated WebP or AVIF files.
Option to include next-gen images (WebP and AVIF) in front-end pages with a single click using the tag.

📦 Bulk Image Optimization and Background Image Processing

New! With ‘Background mode,’ images can now be optimized without needing to keep a browser tab open.
Easily add recurring cron jobs for background optimization, ideal for sites where users upload images via the front end.
Bulk-optimize all images in the Media Library or any gallery with a single click.
Full WP-CLI support for background processing, especially useful for large Media Libraries.

🔥 Performance and Automatic Image Optimization
ShortPixel uses minimal resources and works well with any shared, cloud, VPS, or dedicated web hosting. It can optimize any image on your website, including those not listed in the Media Library, such as images in galleries or those added directly via FTP.
All optimization is performed using ShortPixel’s Image Optimization Cloud, so your hosting resources remain unaffected.

New! Automatic scan of Custom media folders for new images using cron jobs.
Skip already optimized images to avoid redundant processing.

🎨 Compatibility with Popular Themes, Page Builders, and Media Library Plugins

Works great for eCommerce websites using WooCommerce and other plugins.
Compatible with NextGEN Gallery, Modula, Foo Gallery, and other galleries or sliders.
Fully compatible with WP Retina 2x, including automatic compression of retina images.
Works seamlessly with WordPress multisite installs (sub-folders or sub-domains) using a single API key.
Compatible with WPML and WPML Media plugins.
Fully compatible with WP Offload Media plugin.
Supports both HTTPS and HTTP websites.
Compatible with virtually all hosting providers.
Integrates with Gravity Forms’ post_image field type to optimize images upon upload.
Works with watermarking plugins.
Integrates directly with Cloudflare via a Cloudflare Token, automatically synchronizing updates with Cloudflare cache.
New! HEIC file support
With ShortPixel, you can now add images in Apple’s HEIC format directly from your iPhone. They will be automatically converted to JPG and optimized according to your settings. Easy!
Read more.

🔧 Advanced Image Optimization Features

NEW Smart Cropping: Generate subject-centered thumbnails using AI, ideal for eCommerce websites.
Optimize thumbnails and featured images, with options to exclude individual thumbnails from optimization.
Advanced exclusion options (exclude images based on filename, path, size, or complex regex).
Ability to optimize any image, including those in NextGEN Gallery and other image galleries or sliders.
Option to scale images down, with two automatic resizing options for large images (applicable to featured images).
Option to deactivate auto-optimization of images on upload.
Keep or remove EXIF data from images, which is especially useful for photographers or for enhanced privacy.
Easily test lossy, glossy, or lossless versions of images with a single click in the Media Library.
100MB filesize limit

🛡️ Backup and Safety

Safe to test and use: original images are backed up locally and can be restored with a single click (either individually or in bulk).
No credits are used for images optimized by less than 5%

📊 Reporting, Analytics, Compliance and Customer Support

30-day optimization report with detailed image statistics and overall site performance improvements.
24/7 stellar support.
We are fully GDPR compliant.

🚀 New Plan: ShortPixel Unlimited
This is the ideal monthly plan for web agencies or website owners with multiple sites and frequent image uploads.
It allows you to optimize an unlimited number of images with ShortPixel Image Optimizer or use ShortPixel Adaptive Images without worrying about CDN traffic limits.
Read more details on our dedicated page.

free optimization credits for non-profits, contact us for details

💸 How much does it cost?
ShortPixel comes with 100 free credits per month, and additional unlimited monthly credits can be purchased for $9.99.
One-time credit packages that never expire are available starting at $19.99.
Check out our prices.

🌟 Testimonials:
★★★★★ A Super Plugin works very well 62% reduction overall. robertvarns
★★★★★ The secret sauce for a WordPress website. mark1mark
★★★★★ A must have plugin, great support! ElColo13
★★★★★ Excellent Plugin! Even Better Customer Service! scaliendo
★★★★★ Great image compression, solid plugin, equally great support. matters1959
more testimonials

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 30% commission affiliate program.
🛠️ Other plugins by ShortPixel

FastPixel Caching – WP Optimization made easy
ShortPixel Adaptive Images – On-the-fly image optimization & CDN delivery
Enable Media Replace – Easily replace images or files in Media Library
reGenerate Thumbnails Advanced – Easily regenerate thumbnails
Resize Image After Upload – Automatically resize each uploaded image
WP SVG Images – Secure upload of SVG files to Media Library
ShortPixel Critical CSS – Automatically generate above-the-fold CSS for fatster loading times and better SEO scores

📩 Get in touch!

Email https://shortpixel.com/contact
Twitter https://twitter.com/shortpixel
Facebook https://www.facebook.com/ShortPixel
LinkedIn https://www.linkedin.com/company/shortpixel

Actions and Filters for Developers
The ShortPixel Image Optimizer plugin calls the following actions and filters:
do_action( 'shortpixel_image_optimised', $post_id );

upon successful optimization;
do_action("shortpixel_before_restore_image", $post_id);

before restoring an image from backup;
do_action("shortpixel_after_restore_image", $post_id);

after succesful restore;
For version 4.22.10 and earlier:
apply_filters("shortpixel_backup_folder", $backup_folder, $main_file_path, $sizes);

just before returning the ShortPixel backup folder, usually /wp-content/uploads/ShortpixelBackups. The $sizes are the sizes array from metadata;
For version 5.0.0 and later:
$directory = apply_filters("shortpixel/file/backup_folder", $directory, $file);

just before returning the ShortPixel backup folder, usually /wp-content/uploads/ShortpixelBackups).
apply_filters('shortpixel_image_exists', file_exists($path), $path, $post_id);

post ID is not always set, only if it’s an image from Media Library;
apply_filters('shortpixel_image_urls', $URLs, $post_id);

filters the URLs that will be sent to optimisation, $URLs is a plain array;
The filter below is deprecated starting with version 5.0.0!
apply_filters('shortpixel/db/chunk_size', $chunk);

the $chunk is the value ShortPixel chooses to use as the number of selected records in one query (based on total table size), some hosts work better with a different value;
For version 4.22.10 and earlier:
apply_filters('shortpixel/backup/paths', $PATHs, $mainPath);

filters the array of paths of the images sent for backup and can be used to exclude certain paths/images/thumbs from being backed up, based on the image path. $mainPath is the path of the main image, while $PATHs is an array with all files to be backed up (including thumbnails);
For version 5.0.0 and later:
apply_filters('shortpixel/image/skip_backup', false, $this->getFullPath(), $this->is_main_file)

filters the images that are skipped or not from the backup. Return true for the type of images to be skipped in the backup. If you check if is_main_file is true and return false (do not skip backup), while while otherwise returning true, the backup will be kept only for the main image. We suggest using it in conjuction with this action that fires right after the restore from backup is done:
do_action('shortpixel/image/after_restore', $this, $this->id, $cleanRestore);

This action can be used to cleanup the meta data from the database, regenerate thumbnails after restoring the main file, writing the updated meta data, etc.
apply_filters('shortpixel/settings/image_sizes', $sizes);

filters the array ($sizes) of image sizes that can be excluded from processing (displayed in the plugin Advanced settings);
apply_filters('shortpixel/image/imageparamlist', $result, $this->id, $this);

filters the list of parameters sent to the API so that resizing can be performed more granularly;
apply_filters('shortpixel/api/request', $requestParameters, $item_id);

filters the parameters sent to the optimization API (through $requestParameters), described in detail here: ShortPixel Reducer API; $item_id contains the ID of the Media Library item, or the ID of the Custom Media item (when used). In short, this filter can be used to alter any parameters sent to the API, depending on the needs. For example, you can set different resize parameters for different post types, different compression levels, remove EXIF or not, covert WebP/AVIF, and basically any other parameter that is sent to the API for a specific image (together with all its thumbnails).
This filter enables the background ShortPixel processing in additional pages (see here the original list). Here’s an example of this filter that enables the processing on the Comments screen (to be placed in your functions.php file):
add_filter('shortpixel/init/optimize_on_screens', function ($screens) {
$screens[] = 'edit-comments';
return $screens;
});

The edit-comments is the ID of the screen where you want to enable the processing.
If you want to add multiple pages, here’s what the snippet looks like:
add_filter('shortpixel/init/optimize_on_screens', function ($screens) {
$screens = array('edit-comments', 'plugins', 'another-custom-post-type-page');
return $screens;
});

add_filter('shortpixel/image/filecheck', function () { return true; });

This filter forces a file check for WebP/AVIF in case they were manually removed from disk.
If you want to disable the automatic cache flush that is triggered after image optimization, you can use this filter:
add_filter( 'shortpixel/external/flush_cache', function() { return false; } );

In order to define custom thumbnails to be picked up by the optimization you have two options, both comma separated defines:
define('SHORTPIXEL_CUSTOM_THUMB_SUFFIXES', '_tl,_tr');

will handle custom thumbnails like image-100x100_tl.jpg;
define('SHORTPIXEL_CUSTOM_THUMB_INFIXES', '-uae');

will handle custom thumbnails like image-uae-100×100.jpg;
define('SHORTPIXEL_USE_DOUBLE_WEBP_EXTENSION', true);
define('SHORTPIXEL_USE_DOUBLE_AVIF_EXTENSION', true);

will tell the plugin to create double extensions for the WebP/AVIF image counterparts, for example, image.jpg.webp/image.jpg.avif for image.jpg;
Enable the “Trusted mode” in case the file system has limitations and is very slow in responding to direct file operations by adding this constant:
define('SHORTPIXEL_TRUSTED_MODE', true);

This will simply skip file check operations and if the Media Library loads very slowly or freezes, you might want to try adding the constant above to your wp-config.php file.
Disable the feedback survey when the plugin is deactivated:
define('SHORTPIXEL_SKIP_FEEDBACK', true);

Hide the Cloudflare settings by defining these constants in wp-config.php:
define('SHORTPIXEL_CFTOKEN', 'the Cloudflare API token that has Purge Cache right');
define('SHORTPIXEL_CFZONE', 'The Zone ID from the domain settings in Cloudflare');

Add HTTP basic authentication credentials by defining these constants in wp-config.php
define('SHORTPIXEL_HTTP_AUTH_USER', 'user');
define('SHORTPIXEL_HTTP_AUTH_PASSWORD', 'pass');

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「ShortPixel Image Optimizer – Optimize Images, Convert WebP & AVIF」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0 | 1.0.1 | 1.0.2 | 1.0.3 | 1.0.4 | 1.0.6 | 1.2.0 | 1.3.1 | 1.3.5 | 1.4.0 | 1.4.1 | 1.5.0 | 1.5.3 | 1.6.0 | 1.6.1 | 1.6.2 | 1.6.3 | 1.6.4 | 1.6.6 | 1.6.7 | 1.6.8 | 1.6.9 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 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6.0.5 | 6.1.0 | 6.1.1 | 6.1.2 | 6.1.3 | 6.1.4 | trunk | 1.6.10 | 2.1.10 | 4.10.0 | 4.10.1 | 4.10.2 | 4.10.3 | 4.10.4 | 4.10.5 | 4.11.0 | 4.11.1 | 4.11.2 | 4.11.3 | 4.12.0 | 4.12.1 | 4.12.2 | 4.12.3 | 4.12.4 | 4.12.5 | 4.12.6 | 4.12.7 | 4.12.8 | 4.13.0 | 4.13.1 | 4.14.0 | 4.14.1 | 4.14.2 | 4.14.3 | 4.14.4 | 4.14.5 | 4.14.6 | 4.15.0 | 4.15.1 | 4.15.2 | 4.15.3 | 4.15.4 | 4.16.0 | 4.16.1 | 4.16.2 | 4.16.3 | 4.16.4 | 4.17.0 | 4.17.1 | 4.17.2 | 4.17.3 | 4.17.4 | 4.18.0 | 4.18.1 | 4.19.0 | 4.19.1 | 4.19.2 | 4.19.3 | 4.20.0 | 4.20.1 | 4.20.2 | 4.21.0 | 4.21.1 | 4.21.2 | 4.22.0 | 4.22.1 | 4.22.2 | 4.22.3 | 4.22.4 | 4.22.5 | 4.22.6 | 4.22.7 | 4.22.8 | 4.22.9 | 4.22.10 |

延伸相關外掛(你可能也想知道)

文章
Filter
Apply Filters
Mastodon