Changeset 3146091
- Timestamp:
- 09/03/2024 05:07:14 PM (18 months ago)
- Location:
- dashamail/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (1 diff)
-
dashamail.php (modified) (1 diff)
-
dshm_app/Infrastructure/dshm_SettingsPage.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dashamail/trunk/README.txt
r3146083 r3146091 7 7 Tested up to: 6.6.1 8 8 Requires PHP: 7.4 9 Stable tag: 1.0. 69 Stable tag: 1.0.5 10 10 License: GPLv2 or later 11 11 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
dashamail/trunk/dashamail.php
r3146083 r3146091 3 3 * Plugin Name: DashaMail 4 4 * Description: Плагин интеграции с DashaMail 5 * Version: 1.0. 65 * Version: 1.0.5 6 6 * Requires at least: 6.2.2 7 7 * Requires PHP: 7.4 -
dashamail/trunk/dshm_app/Infrastructure/dshm_SettingsPage.php
r3146083 r3146091 60 60 public function __construct() { 61 61 $apiKey = \get_option('dashamail_api_key'); 62 63 $url = ((!empty($_SERVER['HTTPS'])) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 64 if (str_contains($url, 'wp-admin') && str_contains($url, 'dashamail_settings')) { 65 $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($apiKey); 66 } 62 $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($apiKey); 67 63 } 68 64 … … 161 157 function dshm_TemplateApiKey( $args ){ 162 158 $value = \get_option( $args[ 'name' ] ); 163 if (!$this->isApiKeyCorrect) { 164 $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($value); 165 } 159 $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($value); 166 160 $isApiKeyCorrect = $this->isApiKeyCorrect?'valid':'invalid'; 167 161 … … 194 188 195 189 $apiKey = \get_option('dashamail_api_key'); 196 if (!$this->isApiKeyCorrect) { 197 $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($apiKey); 198 } 190 $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($apiKey); 199 191 200 192 $lists[] = ['name' => '-', 'id' => '0']; … … 284 276 285 277 public function dshm_DashamailValidateAPI($input){ 286 if (!$this->isApiKeyCorrect) { 287 $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($input); 288 } 289 if (!$this->isApiKeyCorrect) { 278 if (!dshm_DashaMailAPI::dshm_isApiKeyCorrect($input)) { 290 279 \add_settings_error( 291 280 self::$DSHM_ERROR_SLUG,
Note: See TracChangeset
for help on using the changeset viewer.