src/Modules/Rollback.php
private function get_remote_versions() {
		$url = $this->get_versions_api_url();
		if ( empty( $url ) ) {
			return [];
		}
		$response = wp_remote_get( $url );
		if ( is_wp_error( $response ) ) {
			return array();
		}
		$response = wp_remote_retrieve_body( $response );

		if ( is_serialized( $response ) ) {
			$response = maybe_unserialize( $response );
		} else {
			$response = json_decode( $response );
		}

		if ( ! is_object( $response ) ) {
			return array();
		}
		if ( ! isset( $response->versions ) ) {
			return array();
		}

		$versions = array();
		foreach ( $response->versions as $key => $value ) {
			$versions[] = array(
				'version' => is_object( $value ) ? $value->version : $key,
				'url'     => is_object( $value ) ? $value->file : $value,
			);
		}

		return $versions;
	}
private function get_remote_versions() {
		$url = $this->get_versions_api_url();
		if ( empty( $url ) ) {
			return [];
		}
		$response = wp_remote_get( $url );
		if ( is_wp_error( $response ) ) {
			return array();
		}
		$response = wp_remote_retrieve_body( $response );

		if ( is_serialized( $response ) ) {
			$response = maybe_unserialize( $response );
		} else {
			$response = json_decode( $response );
		}

		if ( ! is_object( $response ) ) {
			return array();
		}
		if ( ! isset( $response->versions ) ) {
			return array();
		}

		$versions = array();
		foreach ( $response->versions as $key => $value ) {
			$versions[] = array(
				'version' => is_object( $value ) ? $value->version : $key,
				'url'     => is_object( $value ) ? $value->file : $value,
			);
		}

		return $versions;
	}
private function get_remote_versions ( ) { $ url = $ this -> get_versions_api_url ( ) ; if ( empty ( $ url ) ) { return [ ] ; } $ response = wp_remote_get ( $ url ) ; if ( is_wp_error ( $ response ) ) { return array ( ) ; } $ response = wp_remote_retrieve_body ( $ response ) ; if ( is_serialized ( $ response ) ) { $ response = maybe_unserialize ( $ response ) ; } else { $ response = json_decode ( $ response ) ; } if ( ! is_object ( $ response ) ) { return array ( ) ; } if ( ! isset ( $ response -> versions ) ) { return array ( ) ; } $ versions = array ( ) ; foreach ( $ response -> versions as $ key => $ value ) { $ versions [ ] = array ( 'version' => is_object ( $ value ) ? $ value -> version : $ key , 'url' => is_object ( $ value ) ? $ value -> file : $ value , ) ; } return $ versions ; }
Get remote versions zips.

@return array Array of available versions.
Get remote versions zips .