Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/Edd/AbstractLicenceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public function buildSubmitButton(string $plugin_id, string $class, string $acti

/**
* Get an array of translation strings.
*
* @return array
*/
public function getStrings(): array
Expand Down Expand Up @@ -141,7 +140,6 @@ abstract protected function init(

/**
* Activates the license key.
*
* @param string $license The incoming POST license key
* @param string $plugin_id
* @param int $item_id
Expand Down Expand Up @@ -182,7 +180,6 @@ protected function activateLicense(string $license, string $plugin_id, int $item

/**
* Deactivates the license key.
*
* @param string $license The incoming POST license key
* @param string $plugin_id
* @param int $item_id
Expand Down Expand Up @@ -219,7 +216,6 @@ protected function deactivateLicense(string $license, string $plugin_id, int $it

/**
* Checks if license is valid and gets expire date.
*
* @param string $license The incoming POST license key
* @param string $plugin_id
* @param bool $update_option
Expand Down Expand Up @@ -339,9 +335,14 @@ private function getCheckLicense(array $api_params): CheckLicense
private function getApiResponse(array $api_params): array
{
$defaults = [
'timeout' => 15,
'timeout' => 10,
'sslverify' => true,
'body' => $api_params,
'user-agent' => sprintf(
'EddLicenseManager/%s; %s',
LicenseManager::VERSION,
esc_url(get_bloginfo('url'))
),
];
$args = (array)apply_filters('dwnload_api_remote_post_args', []);
$args = wp_parse_args($args, $defaults);
Expand Down
3 changes: 3 additions & 0 deletions src/Edd/LicenseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ protected function init(
),
SettingField::TYPE => FieldTypes::FIELD_TYPE_TEXT,
SettingField::DESC => include dirname(__DIR__, 2) . '/views/license.php',
SettingField::ATTRIBUTES => [
'pattern' => '^[a-fA-F0-9]{32}$',
],
SettingField::SECTION_ID => $section_id,
]
)
Expand Down