SpeedyGo provides a complete cleanup process during plugin deactivation to prevent leftover files, rules, or database entries.
30.1 Overview #
When the plugin is deactivated, SpeedyGo ensures that all generated resources and configurations are properly removed to maintain a clean system state.
Technical Context #
- Uses
register_deactivation_hook() - Triggers a controlled cleanup routine
- Prevents accidental deactivation
30.2 Deactivation Protection #
- A custom JavaScript confirmation popup appears before deactivation
- Prevents accidental removal
- Requires user confirmation before cleanup begins
30.3 Cleanup Process #
1️⃣ Cache Directory Removal #
Recursively deletes generated cache directories using:
sg_recursive_delete_dir() Including:
wp-content/uploads/speedygo-cache/ 2️⃣ .htaccess Marker Removal #
Removes the managed configuration block:
# BEGIN SPEEDY GO
...
# END SPEEDY GO Ensuring no residual server rules remain.
3️⃣ Database Cleanup #
Deletes all WordPress options with prefix:
speedygo_ From the:
wp_options This ensures:
- No orphaned data
- No leftover configuration
- Clean database state
30.4 Best Practice Recommendation #
- Backup your website before deactivation
- Confirm no other system depends on SpeedyGo cache files
- Verify
.htaccessafter removal if manually customized
Clean Uninstallation guarantees a complete and safe removal of all SpeedyGo-generated resources.