diff --git a/changelog.txt b/changelog.txt index fffa428..a52c6aa 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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 = * Version bump for maintenance release. diff --git a/readme.txt b/readme.txt index 9ef0fe4..2588444 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: javiercasares Tags: amazon-ses, smtp, email, mail Requires at least: 6.5 Tested up to: 6.9 -Stable tag: 2.0.1 +Stable tag: 2.1.0 Requires PHP: 8.2 -Version: 2.0.1 +Version: 2.1.0 License: GPL-3.0-or-later License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/robotstxt-smtp-amazonses.php b/robotstxt-smtp-amazonses.php index b39232c..1f88516 100644 --- a/robotstxt-smtp-amazonses.php +++ b/robotstxt-smtp-amazonses.php @@ -3,7 +3,7 @@ * Plugin Name: SMTP (by ROBOTSTXT) Amazon SES * Plugin URI: https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses * 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 PHP: 8.2 * Network: true @@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) { } 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' ) ) { diff --git a/uninstall.php b/uninstall.php index 819f5f0..f4f1c8d 100644 --- a/uninstall.php +++ b/uninstall.php @@ -2,6 +2,14 @@ /** * 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 */ @@ -9,128 +17,4 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { exit; } -$option_keys = array( - '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 $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 $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 $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 $settings Option values. - * @param array $keys Keys to remove. - * - * @return array - */ - 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 ) ); - } -} +// No cleanup needed - handled by core SMTP plugin uninstall. diff --git a/update.json b/update.json index dad2b9a..8a1d28c 100644 --- a/update.json +++ b/update.json @@ -1,21 +1,21 @@ { "name": "SMTP (by ROBOTSTXT) Amazon SES", "slug": "robotstxt-smtp-amazonses", - "version": "2.0.0", - "download_url": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses/releases/download/2.0.0/robotstxt-smtp-amazonses-2.0.0.zip", + "version": "2.1.0", + "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_php": "8.2", "tested": "6.9", - "last_updated": "2026-01-29", + "last_updated": "2026-02-09", "author": "ROBOTSTXT", "author_profile": "https://www.robotstxt.es/", "homepage": "https://git.robotstxt.es/ROBOTSTXT/robotstxt-smtp-amazonses", "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.", - "changelog": "

2.0.0 - 2026-01-29

⚠️ BREAKING CHANGE: This version requires PHP 8.2 or higher due to AWS SDK requirements.

  • Added: Reply-To header support for emails sent via Amazon SES
  • Fixed: Improved error handling and validation
  • Fixed: Enhanced compatibility with core SMTP plugin 2.0.0
  • Security: Improved credential handling and encryption
  • Security: Updated AWS SDK for PHP to latest version (3.369.20) with security patches
  • Changed: Minimum PHP version increased to 8.2
  • Improved: Code quality and documentation

1.0.0 - 2026-01-27

  • Initial release
  • Amazon SES integration via AWS SDK v3
  • Full compatibility with ROBOTSTXT SMTP plugin
  • Support for AWS regions and credentials configuration
  • Automatic dependency management with Composer
", + "changelog": "

2.1.0 - 2026-02-09

  • Changed: Uninstall behavior: plugin no longer performs cleanup on uninstall, all data cleanup is now handled by the core SMTP plugin
  • Changed: This ensures Amazon SES credentials are preserved when only the add-on is removed, and properly cleaned when the core plugin is uninstalled
  • Technical: Simplified uninstall.php to delegate all cleanup responsibility to core SMTP plugin
  • Technical: Improved data preservation and cleanup consistency across the plugin ecosystem

2.0.0 - 2026-01-29

⚠️ BREAKING CHANGE: This version requires PHP 8.2 or higher due to AWS SDK requirements.

  • Added: Reply-To header support for emails sent via Amazon SES
  • Fixed: Improved error handling and validation
  • Fixed: Enhanced compatibility with core SMTP plugin 2.0.0
  • Security: Improved credential handling and encryption
  • Security: Updated AWS SDK for PHP to latest version (3.369.20) with security patches
  • Changed: Minimum PHP version increased to 8.2
  • Improved: Code quality and documentation

1.0.0 - 2026-01-27

  • Initial release
  • Amazon SES integration via AWS SDK v3
  • Full compatibility with ROBOTSTXT SMTP plugin
  • Support for AWS regions and credentials configuration
  • Automatic dependency management with Composer
", "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.", - "changelog": "

2.0.0 - 2026-01-29

⚠️ BREAKING CHANGE: This version requires PHP 8.2 or higher due to AWS SDK requirements.

  • Added: Reply-To header support for emails sent via Amazon SES
  • Fixed: Improved error handling and validation
  • Fixed: Enhanced compatibility with core SMTP plugin 2.0.0
  • Security: Improved credential handling and encryption
  • Security: Updated AWS SDK for PHP to latest version (3.369.20) with security patches
  • Changed: Minimum PHP version increased to 8.2
  • Improved: Code quality and documentation

1.0.0 - 2026-01-27

  • Initial release
  • Amazon SES integration via AWS SDK v3
  • Full compatibility with ROBOTSTXT SMTP plugin
  • Support for AWS regions and credentials configuration
  • Automatic dependency management with Composer
" + "changelog": "

2.1.0 - 2026-02-09

  • Changed: Uninstall behavior: plugin no longer performs cleanup on uninstall, all data cleanup is now handled by the core SMTP plugin
  • Changed: This ensures Amazon SES credentials are preserved when only the add-on is removed, and properly cleaned when the core plugin is uninstalled
  • Technical: Simplified uninstall.php to delegate all cleanup responsibility to core SMTP plugin
  • Technical: Improved data preservation and cleanup consistency across the plugin ecosystem

2.0.0 - 2026-01-29

⚠️ BREAKING CHANGE: This version requires PHP 8.2 or higher due to AWS SDK requirements.

  • Added: Reply-To header support for emails sent via Amazon SES
  • Fixed: Improved error handling and validation
  • Fixed: Enhanced compatibility with core SMTP plugin 2.0.0
  • Security: Improved credential handling and encryption
  • Security: Updated AWS SDK for PHP to latest version (3.369.20) with security patches
  • Changed: Minimum PHP version increased to 8.2
  • Improved: Code quality and documentation

1.0.0 - 2026-01-27

  • Initial release
  • Amazon SES integration via AWS SDK v3
  • Full compatibility with ROBOTSTXT SMTP plugin
  • Support for AWS regions and credentials configuration
  • Automatic dependency management with Composer
" }, "banners": { "low": "", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 1af9a07..f8c496c 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '5ace5c7e2ec77c3fc70e313971b56c0482c34262', + 'reference' => 'e34a30a667b7d9f21f4d1a22d25b81ab38a3b976', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '5ace5c7e2ec77c3fc70e313971b56c0482c34262', + 'reference' => 'e34a30a667b7d9f21f4d1a22d25b81ab38a3b976', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),