Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MailgunAdmin extends Mailgun {
/**
* @var array
*/
protected array $options = array();
protected array $options = [];

/**
* @var string $hook_suffix
Expand Down
12 changes: 6 additions & 6 deletions includes/mg-filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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`?
Expand Down
18 changes: 9 additions & 9 deletions includes/wp-mail-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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
Expand All @@ -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)) {
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions mailgun.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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}";
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down