HEX
Server: LiteSpeed
System: Linux cde2.duelhost.dk 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User: dtptviut (1121)
PHP: 8.0.30
Disabled: exec,system,passthru,shell_exec,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/dtptviut/domains/teleweb.dk/public_html/wp-content/plugins/widget-css-classes/uninstall.php
<?php
/**
 * Widget CSS Classes plugin uninstall
 *
 * Uninstall
 * @author Jory Hogeveen <info@keraweb.nl>
 * @package widget-css-classes
 * @version 1.5.1
 * @todo Uninstall for multi-networks
 */

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

wcssc_uninstall();

if ( is_multisite() ) {
	global $wp_version;
	if ( version_compare( $wp_version, '4.5.999', '<' ) ) {
		// @codingStandardsIgnoreLine - Sadly does not work for large networks -> return false
		$blogs = wp_get_sites();
	} else {
		$blogs = get_sites();
	}
	if ( ! empty( $blogs ) ) {
		foreach ( $blogs as $blog ) {
			$blog = (array) $blog;
			wcssc_uninstall( intval( $blog['blog_id'] ) );
		}
		wcssc_uninstall( 'site' );
	}
}

function wcssc_uninstall( $blog_id = false ) {

	// Delete all options
	$option_keys = array( 'WCSSC_options', 'WCSSC_db_version' );
	if ( $blog_id ) {
		if ( 'site' === $blog_id ) {
			foreach ( $option_keys as $option_key ) {
				delete_site_option( $option_key );
			}
		} else {
			foreach ( $option_keys as $option_key ) {
				delete_blog_option( $blog_id, $option_key );
			}
		}
	} else {
		foreach ( $option_keys as $option_key ) {
			delete_option( $option_key );
		}
	}

}