| @@ -4,12 +4,12 @@ | ||
| 4 | 4 | exit(); |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | // Function to delete options for a specific site |
| 8 | -function wpdbbkp_delete_options_for_site() { | |
| 9 | - $wpdbbkp_remove_on_uninstall = get_option('wp_db_remove_on_uninstall', false); | |
| 8 | +function wp_db_delete_options_for_site() { | |
| 9 | + $wp_db_remove_on_uninstall = get_option('wp_db_remove_on_uninstall', false); | |
| 10 | 10 | |
| 11 | - if ($wpdbbkp_remove_on_uninstall) { | |
| 11 | + if ($wp_db_remove_on_uninstall) { | |
| 12 | 12 | // Remove options |
| 13 | 13 | $options_to_remove = array( |
| 14 | 14 | 'wp_db_backup_destination_SFTP', |
| 15 | 15 | 'wp_db_backup_destination_FTP', |
| @@ -23,12 +23,10 @@ | ||
| 23 | 23 | 'wp_db_backup_sftp_details', |
| 24 | 24 | 'wpdb_dest_bb_s3_bucket', |
| 25 | 25 | 'wpdb_dest_bb_s3_bucket_key', |
| 26 | 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' | |
| 27 | + 'wpdb_dest_bb_s3_bucket_host' | |
| 28 | + | |
| 31 | 29 | ); |
| 32 | 30 | |
| 33 | 31 | foreach ($options_to_remove as $option) { |
| 34 | 32 | delete_option($option); |
| @@ -37,17 +35,15 @@ | ||
| 37 | 35 | } |
| 38 | 36 | |
| 39 | 37 | if (is_multisite()) { |
| 40 | 38 | // Get all sites in the network |
| 41 | - $wpdbbkp_sites = get_sites(); | |
| 42 | - if(!empty($wpdbbkp_sites) && is_array($wpdbbkp_sites)) { | |
| 43 | - foreach ($wpdbbkp_sites as $wpdbbkp_site) { | |
| 44 | - switch_to_blog($wpdbbkp_site->blog_id); | |
| 45 | - wpdbbkp_delete_options_for_site(); | |
| 46 | - restore_current_blog(); | |
| 47 | - } | |
| 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(); | |
| 48 | 44 | } |
| 49 | 45 | |
| 50 | 46 | } else { |
| 51 | 47 | // Single site |
| 52 | - wpdbbkp_delete_options_for_site(); | |
| 48 | + wp_db_delete_options_for_site(); | |
| 53 | 49 | } |