PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.3.2
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.3.2
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / uninstall.php

uninstall.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.3.2, at uninstall.php

53 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'WP_UNINSTALL_PLUGIN' ) || exit;
3
4 require_once __DIR__ . '/classes/Tools/InternalStateList.php';
5
6 global $wpdb;
7
8 // Delete Imagify options.
9 delete_site_option( 'imagify_settings' );
10 delete_site_option( 'imagify_old_version' );
11 delete_site_option( 'imagify_files_db_version' );
12 delete_site_option( 'imagify_folders_db_version' );
13 delete_option( 'imagify_data' );
14 delete_option( 'ngg_imagify_data_db_version' );
15 delete_option( $wpdb->prefix . 'ngg_imagify_data_db_version' );
16
17 // Delete all transients.
18 delete_site_transient( 'imagify_activation' );
19 delete_site_transient( 'imagify_check_licence_1' );
20 delete_site_transient( 'imagify_check_api_version' );
21 delete_site_transient( 'imagify_user' );
22 delete_site_transient( 'imagify_themes_plugins_to_sync' );
23 delete_site_transient( 'do_imagify_rating_cron' );
24 delete_site_transient( 'imagify_seen_rating_notice' );
25 delete_site_transient( 'imagify_user_images_count' );
26 delete_transient( 'imagify_activation' );
27 delete_transient( 'imagify_large_library' );
28 delete_transient( 'imagify_max_image_size' );
29 delete_transient( 'imagify_user' );
30 delete_transient( 'imagify_stat_without_next_gen' );
31 delete_transient( 'imagify_attachments_number_modal' );
32 delete_transient( 'imagify_user_cache' );
33 foreach ( \Imagify\Tools\InternalStateList::get_bulk_transients() as $transient ) {
34 delete_transient( $transient );
35 }
36
37 // Delete transients.
38 foreach ( \Imagify\Tools\InternalStateList::get_locked_transient_patterns() as $pattern ) {
39 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", $pattern ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQLPlaceholders.LikeWildcardsInQuery
40 }
41
42 // Clear scheduled hooks.
43 wp_clear_scheduled_hook( 'imagify_rating_event' );
44 wp_clear_scheduled_hook( 'imagify_update_library_size_calculations_event' );
45
46 // Delete all user meta related to Imagify.
47 delete_metadata( 'user', '', '_imagify_ignore_notices', '', true );
48
49 // Drop the tables.
50 $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->base_prefix . 'imagify_files' );
51 $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->base_prefix . 'imagify_folders' );
52 $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'ngg_imagify_data' );
53