=== Simple Media Organizer ===
Contributors: tharkun69
Tags: media, media library, folders, organization, attachments
Requires at least: 6.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Organize the native WordPress Media Library with virtual folders, keyboard controls, drag-and-drop, and a safe migration assistant.

== Description ==

Simple Media Organizer adds a hierarchical virtual folder tree to the native WordPress Media Library and its standard media-selection dialogs.

Folders are virtual. The plugin does not move files on the server and does not change attachment URLs. Folder relationships are stored with a private hierarchical attachment taxonomy.

Version 1.0.3 includes:

* A folder tree beside the native Media Library in grid and list views.
* Folder navigation in standard WordPress media-selection dialogs.
* Create, rename, rearrange, reparent, and delete folders and subfolders.
* Drag-and-drop folder and media moves with server-side validation.
* Keyboard alternatives for moving selected media and folders.
* Dedicated All media and Unassigned views.
* Native WordPress multi-selection support.
* Upload into the currently selected folder where the native uploader exposes its parameters.
* Per-user storage of the selected folder and collapsed tree branches.
* English source strings plus bundled translations for German, Spanish, French, Italian, Portuguese (Brazil), Dutch, Polish, Russian, Japanese, Simplified Chinese, and Turkish.
* Focus management, live status announcements, accessible labels, and reduced-motion support.
* Timeout, session-expiry, invalid-response, retry, and partial-result handling.
* A non-destructive migration assistant for WP Media Folder folder data.
* Import preview, resumable batches, cancellation, repeatable mapping, bounded logs, and orphan-reference detection.
* Configurable advisory warnings for large image and non-image uploads.
* An explicit data-retention option for uninstall.

Version 1.0.3 is a maintenance release for the stable 1.0 line. Backups and staging tests are still recommended before migrations or major organizational changes.

== Installation ==

1. Back up the WordPress database and files.
2. Open Plugins > Add New Plugin > Upload Plugin.
3. Upload `simple-media-organizer-1.0.3.zip` and activate it.
4. Open Media > Library.
5. Create the first folder with the plus button in the left panel.

== Usage ==

* Select a folder to filter the native Media Library.
* Use All media to show every attachment or Unassigned to show media without a Simple Media Organizer folder.
* Select one or more media items and drag one selected item onto a destination folder.
* As a keyboard alternative, use Move selected media and choose the destination in the dialog.
* Drop media on Unassigned to remove its Simple Media Organizer assignment.
* Drag a folder by its grip or use Move folder to change its parent.
* Use Arrow keys, Home, End, Enter, Space, F2, and Delete in the folder tree where applicable.
* Deleting a folder never deletes media files.

== Media selection dialogs ==

The folder browser is added when a plugin, theme, editor, or page builder opens the native `wp.media` interface. It supports filtering, folder creation, selected-media movement, upload assignment, responsive drawer behavior, and keyboard navigation.

Third-party interfaces that replace the native WordPress media frame entirely require separate compatibility work and are not modified automatically.

== Import from WP Media Folder ==

Administrators can open Media > Media Organizer and select the WP Media Folder import tab.

The preview reports the detected source version when available, folder and media counts, relationships, multiple assignments, existing mappings, and estimated batches.

The importer targets the `wpmf-category` attachment taxonomy. It copies folder names, hierarchy, available manual order, and attachment relationships. It never changes the source taxonomy, attachment records, physical files, paths, or URLs.

Imports are repeatable. Mapped folders are reused, existing Simple Media Organizer assignments are retained, and only missing source relationships are added. Media processing runs in batches of 100 and can be resumed after a page reload. Up to ten completed, cancelled, expired, or warning runs are retained in an administrator-only log.

Compatibility with version 6.2.6 was verified with a reproducible schema fixture that mirrors the documented `wpmf-category` taxonomy, nested folders, manual ordering, multiple assignments, and version metadata. The commercial WP Media Folder package was not available in the isolated build environment, so a final staging test with the actually installed 6.2.6 package remains required before a production migration.

Always create a database backup and verify the preview on a staging site before importing production data.

== Data retention and uninstall ==

Deactivation always preserves folders, assignments, preferences, and import data.

