Changeset 3224019
- Timestamp:
- 01/17/2025 08:28:40 AM (14 months ago)
- Location:
- dashamail
- Files:
-
- 21 added
- 5 edited
-
tags/1.0.9 (added)
-
tags/1.0.9/README.txt (added)
-
tags/1.0.9/assets (added)
-
tags/1.0.9/assets/css (added)
-
tags/1.0.9/assets/css/style.css (added)
-
tags/1.0.9/assets/img (added)
-
tags/1.0.9/assets/img/logo.png (added)
-
tags/1.0.9/assets/img/logo_big.png (added)
-
tags/1.0.9/assets/img/logo_dasha.png (added)
-
tags/1.0.9/assets/js (added)
-
tags/1.0.9/assets/js/script.js (added)
-
tags/1.0.9/assets/screenshot-1.png (added)
-
tags/1.0.9/assets/screenshot-2.png (added)
-
tags/1.0.9/assets/screenshot-3.png (added)
-
tags/1.0.9/dashamail.php (added)
-
tags/1.0.9/dshm_app (added)
-
tags/1.0.9/dshm_app/Infrastructure (added)
-
tags/1.0.9/dshm_app/Infrastructure/dshm_DashaMailAPI.php (added)
-
tags/1.0.9/dshm_app/Infrastructure/dshm_PluginActivator.php (added)
-
tags/1.0.9/dshm_app/Infrastructure/dshm_SettingsPage.php (added)
-
tags/1.0.9/dshm_app/Infrastructure/dshm_WordPressFacade.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/dashamail.php (modified) (1 diff)
-
trunk/dshm_app/Infrastructure/dshm_DashaMailAPI.php (modified) (3 diffs)
-
trunk/dshm_app/Infrastructure/dshm_PluginActivator.php (modified) (1 diff)
-
trunk/dshm_app/Infrastructure/dshm_SettingsPage.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dashamail/trunk/README.txt
r3146503 r3224019 5 5 Tags: email, subsciption, dashamail, mail, dasha 6 6 Requires at least: 6.2.2 7 Tested up to: 6. 6.17 Tested up to: 6.7.1 8 8 Requires PHP: 7.4 9 Stable tag: 1.0. 89 Stable tag: 1.0.9 10 10 License: GPLv2 or later 11 11 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 46 46 47 47 == Changelog == 48 = 1.0.9 - 2025-01-17 = 49 FIX Увеличено время выполнения закпроса к API Dashamail 50 48 51 = 1.0.8 - 2024-09-04 = 49 52 FIX Оптимизированы запросы к API Dashamail -
dashamail/trunk/dashamail.php
r3146503 r3224019 3 3 * Plugin Name: DashaMail 4 4 * Description: Плагин интеграции с DashaMail 5 * Version: 1.0. 85 * Version: 1.0.9 6 6 * Requires at least: 6.2.2 7 7 * Requires PHP: 7.4 -
dashamail/trunk/dshm_app/Infrastructure/dshm_DashaMailAPI.php
r3037701 r3224019 22 22 { 23 23 $url = self::dshm_getURL('lists.get', $apiKey, $param); 24 25 $response = \wp_remote_get($url); 26 24 $response = \wp_remote_get($url, ['timeout' => 30]); 25 27 26 if (!is_wp_error($response) && is_array($response) && isset($response['body'])){ 28 27 $json = json_decode($response['body'], true); … … 33 32 } 34 33 35 public static function dshm_isApiKeyCorrect($apiKey):bool 36 { 37 if (empty($apiKey) || $apiKey === false){ 38 return false; 39 } 40 34 public static function dshm_getBalanceAccount($apiKey): ?array 35 { 36 $url = self::dshm_getURL('account.get_balance', $apiKey); 37 $response = \wp_remote_get($url, ['timeout' => 30]); 38 39 if (!is_wp_error($response) && is_array($response) && isset($response['body'])){ 40 $json = json_decode($response['body'], true); 41 return $json['response']; 42 } 43 44 return null; 45 } 46 47 public static function dshm_isApiKeyCorrect($apiKey): bool 48 { 49 if (empty($apiKey) || $apiKey === false) return false; 50 51 $response = self::dshm_getBalanceAccount($apiKey); 52 53 if (!$response || !isset($response['msg']) || !isset($response['msg']['err_code'])) 54 return false; 55 56 return $response['msg']['err_code'] === 0; 57 } 58 59 public static function dshm_getDashaMailLists(string $apiKey):array 60 { 41 61 $response = self::dshm_getResponseDashaMailLists($apiKey); 42 if ($response) { 43 return $response['msg']['err_code'] === 0; 44 } 45 46 return false; 47 } 48 49 public static function dshm_getDashaMailLists(string $apiKey):array 50 { 51 $response = self::dshm_getResponseDashaMailLists($apiKey); 52 if ($response) { 53 return $response['data']; 54 } 55 56 return false; 62 63 return ($response && isset($response['data'])) 64 ? $response['data'] 65 : []; 57 66 } 58 67 … … 65 74 $url = self::dshm_getURL('lists.add_member_batch', $apiKey, $param); 66 75 67 $response = \wp_remote_get($url );76 $response = \wp_remote_get($url, ['timeout' => 30]); 68 77 if (isset($response['body'])){ 69 78 $json = json_decode($response['body'], true); -
dashamail/trunk/dshm_app/Infrastructure/dshm_PluginActivator.php
r3037701 r3224019 112 112 { 113 113 $this->dshm_PrintShortcode($post->ID); 114 114 $html = ''; 115 115 $html .= \wp_nonce_field('save-post-'.$post->ID, 'dshm_nonce_sp', false); 116 116 -
dashamail/trunk/dshm_app/Infrastructure/dshm_SettingsPage.php
r3146503 r3224019 63 63 $url = $_POST['_wp_http_referer'] ?? $_SERVER['REQUEST_URI']; 64 64 if (!stripos($url, strval(self::$DSHM_PAGE_SLUG))) return; 65 65 66 66 $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($apiKey); 67 67 }
Note: See TracChangeset
for help on using the changeset viewer.