Skip to content

Commit

Permalink
Merge pull request #55 from Codeinwp/fix_store_url
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
selul authored May 27, 2019
2 parents cde61ab + a7a078c commit 5dce450
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;
}

Expand All @@ -362,6 +368,7 @@ public function get_basefile() {
public function get_file() {
return $this->file;
}

/**
* Returns the pro slug, if available.
*
Expand Down
4 changes: 2 additions & 2 deletions tests/product-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
Expand All @@ -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() );
}
Expand Down

0 comments on commit 5dce450

Please sign in to comment.