Math Captcha - Version 1.0.1.1

Version Description

Fix: Captcha time expired error on bbPress

Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Math Captcha
Version 1.0.1.1
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.1.1

Files changed (2) hide show
  1. readme.txt +5 -4
  2. wp-math-captcha.php +17 -13
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === Math Captcha ===
2
  Contributors: dfactory
3
  Donate link: http://www.dfactory.eu/
4
  Tags: antispam, capcha, captcha, captha, catcha, comment, comments, spam, security, login, lost password, math captcha, registration, cf7, contact, contact forms, form, contact form 7, bbpress
5
  Requires at least: 3.3
6
  Tested up to: 3.5.1
7
- Stable tag: 1.0.1
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -45,6 +45,7 @@ No questions yet.
45
 
46
  = 1.0.1 =
47
  * Fix: Math Captcha not available in Contact Form 7 if hide for logged in users selected
 
48
  * Tweak: Empty captcha title
49
 
50
 
@@ -53,5 +54,5 @@ No questions yet.
53
 
54
  == Upgrade Notice ==
55
 
56
- = 1.0.1 =
57
- Fix for a couple of bugfixes
1
+ === Math Captcha ===
2
  Contributors: dfactory
3
  Donate link: http://www.dfactory.eu/
4
  Tags: antispam, capcha, captcha, captha, catcha, comment, comments, spam, security, login, lost password, math captcha, registration, cf7, contact, contact forms, form, contact form 7, bbpress
5
  Requires at least: 3.3
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.0.1.1
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
45
 
46
  = 1.0.1 =
47
  * Fix: Math Captcha not available in Contact Form 7 if hide for logged in users selected
48
+ * Fix: Captcha time expired error on bbPress
49
  * Tweak: Empty captcha title
50
 
51
 
54
 
55
  == Upgrade Notice ==
56
 
57
+ = 1.0.1.1 =
58
+ Fix: Captcha time expired error on bbPress
wp-math-captcha.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Math Captcha
4
  Description: Math Captcha is a <strong>very effective CAPTCHA for WordPress</strong> that integrates into login, registration, comments, Contact Form 7 and bbPress.
5
- Version: 1.0.1
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/math-captcha/
@@ -43,7 +43,7 @@ class Math_Captcha
43
  'numbers' => TRUE,
44
  'words' => FALSE
45
  ),
46
- 'time' => 60
47
  );
48
  public static $options = array();
49
  private $choice = array();
@@ -66,9 +66,9 @@ class Math_Captcha
66
 
67
  //actions
68
  add_action('plugins_loaded', array(&$this, 'init_mc_session'), 1);
69
- add_action('plugins_loaded', array(&$this, 'load_actions_filters'), 1);
70
  add_action('plugins_loaded', array(&$this, 'load_textdomain'));
71
  add_action('plugins_loaded', array(&$this, 'load_defaults'));
 
72
  add_action('admin_init', array(&$this, 'register_settings'));
73
  add_action('admin_menu', array(&$this, 'admin_menu_options'));
74
  add_action('admin_enqueue_scripts', array(&$this, 'admin_comments_scripts_styles'));
