Settings > Products > Warranty Desk: the shop owns its * history and must be able to export it first (G16). * * @package ABCreate\WarrantyDesk */ declare(strict_types=1); defined('WP_UNINSTALL_PLUGIN') || exit; if ('yes' !== get_option('abcreate_wd_delete_data_on_uninstall')) { return; } require_once __DIR__ . '/src/Infrastructure/Schema.php'; \ABCreate\WarrantyDesk\Infrastructure\Schema::drop(); // Queued actions that would write to the dropped tables. if (function_exists('as_unschedule_all_actions')) { as_unschedule_all_actions('', [], 'abcreate-warranty-desk'); } // The guarantee months the plugin kept on products (used goods). delete_post_meta_by_key('_ab_wd_guarantee_months'); foreach (['administrator', 'shop_manager'] as $abcreate_wd_role_name) { $abcreate_wd_role = get_role($abcreate_wd_role_name); if ($abcreate_wd_role) { $abcreate_wd_role->remove_cap('abcreate_wd_view'); $abcreate_wd_role->remove_cap('abcreate_wd_manage'); } } foreach (['transit_days', 'target_days', 'informativa_subject', 'informativa_body', 'notice_attachment', 'notice_alt', 'caps', 'delete_data_on_uninstall'] as $abcreate_wd_option) { delete_option('abcreate_wd_' . $abcreate_wd_option); }