Skip to content

Commit

Permalink
Merge pull request #31 from junaidbhura/feature/wp-all-export-addons
Browse files Browse the repository at this point in the history
WP All Export add-ons support
  • Loading branch information
junaidbhura authored Sep 8, 2021
2 parents c815089 + 5217785 commit 378b04f
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected function getDownloadUrl( PackageInterface $package ) {
default:
if ( 0 === strpos( $package_name, 'junaidbhura/gravityforms' ) ) {
$plugin = new Plugins\GravityForms( $package->getPrettyVersion(), str_replace( 'junaidbhura/', '', $package_name ) );
} elseif ( 0 === strpos( $package_name, 'junaidbhura/wpai-' ) ) {
} elseif ( 0 === strpos( $package_name, 'junaidbhura/wpai-' ) || 0 === strpos( $package_name, 'junaidbhura/wpae-' ) ) {
$plugin = new Plugins\WpAiPro( $package->getPrettyVersion(), str_replace( 'junaidbhura/', '', $package_name ) );
}
}
Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ Add the following to your composer.json file:
"junaidbhura/composer-wp-pro-plugins": "*"
}
}
},
{
"type": "package",
"package": {
"name": "junaidbhura/wpae-acf-add-on",
"version": "<version_number>",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
"url": "https://www.wpallimport.com"
},
"require": {
"junaidbhura/composer-wp-pro-plugins": "*"
}
}
}
],
"require": {
Expand All @@ -160,7 +175,8 @@ Add the following to your composer.json file:
"junaidbhura/polylang-pro": "*",
"junaidbhura/wp-all-import-pro": "*",
"junaidbhura/wp-all-export-pro": "*",
"junaidbhura/wpai-acf-add-on": "*"
"junaidbhura/wpai-acf-add-on": "*",
"junaidbhura/wpae-acf-add-on": "*"
},
```

Expand All @@ -185,3 +201,13 @@ You can use any WP All Import Pro add-on by simply adding it's slug like so:
For example:

`junaidbhura/wpai-acf-add-on`

### WP All Export Pro Add-Ons

You can use any WP All Export Pro add-on by simply adding it's slug like so:

`junaidbhura/<plugin-slug>`

For example:

`junaidbhura/wpae-acf-add-on`
44 changes: 28 additions & 16 deletions plugins/WpAiPro.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,45 @@ public function __construct( $version = '', $slug = 'wp-all-import-pro' ) {
* @return string
*/
public function getDownloadUrl() {
if ( 'wp-all-export-pro' === $this->slug ) {
$license = getenv( 'WP_ALL_EXPORT_PRO_KEY' );
$url = getenv( 'WP_ALL_EXPORT_PRO_URL' );
$name = 'WP All Export';
} else {
$license = getenv( 'WP_ALL_IMPORT_PRO_KEY' );
$url = getenv( 'WP_ALL_IMPORT_PRO_URL' );
$url = '';
$name = '';
$license = '';

if ( 'wp-all-import-pro' === $this->slug || 0 === strpos( $this->slug, 'wpai-' ) ) {
// WP All Import Pro.
$url = getenv( 'WP_ALL_IMPORT_PRO_URL' );

switch ( $this->slug ) {
case 'wpai-acf-add-on':
$name = 'ACF Add-On';
$license = '';
$name = 'ACF Add-On';
break;
case 'wpai-linkcloak-add-on':
$name = 'Link Cloaking Add-On';
$license = '';
$name = 'Link Cloaking Add-On';
break;
case 'wpai-user-add-on':
$name = 'User Import Add-On';
$license = '';
$name = 'User Import Add-On';
break;
case 'wpai-woocommerce-add-on':
$name = 'WooCommerce Add-On';
$license = '';
$name = 'WooCommerce Add-On';
break;
default:
$name = 'WP All Import';
$license = getenv( 'WP_ALL_IMPORT_PRO_KEY' );
}
} elseif ( 'wp-all-export-pro' === $this->slug || 0 === strpos( $this->slug, 'wpae-' ) ) {
// WP All Export Pro.
$url = getenv( 'WP_ALL_EXPORT_PRO_URL' );

switch ( $this->slug ) {
case 'wpae-acf-add-on':
$name = 'ACF Export Add-On Pro';
break;
case 'wpae-woocommerce-add-on':
$name = 'WooCommerce Export Add-On Pro';
break;
default:
$name = 'WP All Import';
$name = 'WP All Export';
$license = getenv( 'WP_ALL_EXPORT_PRO_KEY' );
}
}

Expand Down

0 comments on commit 378b04f

Please sign in to comment.