WP Armour – Honeypot Anti Spam - Version 1.7.1

Version Description

  • Fixed Test Widget not showing issue
  • Fixed stats issue.
Download this release

Release Info

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

Code changes from version 1.7 to 1.7.1

includes/views/wpa_stats.php CHANGED
@@ -1,33 +1,35 @@
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'];
6
- $monthDate = $currentStats['total']['month']['date'];
7
  ?>
8
  <br/>
9
  <table class="wp-list-table widefat fixed bookmarks">
 
 
10
  <thead>
11
  <tr>
12
  <th colspan="5"><strong>Quick Stats</strong></th>
13
  </tr>
14
  </thead>
15
- <tbody>
 
16
  <tr>
17
- <td><strong>Source</strong></td>
18
- <td><strong>Today</strong></td>
19
- <td><strong>This Week</strong></td>
20
- <td><strong>This Month</strong></td>
21
- <td><strong>All Time</strong></td>
22
  </tr>
 
 
23
  <?php
24
  if (!empty($currentStats)){
25
  foreach ($currentStats as $source=>$statData): ?>
26
  <tr>
27
  <td><strong><?php echo ucfirst($source); ?></strong></td>
28
- <td><?php echo wpa_check_date($todayDate,'today')?$statData['today']['count']:'0'; ?></td>
29
- <td><?php echo wpa_check_date($weekDate,'week')?$statData['week']['count']:'0'; ?></td>
30
- <td><?php echo wpa_check_date($monthDate,'month')?$statData['month']['count']:'0'; ?></td>
31
  <td><?php echo $statData['all_time']; ?></td>
32
  </tr>
33
  <?php endforeach;
@@ -38,6 +40,7 @@ $monthDate = $currentStats['total']['month']['date'];
38
  </tbody>
39
  </table><br/>
40
  <br/>
 
41
  <table class="wp-list-table widefat fixed bookmarks">
42
  <thead>
43
  <tr>
@@ -87,4 +90,4 @@ $monthDate = $currentStats['total']['month']['date'];
87
  </td>
88
  </tr>
89
  </tbody>
90
- </table><br/>
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  $currentStats = json_decode(get_option('wpa_stats'), true);
 
 
 
4
  ?>
5
  <br/>
6
  <table class="wp-list-table widefat fixed bookmarks">
7
+ <?php
8
+ /*
9
  <thead>
10
  <tr>
11
  <th colspan="5"><strong>Quick Stats</strong></th>
12
  </tr>
13
  </thead>
14
+ */ ?>
15
+ <thead>
16
  <tr>
17
+ <th><strong>Source</strong></th>
18
+ <th><strong>Today</strong></th>
19
+ <th><strong>This Week</strong></th>
20
+ <th><strong>This Month</strong></th>
21
+ <th><strong>All Time</strong></th>
22
  </tr>
23
+ <thead>
24
+ <tbody>
25
  <?php
26
  if (!empty($currentStats)){
27
  foreach ($currentStats as $source=>$statData): ?>
28
  <tr>
29
  <td><strong><?php echo ucfirst($source); ?></strong></td>
30
+ <td><?php echo @wpa_check_date($statData['today']['date'],'today')?$statData['today']['count']:'0'; ?></td>
31
+ <td><?php echo @wpa_check_date($statData['week']['date'],'week')?$statData['week']['count']:'0'; ?></td>
32
+ <td><?php echo @wpa_check_date($statData['month']['date'],'today')?$statData['month']['count']:'0'; ?></td>
33
  <td><?php echo $statData['all_time']; ?></td>
34
  </tr>
35
  <?php endforeach;
40
  </tbody>
41
  </table><br/>
42
  <br/>
43
+ <?php /*
44
  <table class="wp-list-table widefat fixed bookmarks">
45
  <thead>
46
  <tr>
90
  </td>
91
  </tr>
92
  </tbody>
93
+ </table><br/>*/ ?>
includes/wpa_functions.php CHANGED
@@ -1,7 +1,7 @@
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';
@@ -53,37 +53,28 @@ function wpa_save_settings(){
53
  }
54
 
55
  function wpa_save_stats($wp_system){
56
- $currentStats = json_decode(get_option('wpa_stats'), true);
57
- if (wpa_check_date($currentStats['total']['today']['date'],'today')){
58
- $currentStats['total']['today']['count'] += 1;
59
- @$currentStats[$wp_system]['today']['count'] += 1;
60
- } else {
61
- $currentStats['total']['today']['date'] = date('Ymd');
62
- $currentStats['total']['today']['count'] = 1;
63
- @$currentStats[$wp_system]['today']['count'] = 1;
64
- }
65
 
66
- if (wpa_check_date($currentStats['total']['week']['date'],'week')){
67
- $currentStats['total']['week']['count'] += 1;
68
- @$currentStats[$wp_system]['week']['count'] += 1;
69
- } else {
70
- $currentStats['total']['week']['date'] = date('Ymd');
71
- $currentStats['total']['week']['count'] = 1;
72
- @$currentStats[$wp_system]['week']['count'] = 1;
73
- }
74
 
75
- if (wpa_check_date($currentStats['total']['month']['date'],'month')){
76
- $currentStats['total']['month']['count'] += 1;
77
- @$currentStats[$wp_system]['month']['count'] += 1;
78
- } else {
79
- $currentStats['total']['month']['date'] = date('Ymd');
80
- $currentStats['total']['month']['count'] = 1;
81
- @$currentStats[$wp_system]['month']['count'] = 1;
 
82
  }
83
 
84
  $currentStats['total']['all_time'] += 1;
85
  @$currentStats[$wp_system]['all_time'] += 1;
86
-
87
  update_option('wpa_stats', json_encode($currentStats));
88
  }
89
 
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') != 'yes')){
5
  $wpa_add_test = 'yes';
6
  } else {
7
  $wpa_add_test = 'no';
53
  }
54
 
55
  function wpa_save_stats($wp_system){
56
+ $currentStats = json_decode(get_option('wpa_stats'), true);
57
+ $timeArray = array('today','week','month');
 
 
 
 
 
 
 
58
 
59
+ foreach ($timeArray as $key => $time) {
60
+ if (wpa_check_date($currentStats['total'][$time]['date'],$time)){
61
+ $currentStats['total'][$time]['count'] += 1;
62
+ } else {
63
+ $currentStats['total'][$time]['count'] = 1;
64
+ }
 
 
65
 
66
+ if (wpa_check_date($currentStats[$wp_system][$time]['date'],$time)){
67
+ $currentStats[$wp_system][$time]['count'] += 1;
68
+ } else {
69
+ $currentStats[$wp_system][$time]['count'] = 1;
70
+ }
71
+
72
+ $currentStats['total'][$time]['date'] = date('Ymd');
73
+ $currentStats[$wp_system][$time]['date'] = date('Ymd');
74
  }
75
 
76
  $currentStats['total']['all_time'] += 1;
77
  @$currentStats[$wp_system]['all_time'] += 1;
 
78
  update_option('wpa_stats', json_encode($currentStats));
79
  }
80
 
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
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -126,6 +126,10 @@ With WP Armour - Honeypot Anti Spam plugin it is No. But if you want you can use
126
 
127
  == Changelog ==
128
 
 
 
 
 
129
  = = 1.7 =
130
  * Fixed Hide Notification issue.
131
  * Tested with 5.7.
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.1
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
126
 
127
  == Changelog ==
128
 
129
+ = = 1.7.1 =
130
+ * Fixed Test Widget not showing issue
131
+ * Fixed stats issue.
132
+
133
  = = 1.7 =
134
  * Fixed Hide Notification issue.
135
  * Tested with 5.7.
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
9
  Author URI: https://dineshkarki.com.np/wp-armour-anti-spam
10
  */
11
 
5
  Plugin URI: http://wordpress.org/plugins/honeypot/
6
  Description: Add honeypot anti spam protection.
7
  Author: Dnesscarkey
8
+ Version: 1.7.1
9
  Author URI: https://dineshkarki.com.np/wp-armour-anti-spam
10
  */
11