WS_OK_7.4.33 HEX
HEX
Server: nginx/1.21.4
System: Linux v12674 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64
User: endtheignorance (1014)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v12674/lcacorpold/public_html/wp-content/plugins/cf-geoplugin/assets/js/script-public.js
/*
 * Geo Controller
 * @package           cf-geoplugin
 * @link              https://wordpress.org/plugins/cf-geoplugin/
 * @author            Ivijan-Stefan Stipic <ivijan.stefan@gmail.com>
 * @copyright         2014-2024 Ivijan-Stefan Stipic
 * @license           GPL v2 or later
 */
(function (jCFGP) {jCFGP(document).ready(function($){
	
	/*
	 * Fix banner shortcode cache
	 */
	(function(banner) {
		if (banner.length > 0 && CFGP.cache == 1) {
			banner.each(function() {
				var $this = jCFGP(this),
					$id = $this.attr('data-id') || '',
					$nonce = $this.attr('data-nonce') || '',
					ajaxOptions = {
						type: "POST",
						dataType: 'json',
						accept: 'application/json',
						url: (CFGP.rest_enabled == 1) ? CFGP.cache_banner_url : (typeof ajaxurl !== 'undefined' ? ajaxurl : CFGP.ajaxurl),
						data: {
							action: 'cf_geoplugin_banner_cache',
							id: $id,
							nonce: $nonce
						},
						async: true
					},
					handleResponse = function(data) {
						var isRestEnabled = CFGP.rest_enabled == 1;
						var success = isRestEnabled ? data.response !== 'false' && !data.error : data.success && data.data.response !== 'false';

						if (success) {
							$this.html(isRestEnabled ? data.response : data.data.response);
							$this.removeClass('cache').addClass('cached').removeAttr('data-nonce data-id');
						} else {
							$this.removeClass('cache').addClass('cache-fail').removeAttr('data-nonce data-id');
						}
					},
					handleError = function() {
						$this.removeClass('cache').addClass('cache-fail').removeAttr('data-nonce data-id');
					},
					sendAjaxRequest = function() {
						return jCFGP.ajax(ajaxOptions).done(handleResponse).fail(handleError);
					};

				// Make 3 attempts
				sendAjaxRequest().fail(function() {
					sendAjaxRequest().fail(function() {
						sendAjaxRequest();
					});
				});
			});
		}
	}(jCFGP('.cf-geoplugin-banner.cache')));
	

	/*
	 * Fix plugin shortcode cache
	 */
	(function(sc) {
		if (sc.length > 0 && CFGP.cache == 1) {
			sc.each(function() {
				var $this = jCFGP(this),
					$type = $this.attr('data-type') || '',
					$nonce = $this.attr('data-nonce') || '',
					ajaxOptions = {
						type: "POST",
						dataType: 'json',
						accept: 'application/json',
						url: (CFGP.rest_enabled == 1) ? CFGP.cache_shortcode_url : (typeof ajaxurl !== 'undefined' ? ajaxurl : CFGP.ajaxurl),
						data: {
							action: 'cf_geoplugin_shortcode_cache',
							nonce: $nonce,
							type: $type
						},
						async: true
					},
					handleResponse = function(data) {
						var isRestEnabled = CFGP.rest_enabled == 1;
						var success = isRestEnabled ? data.response !== 'false' && !data.error : data.success && data.data !== 'false';

						if (success) {
							$this.html(isRestEnabled ? data.response : data.data);
							$this.removeClass('cache').addClass('cached').removeAttr('data-type data-nonce');
						} else {
							$this.removeClass('cache').addClass('cache-fail').removeAttr('data-type data-nonce');
						}
					},
					handleError = function() {
						$this.removeClass('cache').addClass('cache-fail').removeAttr('data-type data-nonce');
					},
					sendAjaxRequest = function() {
						return jCFGP.ajax(ajaxOptions).done(handleResponse).fail(handleError);
					};

				// Make 3 attempts in case of failure
				sendAjaxRequest().fail(function() {
					sendAjaxRequest().fail(function() {
						sendAjaxRequest();
					});
				});
			});
		}
	}(jCFGP('.cf-geoplugin-shortcode.cache')));
	
});})(jQuery || window.jQuery || Zepto || window.Zepto);