BSF_Update_Manager::bsf_get_package_uri( int $product_id )

Get package URL


Description


Parameters

$product_id

(int) (Required) Product Id.


Return

(string) $download_path.


Source

File: admin/bsf-core/class-bsf-update-manager.php

		public function bsf_get_package_uri( $product_id ) {

			$product       = get_brainstorm_product( $product_id );
			$status        = BSF_License_Manager::bsf_is_active_license( $product_id );
			$download_path = '';
			$parent_product = isset( $product['parent'] ) ? $product['parent'] : '';

			if ( $this->use_beta_version( $product_id ) ) {
				$version = isset( $product['version_beta'] ) ? $product['version_beta'] : '';
			} else {
				$version = isset( $product['remote'] ) ? $product['remote'] : '';
			}

			if ( '' !== $version && false !== $status ) {
				$bundled_product = self::bsf_is_product_bundled( $product_id );
				$purchase_key    = $this->get_purchse_key( $product_id );
				$is_bundled      = ( ! empty( $bundled_product ) ) ? '1' : '0';

				$download_params = array(
					'version_no'   => $version,
					'purchase_key' => $purchase_key,
					'site_url'     => get_site_url(),
					'is_bundled'   => $is_bundled,
					'parent_product' => $parent_product,
				);

				$download_path = bsf_get_api_site( false, true ) . 'download/' . $product_id . '?' . http_build_query( $download_params );
				// Clear Product versions from transient after update.
				bsf_clear_versions_cache( $product_id );

				return $download_path;
			}

			return $download_path;
		}


User Contributed Notes

You must log in before being able to contribute a note or feedback.