Delete icon files from local disk when uninstalling

Created on 11 November 2024, 3 months ago

Problem/Motivation

I just noticed I still have hundreds of folders & files under /sites/default/files/iconify-icons containing icons that weren't even used on the site after months I had uninstalled this module.

Also please note that it seems there are multiple folders based on dimension & color of the icon to be used (like iconify-icons/[pack_name]/[icon_name_and_variant]/24/24/currentColor/[icon_name_and_variant].svg), which seems weird considering SVG can be resized and colored arbitrarily with CSS.

Proposed resolution

Maybe we could add a settings page to configure a cron job to delete the files that are not used (and downloaded only while searching icons in a form) or a button to manually clean them or all of them, and an option to delete all when uninstalling.

I now realize though that probably the site doesn't know which icons are being used, and it is more efficient to keep hundreds of small unused files on disk rather than managing database records.. so your call 😇

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇮🇹Italy kopeboy Milan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024