| @@ -23,10 +23,12 @@ | ||
| 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 | - | |
| 27 | + 'wpdb_dest_bb_s3_bucket_host', | |
| 28 | + 'wp_db_backup_destination_bb', | |
| 29 | + 'wp_db_backup_backups', | |
| 30 | + 'wp_db_backup_options' | |
| 29 | 31 | ); |
| 30 | 32 | |
| 31 | 33 | foreach ($options_to_remove as $option) { |
| 32 | 34 | delete_option($option); |
| @@ -36,12 +38,14 @@ | ||
| 36 | 38 | |
| 37 | 39 | if (is_multisite()) { |
| 38 | 40 | // Get all sites in the network |
| 39 | 41 | $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(); | |
| 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 | + } | |
| 44 | 48 | } |
| 45 | 49 | |
| 46 | 50 | } else { |
| 47 | 51 | // Single site |