PluginProbe
WP Database Backup – Unlimited Database & Files Backup by Backup for WP / 7.5
WP Database Backup – Unlimited Database & Files Backup by Backup for WP v7.5
7.13 7.12 trunk 1.1 2.1.1 5.9 6.0 6.1 6.10 6.11 6.12 6.12.1 6.2 6.3 6.4 6.5 6.5.1 6.6 6.7 6.8 6.9 7.0 7.0.1 7.1 7.10 All 34 releases
wp-database-backup / uninstall.php

uninstall.php in WP Database Backup – Unlimited Database & Files Backup by Backup for WP 7.5, at uninstall.php

54 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // If uninstall is not called from WordPress, exit
3 if (!defined('WP_UNINSTALL_PLUGIN')) {
4 exit();
5 }
6
7 // Function to delete options for a specific site
8 function wp_db_delete_options_for_site() {
9 $wp_db_remove_on_uninstall = get_option('wp_db_remove_on_uninstall', false);
10
11 if ($wp_db_remove_on_uninstall) {
12 // Remove options
13 $options_to_remove = array(
14 'wp_db_backup_destination_SFTP',
15 'wp_db_backup_destination_FTP',
16 'wp_db_backup_destination_Email',
17 'wp_db_backup_destination_s3',
18 'wp_db_remove_local_backup',
19 'wp_db_remove_on_uninstall',
20 'wp_db_backup_backup_type',
21 'wp_db_backup_exclude_dir',
22 'wp_db_backup_backups_dir',
23 'wp_db_backup_sftp_details',
24 'wpdb_dest_bb_s3_bucket',
25 'wpdb_dest_bb_s3_bucket_key',
26 'wpdb_dest_bb_s3_bucket_secret',
27 'wpdb_dest_bb_s3_bucket_host',
28 'wp_db_backup_destination_bb',
29 'wp_db_backup_backups',
30 'wp_db_backup_options'
31 );
32
33 foreach ($options_to_remove as $option) {
34 delete_option($option);
35 }
36 }
37 }
38
39 if (is_multisite()) {
40 // Get all sites in the network
41 $sites = get_sites();
42 if(!empty($sites) && is_array($sites)) {
43 foreach ($sites as $site) {
44 switch_to_blog($site->blog_id);
45 wp_db_delete_options_for_site();
46 restore_current_blog();
47 }
48 }
49
50 } else {
51 // Single site
52 wp_db_delete_options_for_site();
53 }
54