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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
=========

2.1.6 (2025-03-24)
- Added translation for the widget

2.1.3 (2024-11-27)
- Use password type for API Key field for hide it. Fix warning related co compact() method

Expand Down
70 changes: 35 additions & 35 deletions includes/options-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@
$link = sprintf(
wp_kses(
__('A <a href="%1$s" target="%2$s">Mailgun</a> account is required to use this plugin and the Mailgun service.', 'mailgun'),
array(
'a' => array(
'href' => array(),
'target' => array(),
),
)
[
'a' => [
'href' => [],
'target' => [],
],
]
),
esc_url($url),
'_blank'
Expand All @@ -97,12 +97,12 @@
$link = sprintf(
wp_kses(
__('If you need to register for an account, you can do so at <a href="%1$s" target="%2$s">Mailgun.com</a>.', 'mailgun'),
array(
'a' => array(
'href' => array(),
'target' => array(),
),
)
[
'a' => [
'href' => [],
'target' => [],
],
]
),
esc_url($url),
'_blank'
Expand Down Expand Up @@ -282,12 +282,12 @@
$link = __('If enabled, Mailgun will track links. <a href="https://documentation.mailgun.com/en/latest/user_manual.html#tracking-clicks" target="_blank">Open Tracking Documentation</a>.', 'mailgun');
echo wp_kses(
$link,
array(
'a' => array(
'href' => array(),
'target' => array(),
),
)
[
'a' => [
'href' => [],
'target' => [],
],
]
);
?>
</p>
Expand All @@ -306,12 +306,12 @@
<?php
echo wp_kses(
__('If enabled, HTML messages will include an open tracking beacon. <a href="https://documentation.mailgun.com/en/latest/user_manual.html#tracking-opens" target="_blank">Open Tracking Documentation</a>.', 'mailgun'),
array(
'a' => array(
'href' => array(),
'target' => array(),
),
)
[
'a' => [
'href' => [],
'target' => [],
],
]
);
?>
</p>
Expand Down Expand Up @@ -405,12 +405,12 @@ class="regular-text"

echo wp_kses(
__('<a href="https://documentation.mailgun.com/en/latest/user_manual.html#tracking-messages" target="_blank">Tracking</a> and <a href="https://documentation.mailgun.com/en/latest/user_manual.html#tagging" target="_blank">Tagging</a>', 'mailgun'),
array(
'a' => array(
'href' => array(),
'target' => array(),
),
)
[
'a' => [
'href' => [],
'target' => [],
],
]
);
?>
</p>
Expand Down Expand Up @@ -462,11 +462,11 @@ class="regular-text"
$link = sprintf(
wp_kses(
__('<a href="%1$s" target="%2$s">View available lists</a>.', 'mailgun'),
array(
'a' => array(
'href' => array(),
),
)
[
'a' => [
'href' => [],
],
]
),
esc_url($url)
);
Expand Down
16 changes: 16 additions & 0 deletions languages/mailgun-ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,19 @@ msgstr ""
#: includes/options-page.php:74
msgid "Save Changes"
msgstr "Desar els canvis"

#: includes/widget.php:84
msgid "Title (optional):"
msgstr "Titre (optionnel):"

#: includes/widget.php:88
msgid "Description (optional):"
msgstr "Description (optionnelle):"

#: includes/widget.php:92
msgid "List addresses (required):"
msgstr "Lister les adresses (obligatoire):"

#: includes/widget.php:96
msgid "Collect name:"
msgstr "Collecter le nom:"
16 changes: 16 additions & 0 deletions languages/mailgun-de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,19 @@ msgstr "Antwortadresse"

msgid "Suppress Click Track for password reset email"
msgstr "Klick-Tracking für Passwort-Reset-Email unterdrücken"

#: includes/widget.php:84
msgid "Title (optional):"
msgstr "Titel (optional):"

#: includes/widget.php:88
msgid "Description (optional):"
msgstr "Beschreibung (optional):"

#: includes/widget.php:92
msgid "List addresses (required):"
msgstr "Adressen auflisten (erforderlich):"

#: includes/widget.php:96
msgid "Collect name:"
msgstr "Namen erfassen:"
16 changes: 16 additions & 0 deletions languages/mailgun-es_ES.po
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,19 @@ msgstr "dirección de respuesta"

msgid "Suppress Click Track for password reset email"
msgstr "Suprimir seguimiento de clics para el email de restablecimiento de contraseña"

#: includes/widget.php:84
msgid "Title (optional):"
msgstr "Título (opcional):"

#: includes/widget.php:88
msgid "Description (optional):"
msgstr "Descripción (opcional):"

#: includes/widget.php:92
msgid "List addresses (required):"
msgstr "Listar direcciones (obligatorio):"

#: includes/widget.php:96
msgid "Collect name:"
msgstr "Recopilar nombre:"
30 changes: 15 additions & 15 deletions mailgun.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Mailgun
* Plugin URI: http://wordpress.org/extend/plugins/mailgun/
* Description: Mailgun integration for WordPress
* Version: 2.1.6
* Version: 2.1.7
* Requires PHP: 7.4
* Requires at least: 4.4
* Author: Mailgun
Expand Down Expand Up @@ -227,9 +227,9 @@ public function api_call( string $uri, array $params = array(), string $method =

$time = time();
$url = $this->api_endpoint . $uri;
$headers = array(
$headers = [
'Authorization' => 'Basic ' . base64_encode( "api:{$apiKey}" ),
);
];

switch ( $method ) {
case 'GET':
Expand All @@ -248,12 +248,12 @@ public function api_call( string $uri, array $params = array(), string $method =
}

// make the request
$args = array(
$args = [
'method' => $method,
'body' => $params,
'headers' => $headers,
'sslverify' => true,
);
];

// make the remote request
$result = wp_remote_request( $url, $args );
Expand Down Expand Up @@ -282,9 +282,9 @@ public function api_call( string $uri, array $params = array(), string $method =
* @throws JsonException
*/
public function get_lists(): array {
$results = array();
$results = [];

$lists_json = $this->api_call( 'lists', array(), 'GET' );
$lists_json = $this->api_call( 'lists', [], 'GET' );

$lists_arr = json_decode( $lists_json, true, 512, JSON_THROW_ON_ERROR );
if ( isset( $lists_arr['items'] ) && ! empty( $lists_arr['items'] ) ) {
Expand All @@ -304,20 +304,20 @@ public function get_lists(): array {
public function add_list(): void {
$name = sanitize_text_field( $_POST['name'] ?? null );
$email = sanitize_text_field( $_POST['email'] ?? null );
$list_addresses = array();
$list_addresses = [];
foreach ( $_POST['addresses'] as $address => $val ) {
$list_addresses[ sanitize_text_field( $address ) ] = sanitize_text_field( $val );
}

if ( ! empty( $list_addresses ) ) {
$result = array();
$result = [];
foreach ( $list_addresses as $address => $val ) {
$result[] = $this->api_call(
"lists/{$address}/members",
array(
[
'address' => $email,
'name' => $name,
)
]
);
}
$message = 'Thank you!';
Expand All @@ -329,18 +329,18 @@ public function add_list(): void {
}
}
echo json_encode(
array(
[
'status' => 200,
'message' => $message,
),
],
JSON_THROW_ON_ERROR
);
} else {
echo json_encode(
array(
[
'status' => 500,
'message' => 'Uh oh. We weren\'t able to add you to the list' . count( $list_addresses ) ? 's.' : '. Please try again.',
),
],
JSON_THROW_ON_ERROR
);
}
Expand Down
5 changes: 4 additions & 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.7.2
Stable tag: 2.1.6
Stable tag: 2.1.7
Requires PHP: 7.4
License: GPLv2 or later

Expand Down Expand Up @@ -133,6 +133,9 @@ MAILGUN_REPLY_TO_ADDRESS Type: string

== Changelog ==

= 2.1.6 (2025-03-24): =
- Added translation for the widget

= 2.1.6 (2025-03-07): =
- Fixed bug with sending test emails (JS error). Basically it's 2.1.5. Just version updates

Expand Down
5 changes: 4 additions & 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.7.2
Stable tag: 2.1.6
Stable tag: 2.1.7
Requires PHP: 7.4
License: GPLv2 or later

Expand Down Expand Up @@ -129,6 +129,9 @@ MAILGUN_TRACK_OPENS Type: string Choices: 'yes' or 'no'

== Changelog ==

= 2.1.6 (2025-03-24): =
- Added translation for the widget

= 2.1.6 (2025-03-07): =
- Fixed bug with sending test emails (JS error). Basically it's 2.1.5. Just version updates

Expand Down
Loading