Skip to content

Conversation

@pfefferle
Copy link
Owner

Summary

Adds uninstall.php to properly clean up plugin options when the plugin is deleted, following WordPress plugin development standards.

Fixes #519

Options removed on uninstall

  • webmention_disable_selfpings_same_url
  • webmention_disable_selfpings_same_domain
  • webmention_disable_media_mentions
  • webmention_support_post_types
  • webmention_show_comment_form
  • webmention_comment_form_text
  • webmention_home_mentions
  • webmention_approve_domains
  • webmention_avatars
  • webmention_avatar_store_enable
  • webmention_separate_comment
  • webmention_show_facepile
  • webmention_facepile_fold_limit
  • webmention_send_media_mentions (legacy)
  • webmention_db_version
  • webmention_migration_lock

Note

Post meta and comment meta are intentionally not deleted to preserve webmention data in case users reinstall the plugin later.

Test Plan

  • Install and configure the plugin with various settings
  • Deactivate the plugin
  • Delete the plugin from the Plugins page
  • Verify all webmention_* options are removed from wp_options table

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds proper cleanup functionality for the Webmention plugin by implementing an uninstall.php file that removes all plugin options when the plugin is deleted, following WordPress plugin development best practices. This ensures users' databases are left clean after uninstalling the plugin while intentionally preserving post and comment meta for data retention.

Key Changes:

  • Implements uninstall.php with security guard and cleanup logic for 16 plugin options
  • Updates changelog to document the new uninstall functionality
  • Preserves webmention data in post/comment meta for future reinstallation scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
uninstall.php New file implementing plugin cleanup with WP_UNINSTALL_PLUGIN security check and deletion of all 16 webmention options
readme.md Adds changelog entry documenting the new uninstall method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pfefferle pfefferle force-pushed the fix/519-uninstall-method branch from cae8be6 to 7f4f7ea Compare December 9, 2025 12:33
Creates uninstall.php to clean up when the plugin is uninstalled:

Options removed:
- All settings from the settings page
- Database version tracking option
- Migration lock option

Files removed:
- Cached avatar files in wp-content/uploads/webmention/avatars/

Note: Post meta and comment meta are intentionally preserved to allow
users to reinstall the plugin without losing their webmention data.

Fixes #519
@pfefferle pfefferle force-pushed the fix/519-uninstall-method branch from 7f4f7ea to e92c9a1 Compare December 9, 2025 12:34
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.

Uninstall Method Missing

2 participants