=== Algo Media Desk ===
Contributors: rajninair
Donate link: https://algorisys.com
Tags: media library, folders, media cleanup, unused media, duplicates
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.7.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Organize WordPress media into virtual folders and safely clean unused or duplicate files — without breaking URLs.

== Description ==

Stop guessing which images are safe to delete. Algo Media Desk turns the WordPress Media Library into a clear workspace: organize with folders, see where files are used, and clean up without breaking the site.

**Organize without fear**

* Unlimited top-level virtual folders — URLs never change
* All files / Uncategorized smart views
* Move selected files into folders
* Folder search, rename, and delete
* Upload into the active folder
* Folder filter when inserting media
* Usage Trackers — built-in adapters for popular gallery/slider plugins (custom shortcode trackers in Pro)

**Pro tools**

* Nested subfolders + folder colors
* Move / reparent folders into other folders (fix a flat tree later)
* Reset all folders (start clean — media stays Uncategorized)
* Custom shortcode & plugin usage trackers
* Scheduled unused/duplicate cleanup email reports (great for agencies)
* Auto-organize upload rules (mime, extension, name, month folders)
* Role permissions for folders, cleanup, and deletes on client sites

**Clean safely**

* Scan unused media
* Scan used media with page/post/plugin locations
* Find duplicate files
* Block delete/trash while media is still detected as in use
* Enhanced “Uploaded to” column showing page and plugin usage when detected

**Usage tracking**

Media Desk looks for media references in content, featured images, product galleries, and common gallery/slider plugin storage. Built-in adapters activate when those plugins are active. Custom shortcode/plugin trackers are available in Algo Media Desk Pro. Perfect coverage of every third-party plugin is not guaranteed, but common WordPress patterns are covered.

Folders never rewrite attachment URLs. Cleanup delete permanently removes files — confirm carefully.

Developed by Rajni Nair (Algorisys).

== Installation ==

1. Upload the `algo-media-desk` folder to `/wp-content/plugins/`, or install the zip via **Plugins → Add New → Upload Plugin**.
2. Activate **Algo Media Desk** through the Plugins screen.
3. Open **Algo Media Desk** in the admin menu for the product hub, Cleanup, and Usage Trackers.
4. Open **Media → Library** (or Algo Media Desk → Media Library) to use folders in the familiar Media Library.

== Frequently Asked Questions ==

= Will folders break my image URLs? =

No. Folders are virtual. Files stay in the normal uploads path and keep the same URLs.

= What happens when I delete a folder? =

The folder (and subfolders) are removed. Files are not deleted — they become Uncategorized.

= Does cleanup permanently delete files? =

Yes — but only if the file is not detected as still used on the site. Used media is blocked from delete/trash until you remove it from pages, posts, galleries, or sliders first.

= Can I delete media that is still used on a page? =

No. Algo Media Desk blocks delete/trash for media found in content, featured images, galleries, product images, and similar references. Remove the usage first, then delete.

= Does it detect images used in gallery/slider plugins? =

Yes, in layers:

1. Built-in adapters for popular gallery/slider/commerce plugins when those plugins are active (including Supsystic shortcode galleries)
2. Generic postmeta ID scan for many unknown plugins
3. **Pro:** custom shortcode / meta Usage Trackers for any other plugin
4. Extensibility hooks: `amd_usage_sources_catalog`, `amd_attachment_usages`, `amd_is_pro`, `amd_feature_enabled`

The Media Library “Uploaded to” column can show plugin labels such as a gallery or slider name when usage is detected.

= What is free vs Pro? =

**Free forever:** unlimited top-level virtual folders, Placed In / Used In columns, cleanup scans, delete protection, and built-in usage adapters when those gallery/slider plugins are active.

**Pro (separate add-on):** nested subfolders, move/reparent folders, folder colors, reset-all-folders, custom shortcode/plugin Usage Trackers, scheduled cleanup email reports, auto-organize rules, and role permissions.

Install **Algo Media Desk Pro**, then activate it under **Algo Media Desk → Pro License**.

= How do I track a new gallery plugin I just installed? =

If it has a built-in adapter, activate the plugin — tracking turns on automatically. For other plugins, Algo Media Desk Pro lets you paste a shortcode (example: `[my-gallery id='1']`) or add meta/post-type trackers under **Algo Media Desk → Usage Trackers**.

= Privacy =

Algo Media Desk does not phone home. It stores folder relationships and settings in your WordPress database. Optional Pro scheduled reports send email from your site to the address you configure (using WordPress `wp_mail`). No media files or analytics are sent to Algorisys or third-party servers. On uninstall, custom tables and plugin options are removed.

= Does this plugin send data to external servers? =

No. See the Privacy answer above.

= Is WordPress “Attached / Detach” the same as “used on the site”? =

No. WordPress “Uploaded to / Attached” is only an upload-parent label. Media Desk tracks real detected usage separately and shows that in Cleanup and the enhanced Uploaded to column.

= Will this slow down my site? =

Folder browsing and cleanup scans run in wp-admin. Front-end visitors are not affected by folder organization. Cleanup scans can take longer on large libraries — that is expected.

== Screenshots ==

1. Product dashboard — branded Algo Media Desk home (stats, quick actions, Free vs Pro)
2. Folders in Media Library — sidebar, Placed In, and Used In columns
3. Move files into folders — select files and choose a destination
4. Safe cleanup tools — unused / used / duplicates in the branded admin shell
5. Insert Media folder filter — All files / folders in the media modal

