HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: /var/www/indoadvisory/wp/wp-content/plugins/polylang-wc/uninstall.php
<?php
/**
 * @package Polylang-WC
 */

// If uninstall not called from WordPress exit.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit();
}

/**
 * Manages Polylang for WooCommerce uninstallation.
 *
 * @since 0.4
 */
class PLLWC_Uninstall {

	/**
	 * Constructor: manages uninstall for multisite.
	 *
	 * @since 0.4
	 */
	public function __construct() {
		global $wpdb;

		// Check if it is a multisite uninstall - if so, run the uninstall function for each blog id.
		if ( is_multisite() ) {
			foreach ( $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs}" ) as $blog_id ) {
				switch_to_blog( $blog_id );
				$this->uninstall();
			}
			restore_current_blog();
		} else {
			$this->uninstall();
		}
	}

	/**
	 * Removes ALL plugin data.
	 *
	 * @since 0.4
	 */
	public function uninstall() {
		// Delete options.
		delete_option( 'polylang-wc' );
	}
}

new PLLWC_Uninstall();