PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
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
← All changes | uninstall.php +13 -11 1.10 → trunk View file →
@@ -1,7 +1,9 @@
1 1 <?php
2 -defined( 'WP_UNINSTALL_PLUGIN' ) || die( 'Cheatin&#8217; uh?' );
2 +defined( 'WP_UNINSTALL_PLUGIN' ) || exit;
3 3
4 +require_once __DIR__ . '/classes/Tools/InternalStateList.php';
5 +
4 6 global $wpdb;
5 7
6 8 // Delete Imagify options.
7 9 delete_site_option( 'imagify_settings' );
@@ -14,8 +16,9 @@
14 16
15 17 // Delete all transients.
16 18 delete_site_transient( 'imagify_activation' );
17 19 delete_site_transient( 'imagify_check_licence_1' );
20 +delete_site_transient( 'imagify_check_api_version' );
18 21 delete_site_transient( 'imagify_user' );
19 22 delete_site_transient( 'imagify_themes_plugins_to_sync' );
20 23 delete_site_transient( 'do_imagify_rating_cron' );
21 24 delete_site_transient( 'imagify_seen_rating_notice' );
@@ -20,23 +23,22 @@
20 23 delete_site_transient( 'do_imagify_rating_cron' );
21 24 delete_site_transient( 'imagify_seen_rating_notice' );
22 25 delete_site_transient( 'imagify_user_images_count' );
23 26 delete_transient( 'imagify_activation' );
24 -delete_transient( 'imagify_bulk_optimization_level' );
25 -delete_transient( 'imagify_bulk_optimization_infos' );
26 27 delete_transient( 'imagify_large_library' );
27 28 delete_transient( 'imagify_max_image_size' );
28 29 delete_transient( 'imagify_user' );
29 -delete_transient( 'imagify_stat_without_webp' );
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 +}
30 36
31 37 // Delete transients.
32 -$transients = implode( '" OR option_name LIKE "', array(
33 - '\_transient\_%imagify-auto-optimize-%',
34 - '\_transient\_%imagify\_rpc\_%',
35 - '\_transient\_imagify\_%\_process\_locked',
36 - '\_site\_transient\_imagify\_%\_process\_lock%',
37 -) );
38 -$wpdb->query( "DELETE from $wpdb->options WHERE option_name LIKE \"$transients\"" ); // WPCS: unprepared SQL ok.
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 +}
39 41
40 42 // Clear scheduled hooks.
41 43 wp_clear_scheduled_hook( 'imagify_rating_event' );
42 44 wp_clear_scheduled_hook( 'imagify_update_library_size_calculations_event' );