Plugin Directory

Changeset 3146083


Ignore:
Timestamp:
09/03/2024 04:44:26 PM (18 months ago)
Author:
dashamail
Message:

Update to v.1.0.6

Location:
dashamail
Files:
21 added
3 edited

Legend:

Unmodified
Added
Removed
  • dashamail/trunk/README.txt

    r3102708 r3146083  
    55Tags: email, subsciption, dashamail, mail, dasha
    66Requires at least: 6.2.2
    7 Tested up to: 6.4.3
     7Tested up to: 6.6.1
    88Requires PHP: 7.4
    9 Stable tag: 1.0.5
     9Stable tag: 1.0.6
    1010License: GPLv2 or later
    1111License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4646
    4747== Changelog ==
     48= 1.0.6 - 2024-09-03 =
     49Оптимизированы запросы к API Dashamail
     50
    4851= 1.0.5 - 2024-06-14 =
    4952Исправлена проблема подключения дополнительных скриптов
  • dashamail/trunk/dashamail.php

    r3102708 r3146083  
    33 * Plugin Name:       DashaMail
    44 * Description:       Плагин интеграции с DashaMail
    5  * Version:           1.0.5
     5 * Version:           1.0.6
    66 * Requires at least: 6.2.2
    77 * Requires PHP:      7.4
  • dashamail/trunk/dshm_app/Infrastructure/dshm_SettingsPage.php

    r3037701 r3146083  
    6060    public function __construct() {
    6161        $apiKey = \get_option('dashamail_api_key');
    62         $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($apiKey);
     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        }
    6367    }
    6468
     
    157161    function dshm_TemplateApiKey( $args ){
    158162        $value = \get_option( $args[ 'name' ] );
    159         $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($value);
     163        if (!$this->isApiKeyCorrect) {
     164            $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($value);
     165        }
    160166        $isApiKeyCorrect = $this->isApiKeyCorrect?'valid':'invalid';
    161167
     
    188194
    189195        $apiKey = \get_option('dashamail_api_key');
    190         $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($apiKey);
     196        if (!$this->isApiKeyCorrect) {
     197            $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($apiKey);
     198        }
    191199
    192200        $lists[] = ['name' => '-', 'id' => '0'];
     
    276284
    277285    public function dshm_DashamailValidateAPI($input){
    278         if (!dshm_DashaMailAPI::dshm_isApiKeyCorrect($input)) {
     286        if (!$this->isApiKeyCorrect) {
     287            $this->isApiKeyCorrect = dshm_DashaMailAPI::dshm_isApiKeyCorrect($input);
     288        }
     289        if (!$this->isApiKeyCorrect) {
    279290            \add_settings_error(
    280291                self::$DSHM_ERROR_SLUG,
Note: See TracChangeset for help on using the changeset viewer.