By default, uninstall also preserves organizational data so a reinstall can recover it. Administrators can instead enable destructive cleanup under Media > Media Organizer > Settings before uninstalling the plugin.

Destructive cleanup removes only Simple Media Organizer folders, assignments, preferences, import sessions, and logs. It never deletes physical media, attachment posts, or WP Media Folder source data.

== Privacy ==

Simple Media Organizer sends no telemetry and contacts no external service.

It stores virtual folder terms and relationships, folder order metadata, per-user interface preferences, source mapping metadata for repeatable imports, and bounded import state and logs.

== Frequently Asked Questions ==

= Does the plugin create physical folders in wp-content/uploads? =

No. All folders are virtual. Existing paths and URLs remain unchanged.

= What happens when a folder is deleted? =

The folder and its subfolders are removed, but media files and attachment records remain. Media without another assignment appears under Unassigned.

= Can several selected media items be moved together? =

Yes. Use native WordPress multi-selection, then drag one selected item or use the accessible Move selected media action.

= Does it support grid and list views? =

Yes. Folder filtering and media movement are supported in both native Media Library views.

= Does it work in media-selection dialogs? =

Yes, when the caller uses the native WordPress `wp.media` frame. Fully custom third-party file pickers are outside the scope of this integration.

= Can I import folders from WP Media Folder? =

Yes. The non-destructive importer reads the `wpmf-category` taxonomy and preserves multiple source assignments. Source-specific cloud, gallery, permission, watermark, and physical-folder settings are not imported.

= Does WP Media Folder need to remain active during import? =

Not necessarily. If source terms and relationships remain in the database, Simple Media Organizer can register a private read-only compatibility view while the source plugin is inactive.

= Is a repeated import safe? =

The importer maps each source term ID to a destination folder, reuses that mapping, and adds only missing relationships. A current database backup is still strongly recommended.

= Can Simple Media Organizer warn about large uploads? =

Yes. Under Media > Media Organizer > Settings, administrators can enable advisory warning thresholds separately for images and other files. The warning does not change WordPress or PHP upload limits.

= What happens to WP Media Folder assignments that reference deleted media? =

They are counted as orphaned references in the import preview and skipped. The source WP Media Folder data is not deleted or modified.

= How can plugin data be removed? =

Enable Delete all Simple Media Organizer data when the plugin is uninstalled under Media > Media Organizer > Settings, save the setting, and then uninstall the plugin from WordPress.

== Changelog ==

= 1.0.3 =
* Fix a regression where the folder tree could become a blank white column in Divi and other page-builder media dialogs.
* Keep the folder panel as a sibling of the native attachments browser instead of positioning it inside a potentially clipped browser container.
* Reserve the left column for folders while offsetting only the native media browser.
* Explicitly constrain absolutely positioned media browsers with left, right, and automatic width so attachments cannot overlap the folder column.
* Preserve the persistent folder-panel instance when WordPress rebuilds the media browser.
* Establish a local positioning context only when a page builder resets media-frame content to static positioning.

= 1.0.2 =
* Fix page-builder media dialogs such as Divi where the attachment grid could start behind the folder panel.
* Offset the complete native attachments browser instead of relying on optional internal WordPress wrapper elements.
* Keep the toolbar, media grid, upload area, load-more controls, and native media sidebar aligned as one layout unit.
* Support both absolutely positioned and normal-flow media browser layouts.
* Remove and hide stale drag-handle overlays from older cached Simple Media Organizer assets inside media dialogs.

= 1.0.1 =
* Remove floating drag-handle overlays from native WordPress media-selection dialogs; drag directly from the attachment preview or thumbnail instead.
* Remove drag handles from Media Library list view and use the native title cell as the mouse drag surface.
* Keep the grid-view drag handle hidden until hover or keyboard focus, reducing visual clutter.
* Preserve compact drag feedback, multi-selection moves, cancelled-drag click suppression, and the accessible Move selected media action.

