WP Armour – Honeypot Anti Spam - Version 1.6

Version Description

  • Removed WooCommerce Support from Lite version due to complications.
  • Added option to disable Wp Armour Widget.
Download this release

Release Info

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

Code changes from version 1.5.9 to 1.6

includes/integration/wpa_woocommerce.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- add_filter( 'woocommerce_registration_errors', 'wpa_woocommerce_extra_validation', 10, 3 );
4
-
5
- function wpa_woocommerce_extra_validation( $errors, $username, $email ) {
6
- if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
7
- $errors->add( 'reg_email', $GLOBALS['wpa_error_message']);
8
- }
9
- return $errors;
10
- }
 
 
 
 
 
 
 
 
 
 
includes/js/wpa.js CHANGED
@@ -30,9 +30,7 @@ function wpa_add_honeypot_field(){
30
  jQuery('.frm_forms form').append(wpa_hidden_field); // Formidible forms
31
  jQuery('.caldera-grid form').append(wpa_hidden_field); // Caldera forms
32
  jQuery('.wp-block-toolset-cred-form form').append(wpa_hidden_field); // Toolset Forms
33
- jQuery('form.et_pb_contact_form').append(wpa_hidden_field); // Divi Form
34
- jQuery('form.woocommerce-form-register').append(wpa_hidden_field); // WooCommerce Registration
35
- jQuery('form.register').append(wpa_hidden_field); // WooCommerce Register (https://wordpress.org/support/topic/error-spamming-or-your-javascript-is-disabled)
36
  jQuery('form.elementor-form').append(wpa_hidden_field); // FOR Elementor
37
  jQuery('form.frm-fluent-form').append(wpa_hidden_field); // FOR Fluent Forms
38
  }
30
  jQuery('.frm_forms form').append(wpa_hidden_field); // Formidible forms
31
  jQuery('.caldera-grid form').append(wpa_hidden_field); // Caldera forms
32
  jQuery('.wp-block-toolset-cred-form form').append(wpa_hidden_field); // Toolset Forms
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
  }
includes/views/wpa_settings.php CHANGED
@@ -25,6 +25,17 @@
25
  <input name="wpa_error_message" style="width:300px;" value="<?php echo esc_attr(get_option('wpa_error_message'));?>" type="text" /><br/><em>Mesage for bots. No average human users will see though.</em>
26
  </td>
27
  </tr>
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  <tr>
30
  <td colspan="2">
25
  <input name="wpa_error_message" style="width:300px;" value="<?php echo esc_attr(get_option('wpa_error_message'));?>" type="text" /><br/><em>Mesage for bots. No average human users will see though.</em>
26
  </td>
27
  </tr>
28
+
29
+ <tr>
30
+ <td>Disable Honeypot Test Widget</td>
31
+ <td>
32
+ <select name="wpa_disable_test_widget">
33
+ <option value="no" <?php echo get_option('wpa_disable_test_widget') == 'no'?'selected="selected"':''; ?> >No</option>
34
+ <option value="yes" <?php echo get_option('wpa_disable_test_widget') == 'yes'?'selected="selected"':''; ?> >Yes</option>
35
+ </select>
36
+ <em>Only visible when Admin user is logged in.</em>
37
+ </td>
38
+ </tr>
39
 
40
  <tr>
41
  <td colspan="2">
includes/wpa_config.php CHANGED
@@ -2,4 +2,7 @@
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');
 
 
 
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
+
includes/wpa_functions.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  function wpa_load_scripts(){
4
- if (current_user_can('activate_plugins')){
5
  $wpa_add_test = 'yes';
6
  } else {
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.5, true);
12
- wp_enqueue_style( 'wpa-css', plugins_url( '/css/wpa.css', __FILE__ ), array(), '1.5');
13
  }
14
 
