prefix . $n; } return $out; } /** * Options owned by the plugin. * * @return string[] */ function wpbr_owned_options() { return array( 'wpbr_db_version', 'wpbr_settings', 'wpbr_aliases_seeded', 'wpbr_dirs_protected', 'wpbr_adopted_notice', 'wpbr_schema_version', 'wpbr_migration_notice', 'wpbr_migration_failure', 'wpbr_variant_groups', 'wpbr_advocacy_site', 'wpbr_asset_versions', 'wpbr_privacy_proofs', 'wpbr_owned_temps', ); } /** * User meta keys owned by the plugin, stored against each administrator. * * Only the review ask's memory: which sign-ins it has seen and how the * person answered. Uninstall removes the key from every user and nothing else * about them. * * @return string[] */ function wpbr_owned_user_meta() { return array( 'wpbr_advocacy', ); } /** * Transients owned by the plugin, without the _transient_ prefix. * * @return string[] */ function wpbr_owned_transients() { return array( 'wpbr_exposure_check', 'wpbr_site_scan', ); } /** * Directories the plugin creates and writes to. * * Only ever the staging and backups folders. Both hold plugin-created working * copies: staged uploads awaiting processing, and backups of files the plugin * replaced. Neither holds live site content. * * This is the inventory, not the deletion list. Either folder may have been * pinned outside wp-content by a wp-config.php constant, and uninstall removes * only what wpbr_dir_is_removable_on_uninstall() allows. * * @return string[] */ function wpbr_owned_directories() { $dirs = array(); if (function_exists('wpbr_staging_dir')) $dirs[] = wpbr_staging_dir(); if (function_exists('wpbr_storage_roots')) { // Every folder that ever held backups: an old one is cleaned like the current one (protected backups kept), and a // private one is never removed (wpbr_storage_dir_is_preserved()). $dirs = array_merge($dirs, wpbr_storage_roots()); } elseif (function_exists('wpbr_backups_dir')) { $dirs[] = wpbr_backups_dir(); } return array_values(array_unique($dirs)); } /** * What the plugin must never delete, whatever the uninstall setting says. * * This list is not consumed by any code - deletion is an allowlist, so * anything absent from the inventory above is already safe. It is here, and * asserted in tests, so the boundary is stated rather than implied. * * The entries are deliberately not translatable: nothing renders them, and the * one place this boundary is stated to a reader is the uninstall disclosure on * the Settings screen, which carries its own translated wording. * * @return string[] */ function wpbr_never_deleted() { return array( 'Media Library attachments created by the plugin (wp_posts / wp_postmeta)', 'Replacement files written into the uploads directory - these are live site content', 'Post meta values on matched posts, including file URLs the plugin set', 'Original files that were replaced in place (the backup copy is the only remaining copy)', 'Anything outside the staging and backups directories', 'Staging or backup directories pinned outside wp-content by WPBR_STAGING_DIR or WPBR_BACKUPS_DIR', 'A private backups location recorded by the plugin, the record of every folder that ever held backups, and the network record of a deleted site\'s private folder', 'Matching intelligence - remembered matches and abbreviations - which belongs to the Pro add-on, not to this plugin', ); }