Skip to content

Uninstall deletes non-GiveWP options #8323

Description

@susurruses

When deactivating GiveWP and choosing to remove GiveWP data, the uninstaller can delete site options that were not added by GiveWP.

This is because GiveWP is doing a LIKE comparison when querying the database, for the generic word give. See this block from uninstall.php, line 119:

    // Get all options.
    $give_option_names = $wpdb->get_col(
        $wpdb->prepare(
            "
			SELECT option_name
			FROM {$wpdb->options}
			WHERE option_name LIKE '%s'
			",
            '%give%'
        )
    );

I ran the uninstall on a website with an option not added by GiveWP (in this instance, givebutter-widget-account), and confirmed that GiveWP's uninstaller also removed the non-GiveWP setting.

Ideally, GiveWP should instead compare option names to a list of known GiveWP options, and only delete options if they were added by GiveWP (or one of the GiveWP add-ons).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugExisting functionality is broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions