replacing the file_get_content method with wp_remote_get
This commit is contained in:
parent
61fcad66c5
commit
80fc22964e
6 changed files with 17 additions and 5 deletions
|
@ -1,3 +1,6 @@
|
|||
## 2024-09-25 4.8.6
|
||||
* replacing the file_get_content() method with wp_remote_get()
|
||||
|
||||
## 2024-09-20 4.8.5
|
||||
* Project testing has been updated
|
||||
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
4.8.5
|
||||
4.8.6
|
||||
|
|
|
@ -16,6 +16,7 @@ if (!class_exists('WC_Retailcrm_Url_Validator')) :
|
|||
{
|
||||
const CRM_DOMAINS_URL = 'https://infra-data.retailcrm.tech/crm-domains.json';
|
||||
const BOX_DOMAINS_URL = 'https://infra-data.retailcrm.tech/box-domains.json';
|
||||
const CRM_ALL_DOMAINS = ["ecomlogic.com", "retailcrm.ru", "retailcrm.pro", "retailcrm.es", "simla.com", "simla.io", "retailcrm.io"];
|
||||
|
||||
/**
|
||||
* @param string $crmUrl
|
||||
|
@ -169,9 +170,14 @@ if (!class_exists('WC_Retailcrm_Url_Validator')) :
|
|||
private function getValidDomains(string $domainUrl): array
|
||||
{
|
||||
try {
|
||||
$content = json_decode(file_get_contents($domainUrl), true);
|
||||
$content = wp_remote_get($domainUrl);
|
||||
|
||||
return array_column($content['domains'], 'domain');
|
||||
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;
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
throw new ValidatorException($this->getFileError);
|
||||
}
|
||||
|
|
|
@ -82,6 +82,9 @@ 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()
|
||||
|
||||
= 4.8.5 =
|
||||
* Project testing has been updated
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Description: Integration plugin for WooCommerce & Simla.com
|
||||
* Author: RetailDriver LLC
|
||||
* Author URI: http://retailcrm.pro/
|
||||
* Version: 4.8.5
|
||||
* Version: 4.8.6
|
||||
* Tested up to: 6.5
|
||||
* Requires Plugins: woocommerce
|
||||
* WC requires at least: 5.4
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @link https://wordpress.org/plugins/woo-retailcrm/
|
||||
*
|
||||
* @version 4.8.5
|
||||
* @version 4.8.6
|
||||
*
|
||||
* @package RetailCRM
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue