Flexa Media Folders

Opis

Flexa Media Folders adds a hierarchical, drag-and-drop folder tree to the WordPress Media Library. Group images, videos, documents and any other attachment into nested folders, then filter the library to a single folder with one click – in the grid view, the list view, and the media picker inside the post editor.

Folders are stored in dedicated, indexed database tables, so your wp_term* tables stay clean and the tree loads fast even with thousands of files. The same tree is available for posts, pages and custom post types, one post type at a time, if you want it.

Folders are useful on the front end too: the [flexa_mf_folder_gallery] shortcode prints a folder’s images as a responsive grid, so a folder you keep tidy in the admin doubles as a gallery on a post, a page or in a widget.

Features

  • Hierarchical folder tree – create unlimited nested folders, rename them, and reorder them by drag-and-drop.
  • Drag attachments into folders – drag a grid thumbnail or a list-view row straight onto a folder. Select several items first and the whole selection moves at once.
  • Folders for posts and custom post types – optional, off by default. Switch a post type on in Settings and its list screen gets the same tree: drag rows onto a folder, use the „Move to” bulk actions, see a Folders column, and filter the list to one folder. Each post type keeps its own folders, separate from the media ones.
  • Works everywhere the Media Library does – the folder sidebar appears on the Media grid, the list view (upload.php), and the media modal in the block editor, the Classic Editor and on taxonomy term screens.
  • One-click filtering – click a folder to filter the library to it, plus built-in „All files” and „Uncategorized” views. On the list view the active folder is kept in the URL, so it survives paging and reloads.
  • Keyboard control – the tree is a real ARIA tree: arrow keys walk it, Left/Right collapse and expand, Home/End jump to the ends, and typing a few letters jumps to a folder by name. F2 renames, Cmd/Ctrl+X cuts, Cmd/Ctrl+V pastes, and Cmd/Ctrl+Backspace opens the delete confirmation.
  • Inline rename – click the name of an already-selected folder (Finder style) and edit it in place. Enter saves, Esc cancels.
  • Color labels – assign one of 18 colors to any folder from the right-click menu to spot it at a glance.
  • Full context menu – New Folder, Rename, Cut, Paste, Delete and Change Color, all from a right-click.
  • Bulk folder creation – paste a list of names, one per line, and use „/” to nest: Clients/Acme/Logos creates all three levels. A preview shows the tree you are about to get before anything is saved.
  • Import from another folder plugin – bring an existing tree over from FileBird, Real Media Library, CatFolders, Folders (Premio) or Media Library Organizer, including the attachment assignments. The source plugin’s own data is left untouched.
  • Pick the upload target – choose which folder new uploads land in from the uploader itself, without leaving the screen.
  • File counts – each folder can show how many attachments it contains, counting its subfolders too if you prefer (both are Settings toggles).
  • Folder search – filter the folder tree as you type.
  • Front-end gallery shortcode – put [flexa_mf_folder_gallery folder="12"] in a post, a page or a text widget and that folder’s images render as a responsive grid. Columns, gap, corner radius, aspect ratio, image size, caption source, link target, sort order and an item limit are all attributes, and subfolders="yes" pulls in the whole subtree.
  • Settings page – choose a default folder for new uploads (none / last used / a specific folder), set the folder sort order, toggle file counts, pick which post types get their own folders, exclude specific post types or taxonomies from showing the sidebar, and tune the sidebar’s icon size, text size and corner radii.
  • Safe SVG uploads – optional, off by default. When you switch it on, every SVG is sanitized (scripts, event handlers and remote references stripped) before it is stored, whether it comes from the uploader or from an importer, and the library renders the SVG itself instead of a generic file icon.
  • Multisite ready – each site in a network gets its own folder tree. Tables are provisioned when a site is created and removed when it is deleted.
  • Dark mode – the tree automatically follows your WordPress admin color scheme.
  • Accessible – full ARIA tree semantics, keyboard navigation, and visible focus styles.
  • Translation ready – every string is internationalized, 29 locales ship with the plugin, and a .pot template is bundled.
  • REST API – all screens are powered by a REST API under /wp-json/flexa-mf/v1/, so external integrations and your own code can read and manage folders too.
  • WP-CLI – manage folders, run an import, and reset plugin data from the command line with wp flexa-mf.
  • Clean uninstall – a Settings danger zone (and wp flexa-mf reset) wipes all plugin data on demand; uninstalling the plugin drops its tables. Your media files are never touched.

