Optimize More! – Images

描述

A lightweight yet powerful image, iframe, and video optimization plugin.
Part of ThinkWeb's Performance Pack.

Features

  • Lazy Load – Lazy loading images, iframes, and videos, using the high performant lazysizes.js. No jquery dependency.
  • Preload Featured Images – Automatically preloading featured image from common page/post (homepage, pages except homepage, single post, and woocommerce single product pages).
  • Use CDN for Images – HTML rewrite if you want to serve images from your favorite CDN.
  • Add Missing Image Dimensions – Add missing width and height attributes from your images.

New (since 1.1.1)

  • Add no-lazy and skip-lazy class as default exclude class for lazyloading images.
  • Enable loading eager to also target no-lazy and skip-lazy class.
  • Automatically exclude featured image (add no-lazy class) from lazyloading if Preload Featured Images feature is enabled (useful to avoid Largest Contentful Paint image was lazily loaded warning in Google Pagespeed Insights ).
  • Add webp extension to CDN HTML rewrite regex.

New (since 1.0.7)

  • We changed the lazy load library from lozad.js to lazysizes.js.
  • Add field to modify lazysize default configuration. Read the docs.
  • Add fields to specify width and height fallback value if the Add Missing Image Dimensions feature failed to get the actual image dimension.

New (since 1.0.3)

  • Lazy load CSS Background Images – Load faster by lazy loading background images from the CSS background-image property. Tested and works well on CSS background image from GenerateBlocks, Elementor, and Oxygen Builder.
  • Noscript Fallback – Extra option to use <noscript> fallback for lazy images and iframes.
  • Add Loading Eager – Extra option to Automatically add loading=eager to the lazy load excluded list.

This plugin only adds 1 extra row in your database. And it will self delete upon uninstalation.

About Lazysizes

Lazysizes is highly performant lazy load library, written by Alexander Farkas in pure JS with no dependencies.

Taken from lazysize’s github description:
High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.

Optimize More!

Need to optimize more? Try our WordPress Speed Optimization’s Service.

More plugin from ThinkWeb

  • Optimize More! – Selectively Optimize your CSS/JS Delivery: Load CSS Asynchronously, Delay CSS and JavaScripts until User Interaction, Preload Critical CSS and JavaScripts, and Remove Unused CSS and JavaScripts Files..

螢幕截圖

  • Lazy Loading Media Files (Image Tags, Inline Background Images, CSS Background Images, Iframes, Videos)
  • Preload Featured Images, useful to bypass critical image render blocking issue
  • Use CDN for your images, useful to decrease server load
  • Add missing image dimension (width and height attributes)

安裝

From within WordPress

  1. Visit Plugins > Add New
  2. Search for Optimize More Images
  3. Activate Optimize More! Images from your Plugins page
  4. Find Optimize More! Images in your sidebar menu to configure settings

Manually

  1. Download the plugin using the download link in this WordPress plugins repository
  2. Upload optimize-more-images folder to your /wp-content/plugins/ directory
  3. Activate Optimize More! Images plugin from your Plugins page
  4. Find Optimize More! Images in your sidebar menu to configure settings

常見問題

Why changing the lazy load library from lozad.js to lazysizes.js?

More configurable.

How to enable lazy loading CSS background images?

Lazy loading css background images requires some effort from your end. Add an extra lazyload class to each container which has css background image in your favorite page editor. Or, simply put (one of) the container class in the include list field, the plugin will automatically add an extra lazyload class to the container.

Why is there preload featured image feature?

This actually a good practice to add extra performance boost to your WordPress site.

On WordPress single post and WooCommerce single product pages, featured images usually appear on above the fold section, so it’s better to preload them to avoid render blocking issues, just like any assets which required in above the fold section.

We can adapt this single post and single product behaviour in pages too. Set your hero / above the fold images as featured images to programatically, and automatically, preload them on all pages.

Preload featured images not working?

