From 970a35b66a0ba881149535eedaf3656efeabb974 Mon Sep 17 00:00:00 2001 From: Austin Passy <367897+thefrosty@users.noreply.github.com> Date: Thu, 1 Jan 2026 07:31:56 -0800 Subject: [PATCH 1/2] Add default user-agent to remote request --- src/Edd/AbstractLicenceManager.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Edd/AbstractLicenceManager.php b/src/Edd/AbstractLicenceManager.php index c95ffa0..8abdc80 100644 --- a/src/Edd/AbstractLicenceManager.php +++ b/src/Edd/AbstractLicenceManager.php @@ -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 @@ -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 @@ -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 @@ -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 @@ -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); From 3cf2acd2d4389d172c6ce8677b3fdbf6e6e0ef61 Mon Sep 17 00:00:00 2001 From: Austin Passy <367897+thefrosty@users.noreply.github.com> Date: Thu, 1 Jan 2026 08:05:54 -0800 Subject: [PATCH 2/2] Add md5 pattern attribute to input field --- src/Edd/LicenseManager.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Edd/LicenseManager.php b/src/Edd/LicenseManager.php index dcd30f3..03248ad 100644 --- a/src/Edd/LicenseManager.php +++ b/src/Edd/LicenseManager.php @@ -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, ] )