diff --git a/.travis.yml b/.travis.yml index 1f9e8a5b..c5ff7829 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,17 +15,25 @@ jobs: - composer install - composer run-script lint - php: 5.2 + env: + - WP_VERSION=5.1.1 dist: precise script: - ./bin/run-unit-tests.sh - php: 5.3 + env: + - WP_VERSION=5.1.1 dist: precise script: - ./bin/run-unit-tests.sh - php: 5.4 + env: + - WP_VERSION=5.1.1 script: - ./bin/run-unit-tests.sh - php: 5.5 + env: + - WP_VERSION=5.1.1 script: - ./bin/run-unit-tests.sh - php: 5.6 diff --git a/src/Product.php b/src/Product.php index 486729eb..271f6aec 100644 --- a/src/Product.php +++ b/src/Product.php @@ -200,6 +200,7 @@ public function setup_from_fileheaders() { public function get_key() { return $this->key; } + /** * Check if the product is either theme or plugin. * @@ -342,6 +343,11 @@ public function get_store_name() { * @return string The store url. */ public function get_store_url() { + + if ( strpos( $this->store_url, '/themeisle.com' ) !== false ) { + return 'https://store.themeisle.com'; + } + return $this->store_url; } @@ -362,6 +368,7 @@ public function get_basefile() { public function get_file() { return $this->file; } + /** * Returns the pro slug, if available. * diff --git a/tests/product-test.php b/tests/product-test.php index 1fbbe22d..d1b06a0b 100644 --- a/tests/product-test.php +++ b/tests/product-test.php @@ -23,7 +23,7 @@ public function test_product_from_plugin() { $this->assertEquals( $product->get_store_name(), 'ThemeIsle' ); $this->assertEquals( $product->get_version(), '1.1.1' ); $this->assertGreaterThanOrEqual( $product->get_install_time(), time() ); - $this->assertEquals( $product->get_store_url(), 'https://themeisle.com' ); + $this->assertEquals( $product->get_store_url(), 'https://store.themeisle.com' ); $this->assertFalse( $product->requires_license() ); $this->assertFalse( $product->is_wordpress_available() ); } @@ -42,7 +42,7 @@ public function test_product_from_theme() { $this->assertEquals( $product->get_store_name(), 'ThemeIsle' ); $this->assertEquals( $product->get_version(), '2.0.18' ); $this->assertGreaterThanOrEqual( $product->get_install_time(), time() ); - $this->assertEquals( $product->get_store_url(), 'https://themeisle.com' ); + $this->assertEquals( $product->get_store_url(), 'https://store.themeisle.com' ); $this->assertTrue( $product->requires_license() ); $this->assertTrue( $product->is_wordpress_available() ); }