PageSourceSearch

https://www.lesailesdularge.fr/wp-content/plugins/honeypot/includes/js/wpa.js?ver=2.4

js lesailesdularge.fr collected 2026-10-04 02:54:22 UTC 6,290 bytes, 146 lines download raw bytes

1var wpa_field_name, wpa_unique_id, wpa_add_test, wpa_hidden_field;
2
3jQuery(document).ready(function(){	
4	wpa_field_name 	= wpa_field_info.wpa_field_name;
5	wpa_unique_id 	= wpa_field_info.wpa_field_value;
6	wpa_add_test 	= wpa_field_info.wpa_add_test;
7
8	wpa_hidden_field 			= "<div id='altEmail_container' class='altEmail_container'><label for='alt_s'>Alternative:</label><input type='text' id='alt_s' name='alt_s' ></div><span class='wpa_hidden_field' style='display:none;height:0;width:0;'><label>WPA <input type='text' name='"+wpa_field_name+"' value='"+wpa_unique_id+"' /></label></span>";
9
10	var wpa_injected = false;
11	function inject_wpa() {
12		if (wpa_injected) return;
13		wpa_injected = true;
14
15		wpa_add_honeypot_field();
16
17		if (typeof wpae_add_honeypot_field == 'function') { // IF EXTENDED version exists.
18		  wpae_add_honeypot_field(); 
19		}
20		
21		if (wpa_add_test == 'yes'){
22			wpa_add_test_block();
23		}
24
25		jQuery(document).off('mousemove keydown scroll touchstart focusin mousedown click', trigger_wpa_injection);
26	}
27
28	function trigger_wpa_injection() {
29		inject_wpa();
30	}
31
32	// Trigger on user interaction
33	jQuery(document).on('mousemove keydown scroll touchstart focusin mousedown click', trigger_wpa_injection);
34
35	// Fallback: inject after 2 seconds delay
36	setTimeout(inject_wpa, 2000);
37});
38
39function wpa_act_as_spam(){
40	actiontype = jQuery('span.wpa-button').data('actiontype');
41	if (actiontype == 'remove'){
42		wpa_remove_honeypot_field();
43		jQuery('span.wpa-button').data('actiontype','add');
44		jQuery('span.wpa-button').html('Acting as Spam Bot');
45	} else {
46		wpa_add_honeypot_field();
47		jQuery('span.wpa-button').data('actiontype','remove');
48		jQuery('span.wpa-button').html('Act as Spam Bot');
49	}
50}
51
52function wpa_add_honeypot_field(){
53	
54	// Combined form selectors
55	var allFormSelectors = [
56	    // Main forms
57	    'form.wpcf7-form, .wpcf7 form',        // CONTACT FORM 7
58	    'form.wpforms-form',                   // WPForms
59	    '.gform_wrapper form',                 // Gravity Forms
60	    '.frm_forms form',                     // Formidable Forms
61	    '.caldera-grid form',                  // Caldera Forms
62	    '.wp-block-toolset-cred-form form',    // Toolset Forms
63	    'form.cred-user-form',                 // Toolset Forms
64	    'form.cred-form',                      // Toolset Forms
65	    'form.et_pb_contact_form',             // Divi Form
66	    'form.fb_form',                        // Divi Form Builder - Divi Engine
67	    'form.elementor-form',                 // Elementor
68	    'form.form-contribution',              // WooCommerce Reviews Pro
69	    'form.cart',                           // WooCommerce Cart
70	    'form#learn-press-checkout-form',      // LearnPress Checkout Form
71
72	    'form.wpa_form',						   // Generic Class
73	    '.wpa_form form',					   // Generic Class	
74
75	    '.um-form form',						// Ulimate Membership Form
76
77	    // Login forms
78	    'form.spectra-pro-login-form',         // SPECTRA LOGIN FORM
79	    'form#loginform',                      // Default Login Form
80	    'form#edd_login_form',                 // EDD LOGIN FORM
81	    'form.uwp-login-form',                 // USER WP LOGIN FORM
82	    '.et_pb_login_form form',			   // For Elementor login form
83	    'form.eael-login-form',				   // essential-addons login form
84	    'form.user-registration-form-login',   // User Registration & Membership for WordPress
85
86	    'form#lostpasswordform',			   // Lost Password Form
87	    'form.lost_reset_password',            // Tutor Password Form
88	    'form.ur_lost_reset_password',    	   // User Registration & Membership for WordPress	    
89
90	    
91	    //Registration Forms
92	    'form.register',            		   // User Registration & Membership for WordPress
93
94	    // Comment forms
95	    'form#commentform',                    // WP Comment with ID
96	    'form.ast-commentform',                // Astra Comment Form with class
97	    'form#fl-comment-form',                // Beaver Builder Theme Form with ID
98	    'form.comment-form',                   // WP Comment with class
99	    '.review-form form',                   // LearnPress Review
100	    'form#edd-reviews-form',               // EDD Reviews with ID
101	    'form.wpr-comment-form',				
102
103	    // BBPress forms
104	    '.bbp-topic-form form',                // BBPress Topic Form
105	    '.bbp-reply-form form'                 // BBPress Reply Form
106	];
107
108	// Append hidden field to all forms in the combined selector list
109	jQuery(allFormSelectors.join(', ')).append(wpa_hidden_field);
110	
111	// FOR FLUENT FORMS
112	jQuery('form.frm-fluent-form').append(wpa_hidden_field); // FOR Fluent Forms
113	jQuery('.ff_conv_app').append(wpa_hidden_field); // FOR Fluent Convertional Forms
114
115	if (typeof fluent_forms_global_var_1 !== 'undefined') { // QUICK HACK FOR FLUENT FORMS CONVERSIONAL
116    	fluent_forms_global_var_1.extra_inputs[wpa_field_name] = wpa_unique_id;
117    	fluent_forms_global_var_1.extra_inputs['alt_s'] = '';
118	}
119	// EOF FLUENT FORMS 
120
121	jQuery('input.wpa_initiator').each(function() {
122	    var $form = jQuery(this).closest('form'); // Get the parent form of input.wpa_initiator
123	    
124	    // Check if wpa_hidden_field exists in the form, if not, insert it after input.wpa_initiator
125	    if ($form.find('.wpa_hidden_field').length === 0) {
126	        jQuery(wpa_hidden_field).insertAfter(this);
127	    }
128	});
129	
130}
131
132function wpa_add_test_block(){
133	checkingTest = '<div class="wpa-test-msg"><strong>WP Armour ( Only visible to site administrators. Not visible to other users. )</strong><br />This form has a honeypot trap enabled. If you want to act as spam bot for testing purposes, please click the button below.<br/><span class="wpa-button" onclick="wpa_act_as_spam()" data-actiontype="remove">Act as Spam Bot</span></div>';
134	jQuery('.wpa-test-msg').remove(); // Clear First
135	jQuery('span.wpa_hidden_field').after(checkingTest);
136}
137
138function wpa_remove_honeypot_field(){
139	jQuery('.wpa_hidden_field').remove();
140	jQuery('#altEmail_container, .altEmail_container').remove();
141
142	if (typeof fluent_forms_global_var_1 !== 'undefined') { 
143    	delete fluent_forms_global_var_1.extra_inputs[wpa_field_name];
144    	delete fluent_forms_global_var_1.extra_inputs['alt_s'];
145	}
146}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.