HEX
Server: Apache/2.4.59 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2
System: Linux panel.ctvbarranquilla.com 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64
User: bastidas (1002)
PHP: 8.2.18
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen
Upload Files
File: /home/bastidas/web/bastidas.tv/public_html/wp-content/plugins/json-content-importer/uninstall.php
<?php

if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) exit();

UNINSTALL_jci_plugin_options();

function UNINSTALL_jci_plugin_options() {
    global $wpdb;
    if (function_exists('is_multisite') && is_multisite()) {
		$blogIdCurrent = $wpdb->blogid;  // retrieve blogIds
	  	#$query = $wpdb->prepare(
		#	"SELECT blog_id FROM %s",
		#	$wpdb->blogs
		#);	  
		#	$sql = $wpdb->prepare($query, 'publish');
		#$blogIdArr = $wpdb->get_results($sql);
		$sites = get_sites();
        foreach ($sites as $site) {
			switch_to_blog($site->blog_id);
				UNINSTALL_jci_options();
        }
		switch_to_blog($blogIdCurrent);
		return;
    }
    UNINSTALL_jci_options();
	delete_option( "jci_uninstall_deleteall" );
}

function UNINSTALL_jci_options() {
  if (get_option('jci_uninstall_deleteall')==1) {
    delete_option( "jci_json_url" );
	delete_option( "jci_enable_cache" );
    delete_option( "jci_cache_time" );
    delete_option( "jci_cache_time_format" );
    delete_option( "jci_oauth_bearer_access_key" );
    delete_option( "jci_http_header_default_useragent" );
    delete_option( "jci_gutenberg_off" );
    delete_option( "jci_sslverify_off" );
    delete_option( "jci_api_errorhandling" );
  }
}

UNINSTALL_jci_plugin_cacher();

if ( ! function_exists( 'request_filesystem_credentials' ) ) {
    require_once ABSPATH . 'wp-admin/includes/file.php';
}
function UNINSTALL_jci_plugin_cacher() {
	$cacheFolder = WP_CONTENT_DIR.'/cache/jsoncontentimporter/';
	return delete_plugin_cache_directory($cacheFolder);
}

function delete_plugin_cache_directory($dir) {
    $url = wp_nonce_url('index.php', 'my-nonce-del-jci');
    $credentials = request_filesystem_credentials($url);
    if (!WP_Filesystem($credentials)) {
        return false;
    }
    global $wp_filesystem;
    if ($wp_filesystem->rmdir($dir, true)) {
        return true;
    } else {
        return false;
    }
}
?>