Skip to content

Smart Add-Ons Uninstall Data Cleanup: 3 Easy Facts

Smart Add-Ons uninstall data cleanup: license state always cleared, add-on data kept by default

Platform guide

Smart Add-Ons uninstall data cleanup: what actually happens to your data?

License and activation state is always cleared, on every uninstall, with no exception — that prevents a confusing situation where reinstalling after switching plans still shows the old license as active. Everything else — add-on groups, fields, pricing rules, analytics history — is only deleted if a saue_remove_data_on_uninstall option is explicitly set to true, and nothing in the plugin currently sets it. In practice, uninstalling today keeps every add-on group and pricing rule intact; reinstalling brings it all back exactly as it was.

Smart Add-Ons uninstall data cleanup behavior is defined in one file, uninstall.php, and it’s worth reading directly rather than assuming — the honest answer has two different parts depending on what kind of data is involved.

Smart Add-Ons uninstall data cleanup: license state always cleared, add-on data kept by default
License state always goes. Add-on data stays, by default.

Smart Add-Ons uninstall data cleanup: license state always cleared

The license table and every license-related option are dropped unconditionally, every time the plugin is uninstalled:

private static function clearLicenseState(): void {
    $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}saue_license" );
    delete_option( 'saue_license_data' );
    // ...license key, token, and remote config options and transients
}

The code comment explains exactly why this is unconditional rather than tied to the same opt-in flag as everything else: “a customer can delete/reinstall after buying a different plan and still see the previous license as active” without it. A stale cached license state surviving an uninstall would be a confusing, genuinely broken experience — so this one category of data is treated differently on purpose, cleared every time regardless of any setting.

Add-on data: kept by default, opt-in to remove

Everything else — add-on groups, fields, pricing rules, conditional-logic rules, category assignments, analytics history — is gated behind a single option check:

$remove_data = (bool) get_option( 'saue_remove_data_on_uninstall', false );

if ( ! $remove_data ) {
    return; // nothing below this line runs
}

The default is false. Uninstalling the plugin through the normal wp-admin “Delete” flow leaves every add-on group, every pricing rule, and every analytics row exactly where it was — reinstalling later restores the storefront to the same state it was in before, with no rebuilding required.

What this means in practice

Deactivating and reactivating the plugin never touches any of this — deactivation doesn’t run uninstall.php at all, only a full delete through the Plugins screen does. Trying the plugin, deleting it, and installing it again later is safe for stored add-on configuration: none of it is destroyed by that cycle today. What does reset every time is the license activation, which is the one piece a store owner should expect to re-enter after any full uninstall-and-reinstall.

This matters most for two ordinary situations: evaluating the plugin on a staging site before deciding whether to keep it, and moving a site between hosts where the plugin gets temporarily removed and reinstalled as part of the migration. In both cases, the current behavior means the add-on configuration a store owner already built survives the round trip untouched — only the license needs re-entering afterward.

Common questions

Does installing or removing an unrelated plugin trigger any of this?

No — uninstall.php only runs when Smart Add-Ons itself is deleted through WordPress’s plugin management, never as a side effect of installing, removing, or reconfiguring a different plugin.

Is there a way to force full data removal today?

Only by setting the saue_remove_data_on_uninstall option to true directly — through a one-off snippet, WP-CLI, or a database edit — before deleting the plugin, since no admin-UI control exposes it yet. That’s an accurate description of the current gap in Smart Add-Ons uninstall data cleanup, not a recommended workflow.

For how uninstall.php fits into the plugin lifecycle generally, see WordPress’s own uninstall methods documentation (opens in new tab).

What if a store owner wants a completely clean uninstall today?

The straightforward option is exporting or noting down any add-on configuration first, then manually dropping the plugin’s tables and deleting its options afterward through phpMyAdmin, WP-CLI, or a database management tool — the same manual steps the missing UI checkbox would otherwise automate. For most stores this simply isn’t necessary: keeping the configuration around costs nothing meaningful in an inactive install, and it’s what makes a “try it, then reinstall later” evaluation safe in the first place.

Dhyan Software Avatar

Written by

Ready to ship this in your store?

Smart Add-Ons for WooCommerce turns what you just read into a working product page — no code required.

Comments

Leave a comment

Your email is not published.