jQuery(function ($) {

	$('a[href^="plugins.php?action=deactivate&plugin=sdp-custom-order-status"]').attr('onclick', 'if (!deactivation_order_status()) return false;');
	});

function deactivation_order_status () {

	if (typeof Swal !== 'undefined') {

		Swal.fire({
			title: scos_texts.question,
			text: scos_texts.warning,
			icon: 'warning',
			showCancelButton: true,
			confirmButtonColor: '#c42030',
			confirmButtonText: scos_texts.yes,
			cancelButtonText: scos_texts.no,
		}).then((result) => {
    		if (result.isConfirmed) {
				Swal.fire({
					title: scos_texts.success,
					text: scos_texts.complete,
					confirmButtonColor: '#2778c4',
					icon: 'success',
					});
				var destino = jQuery('a[href^="plugins.php?action=deactivate&plugin=sdp-custom-order-status"]').attr('href');
				location.href = destino;
    			}
			});
		}

	else
		alert(scos_texts.warning);
	}