== Changelog ==

= 1.7.5 =
* Folder drag-and-drop: drop above/below to reorder, drop on center to nest

= 1.7.4 =
* Fix folder ⋮ menu icon alignment (use rotated dashicons ellipsis)

= 1.7.3 =
* Folder row cleanup: Color / Rename / Nest / Delete moved into a ⋮ menu (less crowded)

= 1.7.2 =
* Folder UX: ↑↓ reorder siblings, drag-to-nest, rename “Move” → “Nest” (avoids clash with Move files)

= 1.7.1 =
* Media Library sidebar: compact Pro legend + Get Pro link (free users only)

= 1.7.0 =
* Pro: Move / reparent folders — highlighted in Pro features on the AMD Dashboard
* Sidebar shows Move (Pro) when the add-on is not unlocked

= 1.6.9 =
* Refresh AMD Dashboard product screenshots (handbag demo theme)

= 1.6.8 =
* Move folders: reparent any folder under another (or back to top level) from the sidebar

= 1.6.7 =
* Marketplace packaging: privacy FAQ, Free vs Pro clarity, safer Go Pro redirect, multisite uninstall cleanup
* Compress Pro preview images for a lighter free plugin zip

= 1.6.6 =
* Collapsible folder tree: expand/collapse parents and nested folders with children

= 1.6.5 =
* Parent folder counts include files in nested subfolders; opening a parent lists those files too

= 1.6.4 =
* Fix “New subfolder / Parent folder not found” after folder reset — ignore stale selected folder ids

= 1.6.3 =
* Fix create folder with color: surface AJAX error messages (e.g. duplicate name) instead of failing silently

= 1.6.2 =
* Pro: Reset all folders (type DELETE to confirm) — media becomes Uncategorized, files never deleted

= 1.6.1 =
* Soft Pro limits: unlimited top-level folders free; nested folders + folder colors require Pro
* Agency-focused Pro copy for reports and role permissions

= 1.6.0 =
* Pro Tools: scheduled cleanup email reports, auto-organize rules, role permissions
* Pro Tools admin page under Algo Media Desk

= 1.5.3 =
* AMD Dashboard: free product screenshots + Pro feature preview gallery

= 1.5.2 =
* Fix Media Library / Go Pro redirects; rename submenu to AMD Dashboard; keep menu under Media

= 1.5.1 =
* Media columns: “Placed In”, “Used In”; Author moved after Used In

= 1.5.0 =
* Top-level Algo Media Desk menu with product hub (free features, Pro list, quick links)
* Cleanup and Usage Trackers moved under the new menu; Media Library remains the folder workspace

= 1.4.3 =
* Friendly “still in use” delete modal instead of WordPress error page when media cannot be deleted

= 1.4.2 =
* More folder list space: compact cleanup button, context hover actions (Rename/Delete vs Move here)

= 1.4.1 =
* Refreshed Media Library folder sidebar UI (toolbar, folder icons, count pills, clearer hierarchy)

= 1.4.0 =
* Free / Pro framework: `amd_is_pro`, `amd_feature_enabled`, upgrade hooks for a future Pro add-on
* Custom Usage Trackers (shortcode / meta) marked Pro; folders, cleanup, and built-in adapters stay free
* Soft Pro roadmap card on the Usage Trackers screen

= 1.3.2 =
* Media Library “In Folder” column so All files shows which folder each file is in

= 1.3.1 =
* Easy Usage Trackers: paste a shortcode like `[supsystic-gallery id='1']` instead of hunting meta keys
* Built-in shortcode tracking for Photo Gallery by Supsystic (including gallery table images)
* Advanced post type / meta key fields kept as optional fallback

= 1.3.0 =
* Usage Trackers settings: add any installed image/gallery plugin for media usage tracking
* Suggest post types and meta keys from the selected plugin

= 1.2.1 =
* Real product screenshots + sellable packaging assets for marketplace listing

= 1.2.0 =
* Marketplace packaging: privacy FAQ, screenshots section, Domain Path, softer list-view default
* Ready for free WordPress.org-style distribution

= 1.1.0 =
* Active-plugin usage registry and generic postmeta ID scan
* Clearer Uploaded to labels using plugin names when media is used by those plugins

= 1.0.9 =
* Track gallery-plugin usage in cleanup + Media Library “Uploaded to”

= 1.0.8 =
* Block delete/trash for media still used on the site

= 1.0.7 =
* Improved Cleanup tools card UI in Media Library sidebar

= 1.0.6 =
* Cleanup: scan used media with page/post locations and don’t-delete warnings

= 1.0.5 =
* Fix moving multiple selected files
* Hide Move here / destination options for the folder you are viewing

= 1.0.4 =
* Separate view folder from move destination

= 1.0.3 =
* Prefer Media Library list view for easier multi-select
* Clearer Move to folder help and labels

= 1.0.2 =
* Clearer success toast on media upload

= 1.0.1 =
* Fix media upload refresh + success toast after Add Media

= 1.0.0 =
* Initial release: virtual folders, drag/drop assign, media modal filter, unused + duplicate cleanup

== Upgrade Notice ==

= 1.2.1 =
Packaging update with real marketplace screenshots. No required database migration.

= 1.2.0 =
Packaging and privacy documentation update for free marketplace distribution. Softer Media Library list-view default (no longer overwrites an existing Grid preference every visit).