15
  function wpa_plugin_menu(){
@@ -37,6 +37,7 @@ function wpa_save_settings(){
37
  } else {
38
  update_option('wpa_field_name',sanitize_title_with_dashes($_POST['wpa_field_name']));
39
  update_option('wpa_error_message',sanitize_text_field($_POST['wpa_error_message']));
 
40
 
41
  $GLOBALS['wpa_field_name'] = get_option('wpa_field_name');
42
  $GLOBALS['wpa_error_message'] = get_option('wpa_error_message');
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  function wpa_load_scripts(){
4
+ if (current_user_can('activate_plugins') && (get_option('wpa_disable_test_widget') == 'no')){
5
  $wpa_add_test = 'yes';
6
  } else {
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.6, true);
12
+ wp_enqueue_style( 'wpa-css', plugins_url( '/css/wpa.css', __FILE__ ), array(), '1.6');
13
  }
14
 
15
  function wpa_plugin_menu(){
37
  } else {
38
  update_option('wpa_field_name',sanitize_title_with_dashes($_POST['wpa_field_name']));
39
  update_option('wpa_error_message',sanitize_text_field($_POST['wpa_error_message']));
40
+ update_option('wpa_disable_test_widget',sanitize_text_field($_POST['wpa_disable_test_widget']));
41
 
42
  $GLOBALS['wpa_field_name'] = get_option('wpa_field_name');
43
  $GLOBALS['wpa_error_message'] = get_option('wpa_error_message');
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.6.1
7
- Stable tag: 1.5.9
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -31,11 +31,12 @@ As of now spam bots are unable to handle javascript and we exploit this point to
31
  * For Elementor Forms
32
  * For Fluent Forms
33
  * For Divi Theme Contact Form
34
- * For WooCommerce registration
35
 
36
  <strong>How our plugin is different than other honeypot anti spam plugins ? </strong>
37
 
38
  * Works for most of the forms and wordpress system including registation and comments. So All in one anti spam solution.
 
 
39
  * Spam bots can't use javascript so we use javascript to insert honeypot anti spam field in the form and spam bots can't fill it to pass anti spam test.
40
  * Unique honeypot field name generated for each wordpress installation, so it is hard for spam bots to make one fit for all solution to bypass honeypot anti spam test.
41
  * No setup required. Just activate the plugin and it enables anti spam for all supported forms, comment and registration.
@@ -57,7 +58,6 @@ You can get the WP Armour - Anti Spam Extended from <a title="WP Armour Extended
57
  <strong>Our other plugins</strong>
58
 
59
  * <a target="_blank" href="http://wordpress.org/plugins/use-any-font">Use Any Font</a>
60
- * <a target="_blank" href="http://wordpress.org/plugins/wp-masonry-layout/">WP Masonry Layout</a>
61
  * <a target="_blank" href="http://wordpress.org/plugins/any-mobile-theme-switcher/">Any Mobile Theme Switcher</a>
62
  * <a target="_blank" href="http://wordpress.org/plugins/jquery-validation-for-contact-form-7/">Jquery Validation For Contact Form 7</a>
63
  * <a target="_blank" href="https://dineshkarki.com.np/jquery-validation-for-gravity-forms">Jquery Validation For Gravity Forms</a>
@@ -120,6 +120,10 @@ With WP Armour - Honeypot Anti Spam plugin it is No. But if you want you can use
120
 
121
  == Changelog ==
122
 
 
 
 
 
123
  = = 1.5.9 =
124
  * Remove WooCommerce checkout
125
 
4
  Tags: anti spam, spam checker, spam filter, gravity forms, contact form 7
5
  Requires at least: 3.0
6
  Tested up to: 5.6.1
7
+ Stable tag: 1.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
31
  * For Elementor Forms
32
  * For Fluent Forms
33
  * For Divi Theme Contact Form
 
34
 
35
  <strong>How our plugin is different than other honeypot anti spam plugins ? </strong>
36
 
37
  * Works for most of the forms and wordpress system including registation and comments. So All in one anti spam solution.
38
+ * No external calls.
39
+ * GDPR Compliant.
40
  * Spam bots can't use javascript so we use javascript to insert honeypot anti spam field in the form and spam bots can't fill it to pass anti spam test.
41
  * Unique honeypot field name generated for each wordpress installation, so it is hard for spam bots to make one fit for all solution to bypass honeypot anti spam test.
42
  * No setup required. Just activate the plugin and it enables anti spam for all supported forms, comment and registration.
58
  <strong>Our other plugins</strong>
59
 
60
  * <a target="_blank" href="http://wordpress.org/plugins/use-any-font">Use Any Font</a>
 
61
  * <a target="_blank" href="http://wordpress.org/plugins/any-mobile-theme-switcher/">Any Mobile Theme Switcher</a>
62
  * <a target="_blank" href="http://wordpress.org/plugins/jquery-validation-for-contact-form-7/">Jquery Validation For Contact Form 7</a>
63
  * <a target="_blank" href="https://dineshkarki.com.np/jquery-validation-for-gravity-forms">Jquery Validation For Gravity Forms</a>
120
 
121
  == Changelog ==
122
 
123
+ = = 1.6 =
124
+ * Removed WooCommerce Support from Lite version due to complications.
125
+ * Added option to disable Wp Armour Widget.
126
+
127
  = = 1.5.9 =
128
  * Remove WooCommerce checkout
129
 
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.5.9
9
  Author URI: https://dineshkarki.com.np/wp-armour-anti-spam
10
  */
11
 
@@ -25,8 +25,7 @@ add_action( 'init', function(){
25
  include 'includes/integration/wpa_formidable.php';
26
  include 'includes/integration/wpa_calderaforms.php';
27
  include 'includes/integration/wpa_toolsetform.php';
28
- include 'includes/integration/wpa_diviform.php';
29
- include 'includes/integration/wpa_woocommerce.php';
30
  }
31
  include 'includes/integration/wpa_fluentform.php';
32
  include 'includes/integration/wpa_elementor.php';
@@ -36,7 +35,7 @@ add_action( 'init', function(){
36
  add_action('wp_enqueue_scripts','wpa_load_scripts');
37
  add_action('login_enqueue_scripts','wpa_load_scripts');
38
  add_action('admin_menu', 'wpa_plugin_menu');
39
- add_action( 'wpa_handle_spammers','wpa_save_stats',10,1);
40
 
41
 
42
  register_activation_hook( __FILE__, 'wpa_plugin_activation' );
@@ -45,5 +44,6 @@ function wpa_plugin_activation(){
45
  add_option('wpa_installed_date',date('Ymd'));
46
  add_option('wpa_field_name','field'.rand(1,9999));
47
  add_option('wpa_error_message',' Spamming or your Javascript is disabled !!');
 
48
  add_option('wpa_stats','{"total":{"today":{"date":"'.date('Ymd').'","count":0},"week":{"date":"'.date('Ymd').'","count":0},"month":{"date":"'.date('Ymd').'","count":0},"all_time":0}}');
49
  }
5
  Plugin URI: http://wordpress.org/plugins/honeypot/
6
  Description: Add honeypot anti spam protection.
7
  Author: Dnesscarkey
8
+ Version: 1.6
9
  Author URI: https://dineshkarki.com.np/wp-armour-anti-spam
10
  */
11
 
25
  include 'includes/integration/wpa_formidable.php';
26
  include 'includes/integration/wpa_calderaforms.php';
27
  include 'includes/integration/wpa_toolsetform.php';
28
+ include 'includes/integration/wpa_diviform.php';
 
29
  }
30
  include 'includes/integration/wpa_fluentform.php';
31
  include 'includes/integration/wpa_elementor.php';
35
  add_action('wp_enqueue_scripts','wpa_load_scripts');
36
  add_action('login_enqueue_scripts','wpa_load_scripts');
37
  add_action('admin_menu', 'wpa_plugin_menu');
38
+ add_action('wpa_handle_spammers','wpa_save_stats',10,1);
39
 
40
 
41
  register_activation_hook( __FILE__, 'wpa_plugin_activation' );
44
  add_option('wpa_installed_date',date('Ymd'));
45
  add_option('wpa_field_name','field'.rand(1,9999));
46
  add_option('wpa_error_message',' Spamming or your Javascript is disabled !!');
47
+ add_option('wpa_disable_test_widget','no');
48
  add_option('wpa_stats','{"total":{"today":{"date":"'.date('Ymd').'","count":0},"week":{"date":"'.date('Ymd').'","count":0},"month":{"date":"'.date('Ymd').'","count":0},"all_time":0}}');
49
  }