External services

All of your folders and media stay on your own site. The plugin connects to one external service, only in the admin area, for the single reason below.

Deactivation feedback (Flexa Product Intelligence)

When you go to deactivate Flexa Media Folders on the Plugins screen, a short optional survey asks why. It is served by Flexa’s product intelligence service at https://product-intelligence.flexacommerce.com. It runs only in the admin, on wp-admin/plugins.php, never on the front end, and never blocks or delays deactivation. What is sent, and when:

  • On opening the Plugins screen: a request to /api/v1/config (product slug and tier) to load the survey configuration. The response is cached for 6 hours.
  • When you deactivate or interact with the survey: the reason you pick and any optional message you type, sent to /api/v1/deactivations, /api/v1/events, /api/v1/feedback, /api/v1/feature-requests and /api/v1/recovery-events.

Every request includes an anonymous per-site identifier (a random UUID), the plugin version and tier, and by default your WordPress version, PHP version and locale. No email, site domain, user identity or raw IP is collected. To stop sending environment data, use add_filter( 'flexa_mf/deactivation_survey/config', function ( $c ) { return array( 'collect_environment' => false ) + $c; } );. To disable the survey entirely, use add_filter( 'flexa_mf/deactivation_survey/enabled', '__return_false' );.
Terms of Service: https://flexacommerce.com/pages/terms
Privacy Policy: https://flexacommerce.com/pages/privacy

Zrzuty ekranu

Instalacja

  1. Upload the plugin files to /wp-content/plugins/flexa-media-folders, or install it through the WordPress Plugins screen.
  2. Activate the plugin through the Plugins screen.
  3. Open Media in the admin menu – the folder sidebar appears next to your library. Visit Media Media Folders to configure defaults.

Najczęściej zadawane pytania

Does this move or rename my media files?

No. Folders are an organizational layer stored separately in the database. Your files stay exactly where WordPress put them, with the same URLs.

What happens to my folders if I deactivate or delete the plugin?

Deactivating keeps all folder data. Deleting (uninstalling) the plugin drops its database tables and removes its settings – but your media files are never deleted. You can also wipe folder data on demand from the Settings danger zone.

Does it use WordPress taxonomies?

No. Folders live in three dedicated, indexed tables: one for the tree, one for media membership and one for post membership. This keeps your wp_term* tables clean and lets the tree load in a single query.

I already use another folder plugin. Can I bring my tree over?

Yes. The Settings page has an Import panel that detects FileBird, Real Media Library, CatFolders, Folders (Premio) and Media Library Organizer, and copies their folders and attachment assignments across. The other plugin’s data is only read, never modified, so you can compare the result before deactivating it. The same thing is available as wp flexa-mf import.

Can I filter the Media Library by folder inside the post editor?

Yes. The folder sidebar is available in the media modal in both the block editor and the Classic Editor.

Can I use the folder tree without a mouse?

Yes. Tab into the tree and the arrow keys walk it, Left and Right collapse and expand, Home and End jump to the first and last folder, and typing a few letters jumps to a folder by name. F2 renames the focused folder, Cmd/Ctrl+X and Cmd/Ctrl+V cut and paste it, and Cmd/Ctrl+Backspace opens the delete confirmation.

Is enabling SVG uploads safe?

SVG uploads are off by default because an SVG is an XML document that can carry scripts. When you turn the setting on, the plugin sanitizes every SVG before it is stored, stripping <script> elements, on* event handlers and remote references. That covers both ways a file reaches the library: the browser uploader and the sideload path used by wp media import, media_sideload_image() and importers. Sanitization is not optional and cannot be switched off from the UI; it only runs for files uploaded after the setting is enabled, so audit any SVGs that were already in your library.

