Compare commits

...
Author SHA1 Message Date
dbcc75fea7 v2.1.2 2026-11-03 17:54:40 +00:00
8 changed files with 182 additions and 137 deletions

View file

@ -1,5 +1,67 @@
== Changelog == == Changelog ==
= 2.1.2 =
_Release date: 2026-11-03_
**Highlights**
* Legacy v1 options no longer wiped on save, and WordPress 7.2 / PHP 8.6 compatibility declared and verified.
**Fixed**
* Legacy v1.0.x Reply-To options (wp_mail_replyto_email, wp_mail_replyto_name) were emptied on every settings save, destroying the rollback/migration fallback values; on PHP 8.1+ hosts the same code path logged a sanitize_email() deprecation (found in debug.log review). Root cause: the options were registered in the Settings API group while the settings form no longer posts them, so wp-admin/options.php passed null to update_option() for each of them. Fix: the options are no longer part of the settings group, so their values survive every save and no null ever reaches the sanitizers.
**Changed**
* Development tooling updated via composer update (PHPStan 2.2.14 → 2.3.5, wp-compat 2.0.1 → 3.0.1, wordpress-stubs 7.1.0 → 7.1.2, PHPUnit 9.6.36 → 9.6.38).
* phpcompatibility/php-compatibility 9.3.5 → 10.0.0-alpha2 (dev-only dependency): the 9.x line cannot see PHP 8.x syntax, so previous "5.6-8.5" scans were blind above 7.4; the 10.x line genuinely scans PHP 5.6 through 8.6 (sniff verified against a known 8.0-only construct).
* bin/preflight.sh PHPCompatibility scan upper bound raised from 8.5 to 8.6.
* AGENTS default compatibility windows updated (WordPress 7.0-7.2, PHP 8.3-8.6 development target).
**Compatibility**
* WordPress: 4.7 - 7.2 (Tested up to raised to 7.2 after smoke tests on WordPress 7.2-beta4 single-site staging — MariaDB 11.8.9 — covering settings page render, options.php save path, context sanitization, and wp_mail Reply-To injection; WordPress floor re-verified with wp-compat 3.0.1 enforcing Requires at least 4.7).
* PHP: 5.6 - 8.6 (PHPCompatibility scan 5.6-8.6 clean; the 87-test PHPUnit suite green on PHP 7.4, 8.2, 8.3, 8.4, 8.5, and 8.6.0RC3; syntax lint passes on every PHP binary 5.6 through 8.6; PHP floor stays 5.6 — the real lowest compatible version).
**Tests**
* PHP Coding Standards: 3.13.6
* WordPress Coding Standards: 3.4.1
* PHPCompatibility: 10.0.0-alpha2 (range 5.6-8.6)
* PHPStan: 2.3.5 (level 9, wp-compat 3.0.1)
* PHPUnit: 9.6.38 — 87 tests (86 → 87: added regression test asserting the legacy options stay out of the settings group)
* Plugin Check (PCP): 0 errors on the release package (4 accepted warnings, unchanged: trademarked_term x2, load_plugin_textdomain, $site_id in uninstall.php)
= 2.1.1 =
_Release date: 2026-09-18_
**Highlights**
* Security hardening patch: settings error messages now escape the context label, and the deferred review items are closed out. No behavior change.
**Security**
* Context name in settings error/warning messages (invalid email, DNS domain warning, name truncation) now escaped at output time via esc_html() — defense in depth for translated labels.
**Changed**
* Known-issues triage closed: load_plugin_textdomain() accepted (bundled translations in /languages must load even before GlotPress coverage); trademarked_term accepted (not a problem per maintainer); switch_to_blog() uninstall sweep confirmed as the standard pattern — batched get_sites() pagination documented as the fallback for very large networks.
* composer update re-run: no dependency changes (already current).
**Compatibility**
* WordPress: 4.7 - 7.1 (7.2 not yet released — expected December 2026 — so Tested up to stays at 7.1)
* PHP: 5.6 - 8.5
**Tests**
* PHP Coding Standards: 3.13.6
* WordPress Coding Standards: 3.4.1
* PHPStan: 2.2.14 (level 9)
* PHPUnit: 9.6.36
= 2.1.0 = = 2.1.0 =
_Release date: 2026-09-18_ _Release date: 2026-09-18_