It calls images set as featured image in the native WordPress post/pages, using get_post_thumbnail_id() and wp_get_attachment_image_src(). Make sure you already adds them.

If you are using Elementor or other Page’s builders, simply edit the pages with the native WordPress editor to set the featured image.

This plugin preload the wrong image size in my post?

By default, this plugin will be grab the url and preload the full image size and woocommerce_single for WooCommerce single product pages. You can change that using filter if your theme is uses different image size. See example below.

How to change the image size of featured image when using Preload Featured Images feature?

Here are some examples:

add_filter( ‘preload_featured_images_image_size’, function( $image_size, $post ) {
if ( is_singular( ‘post’ ) ) { return ‘large’; }
elseif ( is_singular( ‘product’ ) ) { return ‘full’; }
else { return $image_size; }
}, 10, 2 );

How to change the image file types for CDN HTML rewrite?

Example if you want to add svg:

add_filter( ‘opm_cdn_file_types’, function($opm_cdn_file_types) {
return $opm_cdn_file_types . ‘|svg’;
} );

Example if you want to completely change the default file types:

add_filter( ‘opm_cdn_file_types’, function($opm_cdn_file_types) {
return ‘png|webp|svg’;
} );

Add Missing Image Dimensions not working?

This depends on you theme or overal site’s setup and how you upload your images. If it fails to grab the width and height of your images, you can specify the default image width and height fallback values that best suit your website situation in the provided fields.

評價

2022年11月10日
Keep maintain this plugin, and more optimize for youtube/embed, because in other plugin i know, the youtube embed can become load image not video before user click play button.
2022年1月24日
I have used the plugin to optimize images for several clients and it works extremely well. Therefore I can recommend it to anyone who wants to improve the page speed of their websites.
閱讀全部4個評價

貢獻者及開發者

“Optimize More! – Images” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 Optimize More! – Images 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

1.1.2

  • Enable no-lazy and skip-lazy class to lazy load background images
  • Remove svg extension and only use jpg|jpeg|png|webp as the default file types for CDN HTML rewrite regex
  • Introduce opm_cdn_file_types filter to change the file types of CDN HTML rewrite regex (see FAQ)
  • Fix some bugs

1.1.1

  • Add no-lazy and skip-lazy class as default exclude class for lazyloading images
  • Enable loading eager to also target no-lazy and skip-lazy class
  • Automatically exclude featured image (add no-lazy class) from lazyloading if Preload Featured Images feature is enabled (useful to avoid Largest Contentful Paint image was lazily loaded warning in Google Pagespeed Insights)
  • Introduce preload_featured_images_image_size filter to change the image size of featured image in the plugin’s FAQ.
  • Add webp and svg to CDN HTML rewrite regex
  • Add dns-prefetch for CDN url

1.1.0

  • Enable exclude field to also exclude Lazy Load CSS BG Images class. Useful if we want to put generic class in the Lazy Load CSS BG Images include list

1.0.9

  • Exclude 404 page for Preload Featured Image feature

1.0.8

  • Re-commit to push 1.0.7 update on repo

1.0.7

  • Change the lazy load library from lozad.js to lazysizes.js
  • Add field to modify lazysize default configuration
  • Add fields to specify width and height fallback value if the Add Missing Image Dimensions feature failed to get the actual image dimension

1.0.6

  • Bug fixes: sometimes images take too long to appear on woocommerce products shortcode display in some themes

1.0.5

  • Bug fixes

1.0.4

  • Minor fixes: simplifying and add structure to the plugin menu name in the sidebar menu to incorporate our new plugin Optimize More! – CSS

1.0.3

  • Added lazy loading CSS background image feature
  • Added option to use no-script fallback
  • Added option to automatically add loading=eager to the excluded list
  • Minor fixes: admin css fixes, typo fixes, and plugin screenshot revision

1.0.2

  • Minor fixes, plugin banner revision, typo fixes, and plugin screenshot revision

1.0.1

  • Initial release