WP Armour – Honeypot Anti Spam - Version 1.5.7

Version Description

  • Fixed security issue.
Download this release

Release Info

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

Code changes from version 1.5.6 to 1.5.7

includes/integration/wpa_bbpress.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /* BB PRESS */
3
  add_action( 'bbp_new_topic_pre_extras','wpa_bbp_extra_validation');
4
  add_action( 'bbp_new_reply_pre_extras','wpa_bbp_extra_validation');
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  /* BB PRESS */
4
  add_action( 'bbp_new_topic_pre_extras','wpa_bbp_extra_validation');
5
  add_action( 'bbp_new_reply_pre_extras','wpa_bbp_extra_validation');
includes/integration/wpa_calderaforms.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  function wpa_calderaforms_extra_validation( ) {
3
  if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
4
  do_action('wpa_handle_spammers','calderaforms');
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');
includes/integration/wpa_contactform7.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  add_filter( 'wpcf7_validate', 'wpa_contactform7_extra_validation', 10, 2 );
3
 
4
  function wpa_contactform7_extra_validation($result, $tags){
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  add_filter( 'wpcf7_validate', 'wpa_contactform7_extra_validation', 10, 2 );
4
 
5
  function wpa_contactform7_extra_validation($result, $tags){
includes/integration/wpa_diviform.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  foreach($_POST as $param => $value){
3
  if(strpos($param, 'et_pb_contactform_submit') === 0){
4
  $is_divi_form = 'true';
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  foreach($_POST as $param => $value){
4
  if(strpos($param, 'et_pb_contactform_submit') === 0){
5
  $is_divi_form = 'true';
includes/integration/wpa_elementor.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  function wpa_elementor_extra_validation( $record, $ajax_handler ) {
3
  if (!isset($_POST[ $GLOBALS['wpa_field_name']] )){
4
  $all_fields = $record->get( 'fields' );
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' );
includes/integration/wpa_fluentform.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  function wpa_fluent_form_extra_validation($insertData, $data, $form) {
3
  if (!isset($data[ $GLOBALS['wpa_field_name']] )){
4
  do_action('wpa_handle_spammers','fluent_forms');
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');
includes/integration/wpa_formidable.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  add_filter( 'frm_validate_entry', 'wpa_formidable_extra_validation', 10, 2 );
3
 
4
  function wpa_formidable_extra_validation($errors, $values){
1
  <?php
2
+ 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){
includes/integration/wpa_gravityforms.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  add_action( 'gform_validation', 'wpa_gravityforms_extra_validation');
3
 
4
  function wpa_gravityforms_extra_validation($validation_result ){
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  add_action( 'gform_validation', 'wpa_gravityforms_extra_validation');
4
 
5
  function wpa_gravityforms_extra_validation($validation_result ){
includes/integration/wpa_toolsetform.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  add_filter('cred_form_validate','wpa_toolsetform_extra_validation',20,2);
3
 
4
  function wpa_toolsetform_extra_validation($error_fields, $form_data)
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  add_filter('cred_form_validate','wpa_toolsetform_extra_validation',20,2);
4
 
5
  function wpa_toolsetform_extra_validation($error_fields, $form_data)
includes/integration/wpa_woocommerce.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  add_filter( 'woocommerce_registration_errors', 'wpa_woocommerce_extra_validation', 10, 3 );
3
 
4
  function wpa_woocommerce_extra_validation( $errors, $username, $email ) {
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 ) {
includes/integration/wpa_wpcomment.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  // WP Comments
3
  add_filter( 'preprocess_comment', 'wpa_wpcomment_extra_validation' );
4
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  // WP Comments
4
  add_filter( 'preprocess_comment', 'wpa_wpcomment_extra_validation' );
5
 
includes/integration/wpa_wpforms.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  add_filter( 'wpforms_process_before', 'wpa_wpforms_extra_validation', 10, 2 );
3
 
4
  function wpa_wpforms_extra_validation($entry, $form_data){
1
  <?php
2
+ 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){
includes/integration/wpa_wpregistration.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  add_filter( 'registration_errors', 'wpa_wpregistration_extra_validation', 10, 3 );
3
 
4
  function wpa_wpregistration_extra_validation( $errors, $sanitized_user_login, $user_email ) {
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 ) {
includes/views/wpa_extended_version.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <style type="text/css">
2
  .why_extended{padding: 10px; font-size: 14px;}
3
  .why_extended ul li{ padding-bottom: 20px; width: 285px; float: left; margin:10px 20px 10px 0px;border: 1px solid #d0d0d0; background: #d8d8d8; height: 150px; border-radius: 5px; padding: 10px; line-height: 1.5;}
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <style type="text/css">
3
  .why_extended{padding: 10px; font-size: 14px;}
4
  .why_extended ul li{ padding-bottom: 20px; width: 285px; float: left; margin:10px 20px 10px 0px;border: 1px solid #d0d0d0; background: #d8d8d8; height: 150px; border-radius: 5px; padding: 10px; line-height: 1.5;}
includes/views/wpa_main.php CHANGED
@@ -1,9 +1,10 @@
1
  <?php
 
2
  if (isset($_POST['submit-wpa-general-settings'])){
3
  $saveReturn = wpa_save_settings();
4
  }
5
 
6
- if (isset($_GET['tab'])){
7
  $currentTab = $_GET['tab'];
8
  } else {
9
  $currentTab = 'settings';
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  if (isset($_POST['submit-wpa-general-settings'])){
4
  $saveReturn = wpa_save_settings();
5
  }
6
 
7
+ if (isset($_GET['tab']) && array_key_exists($_GET['tab'],$wpa_tabs)){
8
  $currentTab = $_GET['tab'];
9
  } else {
10
  $currentTab = 'settings';
includes/views/wpa_notice.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  add_action('admin_notices', 'wpa_reviews_notice');
3
  if (isset($_GET['wpa_reviews_notice_hide']) == 1){
4
  update_option('wpa_reviews_notice_hide','yes');
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  add_action('admin_notices', 'wpa_reviews_notice');
4
  if (isset($_GET['wpa_reviews_notice_hide']) == 1){
5
  update_option('wpa_reviews_notice_hide','yes');
includes/views/wpa_settings.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <br/>
2
  <table class="wp-list-table widefat">
3
  <thead>
@@ -14,19 +15,22 @@
14
  <tr>
15
  <td width="250">Honey Pot Field Name</td>
16
  <td>
17
- <input name="wpa_field_name" style="width:300px;" value="<?php echo get_option('wpa_field_name');?>" type="text" /><br/>
18
  <em>Changing the field name regularly is a good idea. Please do it if you are getting spam.</em>
19
  </td>
20
  </tr>
21
  <tr>
22
  <td>Honey Pot Error Message</td>
23
  <td>
24
- <input name="wpa_error_message" style="width:300px;" value="<?php echo get_option('wpa_error_message');?>" type="text" /><br/><em>Mesage for bots. No average human users will see though.</em>
25
  </td>
26
  </tr>
27
 
28
  <tr>
29
- <td colspan="2"><input type="submit" name="submit-wpa-general-settings" class="button-primary" value="Save General Settings" /></td>
 
 
 
30
  </tr>
31
  </form>
32
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <br/>
3
  <table class="wp-list-table widefat">
4
  <thead>
15
  <tr>
16
  <td width="250">Honey Pot Field Name</td>
17
  <td>
18
+ <input name="wpa_field_name" style="width:300px;" value="<?php echo esc_attr(get_option('wpa_field_name'));?>" type="text" /><br/>
19
  <em>Changing the field name regularly is a good idea. Please do it if you are getting spam.</em>
20
  </td>
21
  </tr>
22
  <tr>
23
  <td>Honey Pot Error Message</td>
24
  <td>
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">
31
+ <?php wp_nonce_field( 'wpa_save_settings', 'wpa_nonce' ); ?>
32
+ <input type="submit" name="submit-wpa-general-settings" class="button-primary" value="Save General Settings" />
33
+ </td>
34
  </tr>
35
  </form>
36
 
includes/views/wpa_sidebar.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <style type="text/css">
2
  ul.uaf_list{ list-style-type:square;margin-left: 2em;}
3
  </style>
@@ -15,7 +16,7 @@ ul.uaf_list{ list-style-type:square;margin-left: 2em;}
15
  <ul class="uaf_list">
16
  <li><a href="https://wordpress.org/support/plugin/honeypot/" target="_blank">Support Forum</a></li>
17
  <li><a href="https://www.facebook.com/Dnesscarkey-77553779916" target="_blank">Send Us Msg via Facebook</a></li>
18
- <li><a href="https://bit.ly/2CdkfqR" target="_blank">Get WP Armour Extended</a></li>
19
  </ul>
20
  </td>
21
  </tr>
@@ -34,7 +35,7 @@ ul.uaf_list{ list-style-type:square;margin-left: 2em;}
34
  <td>
35
  <ul class="uaf_list">
36
  <li><a href="https://wordpress.org/plugins/use-any-font/" target="_blank">Use Any Font</a></li>
37
- <li><a href="http://goo.gl/3XDDzi" target="_blank">WP Masonry Layout</a></li>
38
  <li><a href="http://wordpress.org/extend/plugins/any-mobile-theme-switcher/" target="_blank">Any Mobile Theme Switcher</a></li>
39
  <li><a href="http://wordpress.org/extend/plugins/jquery-validation-for-contact-form-7/" target="_blank">Jquery Validation For Contact Form 7</a></li>
40
  <li><a href="http://wordpress.org/extend/plugins/add-tags-and-category-to-page/" target="_blank">Add Tags And Category To Page</a></li>
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <style type="text/css">
3
  ul.uaf_list{ list-style-type:square;margin-left: 2em;}
4
  </style>
16
  <ul class="uaf_list">
17
  <li><a href="https://wordpress.org/support/plugin/honeypot/" target="_blank">Support Forum</a></li>
18
  <li><a href="https://www.facebook.com/Dnesscarkey-77553779916" target="_blank">Send Us Msg via Facebook</a></li>
19
+ <li><a href="https://dineshkarki.com.np/buy-wp-armour-extended" target="_blank">Get WP Armour Extended</a></li>
20
  </ul>
21
  </td>
22
  </tr>
35
  <td>
36
  <ul class="uaf_list">
37
  <li><a href="https://wordpress.org/plugins/use-any-font/" target="_blank">Use Any Font</a></li>
38
+ <li><a href="https://wordpress.org/plugins/wp-masonry-layout/" target="_blank">WP Masonry Layout</a></li>
39
  <li><a href="http://wordpress.org/extend/plugins/any-mobile-theme-switcher/" target="_blank">Any Mobile Theme Switcher</a></li>
40
  <li><a href="http://wordpress.org/extend/plugins/jquery-validation-for-contact-form-7/" target="_blank">Jquery Validation For Contact Form 7</a></li>
41
  <li><a href="http://wordpress.org/extend/plugins/add-tags-and-category-to-page/" target="_blank">Add Tags And Category To Page</a></li>
includes/views/wpa_stats.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  $currentStats = json_decode(get_option('wpa_stats'), true);
3
  $todayDate = $currentStats['total']['today']['date'];
4
  $weekDate = $currentStats['total']['week']['date'];
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  $currentStats = json_decode(get_option('wpa_stats'), true);
4
  $todayDate = $currentStats['total']['today']['date'];
5
  $weekDate = $currentStats['total']['week']['date'];
includes/views/wpa_stats_widget.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <style type="text/css">
2
  .wpa_stat_table{max-width: 100%;filter: blur(2px);-webkit-filter: blur(2px);}
3
  .wpa_stat_table_holder{position: relative;}
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
  <style type="text/css">
3
  .wpa_stat_table{max-width: 100%;filter: blur(2px);-webkit-filter: blur(2px);}
4
  .wpa_stat_table_holder{position: relative;}
includes/wpa_config.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
-
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');
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');
includes/wpa_dashboard_widget.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  add_action("wp_dashboard_setup", "wpa_dashboard_widget");
3
  function wpa_dashboard_widget()
4
  {
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  add_action("wp_dashboard_setup", "wpa_dashboard_widget");
4
  function wpa_dashboard_widget()
5
  {
includes/wpa_functions.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  function wpa_load_scripts(){
3
 
4
  if (current_user_can('activate_plugins')){
@@ -29,19 +30,25 @@ function wpa_options(){
29
  include 'views/wpa_main.php';
30
  }
31
 
32
- function wpa_save_settings(){
33
- $all_fields = $_POST;
34
- unset($all_fields['submit-wpa-general-settings']); // REMOVE submit field
35
-
36
- foreach ($all_fields as $fieldname => $fieldvalue) {
37
- update_option($fieldname,$fieldvalue);
 
 
 
 
 
 
 
 
 
 
 
 
38
  }
39
-
40
- $GLOBALS['wpa_field_name'] = get_option('wpa_field_name');
41
- $GLOBALS['wpa_error_message'] = get_option('wpa_error_message');
42
-
43
- $return['status'] = 'ok';
44
- $return['body'] = 'Settings Saved';
45
  return $return;
46
  }
47
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  function wpa_load_scripts(){
4
 
5
  if (current_user_can('activate_plugins')){
30
  include 'views/wpa_main.php';
31
  }
32
 
33
+ function wpa_save_settings(){
34
+ if ( isset($_POST['wpa_nonce']) && wp_verify_nonce($_POST['wpa_nonce'], 'wpa_save_settings')) {
35
+ if (empty($_POST['wpa_field_name'])){
36
+ $return['status'] = 'error';
37
+ $return['body'] = "Honey Pot Field Name can't be empty";
38
+ } else {
39
+ update_option('wpa_field_name',sanitize_title_with_dashes($_POST['wpa_field_name']));
40
+ update_option('wpa_error_message',sanitize_text_field($_POST['wpa_error_message']));
41
+
42
+ $GLOBALS['wpa_field_name'] = get_option('wpa_field_name');
43
+ $GLOBALS['wpa_error_message'] = get_option('wpa_error_message');
44
+
45
+ $return['status'] = 'ok';
46
+ $return['body'] = 'Settings Saved';
47
+ }
48
+ } else {
49
+ $return['status'] = 'error';
50
+ $return['body'] = 'Sorry, your nonce did not verify. Please try again.';
51
  }
 
 
 
 
 
 
52
  return $return;
53
  }
54
 
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
7
- Stable tag: 1.5.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -119,6 +119,10 @@ With WP Armour - Honeypot Anti Spam plugin it is No. But if you want you can use
119
 
120
  == Changelog ==
121
 
 
 
 
 
122
  = = 1.5.6 =
123
  * Fixed Gravity Form Ajax Issue
124
  * Added anti spam support for Elementor Form Widget
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
7
+ Stable tag: 1.5.7
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
119
 
120
  == Changelog ==
121
 
122
+ = = 1.5.7 =
123
+ * Fixed security issue.
124
+
125
+
126
  = = 1.5.6 =
127
  * Fixed Gravity Form Ajax Issue
128
  * Added anti spam support for Elementor Form Widget
wp-armour.php CHANGED
@@ -1,10 +1,11 @@
1
  <?php
 
2
  /*
3
  Plugin Name: WP Armour - Honeypot Anti Spam
4
  Plugin URI: http://wordpress.org/plugins/honeypot/
5
  Description: Add honeypot anti spam protection.
6
  Author: Dnesscarkey
7
- Version: 1.5.6
8
  Author URI: https://dineshkarki.com.np/wp-armour-anti-spam
9
  */
10
 
1
  <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
  /*
4
  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.7
9
  Author URI: https://dineshkarki.com.np/wp-armour-anti-spam
10
  */
11