Binary file not shown.

View file

@ -3,7 +3,7 @@
# This file is distributed under the GPL-3.0-or-later. # This file is distributed under the GPL-3.0-or-later.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Reply-To for WP_Mail 2.1.0\n" "Project-Id-Version: Reply-To for WP_Mail 2.1.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/replyto\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/replyto\n"
"POT-Creation-Date: 2026-09-18T14:58:16+00:00\n" "POT-Creation-Date: 2026-09-18T14:58:16+00:00\n"
"PO-Revision-Date: 2026-09-18 17:00+0100\n" "PO-Revision-Date: 2026-09-18 17:00+0100\n"

Binary file not shown.

View file

@ -3,7 +3,7 @@
# This file is distributed under the GPL-3.0-or-later. # This file is distributed under the GPL-3.0-or-later.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Reply-To for WP_Mail 2.1.0\n" "Project-Id-Version: Reply-To for WP_Mail 2.1.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/replyto\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/replyto\n"
"POT-Creation-Date: 2026-09-18T14:58:16+00:00\n" "POT-Creation-Date: 2026-09-18T14:58:16+00:00\n"
"PO-Revision-Date: 2026-09-18 17:00+0100\n" "PO-Revision-Date: 2026-09-18 17:00+0100\n"

View file

@ -2,14 +2,14 @@
# This file is distributed under the GPL-3.0-or-later. # This file is distributed under the GPL-3.0-or-later.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Reply-To for WP_Mail 2.1.0\n" "Project-Id-Version: Reply-To for WP_Mail 2.1.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/replyto\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/replyto\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2026-09-18T14:58:16+00:00\n" "POT-Creation-Date: 2026-11-03T17:05:34+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.12.0\n" "X-Generator: WP-CLI 2.12.0\n"
"X-Domain: replyto\n" "X-Domain: replyto\n"
@ -39,191 +39,191 @@ msgstr ""
msgid "https://www.robotstxt.software/" msgid "https://www.robotstxt.software/"
msgstr "" msgstr ""
#: replyto.php:401 #: replyto.php:403
msgid "WP Mail Reply-To Settings" msgid "WP Mail Reply-To Settings"
msgstr "" msgstr ""
#: replyto.php:402 #: replyto.php:404
msgid "Reply-To" msgid "Reply-To"
msgstr "" msgstr ""
#: replyto.php:535 #: replyto.php:523
#: replyto.php:762 #: replyto.php:753
msgid "Default" msgid "Default"
msgstr "" msgstr ""
#: replyto.php:536 #: replyto.php:524
msgid "Authentication" msgid "Authentication"
msgstr "" msgstr ""
#: replyto.php:537 #: replyto.php:525
msgid "Comments" msgid "Comments"
msgstr "" msgstr ""
#: replyto.php:538 #: replyto.php:526
msgid "Users" msgid "Users"
msgstr "" msgstr ""
#: replyto.php:539 #: replyto.php:527
msgid "System" msgid "System"
msgstr "" msgstr ""
#: replyto.php:540 #: replyto.php:528
#: replyto.php:791 #: replyto.php:782
msgid "WooCommerce" msgid "WooCommerce"
msgstr "" msgstr ""
#. translators: %s: context name #. translators: %s: context name
#: replyto.php:580 #: replyto.php:568
#, php-format #, php-format
msgid "Invalid email address for %s context." msgid "Invalid email address for %s context."
msgstr "" msgstr ""
#. translators: %s: context name #. translators: %s: context name
#: replyto.php:596 #: replyto.php:584
#, php-format #, php-format
msgid "Warning: The email domain for %s context does not appear to have valid DNS records." msgid "Warning: The email domain for %s context does not appear to have valid DNS records."
msgstr "" msgstr ""
#. translators: %s: context name #. translators: %s: context name
#: replyto.php:611 #: replyto.php:599
#: replyto.php:621 #: replyto.php:609
#, php-format #, php-format
msgid "Name for %s context was truncated to 255 characters." msgid "Name for %s context was truncated to 255 characters."
msgstr "" msgstr ""
#: replyto.php:661 #: replyto.php:649
msgid "Reply-To configuration updated successfully." msgid "Reply-To configuration updated successfully."
msgstr "" msgstr ""
#: replyto.php:744 #: replyto.php:732
msgid "You do not have sufficient permissions to access this page." msgid "You do not have sufficient permissions to access this page."
msgstr "" msgstr ""
#: replyto.php:763 #: replyto.php:754
msgid "Default Reply-To used for all emails that do not match a specific context. This is the fallback when other contexts are not configured." msgid "Default Reply-To used for all emails that do not match a specific context. This is the fallback when other contexts are not configured."
msgstr "" msgstr ""
#: replyto.php:764 #: replyto.php:755
msgid "Newsletter confirmations, general notifications, and any emails not covered by other contexts." msgid "Newsletter confirmations, general notifications, and any emails not covered by other contexts."
msgstr "" msgstr ""
#: replyto.php:767 #: replyto.php:758
msgid "Authentication & Security" msgid "Authentication & Security"
msgstr "" msgstr ""
#: replyto.php:768 #: replyto.php:759
msgid "Reply-To for password resets, password changes, and email address changes." msgid "Reply-To for password resets, password changes, and email address changes."
msgstr "" msgstr ""
#: replyto.php:769 #: replyto.php:760
msgid "Password reset requests, password change confirmations, email address verifications." msgid "Password reset requests, password change confirmations, email address verifications."
msgstr "" msgstr ""
#: replyto.php:772 #: replyto.php:763
msgid "Comments & Moderation" msgid "Comments & Moderation"
msgstr "" msgstr ""
#: replyto.php:773 #: replyto.php:764
msgid "Reply-To for comment notifications and moderation alerts." msgid "Reply-To for comment notifications and moderation alerts."
msgstr "" msgstr ""
#: replyto.php:774 #: replyto.php:765
msgid "New comment notifications, comment moderation alerts, comment replies." msgid "New comment notifications, comment moderation alerts, comment replies."
msgstr "" msgstr ""
#: replyto.php:777 #: replyto.php:768
msgid "Users & Registration" msgid "Users & Registration"
msgstr "" msgstr ""
#: replyto.php:778 #: replyto.php:769
msgid "Reply-To for new user registrations, role changes, and user management emails." msgid "Reply-To for new user registrations, role changes, and user management emails."
msgstr "" msgstr ""
#: replyto.php:779 #: replyto.php:770
msgid "New user welcome emails, user role changes, account activations." msgid "New user welcome emails, user role changes, account activations."
msgstr "" msgstr ""
#: replyto.php:782 #: replyto.php:773
msgid "System & Updates" msgid "System & Updates"
msgstr "" msgstr ""
#: replyto.php:783 #: replyto.php:774
msgid "Reply-To for automatic updates, system alerts, and critical site health notifications." msgid "Reply-To for automatic updates, system alerts, and critical site health notifications."
msgstr "" msgstr ""
#: replyto.php:784 #: replyto.php:775
msgid "WordPress core updates, plugin updates, theme updates, recovery mode, fatal error notifications." msgid "WordPress core updates, plugin updates, theme updates, recovery mode, fatal error notifications."
msgstr "" msgstr ""
#: replyto.php:792 #: replyto.php:783
msgid "Reply-To for WooCommerce order notifications, invoices, and customer communications." msgid "Reply-To for WooCommerce order notifications, invoices, and customer communications."
msgstr "" msgstr ""
#: replyto.php:793 #: replyto.php:784
msgid "Order confirmations, shipping notifications, invoices, customer notes." msgid "Order confirmations, shipping notifications, invoices, customer notes."
msgstr "" msgstr ""
#: replyto.php:807 #: replyto.php:798
msgid "Configure different Reply-To addresses based on the type of email being sent. Each context can have its own email address and display name." msgid "Configure different Reply-To addresses based on the type of email being sent. Each context can have its own email address and display name."
msgstr "" msgstr ""
#: replyto.php:845 #: replyto.php:836
msgid "Active with email configured" msgid "Active with email configured"
msgstr "" msgstr ""
#: replyto.php:846 #: replyto.php:837
msgid "Inactive or no email configured" msgid "Inactive or no email configured"
msgstr "" msgstr ""
#: replyto.php:862 #: replyto.php:853
msgid "What this context covers:" msgid "What this context covers:"
msgstr "" msgstr ""
#: replyto.php:864 #: replyto.php:855
msgid "Examples:" msgid "Examples:"
msgstr "" msgstr ""
#: replyto.php:875 #: replyto.php:866
msgid "Enable this context" msgid "Enable this context"
msgstr "" msgstr ""
#: replyto.php:878 #: replyto.php:869
msgid "When disabled, emails in this context will use the Default Reply-To address." msgid "When disabled, emails in this context will use the Default Reply-To address."
msgstr "" msgstr ""
#: replyto.php:888 #: replyto.php:879
msgid "Reply-To Email Address" msgid "Reply-To Email Address"
msgstr "" msgstr ""
#: replyto.php:898 #: replyto.php:889
msgid "Enter the email address where replies should be sent." msgid "Enter the email address where replies should be sent."
msgstr "" msgstr ""
#: replyto.php:905 #: replyto.php:896
msgid "Reply-To Display Name (Optional)" msgid "Reply-To Display Name (Optional)"
msgstr "" msgstr ""
#: replyto.php:915 #: replyto.php:906
msgid "Optional: Enter a name to display with the email (e.g., \"Support Team\")." msgid "Optional: Enter a name to display with the email (e.g., \"Support Team\")."
msgstr "" msgstr ""
#: replyto.php:924 #: replyto.php:915
msgid "Note:" msgid "Note:"
msgstr "" msgstr ""
#: replyto.php:925 #: replyto.php:916
msgid "The Default context is always active and acts as a fallback for all emails." msgid "The Default context is always active and acts as a fallback for all emails."
msgstr "" msgstr ""
#: replyto.php:935 #: replyto.php:926
msgid "Delete plugin data on uninstall" msgid "Delete plugin data on uninstall"
msgstr "" msgstr ""
#: replyto.php:938 #: replyto.php:929
msgid "Your Reply-To settings are preserved by default. Check this box to remove all plugin data when the plugin is uninstalled." msgid "Your Reply-To settings are preserved by default. Check this box to remove all plugin data when the plugin is uninstalled."
msgstr "" msgstr ""
#: replyto.php:967 #: replyto.php:958
msgid "Save Settings" msgid "Save Settings"
msgstr "" msgstr ""

