Skip to content

Helper for uninstall scripts to delete all data brought by an extension #179

Open
@unfulvio

Description

@unfulvio

SkyVerge plugins so far do not feature an uninstall.php script. If this file is found in the plugin root, its code would be executed when a plugin is uninstalled from WordPress via WP Admin.

Generally our plugins don't leave a huge footprint, although we have some that leave behind setting options, or post types. With Memberships, that includes Action Scheduler, there are even comments. For Local Pickup Plus, we'll have a custom table. And so on.

It should be up to the customer decide whether wipe out all the data or just install the plugin and leave the data in db when uninstalling. Many plugins use the approach to include one option, like a checkbox, that, if ticked, when uninstalling the plugin all the data gets deleted, as a form of opt in.

We could framework such setting (use a standard option name like the one storing the plugin version) and a simple method to retrieve whether the option value is yes or no. Where to place this setting could be an individual plugin's burden, but we could also think of a helper to output the setting as long as it's a simple solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions