WC_WCCOM_Site_Installation_Step_Activate_Product::get_wporg_product_dir_name()privateWC 1.0

Get WP.org product directory name.

Method of the class: WC_WCCOM_Site_Installation_Step_Activate_Product{}

No Hooks.

Return

String|false.

Usage

// private - for code of main (parent) class only
$result = $this->get_wporg_product_dir_name();

WC_WCCOM_Site_Installation_Step_Activate_Product::get_wporg_product_dir_name() code WC 8.7.0

private function get_wporg_product_dir_name() {
	if ( empty( $this->state->get_installed_path() ) ) {
		return false;
	}

	// Check whether product was downloaded from WordPress.org.
	$download_url = $this->state->get_download_url();
	$parsed_url   = wp_parse_url( $download_url );
	if ( ! empty( $parsed_url['host'] ) && 'downloads.wordpress.org' !== $parsed_url['host'] ) {
		return false;
	}

	return basename( $this->state->get_installed_path() );
}