<?php
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit;
}

delete_option( 'mdce_settings' );

delete_post_meta_by_key( '_mdce_expiration_date' );
delete_post_meta_by_key( '_mdce_expiration_action' );

$cron = _get_cron_array();
foreach ( $cron as $timestamp => $hooks ) {
	if ( isset( $hooks['mdce_expire_post'] ) ) {
		foreach ( $hooks['mdce_expire_post'] as $hook ) {
			$post_id = reset( $hook['args'] );
			wp_clear_scheduled_hook( 'mdce_expire_post', [ $post_id ] );
		}
	}
}
