Skip to content
Open
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
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2024
## [1.1.0] - July 31, 2026

### Added

- Uninstall handler (via `register_uninstall_hook`) to remove Resend WordPress Plugin's stored options (`resend_api_key`, `resend_from_name`, `resend_from_address`) when the plugin is deleted ([#11](https://github.com/resend/resend-wordpress/issues/11))

## [1.0.0] - July 26, 2026

### Added
- Initial release of Resend WordPress Plugin
Expand Down Expand Up @@ -59,4 +65,4 @@ None reported yet.
For issues, feature requests, or questions:
- [GitHub Issues](https://github.com/resend/resend-wordpress/issues)
- [Resend Support](https://resend.com/help)
- [Documentation](https://resend.com/docs)
- [Documentation](https://resend.com/docs)
30 changes: 30 additions & 0 deletions class-resend.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,36 @@ public static function plugin_activation() {
public static function plugin_deactivation() {
}

/**
* Handle plugin uninstall tasks.
*
* @return void
*/
public static function plugin_uninstall() {
if ( is_multisite() ) {
$site_ids = get_sites( array( 'fields' => 'ids' ) );

foreach ( $site_ids as $site_id ) {
switch_to_blog( $site_id );
self::delete_plugin_data();
restore_current_blog();
}
} else {
self::delete_plugin_data();
}
}

/**
* Delete all Resend plugin options for the current site.
*
* @return void
*/
private static function delete_plugin_data() {
delete_option( 'resend_api_key' );
delete_option( 'resend_from_name' );
delete_option( 'resend_from_address' );
}

/**
* Retrieve the stored Resend API key.
*
Expand Down
8 changes: 8 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ The plugin works with WordPress multisite, but each site will need its own Resen

When you deactivate the plugin, WordPress will revert to its default email sending behavior. Any emails queued in Resend will still be sent normally.

= What happens to my data if I delete the plugin? =

When you delete the plugin from the Plugins page, your Resend settings (API key, sender name, sender email) are removed from the database. Simply deactivating the plugin does not remove this data.

= Does this support attachments? =

Yes, if the Resend API supports it. The plugin uses the standard `wp_mail()` function which supports attachments.
Expand All @@ -119,6 +123,9 @@ Yes! You can set a custom sender email and name in the plugin settings page.

== Changelog ==

= 1.1.0 =
* Plugin data is now removed on uninstall

= 1.0.0 =
* Initial release
* Basic email sending via Resend API
Expand All @@ -136,6 +143,7 @@ Yes! You can set a custom sender email and name in the plugin settings page.
== Support ==

For support, feature requests, or bug reports, please visit:

* [GitHub Issues](https://github.com/resend/resend-wordpress/issues)
* [Resend Support](https://resend.com/help)

Expand Down
1 change: 1 addition & 0 deletions resend.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function wp_mail_already_declared_notice() {

register_activation_hook( __FILE__, array( 'Resend', 'plugin_activation' ) );
register_deactivation_hook( __FILE__, array( 'Resend', 'plugin_deactivation' ) );
register_uninstall_hook( __FILE__, array( 'Resend', 'plugin_uninstall' ) );

require_once RESEND__PLUGIN_DIR . 'class-resend.php';

Expand Down