v5.0.0
This commit is contained in:
commit
7b62556227
1 changed files with 82799 additions and 0 deletions
39
uninstall.php
Normal file
39
uninstall.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* Plugin uninstall handler.
|
||||
*
|
||||
* WordPress runs this file when the plugin is deleted from the Plugins screen.
|
||||
* Data is only deleted when the administrator has explicitly opted in by enabling
|
||||
* the "Delete all plugin data on uninstall" option in the plugin settings.
|
||||
* By default all data is preserved so that re-activating the plugin restores
|
||||
* the previous state without any additional configuration.
|
||||
*
|
||||
* @package WPVulnerability
|
||||
*
|
||||
* @since 4.3.4
|
||||
*/
|
||||
|
||||
defined( 'WP_UNINSTALL_PLUGIN' ) || exit;
|
||||
|
||||
// Resolve the opt-in preference.
|
||||
$wpvulnerability_config = is_multisite()
|
||||
? get_site_option( 'wpvulnerability-config', array() )
|
||||
: get_option( 'wpvulnerability-config', array() );
|
||||
|
||||
$wpvulnerability_delete_on_uninstall = is_array( $wpvulnerability_config ) && ! empty( $wpvulnerability_config['delete_on_uninstall'] );
|
||||
|
||||
if ( ! $wpvulnerability_delete_on_uninstall ) {
|
||||
// User did not opt in — preserve all data (default behaviour).
|
||||
return;
|
||||
}
|
||||
|
||||
// User opted in: load the uninstall routine from the main plugin file.
|
||||
if ( ! defined( 'WPVULNERABILITY_PLUGIN_PATH' ) ) {
|
||||
define( 'WPVULNERABILITY_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
|
||||
}
|
||||
|
||||
require_once WPVULNERABILITY_PLUGIN_PATH . 'wpvulnerability-run.php';
|
||||
|
||||
if ( function_exists( 'wpvulnerability_uninstall' ) ) {
|
||||
wpvulnerability_uninstall();
|
||||
}
|
||||
Loading…
Reference in a new issue