# code-engine/0.4.5/uninstall.php

Code Engine – PHP Snippets, AI Functions &amp; Automation for WordPress, version 0.4.5. 38 lines.

- Page: https://pluginprobe.com/plugins/code-engine/0.4.5/code/uninstall.php
- Raw: https://pluginprobe.com/plugins/code-engine/0.4.5/raw/uninstall.php
- Modified: 2025-11-12T10:03:40+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/code-engine/0.4.5/code/uninstall.php#L10-L20`.

```php
<?php
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
    die;
}

function mwcode_remove_database() {
	global $wpdb;
	$table_name1 = $wpdb->prefix . "mwcode_snippets";
	$sql = "DROP TABLE IF EXISTS $table_name1";
	$wpdb->query( $sql );

	
}

function mwcode_remove_options() {

	// Delete the options
	$option_functions = 'mwcode_functions';
    $option_intervals = 'mwcode_intervals';
	$options = 'mwcode_options';

	delete_option( $options );
	delete_option( $option_functions );
	delete_option( $option_intervals );
}

function mwcode_uninstall () {
	$options = get_option( 'mwcode_options' );
	$cleanUninstall = array_key_exists( 'clean_uninstall', $options ) ? $options['clean_uninstall'] : false;

	if ( $cleanUninstall ) {
		mwcode_remove_options();
		mwcode_remove_database();
	}

}

mwcode_uninstall();
```
