Warning: Constant SEO_LINKS_API_ENDPOINT already defined in /www/wwwroot/fni.gov.mz/wp-content/plugins/wordpress-plugin/wordpress-plugin.php on line 10
HEX
HEX
Server: Apache
System: Linux paginas.localdomain 4.15.0-200-generic #211-Ubuntu SMP Thu Nov 24 18:16:04 UTC 2022 x86_64
User: www (1002)
PHP: 8.0.11
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/fni.gov.mz/wp-content/plugins/google-calendar-events/uninstall.php
<?php
/**
 * Fired when the plugin is uninstalled.
 *
 * @package SimpleCalendar
 */

// Exit if not uninstalling from WordPress.
if (!defined('WP_UNINSTALL_PLUGIN')) {
	exit();
}

// Get user options whether to delete settings and/or data.
$settings = get_option('simple-calendar_settings_advanced');

if (isset($settings['installation']['delete_settings'])) {
	$delete_settings = 'yes' == $settings['installation']['delete_settings'] ? true : false;
} else {
	$delete_settings = false;
}

if (isset($settings['installation']['erase_data'])) {
	$erase_data = 'yes' == $settings['installation']['erase_data'] ? true : false;
} else {
	$erase_data = false;
}

global $wpdb;

// Delete settings.
if ($delete_settings === true || $erase_data === true) {
	$wpdb->query(
		"
DELETE FROM $wpdb->options WHERE option_name LIKE '%simple-calendar%';
"
	);
}

// Delete calendar data.
if ($erase_data === true) {
	// Delete calendar posts.
	$wpdb->query(
		"
DELETE FROM {$wpdb->posts} WHERE post_type IN ( 'calendar' );
"
	);

	// Delete calendar postmeta.
	$wpdb->query("
DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;
");

	// Delete calendar terms.
	$terms = get_terms(['calendar_category', 'calendar_feed', 'calendar_type']);
	if (!empty($terms) && is_array($terms)) {
		foreach ($terms as $term) {
			wp_delete_term($term->term_id, $term->taxonomy);
		}
	}
}