Changeset 3198104
- Timestamp:
- 11/27/2024 11:34:44 AM (4 months ago)
- Location:
- mailgun/trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
mailgun/trunk/CHANGELOG.md
r3190612 r3198104 1 1 Changelog 2 2 ========= 3 4 2.1.3 (2024-11-27) 5 - Use password type for API Key field for hide it. Fix warning related co compact() method 3 6 4 7 2.1.2 (2024-11-17) -
mailgun/trunk/includes/admin.php
r3126570 r3198104 119 119 if (current_user_can('manage_options')) { 120 120 $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']); 122 122 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']); 127 127 } 128 128 } … … 146 146 { 147 147 ?> 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"> 149 149 <script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script> 150 150 <script type="text/javascript"> … … 261 261 public function register_settings(): void 262 262 { 263 register_setting('mailgun', 'mailgun', array(&$this, 'validation'));263 register_setting('mailgun', 'mailgun', [&$this, 'validation']); 264 264 } 265 265 … … 338 338 $apiActiveNotConfigured = ($this->get_option('useAPI') === '1' && ($apiRegionUndefined || $apiKeyUndefined)); 339 339 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)) { ?> 341 341 <div id='mailgun-warning' class='notice notice-warning is-dismissible'> 342 342 <p> … … 350 350 </p> 351 351 </div> 352 <?php $_SESSION['settings_turned_of'] = true; ?>352 <?php $_SESSION['settings_turned_of'] = true; ?> 353 353 <?php } ?> 354 354 … … 404 404 if (!current_user_can('manage_options') || !wp_verify_nonce(sanitize_text_field($_GET['_wpnonce']))) { 405 405 die( 406 json_encode(array(407 408 409 410 ), JSON_THROW_ON_ERROR)406 json_encode([ 407 'message' => __('Unauthorized', 'mailgun'), 408 'method' => null, 409 'error' => __('Unauthorized', 'mailgun'), 410 ], JSON_THROW_ON_ERROR) 411 411 ); 412 412 } … … 441 441 if (!$admin_email) { 442 442 die( 443 json_encode(array(444 445 446 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) 448 448 ); 449 449 } … … 483 483 484 484 // 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')) { 486 486 $error_msg = sprintf( 487 487 "Administration Email Address (%s) is not valid and can't be used for test, you can change it at General Setting page", … … 492 492 if ($result) { 493 493 die( 494 json_encode(array(495 496 497 498 ), JSON_THROW_ON_ERROR)494 json_encode([ 495 'message' => __('Success', 'mailgun'), 496 'method' => $method, 497 'error' => __('Success', 'mailgun'), 498 ], JSON_THROW_ON_ERROR) 499 499 ); 500 500 } … … 503 503 $error_msg = $error_msg ?: "Can't connect to Mailgun"; 504 504 die( 505 json_encode(array(506 507 508 509 ), JSON_THROW_ON_ERROR)505 json_encode([ 506 'message' => __('Failure', 'mailgun'), 507 'method' => $method, 508 'error' => $error_msg, 509 ], JSON_THROW_ON_ERROR) 510 510 ); 511 511 } -
mailgun/trunk/includes/mg-filter.php
r3040805 r3198104 138 138 $mg_override_from = $mg_opts['override-from'] ?? null; 139 139 $mg_from_addr = $mg_opts['from-address'] ?? null; 140 141 $from_addr = null;142 140 143 141 if ($mg_override_from && !is_null($mg_from_addr)) { … … 224 222 if (false !== stripos($header, 'boundary=')) { 225 223 $parts = preg_split('/boundary=/i', trim($header)); 226 $boundary = trim(str_replace( array('"', '\''), '', $parts[1]));224 $boundary = trim(str_replace(['"', '\''], '', $parts[1])); 227 225 } 228 226 $value .= $header; … … 272 270 foreach ($headers as $name => $values) { 273 271 $header_string .= sprintf("%s: ", $name); 274 $header_values = array();272 $header_values = []; 275 273 276 274 foreach ($values as $content) { -
mailgun/trunk/includes/options-page.php
r3126570 r3198104 77 77 wp_kses( 78 78 __('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 ] 84 84 ), esc_url($url), '_blank' 85 85 ); … … 94 94 wp_kses( 95 95 __('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 ] 101 101 ), esc_url($url), '_blank' 102 102 ); … … 173 173 </th> 174 174 <td> 175 <input type=" text" class="regular-text" name="mailgun[apiKey]"175 <input type="password" class="regular-text" name="mailgun[apiKey]" 176 176 value="<?php esc_attr_e($mailgun_api_key); ?>" 177 177 placeholder="key-3ax6xnjp29jd6fds4gc373sgvjxteol0" … … 452 452 wp_kses( 453 453 __('<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 ] 458 458 ), esc_url($url) 459 459 ); -
mailgun/trunk/includes/widget.php
r2968276 r3198104 30 30 __('Mailgun List Widget', 'wpb_widget_domain'), 31 31 // Widget description 32 array('description' => __('Mailgun list widget', 'wpb_widget_domain'))32 ['description' => __('Mailgun list widget', 'wpb_widget_domain')] 33 33 ); 34 34 } -
mailgun/trunk/includes/wp-mail-api.php
r3136968 r3198104 113 113 */ 114 114 if (!function_exists('wp_mail')) { 115 /** 116 * @throws \PHPMailer\PHPMailer\Exception 117 */ 115 118 function wp_mail($to, $subject, $message, $headers = '', $attachments = []) 116 119 { … … 160 163 $attachments = explode("\n", str_replace("\r\n", "\n", $attachments)); 161 164 } 165 166 $cc = []; 167 $bcc = []; 162 168 163 169 // Headers -
mailgun/trunk/includes/wp-mail-smtp.php
r3136968 r3198104 104 104 // $headers and $attachments are optional - make sure they exist 105 105 $headers = (!isset($headers)) ? '' : $headers; 106 $attachments = (!isset($attachments)) ? array(): $attachments;106 $attachments = (!isset($attachments)) ? [] : $attachments; 107 107 108 108 $mg_opts = get_option('mailgun'); … … 143 143 144 144 $from_header['value'] = sprintf('%s <%s>', $from_name, $from_addr); 145 $mg_headers['From'] = array($from_header);145 $mg_headers['From'] = [$from_header]; 146 146 147 147 // Header compaction -
mailgun/trunk/mailgun.php
r3190612 r3198104 4 4 * Plugin URI: http://wordpress.org/extend/plugins/mailgun/ 5 5 * Description: Mailgun integration for WordPress 6 * Version: 2.1. 26 * Version: 2.1.3 7 7 * Requires PHP: 7.4 8 8 * Requires at least: 4.4 -
mailgun/trunk/readme.md
r3190612 r3198104 5 5 Tags: mailgun, smtp, http, api, mail, email 6 6 Tested up to: 6.7 7 Stable tag: 2.1.2 7 Stable tag: 2.1.3 8 Requires PHP: 7.4 8 9 License: GPLv2 or later 9 10 … … 133 134 == Changelog == 134 135 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 135 139 = 2.1.2 (2024-11-17): = 136 140 - Fixed code. Removed line that try to connect not existing file. Fixed versions in the plugin -
mailgun/trunk/readme.txt
r3190612 r3198104 5 5 Tags: mailgun, smtp, http, api, mail, email 6 6 Tested up to: 6.7 7 Stable tag: 2.1.2 7 Stable tag: 2.1.3 8 Requires PHP: 7.4 8 9 License: GPLv2 or later 9 10 … … 129 130 == Changelog == 130 131 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 131 135 = 2.1.2 (2024-11-17): = 132 136 - 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.