HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/testingff/public_html/fdfctr/wp-content/plugins/quiz-master-next/uninstall.php
<?php
/**
 * If uninstall not called from WordPress, then exit.
 *
 * @package QSM
 */

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

//Do not allow to delete the data untill delete_qsm_data option is not set.
$settings   = (array) get_option( 'qmn-settings' );
if ( ! isset( $settings['delete_qsm_data'] ) ) {
    return;
}

global $wpdb;

$qsm_tables = array(
	'mlw_results',
	'mlw_quizzes',
	'mlw_questions',
	'mlw_qm_audit_trail',
);

// Drop the tables associated with our plugin.
foreach ( $qsm_tables as $table_name ) {
	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . $table_name );
}

// Taken from Easy Digital Downloads. Much better way of doing it than I was doing :)
// Cycle through custom post type array, retreive all posts, delete each one.
$qsm_post_types = array( 'qsm_quiz', 'qmn_log' );
foreach ( $qsm_post_types as $qsm_post_type ) {
	$items = get_posts(
		array(
			'post_type'   => $qsm_post_type,
			'post_status' => 'any',
			'numberposts' => -1,
			'fields'      => 'ids',
		)
	);
	if ( $items ) {
		foreach ( $items as $item ) {
			wp_delete_post( $item, true );
		}
	}
}

$qsm_options = array(
	'qmn_original_version',
	'mlw_advert_shows',
	'qmn_review_message_trigger',
	'qsm_update_db_column',
	'qsm_change_the_post_type',
	'qmn_quiz_taken_cnt',
	'qmn-settings',
	'qsm-quiz-settings',
	'mlw_quiz_master_version',
	'qmn_tracker_last_time',
	'qmn-tracking-notice',
	'mlw_qmn_review_notice',
	'qsm_upated_question_type_val',
	'qsm_update_quiz_db_column',
	'qsm_update_result_db_column',
);

// Remove the orphaned options now.
foreach ( $qsm_options as $option_name ) {
	delete_option( $option_name );
}

$qsm_transients = array(
	'qsm_sidebar_feed_data',
	'qmn_contributors',
	'qsm_ads_data',
	'qsm_admin_dashboard_data',
);

// Remove the orphaned transients now.
foreach ( $qsm_transients as $transient_name ) {
	delete_transient( $transient_name );
}