image-1.jpg, image-2.jpg, …) appear on importThe cause is in includes/class-studiou-wc-product-manage-product-import.php, not in the view.
process_variable_product() calls upload_image_from_url() at line 287-292.process_variation() calls upload_image_from_url() again at line 411-416.Every CSV row that has a non-empty Obrázky triggers an independent call.
upload_image_from_url() does (line 464-511)download_url($url, 30) — downloads the remote file to a fresh temp file (PHP's tmpfile() name, not the basename of your URL).$file_array['name'] = basename($url).media_handle_sideload($file_array, 0) — and there is no check for whether the same source URL is already in the Media Library.-1, -2, -3 suffix gets addedmedia_handle_sideload() → wp_handle_sideload() → wp_unique_filename(). WordPress sees that uploads/YYYY/MM/image.jpg already exists from a previous row's import, so it renames the new upload to image-1.jpg, then image-2.jpg, etc. Each gets its own attachment post + physical file on disk.
One variable parent + N variations, all pointing at the same image.jpg:
image.jpg (attachment #1)image-1.jpg (attachment #2)image-2.jpg (attachment #3)That's the exact <thumbnail-file>-<ordinal>.jpg pattern observed.
guid / _source_url / _wp_attached_file matches this remote URL?"download_url() + media_handle_sideload().basename($url) is used as the local filename, so the collision detection only catches exact same-filename uploads in the same month folder. A URL like …/img.jpg?v=2 still produces img.jpg, so collisions are likely.array($url => $attachment_id) would die when the request ends.Because each variation gets its own uploaded image, $variation->set_image_id($image_id) at line 414 points each variation at a different attachment ID — even though all the variations were supposed to share the parent's image. So this isn't just file clutter; the parent and every variation are individually referencing distinct copies of what is logically the same image.
A cache array<url, attachment_id> keyed by source URL, checked before download_url(), that:
guid / a custom _source_url meta / matching _wp_attached_file basename, andThat would collapse N+1 duplicate uploads per shared URL down to one.