PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.20
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.20
1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 All 164 releases
← All changes | includes/Sync/Product_Images.php +12 -0 1.10.0 → 1.10.20 View file →
@@ -33,8 +33,20 @@
33 33 *
34 34 * @param array $record Product response record.
35 35 */
36 36 private static function downsize_images( array $record ): array {
37 + // A VARIATION carries `image` (singular) — WooCommerce's variations controller has no
38 + // `images` array, and its `src` is the FULL SIZE file. Without this branch the medium
39 + // downsizing silently stops applying to variations and every till pulls full-resolution
40 + // originals (#1710). Mirrors what the v1 lane has always done in
41 + // `API\V1\Product_Variations_Controller::wcpos_variation_response()`.
42 + if ( isset( $record['image'] ) && \is_array( $record['image'] ) && isset( $record['image']['id'] ) ) {
43 + $medium = image_downsize( (int) $record['image']['id'], 'medium' );
44 + if ( $medium ) {
45 + $record['image']['src'] = $medium[0];
46 + }
47 + }
48 +
37 49 if ( ! isset( $record['images'] ) || ! \is_array( $record['images'] ) ) {
38 50 return $record;
39 51 }
40 52 foreach ( $record['images'] as $index => $entry ) {