robotstxt-manager/uninstall.php
2026-08-18 10:48:13 +00:00

31 lines
728 B
PHP

<?php
/**
* Uninstall routine for ROBOTSTXT Manager.
*
* @package Robotstxt_Manager
*/
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
if ( ! get_site_option( 'robotstxt_manager_delete_data_on_uninstall', false ) ) {
return;
}
$option_keys = array(
'robotstxt_manager_store_url',
'robotstxt_manager_api_key',
'robotstxt_manager_cache_ttl_minutes',
'robotstxt_manager_delete_data_on_uninstall',
);
foreach ( $option_keys as $key ) {
delete_site_option( $key );
}
delete_site_transient( 'robotstxt_manager_catalog' );
// Purge the WordPress update transient: premium entries carry the API key
// in their package URL. WordPress rebuilds it on the next update check.
delete_site_transient( 'update_plugins' );