Plugin Directory

Changeset 3198104


Ignore:
Timestamp:
11/27/2024 11:34:44 AM (4 months ago)
Author:
omykhailenko
Message:

Updating trunk

Location:
mailgun/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • mailgun/trunk/CHANGELOG.md

    r3190612 r3198104  
    11Changelog
    22=========
     3
     42.1.3 (2024-11-27)
     5-  Use password type for API Key field for hide it. Fix warning related co compact() method
    36
    472.1.2 (2024-11-17)
  • mailgun/trunk/includes/admin.php

    r3126570 r3198104  
    119119        if (current_user_can('manage_options')) {
    120120            $this->hook_suffix = add_options_page(__('Mailgun', 'mailgun'), __('Mailgun', 'mailgun'),
    121                 'manage_options', 'mailgun', array(&$this, 'options_page'));
     121                'manage_options', 'mailgun', [&$this, 'options_page']);
    122122            add_options_page(__('Mailgun Lists', 'mailgun'), __('Mailgun Lists', 'mailgun'), 'manage_options',
    123                 'mailgun-lists', array(&$this, 'lists_page'));
    124             add_action("admin_print_scripts-{$this->hook_suffix}", array(&$this, 'admin_js'));
    125             add_filter("plugin_action_links_{$this->plugin_basename}", array(&$this, 'filter_plugin_actions'));
    126             add_action("admin_footer-{$this->hook_suffix}", array(&$this, 'admin_footer_js'));
     123                'mailgun-lists', [&$this, 'lists_page']);
     124            add_action("admin_print_scripts-{$this->hook_suffix}", [&$this, 'admin_js']);
     125            add_filter("plugin_action_links_{$this->plugin_basename}", [&$this, 'filter_plugin_actions']);
     126            add_action("admin_footer-{$this->hook_suffix}", [&$this, 'admin_footer_js']);
    127127        }
    128128    }
     
    146146    {
    147147        ?>
    148         <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" >
     148        <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
    149149        <script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
    150150        <script type="text/javascript">
     
    261261    public function register_settings(): void
    262262    {
    263         register_setting('mailgun', 'mailgun', array(&$this, 'validation'));
     263        register_setting('mailgun', 'mailgun', [&$this, 'validation']);
    264264    }
    265265
     
    338338        $apiActiveNotConfigured = ($this->get_option('useAPI') === '1' && ($apiRegionUndefined || $apiKeyUndefined));
    339339
    340         if (isset($_SESSION) && (!isset($_SESSION['settings_turned_of']) || $_SESSION['settings_turned_of'] === false) && ($apiActiveNotConfigured || $smtpActiveNotConfigured) ) { ?>
     340        if (isset($_SESSION) && (!isset($_SESSION['settings_turned_of']) || $_SESSION['settings_turned_of'] === false) && ($apiActiveNotConfigured || $smtpActiveNotConfigured)) { ?>
    341341            <div id='mailgun-warning' class='notice notice-warning is-dismissible'>
    342342                <p>
     
    350350                </p>
    351351            </div>
    352         <?php $_SESSION['settings_turned_of'] = true; ?>
     352            <?php $_SESSION['settings_turned_of'] = true; ?>
    353353        <?php } ?>
    354354
     
    404404        if (!current_user_can('manage_options') || !wp_verify_nonce(sanitize_text_field($_GET['_wpnonce']))) {
    405405            die(
    406                 json_encode(array(
    407                     'message' => __('Unauthorized', 'mailgun'),
    408                     'method' => null,
    409                     'error' => __('Unauthorized', 'mailgun'),
    410                 ), JSON_THROW_ON_ERROR)
     406            json_encode([
     407                'message' => __('Unauthorized', 'mailgun'),
     408                'method' => null,
     409                'error' => __('Unauthorized', 'mailgun'),
     410            ], JSON_THROW_ON_ERROR)
    411411            );
    412412        }
     
    441441        if (!$admin_email) {
    442442            die(
    443                 json_encode(array(
    444                     'message' => __('Admin Email is empty', 'mailgun'),
    445                     'method' => $method,
    446                     'error' => __('Admin Email is empty', 'mailgun'),
    447                 ), JSON_THROW_ON_ERROR)
     443            json_encode([
     444                'message' => __('Admin Email is empty', 'mailgun'),
     445                'method' => $method,
     446                'error' => __('Admin Email is empty', 'mailgun'),
     447            ], JSON_THROW_ON_ERROR)
    448448            );
    449449        }
     
    483483
    484484        // Admin Email is used as 'to' parameter, but in case of 'Test Configuration' this message is not clear for the user, so replaced with more appropriate one
    485         if (false !== strpos($error_msg, "'to'") && false !== strpos($error_msg, 'is not a valid')) {
     485        if (str_contains($error_msg, "'to'") && str_contains($error_msg, 'is not a valid')) {
    486486            $error_msg = sprintf(
    487487                "Administration Email Address (%s) is not valid and can't be used for test, you can change it at General Setting page",
     
    492492        if ($result) {
    493493            die(
    494                 json_encode(array(
    495                     'message' => __('Success', 'mailgun'),
    496                     'method' => $method,
    497                     'error' => __('Success', 'mailgun'),
    498                 ), JSON_THROW_ON_ERROR)
     494            json_encode([
     495                'message' => __('Success', 'mailgun'),
     496                'method' => $method,
     497                'error' => __('Success', 'mailgun'),
     498            ], JSON_THROW_ON_ERROR)
    499499            );
    500500        }
     
    503503        $error_msg = $error_msg ?: "Can't connect to Mailgun";
    504504        die(
    505             json_encode(array(
    506                 'message' => __('Failure', 'mailgun'),
    507                 'method' => $method,
    508                 'error' => $error_msg,
    509             ), JSON_THROW_ON_ERROR)
     505        json_encode([
     506            'message' => __('Failure', 'mailgun'),
     507            'method' => $method,
     508            'error' => $error_msg,
     509        ], JSON_THROW_ON_ERROR)
    510510        );
    511511    }
  • mailgun/trunk/includes/mg-filter.php

    r3040805 r3198104  
    138138    $mg_override_from = $mg_opts['override-from'] ?? null;
    139139    $mg_from_addr = $mg_opts['from-address'] ?? null;
    140 
    141     $from_addr = null;
    142140
    143141    if ($mg_override_from && !is_null($mg_from_addr)) {
     
    224222                if (false !== stripos($header, 'boundary=')) {
    225223                    $parts = preg_split('/boundary=/i', trim($header));
    226                     $boundary = trim(str_replace(array('"', '\''), '', $parts[1]));
     224                    $boundary = trim(str_replace(['"', '\''], '', $parts[1]));
    227225                }
    228226                $value .= $header;
     
    272270    foreach ($headers as $name => $values) {
    273271        $header_string .= sprintf("%s: ", $name);
    274         $header_values = array();
     272        $header_values = [];
    275273
    276274        foreach ($values as $content) {
  • mailgun/trunk/includes/options-page.php

    r3126570 r3198104  
    7777            wp_kses(
    7878                __('A <a href="%1$s" target="%2$s">Mailgun</a> account is required to use this plugin and the Mailgun service.', 'mailgun'),
    79                 array('a' => array(
    80                     'href' => array(),
    81                     'target' => array()
    82                 )
    83                 )
     79                ['a' => [
     80                    'href' => [],
     81                    'target' => []
     82                ]
     83                ]
    8484            ), esc_url($url), '_blank'
    8585        );
     
    9494            wp_kses(
    9595                __('If you need to register for an account, you can do so at <a href="%1$s" target="%2$s">Mailgun.com</a>.', 'mailgun'),
    96                 array('a' => array(
    97                     'href' => array(),
    98                     'target' => array()
    99                 )
    100                 )
     96                ['a' => [
     97                    'href' => [],
     98                    'target' => []
     99                ]
     100                ]
    101101            ), esc_url($url), '_blank'
    102102        );
     
    173173                </th>
    174174                <td>
    175                     <input type="text" class="regular-text" name="mailgun[apiKey]"
     175                    <input type="password" class="regular-text" name="mailgun[apiKey]"
    176176                           value="<?php esc_attr_e($mailgun_api_key); ?>"
    177177                           placeholder="key-3ax6xnjp29jd6fds4gc373sgvjxteol0"
     
    452452                        wp_kses(
    453453                            __('<a href="%1$s" target="%2$s">View available lists</a>.', 'mailgun'),
    454                             array('a' => array(
    455                                 'href' => array(),
    456                             )
    457                             )
     454                            ['a' => [
     455                                'href' => [],
     456                            ]
     457                            ]
    458458                        ), esc_url($url)
    459459                    );
  • mailgun/trunk/includes/widget.php

    r2968276 r3198104  
    3030            __('Mailgun List Widget', 'wpb_widget_domain'),
    3131            // Widget description
    32             array('description' => __('Mailgun list widget', 'wpb_widget_domain'))
     32            ['description' => __('Mailgun list widget', 'wpb_widget_domain')]
    3333        );
    3434    }
  • mailgun/trunk/includes/wp-mail-api.php

    r3136968 r3198104  
    113113 */
    114114if (!function_exists('wp_mail')) {
     115    /**
     116     * @throws \PHPMailer\PHPMailer\Exception
     117     */
    115118    function wp_mail($to, $subject, $message, $headers = '', $attachments = [])
    116119    {
     
    160163            $attachments = explode("\n", str_replace("\r\n", "\n", $attachments));
    161164        }
     165
     166        $cc = [];
     167        $bcc = [];
    162168
    163169        // Headers
  • mailgun/trunk/includes/wp-mail-smtp.php

    r3136968 r3198104  
    104104    // $headers and $attachments are optional - make sure they exist
    105105    $headers = (!isset($headers)) ? '' : $headers;
    106     $attachments = (!isset($attachments)) ? array() : $attachments;
     106    $attachments = (!isset($attachments)) ? [] : $attachments;
    107107
    108108    $mg_opts = get_option('mailgun');
     
    143143
    144144    $from_header['value'] = sprintf('%s <%s>', $from_name, $from_addr);
    145     $mg_headers['From'] = array($from_header);
     145    $mg_headers['From'] = [$from_header];
    146146
    147147    // Header compaction
  • mailgun/trunk/mailgun.php

    r3190612 r3198104  
    44 * Plugin URI:   http://wordpress.org/extend/plugins/mailgun/
    55 * Description:  Mailgun integration for WordPress
    6  * Version:      2.1.2
     6 * Version:      2.1.3
    77 * Requires PHP: 7.4
    88 * Requires at least: 4.4
  • mailgun/trunk/readme.md

    r3190612 r3198104  
    55Tags: mailgun, smtp, http, api, mail, email
    66Tested up to: 6.7
    7 Stable tag: 2.1.2
     7Stable tag: 2.1.3
     8Requires PHP: 7.4
    89License: GPLv2 or later
    910
     
    133134== Changelog ==
    134135
     136= 2.1.3 (2024-11-27): =
     137-  Use password type for API Key field for hide it. Fix warning related co compact() method
     138
    135139= 2.1.2 (2024-11-17): =
    136140- Fixed code. Removed line that try to connect not existing file. Fixed versions in the plugin
  • mailgun/trunk/readme.txt

    r3190612 r3198104  
    55Tags: mailgun, smtp, http, api, mail, email
    66Tested up to: 6.7
    7 Stable tag: 2.1.2
     7Stable tag: 2.1.3
     8Requires PHP: 7.4
    89License: GPLv2 or later
    910
     
    129130== Changelog ==
    130131
     132= 2.1.3 (2024-11-27): =
     133-  Use password type for API Key field for hide it. Fix warning related co compact() method
     134
    131135= 2.1.2 (2024-11-17): =
    132136 - Fixed code. Removed line that try to connect not existing file. Fixed versions in the plugin
Note: See TracChangeset for help on using the changeset viewer.