@@ -87,8 +87,6 @@ class Math_Captcha
87
  {
88
  global $pagenow;
89
 
90
- include_once(ABSPATH.'wp-admin/includes/plugin.php');
91
-
92
  //comments
93
  if($this->options['enable_for']['comment_form'] === TRUE)
94
  {
@@ -136,6 +134,8 @@ class Math_Captcha
136
  //bbPress
137
  if($this->options['enable_for']['bbpress'] === TRUE)
138
  {
 
 
139
  if(is_plugin_active('bbpress/bbpress.php') && (!is_user_logged_in() || (is_user_logged_in() && $this->options['hide_for_logged_users'] === FALSE)))
140
  {
141
  add_action('bbp_theme_after_reply_form_content', array(&$this, 'add_bbp_captcha_form'));
@@ -148,6 +148,8 @@ class Math_Captcha
148
  //Contact Form 7
149
  if($this->options['enable_for']['contact_form_7'] === TRUE)
150
  {
 
 
151
  if(is_plugin_active('contact-form-7/wp-contact-form-7.php'))
152
  {
153
  global $mc_class;
@@ -466,15 +468,17 @@ class Math_Captcha
466
  {
467
  if(is_admin())
468
  return;
469
-
470
  $captcha_title = apply_filters('math_captcha_title', $this->options['title']);
471
-
472
  echo '<p class="math-captcha-form">';
473
- if (!empty($captcha_title))
 
474
  {
475
  echo '<label>'.$captcha_title.'<br /></label>';
476
  }
477
- echo '<span>'.$this->generate_captcha_phrase('default').'</span>
 
478
  </p>';
479
  }
480
 
@@ -1193,11 +1197,11 @@ class Math_Captcha
1193
  */
1194
  public function plugin_extend_links($links, $file)
1195
  {
1196
- if (!current_user_can('install_plugins'))
1197
  return $links;
1198
-
1199
  $plugin = plugin_basename(__FILE__);
1200
-
1201
  if ($file == $plugin)
1202
  {
1203
  return array_merge(
@@ -1205,7 +1209,7 @@ class Math_Captcha
1205
  array(sprintf('<a href="http://www.dfactory.eu/support/forum/math-captcha/" target="_blank">%s</a>', __('Support', 'math-captcha')))
1206
  );
1207
  }
1208
-
1209
  return $links;
1210
  }
1211
 
2
  /*
3
  Plugin Name: Math Captcha
4
  Description: Math Captcha is a <strong>very effective CAPTCHA for WordPress</strong> that integrates into login, registration, comments, Contact Form 7 and bbPress.
5
+ Version: 1.0.1.1
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/math-captcha/
43
  'numbers' => TRUE,
44
  'words' => FALSE
45
  ),
46
+ 'time' => 300
47
  );
48
  public static $options = array();
49
  private $choice = array();
66
 
67
  //actions
68
  add_action('plugins_loaded', array(&$this, 'init_mc_session'), 1);
 
69
  add_action('plugins_loaded', array(&$this, 'load_textdomain'));
70
  add_action('plugins_loaded', array(&$this, 'load_defaults'));
71
+ add_action('init', array(&$this, 'load_actions_filters'), 1);
72
  add_action('admin_init', array(&$this, 'register_settings'));
73
  add_action('admin_menu', array(&$this, 'admin_menu_options'));
74
  add_action('admin_enqueue_scripts', array(&$this, 'admin_comments_scripts_styles'));
87
  {
88
  global $pagenow;
89
 
 
 
90
  //comments
91
  if($this->options['enable_for']['comment_form'] === TRUE)
92
  {
134
  //bbPress
135
  if($this->options['enable_for']['bbpress'] === TRUE)
136
  {
137
+ include_once(ABSPATH.'wp-admin/includes/plugin.php');
138
+
139
  if(is_plugin_active('bbpress/bbpress.php') && (!is_user_logged_in() || (is_user_logged_in() && $this->options['hide_for_logged_users'] === FALSE)))
140
  {
141
  add_action('bbp_theme_after_reply_form_content', array(&$this, 'add_bbp_captcha_form'));
148
  //Contact Form 7
149
  if($this->options['enable_for']['contact_form_7'] === TRUE)
150
  {
151
+ include_once(ABSPATH.'wp-admin/includes/plugin.php');
152
+
153
  if(is_plugin_active('contact-form-7/wp-contact-form-7.php'))
154
  {
155
  global $mc_class;
468
  {
469
  if(is_admin())
470
  return;
471
+
472
  $captcha_title = apply_filters('math_captcha_title', $this->options['title']);
473
+
474
  echo '<p class="math-captcha-form">';
475
+
476
+ if(!empty($captcha_title))
477
  {
478
  echo '<label>'.$captcha_title.'<br /></label>';
479
  }
480
+
481
+ echo '<span>'.$this->generate_captcha_phrase('bbpress').'</span>
482
  </p>';
483
  }
484
 
1197
  */
1198
  public function plugin_extend_links($links, $file)
1199
  {
1200
+ if(!current_user_can('install_plugins'))
1201
  return $links;
1202
+
1203
  $plugin = plugin_basename(__FILE__);
1204
+
1205
  if ($file == $plugin)
1206
  {
1207
  return array_merge(
1209
  array(sprintf('<a href="http://www.dfactory.eu/support/forum/math-captcha/" target="_blank">%s</a>', __('Support', 'math-captcha')))
1210
  );
1211
  }
1212
+
1213
  return $links;
1214
  }
1215