diff --git a/src/class-tiny-plugin.php b/src/class-tiny-plugin.php index facff18..f0d324b 100644 --- a/src/class-tiny-plugin.php +++ b/src/class-tiny-plugin.php @@ -861,6 +861,14 @@ public function clean_attachment( $post_id ) { $tiny_image->delete_converted_image(); } + /** + * Runs on uninstall + * + * @return void + */ + public static function uninstall() { + Tiny_Apache_Rewrite::uninstall_rules(); + } public function mark_image_as_compressed() { $response = $this->validate_ajax_attachment_request(); diff --git a/tiny-compress-images.php b/tiny-compress-images.php index 4a92b9b..f77bd68 100644 --- a/tiny-compress-images.php +++ b/tiny-compress-images.php @@ -38,3 +38,8 @@ } $tiny_plugin = new Tiny_Plugin(); + +register_uninstall_hook( + __FILE__, + array( 'Tiny_Plugin', 'uninstall' ) +); diff --git a/uninstall.php b/uninstall.php deleted file mode 100644 index 79745b9..0000000 --- a/uninstall.php +++ /dev/null @@ -1,14 +0,0 @@ -