32 lines
788 B
PHP
32 lines
788 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' );
|
|
delete_site_transient( 'robotstxt_manager_subscriptions' );
|
|
|
|
// 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' );
|