=== Idun Simple Upload Renamer ===
Contributors: lucaspinelli
Tags: media, upload, filename, rename, seo
Requires at least: 6.9
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Rename files before upload with customizable patterns, automatic rules, and manual editing. Create descriptive filenames that can also support SEO.

== Description ==

Idun Simple Upload Renamer lets you rename files automatically using customizable patterns, or review and edit filenames individually through a simple popup, **before** WordPress saves uploaded media. It supports WordPress Core media upload workflows, including the Media Library and Block Editor.

Choose between two normalization modes: **Idun normalization**, the default option for consistent lowercase ASCII filenames, and **WordPress standard**, which preserves filenames according to WordPress settings.

**Simple. Lightweight. Effective.**

* Review and edit filenames individually, or use `{original-name}` in a filename pattern to rename files automatically without individual confirmation.
* Build filenames with `{upload-name}`, `{original-name}`, `{post-name}`, `{custom-string}`, `{date}` (YYYYMMDD), `{year}`, `{month}`, `{day}`, and `{sep}` (the selected hyphen or underscore separator).
* Choose Idun normalization for lowercase ASCII filenames or WordPress standard normalization to leave final filename sanitization to WordPress.
* Enable renaming for all accepted file types or selected file groups.
* Review a live pattern example and reset the editable filename when needed.
* Upload several files while retaining individual filename preparation.

Clear, descriptive filenames can also support SEO by helping search engines understand the content of uploaded files, particularly images. Idun Simple Upload Renamer makes it easier to apply consistent naming conventions, while leaving the choice of filenames and naming patterns to the user.

WordPress continues to determine permitted file types, process uploads, sanitize filenames, resolve filename collisions, and store attachments. For block-editor uploads, Idun uses the WordPress REST upload workflow. It does not rename existing media, change existing URLs, or replace WordPress upload handlers. Uploaders that do not use the supported WordPress Core interfaces are not intercepted.

== Screenshots ==

1. Configure filename patterns and review a live example in Settings.
2. Review and edit a filename during a Media Library multi-file upload.
3. Rename a file before upload from the WordPress Block Editor.

== Installation ==

1. Install the ZIP using Plugins > Add New > Upload Plugin, or copy the plugin directory into `wp-content/plugins/`.
2. Activate Idun Simple Upload Renamer.
3. Open Settings > Idun Simple Upload Renamer.
4. Set the filename pattern, normalization method, and applicable file types.
5. Upload media using a supported WordPress Core media workflow.

== Frequently Asked Questions ==

= How can I rename files automatically without reviewing each upload? =

Simply include `{original-name}` in your filename pattern, optionally combining it with other placeholders such as `{sep}`, `{date}`, or `{custom-string}`.

For example, `{date}{sep}{original-name}` automatically applies your naming pattern without requiring individual confirmation.

= What is the difference between Idun normalization and WordPress standard? =

**Idun normalization** produces consistent lowercase ASCII filenames, using the selected separator and converting supported accented characters.

**WordPress standard** follows WordPress filename sanitization rules, preserving filenames according to WordPress settings.

You can switch between the two modes at any time in the plugin settings.

= Does the plugin support filenames in Chinese, Hindi, Arabic, Cyrillic, and other non-Latin scripts? =

Yes. The plugin offers two normalization modes:

* **Idun normalization (default):** Produces consistent lowercase ASCII filenames.
* **WordPress standard:** Preserves filenames according to WordPress settings, including Chinese, Hindi, Arabic, Cyrillic, and other non-Latin scripts where supported.

Simply select your preferred mode in the plugin settings.

= Does the plugin rename existing files? =

No. The naming rules are applied before supported new uploads, not to media already saved in the library.

= Does Idun override WordPress file security or filename uniqueness? =

No. WordPress remains responsible for upload permissions, file-type validation, filename sanitization, and uniqueness.

= Does it work in the block editor? =

Yes. Supported block-editor media uploads are handled through the WordPress Core REST media endpoint.

= Does it work with every third-party uploader? =

No. The plugin hooks into supported WordPress Core upload interfaces, rather than intercepting every request or replacing external upload handlers.

= What happens when I cancel? =

The selected file is not uploaded by Idun's pending operation. Other files in a batch can continue according to their own choices.

= Can I return to the original suggested name? =

Yes. Use Reset in the filename dialog.

== Changelog ==

= 2.0.0 =
* Added support for supported WordPress block-editor media uploads using the Core REST endpoint.
* Unified filename preparation across classic and block-editor workflows.
* Added independent, short-lived upload authorizations with atomic one-time consumption and bounded expiration cleanup.
* Improved handling of simultaneous uploads, cancellation, and contextual filename preparation.
* Added selectable Idun and WordPress-standard filename normalization.
* Refined pattern validation, live examples, and the settings interface.
* Kept WordPress Core in control of accepted file types, upload processing, and filename collisions.
