Math Captcha - Version 1.2.4

Version Description

  • Tweak: Switch from wp_generate_password() to custom function due to Jetpack statistics DB calls issue
  • Fix: Undefined contant notice in plugin settings
Download this release

Release Info

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

Code changes from version 1.2.3 to 1.2.4

includes/class-cookie-session.php CHANGED
@@ -37,12 +37,12 @@ class Math_Captcha_Cookie_Session
37
  case 'multi':
38
  for($i = 0; $i < 5; $i++)
39
  {
40
- $this->session_ids[$place][$i] = sha1(wp_generate_password(64, false, false));
41
  }
42
  break;
43
 
44
  case 'default':
45
- $this->session_ids[$place] = sha1(wp_generate_password(64, false, false));
46
  break;
47
  }
48
  }
@@ -58,5 +58,27 @@ class Math_Captcha_Cookie_Session
58
  }
59
  }
60
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
  ?>
37
  case 'multi':
38
  for($i = 0; $i < 5; $i++)
39
  {
40
+ $this->session_ids[$place][$i] = sha1($this->generate_password(64, false, false));
41
  }
42
  break;
43
 
44
  case 'default':
45
+ $this->session_ids[$place] = sha1($this->generate_password(64, false, false));
46
  break;
47
  }
48
  }
58
  }
59
  }
60
  }
61
+
62
+
63
+ /**
64
+ * Generate password helper, without wp_rand() call
65
+ */
66
+ private function generate_password($length = 12, $special_chars = true, $extra_special_chars = false)
67
+ {
68
+ $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
69
+ if ($special_chars)
70
+ $chars .= '!@#$%^&*()';
71
+ if ($extra_special_chars)
72
+ $chars .= '-_ []{}<>~`+=,.;:/?|';
73
+
74
+ $password = '';
75
+
76
+ for ($i = 0; $i < $length; $i++)
77
+ {
78
+ $password .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
79
+ }
80
+
81
+ return $password;
82
+ }
83
  }
84
  ?>
includes/class-settings.php CHANGED
@@ -95,7 +95,7 @@ class Math_Captcha_Settings
95
  <img alt="" border="0" src="https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif" width="1" height="1">
96
  </form>
97
  <hr/>
98
- <p class="df-link inner">Created by <a href="http://www.dfactory.eu/?utm_source=math-captcha-settings&utm_medium=link&utm_campaign=created-by" target="_blank" title="dFactory - Quality plugins for WordPress"><img src="'.DOWNLOAD_ATTACHMENTS_URL.'/images/logo-dfactory.png" title="dFactory - Quality plugins for WordPress" alt="dFactory - Quality plugins for WordPress"/></a></p>
99
  </div>
100
  </div>
101
  <form action="options.php" method="post">';
@@ -266,9 +266,9 @@ class Math_Captcha_Settings
266
  echo '
267
  <div id="mc_general_block_direct_comments">
268
  <fieldset>
269
- <input id="mc-general-block-direct-comments" type="checkbox" name="math_captcha_options[block_direct_comments]" '.checked(true, Math_Captcha()->options['general']['block_direct_comments'], false).'/><label for="mc-general-block-direct-comments">'.__('Blocks direct access to wp-comments-post.php. Enable this to prevent spambots from posting to Wordpress via a URL.', 'math-captcha').'</label>
270
  <br/>
271
- <span class="description">'.__('Blocks direct access to wp-comments-post.php. Enable this to prevent spambots from posting to Wordpress via a URL.', 'math-captcha').'</span>
272
  </fieldset>
273
  </div>';
274
  }
95
  <img alt="" border="0" src="https://www.paypalobjects.com/pl_PL/i/scr/pixel.gif" width="1" height="1">
96
  </form>
97
  <hr/>
