Implemented Add option to completely remove add-ons

Snog

Well-known member
Since we can install from archive, I don't think there's any reason we couldn't have a "Remove add-on" option for add-ons that have been uninstalled.

I THINK it would just be a matter of reading the add-on's hashes.json file and deleting the files/folders listed in it.

remove.webp
 
Last edited:
Upvote 92
This suggestion has been implemented. Votes are no longer accepted.
I don`t think it will be a good idea to do it automatically. Will be nice if we can have a popup notice, when you uninstall an add-on, who tell you the directories of that add-on location and, if the add-on have common files or not.
 
You should always keep a backup of any addons you load on your site.
Why if I can download them again?
Anyway... we don`t talk my way to delete them.... but will be nice to have that popup notice with the direction of the folders of the add-on.
 
I agree, uninstalling and removing files should be done with care and not by some automated process. Maybe once an addon is uninstalled, and admins have verified everything is functioning correctly, then have a button to click to remove the files.
If you look at my original post and the image I posted, that's what's implied. If the "install" button is available, then it implies the add-on either hasn't been installed or it's been uninstalled.
 
Have you seen...? Obviously not I'm only telling you now. This has been implemented in XF 2.2.7!

Installable add-ons (add-ons that are not installed / have been uninstalled) may now contain a "Delete files" button (with some exceptions).

localhost_22x_admin.php_add-ons_.png

Clicking "Delete files" enumerates the add-on's hashes.json file to work out which files belong to that add-on. It checks if they are deletable and lists the files that would be deleted if you proceed:

localhost_22x_admin.php_add-ons_ (2).png

Clicking "Delete files" triggers a job which deletes those files and the add-on's directory.

No other directories are removed (this is by design to reduce the risk of other add-ons being affected) so this will leave empty directories on your server but once complete the add-on will no longer appear in the "Installable add-ons" list.

In some cases, you may come across an add-on that shares files with another add-on. This is less common (many add-ons by @Xon used to do this but not so much now) but theoretically could be used for nefarious means - for example a specially crafted hashes.json file might make it seem like another add-ons files belong to that add-on or even a core XF file.

So we flag it if an add-on you're deleting contains files that may be in use by another add-on:

localhost_22x_admin.php_add-ons_ (4).png


Rather than blocking the deletion entirely, we simply ensure those files are skipped.

There are some situations where the "Delete files" button will not be available in the add-on list, particularly if the src/addons directory is not writable (this means the files within would not be deletable) or if the add-on contains files in an _output directory (used during development).
 
Top Bottom