m1.DownloadList
This plugin easily displays the folders and files from a selected directory.
Install in
This plugin easily displays the folders and files from a selected directory, as block “Download list” or shortcode. Uploads must be done by a separate FTP program. No managing options.
-
block with folder picker and preview (WordPress 5.8+);
[m1dll]shortcodes convert into it -
visitors can browse into subfolders, a breadcrumb leads back
- file type icons, file size and modification date
- filter by file type, hide single files or folders
- several lists on one page
- needs the PHP extension mbstring
available optional shortcode parameters
- path = directory path, starting at the WordPress root folder (default: the uploads folder, usually
wp-content/uploads/) - target = browser window name, for example
_blank - sort = by name ASC/DESC (default: ASC)
- sort-order = filename/filetype/ftime/filetime/foldertime (default: filename)
- label = custom top level label
- nosize = displays no file size
- hidedirs = displays no folders, only files
- filetype = (comma separated list) filter files by their extension
- hidefiletype = (comma separated list) hide files with filetype
- hidefilename = (comma separated list) hide named files and folders
- noext = hide the file extensions
- nobreadcrumb = hide breadcrumb / title
- ftime = display file and folder modification date and time (standard = “1” or use date formatting like “Y-m-d H:i”), see PHP date formatting
- filetime = same as ftime, just for files
- foldertime = same as ftime, just for folders
- layout = classic/list/table/grid (default: classic, the display of all earlier versions)
- nodate = hides the date in the layouts list, table and grid
- icons = icon set of the layouts: m1 (default), wordpress, tabler, bootstrap or none
layouts
classicis the display of all earlier versions and stays the default, so existing pages do not change.listshows one row per entry with a file type icon, type, size and date.tableshows sortable columns for name, type, size and date. Visitors sort by clicking a column header; on narrow screens a sort bar replaces the header.gridshows cards, good for a few files like brochures.- The layouts take font and colours from the theme, work in light and dark themes and need no JavaScript.
- In the layouts the file name is shown without extension, because the type is shown separately.
noext="0"shows the extension. - The date shows the date format of the site;
ftime,filetimeandfoldertimechange it as before. icons="wordpress"uses the media icons of WordPress,tablerandbootstrapicons in the text colour of the theme.- Themes can change the markup: copy
templates/list.php,table.phporgrid.phpof the plugin toyour-theme/m1downloadlist/.
(most of it can be combined together)
shortcode examples
- displays content of
wp-content/uploads/:[m1dll] - displays content of
wp-content/uploads/your/foldername/here/:[m1dll path="wp-content/uploads/your/foldername/here/"] - displays content of
your/foldername/here/and sort descending:[m1dll path="your/foldername/here/" sort="DESC"] - displays content of
your/foldername/here/, open files in a new window:[m1dll path="your/foldername/here/" target="_blank"] - displays content of
wp-content/uploads/, displays no file size:[m1dll nosize="1"] - displays content of
wp-content/uploads/, displays no folders:[m1dll hidedirs="1"] - displays content of
wp-content/uploads/, displays only pdf- and docx-documents:[m1dll filetype="pdf,docx"] - displays content of
wp-content/uploads/, do not display pdf- and docx-documents:[m1dll hidefiletype="pdf,docx"] - displays content of
wp-content/uploads/, do not display file secret.txt and secret.docx:[m1dll hidefilename="secret.txt,secret.docx"] - displays content of
wp-content/uploads/, displays no file extensions:[m1dll noext="1"] - displays content of
wp-content/uploads/, displays no breadcrumb:[m1dll nobreadcrumb="1"] - displays content of
wp-content/uploads/, with file and folder date and time (standard from WordPress)[m1dll ftime="1"] - displays content of
wp-content/uploads/, sorted by file type[m1dll sort-order="filetype"] - displays content of
wp-content/uploads/downloads/as a sortable table[m1dll path="wp-content/uploads/downloads/" layout="table"] - displays content of
wp-content/uploads/downloads/as cards[m1dll path="wp-content/uploads/downloads/" layout="grid"]
which folders can be listed?
- Folders inside the uploads folder can be listed by every author.
- Folders outside of the uploads folder are only listed if the author of the post or page may publish unfiltered HTML (administrators, editors). This protects the site against contributors listing private files.
- Folders containing an
index.php,index.htmlorindex.htmare protected: they are not shown as subfolders and not opened by a link, and only administrators and editors can list them withpath. Shop, form and backup plugins protect their folders in the uploads folder this way. Developers can change this with the filterm1dll_folder_protected(parameters: protected, folder). - The folders of WordPress itself are never listed: the WordPress root folder,
wp-admin,wp-includes,wp-content, plugins, themes, languages and upgrade. - Files and folders whose name starts with a dot (
.htaccess,.env) are never shown. - Folders hidden by
hidedirs,hidefilenameorhidefiletype="dir"can not be opened by a link either. - If a folder can not be listed, visitors see nothing and users who may edit the post see a short notice.
- Developers can allow or deny a folder with the filter
m1dll_path_allowed(parameters: allowed, real path, post).
The plugin only lists files, it does not protect them. Every file in a listed folder can be downloaded by everyone who knows its address. Do not put confidential files into a public folder.
Copyright
Tabler Icons, (c) Paweł Kuna, MIT license, https://tabler.io/icons
Bootstrap Icons, (c) The Bootstrap Authors, MIT license, https://icons.getbootstrap.com
Written by Joobi from the project's own listing. See the source page
0.26
- security: contributors can no longer list folders outside of the uploads folder (CVE-2025-32164)
- security: file names, label, date format and window name are escaped
- security: hidden and protected folders can no longer be listed or opened by a link
- feature: block “Download list” for the editor
- feature: icon sets for the layouts
- feature: icons for rtf, pps and ppsx files
- feature: layouts list, table and grid, overridable by the theme
- bugfix: sort-order=”filetype” works
- bugfix: target=”_blank” works
0.25
- WordPress 7.1 compatibility
0.24
- bugfix: security bugfix
0.23
- bugfix: security bugfix
0.22
- bugfix: links in breadcrumbs work again
- feature: wordpress 6.8 compatibility
0.21
- bugfix: fixed typo
0.20
- bugfix: shortcode is now escaped
- feature: wordpress 6.7 compatibility
- feature: compatible up to PHP 8.3.14
0.19
- feature: wordpress 6.6 compatibility
0.18
- feature: php 8.2 compatibility
- feature: wordpress 6.2.2 compatibility
0.17
- bugfix: parameter nosize doesn’t work
0.16
- feature: display file date and time (3 new parameters: ftime, filetime, foldertime)
- feature: new parameter ‘sort-oder’ to choose a sortable parameter like name or date
- feature: CSS-class-names for filetime and filesize
0.15
- bugfix: removed debugging message
0.14
- feature: new parameter ‘hidefiletype’
- feature: new parameter ‘hidefilename’
- bugfix: remove notice message for parameter “target” thx@rameshmehay
- bugfix: show office documents icons (docx, xlsx, pptx)
Older versions: seechangelog.txt.
Follow this listing's changes (Atom feed)