Developer notes
analyze(POST, 500 files per call): reads the catalogue, changes nothing.start: creates a job.add(500 files per call): stores the confirmed files. Every product is checked again here; the browser only proposes.chunk: appends tovar/kv_bulk_image_uploader/<job>/<item>.part. The size on disk is the truth: a wrong offset gets the real one back. The last part sends the file throughfn_update_image_pairs().finish: completes products.closegives up files that never arrived.
Files of one product are sent one by one, so main image and positions need no locking. All writes use security_hash.
File safety
Section titled “File safety”The extension must be jpg, jpeg, png, gif or webp, and fn_get_image_size() must accept the content. The stored name is rebuilt from the base name with [A-Za-z0-9_-] and the extension of the real image type, so shell.php.jpg is stored as shell-php.jpg and a renamed script is refused. Part files have no user-controlled name and live under var/.
Images
Section titled “Images”Core functions only: fn_update_image_pairs() (hooks update_image_pairs_pre, update_image_pairs) and fn_delete_image_pair() (hook delete_image_pair). Storage backends, variation and common product sync, and other add-ons keep working. Changing the old main image to additional is a direct UPDATE ?:images_links, undone if the new image is refused.
Tables
Section titled “Tables”| Table | Contents |
|---|---|
?:kv_biu_jobs |
One row per upload: owner, company, mode, alt template, status |
?:kv_biu_items |
One row per file: product, SKU, status (W waiting, D done, F failed, S skipped), role, pair, message key |
?:kv_biu_products |
Per product in a job: old pairs, demoted main pair, next position |
Classes
Section titled “Classes”Tygh\Addons\KvBulkImageUploader: Matcher (names to products), Jobs (upload state, report, undo), Config (settings, licence gate).
Matcher applies fn_get_company_condition(), so a vendor or selected storefront sees only its own products. Vendor copies of common products are excluded (master_product_id = 0) when the Common products add-on is active.
License gate
Section titled “License gate”Config::isOn() is checked on start, add and chunk.
Full page cache
Section titled “Full page cache”No storefront output, no storefront code path.
Uninstall
Section titled “Uninstall”Drops the three tables. var/kv_bulk_image_uploader/ holds only unfinished uploads and is emptied when a job closes.