= 1.0.0 =
* Keep the folder panel persistently mounted while switching folders so the tree no longer disappears during media refreshes.
* Refresh the Media Library list view asynchronously and replace only the native media table, avoiding a full-page reload on folder changes.
* Reuse the same folder-panel DOM node when WordPress rebuilds native media-selection dialogs.
* Preserve folder-tree scroll position, focus, selection, and collapsed branches during background folder refreshes.
* Show loading feedback only in the media content area; an existing folder tree is never blanked for a background refresh.
* Add stale-layout recovery if another admin extension temporarily replaces the native Media Library container.
* Promote Simple Media Organizer from pre-release to the first stable release.

= 0.9.9 =
* Adds complete bundled translations for Spanish (Spain), French (France), Italian, Portuguese (Brazil), Dutch, Polish, Russian, Japanese, Simplified Chinese, and Turkish.
* Keeps English as the source language and the existing German translation.
* Updates the translation template and compiled MO catalogs for all bundled locales.

= 0.9.8 =

* Fix the remaining findings from the WordPress Plugin Check report supplied for 0.9.7.
* Sanitize the configurable large-file warning thresholds explicitly before validation.
* Remove the prohibited `suppress_filters` WP_Query argument from WP Media Folder import validation.
* Prefix multisite uninstall variables to comply with WordPress global naming conventions.
* Start the folder tree collapsed for users who do not yet have a saved tree preference, so only root folders are visible initially.
* Preserve every user's explicitly saved expanded/collapsed state afterwards.

= 0.9.7 =

* Reduced vertical spacing in the folder panel header, toolbar, navigation, status area, and help text.
* Kept toolbar button sizes and interaction targets unchanged.
* Preserved the 328 px desktop panel width introduced in 0.9.4.

= 0.9.6 =

* Detect orphaned WP Media Folder media relationships during preview and skip them during import.
* Report orphaned media references and skipped assignments in import logs.
* Add configurable advisory warnings for large media uploads.
* Default warning thresholds: 5 MB for images and 20 MB for other files.
* Keep WordPress and PHP upload limits unchanged; users can explicitly continue with a large upload.
* Provide the warning in the Media Library and native WordPress media-selection dialogs.

= 0.9.4 =

* Widened the folder panel so all seven actions fit on one row.
* Kept the Media Library content column responsive.

= 0.9.3 =
* Prevent the WordPress attachment-details dialog from opening after a completed or cancelled media drag.
* Disable Move selected media until the native grid or list view contains a selection.
* Show the current selection count in the move button label and tooltip.
* Keep the compact drag helper and collision-resistant folder labels introduced in 0.9.2.

= 0.9.2 =
* Reworked folder-row markup so folder names keep a dedicated visible area.
* Added collision-resistant folder-label rendering for the Media Library and media-selection dialogs.
* Limited drop highlighting to the actual destination button.
* Replaced the large thumbnail drag ghost with a compact move indicator and item count.
* Removed the black drop tooltip that could cover the folder tree and help text.

= 0.9.1 =

* Fixed folder names that could be hidden by conflicting WordPress or third-party admin styles.
* Added a robust jQuery UI drag-and-drop path for media thumbnails and list rows.
* Retained native HTML5 dragging as a fallback when jQuery UI is unavailable.
* Added visible media drag handles and improved feedback for valid destination folders.
* Prevented duplicate move requests when native and jQuery UI drop events overlap.
* Fixed media-selection dialog initialization with WordPress' jQuery UI components.

= 0.9.0 =

* Added folder navigation to native WordPress media-selection dialogs.
* Completed grid and list view support with drag-and-drop and keyboard alternatives.
* Added responsive modal behavior and selected-media movement inside media frames.
* Added English source strings and complete bundled German translations.
* Added WAI-ARIA tree semantics, focus management, live announcements, and reduced-motion support.
* Added request timeouts, retry controls, session-expiry detection, and partial-result messages.
* Added configurable uninstall cleanup with non-destructive defaults.
* Hardened REST schemas, batch limits, import locks, and run-ID validation.
* Added source-order compatibility and WP Media Folder 6.2.6 schema-fixture coverage.
* Updated repository metadata and coding-standard documentation.

= 0.5.0 =

* Added drag-and-drop, multi-selection, hierarchy movement, user preferences, and the WP Media Folder importer.

= 0.1.1 =

* Fixed folder-action initialization and addressed the first Plugin Check findings.

= 0.1.0 =

* Initial prototype with virtual hierarchical media folders.
