diff --git a/CHANGELOG.md b/CHANGELOG.md index 694d0a7..2b3caff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ ## 2024-09-25 4.8.6 -* replacing the file_get_content() method with wp_remote_get() +* replacing the file_get_content() method with wp_remote_get() in url validator for download crm's domains ## 2024-09-20 4.8.5 * Project testing has been updated diff --git a/src/include/validators/url-validator/class-wc-retailcrm-url-constraint.php b/src/include/validators/url-validator/class-wc-retailcrm-url-constraint.php index ef9adab..bb16fef 100644 --- a/src/include/validators/url-validator/class-wc-retailcrm-url-constraint.php +++ b/src/include/validators/url-validator/class-wc-retailcrm-url-constraint.php @@ -62,6 +62,6 @@ if (!class_exists('WC_Retailcrm_Url_Constraint')) : /** * @var string */ - public $getFileError = 'Unable to obtain reference values.'; + public $getFileError = 'Bad Request. File not getted'; } endif; diff --git a/src/include/validators/url-validator/class-wc-retailcrm-url-validator.php b/src/include/validators/url-validator/class-wc-retailcrm-url-validator.php index 2954eab..7549774 100644 --- a/src/include/validators/url-validator/class-wc-retailcrm-url-validator.php +++ b/src/include/validators/url-validator/class-wc-retailcrm-url-validator.php @@ -171,13 +171,12 @@ if (!class_exists('WC_Retailcrm_Url_Validator')) : { try { $content = wp_remote_get($domainUrl); - + if (!$content instanceof WP_ERROR && $content['response']['code'] === 200) { $domains = json_decode($content['body'], true); return array_column($domains['domains'], 'domain'); - } else { - return self::CRM_ALL_DOMAINS; } + return self::CRM_ALL_DOMAINS; } catch (Exception $exception) { throw new ValidatorException($this->getFileError); } diff --git a/src/readme.txt b/src/readme.txt index 4bf8dba..292263a 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -5,7 +5,7 @@ Tags: Интеграция, Simla.com, simla Requires PHP: 7.1 Requires at least: 5.3 Tested up to: 6.5 -Stable tag: 4.8.5 +Stable tag: 4.8.6 License: GPLv1 or later License URI: http://www.gnu.org/licenses/gpl-1.0.html @@ -83,7 +83,7 @@ Asegúrate de tener una clave API específica para cada tienda. Las siguientes i == Changelog == = 4.8.6 = -* replacing the file_get_content() method with wp_remote_get() +* replacing the file_get_content() method with wp_remote_get() in url validator for download crm's domains = 4.8.5 = * Project testing has been updated