=== Media Replace DL ===
Contributors: devlemon
Tags: media, replace media, media library, images, attachments
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Replace existing WordPress media files while preserving attachment IDs and references.

== Description ==

**Media Replace DL** lets you swap out a media file in your WordPress library without losing the attachment ID, URL, or any of the associated metadata.

**The problem it solves**

You published a banner image and used it across ten posts and a dozen widget areas. Now you have a corrected version. Normally you would delete the old file, upload the new one, and manually update every place the old image appeared.

With Media Replace DL, you open the attachment in the Media Library, click "Replace Media", upload the new file, and that's it. All existing references continue to work because the file path and attachment ID are preserved.

**What it preserves**

* Attachment ID
* File URL and path (the original filename is kept)
* Post title, caption, description, and alt text
* All post meta and attachment data not related to the physical file

**What it updates**

* The physical file content
* The MIME type stored in the database
* Image dimensions and file size in attachment metadata
* Thumbnails (optional — you choose whether to regenerate them)

**Privacy**

No data is collected. No external services are contacted. The plugin works entirely within your WordPress installation.

== Installation ==

1. Upload the `media-replace-dl` folder to `/wp-content/plugins/`, or install via the WordPress plugin screen.
2. Activate the plugin.
3. Go to **Media → Library**, hover over any attachment, and click **Replace Media**.

== Frequently Asked Questions ==

= Does replacing a file change the attachment ID? =
No. Media Replace DL preserves the existing WordPress attachment post. The ID never changes.

= Will my posts need to be updated? =
When the original file URL is preserved (which is always the case in version 1.0.0), existing references continue to work without any changes.

= Does the plugin create a new media attachment? =
No. The existing attachment is updated in place.

= Does Media Replace DL send data to external servers? =
No. Everything runs locally within your WordPress installation.

= Can I replace images? =
Yes. Supported image formats allowed by your WordPress installation (JPG, PNG, GIF, WebP, and others) can be replaced.

= Does it regenerate thumbnails? =
You choose. The replacement form offers two options: replace the file only (faster, thumbnails remain but may show the old image), or replace and regenerate all image sizes (old thumbnails are removed and new ones are created).

= What happens if the upload fails? =
The original file is never touched until the new file has been fully received and validated. If anything goes wrong during the replacement, the original remains intact.

= Does the plugin modify my posts permanently? =
No. The attachment post content (title, caption, alt text, etc.) is unchanged. Only the physical file and its derived metadata (dimensions, file size) are updated.

== Screenshots ==

1. Replace Media link in the Media Library list view.
2. The replacement form showing current file information.
3. Upload options including thumbnail regeneration for images.
4. Success notice after a completed replacement.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