Does it work on multisite?

Yes. Every site in a network keeps its own folder tree in its own set of tables. Network activation provisions the existing sites, a newly created site is provisioned automatically, and deleting a site removes its tables.

Is there a REST API?

Yes – all folder data is exposed under /wp-json/flexa-mf/v1/. The endpoints require the same capabilities as the Media Library itself.

How does the plugin handle authentication and permissions?

Every state-changing request goes through the WordPress REST API and is gated by two checks: a capability check and the standard WordPress REST nonce (X-WP-Nonce). There are three capability gates, each filterable:

  • flexa_mf/capabilities/edit (default manage_categories, so Editors and Administrators) for changing the folder structure itself: create, rename, move, delete, reorder, bulk create and import. The tree is shared site-wide, so reshaping it is deliberately a higher bar than uploading.
  • flexa_mf/capabilities/manage (default upload_files) for reading the tree and filing media into an existing folder.
  • flexa_mf/capabilities/settings (default manage_options) for the settings and data-reset endpoints.

Filing posts into folders is gated separately, on the post type’s own edit_posts capability, because the users who organize a post type are the ones who write for it.

On top of that, assigning or detaching media or posts is verified per item with the edit_post capability, and the attachment listing is scoped to media the current user can manage. Users without the folder-edit capability also get the tree-editing actions hidden in the UI, so they are not offered buttons the server would reject. The plugin does not register any custom admin-ajax endpoints.

Can I organize posts, pages or products into folders too?

Yes, and it is off until you ask for it. Open Media -> Media Folders -> Integrations and check the post types you want. Each one you check gets a folder tree on its own list screen under Posts, Pages or that post type’s menu, with its own folders: a folder you make for Products never shows up under Posts or in the Media Library. Posts are filed by dragging rows onto a folder, with the „Move to” bulk actions, or by creating a post while a folder is selected. Unchecking a post type hides the tree again and leaves its folders in place.

Can I stop the sidebar from showing on a particular post type?

Yes. The plugin’s Settings page has a per-post-type exclusion list, and a matching one for taxonomy term screens.

Can I show a folder’s images on the front end?

Yes. Add the shortcode [flexa_mf_folder_gallery folder="12"] to a post, a page or a text widget, where 12 is the folder’s id (the Settings page and the REST API both show it). The folder’s images come out as a responsive CSS grid.

Attributes, all optional: columns (1-8, default 3), gap in pixels (0-80, default 12), radius in pixels (0-40, default 4), ratio such as 1:1 or 4:3 to crop every tile to the same shape, size for the registered image size (default medium), caption (none, caption, title, alt), link (file, attachment, none), orderby (date, title, menu_order, id, rand), order (asc, desc), limit (up to 100, default 20) and subfolders="yes" to include every folder underneath. Non-image attachments are skipped, and so is an image whose parent post the visitor cannot see: a file uploaded from inside a draft, a private or a password-protected post stays out of the grid until that post is published. A file uploaded straight to the Media Library has no parent post and is always shown.

Recenzje

Wtyczka nie ma jeszcze żadnej recenzji.

Kontrybutorzy i deweloperzy

„Flexa Media Folders” jest oprogramowaniem open source. Poniższe osoby miały wkład w rozwój wtyczki.

Zaangażowani

Rejestr zmian

1.4.4

  • New: a front-end gallery shortcode. [flexa_mf_folder_gallery folder="12"] prints a folder’s images as a responsive grid in any post, page or text widget, with attributes for columns, gap, corner radius, aspect ratio, image size, captions, link target, sort order, a limit and whether to include subfolders. See the FAQ for the full list. Images whose parent post is a draft, private or password-protected are left out for visitors who cannot see that post.

