-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Thumbnail Image Regeneration in 3.3
WooCommerce 3.3 introduced thumbnail regeneration functionality. In the past when image size settings were changed you would need to install an external plugin and then have it regenerate all WordPress image thumbnails before the changes would be visible.
The new image regeneration functionality, combined with the introduction of WooCommerce image settings in the customizer, now ensure that as you make changes to your store image settings you can preview the changes in real-time within the customizer.
When you make changes to image sizes/aspect ratios in the customiser, or if your theme changes image sizes, WC will detect these changes and queue a background regeneration job. The 2 events which can trigger this are:
- Publishing settings in the customizer
- Switching themes
Whilst in the customizer, size changes can be previewed due to our on-the-fly image regen. These changes will not be persisted to the live site until you hit publish.
If your site is behind BasicAuth, both async requests and background processes will fail to complete. This is because WP Background Processing relies on the WordPress HTTP API, which requires you to attach your BasicAuth credentials to requests.
You can pass these credentials via a snippet, see: https://github.com/A5hleyRich/wp-background-processing#basicauth
To view the logs for background image regeneration go to WooCommerce > Status > Logs
and select the wc-background-regeneration
log from the dropdown.
This log file will list images which have been processed and when the job was completed or cancelled.
As of WooCommerce 3.3.2 you will see an admin notice when background image regeneration is running. Within this notice is a link to cancel the job.
Cancelling the job will stop more thumbnails being regenerated. If image sizes do not look correct inside your catalog, you'll need to run thumbnail regeneration manually (either using our tool, or using another plugin such as https://en-gb.wordpress.org/plugins/regenerate-thumbnails/).
Most CDN plugins listen to WordPress core hooks and upload generated thumbnails to their service once created. This will continue to function with our background image regeneration code. Generation may be slower due to uploading the images to the 3rd party service as it progresses.
The woocommerce_background_image_regeneration
filter can be used to disable background regeneration completely. Example code:
add_filter( 'woocommerce_background_image_regeneration', '__return_false' );
Once disabled, you'll need to regenerate thumbnails manually using another tool should you change image size settings and need new thumbnails.
Alternatively, you can use the Jetpack Photon module which can do image resizing on the fly and will be used instead of background regeneration as of WooCommerce 3.3.2.
Jetpack is a plugin by Automattic, makers of WordPress.com. It gives your self-hosted WordPress site some of the functionality that is available to WordPress.com-hosted sites.
The Photon module makes the images on your site be served from WordPress.com's global content delivery network (CDN) which should speed up the loading of images.
Photon can create thumbnails on the fly which means you'll never need to use our background image regeneration functionality.
WooCommerce is an open source commerce platform built for WordPress and lovingly crafted by Automattic and the WooCommerce community 💜. Come and work with us!
Contribution
- Set up development environment
- Our Git Flow
- SCSS and JS minification
- Naming conventions
- CSS SASS coding guidelines and naming conventions
- Critical Flows
- API Critical Flows
- String localisation guidelines
- Translating WooCommerce
- Deprecation in core
- Adding Actions and Filters
- Common Issues
- Writing high-quality testing instructions
Release Notes
- Release Testing Instructions
- 3.6.x notes/FAQ
- 2.6.x to 3.0.0 Developer Migration Notes
- Select2 fields not working in 3.0.x
- Thumbnail Image Regeneration in 3.3+
- Customizing image sizes in 3.3+
REST API and CLI
CRUD & Data Descriptions
- Database Description
- CRUD Objects in 3.0
- Order and Order Line Item Data
- Coupon Data
- Customer Data
- Product Data
- Data Stores
Internal APIs
Theming
- Enabling product gallery features (zoom, swipe, lightbox)
- Template File Guidelines for Devs and Theme Authors
Examples / Guides