WP Armour – Honeypot Anti Spam - Version 1.8.2

Version Description

  • Added extra security check
Download this release

Release Info

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

Code changes from version 1.8.1 to 1.8.2

Files changed (3) hide show
  1. includes/wpa_functions.php +4 -6
  2. readme.txt +4 -1
  3. wp-armour.php +4 -7
includes/wpa_functions.php CHANGED
@@ -7,11 +7,11 @@ function wpa_load_scripts(){
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='1' /></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.1', true);
14
- wp_enqueue_style( 'wpa-css', plugins_url( '/css/wpa.css', __FILE__ ), array(), '1.8.1');
15
  }
16
 
17
  function wpa_plugin_menu(){
@@ -117,9 +117,7 @@ function wpa_unqiue_field_name(){
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
- if ( isset($form_data[$GLOBALS['wpa_field_name']]) ){
123
  return false;
124
  } else {
125
  return true;
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='".$_COOKIE['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.2', true);
14
+ wp_enqueue_style( 'wpa-css', plugins_url( '/css/wpa.css', __FILE__ ), array(), '1.8.2');
15
  }
16
 
17
  function wpa_plugin_menu(){
117
  }
118
 
119
  function wpa_check_is_spam($form_data){
120
+ if (isset($form_data[$GLOBALS['wpa_field_name']]) && ($form_data[$GLOBALS['wpa_field_name']] == $_COOKIE['wpa_unique_id'])){
 
 
121
  return false;
122
  } else {
123
  return true;
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.8.1
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -132,6 +132,9 @@ With WP Armour - Honeypot Anti Spam plugin it is No. But if you want you can use
132
 
133
  == Changelog ==
134
 
 
 
 
135
  = = 1.8.1 =
136
  * Fixed session issue.
137
 
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.2
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
132
 
133
  == Changelog ==
134
 
135
+ = = 1.8.2 =
136
+ * Added extra security check
137
+
138
  = = 1.8.1 =
139
  * Fixed session issue.
140
 
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.8.1
9
  Author URI: https://dineshkarki.com.np/wp-armour-anti-spam
10
  */
11
 
@@ -15,12 +15,9 @@ include 'includes/wpa_dashboard_widget.php';
15
  include 'includes/views/wpa_notice.php';
16
 
17
  add_action( 'init', function(){
18
-
19
- /*
20
- if(!session_id()) { session_start(); }
21
- if (!isset($_SESSION['wpa_unique_id'])){
22
- $_SESSION['wpa_unique_id'] = rand(1, 99999);
23
- }*/
24
 
25
  if( !is_admin() ){ // ONLY BLOCK SPAM IF IT IS NOT ADMIN PANEL
26
  include 'includes/integration/wpa_bbpress.php';
5
  Plugin URI: http://wordpress.org/plugins/honeypot/
6
  Description: Add honeypot anti spam protection.
7
  Author: Dnesscarkey
8
+ Version: 1.8.2
9
  Author URI: https://dineshkarki.com.np/wp-armour-anti-spam
10
  */
11
 
15
  include 'includes/views/wpa_notice.php';
16
 
17
  add_action( 'init', function(){
18
+ if (!isset($_COOKIE['wpa_unique_id'])) {
19
+ setcookie('wpa_unique_id', rand(111, 99999), '0');
20
+ }
 
 
 
21
 
22
  if( !is_admin() ){ // ONLY BLOCK SPAM IF IT IS NOT ADMIN PANEL
23
  include 'includes/integration/wpa_bbpress.php';