Describe the Bug
When the Cache Attachment Lookups setting is enabled, deleting a file does not remove its cache entry from the wp_mcloud_post_map table. This leads to issues when re-uploading a file with the same name, as the cache still points to the old file instead of the new one.
Steps to Reproduce
- Upload a file named
test.zip.
- Delete the file
test.zip.
- Re-upload a file with the same name,
test.zip.
- Use
attachment_url_to_postid($url) to check the association — it still points to the file from step 1.
Expected Behavior
When a file is deleted, its corresponding entry in the wp_mcloud_post_map table should also be deleted to prevent stale cache data.
Server Details
- Operating System: Ubuntu (Docker)
- PHP Version: 8.2
- Web Server: Apache (from the WordPress Docker image)
Plugin Installation
Installed via the WordPress admin panel using the plugin store.
Describe the Bug
When the Cache Attachment Lookups setting is enabled, deleting a file does not remove its cache entry from the
wp_mcloud_post_maptable. This leads to issues when re-uploading a file with the same name, as the cache still points to the old file instead of the new one.Steps to Reproduce
test.zip.test.zip.test.zip.attachment_url_to_postid($url)to check the association — it still points to the file from step 1.Expected Behavior
When a file is deleted, its corresponding entry in the
wp_mcloud_post_maptable should also be deleted to prevent stale cache data.Server Details
Plugin Installation
Installed via the WordPress admin panel using the plugin store.