View file

@ -2,10 +2,10 @@
Contributors: robotstxt, javiercasares Contributors: robotstxt, javiercasares
Tags: email, reply-to, mail, smtp Tags: email, reply-to, mail, smtp
Requires at least: 4.7 Requires at least: 4.7
Tested up to: 7.1 Tested up to: 7.2
Stable tag: 2.1.0 Stable tag: 2.1.2
Requires PHP: 5.6 Requires PHP: 5.6
Version: 2.1.0 Version: 2.1.2
License: GPL-3.0-or-later License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.txt License URI: https://www.gnu.org/licenses/gpl-3.0.txt
@ -56,11 +56,71 @@ Yes. Each site in a Multisite network maintains its own configuration. On uninst
== Compatibility == == Compatibility ==
* WordPress: 4.7 - 7.1 * WordPress: 4.7 - 7.2
* PHP: 5.6 - 8.5 * PHP: 5.6 - 8.6
== Changelog == == Changelog ==
= 2.1.2 =
_Release date: 2026-11-03_
**Highlights**
* Legacy v1 options no longer wiped on save, and WordPress 7.2 / PHP 8.6 compatibility declared and verified.
**Fixed**
* Legacy v1.0.x Reply-To options (wp_mail_replyto_email, wp_mail_replyto_name) were emptied on every settings save, destroying the rollback/migration fallback values; on PHP 8.1+ hosts the same code path logged a sanitize_email() deprecation (found in debug.log review). The options are no longer part of the Settings API group, so their values survive every save.
**Changed**
* Development tooling updated via composer update (PHPStan 2.2.14 → 2.3.5, wp-compat 2.0.1 → 3.0.1, wordpress-stubs 7.1.0 → 7.1.2, PHPUnit 9.6.36 → 9.6.38).
* PHPCompatibility 9.3.5 → 10.0.0-alpha2 (dev-only): the 9.x line cannot see PHP 8.x syntax, 10.x scans through 8.6 for real.
**Compatibility**
* WordPress: 4.7 - 7.2 (Tested up to raised to 7.2 after smoke tests on WordPress 7.2-beta4 single-site staging: settings render, save, and wp_mail Reply-To injection verified)
* PHP: 5.6 - 8.6 (PHPCompatibility scan 5.6-8.6 clean; runtime verified on PHP 7.4, 8.2, 8.3, 8.4, 8.5, and 8.6.0RC3; syntax lint passes on every PHP binary 5.6 through 8.6)
**Tests**
* PHP Coding Standards: 3.13.6
* WordPress Coding Standards: 3.4.1
* PHPCompatibility: 10.0.0-alpha2 (range 5.6-8.6)
* PHPStan: 2.3.5 (level 9, wp-compat 3.0.1 enforcing the WordPress 4.7 floor)
* PHPUnit: 9.6.38 (87 tests)
* Plugin Check (PCP): 0 errors on the release package (4 accepted warnings, unchanged)
= 2.1.1 =
_Release date: 2026-09-18_
**Highlights**
* Security hardening patch: settings error messages now escape the context label, and the deferred review items are closed out. No behavior change.
**Security**
* Context name in settings error/warning messages now escaped at output time (defense in depth for translated labels).
**Changed**
* Known-issues triage closed: load_plugin_textdomain() accepted (bundled translations must load), trademarked_term accepted (not a problem), switch_to_blog() uninstall sweep confirmed as the standard pattern (batched get_sites() documented as the fallback for very large networks).
* composer update re-run: no dependency changes (already current).
**Compatibility**
* WordPress: 4.7 - 7.1 (7.2 not yet released — expected December 2026 — so Tested up to stays at 7.1)
* PHP: 5.6 - 8.5
**Tests**
* PHP Coding Standards: 3.13.6
* WordPress Coding Standards: 3.4.1
* PHPStan: 2.2.14 (level 9)
* PHPUnit: 9.6.36
= 2.1.0 = = 2.1.0 =
_Release date: 2026-09-18_ _Release date: 2026-09-18_
@ -97,85 +157,22 @@ _Release date: 2026-09-18_
* PHPUnit: 9.6.36 * PHPUnit: 9.6.36
* Plugin Check (PCP): 0 errors on the release package. * Plugin Check (PCP): 0 errors on the release package.
= 2.0.3 =
_Release date: 2026-08-18_
**Highlights**
* Housekeeping release: branding URLs moved to robotstxt.software and declared WordPress support floor set to 4.7.
**Changed**
* Minimum WordPress version raised from 3.6 to 4.7 (real functional floor: register_setting() with array arguments requires WordPress 4.7).
* Developer URL updated to https://www.robotstxt.software/ and plugin home page added (https://www.robotstxt.software/plugins/replyto/).
* Full changelog now hosted at https://www.robotstxt.software/plugins/replyto/changelog/.
* Development tooling updated (PHPCS, WPCS, PHPStan, PHPUnit).
**Added**
* bin/preflight.sh automated pre-deploy verification script.
* WordPress floor verification (wp-compat) integrated into PHPStan analysis.
**Compatibility**
* WordPress: 4.7 - 7.1
* PHP: 5.6 - 8.5
**Tests**
* PHP Coding Standards: 3.13.6
* WordPress Coding Standards: 3.4.1
* PHPStan: 2.2.8 (level 9)
* PHPUnit: 9.6.36
= 2.0.2 =
_Release date: 2026-06-05_
**Highlights**
* Translations added for Spanish (Spain) and Catalan.
* WordPress minimum version corrected to 3.6 based on actual function usage (wp-compat analysis).
**Changed**
* Minimum WordPress version updated from 4.1 to 3.6.
* Tested up to WordPress 7.1.
* POT file regenerated via WP-CLI i18n.
**Added**
* Spanish (Spain) translation (es_ES).
* Catalan translation (ca).
**Compatibility**
* WordPress: 3.6 - 7.1
* PHP: 5.6 - 8.5
**Tests**
* PHP Coding Standards: 3.13.5
* WordPress Coding Standards: 3.3.0
* PHPStan: 2.2.2 (level 9)
* PHPUnit: 9.6.34
= Previous versions = = Previous versions =
If you want to see the full changelog, visit the [changelog](https://www.robotstxt.software/plugins/replyto/changelog/) page. If you want to see the full changelog, visit the [changelog](https://www.robotstxt.software/plugins/replyto/changelog/) page.
== Upgrade Notice == == Upgrade Notice ==
= 2.1.2 =
Legacy v1 settings are no longer wiped on save; tested with WordPress 7.2 and PHP 8.6. Recommended for everyone.
= 2.1.1 =
Security hardening patch: settings messages escape the context label. No behavior change; upgrade optional.
= 2.1.0 = = 2.1.0 =
WooCommerce context values are preserved and plugin data is kept on uninstall unless you opt in. Recommended for all users. WooCommerce context values are preserved and plugin data is kept on uninstall unless you opt in. Recommended for all users.
= 2.0.3 =
Housekeeping release: branding URLs moved to robotstxt.software. Minimum WordPress version is now 4.7.
= 2.0.2 =
Translations added for Spanish (Spain) and Catalan. WordPress minimum corrected to 3.6. Upgrade recommended.
== Compliance == == Compliance ==
This plugin adheres to the following security measures and review protocols for each version: This plugin adheres to the following security measures and review protocols for each version:

View file

@ -5,7 +5,7 @@
* Plugin URI: https://www.robotstxt.software/plugins/replyto/ * Plugin URI: https://www.robotstxt.software/plugins/replyto/
* Requires at least: 4.7 * Requires at least: 4.7
* Requires PHP: 5.6 * Requires PHP: 5.6
* Version: 2.1.0 * Version: 2.1.2
* Author: ROBOTSTXT * Author: ROBOTSTXT
* Author URI: https://www.robotstxt.software/ * Author URI: https://www.robotstxt.software/
* License: GPL-3.0-or-later * License: GPL-3.0-or-later
@ -15,7 +15,7 @@
* *
* @package replyto * @package replyto
* *
* @version 2.1.0 * @version 2.1.2
*/ */
defined( 'ABSPATH' ) || die( 'No script kiddies please!' ); defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
@ -26,7 +26,7 @@ defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
* @since 2.1.0 * @since 2.1.0
*/ */
if ( ! defined( 'WP_MAIL_REPLYTO_VERSION' ) ) { if ( ! defined( 'WP_MAIL_REPLYTO_VERSION' ) ) {
define( 'WP_MAIL_REPLYTO_VERSION', '2.1.0' ); define( 'WP_MAIL_REPLYTO_VERSION', '2.1.2' );
} }
register_activation_hook( __FILE__, 'wp_mail_replyto_migrate_to_v200' ); register_activation_hook( __FILE__, 'wp_mail_replyto_migrate_to_v200' );
@ -461,26 +461,12 @@ function wp_mail_replyto_register_settings() {
) )
); );
// Legacy settings kept for backward compatibility during migration. // The legacy v1.0.x options (wp_mail_replyto_email, wp_mail_replyto_name)
register_setting( // are intentionally NOT registered here: they are not part of the settings
'wp_mail_replyto_settings_group', // form, and options.php calls update_option() with null for every registered
'wp_mail_replyto_email', // option missing from the POST body. That wiped the legacy values on every
array( // save and triggered a sanitize_email(null) deprecation on PHP 8.1+. The
'type' => 'string', // options are read directly during migration, which needs no registration.
'sanitize_callback' => 'sanitize_email',
'default' => '',
)
);
register_setting(
'wp_mail_replyto_settings_group',
'wp_mail_replyto_name',
array(
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
'default' => '',
)
);
// Uninstall behaviour opt-in: data is preserved unless the user checks this. // Uninstall behaviour opt-in: data is preserved unless the user checks this.
register_setting( register_setting(
@ -579,7 +565,7 @@ function wp_mail_replyto_sanitize_contexts( $input ) {
'wp_mail_replyto_messages', 'wp_mail_replyto_messages',
'wp_mail_replyto_invalid_email_' . $context_key, 'wp_mail_replyto_invalid_email_' . $context_key,
/* translators: %s: context name */ /* translators: %s: context name */
sprintf( esc_html__( 'Invalid email address for %s context.', 'replyto' ), $context_label ), sprintf( esc_html__( 'Invalid email address for %s context.', 'replyto' ), esc_html( $context_label ) ),
'error' 'error'
); );
$email = ''; $email = '';
@ -595,7 +581,7 @@ function wp_mail_replyto_sanitize_contexts( $input ) {
'wp_mail_replyto_messages', 'wp_mail_replyto_messages',
'wp_mail_replyto_domain_warning_' . $context_key, 'wp_mail_replyto_domain_warning_' . $context_key,
/* translators: %s: context name */ /* translators: %s: context name */
sprintf( esc_html__( 'Warning: The email domain for %s context does not appear to have valid DNS records.', 'replyto' ), $context_label ), sprintf( esc_html__( 'Warning: The email domain for %s context does not appear to have valid DNS records.', 'replyto' ), esc_html( $context_label ) ),
'warning' 'warning'
); );
} }
@ -610,7 +596,7 @@ function wp_mail_replyto_sanitize_contexts( $input ) {
'wp_mail_replyto_messages', 'wp_mail_replyto_messages',
'wp_mail_replyto_name_long_' . $context_key, 'wp_mail_replyto_name_long_' . $context_key,
/* translators: %s: context name */ /* translators: %s: context name */
sprintf( esc_html__( 'Name for %s context was truncated to 255 characters.', 'replyto' ), $context_label ), sprintf( esc_html__( 'Name for %s context was truncated to 255 characters.', 'replyto' ), esc_html( $context_label ) ),
'warning' 'warning'
); );
} }
@ -620,7 +606,7 @@ function wp_mail_replyto_sanitize_contexts( $input ) {
'wp_mail_replyto_messages', 'wp_mail_replyto_messages',
'wp_mail_replyto_name_long_' . $context_key, 'wp_mail_replyto_name_long_' . $context_key,
/* translators: %s: context name */ /* translators: %s: context name */
sprintf( esc_html__( 'Name for %s context was truncated to 255 characters.', 'replyto' ), $context_label ), sprintf( esc_html__( 'Name for %s context was truncated to 255 characters.', 'replyto' ), esc_html( $context_label ) ),
'warning' 'warning'
); );
} }