| @@ -57,8 +57,24 @@ | ||
| 57 | 57 | } else { |
| 58 | 58 | vigilante_uninstall_site(); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | + /* | |
| 62 | + * Network options. Since 2.11.3 the baseline of the critical files lives in | |
| 63 | + * a single network option, because both files it watches, wp-config.php and | |
| 64 | + * the root .htaccess, belong to the installation and not to any one site. | |
| 65 | + * It is stored redacted, but it is still a copy of the configuration and it | |
| 66 | + * goes when the plugin goes. Once, not per site. | |
| 67 | + */ | |
| 68 | + if ( is_multisite() ) { | |
| 69 | + delete_site_option( 'vigilante_critical_files_baseline' ); | |
| 70 | + delete_site_option( 'vigilante_baseline_sweep' ); | |
| 71 | + delete_site_option( 'vigilante_owned_blocks' ); | |
| 72 | + delete_site_option( 'vigilante_owned_blocks_claim' ); | |
| 73 | + delete_site_option( 'vigilante_config_copies_sweep' ); | |
| 74 | + delete_site_option( 'vigilante_results_sweep' ); | |
| 75 | + } | |
| 76 | + | |
| 61 | 77 | // Remove backup directory. WP_CONTENT_DIR is shared by the whole network, |
| 62 | 78 | // so this happens once. |
| 63 | 79 | $backup_dir = WP_CONTENT_DIR . '/vigilante-backups/'; |
| 64 | 80 | if ( is_dir( $backup_dir ) ) { |
| @@ -142,8 +158,12 @@ | ||
| 142 | 158 | // Delete options |
| 143 | 159 | $options_to_delete = array( |
| 144 | 160 | 'vigilante_options', |
| 145 | 161 | 'vigilante_db_version', |
| 162 | + 'vigilante_purge_2_11_0_done', | |
| 163 | + 'vigilante_baseline_redaction', | |
| 164 | + 'vigilante_owned_blocks', | |
| 165 | + 'vigilante_owned_blocks_claim', | |
| 146 | 166 | 'vigilante_backup_timestamp', |
| 147 | 167 | 'vigilante_last_integrity_scan', |
| 148 | 168 | 'vigilante_last_integrity_results', |
| 149 | 169 | 'vigilante_ignored_files', |
| @@ -166,9 +186,19 @@ | ||
| 166 | 186 | // The wp-config.php one holds the database credentials and the |
| 167 | 187 | // authentication salts, so leaving it behind would keep them readable in |
| 168 | 188 | // the options table long after the plugin is gone. |
| 169 | 189 | 'vigilante_htaccess_backup', |
| 190 | + 'vigilante_htaccess_history', | |
| 191 | + // The pre-migration snapshot keeps our own header block so the owner can | |
| 192 | + // restore it; it is still ours to remove on uninstall, along with the | |
| 193 | + // recovery undo copy and the dismissed flag. | |
| 194 | + 'vigilante_htaccess_pre_migration', | |
| 195 | + 'vigilante_htaccess_recovery_undo', | |
| 196 | + 'vigilante_htaccess_recovery_done', | |
| 170 | 197 | 'vigilante_wpconfig_backup', |
| 198 | + 'vigilante_config_copies_purged', | |
| 199 | + 'vigilante_config_copies_sweep_lock', | |
| 200 | + 'vigilante_htaccess_write_lock', | |
| 171 | 201 | 'vigilante_plugin_status_state', |
| 172 | 202 | 'vigilante_plugin_status_last_check', |
| 173 | 203 | 'vigilante_ignored_closed_plugins', |
| 174 | 204 | ); |
| @@ -234,8 +264,13 @@ | ||
| 234 | 264 | OR option_name LIKE 'vigilante_backup_info\_%' |
| 235 | 265 | OR option_name IN ( |
| 236 | 266 | 'vigilante_options', |
| 237 | 267 | 'vigilante_db_version', |
| 268 | + 'vigilante_purge_2_11_0_done', | |
| 269 | + 'vigilante_baseline_redaction', | |
| 270 | + 'vigilante_critical_files_baseline', | |
| 271 | + 'vigilante_owned_blocks', | |
| 272 | + 'vigilante_owned_blocks_claim', | |
| 238 | 273 | 'vigilante_ignored_closed_plugins', |
| 239 | 274 | 'vigilante_ignored_files', |
| 240 | 275 | 'vigilante_dismissed_notices', |
| 241 | 276 | 'vigilante_under_attack_mode', |