src/Modules/Dashboard_widget.php
function get_product_from_api() {
		if ( false === ( $products = get_transient( 'themeisle_sdk_products' ) ) ) {
			$products                = array();
			$all_themes              = $this->get_themes_from_wporg( 'themeisle' );
			$all_plugins             = $this->get_plugins_from_wporg( 'themeisle' );
			static $allowed_products = [
				'hestia'              => true,
				'neve'                => true,
				'visualizer'          => true,
				'feedzy-rss-feeds'    => true,
				'wp-product-review'   => true,
				'otter-blocks'        => true,
				'themeisle-companion' => true,
			];
			foreach ( $all_themes as $theme ) {
				if ( $theme->active_installs < 4999 ) {
					continue;
				}
				if ( ! isset( $allowed_products[ $theme->slug ] ) ) {
					continue;
				}
				$products[] = array(
					'name'     => $theme->name,
					'type'     => 'theme',
					'slug'     => $theme->slug,
					'installs' => $theme->active_installs,
				);
			}
			foreach ( $all_plugins as $plugin ) {
				if ( $plugin->active_installs < 4999 ) {
					continue;
				}
				if ( ! isset( $allowed_products[ $plugin->slug ] ) ) {
					continue;
				}
				$products[] = array(
					'name'     => $plugin->name,
					'type'     => 'plugin',
					'slug'     => $plugin->slug,
					'installs' => $plugin->active_installs,
				);
			}
			set_transient( 'themeisle_sdk_products', $products, 6 * HOUR_IN_SECONDS );
		}

		return $products;
	}
function get_product_from_api() {
		if ( false === ( $products = get_transient( 'themeisle_sdk_products' ) ) ) {
			$products                = array();
			$all_themes              = $this->get_themes_from_wporg( 'themeisle' );
			$all_plugins             = $this->get_plugins_from_wporg( 'themeisle' );
			static $allowed_products = [
				'hestia'              => true,
				'neve'                => true,
				'visualizer'          => true,
				'feedzy-rss-feeds'    => true,
				'wp-product-review'   => true,
				'otter-blocks'        => true,
				'themeisle-companion' => true,
			];
			foreach ( $all_themes as $theme ) {
				if ( $theme->active_installs < 4999 ) {
					continue;
				}
				if ( ! isset( $allowed_products[ $theme->slug ] ) ) {
					continue;
				}
				$products[] = array(
					'name'     => $theme->name,
					'type'     => 'theme',
					'slug'     => $theme->slug,
					'installs' => $theme->active_installs,
				);
			}
			foreach ( $all_plugins as $plugin ) {
				if ( $plugin->active_installs < 4999 ) {
					continue;
				}
				if ( ! isset( $allowed_products[ $plugin->slug ] ) ) {
					continue;
				}
				$products[] = array(
					'name'     => $plugin->name,
					'type'     => 'plugin',
					'slug'     => $plugin->slug,
					'installs' => $plugin->active_installs,
				);
			}
			set_transient( 'themeisle_sdk_products', $products, 6 * HOUR_IN_SECONDS );
		}

		return $products;
	}
function get_product_from_api ( ) { if ( false === ( $ products = get_transient ( 'themeisle_sdk_products' ) ) ) { $ products = array ( ) ; $ all_themes = $ this -> get_themes_from_wporg ( 'themeisle' ) ; $ all_plugins = $ this -> get_plugins_from_wporg ( 'themeisle' ) ; static $ allowed_products = [ 'hestia' => true , 'neve' => true , 'visualizer' => true , 'feedzy-rss-feeds' => true , 'wp-product-review' => true , 'otter-blocks' => true , 'themeisle-companion' => true , ] ; foreach ( $ all_themes as $ theme ) { if ( $ theme -> active_installs < 4999 ) { continue ; } if ( ! isset ( $ allowed_products [ $ theme -> slug ] ) ) { continue ; } $ products [ ] = array ( 'name' => $ theme -> name , 'type' => 'theme' , 'slug' => $ theme -> slug , 'installs' => $ theme -> active_installs , ) ; } foreach ( $ all_plugins as $ plugin ) { if ( $ plugin -> active_installs < 4999 ) { continue ; } if ( ! isset ( $ allowed_products [ $ plugin -> slug ] ) ) { continue ; } $ products [ ] = array ( 'name' => $ plugin -> name , 'type' => 'plugin' , 'slug' => $ plugin -> slug , 'installs' => $ plugin -> active_installs , ) ; } set_transient ( 'themeisle_sdk_products' , $ products , 6 * HOUR_IN_SECONDS ) ; } return $ products ; }
Fetch products from the recomended section.

@return array|mixed The list of products to use in recomended section.
Fetch products from the recomended section .