WP Armour – Honeypot Anti Spam - Version 1.8

Version Description

  • Added dynamic value for honeypot field test
Download this release

Release Info

Developer dnesscarkey
Plugin Icon 128x128 WP Armour – Honeypot Anti Spam
Version 1.8
Comparing to
See all releases

Code changes from version 1.7.2 to 1.8

includes/integration/wpa_bbpress.php CHANGED
@@ -5,7 +5,7 @@ add_action( 'bbp_new_topic_pre_extras','wpa_bbp_extra_validation');
5
  add_action( 'bbp_new_reply_pre_extras','wpa_bbp_extra_validation');
6
 
7
  function wpa_bbp_extra_validation(){
8
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
9
  do_action('wpa_handle_spammers','bbpress');
10
  bbp_add_error( 'bbp_extra_email', __( $GLOBALS['wpa_error_message'], 'bbpress' ) );
11
  }
5
  add_action( 'bbp_new_reply_pre_extras','wpa_bbp_extra_validation');
6
 
7
  function wpa_bbp_extra_validation(){
8
+ if (wpa_check_is_spam($_POST)){
9
  do_action('wpa_handle_spammers','bbpress');
10
  bbp_add_error( 'bbp_extra_email', __( $GLOBALS['wpa_error_message'], 'bbpress' ) );
11
  }
includes/integration/wpa_calderaforms.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  function wpa_calderaforms_extra_validation( ) {
4
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
5
  do_action('wpa_handle_spammers','calderaforms');
6
  die($GLOBALS['wpa_error_message']);
7
  }
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  function wpa_calderaforms_extra_validation( ) {
4
+ if (wpa_check_is_spam($_POST)){
5
  do_action('wpa_handle_spammers','calderaforms');
6
  die($GLOBALS['wpa_error_message']);
7
  }
includes/integration/wpa_contactform7.php CHANGED
@@ -3,7 +3,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
3
  add_filter( 'wpcf7_validate', 'wpa_contactform7_extra_validation', 10, 2 );
4
 
5
  function wpa_contactform7_extra_validation($result, $tags){
6
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
7
  do_action('wpa_handle_spammers','contactform7');
8
  $result->invalidate('', $GLOBALS['wpa_error_message']);
9
  }
3
  add_filter( 'wpcf7_validate', 'wpa_contactform7_extra_validation', 10, 2 );
4
 
5
  function wpa_contactform7_extra_validation($result, $tags){
6
+ if (wpa_check_is_spam($_POST)){
7
  do_action('wpa_handle_spammers','contactform7');
8
  $result->invalidate('', $GLOBALS['wpa_error_message']);
9
  }
includes/integration/wpa_diviform.php CHANGED
@@ -8,7 +8,7 @@ foreach($_POST as $param => $value){
8
  }
9
 
10
  if(!empty($is_divi_form) && $is_divi_form == 'true'){
11
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
12
  do_action('wpa_handle_spammers','divi_form');
13
  echo "<div id='et_pb_contact_form{$divi_form_additional}'><p>".$GLOBALS['wpa_error_message']."</p><div></div></div>";
14
  die();
8
  }
9
 
10
  if(!empty($is_divi_form) && $is_divi_form == 'true'){
11
+ if (wpa_check_is_spam($_POST)){
12
  do_action('wpa_handle_spammers','divi_form');
13
  echo "<div id='et_pb_contact_form{$divi_form_additional}'><p>".$GLOBALS['wpa_error_message']."</p><div></div></div>";
14
  die();
includes/integration/wpa_elementor.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  function wpa_elementor_extra_validation( $record, $ajax_handler ) {
4
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
5
  $all_fields = $record->get( 'fields' );
6
  $firstField = array_key_first($all_fields);
7
  do_action('wpa_handle_spammers','elementor');
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  function wpa_elementor_extra_validation( $record, $ajax_handler ) {
4
+ if (wpa_check_is_spam($_POST)){
5
  $all_fields = $record->get( 'fields' );
6
  $firstField = array_key_first($all_fields);
7
  do_action('wpa_handle_spammers','elementor');
includes/integration/wpa_fluentform.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  function wpa_fluent_form_extra_validation($insertData, $data, $form) {
4
- if (!isset($data[ $GLOBALS['wpa_field_name']] )){
5
  do_action('wpa_handle_spammers','fluent_forms');
6
  die($GLOBALS['wpa_error_message']);
7
  }
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  function wpa_fluent_form_extra_validation($insertData, $data, $form) {
4
+ if (wpa_check_is_spam($data)){
5
  do_action('wpa_handle_spammers','fluent_forms');
6
  die($GLOBALS['wpa_error_message']);
7
  }
includes/integration/wpa_formidable.php CHANGED
@@ -3,7 +3,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
3
  add_filter( 'frm_validate_entry', 'wpa_formidable_extra_validation', 10, 2 );
4
 
5
  function wpa_formidable_extra_validation($errors, $values){
6
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
7
  do_action('wpa_handle_spammers','formidable');
8
  $errors['my_error'] = $GLOBALS['wpa_error_message'];
9
  }
3
  add_filter( 'frm_validate_entry', 'wpa_formidable_extra_validation', 10, 2 );
4
 
5
  function wpa_formidable_extra_validation($errors, $values){
6
+ if (wpa_check_is_spam($_POST)){
7
  do_action('wpa_handle_spammers','formidable');
8
  $errors['my_error'] = $GLOBALS['wpa_error_message'];
9
  }
includes/integration/wpa_gravityforms.php CHANGED
@@ -3,7 +3,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
3
  add_action( 'gform_validation', 'wpa_gravityforms_extra_validation');
4
 
5
  function wpa_gravityforms_extra_validation($validation_result ){
6
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
7
  $form = $validation_result['form'];
8
  do_action('wpa_handle_spammers','gravityforms');
9
  $validation_result['is_valid'] = false;
3
  add_action( 'gform_validation', 'wpa_gravityforms_extra_validation');
4
 
5
  function wpa_gravityforms_extra_validation($validation_result ){
6
+ if (wpa_check_is_spam($_POST)){
7
  $form = $validation_result['form'];
8
  do_action('wpa_handle_spammers','gravityforms');
9
  $validation_result['is_valid'] = false;
includes/integration/wpa_toolsetform.php CHANGED
@@ -5,7 +5,7 @@ add_filter('cred_form_validate','wpa_toolsetform_extra_validation',20,2);
5
  function wpa_toolsetform_extra_validation($error_fields, $form_data)
6
  {
7
  list($fields,$errors)=$error_fields;
8
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
9
  do_action('wpa_handle_spammers','toolset_form');
10
  die($GLOBALS['wpa_error_message']);
11
  }
5
  function wpa_toolsetform_extra_validation($error_fields, $form_data)
6
  {
7
  list($fields,$errors)=$error_fields;
8
+ if (wpa_check_is_spam($_POST)){
9
  do_action('wpa_handle_spammers','toolset_form');
10
  die($GLOBALS['wpa_error_message']);
11
  }
includes/integration/wpa_wpcomment.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
4
  add_filter( 'preprocess_comment', 'wpa_wpcomment_extra_validation' );
5
 
6
  function wpa_wpcomment_extra_validation( $commentdata ) {
7
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
8
  do_action('wpa_handle_spammers','wpcomment');
9
  wp_die( __( $GLOBALS['wpa_error_message'] ) );
10
  }
4
  add_filter( 'preprocess_comment', 'wpa_wpcomment_extra_validation' );
5
 
6
  function wpa_wpcomment_extra_validation( $commentdata ) {
7
+ if (wpa_check_is_spam($_POST)){
8
  do_action('wpa_handle_spammers','wpcomment');
9
  wp_die( __( $GLOBALS['wpa_error_message'] ) );
10
  }
includes/integration/wpa_wpforms.php CHANGED
@@ -3,7 +3,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
3
  add_filter( 'wpforms_process_before', 'wpa_wpforms_extra_validation', 10, 2 );
4
 
5
  function wpa_wpforms_extra_validation($entry, $form_data){
6
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
7
  do_action('wpa_handle_spammers','wpforms');
8
  wpforms()->process->errors[ $form_data['id'] ][ '0' ] = $GLOBALS['wpa_error_message'];
9
  }
3
  add_filter( 'wpforms_process_before', 'wpa_wpforms_extra_validation', 10, 2 );
4
 
5
  function wpa_wpforms_extra_validation($entry, $form_data){
6
+ if (wpa_check_is_spam($_POST)){
7
  do_action('wpa_handle_spammers','wpforms');
8
  wpforms()->process->errors[ $form_data['id'] ][ '0' ] = $GLOBALS['wpa_error_message'];
9
  }
includes/integration/wpa_wpregistration.php CHANGED
@@ -1,9 +1,15 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
 
 
 
 
 
 
3
  add_filter( 'registration_errors', 'wpa_wpregistration_extra_validation', 10, 3 );
4
 
5
  function wpa_wpregistration_extra_validation( $errors, $sanitized_user_login, $user_email ) {
6
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
7
  do_action('wpa_handle_spammers','wpregistration');
8
  $errors->add( 'wpa_extra_email', __($GLOBALS['wpa_error_message']) );
9
  }
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+
4
+ add_action( 'register_form', 'wpa_wpregistration_add_initiator_field' );
5
+ function wpa_wpregistration_add_initiator_field() {
6
+ echo '<input type="hidden" id="wpa_initiator" class="wpa_initiator" name="wpa_initiator" value="" />';
7
+ }
8
+
9
  add_filter( 'registration_errors', 'wpa_wpregistration_extra_validation', 10, 3 );
10
 
11
  function wpa_wpregistration_extra_validation( $errors, $sanitized_user_login, $user_email ) {
12
+ if (wpa_check_is_spam($_POST)){
13
  do_action('wpa_handle_spammers','wpregistration');
14
  $errors->add( 'wpa_extra_email', __($GLOBALS['wpa_error_message']) );
15
  }
includes/js/wpa.js CHANGED
@@ -3,7 +3,7 @@ jQuery(document).ready(function(){
3
 
4
  if (wpa_add_test == 'yes'){
5
  wpa_add_test_block();
6
- }
7
  });
8
 
9
  function wpa_act_as_spam(){
@@ -23,7 +23,6 @@ function wpa_add_honeypot_field(){
23
  jQuery('.bbp-topic-form form').append(wpa_hidden_field); // BBPRESS TOPIC
24
  jQuery('.bbp-reply-form form').append(wpa_hidden_field); // BBPRESS REPLY
25
  jQuery('form#commentform').append(wpa_hidden_field); // WP COMMENT
26
- jQuery('form#registerform').append(wpa_hidden_field); // WP REGISTRATION
27
  jQuery('form.wpcf7-form').append(wpa_hidden_field); // CONTACT FORM 7
28
  jQuery('form.wpforms-form').append(wpa_hidden_field); // WPFFORMS
29
  jQuery('.gform_wrapper form').append(wpa_hidden_field); // GRAVITY FORMS
@@ -33,6 +32,8 @@ function wpa_add_honeypot_field(){
33
  jQuery('form.et_pb_contact_form').append(wpa_hidden_field); // Divi Form
34
  jQuery('form.elementor-form').append(wpa_hidden_field); // FOR Elementor
35
  jQuery('form.frm-fluent-form').append(wpa_hidden_field); // FOR Fluent Forms
 
 
36
  }
37
 
38
  function wpa_add_test_block(){
3
 
4
  if (wpa_add_test == 'yes'){
5
  wpa_add_test_block();
6
+ }
7
  });
8
 
9
  function wpa_act_as_spam(){
23
  jQuery('.bbp-topic-form form').append(wpa_hidden_field); // BBPRESS TOPIC
24
  jQuery('.bbp-reply-form form').append(wpa_hidden_field); // BBPRESS REPLY
25
  jQuery('form#commentform').append(wpa_hidden_field); // WP COMMENT
 
26
  jQuery('form.wpcf7-form').append(wpa_hidden_field); // CONTACT FORM 7
27
  jQuery('form.wpforms-form').append(wpa_hidden_field); // WPFFORMS
28
  jQuery('.gform_wrapper form').append(wpa_hidden_field); // GRAVITY FORMS
32
  jQuery('form.et_pb_contact_form').append(wpa_hidden_field); // Divi Form
33
  jQuery('form.elementor-form').append(wpa_hidden_field); // FOR Elementor
34
  jQuery('form.frm-fluent-form').append(wpa_hidden_field); // FOR Fluent Forms
35
+
36
+ jQuery(wpa_hidden_field).insertAfter('input.wpa_initiator'); // FOR WPA INITIATOR (WP registration)
37
  }
38
 
39
  function wpa_add_test_block(){
includes/wpa_config.php CHANGED
@@ -1,8 +1,5 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  $GLOBALS['wpa_field_name'] = get_option('wpa_field_name');
4
- $GLOBALS['wpa_hidden_field'] = "<span class='wpa_hidden_field' style='display:none;height:0;width:0;'><input type='text' name='".$GLOBALS['wpa_field_name']."' value='1' /></span>";
5
  $GLOBALS['wpa_error_message'] = get_option('wpa_error_message');
6
- $GLOBALS['wpa_disable_test_widget'] = get_option('wpa_disable_test_widget');
7
-
8
-
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  $GLOBALS['wpa_field_name'] = get_option('wpa_field_name');
 
4
  $GLOBALS['wpa_error_message'] = get_option('wpa_error_message');
5
+ $GLOBALS['wpa_disable_test_widget'] = get_option('wpa_disable_test_widget');
 
 
includes/wpa_functions.php CHANGED
@@ -7,9 +7,11 @@ function wpa_load_scripts(){
7
  $wpa_add_test = 'no';
8
  }
9
 
 
 
10
  echo '<script>var wpa_hidden_field = "'.$GLOBALS['wpa_hidden_field'].'"; var wpa_add_test = "'.$wpa_add_test.'";</script>';
11
- wp_enqueue_script( 'wpascript', plugins_url( '/js/wpa.js', __FILE__ ), array ( 'jquery' ), 1.7, true);
12
- wp_enqueue_style( 'wpa-css', plugins_url( '/css/wpa.css', __FILE__ ), array(), '1.7');
13
  }
14
 
15
  function wpa_plugin_menu(){
@@ -112,4 +114,13 @@ function wpa_check_date($timestamp, $comparision){
112
  function wpa_unqiue_field_name(){
113
  $permitted_chars = 'abcdefghijklmnopqrstuvwxyz';
114
  return substr(str_shuffle($permitted_chars), 0, 6).rand(1,9999);
 
 
 
 
 
 
 
 
 
115
  }
7
  $wpa_add_test = 'no';
8
  }
9
 
10
+ $GLOBALS['wpa_hidden_field'] = "<span class='wpa_hidden_field' style='display:none;height:0;width:0;'><input type='text' name='".$GLOBALS['wpa_field_name']."' value='".$_SESSION['wpa_unique_id']."' /></span>";
11
+
12
  echo '<script>var wpa_hidden_field = "'.$GLOBALS['wpa_hidden_field'].'"; var wpa_add_test = "'.$wpa_add_test.'";</script>';
13
+ wp_enqueue_script( 'wpascript', plugins_url( '/js/wpa.js', __FILE__ ), array ( 'jquery' ), 1.8, true);
14
+ wp_enqueue_style( 'wpa-css', plugins_url( '/css/wpa.css', __FILE__ ), array(), '1.8');
15
  }
16
 
17
  function wpa_plugin_menu(){
114
  function wpa_unqiue_field_name(){
115
  $permitted_chars = 'abcdefghijklmnopqrstuvwxyz';
116
  return substr(str_shuffle($permitted_chars), 0, 6).rand(1,9999);
117
+ }
118
+
119
+ function wpa_check_is_spam($form_data){
120
+ if(!session_id()) { session_start(); }
121
+ if (isset($form_data[$GLOBALS['wpa_field_name']]) && ($form_data[$GLOBALS['wpa_field_name']] == $_SESSION['wpa_unique_id'])){
122
+ return false;
123
+ } else {
124
+ return true;
125
+ }
126
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://dineshkarki.com.np/wp-armour-anti-spam
4
  Tags: anti spam, spam checker, spam filter, gravity forms, contact form 7
5
  Requires at least: 3.0
6
  Tested up to: 5.7
7
- Stable tag: 1.7.2
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -54,13 +54,19 @@ If you have any issue, you can write to using <a title="WP Armour - Honeypot Ant
54
  * Gravity Forms (For Ajax Based and Multi Step Forms)
55
  * MC4WP: Mailchimp for WordPress
56
  * S2 Members
 
 
57
  * BuddyPress
 
58
  * Logs spam bot IPs.
59
  * Block spam bot IPs if multiple spam is submitted. Add extra level of anti spam filter based on IPs. Needed to stop spam bot using unwanted bandwidth and save valuable server resource.
60
  * View what spam bot are trying to submit, so that you are sure our plugin is blocking legit spam bots.
61
 
62
  You can get the WP Armour - Anti Spam Extended from <a title="WP Armour Extended - Anti Spam" href="https://dineshkarki.com.np/buy-wp-armour-extended">here</a>
63
 
 
 
 
64
  <strong>Our other plugins</strong>
65
 
66
  * <a target="_blank" href="http://wordpress.org/plugins/use-any-font">Use Any Font</a>
@@ -126,6 +132,9 @@ With WP Armour - Honeypot Anti Spam plugin it is No. But if you want you can use
126
 
127
  == Changelog ==
128
 
 
 
 
129
  = = 1.7.2 =
130
  * Added random field name generate button
131
  * Fixed stats issue.
4
  Tags: anti spam, spam checker, spam filter, gravity forms, contact form 7
5
  Requires at least: 3.0
6
  Tested up to: 5.7
7
+ Stable tag: 1.8
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
54
  * Gravity Forms (For Ajax Based and Multi Step Forms)
55
  * MC4WP: Mailchimp for WordPress
56
  * S2 Members
57
+ * HTMLform plugin
58
+ * Avia Enfold Theme
59
  * BuddyPress
60
+ * BuddyBoss
61
  * Logs spam bot IPs.
62
  * Block spam bot IPs if multiple spam is submitted. Add extra level of anti spam filter based on IPs. Needed to stop spam bot using unwanted bandwidth and save valuable server resource.
63
  * View what spam bot are trying to submit, so that you are sure our plugin is blocking legit spam bots.
64
 
65
  You can get the WP Armour - Anti Spam Extended from <a title="WP Armour Extended - Anti Spam" href="https://dineshkarki.com.np/buy-wp-armour-extended">here</a>
66
 
67
+ <strong>Want itegration for other plugins for anti spam support ? </strong>
68
+ You can fill this form and we will start working for it. <a href="https://forms.gle/VFhrQRtkjbwZ4Pbe9">https://forms.gle/VFhrQRtkjbwZ4Pbe9</a>
69
+
70
  <strong>Our other plugins</strong>
71
 
72
  * <a target="_blank" href="http://wordpress.org/plugins/use-any-font">Use Any Font</a>
132
 
133
  == Changelog ==
134
 
135
+ = = 1.8 =
136
+ * Added dynamic value for honeypot field test
137
+
138
  = = 1.7.2 =
139
  * Added random field name generate button
140
  * Fixed stats issue.
wp-armour.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: WP Armour - Honeypot Anti Spam
5
  Plugin URI: http://wordpress.org/plugins/honeypot/
6
  Description: Add honeypot anti spam protection.
7
  Author: Dnesscarkey
8
- Version: 1.7.2
9
  Author URI: https://dineshkarki.com.np/wp-armour-anti-spam
10
  */
11
 
@@ -16,6 +16,11 @@ include 'includes/views/wpa_notice.php';
16
 
17
  add_action( 'init', function(){
18
  if( !is_admin() ){ // ONLY BLOCK SPAM IF IT IS NOT ADMIN PANEL
 
 
 
 
 
19
  include 'includes/integration/wpa_bbpress.php';
20
  include 'includes/integration/wpa_wpcomment.php';
21
  include 'includes/integration/wpa_wpregistration.php';
5
  Plugin URI: http://wordpress.org/plugins/honeypot/
6
  Description: Add honeypot anti spam protection.
7
  Author: Dnesscarkey
8
+ Version: 1.8
9
  Author URI: https://dineshkarki.com.np/wp-armour-anti-spam
10
  */
11
 
16
 
17
  add_action( 'init', function(){
18
  if( !is_admin() ){ // ONLY BLOCK SPAM IF IT IS NOT ADMIN PANEL
19
+ if(!session_id()) { session_start(); }
20
+ if (!isset($_SESSION['wpa_unique_id'])){
21
+ $_SESSION['wpa_unique_id'] = rand(1, 99999);
22
+ }
23
+
24
  include 'includes/integration/wpa_bbpress.php';
25
  include 'includes/integration/wpa_wpcomment.php';
26
  include 'includes/integration/wpa_wpregistration.php';