Delete) - never on ordinary deactivation (see * Plugin::deactivate(), which only unschedules the retry cron and leaves * every setting/log/queued row intact). WordPress itself refuses to load * this file any other way (the WP_UNINSTALL_PLUGIN check below is the * standard guard every WordPress plugin's uninstall.php uses). * * Removes: every `emails404_*` option (including the API key - the whole point * of uninstalling is "this site should have no memory of this * integration") and this plugin's own two custom tables. Never touches * WordPress core tables, another plugin's data, or anything on the Email * Platform side (an uninstall here has no effect on the workspace's own * API key record - the workspace should separately revoke it if the key * is no longer needed). * * @package Emails404 */ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { exit; } require_once __DIR__ . '/includes/class-settings.php'; require_once __DIR__ . '/includes/class-site-display.php'; require_once __DIR__ . '/includes/class-form-connections.php'; require_once __DIR__ . '/includes/class-logger.php'; require_once __DIR__ . '/includes/class-retry-queue.php'; $option_names = array( \Emails404\Settings::OPTION_PLATFORM_URL, \Emails404\Settings::OPTION_API_KEY, \Emails404\Settings::OPTION_API_KEY_PREFIX, \Emails404\Settings::OPTION_CONNECTION_STATUS, \Emails404\Settings::OPTION_LAST_SUCCESS_AT, \Emails404\Settings::OPTION_LAST_FAILURE_AT, \Emails404\Settings::OPTION_LAST_ERROR_CATEGORY, \Emails404\Settings::OPTION_SELECTED_FORM_ID, \Emails404\Settings::OPTION_SELECTED_FORM_NAME, \Emails404\Settings::OPTION_ET_ENABLED, \Emails404\Settings::OPTION_ET_CONSENT_LABEL, \Emails404\Settings::OPTION_ET_CONSENT_VISIBLE, \Emails404\Settings::OPTION_ET_CONSENT_FIELD_SLUG, \Emails404\Settings::OPTION_WOO_ENABLED, \Emails404\Settings::OPTION_WOO_CONSENT_LABEL, \Emails404\Settings::OPTION_WOO_SELECTED_FORM_ID, \Emails404\Settings::OPTION_WOO_SELECTED_FORM_NAME, \Emails404\Settings::OPTION_WORKSPACE_NAME, \Emails404\Site_Display::OPTION, \Emails404\Form_Connections::OPTION, ); foreach ( $option_names as $option_name ) { delete_option( $option_name ); } delete_transient( 'emails404_remote_forms_cache' ); \Emails404\Logger::drop_table(); \Emails404\Retry_Queue::drop_table(); $timestamp = wp_next_scheduled( \Emails404\Retry_Queue::CRON_HOOK ); if ( $timestamp ) { wp_unschedule_event( $timestamp, \Emails404\Retry_Queue::CRON_HOOK ); }