diff --git a/includes/admin.php b/includes/admin.php index 8e4c047..fa79c9b 100755 --- a/includes/admin.php +++ b/includes/admin.php @@ -29,7 +29,7 @@ class MailgunAdmin extends Mailgun { /** * @var array */ - protected array $options = array(); + protected array $options = []; /** * @var string $hook_suffix diff --git a/includes/mg-filter.php b/includes/mg-filter.php index fdf216b..b63283e 100755 --- a/includes/mg-filter.php +++ b/includes/mg-filter.php @@ -162,7 +162,7 @@ function mg_detect_from_address( $from_addr_header = null ): string { 'wp_mail_from', $from_addr ); - if ( ! is_null($filter_from_addr) || ! empty($filter_from_addr)) { + if (!is_null($filter_from_addr)) { $from_addr = $filter_from_addr; } } @@ -193,9 +193,9 @@ function mg_detect_from_address( $from_addr_header = null ): string { * * @since 1.5.8 */ -function mg_parse_headers( $headers = array() ): array { +function mg_parse_headers( $headers = []): array { if (empty($headers)) { - return array(); + return []; } if ( ! is_array($headers)) { @@ -204,7 +204,7 @@ function mg_parse_headers( $headers = array() ): array { $tmp = $headers; } - $new_headers = array(); + $new_headers = []; if ( ! empty($tmp)) { $name = null; $value = null; @@ -232,7 +232,7 @@ function mg_parse_headers( $headers = array() ): array { $value = trim($value); if ( ! isset($new_headers[ $name ])) { - $new_headers[ $name ] = array(); + $new_headers[ $name ] = []; } $new_headers[ $name ][] = array( @@ -264,7 +264,7 @@ function mg_dump_headers( array $headers = null ): string { $header_string = ''; foreach ($headers as $name => $values) { $header_string .= sprintf('%s: ', $name); - $header_values = array(); + $header_values = []; foreach ($values as $content) { // XXX - Is it actually okay to discard `parts` and `boundary`? diff --git a/includes/wp-mail-api.php b/includes/wp-mail-api.php index 2d910a1..eefce07 100644 --- a/includes/wp-mail-api.php +++ b/includes/wp-mail-api.php @@ -71,7 +71,7 @@ function mg_mutate_to_rcpt_vars_cb( $to_addrs ): array { } if (has_filter('mg_use_recipient_vars_syntax')) { - $rcpt_vars = array(); + $rcpt_vars = []; $use_rcpt_vars = apply_filters('mg_use_recipient_vars_syntax', null); if ($use_rcpt_vars) { @@ -122,7 +122,7 @@ function mg_mutate_to_rcpt_vars_cb( $to_addrs ): array { * @return bool * @throws \PHPMailer\PHPMailer\Exception */ - function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) { + function wp_mail( $to, $subject, $message, $headers = '', $attachments = []) { $mailgun = get_option('mailgun'); $region = ( defined('MAILGUN_REGION') && MAILGUN_REGION ) ? MAILGUN_REGION : $mailgun['region']; $apiKey = ( defined('MAILGUN_APIKEY') && MAILGUN_APIKEY ) ? MAILGUN_APIKEY : $mailgun['apiKey']; @@ -169,12 +169,12 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() $attachments = explode("\n", str_replace("\r\n", "\n", $attachments)); } - $cc = array(); - $bcc = array(); + $cc = []; + $bcc = []; // Headers if (empty($headers)) { - $headers = array(); + $headers = []; } else { if ( ! is_array($headers)) { // Explode the headers out, so this function can take both @@ -183,9 +183,9 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() } else { $tempheaders = $headers; } - $headers = array(); - $cc = array(); - $bcc = array(); + $headers = []; + $cc = []; + $bcc = []; // If it's actually got contents if ( ! empty($tempheaders)) { @@ -273,7 +273,7 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() $body['recipient-variables'] = $rcpt_data['rcpt_vars']; } - $body['o:tag'] = array(); + $body['o:tag'] = []; if (defined('MAILGUN_TRACK_CLICKS')) { $trackClicks = MAILGUN_TRACK_CLICKS; } else { diff --git a/mailgun.php b/mailgun.php index 6bc65b4..29cd231 100755 --- a/mailgun.php +++ b/mailgun.php @@ -3,9 +3,9 @@ * Plugin Name: Mailgun * Plugin URI: http://wordpress.org/extend/plugins/mailgun/ * Description: Mailgun integration for WordPress - * Version: 2.1.9 + * Version: 2.1.10 * Requires PHP: 7.4 - * Requires at least: 4.4 + * Requires at least: 5.6 * Author: Mailgun * Author URI: http://www.mailgun.com/ * License: GPLv2 or later @@ -213,7 +213,7 @@ public function deactivate_and_die( $file ): void { * * @return string */ - public function api_call( string $uri, array $params = array(), string $method = 'POST' ): string { + public function api_call( string $uri, array $params = [], string $method = 'POST' ): string { $options = get_option( 'mailgun' ); $getRegion = ( defined( 'MAILGUN_REGION' ) && MAILGUN_REGION ) ? MAILGUN_REGION : $options['region']; $apiKey = ( defined( 'MAILGUN_APIKEY' ) && MAILGUN_APIKEY ) ? MAILGUN_APIKEY : $options['apiKey']; @@ -369,7 +369,7 @@ public function add_list(): void { * @param array $args widget arguments * @throws JsonException */ - public function list_form( string $list_address, array $args = array() ): void { + public function list_form( string $list_address, array $args = []): void { $widgetId = $args['widget_id'] ?? 0; $widget_class_id = "mailgun-list-widget-{$widgetId}"; $form_class_id = "list-form-{$widgetId}"; diff --git a/readme.md b/readme.md index 78c0a5b..4e2e873 100755 --- a/readme.md +++ b/readme.md @@ -4,7 +4,7 @@ Mailgun for WordPress Contributors: mailgun, sivel, lookahead.io, m35dev, alanfuller Tags: mailgun, smtp, http, api, mail, email Tested up to: 6.8.1 -Stable tag: 2.1.9 +Stable tag: 2.1.10 Requires PHP: 7.4 License: GPLv2 or later diff --git a/readme.txt b/readme.txt index 1c12f27..3dcccf6 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Mailgun for WordPress Contributors: mailgun, sivel, lookahead.io, m35dev, alanfuller Tags: mailgun, smtp, http, api, mail, email Tested up to: 6.8.1 -Stable tag: 2.1.9 +Stable tag: 2.1.10 Requires PHP: 7.4 License: GPLv2 or later