PluginProbe
WP Database Backup – Unlimited Database & Files Backup by Backup for WP / 6.11
WP Database Backup – Unlimited Database & Files Backup by Backup for WP v6.11
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 6.11, at uninstall.php

50 lines 1.4 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
29 );
30
31 foreach ($options_to_remove as $option) {
32 delete_option($option);
33 }
34 }
35 }
36
37 if (is_multisite()) {
38 // Get all sites in the network
39 $sites = get_sites();
40 foreach ($sites as $site) {
41 switch_to_blog($site->blog_id);
42 wp_db_delete_options_for_site();
43 restore_current_blog();
44 }
45
46 } else {
47 // Single site
48 wp_db_delete_options_for_site();
49 }
50