Not backing up the image
-
Hello,
I believe I have found a reproducible issue in Image Watermark 2.0.11. Environment
- WordPress 7.0
- Image Watermark 2.0.11
- WooCommerce
The problem
When uploading images from Media → Add New, everything works correctly:
- Backup is created in
wp-content/uploads/iw-backup/ - Apply Watermark works
- Remove Watermark works
However, when uploading images directly from the WooCommerce product editor (“Set product image” / “Add product gallery images”) the behavior is different.
The image is uploaded and automatically watermarked, but no backup file is created inside
wp-content/uploads/iw-backup/.The attachment still receives:
iw-is-watermarked = 1but there is no corresponding backup file.
Because of this:
- Remove Watermark returns:
No watermark backup found for this image.and
- Apply Watermark again returns:
Watermark not applied because the original backup is missing.What we verified
backup_imageis enabled (backup_image = true).- Backup folder exists and is writable.
- Permissions are correct.
- No PHP errors are generated.
- The problem is reproducible only for uploads performed from the WooCommerce product editor.
Source code observations
do_backup()appears to be implemented correctly.If backup creation fails, the code returns before watermarking:
$backup_result = $this->do_backup(...); if (!$backup_result['success']) { return $data; }However, in our case the attachment is already marked as:
iw-is-watermarked = 1while no backup file exists.
This seems inconsistent with the expected execution flow. Temporary workaround
We implemented a temporary hook on:
iw_before_apply_watermarkwhich manually creates the backup before the watermark is applied.
After adding this workaround:
- Upload from WooCommerce product editor works correctly.
- Backup is created.
- Apply Watermark works.
- Remove Watermark works.
This suggests that the backup creation step is being skipped (or not executed) for uploads coming from the WooCommerce product media uploader.
Could you please investigate whether this is a bug in the upload flow for WooCommerce product uploads?
Thank you!
The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.