Skip to content

Feature 681: Adding uninstall method#716

Closed
bluecollarcoders wants to merge 5 commits intoGatherPress:developfrom
bluecollarcoders:origin/feature/681
Closed

Feature 681: Adding uninstall method#716
bluecollarcoders wants to merge 5 commits intoGatherPress:developfrom
bluecollarcoders:origin/feature/681

Conversation

@bluecollarcoders
Copy link
Copy Markdown
Collaborator

@bluecollarcoders bluecollarcoders commented Jun 28, 2024

Description of the Change

This PR adds an uninstall method to clear out any plugin options, settings specific to the plugin, and/or other database entities such as tables.

Where possible, please also include:

  • verification steps to ensure your change has the desired effects and has not introduced any regressions
  • any benefits that will be realized
  • any alternative implementations or possible drawbacks that you considered
  • screenshots or screencasts

Closes #

How to test the Change

Changelog Entry

Added - New feature

Credits

Props @bluecollarcoders

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Comment thread includes/core/classes/class-setup.php Outdated
global $wpdb;

// Delete Options.
$option_name = 'wporg_option';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just an example. We need to remove things we store in the options table (GatherPress settings). In addition to deleting options, should delete user meta, taxonomies, events, venues, etc. Some things like post meta will be deleted automatically with the posts. We might want to delete things in options table by looking for anything that prepends with gatherpress_. What do you think @carstingaxion?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I especially liked about the linked implementation was:

  • additional check if plugin is network-enabled
  • deletion of user_meta

In addition:

For the multiple options I suggest an array function like array_walk calling delete_option on the list of all options and transients as well.

@carstingaxion carstingaxion linked an issue Aug 28, 2024 that may be closed by this pull request
1 task
@github-actions
Copy link
Copy Markdown
Contributor

Preview changes with Playground

You can preview the least recent changes for PR#716 by following one of the links below:

⚠️ Note: The preview sites are created using WordPress Playground. You can add content, edit settings, and test the themes as you would on a real site, but please note that changes are not saved between sessions.

@mauteri mauteri changed the base branch from main to develop October 10, 2024 13:01
@mauteri
Copy link
Copy Markdown
Contributor

mauteri commented Apr 20, 2026

Cleaning up old PRs

@mauteri mauteri closed this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add uninstall.php or uninstall routine

3 participants