1.4.3

  • Security: SVG files that arrived through an import were not sanitized. WordPress stores uploads through two paths, one for a file posted from the browser and one for a file already sitting on the server, and the plugin was only cleaning the first. An SVG brought in by wp media import, media_sideload_image() or an importer could keep its scripts and event handlers. Both paths are sanitized now. Only sites that had switched SVG uploads on were affected, and that setting is off by default. If you enabled it and have imported SVGs, re-check those files.

1.4.2

  • Fixed: uninstalling the plugin left one row behind, the anonymous installation id the deactivation survey stores as an option. Uninstall now clears it and the survey’s two other rows, on every site of a network as well as on a single site. Nothing else was left over: the tables, the settings and the version option were already being removed.

1.4.1

  • Performance: the Uncategorized count is cached instead of being recalculated on every screen. Working out which files sit in no folder means walking the whole attachment list, which cost roughly 200ms on a 200,000-file library and was paid again on each media view and each media modal. The number is kept until something files, unfiles, uploads or deletes a file, so after the first load the sidebar gets it for nothing.
  • Performance: clicking Uncategorized on a library where every file is already filed no longer scans the library to find out that the bucket is empty.
  • Fixed: a folder’s badge kept counting files that had been deleted for good. Nothing cleared the folder membership row when an attachment was permanently deleted, so the count stayed too high until the folder was touched again. Deletions now clear their own rows, and the upgrade to database version 1.3.0 sweeps out the ones earlier deletions left behind.

1.4.0

  • New: folders for posts, pages and any other public post type. Switch a post type on under Settings -> Integrations and its list screen (edit.php) gets the same folder tree the Media Library has, with its own separate set of folders.
  • New: file posts into a folder by dragging list-table rows onto the tree, or with the „Move to: ” bulk actions on the list screen. A „Folders” column shows where each post sits and links back to that folder.
  • New: creating a post while a folder is selected files it into that folder on first save.
  • New: the Settings „Folders” tab now has a tab per enabled post type, so post-type folders can be bulk renamed, recolored, moved and deleted there too.
  • New: REST endpoints POST|PATCH|DELETE /flexa-mf/v1/folders/<id>/objects for filing posts into folders. They are gated by the post type’s own edit_posts capability and re-check edit_post per post.
  • Change: a third database table (<prefix>flexa_mf_object_folder) stores post membership. It is created on upgrade; existing media folders are untouched.

1.3.2

  • Fixed: wp flexa-mf folder create --color=#rrggbb never set the folder’s color. WP-CLI keeps --color for its own output colorization and strips it before a command runs, so the flag is now --folder-color. The old spelling still works and prints a notice pointing at the new one. A hex value the plugin cannot parse now stops the command instead of creating a folder with no color.

1.3.1

  • Fixed: folders could not be clicked in the block editor’s media modal on WordPress 7.1. Core wraps the attachment grid in a new container that leaves the grid itself positioned against the whole browser pane, so the list stretched across the folder sidebar as an invisible layer and absorbed the clicks.

1.3.0

  • New: full keyboard control of the folder tree. Arrow keys walk it, Left/Right collapse and expand, Home/End jump to the ends, and typing a few letters jumps to a folder by name. F2 renames, Cmd/Ctrl+X cuts, Cmd/Ctrl+V pastes, and Cmd/Ctrl+Backspace opens the delete confirmation.
  • New: import an existing folder tree, with its attachment assignments, from FileBird, Real Media Library, CatFolders, Folders (Premio) or Media Library Organizer. Available from an Import panel on the Settings page and as wp flexa-mf import. The source plugin’s data is only read, never changed.
  • New: optional SVG uploads. Off by default; when enabled, every uploaded SVG is sanitized before it is stored and the library renders the SVG itself instead of a generic file icon.
  • New: pick the folder new uploads land in from the uploader, without leaving the screen.
  • New: multisite support. Each site in a network keeps its own folder tree. Tables are provisioned on network activation and when a site is created, and removed when a site is deleted.
  • New: 29 translations now ship with the plugin.
  • New: Settings additions – count the files in subfolders towards a folder’s badge, exclude individual taxonomies from showing the sidebar (to match the existing post-type list), and tune the sidebar’s folder-icon size, text size and corner radii.
  • New: a „Reset sidebar size” entry in the sidebar menu, for when a drag-resize has left the panel somewhere awkward.
  • Change: renaming now happens inline in the tree instead of in a side panel, and it is armed by clicking the name of an already-selected folder (Finder style) rather than by double-clicking. F2 and the right-click Rename option work as before.
  • Removed: the „Download folder” context-menu entry, which only ever showed a notice saying the feature was coming.