98
+ <p class="df-link inner">Created by <a href="http://www.dfactory.eu/?utm_source=math-captcha-settings&utm_medium=link&utm_campaign=created-by" target="_blank" title="dFactory - Quality plugins for WordPress"><img src="'.MATH_CAPTCHA_URL.'/images/logo-dfactory.png" title="dFactory - Quality plugins for WordPress" alt="dFactory - Quality plugins for WordPress"/></a></p>
99
  </div>
100
  </div>
101
  <form action="options.php" method="post">';
266
  echo '
267
  <div id="mc_general_block_direct_comments">
268
  <fieldset>
269
+ <input id="mc-general-block-direct-comments" type="checkbox" name="math_captcha_options[block_direct_comments]" '.checked(true, Math_Captcha()->options['general']['block_direct_comments'], false).'/><label for="mc-general-block-direct-comments">'.__('Block direct access to wp-comments-post.php.', 'math-captcha').'</label>
270
  <br/>
271
+ <span class="description">'.__('Enable this to prevent spambots from posting to Wordpress via a URL.', 'math-captcha').'</span>
272
  </fieldset>
273
  </div>';
274
  }
languages/math-captcha-pl_PL.mo CHANGED
Binary file
languages/math-captcha-pl_PL.po CHANGED
@@ -1,15 +1,15 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Math Captcha\n"
4
- "POT-Creation-Date: 2014-09-05 17:19+0100\n"
5
- "PO-Revision-Date: 2014-09-05 17:20+0100\n"
6
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
7
  "Language-Team: dFactory <info@dfactory.eu>\n"
8
  "Language: en\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.9\n"
13
  "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
  "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
@@ -283,37 +283,46 @@ msgstr "Wybierz w których miejscach chcesz używać Math Captcha."
283
  msgid "Enable to hide captcha for logged in users."
284
  msgstr "Włącz aby ukryć captcha dla zalogowanych użytkowników."
285
 
286
- #: ../includes/class-settings.php:198
 
 
 
 
287
  msgid "Select which mathematical operations to use in your captcha."
288
  msgstr ""
289
  "Wybierz jakie rodzaje operacji matematycznych będą stosowane w captcha."
290
 
291
- #: ../includes/class-settings.php:221
292
  msgid "Select how you'd like to display you captcha."
293
  msgstr "Wybierz w jaki sposób chcesz wyświetlać captcha."
294
 
295
- #: ../includes/class-settings.php:237
296
  msgid "How to entitle field with captcha?"
297
  msgstr "Jaki tytuł będzie miało pole z captcha?"
298
 
299
- #: ../includes/class-settings.php:253
300
  msgid "Enter the time (in seconds) a user has to enter captcha value."
301
  msgstr "Podaj czas (w sekundach) w jakim należy uzupełnić pole captcha."
302
 
303
- #: ../includes/class-settings.php:267
304
- msgid ""
305
- "Blocks direct access to wp-comments-post.php. Enable this to prevent "
306
- "spambots from posting to Wordpress via a URL."
 
 
307
  msgstr ""
308
- "To ustawienie blokuje bezpośredni dostęp do pliku wp-comments-post.php. "
309
  "Włącz to jeśli chcesz uniemożliwiść spambotom dodawanie komentarzy poprzez "
310
  "URL."
311
 
312
- #: ../includes/class-settings.php:281
313
  msgid "Delete settings on plugin deactivation."
314
  msgstr "Usuń wszystkie dane wtyczki podczas deaktywacji."
315
 
316
- #: ../includes/class-settings.php:325
 
 
 
 
317
  msgid ""
318
  "You need to check at least one mathematical operation. Defaults settings of "
319
  "this option restored."
@@ -321,7 +330,7 @@ msgstr ""
321
  "Musisz wybrać przynajmniej jedną operację. Przywrócono domyślne ustawienie "
322
  "tej opcji."
323
 
324
- #: ../includes/class-settings.php:344
325
  msgid ""
326
  "You need to check at least one group. Defaults settings of this option "
327
  "restored."
@@ -329,7 +338,7 @@ msgstr ""
329
  "Musisz wybrać przynajmniej jedną grupę. Przywrócono domyślne ustawienie tej "
