This commit is contained in:
Javier Casares 2026-02-09 11:58:59 +00:00
commit 91fea3ecf7
6 changed files with 26 additions and 136 deletions

View file

@ -1,3 +1,9 @@
= 2.1.0 =
* Changed uninstall behavior: plugin no longer performs cleanup on uninstall, all data cleanup is now handled by the core SMTP plugin.
* This ensures Amazon SES credentials are preserved when only the add-on is removed, and properly cleaned when the core plugin is uninstalled.
* Simplified uninstall.php to delegate all cleanup responsibility to core SMTP plugin.
= 2.0.1 = = 2.0.1 =
* Version bump for maintenance release. * Version bump for maintenance release.

View file

@ -3,9 +3,9 @@ Contributors: javiercasares
Tags: amazon-ses, smtp, email, mail Tags: amazon-ses, smtp, email, mail
Requires at least: 6.5 Requires at least: 6.5
Tested up to: 6.9 Tested up to: 6.9
Stable tag: 2.0.1 Stable tag: 2.1.0
Requires PHP: 8.2 Requires PHP: 8.2
Version: 2.0.1 Version: 2.1.0
License: GPL-3.0-or-later License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.html License URI: https://www.gnu.org/licenses/gpl-3.0.html

View file

@ -3,7 +3,7 @@
* Plugin Name: SMTP (by ROBOTSTXT) Amazon SES * Plugin Name: SMTP (by ROBOTSTXT) Amazon SES
* Plugin URI: https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses * Plugin URI: https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses
* Description: Adds Amazon SES configuration support to the ROBOTSTXT SMTP plugin. * Description: Adds Amazon SES configuration support to the ROBOTSTXT SMTP plugin.
* Version: 2.0.1 * Version: 2.1.0
* Requires at least: 6.5 * Requires at least: 6.5
* Requires PHP: 8.2 * Requires PHP: 8.2
* Network: true * Network: true
@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) {
} }
if ( ! defined( 'ROBOTSTXT_SMTP_AMAZONSES_VERSION' ) ) { if ( ! defined( 'ROBOTSTXT_SMTP_AMAZONSES_VERSION' ) ) {
define( 'ROBOTSTXT_SMTP_AMAZONSES_VERSION', '2.0.1' ); define( 'ROBOTSTXT_SMTP_AMAZONSES_VERSION', '2.1.0' );
} }
if ( ! defined( 'ROBOTSTXT_SMTP_AMAZONSES_FILE' ) ) { if ( ! defined( 'ROBOTSTXT_SMTP_AMAZONSES_FILE' ) ) {

View file

@ -2,6 +2,14 @@
/** /**
* Uninstall routines for the Amazon SES extension. * Uninstall routines for the Amazon SES extension.
* *
* This add-on does not perform any cleanup on uninstall. All data cleanup
* (including Amazon SES credentials stored in the main SMTP plugin options)
* is handled by the core SMTP plugin when it is uninstalled.
*
* This ensures that:
* - If only the Amazon SES add-on is removed, the configuration remains intact
* - If the core SMTP plugin is removed, all data (including add-on data) is cleaned up
*
* @package Robotstxt_SMTP_AmazonSES * @package Robotstxt_SMTP_AmazonSES
*/ */
@ -9,128 +17,4 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit; exit;
} }
$option_keys = array( // No cleanup needed - handled by core SMTP plugin uninstall.
'amazon_ses_access_key',
'amazon_ses_secret_key',
'amazon_ses_region',
);
robotstxt_smtp_amazonses_delete_network_settings( $option_keys );
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
$sites = get_sites( array( 'fields' => 'ids' ) );
foreach ( $sites as $site_id ) {
switch_to_blog( (int) $site_id );
robotstxt_smtp_amazonses_delete_site_settings( $option_keys );
restore_current_blog();
}
} else {
robotstxt_smtp_amazonses_delete_site_settings( $option_keys );
}
if ( ! function_exists( 'robotstxt_smtp_amazonses_delete_site_settings' ) ) {
/**
* Deletes Amazon SES settings and logs for the current site.
*
* @param array<int, string> $keys Option keys to remove.
*
* @return void
*/
function robotstxt_smtp_amazonses_delete_site_settings( array $keys ): void {
robotstxt_smtp_amazonses_remove_keys_from_option( 'robotstxt_smtp_options', $keys );
robotstxt_smtp_amazonses_delete_logs();
}
}
if ( ! function_exists( 'robotstxt_smtp_amazonses_delete_network_settings' ) ) {
/**
* Removes Amazon SES values stored in the network-wide settings.
*
* @param array<int, string> $keys Option keys to remove.
*
* @return void
*/
function robotstxt_smtp_amazonses_delete_network_settings( array $keys ): void {
$settings = get_site_option( 'robotstxt_smtp_network_options', array() );
if ( ! is_array( $settings ) || empty( $settings ) ) {
return;
}
$clean_settings = robotstxt_smtp_amazonses_remove_keys( $settings, $keys );
if ( $clean_settings !== $settings ) {
update_site_option( 'robotstxt_smtp_network_options', $clean_settings );
}
}
}
if ( ! function_exists( 'robotstxt_smtp_amazonses_remove_keys_from_option' ) ) {
/**
* Removes specific keys from an option array if it exists.
*
* @param string $option_name Option identifier.
* @param array<int, string> $keys Keys to remove.
*
* @return void
*/
function robotstxt_smtp_amazonses_remove_keys_from_option( string $option_name, array $keys ): void {
$settings = get_option( $option_name, array() );
if ( ! is_array( $settings ) || empty( $settings ) ) {
return;
}
$clean_settings = robotstxt_smtp_amazonses_remove_keys( $settings, $keys );
if ( $clean_settings !== $settings ) {
update_option( $option_name, $clean_settings );
}
}
}
if ( ! function_exists( 'robotstxt_smtp_amazonses_remove_keys' ) ) {
/**
* Returns an array without the provided keys.
*
* @param array<string, mixed> $settings Option values.
* @param array<int, string> $keys Keys to remove.
*
* @return array<string, mixed>
*/
function robotstxt_smtp_amazonses_remove_keys( array $settings, array $keys ): array {
foreach ( $keys as $key ) {
unset( $settings[ $key ] );
}
return $settings;
}
}
if ( ! function_exists( 'robotstxt_smtp_amazonses_delete_logs' ) ) {
/**
* Deletes all stored SMTP logs for the current site.
*
* @return void
*/
function robotstxt_smtp_amazonses_delete_logs(): void {
do {
$logs = get_posts(
array(
'post_type' => 'robotstxt_smtp_log',
'post_status' => 'any',
'fields' => 'ids',
'posts_per_page' => 100,
'orderby' => 'ID',
'order' => 'ASC',
)
);
foreach ( $logs as $log_id ) {
wp_delete_post( (int) $log_id, true );
}
} while ( ! empty( $logs ) );
}
}