1.2.8

  • Added an optional, admin-only deactivation feedback survey so we can learn why the plugin is being removed. It runs only on the Plugins screen, never blocks or delays deactivation, and can be turned off with a filter. See the „External services” section for exactly what is sent.

1.2.7

  • Compatibility: tested up to WordPress 7.1. Fixed the folder sidebar in the media modal (block editor „Select or Upload Media”), where WordPress 7.1 wraps the attachment grid in an absolutely-positioned container that overlapped the folder tree.

1.2.6

  • Security: creating, renaming, moving, deleting, reordering and bulk-creating folders now require the manage_categories capability (Editors and Administrators) instead of upload_files. Folders are a shared, site-wide structure, so lower-privileged users could previously reorganize the tree for everyone. Reading folders and assigning your own media to them still only needs upload_files. The gate is filterable via flexa_mf/capabilities/edit.

1.2.5

  • Fix: the i18n build helper script is no longer included in the release package, so no unguarded PHP file ships to production.

1.2.4

  • New: translation template (.pot) covering all plugin strings, so the plugin can now be translated into other languages.

1.2.3

  • New: a Settings link on the Plugins page now takes you straight to the Media Folders settings.

1.2.2

  • Fix: development files are no longer included in the release package.

1.2.1

  • Fix: the „Download folder” notice now inserts the folder name correctly in translated languages, so translators can reposition the placeholder.

1.2.0

  • New: after moving media into a folder, the confirmation toast now offers an Undo button for 5 seconds – click it to send every item back to its previous folder (including Uncategorized) with folder counts and the media grid updated automatically.

1.1.0

  • New: rename a folder inline by double-clicking its name in the sidebar – press Enter or click away to save, Esc to cancel. Empty names are ignored and the right-click Rename option still works as before.

1.0.2

  • Security: the folder assign/detach REST endpoints now verify per-attachment edit permission (edit_post) for each item, so a user can only organize media they are allowed to edit instead of any attachment in the library.
  • Security: the attachment-listing REST endpoint now scopes results to media the caller can manage – users who cannot edit others’ posts see only their own uploads.

1.0.1

  • Security: bind every custom-table identifier through wpdb::prepare()’s %i placeholder so no SQL string interpolates a table name outside prepare().
  • Security: gate the Media Library query-filter superglobal reads behind an explicit current_user_can() check (defense in depth on top of WordPress’s upstream cap enforcement).
  • Fix: the admin UI now loads correctly on the Settings page.
  • Fix: dark-mode styling on the folder tree, drag tooltip, and toast.
  • Compatibility: minimum WordPress version bumped from 5.8 to 6.2 (required for the %i placeholder).

1.0.0

  • Initial release.
  • Hierarchical, drag-and-drop folder tree for the Media Library.
  • Drag attachments into folders.
  • Folder sidebar in the Media grid, the list view, and the editor media modal.
  • One-click folder filtering with built-in „All files” and „Uncategorized” views.
  • Folder color labels (18-color palette) and a full right-click context menu.
  • Per-folder file counts, folder-tree search, and a Settings page (default upload folder, sort order, count display, post-type exclusions).
  • Dark mode that follows the WordPress admin color scheme; full keyboard and ARIA accessibility.
  • REST API under /wp-json/flexa-mf/v1/ and wp flexa-mf WP-CLI commands.
  • Translation ready with a bundled .pot template.