prefix . 'fitzaro_requests'; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- Dropping the plugin's own table on uninstall. $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i', $fitzaro_table ) ); delete_option( 'fitzaro_db_version' ); delete_transient( 'fitzaro_recurring_checked' ); delete_option( 'fitzaro_limits' ); delete_option( 'fitzaro_provider' ); delete_option( 'fitzaro_budget_reached' ); delete_option( 'fitzaro_openai_key' ); delete_option( 'fitzaro_openai_model' ); delete_option( 'fitzaro_provider_problem' ); delete_option( 'fitzaro_enabled' ); delete_option( 'fitzaro_types' ); delete_option( 'fitzaro_setup_notice' ); delete_post_meta_by_key( '_fitzaro_type' ); delete_metadata( 'term', 0, 'fitzaro_type', '', true ); // The main plugin file is not loaded during uninstall, so load the classes directly. require_once __DIR__ . '/src/Autoloader.php'; \Fitzaro\Autoloader::register( __DIR__ . '/src/' ); $fitzaro_location = get_option( \Fitzaro\Storage\Storage::OPTION_LOCATION ); if ( is_array( $fitzaro_location ) && ! empty( $fitzaro_location['path'] ) ) { ( new \Fitzaro\Storage\FileStore( (string) $fitzaro_location['path'] ) )->destroy(); } // A folder set with FITZARO_STORAGE_DIR belongs to the site owner: its files are removed, the folder setting is theirs. if ( defined( 'FITZARO_STORAGE_DIR' ) ) { ( new \Fitzaro\Storage\FileStore( (string) constant( 'FITZARO_STORAGE_DIR' ) ) )->destroy(); } delete_option( \Fitzaro\Storage\Storage::OPTION_LOCATION ); delete_option( \Fitzaro\Storage\Storage::OPTION_SUFFIX );