Automattic / Automattic/jetpack

Beta Plugin: Implement register_uninstall_hook for cleanup

Open
#18,423 0 comments 0 reactions 0 assignees View on GitHub
[Plugin] Beta [Pri] Normal Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

Something like:

```
function jetpack_beta_activate(){
register_uninstall_hook( __FILE__, array( 'Jetpack_Beta', 'unistall' );
}
register_activation_hook( __FILE__, 'jetpack_beta_activate' );

// And here goes the uninstallation function:
function uninstall(){
// codes to perform during unistallation
delete_option( self::$option_dev_installed );
delete_option( self::$option );
delete_option( 'jp_beta_autoupdate' );
}
```

As requested in https://github.com/Automattic/jetpack-beta/pull/44#issuecomment-356071265

Contributor guide

Open the contributing guide

Research direction

No file or test is named. Start by locating the Jetpack Beta activation entry point and the existing uninstall-related code, then compare it with the requested register_uninstall_hook example. Done means the uninstall callback is registered and removes the three listed options; verify the behavior with the plugin's available tests or manual uninstall flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.