| 1 |
<?php |
| 2 |
/* |
| 3 |
+=====================================================================+ |
| 4 |
| ____ _ ____ __ _ _ | |
| 5 |
| / ___|___ __| | ___ | _ \ _ __ ___ / _(_) | ___ _ __ | |
| 6 |
| | | / _ \ / _` |/ _ \ | |_) | '__/ _ \| |_| | |/ _ \ '__| | |
| 7 |
| | |__| (_) | (_| | __/ | __/| | | (_) | _| | | __/ | | |
| 8 |
| \____\___/ \__,_|\___| |_| |_| \___/|_| |_|_|\___|_| | |
| 9 |
| | |
| 10 |
| (c) Jerome Bruandet ~ https://code-profiler.com/ | |
| 11 |
+=====================================================================+ |
| 12 |
*/ |
| 13 |
|
| 14 |
if (! defined('WP_UNINSTALL_PLUGIN') ) { exit('Not allowed'); } |
| 15 |
|
| 16 |
// ===================================================================== |
| 17 |
// Code Profiler's uninstaller (database + files). |
| 18 |
|
| 19 |
$cp_options = get_option('code-profiler'); |
| 20 |
|
| 21 |
global $wp_filesystem; |
| 22 |
require_once ABSPATH .'wp-admin/includes/file.php'; |
| 23 |
WP_Filesystem(); |
| 24 |
|
| 25 |
define('CODE_PROFILER_VERSION', '1'); |
| 26 |
require_once 'lib/helper.php'; |
| 27 |
|
| 28 |
if ( $wp_filesystem->exists( WPMU_PLUGIN_DIR .'/'. CODE_PROFILER_MUPLUGIN ) ) { |
| 29 |
$wp_filesystem->delete( WPMU_PLUGIN_DIR .'/'. CODE_PROFILER_MUPLUGIN, false, 'f'); |
| 30 |
} |
| 31 |
|
| 32 |
// Delete options in the DB |
| 33 |
delete_option('code-profiler'); |
| 34 |
|
| 35 |
// Delete profiles on disk (optional) |
| 36 |
//~ if (! empty( $cp_options['uninstall_delete_profiles'] ) ) { |
| 37 |
// Find and recursively delete any files and folders |
| 38 |
// located inside the profiles directory: |
| 39 |
$wp_filesystem->delete( CODE_PROFILER_UPLOAD_DIR, true, 'd'); |
| 40 |
//~ } |
| 41 |
|
| 42 |
return; |
| 43 |
|
| 44 |
// ===================================================================== |
| 45 |
// EOF |
| 46 |
|