Setting JPEG compression for custom image sizes doesn’t work in specific cases
Some suggestions: If you want to try out the Image Editor API you can try to replace imagejpeg( $resource, $image, 35 ); with: $editor = wp_get_image_editor( $image ); if ( ! is_wp_error( $editor ) ) { $editor->set_quality( 35 ); $editor->save( $image ); } unset( $editor ); Also try to test e.g. these parts: $resource = … Read more