# button-generation/2.3.9/includes/plugin-deactivation.php

Button Generator – Easily Create Custom Buttons with Icons and Analytics, version 2.3.9. 44 lines.

- Page: https://pluginprobe.com/plugins/button-generation/2.3.9/code/includes/plugin-deactivation.php
- Raw: https://pluginprobe.com/plugins/button-generation/2.3.9/raw/includes/plugin-deactivation.php
- Modified: 2024-01-24T07:37:22+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/button-generation/2.3.9/code/includes/plugin-deactivation.php#L10-L20`.

```php
<?php
/**
 * Deactivation function
 *
 * @package     Wow_Plugin
 * @subpackage  Includes/Dectivation
 * @author      Wow-Company <yoda@wow-company.com>
 * @copyright   2019 Wow-Company
 * @license     GNU Public License
 * @version     1.0

 */
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Get the plugin folder in 'uploads'
 */
$upload  = wp_upload_dir();
$field   = dirname( plugin_basename( __FILE__ ), 2 );
$basedir = $upload['basedir'] . '/' . $field . '/';

/**
 * Delete the plugin folder and files from wp-upload
 */
if ( is_dir( $basedir ) ) {
	
	$is_empty = count( glob( $basedir . '*' ) ) ? true : false;
	if ( $is_empty === true ) {
		$handle = opendir( $basedir );
		
		while ( false !== ( $file = readdir( $handle ) ) ) {
			
			if ( $file != "." && $file != ".." ) {
				wp_delete_file( $basedir . $file );
			}
			
		}
		closedir( $basedir );
	}
	rmdir( $basedir );
}

```