330
  "opcji."
331
 
332
- #: ../includes/class-settings.php:381
333
  msgid "Settings restored to defaults."
334
  msgstr "Ustawienia zostały przywrócone do domyślnych."
335
 
@@ -361,6 +370,14 @@ msgstr "Forum pomocy"
361
  msgid "Settings"
362
  msgstr "Ustawienia"
363
 
 
 
 
 
 
 
 
 
364
  #~ msgid "yes"
365
  #~ msgstr "tak"
366
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Math Captcha\n"
4
+ "POT-Creation-Date: 2015-01-25 22:43+0100\n"
5
+ "PO-Revision-Date: 2015-01-25 22:44+0100\n"
6
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
7
  "Language-Team: dFactory <info@dfactory.eu>\n"
8
  "Language: en\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.7.3\n"
13
  "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
  "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
283
  msgid "Enable to hide captcha for logged in users."
284
  msgstr "Włącz aby ukryć captcha dla zalogowanych użytkowników."
285
 
286
+ #: ../includes/class-settings.php:177
287
+ msgid "Would you like to hide captcha for logged in users?"
288
+ msgstr "Chesz ukryć captcha dla zalogowanych użytkowników?"
289
+
290
+ #: ../includes/class-settings.php:200
291
  msgid "Select which mathematical operations to use in your captcha."
292
  msgstr ""
293
  "Wybierz jakie rodzaje operacji matematycznych będą stosowane w captcha."
294
 
295
+ #: ../includes/class-settings.php:223
296
  msgid "Select how you'd like to display you captcha."
297
  msgstr "Wybierz w jaki sposób chcesz wyświetlać captcha."
298
 
299
+ #: ../includes/class-settings.php:239
300
  msgid "How to entitle field with captcha?"
301
  msgstr "Jaki tytuł będzie miało pole z captcha?"
302
 
303
+ #: ../includes/class-settings.php:255
304
  msgid "Enter the time (in seconds) a user has to enter captcha value."
305
  msgstr "Podaj czas (w sekundach) w jakim należy uzupełnić pole captcha."
306
 
307
+ #: ../includes/class-settings.php:269
308
+ msgid "Block direct access to wp-comments-post.php."
309
+ msgstr "Blokuj bezpośredni dostęp do wp-comments-post.php."
310
+
311
+ #: ../includes/class-settings.php:271
312
+ msgid "Enable this to prevent spambots from posting to Wordpress via a URL."
313
  msgstr ""
 
314
  "Włącz to jeśli chcesz uniemożliwiść spambotom dodawanie komentarzy poprzez "
315
  "URL."
316
 
317
+ #: ../includes/class-settings.php:285
318
  msgid "Delete settings on plugin deactivation."
319
  msgstr "Usuń wszystkie dane wtyczki podczas deaktywacji."
320
 
321
+ #: ../includes/class-settings.php:287
322
+ msgid "Delete settings on plugin deactivation"
323
+ msgstr "Usuń dane wtyczki podczas jej deaktywacji"
324
+
325
+ #: ../includes/class-settings.php:331
326
  msgid ""
327
  "You need to check at least one mathematical operation. Defaults settings of "
328
  "this option restored."
330
  "Musisz wybrać przynajmniej jedną operację. Przywrócono domyślne ustawienie "
331
  "tej opcji."
332
 
333
+ #: ../includes/class-settings.php:350
334
  msgid ""
335
  "You need to check at least one group. Defaults settings of this option "
336
  "restored."
338
  "Musisz wybrać przynajmniej jedną grupę. Przywrócono domyślne ustawienie tej "
339
  "opcji."
340
 
341
+ #: ../includes/class-settings.php:387
342
  msgid "Settings restored to defaults."
343
  msgstr "Ustawienia zostały przywrócone do domyślnych."
344
 
370
  msgid "Settings"
371
  msgstr "Ustawienia"
372
 