View file

@ -1,21 +1,21 @@
{ {
"name": "SMTP (by ROBOTSTXT) Amazon SES", "name": "SMTP (by ROBOTSTXT) Amazon SES",
"slug": "robotstxt-smtp-amazonses", "slug": "robotstxt-smtp-amazonses",
"version": "2.0.0", "version": "2.1.0",
"download_url": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses/releases/download/2.0.0/robotstxt-smtp-amazonses-2.0.0.zip", "download_url": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses/releases/download/2.1.0/robotstxt-smtp-amazonses-2.1.0.zip",
"requires": "6.5", "requires": "6.5",
"requires_php": "8.2", "requires_php": "8.2",
"tested": "6.9", "tested": "6.9",
"last_updated": "2026-01-29", "last_updated": "2026-02-09",
"author": "ROBOTSTXT", "author": "ROBOTSTXT",
"author_profile": "https://www.robotstxt.es/", "author_profile": "https://www.robotstxt.es/",
"homepage": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses", "homepage": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses",
"requires_plugins": ["robotstxt-smtp"], "requires_plugins": ["robotstxt-smtp"],
"description": "Adds Amazon SES (Simple Email Service) configuration support to the ROBOTSTXT SMTP plugin. Integrates seamlessly with AWS SDK for PHP to send emails through Amazon SES infrastructure.", "description": "Adds Amazon SES (Simple Email Service) configuration support to the ROBOTSTXT SMTP plugin. Integrates seamlessly with AWS SDK for PHP to send emails through Amazon SES infrastructure.",
"changelog": "<h3>2.0.0 - 2026-01-29</h3><p><strong>⚠️ BREAKING CHANGE:</strong> This version requires PHP 8.2 or higher due to AWS SDK requirements.</p><ul><li><strong>Added:</strong> Reply-To header support for emails sent via Amazon SES</li><li><strong>Fixed:</strong> Improved error handling and validation</li><li><strong>Fixed:</strong> Enhanced compatibility with core SMTP plugin 2.0.0</li><li><strong>Security:</strong> Improved credential handling and encryption</li><li><strong>Security:</strong> Updated AWS SDK for PHP to latest version (3.369.20) with security patches</li><li><strong>Changed:</strong> Minimum PHP version increased to 8.2</li><li><strong>Improved:</strong> Code quality and documentation</li></ul><h3>1.0.0 - 2026-01-27</h3><ul><li>Initial release</li><li>Amazon SES integration via AWS SDK v3</li><li>Full compatibility with ROBOTSTXT SMTP plugin</li><li>Support for AWS regions and credentials configuration</li><li>Automatic dependency management with Composer</li></ul>", "changelog": "<h3>2.1.0 - 2026-02-09</h3><ul><li><strong>Changed:</strong> Uninstall behavior: plugin no longer performs cleanup on uninstall, all data cleanup is now handled by the core SMTP plugin</li><li><strong>Changed:</strong> This ensures Amazon SES credentials are preserved when only the add-on is removed, and properly cleaned when the core plugin is uninstalled</li><li><strong>Technical:</strong> Simplified uninstall.php to delegate all cleanup responsibility to core SMTP plugin</li><li><strong>Technical:</strong> Improved data preservation and cleanup consistency across the plugin ecosystem</li></ul><h3>2.0.0 - 2026-01-29</h3><p><strong>⚠️ BREAKING CHANGE:</strong> This version requires PHP 8.2 or higher due to AWS SDK requirements.</p><ul><li><strong>Added:</strong> Reply-To header support for emails sent via Amazon SES</li><li><strong>Fixed:</strong> Improved error handling and validation</li><li><strong>Fixed:</strong> Enhanced compatibility with core SMTP plugin 2.0.0</li><li><strong>Security:</strong> Improved credential handling and encryption</li><li><strong>Security:</strong> Updated AWS SDK for PHP to latest version (3.369.20) with security patches</li><li><strong>Changed:</strong> Minimum PHP version increased to 8.2</li><li><strong>Improved:</strong> Code quality and documentation</li></ul><h3>1.0.0 - 2026-01-27</h3><ul><li>Initial release</li><li>Amazon SES integration via AWS SDK v3</li><li>Full compatibility with ROBOTSTXT SMTP plugin</li><li>Support for AWS regions and credentials configuration</li><li>Automatic dependency management with Composer</li></ul>",
"sections": { "sections": {
"description": "Adds Amazon SES (Simple Email Service) configuration support to the ROBOTSTXT SMTP plugin. Integrates seamlessly with AWS SDK for PHP to send emails through Amazon SES infrastructure.", "description": "Adds Amazon SES (Simple Email Service) configuration support to the ROBOTSTXT SMTP plugin. Integrates seamlessly with AWS SDK for PHP to send emails through Amazon SES infrastructure.",
"changelog": "<h3>2.0.0 - 2026-01-29</h3><p><strong>⚠️ BREAKING CHANGE:</strong> This version requires PHP 8.2 or higher due to AWS SDK requirements.</p><ul><li><strong>Added:</strong> Reply-To header support for emails sent via Amazon SES</li><li><strong>Fixed:</strong> Improved error handling and validation</li><li><strong>Fixed:</strong> Enhanced compatibility with core SMTP plugin 2.0.0</li><li><strong>Security:</strong> Improved credential handling and encryption</li><li><strong>Security:</strong> Updated AWS SDK for PHP to latest version (3.369.20) with security patches</li><li><strong>Changed:</strong> Minimum PHP version increased to 8.2</li><li><strong>Improved:</strong> Code quality and documentation</li></ul><h3>1.0.0 - 2026-01-27</h3><ul><li>Initial release</li><li>Amazon SES integration via AWS SDK v3</li><li>Full compatibility with ROBOTSTXT SMTP plugin</li><li>Support for AWS regions and credentials configuration</li><li>Automatic dependency management with Composer</li></ul>" "changelog": "<h3>2.1.0 - 2026-02-09</h3><ul><li><strong>Changed:</strong> Uninstall behavior: plugin no longer performs cleanup on uninstall, all data cleanup is now handled by the core SMTP plugin</li><li><strong>Changed:</strong> This ensures Amazon SES credentials are preserved when only the add-on is removed, and properly cleaned when the core plugin is uninstalled</li><li><strong>Technical:</strong> Simplified uninstall.php to delegate all cleanup responsibility to core SMTP plugin</li><li><strong>Technical:</strong> Improved data preservation and cleanup consistency across the plugin ecosystem</li></ul><h3>2.0.0 - 2026-01-29</h3><p><strong>⚠️ BREAKING CHANGE:</strong> This version requires PHP 8.2 or higher due to AWS SDK requirements.</p><ul><li><strong>Added:</strong> Reply-To header support for emails sent via Amazon SES</li><li><strong>Fixed:</strong> Improved error handling and validation</li><li><strong>Fixed:</strong> Enhanced compatibility with core SMTP plugin 2.0.0</li><li><strong>Security:</strong> Improved credential handling and encryption</li><li><strong>Security:</strong> Updated AWS SDK for PHP to latest version (3.369.20) with security patches</li><li><strong>Changed:</strong> Minimum PHP version increased to 8.2</li><li><strong>Improved:</strong> Code quality and documentation</li></ul><h3>1.0.0 - 2026-01-27</h3><ul><li>Initial release</li><li>Amazon SES integration via AWS SDK v3</li><li>Full compatibility with ROBOTSTXT SMTP plugin</li><li>Support for AWS regions and credentials configuration</li><li>Automatic dependency management with Composer</li></ul>"
}, },
"banners": { "banners": {
"low": "", "low": "",

View file

@ -3,7 +3,7 @@
'name' => '__root__', 'name' => '__root__',
'pretty_version' => 'dev-main', 'pretty_version' => 'dev-main',
'version' => 'dev-main', 'version' => 'dev-main',
'reference' => '5ace5c7e2ec77c3fc70e313971b56c0482c34262', 'reference' => 'e34a30a667b7d9f21f4d1a22d25b81ab38a3b976',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@ -13,7 +13,7 @@
'__root__' => array( '__root__' => array(
'pretty_version' => 'dev-main', 'pretty_version' => 'dev-main',
'version' => 'dev-main', 'version' => 'dev-main',
'reference' => '5ace5c7e2ec77c3fc70e313971b56c0482c34262', 'reference' => 'e34a30a667b7d9f21f4d1a22d25b81ab38a3b976',
'type' => 'library', 'type' => 'library',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),