File "update.php"

Full Path: /home/romayxjt/public_html/wp-content/plugins/vikbooking/libraries/html/license/update.php
File size: 1.31 KB
MIME-type: text/x-php
Charset: utf-8

<?php
/** 
 * @package   	VikBooking - Libraries
 * @subpackage 	html.update
 * @author    	E4J s.r.l.
 * @copyright 	Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
 * @license  	http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @link 		https://vikwp.com
 */

// No direct access
defined('ABSPATH') or die('No script kiddies please!');

// define alert message
$__alert = __(
	"Your PRO license is expired, if you proceed with the update, you'll lose access to the features unlocked with the PRO version. We strongly recommend to update the plugin only after renewing your license.\nWould you like to proceed anyway?",
	'vikbooking'
);

?>

<script>

	jQuery(function($) {
		// retrieve VikBooking update link
		var link = $('#vikbooking-update a.update-link');

		// define callback to invoke when the update button gets clicked
		var implementor = function(event) {
			// prevent default event
			event.preventDefault();
			event.stopPropagation();

			// prompt alert message
			var r = confirm(<?php echo json_encode($__alert); ?>);

			if (r) {
				// turn off click event
				link.off('click', implementor);

				setTimeout(() => {
					// trigger click to auto-dispatch the update
					link.trigger('click');
				}, 32);
			}

			return false;
		};

		// override default click event
		link.on('click', implementor);
	});

</script>