Skip to content

Conversation

@ahuseyn
Copy link
Member

@ahuseyn ahuseyn commented Nov 27, 2025

Description

This pull request introduces an optional data cleanup feature for the HWP Previews WordPress plugin, allowing users to remove all plugin settings and data during uninstallation by setting a specific constant. Documentation has been updated to explain this process, and new tests and an uninstall script have been added to support and verify the feature.

Feature Addition: Data Cleanup on Uninstall

  • Added support for optional removal of all plugin data and settings during uninstall by defining the HWP_PREVIEWS_UNINSTALL_PLUGIN constant. This is implemented in the new uninstall.php script, which also fires an action hook for extensibility.

Documentation Updates

  • Updated README.md and docs/plugins/hwp-previews/index.md to include instructions for enabling data cleanup on uninstall and details about the new constant.

Testing

  • Added UninstallTest.php to verify the existence of the uninstall script, ensure plugin options can be deleted, and confirm the uninstall action hook fires correctly.

Release Note

  • Added a changeset file describing the patch and the new optional uninstall cleanup feature.

Related Issue

#223

Dependant PRs

Type of Change

  • ✅ Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactoring (no functional changes)
  • 📄 Example update (no functional changes)
  • 📝 Documentation update
  • 🔍 Performance improvement
  • 🧪 Test update

How Has This Been Tested?

Screenshots

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the project's coding standards
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • Any dependent changes have been highlighted, merged or published

@changeset-bot
Copy link

changeset-bot bot commented Nov 27, 2025

🦋 Changeset detected

Latest commit: a120c89

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@wpengine/hwp-previews-wordpress-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

📦 Plugin Artifacts Ready!

Download from GitHub Actions run

Available plugins:

  • ✅ hwp-previews.zip

See the "Artifacts" section at the bottom of the Actions run page

colinmurphy
colinmurphy previously approved these changes Nov 27, 2025
Copy link
Member

@colinmurphy colinmurphy left a comment

Choose a reason for hiding this comment

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

LGTM ❤️

@ahuseyn ahuseyn changed the title feat(previews): Add uninstallation hook chore(previews): Add uninstallation hook Nov 27, 2025
@ahuseyn ahuseyn linked an issue Nov 27, 2025 that may be closed by this pull request
@ahuseyn ahuseyn marked this pull request as ready for review November 27, 2025 16:31
@ahuseyn ahuseyn requested a review from a team as a code owner November 27, 2025 16:31
@ahuseyn ahuseyn requested a review from colinmurphy November 27, 2025 16:31
@ahuseyn ahuseyn enabled auto-merge November 27, 2025 16:31
@ahuseyn ahuseyn disabled auto-merge November 27, 2025 16:41
@ahuseyn ahuseyn added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit a2321cd Nov 27, 2025
23 checks passed
@ahuseyn ahuseyn deleted the hwp-previews-uninstall-cleanup branch November 27, 2025 20:49
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.

chore: Previews install and uninstall UX Considerations

3 participants