public static function sanitizeSettings( array $settings ) {
		$result = array();

		if ( ! empty( $settings['autoupdate'] ) && is_array( $settings['autoupdate'] ) ) {
			foreach ( $settings['autoupdate'] as $category => $itemSetting ) {
				$category = sanitize_key( $category );

				foreach ( $itemSetting as $id => $val ) {
					$id = sanitize_text_field( $id );

					$result['autoupdate'][ $category ][ $id ] = (bool) $val;
				}
			}
		}

		// Validate release channel settings.
		$channels = array(
			'stable',
			'edge',
			'candidate',
		);

		if ( empty( $settings['release_channel'] ) ||
			! in_array( $settings['release_channel'], $channels, true ) ) {
				$result['release_channel'] = 'stable';
		} else {
			$result['release_channel'] = $settings['release_channel'];
		}

		if ( empty( $settings['theme_release_channel'] ) ||
			! in_array( $settings['theme_release_channel'], $channels, true ) ) {
				$result['theme_release_channel'] = 'stable';
		} else {
			$result['theme_release_channel'] = $settings['theme_release_channel'];
		}

		return $result;
	}