Skip to content

fix: Critical plugin deactivation after update v1.4.5

Choose a tag to compare

@danbaileyza danbaileyza released this 26 Feb 06:27
· 8 commits to main since this release
Fixes: Plugin file does not exist error after auto-update

Problem:
- After updating to v1.4.3, plugin gets deactivated
- WordPress shows: errorvault-wordpress/errorvault.php does not exist
- Update process not properly preserving plugin structure

Root Cause:
- after_install hook was processing ALL plugin updates
- Not checking if the update was for our specific plugin
- Missing destination_name setting for WordPress recognition

Solution:
- Add plugin-specific check in after_install
- Only process updates where hook_extra[plugin] matches our slug
- Set result[destination_name] = errorvault-wordpress
- Add upgrader_clear_destination filter for pre-update handling

Changes:
- Check hook_extra[plugin] === this->plugin_slug before processing
- Set destination_name to ensure WordPress recognizes folder
- Add clear_destination filter for better update flow
- Enhanced logging with plugin basename tracking

This ensures:
1. Only our plugin updates are processed by after_install
2. WordPress maintains correct plugin path after update
3. Plugin remains activated after successful update
4. Better debugging with detailed logs