Repository navigation
fix: prevent fatal error when uninstalling the plugin - #329
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes correctly address the missing constant while preserving local cleanup on remote failures.
0 open findings
What changed in this PR
Prevents uninstall failures when the main plugin bootstrap and its constants are unavailable.
Changes:
- Defines
ONESEARCH_DIRbefore loading the autoloader. - Allows local cleanup to continue if Algolia cleanup fails.
| File | Description |
|---|---|
uninstall.php |
Makes dependency loading and cleanup resilient during uninstall. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #329 +/- ##
============================================
+ Coverage 87.83% 89.27% +1.43%
Complexity 667 667
============================================
Files 33 23 -10
Lines 2951 2302 -649
Branches 180 0 -180
============================================
- Hits 2592 2055 -537
+ Misses 297 247 -50
+ Partials 62 0 -62
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
justlevine
requested changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes a fatal error that stopped OneSearch from uninstalling.
Why
WordPress runs
uninstall.phpwithout loading the main plugin file, so none of the constants fromonesearch.phpexist at that point. The uninstaller loads the plugin's autoloader to clean up Algolia, andAutoloader::autoload()builds its paths fromONESEARCH_DIR. The result is a fatal error:Related Issue(s):
How
AI Disclosure
Testing Instructions
Screenshots
N/A
Checklist