Plugin Directory

Changeset 3037701


Ignore:
Timestamp:
02/19/2024 07:35:10 AM (2 years ago)
Author:
dashamail
Message:

Update to v.1.0.4

Location:
dashamail
Files:
21 added
5 edited

Legend:

Unmodified
Added
Removed
  • dashamail/trunk/README.txt

    r3029241 r3037701  
    77Tested up to: 6.4.3
    88Requires PHP: 7.4
    9 Stable tag: 1.0.3
     9Stable tag: 1.0.4
    1010License: GPLv2 or later
    1111License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4646
    4747== Changelog ==
     48= 1.0.4 - 2024-02-19 =
     49Fix corner case bug: использование защитных проверочных ключей
     50
    4851= 1.0.3 - 2024-01-31 =
    4952Исправлена ошибка отсутствия ответа от API DashaMail
  • dashamail/trunk/dashamail.php

    r3029241 r3037701  
    33 * Plugin Name:       DashaMail
    44 * Description:       Плагин интеграции с DashaMail
    5  * Version:           1.0.3
     5 * Version:           1.0.4
    66 * Requires at least: 6.2.2
    77 * Requires PHP:      7.4
  • dashamail/trunk/dshm_app/Infrastructure/dshm_DashaMailAPI.php

    r3029240 r3037701  
    1919    }
    2020
    21     public static function dshm_getResponseDashaMailLists($apiKey, $param = []):array{
     21    public static function dshm_getResponseDashaMailLists($apiKey, $param = []): ?array
     22    {
    2223        $url = self::dshm_getURL('lists.get', $apiKey, $param);
    2324
    2425        $response = \wp_remote_get($url);
     26       
    2527        if (!is_wp_error($response) && is_array($response) && isset($response['body'])){
    2628            $json = json_decode($response['body'], true);
     
    2830        }
    2931
    30         return false;
     32        return null;
    3133    }
    3234
     
    136138
    137139        $responceLists = self::dshm_getResponseDashaMailLists($apiKey, ['list_id' => $list]);
     140        if (!$responceLists) {
     141            return false;
     142        }
    138143
    139144        if ($responceLists['msg']['err_code'] !== 0 || !isset($responceLists['data'][0])) {
  • dashamail/trunk/dshm_app/Infrastructure/dshm_PluginActivator.php

    r3012800 r3037701  
    113113        $this->dshm_PrintShortcode($post->ID);
    114114
     115        $html .= \wp_nonce_field('save-post-'.$post->ID, 'dshm_nonce_sp', false);
     116
    115117        $userCanDeletePost = \current_user_can("delete_post", $post->ID);
    116118        $delete_text = (!\EMPTY_TRASH_DAYS) ? 'Удалить' : 'В корзину';
     
    129131
    130132        $html .= '<div id="publishing-action">
    131                     <span class="spinner"></span>
    132                     '.\wp_nonce_field('save-post-'.$post->ID, 'dshm_nonce_sp', false).'
    133                     <input name="original_publish" type="hidden" id="original_publish" value="Сохранить" /> ' . \get_submit_button('Сохранить', 'primary large', 'publish', false) . '
    134                 </div>
     133                    <span class="spinner"></span>'
     134                    .'<input name="original_publish" type="hidden" id="original_publish" value="Сохранить" /> '
     135                    .\get_submit_button('Сохранить', 'primary large', 'publish', false)
     136                .'</div>
    135137                <div class="clear"></div>';
    136138       
     
    179181    public function dshm_SavePostMeta($postId)
    180182    {   
    181         if (!\wp_verify_nonce(\sanitize_text_field($_POST['dshm_nonce_sp']), 'save-post-'.$postId )){
     183        if (isset($_POST['dshm_nonce_sp']) && !\wp_verify_nonce(\sanitize_text_field($_POST['dshm_nonce_sp']), 'save-post-'.$postId )){
    182184            return false;
    183185        }
  • dashamail/trunk/dshm_app/Infrastructure/dshm_SettingsPage.php

    r3012800 r3037701  
    267267
    268268    function dshm_AfterSectionExportRole(){
    269         $nonce = \wp_nonce_url( $bare_url, 'dashamail_export_mass', 'dshm_nonce' );
     269        $nonce = \wp_nonce_url('', 'dashamail_export_mass', 'dshm_nonce' );
    270270        return '<br/>
    271271                <a class="button button-primary button-large" href="#" id="start_export" data-nonce="' . $nonce .'">
Note: See TracChangeset for help on using the changeset viewer.