-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from mcaskill/feature/wpml
Add support for WPML (plugin / add-ons)
- Loading branch information
Showing
3 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
/** | ||
* WPML Plugin. | ||
* | ||
* @package Junaidbhura\Composer\WPProPlugins\Plugins | ||
*/ | ||
|
||
namespace Junaidbhura\Composer\WPProPlugins\Plugins; | ||
|
||
use UnexpectedValueException; | ||
|
||
/** | ||
* Wpml class. | ||
*/ | ||
class Wpml extends AbstractPlugin { | ||
|
||
/** | ||
* Wpml constructor. | ||
* | ||
* @param string $version | ||
* @param string $slug | ||
*/ | ||
public function __construct( $version = '', $slug = 'wpml-sitepress-multilingual-cms' ) { | ||
parent::__construct( $version, $slug ); | ||
} | ||
|
||
/** | ||
* Get the download URL for this plugin. | ||
* | ||
* @return string | ||
*/ | ||
public function getDownloadUrl() { | ||
$packages = array( | ||
'wpml-acfml' => 1097589, | ||
'wpml-all-import' => 720221, | ||
'wpml-buddypress-multilingual' => 2216259, | ||
'wpml-cms-nav' => 6096, | ||
'wpml-contact-form-7-multilingual' => 3156699, | ||
'wpml-gravityforms-multilingual' => 8882, | ||
'wpml-mailchimp-for-wp' => 1442229, | ||
'wpml-media-translation' => 7474, | ||
'wpml-ninja-forms' => 5342487, | ||
'wpml-sitepress-multilingual-cms' => 6088, | ||
'wpml-sticky-links' => 6090, | ||
'wpml-string-translation' => 6092, | ||
'wpml-translation-management' => 6094, | ||
'wpml-types' => 1385906, | ||
'wpml-woocommerce-multilingual' => 637370, | ||
'wpml-wp-seo-multilingual' => 3566177, | ||
'wpml-wpforms' => 5368995, | ||
); | ||
|
||
if ( ! array_key_exists( $this->slug, $packages ) ) { | ||
throw new UnexpectedValueException( sprintf( | ||
'Could not find a matching package for %s. Check the package spelling and that the package is supported', | ||
'junaidbhura/' . $this->slug | ||
) ); | ||
} | ||
|
||
return 'https://wpml.org/?download=' . $packages[ $this->slug ] . '&user_id=' . getenv( 'WPML_USER_ID' ) . '&subscription_key=' . getenv( 'WPML_KEY' ) . '&version=' . $this->version; | ||
} | ||
|
||
} |