Skip to content

Commit 8f38789

Browse files
committed
Fix: Missing license key method
1 parent 4d90918 commit 8f38789

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/Edd/License.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Dwnload\EddSoftwareLicenseManager\Edd;
66

77
use Dwnload\EddSoftwareLicenseManager\Edd\Models\LicenseStatus;
8-
use Dwnload\WpSettingsApi\Api\Options;
98
use function in_array;
109
use function sanitize_text_field;
1110
use function strtotime;
@@ -48,19 +47,25 @@ public static function getLicenseExpires(string $plugin_id): string
4847
}
4948

5049
/**
51-
* Get the current plugin's license status.
50+
* Get the current plugin's license key.
5251
* @param string $plugin_id The plugin slug.
5352
* @return string
5453
*/
55-
public static function getLicenseStatus(string $plugin_id): string
54+
public static function getLicenseKey(string $plugin_id): string
5655
{
5756
$data = self::getLicenseData();
58-
return sanitize_text_field($data[$plugin_id]['status'] ?? LicenseStatus::LICENSE_INACTIVE);
57+
return sanitize_text_field($data[$plugin_id]['license'] ?? '');
5958
}
6059

61-
public static function getLicenseKey(string $plugin_id, string $section_id): string
60+
/**
61+
* Get the current plugin's license status.
62+
* @param string $plugin_id The plugin slug.
63+
* @return string
64+
*/
65+
public static function getLicenseStatus(string $plugin_id): string
6266
{
63-
return sanitize_text_field(Options::getOption($plugin_id, $section_id));
67+
$data = self::getLicenseData();
68+
return sanitize_text_field($data[$plugin_id]['status'] ?? LicenseStatus::LICENSE_INACTIVE);
6469
}
6570

6671
/**

0 commit comments

Comments
 (0)