Skip to content

Instantly share code, notes, and snippets.

@DanielSantoro
Created February 19, 2018 17:07
Show Gist options
  • Save DanielSantoro/823ecca7f1591f31f0869e69ed94cbc1 to your computer and use it in GitHub Desktop.
Save DanielSantoro/823ecca7f1591f31f0869e69ed94cbc1 to your computer and use it in GitHub Desktop.
Add Theme Support for Thumbnail Regeneration
<?php // Don't include this line
add_theme_support( 'woocommerce', array(
'thumbnail_image_width' => 150,
'single_image_width' => 322,
) );
@tremblayly
Copy link

Hi Daniel,

Thanks for all of your help yesterday with my issues.

The code snippet above did not stop the server spikes as a result of this error:
PHP Warning: Invalid argument supplied for foreach() in /nas/content/live/lysejewelry/wp-content/plugins/woocommerce/includes/abstracts/class-wc-background-process.php on line 101, referer: https://lysetremblayjewelry.ca/wp-admin/admin-ajax.php?action=wp_1_wc_regenerate_images&nonce=21b126e3af

This one did:

/* filter added to prevent automatic regeneration of thumbnail images and causing server hikes */ add_filter( 'woocommerce_background_image_regeneration', '__return_false' );

Cheers
Lyse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment