# imagify/1.7/uninstall.php

Imagify Image Optimization: Optimize Images | Compress &amp; Convert to WebP/AVIF, version 1.7. 47 lines.

- Page: https://pluginprobe.com/plugins/imagify/1.7/code/uninstall.php
- Raw: https://pluginprobe.com/plugins/imagify/1.7/raw/uninstall.php
- Modified: 2018-03-13T14:15:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/imagify/1.7/code/uninstall.php#L10-L20`.

```php
<?php
defined( 'WP_UNINSTALL_PLUGIN' ) || die( 'Cheatin&#8217; uh?' );

global $wpdb;

// Delete Imagify options.
delete_site_option( 'imagify_settings' );
delete_site_option( 'imagify_old_version' );
delete_site_option( 'imagify_files_db_version' );
delete_site_option( 'imagify_folders_db_version' );
delete_site_option( 'do_imagify_rating_cron' );
delete_site_option( 'imagify_seen_rating_notice' );
delete_site_option( 'imagify_user_images_count' );
delete_option( 'imagify_data' );
delete_option( 'ngg_imagify_data_db_version' );
delete_option( $wpdb->prefix . 'ngg_imagify_data_db_version' );

// Delete all transients.
delete_site_transient( 'imagify_check_licence_1' );
delete_site_transient( 'imagify_user' );
delete_transient( 'imagify_bulk_optimization_level' );
delete_transient( 'imagify_bulk_optimization_infos' );
delete_transient( 'imagify_large_library' );
delete_transient( 'imagify_max_image_size' );
delete_transient( 'imagify_user' );

// Delete transients.
$transients = implode( '" OR option_name LIKE "', array(
	'_transient_%imagify-async-in-progress-%',
	'_transient_%imagify-ngg-async-in-progress-%',
	'_site_transient_%imagify-file-async-in-progress-%',
	'_transient_%imagify_rpc_%',
) );
$wpdb->query( 'DELETE from ' . $wpdb->options . ' WHERE option_name LIKE "' . $transients . '"' ); // WPCS: unprepared SQL ok.

// Clear scheduled hooks.
wp_clear_scheduled_hook( 'imagify_rating_event' );
wp_clear_scheduled_hook( 'imagify_update_library_size_calculations_event' );

// Delete all user meta related to Imagify.
delete_metadata( 'user', '', '_imagify_ignore_notices', '', true );

// Drop the tables.
$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->base_prefix . 'imagify_files' );
$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->base_prefix . 'imagify_folders' );
$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'ngg_imagify_data' );

```