373
+ #~ msgid ""
374
+ #~ "Blocks direct access to wp-comments-post.php. Enable this to prevent "
375
+ #~ "spambots from posting to Wordpress via a URL."
376
+ #~ msgstr ""
377
+ #~ "To ustawienie blokuje bezpośredni dostęp do pliku wp-comments-post.php. "
378
+ #~ "Włącz to jeśli chcesz uniemożliwiść spambotom dodawanie komentarzy "
379
+ #~ "poprzez URL."
380
+
381
  #~ msgid "yes"
382
  #~ msgstr "tak"
383
 
languages/math-captcha-ro_RO.mo ADDED
Binary file
languages/math-captcha-ro_RO.po CHANGED
@@ -3,8 +3,8 @@ msgstr ""
3
  "Project-Id-Version: Math Captcha v1.0.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2015-01-16 17:39+0200\n"
7
- "Last-Translator: SiL3R <contact@xarold.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
3
  "Project-Id-Version: Math Captcha v1.0.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2015-01-19 17:40+0100\n"
7
+ "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
languages/math-captcha.pot CHANGED
@@ -1,15 +1,15 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Math Captcha\n"
4
- "POT-Creation-Date: 2014-09-05 17:19+0100\n"
5
- "PO-Revision-Date: 2014-09-05 17:19+0100\n"
6
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
7
  "Language-Team: dFactory <info@dfactory.eu>\n"
8
  "Language: en\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.9\n"
13
  "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
  "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
@@ -283,45 +283,55 @@ msgstr ""
283
  msgid "Enable to hide captcha for logged in users."
284
  msgstr ""
285
 
286
- #: ../includes/class-settings.php:198
 
 
 
 
287
  msgid "Select which mathematical operations to use in your captcha."
288
  msgstr ""
289
 
290
- #: ../includes/class-settings.php:221
291
  msgid "Select how you'd like to display you captcha."
292
  msgstr ""
293
 
294
- #: ../includes/class-settings.php:237
295
  msgid "How to entitle field with captcha?"
296
  msgstr ""
297
 
298
- #: ../includes/class-settings.php:253
299
  msgid "Enter the time (in seconds) a user has to enter captcha value."
300
  msgstr ""
301
 
302
- #: ../includes/class-settings.php:267
303
- msgid ""
304
- "Blocks direct access to wp-comments-post.php. Enable this to prevent "
305
- "spambots from posting to Wordpress via a URL."
306
  msgstr ""
307
 
308
- #: ../includes/class-settings.php:281
 
 
 
 
309
  msgid "Delete settings on plugin deactivation."
310
  msgstr ""
311
 
312
- #: ../includes/class-settings.php:325
 
 
 
 
313
  msgid ""
314
  "You need to check at least one mathematical operation. Defaults settings of "
315
  "this option restored."
316
  msgstr ""
317
 
318
- #: ../includes/class-settings.php:344
319
  msgid ""
320
  "You need to check at least one group. Defaults settings of this option "
321
  "restored."
322
  msgstr ""
323
 
324
- #: ../includes/class-settings.php:381
325
  msgid "Settings restored to defaults."
326
  msgstr ""
327
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Math Captcha\n"
4
+ "POT-Creation-Date: 2015-01-25 22:44+0100\n"
5
+ "PO-Revision-Date: 2015-01-25 22:44+0100\n"
6
  "Last-Translator: Bartosz Arendt <info@dfactory.eu>\n"
7
  "Language-Team: dFactory <info@dfactory.eu>\n"
8
  "Language: en\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.7.3\n"
13
  "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
  "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
283
  msgid "Enable to hide captcha for logged in users."
284
  msgstr ""
285
 
286
+ #: ../includes/class-settings.php:177
287
+ msgid "Would you like to hide captcha for logged in users?"
288
+ msgstr ""
289
+
290
+ #: ../includes/class-settings.php:200
291
  msgid "Select which mathematical operations to use in your captcha."
