Contact Form 7 Honeypot - Version 2.0.1

Version Description

Hotfix for issue with options not being set on upgrade.

Download this release

Release Info

Developer nocean
Plugin Icon 128x128 Contact Form 7 Honeypot
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0 to 2.0.1

Files changed (3) hide show
  1. honeypot.php +2 -2
  2. includes/admin.php +8 -5
  3. readme.txt +3 -0
honeypot.php CHANGED
@@ -5,12 +5,12 @@ Plugin URI: http://www.nocean.ca/plugins/honeypot-module-for-contact-form-7-word
5
  Description: Add honeypot anti-spam functionality to the popular Contact Form 7 plugin.
6
  Author: Nocean
7
  Author URI: http://www.nocean.ca
8
- Version: 2.0
9
  Text Domain: contact-form-7-honeypot
10
  Domain Path: /languages/
11
  */
12
 
13
- define( 'HONEYPOT4CF7_VERSION', '2.0' );
14
  define( 'HONEYPOT4CF7_TEXT_DOMAIN', 'contact-form-7-honeypot' );
15
  define( 'HONEYPOT4CF7_PLUGIN', __FILE__ );
16
  define( 'HONEYPOT4CF7_PLUGIN_BASENAME', plugin_basename( HONEYPOT4CF7_PLUGIN ) );
5
  Description: Add honeypot anti-spam functionality to the popular Contact Form 7 plugin.
6
  Author: Nocean
7
  Author URI: http://www.nocean.ca
8
+ Version: 2.0.1
9
  Text Domain: contact-form-7-honeypot
10
  Domain Path: /languages/
11
  */
12
 
13
+ define( 'HONEYPOT4CF7_VERSION', '2.0.1' );
14
  define( 'HONEYPOT4CF7_TEXT_DOMAIN', 'contact-form-7-honeypot' );
15
  define( 'HONEYPOT4CF7_PLUGIN', __FILE__ );
16
  define( 'HONEYPOT4CF7_PLUGIN_BASENAME', plugin_basename( HONEYPOT4CF7_PLUGIN ) );
includes/admin.php CHANGED
@@ -9,9 +9,11 @@
9
  add_action( 'admin_init', 'honeypot4cf7_has_parent_plugin' );
10
  function honeypot4cf7_has_parent_plugin() {
11
  // Get Options
12
- $default_options = array('honeypot4cf7_version', HONEYPOT4CF7_VERSION);
13
- $honeypot4cf7_config = ($honeypot4cf7_config = get_option('honeypot4cf7_config')) ? $honeypot4cf7_config : add_option('honeypot4cf7_config',$default_options);
14
-
 
 
15
 
16
  if ( is_admin() && current_user_can( 'activate_plugins' ) && !is_plugin_active( HONEYPOT4CF7_DEP_PLUGIN ) && empty( $honeypot4cf7_config['honeypot_cf7_req_msg_dismissed'])) {
17
  add_action( 'admin_notices', 'honeypot4cf7_nocf7_notice' );
@@ -124,6 +126,8 @@ function honeypot4cf7_restore_config($type=false) {
124
  }
125
 
126
  update_option( 'honeypot4cf7_config', $honeypot4cf7_config );
 
 
127
  }
128
 
129
 
@@ -146,8 +150,7 @@ function honeypot4cf7_admin_page() {
146
  }
147
 
148
  // Get Options
149
- $default_options = array('honeypot4cf7_version', HONEYPOT4CF7_VERSION);
150
- $honeypot4cf7_config = ($honeypot4cf7_config = get_option('honeypot4cf7_config')) ? $honeypot4cf7_config : add_option('honeypot4cf7_config', $default_options);
151
 
152
  // Save Values
153
  if (!empty($_POST['save'])) {
9
  add_action( 'admin_init', 'honeypot4cf7_has_parent_plugin' );
10
  function honeypot4cf7_has_parent_plugin() {
11
  // Get Options
12
+ if ($honeypot4cf7_config = get_option('honeypot4cf7_config')) {
13
+ $honeypot4cf7_config = $honeypot4cf7_config;
14
+ } else {
15
+ $honeypot4cf7_config = honeypot4cf7_restore_config();
16
+ }
17
 
18
  if ( is_admin() && current_user_can( 'activate_plugins' ) && !is_plugin_active( HONEYPOT4CF7_DEP_PLUGIN ) && empty( $honeypot4cf7_config['honeypot_cf7_req_msg_dismissed'])) {
19
  add_action( 'admin_notices', 'honeypot4cf7_nocf7_notice' );
126
  }
127
 
128
  update_option( 'honeypot4cf7_config', $honeypot4cf7_config );
129
+
130
+ return $honeypot4cf7_config;
131
  }
132
 
133
 
150
  }
151
 
152
  // Get Options
153
+ $honeypot4cf7_config = $honeypot4cf7_config = get_option('honeypot4cf7_config');
 
154
 
155
  // Save Values
156
  if (!empty($_POST['save'])) {
readme.txt CHANGED
@@ -76,6 +76,9 @@ You bet! If the honeypot trap is triggered, an email isn't sent, but the form su
76
  I realize not everyone loves ads, but daddy's gotta pay the bills. I'm extremely grateful to the numerous users that have donated to the plugin's development over the years, and while that's awesome, I don't think donations will ever come remotely close to covering the time and effort it takes to maintain and support a plugin that now has **nearly 1.5 million downloads** and **more than 300,000 active installs**.
77
 
78
  == Changelog ==
 
 
 
79
  = 2.0 =
80
  A significant update with a bunch of new things. Please see the [release notes](http://www.nocean.ca/blog/honeypot-for-contact-form-7-v2-0/).
81
 
76
  I realize not everyone loves ads, but daddy's gotta pay the bills. I'm extremely grateful to the numerous users that have donated to the plugin's development over the years, and while that's awesome, I don't think donations will ever come remotely close to covering the time and effort it takes to maintain and support a plugin that now has **nearly 1.5 million downloads** and **more than 300,000 active installs**.
77
 
78
  == Changelog ==
79
+ = 2.0.1 =
80
+ Hotfix for issue with options not being set on upgrade.
81
+
82
  = 2.0 =
83
  A significant update with a bunch of new things. Please see the [release notes](http://www.nocean.ca/blog/honeypot-for-contact-form-7-v2-0/).
84