HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux aritmodecarnaval.es 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: www-data (33)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/www/torresncgolf/wp-content/plugins/wordfence-assistant/js/admin.js
if(! window['wordfenceAst']){ //To compile for checking: java -jar /usr/local/bin/closure.jar --js=admin.js --js_output_file=test.js
window['wordfenceAst'] = {
	loadingCount: 0,
	nonce: '',
	init: function(){
		this.nonce = WordfenceAstVars.firstNonce; 
		jQuery('.wf-assistant-checkbox').each(function() {
			var checkbox = jQuery(this).find('input[type=checkbox]');
			jQuery(this).find('label').on('click', function() {
				checkbox.trigger('click');
			});
		});
	},
	delAll: function(){
		var delete2faSecrets = jQuery('#delete_2fa_secrets').prop('checked');
		var message;
		if (delete2faSecrets) {
			message = "Are you sure you want to delete all Wordfence data and tables, including 2FA secrets?";
		}
		else {
			message = "Are you sure you want to delete all Wordfence data and tables except for 2FA secrets?";
		}
		if(confirm(message)){
			this.ajax({ func: 'delAll', delete2faSecrets: delete2faSecrets });
		}
	},
	clearLocks: function(){
		if(confirm("Are you sure you want to clear all locked IP addresses, users and any advanced locks you have?")){
			this.ajax({ func: 'clearLocks' });
		}
	},
	clearLiveTraffic: function(){
		if(confirm("Are you sure you want to delete all Live Traffic Data for Wordfence?")){
			this.ajax({ func: 'clearLiveTraffic' });
		}
	},
	disableFirewall: function(){
		if(confirm("Are you sure you want to disable the Wordfence firewall?")){
			this.ajax({ func: 'disableFirewall' }, function(json) {
				if (json.html) {
					jQuery('#disableFirewall').html(json.html);
				}
			});
		}
	},
	finalizeDisableFirewall: function() {
		this.ajax({ func: 'finalizeDisableFirewall' }, function() {
			jQuery('#disableFirewall').html('');
		});
	},
	disableBlacklist: function() {
		if(confirm("Are you sure you want to disable the Wordfence IP Blocklist?")){
			this.ajax({ func: 'disableIPBlacklist' });
		}
	},
	disableAutoUpdate: function() {
		if(confirm("Are you sure you want to disable Wordfence automatic updates?")){
			this.ajax({ func: 'disableAutoUpdate' });
		}
	},
	ajax: function(data, callback){
		if(typeof(data) == 'string'){
			if(data.length > 0){
				data += '&';
			}
			data += 'action=wordfenceAssistant_do&nonce=' + this.nonce;
		} else if(typeof(data) == 'object'){
			data['action'] = 'wordfenceAssistant_do';
			data['nonce'] = this.nonce;
		}
		var self = this;
		this.showLoading();
		jQuery.ajax({
			type: 'POST',
			url: WordfenceAstVars.ajaxURL,
			dataType: "json",
			data: data,
			success: function(json){ 
				self.removeLoading();
				if(json && json.nonce){
					self.nonce = json.nonce;
				}
				if(json && json.errorMsg){
					alert('An error occurred: ' + json.errorMsg);
				}
				if(json.msg){
					alert(json.msg);
				}
				typeof callback === 'function' && callback(json);
			},
			error: function(){ 
				self.removeLoading();  
			}
			});
	},
	showLoading: function(){
		this.loadingCount++;
		if(this.loadingCount == 1){
			jQuery('<div id="wordfenceAstWorking">Wordfence Assistant is working...</div>').appendTo('body');
		}
	},
	removeLoading: function(){
		this.loadingCount--;
		if(this.loadingCount == 0){
			jQuery('#wordfenceAstWorking').remove();
		}
	}
};
window['WFAST'] = window['wordfenceAst'];
}
jQuery(function(){
	wordfenceAst.init();
});