292
  msgstr ""
293
 
294
+ #: ../includes/class-settings.php:223
295
  msgid "Select how you'd like to display you captcha."
296
  msgstr ""
297
 
298
+ #: ../includes/class-settings.php:239
299
  msgid "How to entitle field with captcha?"
300
  msgstr ""
301
 
302
+ #: ../includes/class-settings.php:255
303
  msgid "Enter the time (in seconds) a user has to enter captcha value."
304
  msgstr ""
305
 
306
+ #: ../includes/class-settings.php:269
307
+ msgid "Block direct access to wp-comments-post.php."
 
 
308
  msgstr ""
309
 
310
+ #: ../includes/class-settings.php:271
311
+ msgid "Enable this to prevent spambots from posting to Wordpress via a URL."
312
+ msgstr ""
313
+
314
+ #: ../includes/class-settings.php:285
315
  msgid "Delete settings on plugin deactivation."
316
  msgstr ""
317
 
318
+ #: ../includes/class-settings.php:287
319
+ msgid "Delete settings on plugin deactivation"
320
+ msgstr ""
321
+
322
+ #: ../includes/class-settings.php:331
323
  msgid ""
324
  "You need to check at least one mathematical operation. Defaults settings of "
325
  "this option restored."
326
  msgstr ""
327
 
328
+ #: ../includes/class-settings.php:350
329
  msgid ""
330
  "You need to check at least one group. Defaults settings of this option "
331
  "restored."
332
  msgstr ""
333
 
334
+ #: ../includes/class-settings.php:387
335
  msgid "Settings restored to defaults."
336
  msgstr ""
337
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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: 4.1
7
- Stable tag: 1.2.3
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -61,6 +61,10 @@ A. Chances are, someone else has asked it. Check out the support forum at: http:
61
 
62
  == Changelog ==
63
 
 
 
 
 
64
  = 1.2.3 =
65
  * New: Romanian translation, thanks to [Robert M.](http://www.administrezimobile.net)
66
 
@@ -123,5 +127,6 @@ A. Chances are, someone else has asked it. Check out the support forum at: http:
123
 
124
  == Upgrade Notice ==
125
 
126
- = 1.2.3 =
127
- * New: Romanian translation, thanks to [Robert M.](http://www.administrezimobile.net)
 
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: 4.1
7
+ Stable tag: 1.2.4
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
61
 
62
  == Changelog ==
63
 
64
+ = 1.2.4 =
65
+ * Tweak: Switch from wp_generate_password() to custom function due to Jetpack statistics DB calls issue
66
+ * Fix: Undefined contant notice in plugin settings
67
+
68
  = 1.2.3 =
69
  * New: Romanian translation, thanks to [Robert M.](http://www.administrezimobile.net)
70
 
127
 
128
  == Upgrade Notice ==
129
 
130
+ = 1.2.4 =
131
+ * Tweak: Switch from wp_generate_password() to custom function due to Jetpack statistics DB calls issue
132
+ * Fix: Undefined contant notice in plugin settings
wp-math-captcha.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Math Captcha
4
  Description: Math Captcha is a <strong>100% effective CAPTCHA for WordPress</strong> that integrates into login, registration, comments, Contact Form 7 and bbPress.
5
- Version: 1.2.3
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/math-captcha/
@@ -67,7 +67,7 @@ class Math_Captcha
67
  'deactivation_delete' => false,
68
  'flush_rules' => false
69
  ),
70
- 'version' => '1.2.3'
71
  );
72
 
73
 
2
  /*
3
  Plugin Name: Math Captcha
4
  Description: Math Captcha is a <strong>100% effective CAPTCHA for WordPress</strong> that integrates into login, registration, comments, Contact Form 7 and bbPress.
5
+ Version: 1.2.4
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/math-captcha/
67
  'deactivation_delete' => false,
68
  'flush_rules' => false
69
  ),
70
+ 'version' => '1.2.4'
71
  );
72
 
73