=== Webfydev Duplicate Media Guard ===
Contributors: webfydev, jsrasheduzzaman
Donate link: https://webfydev.com
Tags: duplicate media, media upload, duplicate upload, media library, file upload
Requires at least: 6.2
Tested up to: 7.1
Stable tag: 1.0.0
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Prevent duplicate media uploads in WordPress by checking existing files with or without file extensions before adding them to the Media Library.

== Description ==

**Webfydev Duplicate Media Guard** helps keep your WordPress Media Library clean by preventing duplicate file uploads.

The plugin checks whether a file already exists before it is uploaded. You can choose to compare files using their complete filename (including extension) or compare only the filename while ignoring the extension.

For example:

- `logo.png` and `logo.png` → Duplicate
- `logo.png` and `logo.jpg` → Duplicate (when extension check is disabled)
- `banner.webp` and `banner.webp` → Duplicate

This helps eliminate unnecessary duplicate files, reduces media library clutter, and saves server storage.

### Features

* Prevent duplicate media uploads automatically.
* Compare filenames with extension.
* Compare filenames without extension.
* Simple settings page.
* Lightweight and easy to use.
* Works with the default WordPress Media Uploader.
* No impact on existing media files.
* No configuration required after activation (default settings available).

### How It Works

1. Upload a file through the WordPress Media Library.
2. The plugin checks if a matching filename already exists.
3. If a duplicate is found, the upload is skipped.
4. A notice is displayed informing you that the file already exists.

== Installation ==

### Modern Installation

1. Go to **WordPress Dashboard → Plugins → Add New Plugin**.
2. Search for **Webfydev Duplicate Media Guard**.
3. Click **Install Now**.
4. Activate the plugin.

### Manual Installation

1. Upload the plugin folder to the `/wp-content/plugins/` directory.
2. Go to **Plugins** in your WordPress dashboard.
3. Activate **Webfydev Duplicate Media Guard**.

== Frequently Asked Questions ==

= What is considered a duplicate? =

A duplicate is a file whose name matches an existing media file according to your selected comparison method.

= What happens if a duplicate is detected? =

The upload is skipped, preventing another copy from being added to the Media Library.

= Can I compare filenames without extensions? =

Yes. If enabled, files like `photo.jpg`, `photo.png`, and `photo.webp` are considered duplicates because they share the same filename.

= Does this affect existing media files? =

No. The plugin only checks files during upload. Existing media files remain unchanged.

= Does this work with all media types? =

Yes. The plugin works with all media types supported by WordPress.

= Is the plugin lightweight? =

Yes. It performs a simple duplicate check during upload and does not add unnecessary overhead.

== Screenshots ==

1. Plugin settings page showing duplicate detection options.
2. Example showing a duplicate media upload being detected and skipped.

== Changelog ==

= 1.0.0 =
* Initial release.
* Prevent duplicate media uploads.
* Option to compare filenames with file extensions.
* Option to compare filenames without file extensions.
* Added admin settings page.
* Added duplicate upload detection notice.
* Lightweight and optimized for WordPress Media Library.

== Upgrade Notice ==

= 1.0.0 =

Initial release of Webfydev Duplicate Media Guard.