Math Captcha - Version 1.0.2

Version Description

  • New: Option to delete plugin settings on deactivation
  • New: Persian translation by Ali Mirzaei
  • Fix: Captcha time expired error - thanks to Aaron and Simo
Download this release

Release Info

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

Code changes from version 1.0.1.1 to 1.0.2

css/{math-captcha-admin.css → admin.css} RENAMED
File without changes
js/admin.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+
3
+ $('.wplikebtns').buttonset();
4
+ });
js/math-captcha-admin.js DELETED
@@ -1,3 +0,0 @@
1
- jQuery(document).ready(function($) {
2
- $('#mc_enable_for, #mc_hide_for_logged, #mc_mathematical_operations, #mc_groups').buttonset();
3
- });
 
 
 
languages/math-captcha-fa_IR.mo ADDED
Binary file
languages/math-captcha-fa_IR.po ADDED
@@ -0,0 +1,344 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: math-captcha\n"
4
+ "POT-Creation-Date: 2013-07-09 20:29+0330\n"
5
+ "PO-Revision-Date: 2013-07-09 20:46+0330\n"
6
+ "Last-Translator: Alimir <info@alimir.ir>\n"
7
+ "Language-Team: Alimir.ir <info@alimir.ir>\n"
8
+ "Language: Persian\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.5.4\n"
13
+ "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+ "X-Poedit-SearchPath-1: ..\n"
18
+
19
+ #: ../wp-math-captcha.php:546
20
+ msgid "one"
21
+ msgstr "یک"
22
+
23
+ #: ../wp-math-captcha.php:547
24
+ msgid "two"
25
+ msgstr "دو"
26
+
27
+ #: ../wp-math-captcha.php:548
28
+ msgid "three"
29
+ msgstr "سه"
30
+
31
+ #: ../wp-math-captcha.php:549
32
+ msgid "four"
33
+ msgstr "چهار"
34
+
35
+ #: ../wp-math-captcha.php:550
36
+ msgid "five"
37
+ msgstr "پنج"
38
+
39
+ #: ../wp-math-captcha.php:551
40
+ msgid "six"
41
+ msgstr "شش"
42
+
43
+ #: ../wp-math-captcha.php:552
44
+ msgid "seven"
45
+ msgstr "هفت"
46
+
47
+ #: ../wp-math-captcha.php:553
48
+ msgid "eight"
49
+ msgstr "هشت"
50
+
51
+ #: ../wp-math-captcha.php:554
52
+ msgid "nine"
53
+ msgstr "نه"
54
+
55
+ #: ../wp-math-captcha.php:555
56
+ msgid "ten"
57
+ msgstr "ده"
58
+
59
+ #: ../wp-math-captcha.php:556
60
+ msgid "eleven"
61
+ msgstr "یازده"
62
+
63
+ #: ../wp-math-captcha.php:557
64
+ msgid "twelve"
65
+ msgstr "دوازده"
66
+
67
+ #: ../wp-math-captcha.php:558
68
+ msgid "thirteen"
69
+ msgstr "سیزده"
70
+
71
+ #: ../wp-math-captcha.php:559
72
+ msgid "fourteen"
73
+ msgstr "چهارده"
74
+
75
+ #: ../wp-math-captcha.php:560
76
+ msgid "fifteen"
77
+ msgstr "پانزده"
78
+
79
+ #: ../wp-math-captcha.php:561
80
+ msgid "sixteen"
81
+ msgstr "شانزده"
82
+
83
+ #: ../wp-math-captcha.php:562
84
+ msgid "seventeen"
85
+ msgstr "هفده"
86
+
87
+ #: ../wp-math-captcha.php:563
88
+ msgid "eighteen"
89
+ msgstr "هجده"
90
+
91
+ #: ../wp-math-captcha.php:564
92
+ msgid "nineteen"
93
+ msgstr "نوزده"
94
+
95
+ #: ../wp-math-captcha.php:565
96
+ msgid "twenty"
97
+ msgstr "بیست"
98
+
99
+ #: ../wp-math-captcha.php:566
100
+ msgid "thirty"
101
+ msgstr "سی"
102
+
103
+ #: ../wp-math-captcha.php:567
104
+ msgid "forty"
105
+ msgstr "چهل"
106
+
107
+ #: ../wp-math-captcha.php:568
108
+ msgid "fifty"
109
+ msgstr "پنجاه"
110
+
111
+ #: ../wp-math-captcha.php:569
112
+ msgid "sixty"
113
+ msgstr "شصت"
114
+
115
+ #: ../wp-math-captcha.php:570
116
+ msgid "seventy"
117
+ msgstr "هفتاد"
118
+
119
+ #: ../wp-math-captcha.php:571
120
+ msgid "eighty"
121
+ msgstr "هشتاد"
122
+
123
+ #: ../wp-math-captcha.php:572
124
+ msgid "ninety"
125
+ msgstr "نود"
126
+
127
+ #: ../wp-math-captcha.php:873 ../wp-math-captcha.php:874
128
+ #: ../wp-math-captcha.php:875
129
+ msgid "ERROR"
130
+ msgstr "خطا"
131
+
132
+ #: ../wp-math-captcha.php:873 ../includes/math-captcha-cf7.php:113
133
+ msgid "Please enter captcha value."
134
+ msgstr "لطفا کد امنیتی را وارد کنید."
135
+
136
+ #: ../wp-math-captcha.php:874 ../includes/math-captcha-cf7.php:109
137
+ msgid "Invalid captcha value."
138
+ msgstr "کد امنیتی وارد شده اشتباه است"
139
+
140
+ #: ../wp-math-captcha.php:875 ../includes/math-captcha-cf7.php:117
141
+ msgid "Captcha time expired."
142
+ msgstr "فرصت وارد کردن کد امنیتی به اتمام رسید."
143
+
144
+ #: ../wp-math-captcha.php:879
145
+ msgid "login form"
146
+ msgstr "فرم ورود"
147
+
148
+ #: ../wp-math-captcha.php:880
149
+ msgid "registration form"
150
+ msgstr "فرم عضویت"
151
+
152
+ #: ../wp-math-captcha.php:881
153
+ msgid "reset password form"
154
+ msgstr "بازیابی رمز عبور"
155
+
156
+ #: ../wp-math-captcha.php:882
157
+ msgid "comment form"
158
+ msgstr "فرم دیدگاه ها"
159
+
160
+ #: ../wp-math-captcha.php:883
161
+ msgid "bbpress"
162
+ msgstr "بی بی پرس"
163
+
164
+ #: ../wp-math-captcha.php:884
165
+ msgid "contact form 7"
166
+ msgstr "فرم تماس 7"
167
+
168
+ #: ../wp-math-captcha.php:888
169
+ msgid "yes"
170
+ msgstr "بله"
171
+
172
+ #: ../wp-math-captcha.php:889
173
+ msgid "no"
174
+ msgstr "خیر"
175
+
176
+ #: ../wp-math-captcha.php:893
177
+ msgid "addition (+)"
178
+ msgstr "جمع (+)"
179
+
180
+ #: ../wp-math-captcha.php:894
181
+ msgid "subtraction (-)"
182
+ msgstr "تفریق (-)"
183
+
184
+ #: ../wp-math-captcha.php:895
185
+ msgid "multiplication (&#215;)"
186
+ msgstr "ضرب (&#215;)"
187
+
188
+ #: ../wp-math-captcha.php:896
189
+ msgid "division (&#247;)"
190
+ msgstr "تقسیم (&#247;)"
191
+
192
+ #: ../wp-math-captcha.php:900
193
+ msgid "numbers"
194
+ msgstr "اعداد"
195
+
196
+ #: ../wp-math-captcha.php:901
197
+ msgid "words"
198
+ msgstr "حروف"
199
+
200
+ #: ../wp-math-captcha.php:913
201
+ msgid "Math Captcha settings"
202
+ msgstr "بخش تنظیمات کپچای ریاضیاتی"
203
+
204
+ #: ../wp-math-captcha.php:914
205
+ msgid "Enable Math Captcha for"
206
+ msgstr "فعال سازی کد امنیتی برای:"
207
+
208
+ #: ../wp-math-captcha.php:915
209
+ msgid "Hide for logged in users"
210
+ msgstr "پنهان نمودن کد برای کاربران وارد شده"
211
+
212
+ #: ../wp-math-captcha.php:916
213
+ msgid "Mathematical operations"
214
+ msgstr "عملگرهای ریاضیاتی"
215
+
216
+ #: ../wp-math-captcha.php:917
217
+ msgid "Display captcha as"
218
+ msgstr "نمایش کپچا به صورت"
219
+
220
+ #: ../wp-math-captcha.php:918
221
+ msgid "Captcha field title"
222
+ msgstr "عنوان فیلد کپچا"
223
+
224
+ #: ../wp-math-captcha.php:919
225
+ msgid "Captcha time"
226
+ msgstr "زمان دهی"
227
+
228
+ #: ../wp-math-captcha.php:939
229
+ msgid "Select were would you like to use Math Captcha."
230
+ msgstr "محل استفاده ی کپچای ریاضیاتی را مشخص کنید."
231
+
232
+ #: ../wp-math-captcha.php:960
233
+ msgid "Would you like to hide captcha for logged in users?"
234
+ msgstr "آیا می خواهید کد امنیتی از دید کاربران وارد شده مخفی بماند؟"
235
+
236
+ #: ../wp-math-captcha.php:973
237
+ msgid ""
238
+ "Select what kind of mathematical operations will be used to generate captcha."
239
+ msgstr "عنوانی را برای فیلد کپچا انتخاب کنید."
240
+
241
+ #: ../wp-math-captcha.php:986
242
+ msgid "Enter the time (in seconds) a user has to enter captcha value."
243
+ msgstr "مهلت زمانیه وارد کردن کد امنیتی را برای کاربر مشخص کنید (به ثانیه)"
244
+
245
+ #: ../wp-math-captcha.php:1007
246
+ msgid "Select which mathematical operations to use in your captcha."
247
+ msgstr ""
248
+ "عملگرهای ریاضیاتی ای را که می خواهید در تولید کد امنیتی استفاده شوند، انتخاب "
249
+ "کنید."
250
+
251
+ #: ../wp-math-captcha.php:1028
252
+ msgid "Select how you'd like to display you captcha."
253
+ msgstr "نحوه ی نمایش دلخواه خود را برای کپچا انتخاب کنید."
254
+
255
+ #: ../wp-math-captcha.php:1073
256
+ msgid ""
257
+ "You need to check at least one mathematical operation. Defaults settings of "
258
+ "this option restored."
259
+ msgstr ""
260
+
261
+ #: ../wp-math-captcha.php:1089
262
+ msgid ""
263
+ "You need to check at least one group. Defaults settings of this option "
264
+ "restored."
265
+ msgstr ""
266
+
267
+ #: ../wp-math-captcha.php:1119 ../wp-math-captcha.php:1120
268
+ #: ../wp-math-captcha.php:1135 ../wp-math-captcha.php:1148
269
+ #: ../includes/math-captcha-cf7.php:148
270
+ msgid "Math Captcha"
271
+ msgstr "کپچای ریاضیاتی"
272
+
273
+ #: ../wp-math-captcha.php:1150
274
+ msgid "Need support?"
275
+ msgstr "نیاز به پشتیبانی دارید؟"
276
+
277
+ #: ../wp-math-captcha.php:1151
278
+ msgid ""
279
+ "If you are having problems with this plugin, please talk about them in the"
280
+ msgstr ""
281
+ "اگر مشکلی با این افزونه دارید می توانید آن را در انجمن پشتیبانی به آدرس "
282
+ "روبرو در میان بگذارید:"
283
+
284
+ #: ../wp-math-captcha.php:1151
285
+ msgid "Support forum"
286
+ msgstr "ورود به انجمن پشتیبانی"
287
+
288
+ #: ../wp-math-captcha.php:1153
289
+ msgid "Do you like this plugin?"
290
+ msgstr "آیا از این افزونه راضی هستید؟"
291
+
292
+ #: ../wp-math-captcha.php:1154
293
+ msgid "Rate it 5"
294
+ msgstr "امتیاز دهی"
295
+
296
+ #: ../wp-math-captcha.php:1154
297
+ msgid "on WordPress.org"
298
+ msgstr "به افزونه در مخزن وردپرس"
299
+
300
+ #: ../wp-math-captcha.php:1155
301
+ msgid "Blog about it & link to the"
302
+ msgstr "مشاهده مشخصات بیشتر در"
303
+
304
+ #: ../wp-math-captcha.php:1155
305
+ msgid "plugin page"
306
+ msgstr "صفحه ی افزونه"
307
+
308
+ #: ../wp-math-captcha.php:1156
309
+ msgid "Check out our other"
310
+ msgstr "مشاهده ی دیگر"
311
+
312
+ #: ../wp-math-captcha.php:1156
313
+ msgid "WordPress plugins"
314
+ msgstr "افزونه های وردپرسی ما"
315
+
316
+ #: ../wp-math-captcha.php:1209
317
+ msgid "Support"
318
+ msgstr "پشتیبانی"
319
+
320
+ #: ../wp-math-captcha.php:1231
321
+ msgid "Settings"
322
+ msgstr "تنظیمات"
323
+
324
+ #: ../includes/math-captcha-cf7.php:160
325
+ msgid "Name"
326
+ msgstr "نام"
327
+
328
+ #: ../includes/math-captcha-cf7.php:166
329
+ msgid "Input field settings"
330
+ msgstr "تنظیمات فیلد ورودی"
331
+
332
+ #: ../includes/math-captcha-cf7.php:169 ../includes/math-captcha-cf7.php:173
333
+ msgid "optional"
334
+ msgstr "اختیاری"
335
+
336
+ #: ../includes/math-captcha-cf7.php:179
337
+ msgid "Copy this code and paste it into the form left."
338
+ msgstr ""
339
+
340
+ #~ msgid "Edited & Translated by"
341
+ #~ msgstr " ویرایش و فارسی سازی در"
342
+
343
+ #~ msgid "wordpress and programming world"
344
+ #~ msgstr "دنیای وردپرس و برنامه نویسی"
languages/math-captcha-pl_PL.mo CHANGED
Binary file
languages/math-captcha-pl_PL.po CHANGED
@@ -1,257 +1,265 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Math Captcha\n"
4
- "POT-Creation-Date: 2013-06-20 21:03+0100\n"
5
- "PO-Revision-Date: 2013-06-20 21:03+0100\n"
6
  "Last-Translator: Bartosz Arendt <info@digitalfactory.pl>\n"
7
  "Language-Team: dFactory <info@dfactory.eu>\n"
8
  "Language: English\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.5.5\n"
13
  "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
  "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-SearchPath-0: ..\n"
17
 
18
- #: ../wp-math-captcha.php:542
19
  msgid "one"
20
  msgstr "jeden"
21
 
22
- #: ../wp-math-captcha.php:543
23
  msgid "two"
24
  msgstr "dwa"
25
 
26
- #: ../wp-math-captcha.php:544
27
  msgid "three"
28
  msgstr "trzy"
29
 
30
- #: ../wp-math-captcha.php:545
31
  msgid "four"
32
  msgstr "cztery"
33
 
34
- #: ../wp-math-captcha.php:546
35
  msgid "five"
36
  msgstr "pięć"
37
 
38
- #: ../wp-math-captcha.php:547
39
  msgid "six"
40
  msgstr "sześć"
41
 
42
- #: ../wp-math-captcha.php:548
43
  msgid "seven"
44
  msgstr "siedem"
45
 
46
- #: ../wp-math-captcha.php:549
47
  msgid "eight"
48
  msgstr "osiem"
49
 
50
- #: ../wp-math-captcha.php:550
51
  msgid "nine"
52
  msgstr "dziewięć"
53
 
54
- #: ../wp-math-captcha.php:551
55
  msgid "ten"
56
  msgstr "dziesięć"
57
 
58
- #: ../wp-math-captcha.php:552
59
  msgid "eleven"
60
  msgstr "jedenaście"
61
 
62
- #: ../wp-math-captcha.php:553
63
  msgid "twelve"
64
  msgstr "dwanaście"
65
 
66
- #: ../wp-math-captcha.php:554
67
  msgid "thirteen"
68
  msgstr "trzynaście"
69
 
70
- #: ../wp-math-captcha.php:555
71
  msgid "fourteen"
72
  msgstr "czternaście"
73
 
74
- #: ../wp-math-captcha.php:556
75
  msgid "fifteen"
76
  msgstr "piętnaście"
77
 
78
- #: ../wp-math-captcha.php:557
79
  msgid "sixteen"
80
  msgstr "szesnaście"
81
 
82
- #: ../wp-math-captcha.php:558
83
  msgid "seventeen"
84
  msgstr "siedemnaście"
85
 
86
- #: ../wp-math-captcha.php:559
87
  msgid "eighteen"
88
  msgstr "osiemnaście"
89
 
90
- #: ../wp-math-captcha.php:560
91
  msgid "nineteen"
92
  msgstr "dziewiętnaście"
93
 
94
- #: ../wp-math-captcha.php:561
95
  msgid "twenty"
96
  msgstr "dwadzieścia"
97
 
98
- #: ../wp-math-captcha.php:562
99
  msgid "thirty"
100
  msgstr "trzydzieści"
101
 
102
- #: ../wp-math-captcha.php:563
103
  msgid "forty"
104
  msgstr "czterdzieści"
105
 
106
- #: ../wp-math-captcha.php:564
107
  msgid "fifty"
108
  msgstr "pięćdziesiąt"
109
 
110
- #: ../wp-math-captcha.php:565
111
  msgid "sixty"
112
  msgstr "sześćdziesiąt"
113
 
114
- #: ../wp-math-captcha.php:566
115
  msgid "seventy"
116
  msgstr "siedemdziesiąt"
117
 
118
- #: ../wp-math-captcha.php:567
119
  msgid "eighty"
120
  msgstr "osiemdziesiąt"
121
 
122
- #: ../wp-math-captcha.php:568
123
  msgid "ninety"
124
  msgstr "dziewięćdziesiąt"
125
 
126
- #: ../wp-math-captcha.php:869 ../wp-math-captcha.php:870
127
- #: ../wp-math-captcha.php:871
128
  msgid "ERROR"
129
  msgstr "BŁĄD"
130
 
131
- #: ../wp-math-captcha.php:869 ../includes/math-captcha-cf7.php:113
132
  msgid "Please enter captcha value."
133
  msgstr "Proszę wpisać wartość."
134
 
135
- #: ../wp-math-captcha.php:870 ../includes/math-captcha-cf7.php:109
136
  msgid "Invalid captcha value."
137
  msgstr "Nieprawidłowa wartość."
138
 
139
- #: ../wp-math-captcha.php:871 ../includes/math-captcha-cf7.php:117
140
  msgid "Captcha time expired."
141
  msgstr "Upłynął czas."
142
 
143
- #: ../wp-math-captcha.php:875
144
  msgid "login form"
145
  msgstr "formularz logowania"
146
 
147
- #: ../wp-math-captcha.php:876
148
  msgid "registration form"
149
  msgstr "formularz rejestracji"
150
 
151
- #: ../wp-math-captcha.php:877
152
  msgid "reset password form"
153
  msgstr "resetowanie hasła"
154
 
155
- #: ../wp-math-captcha.php:878
156
  msgid "comment form"
157
  msgstr "komentarze"
158
 
159
- #: ../wp-math-captcha.php:879
160
  msgid "bbpress"
161
  msgstr "bbpress"
162
 
163
- #: ../wp-math-captcha.php:880
164
  msgid "contact form 7"
165
  msgstr "contact form 7"
166
 
167
- #: ../wp-math-captcha.php:884
168
  msgid "yes"
169
  msgstr "tak"
170
 
171
- #: ../wp-math-captcha.php:885
172
  msgid "no"
173
  msgstr "nie"
174
 
175
- #: ../wp-math-captcha.php:889
176
  msgid "addition (+)"
177
  msgstr "dodawanie (+)"
178
 
179
- #: ../wp-math-captcha.php:890
180
  msgid "subtraction (-)"
181
  msgstr "odejmowanie (-)"
182
 
183
- #: ../wp-math-captcha.php:891
184
  msgid "multiplication (&#215;)"
185
  msgstr "mnożenie (&#215;)"
186
 
187
- #: ../wp-math-captcha.php:892
188
  msgid "division (&#247;)"
189
  msgstr "dzielenie (&#247;)"
190
 
191
- #: ../wp-math-captcha.php:896
192
  msgid "numbers"
193
  msgstr "liczby"
194
 
195
- #: ../wp-math-captcha.php:897
196
  msgid "words"
197
  msgstr "słowa"
198
 
199
- #: ../wp-math-captcha.php:909
200
  msgid "Math Captcha settings"
201
  msgstr "Ustawienia Math Captcha"
202
 
203
- #: ../wp-math-captcha.php:910
204
  msgid "Enable Math Captcha for"
205
  msgstr "Włącz captcha dla"
206
 
207
- #: ../wp-math-captcha.php:911
208
  msgid "Hide for logged in users"
209
  msgstr "Ukryj dla zalogowanych"
210
 
211
- #: ../wp-math-captcha.php:912
212
  msgid "Mathematical operations"
213
  msgstr "Operacje matematyczne"
214
 
215
- #: ../wp-math-captcha.php:913
216
  msgid "Display captcha as"
217
  msgstr "Wyśiwtlaj captcha jako"
218
 
219
- #: ../wp-math-captcha.php:914
220
  msgid "Captcha field title"
221
  msgstr "Tytuł pola captcha"
222
 
223
- #: ../wp-math-captcha.php:915
224
  msgid "Captcha time"
225
  msgstr "Czas captcha"
226
 
227
- #: ../wp-math-captcha.php:935
 
 
 
 
228
  msgid "Select were would you like to use Math Captcha."
229
  msgstr "Wybierz w których miejscach chcesz używać Math Captcha"
230
 
231
- #: ../wp-math-captcha.php:956
232
  msgid "Would you like to hide captcha for logged in users?"
233
  msgstr "Czy chcesz ukryć captcha dla zalogowanych użytkowników?"
234
 
235
- #: ../wp-math-captcha.php:969
236
  msgid ""
237
  "Select what kind of mathematical operations will be used to generate captcha."
238
  msgstr ""
239
  "Wybierz jakie rodzaje operacji matematycznych będą stosowane w captcha."
240
 
241
- #: ../wp-math-captcha.php:982
242
  msgid "Enter the time (in seconds) a user has to enter captcha value."
243
  msgstr "Podaj czas (w sekundach) w jakim należy uzupełnić pole captcha."
244
 
245
- #: ../wp-math-captcha.php:1003
 
 
 
 
246
  msgid "Select which mathematical operations to use in your captcha."
247
  msgstr ""
248
  "Wybierz jakie rodzaje operacji matematycznych będą stosowane w captcha."
249
 
250
- #: ../wp-math-captcha.php:1024
251
  msgid "Select how you'd like to display you captcha."
252
  msgstr "Wybierz w jaki sposób chcesz wyświetlać captcha."
253
 
254
- #: ../wp-math-captcha.php:1069
255
  msgid ""
256
  "You need to check at least one mathematical operation. Defaults settings of "
257
  "this option restored."
@@ -259,7 +267,7 @@ msgstr ""
259
  "Musisz wybrać przynajmniej jedną operację. Przywrócono domyślne ustawienie "
260
  "tej opcji."
261
 
262
- #: ../wp-math-captcha.php:1085
263
  msgid ""
264
  "You need to check at least one group. Defaults settings of this option "
265
  "restored."
@@ -267,58 +275,58 @@ msgstr ""
267
  "Musisz wybrać przynajmniej jedną grupę. Przywrócono domyślne ustawienie tej "
268
  "opcji."
269
 
270
- #: ../wp-math-captcha.php:1115 ../wp-math-captcha.php:1116
271
- #: ../wp-math-captcha.php:1131 ../wp-math-captcha.php:1144
272
  #: ../includes/math-captcha-cf7.php:148
273
  msgid "Math Captcha"
274
  msgstr "Math Captcha"
275
 
276
- #: ../wp-math-captcha.php:1146
277
  msgid "Need support?"
278
  msgstr "Potrzebujesz pomocy?"
279
 
280
- #: ../wp-math-captcha.php:1147
281
  msgid ""
282
  "If you are having problems with this plugin, please talk about them in the"
283
  msgstr "Jeśli masz jakiekolwiek problemy z tą wtyczką, powiedz o tym na"
284
 
285
- #: ../wp-math-captcha.php:1147
286
  msgid "Support forum"
287
  msgstr "Forum pomocy"
288
 
289
- #: ../wp-math-captcha.php:1149
290
  msgid "Do you like this plugin?"
291
  msgstr "Lubisz tę wtyczkę?"
292
 
293
- #: ../wp-math-captcha.php:1150
294
  msgid "Rate it 5"
295
  msgstr "Oceń ją na 5"
296
 
297
- #: ../wp-math-captcha.php:1150
298
  msgid "on WordPress.org"
299
  msgstr "na WordPress.org"
300
 
301
- #: ../wp-math-captcha.php:1151
302
  msgid "Blog about it & link to the"
303
  msgstr "Napisz o niej i dodaj link do"
304
 
305
- #: ../wp-math-captcha.php:1151
306
  msgid "plugin page"
307
  msgstr "strony wtyczki"
308
 
309
- #: ../wp-math-captcha.php:1152
310
  msgid "Check out our other"
311
  msgstr "Sprawdź nasze inne"
312
 
313
- #: ../wp-math-captcha.php:1152
314
  msgid "WordPress plugins"
315
  msgstr "wtyczki do WordPressa"
316
 
317
- #: ../wp-math-captcha.php:1205
318
  msgid "Support"
319
  msgstr "Forum pomocy"
320
 
321
- #: ../wp-math-captcha.php:1227
322
  msgid "Settings"
323
  msgstr "Ustawienia"
324
 
@@ -650,12 +658,6 @@ msgstr "Skopij i wkej ten kod do formularza po lewej."
650
  #~ msgid "Display widget options in groups"
651
  #~ msgstr "Wyświetl opcje widgetów w grupach"
652
 
653
- #~ msgid "Plugin Deactivation"
654
- #~ msgstr "Deaktywacja wtyczki"
655
-
656
- #~ msgid "Remove all plugin data on deactivation"
657
- #~ msgstr "Usuń wszystkie dane wtyczki podczas deaktywacji"
658
-
659
  #~ msgid "Single %s"
660
  #~ msgstr "Pojedyncze %s"
661
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Math Captcha\n"
4
+ "POT-Creation-Date: 2013-07-25 10:22+0100\n"
5
+ "PO-Revision-Date: 2013-07-25 10:22+0100\n"
6
  "Last-Translator: Bartosz Arendt <info@digitalfactory.pl>\n"
7
  "Language-Team: dFactory <info@dfactory.eu>\n"
8
  "Language: English\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.5.7\n"
13
  "X-Poedit-KeywordsList: gettext;gettext_noop;__;_e\n"
14
  "X-Poedit-Basepath: .\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-SearchPath-0: ..\n"
17
 
18
+ #: ../wp-math-captcha.php:496
19
  msgid "one"
20
  msgstr "jeden"
21
 
22
+ #: ../wp-math-captcha.php:497
23
  msgid "two"
24
  msgstr "dwa"
25
 
26
+ #: ../wp-math-captcha.php:498
27
  msgid "three"
28
  msgstr "trzy"
29
 
30
+ #: ../wp-math-captcha.php:499
31
  msgid "four"
32
  msgstr "cztery"
33
 
34
+ #: ../wp-math-captcha.php:500
35
  msgid "five"
36
  msgstr "pięć"
37
 
38
+ #: ../wp-math-captcha.php:501
39
  msgid "six"
40
  msgstr "sześć"
41
 
42
+ #: ../wp-math-captcha.php:502
43
  msgid "seven"
44
  msgstr "siedem"
45
 
46
+ #: ../wp-math-captcha.php:503
47
  msgid "eight"
48
  msgstr "osiem"
49
 
50
+ #: ../wp-math-captcha.php:504
51
  msgid "nine"
52
  msgstr "dziewięć"
53
 
54
+ #: ../wp-math-captcha.php:505
55
  msgid "ten"
56
  msgstr "dziesięć"
57
 
58
+ #: ../wp-math-captcha.php:506
59
  msgid "eleven"
60
  msgstr "jedenaście"
61
 
62
+ #: ../wp-math-captcha.php:507
63
  msgid "twelve"
64
  msgstr "dwanaście"
65
 
66
+ #: ../wp-math-captcha.php:508
67
  msgid "thirteen"
68
  msgstr "trzynaście"
69
 
70
+ #: ../wp-math-captcha.php:509
71
  msgid "fourteen"
72
  msgstr "czternaście"
73
 
74
+ #: ../wp-math-captcha.php:510
75
  msgid "fifteen"
76
  msgstr "piętnaście"
77
 
78
+ #: ../wp-math-captcha.php:511
79
  msgid "sixteen"
80
  msgstr "szesnaście"
81
 
82
+ #: ../wp-math-captcha.php:512
83
  msgid "seventeen"
84
  msgstr "siedemnaście"
85
 
86
+ #: ../wp-math-captcha.php:513
87
  msgid "eighteen"
88
  msgstr "osiemnaście"
89
 
90
+ #: ../wp-math-captcha.php:514
91
  msgid "nineteen"
92
  msgstr "dziewiętnaście"
93
 
94
+ #: ../wp-math-captcha.php:515
95
  msgid "twenty"
96
  msgstr "dwadzieścia"
97
 
98
+ #: ../wp-math-captcha.php:516
99
  msgid "thirty"
100
  msgstr "trzydzieści"
101
 
102
+ #: ../wp-math-captcha.php:517
103
  msgid "forty"
104
  msgstr "czterdzieści"
105
 
106
+ #: ../wp-math-captcha.php:518
107
  msgid "fifty"
108
  msgstr "pięćdziesiąt"
109
 
110
+ #: ../wp-math-captcha.php:519
111
  msgid "sixty"
112
  msgstr "sześćdziesiąt"
113
 
114
+ #: ../wp-math-captcha.php:520
115
  msgid "seventy"
116
  msgstr "siedemdziesiąt"
117
 
118
+ #: ../wp-math-captcha.php:521
119
  msgid "eighty"
120
  msgstr "osiemdziesiąt"
121
 
122
+ #: ../wp-math-captcha.php:522
123
  msgid "ninety"
124
  msgstr "dziewięćdziesiąt"
125
 
126
+ #: ../wp-math-captcha.php:812 ../wp-math-captcha.php:813
127
+ #: ../wp-math-captcha.php:814
128
  msgid "ERROR"
129
  msgstr "BŁĄD"
130
 
131
+ #: ../wp-math-captcha.php:812 ../includes/math-captcha-cf7.php:113
132
  msgid "Please enter captcha value."
133
  msgstr "Proszę wpisać wartość."
134
 
135
+ #: ../wp-math-captcha.php:813 ../includes/math-captcha-cf7.php:109
136
  msgid "Invalid captcha value."
137
  msgstr "Nieprawidłowa wartość."
138
 
139
+ #: ../wp-math-captcha.php:814 ../includes/math-captcha-cf7.php:117
140
  msgid "Captcha time expired."
141
  msgstr "Upłynął czas."
142
 
143
+ #: ../wp-math-captcha.php:818
144
  msgid "login form"
145
  msgstr "formularz logowania"
146
 
147
+ #: ../wp-math-captcha.php:819
148
  msgid "registration form"
149
  msgstr "formularz rejestracji"
150
 
151
+ #: ../wp-math-captcha.php:820
152
  msgid "reset password form"
153
  msgstr "resetowanie hasła"
154
 
155
+ #: ../wp-math-captcha.php:821
156
  msgid "comment form"
157
  msgstr "komentarze"
158
 
159
+ #: ../wp-math-captcha.php:822
160
  msgid "bbpress"
161
  msgstr "bbpress"
162
 
163
+ #: ../wp-math-captcha.php:823
164
  msgid "contact form 7"
165
  msgstr "contact form 7"
166
 
167
+ #: ../wp-math-captcha.php:827
168
  msgid "yes"
169
  msgstr "tak"
170
 
171
+ #: ../wp-math-captcha.php:828
172
  msgid "no"
173
  msgstr "nie"
174
 
175
+ #: ../wp-math-captcha.php:832
176
  msgid "addition (+)"
177
  msgstr "dodawanie (+)"
178
 
179
+ #: ../wp-math-captcha.php:833
180
  msgid "subtraction (-)"
181
  msgstr "odejmowanie (-)"
182
 
183
+ #: ../wp-math-captcha.php:834
184
  msgid "multiplication (&#215;)"
185
  msgstr "mnożenie (&#215;)"
186
 
187
+ #: ../wp-math-captcha.php:835
188
  msgid "division (&#247;)"
189
  msgstr "dzielenie (&#247;)"
190
 
191
+ #: ../wp-math-captcha.php:839
192
  msgid "numbers"
193
  msgstr "liczby"
194
 
195
+ #: ../wp-math-captcha.php:840
196
  msgid "words"
197
  msgstr "słowa"
198
 
199
+ #: ../wp-math-captcha.php:852
200
  msgid "Math Captcha settings"
201
  msgstr "Ustawienia Math Captcha"
202
 
203
+ #: ../wp-math-captcha.php:853
204
  msgid "Enable Math Captcha for"
205
  msgstr "Włącz captcha dla"
206
 
207
+ #: ../wp-math-captcha.php:854
208
  msgid "Hide for logged in users"
209
  msgstr "Ukryj dla zalogowanych"
210
 
211
+ #: ../wp-math-captcha.php:855
212
  msgid "Mathematical operations"
213
  msgstr "Operacje matematyczne"
214
 
215
+ #: ../wp-math-captcha.php:856
216
  msgid "Display captcha as"
217
  msgstr "Wyśiwtlaj captcha jako"
218
 
219
+ #: ../wp-math-captcha.php:857
220
  msgid "Captcha field title"
221
  msgstr "Tytuł pola captcha"
222
 
223
+ #: ../wp-math-captcha.php:858
224
  msgid "Captcha time"
225
  msgstr "Czas captcha"
226
 
227
+ #: ../wp-math-captcha.php:859
228
+ msgid "Deactivation"
229
+ msgstr "Deaktywacja wtyczki"
230
+
231
+ #: ../wp-math-captcha.php:879
232
  msgid "Select were would you like to use Math Captcha."
233
  msgstr "Wybierz w których miejscach chcesz używać Math Captcha"
234
 
235
+ #: ../wp-math-captcha.php:900
236
  msgid "Would you like to hide captcha for logged in users?"
237
  msgstr "Czy chcesz ukryć captcha dla zalogowanych użytkowników?"
238
 
239
+ #: ../wp-math-captcha.php:913
240
  msgid ""
241
  "Select what kind of mathematical operations will be used to generate captcha."
242
  msgstr ""
243
  "Wybierz jakie rodzaje operacji matematycznych będą stosowane w captcha."
244
 
245
+ #: ../wp-math-captcha.php:926
246
  msgid "Enter the time (in seconds) a user has to enter captcha value."
247
  msgstr "Podaj czas (w sekundach) w jakim należy uzupełnić pole captcha."
248
 
249
+ #: ../wp-math-captcha.php:947
250
+ msgid "Delete settings on plugin deactivation"
251
+ msgstr "Usuń wszystkie dane wtyczki podczas deaktywacji"
252
+
253
+ #: ../wp-math-captcha.php:968
254
  msgid "Select which mathematical operations to use in your captcha."
255
  msgstr ""
256
  "Wybierz jakie rodzaje operacji matematycznych będą stosowane w captcha."
257
 
258
+ #: ../wp-math-captcha.php:989
259
  msgid "Select how you'd like to display you captcha."
260
  msgstr "Wybierz w jaki sposób chcesz wyświetlać captcha."
261
 
262
+ #: ../wp-math-captcha.php:1030
263
  msgid ""
264
  "You need to check at least one mathematical operation. Defaults settings of "
265
  "this option restored."
267
  "Musisz wybrać przynajmniej jedną operację. Przywrócono domyślne ustawienie "
268
  "tej opcji."
269
 
270
+ #: ../wp-math-captcha.php:1046
271
  msgid ""
272
  "You need to check at least one group. Defaults settings of this option "
273
  "restored."
275
  "Musisz wybrać przynajmniej jedną grupę. Przywrócono domyślne ustawienie tej "
276
  "opcji."
277
 
278
+ #: ../wp-math-captcha.php:1080 ../wp-math-captcha.php:1081
279
+ #: ../wp-math-captcha.php:1096 ../wp-math-captcha.php:1109
280
  #: ../includes/math-captcha-cf7.php:148
281
  msgid "Math Captcha"
282
  msgstr "Math Captcha"
283
 
284
+ #: ../wp-math-captcha.php:1111
285
  msgid "Need support?"
286
  msgstr "Potrzebujesz pomocy?"
287
 
288
+ #: ../wp-math-captcha.php:1112
289
  msgid ""
290
  "If you are having problems with this plugin, please talk about them in the"
291
  msgstr "Jeśli masz jakiekolwiek problemy z tą wtyczką, powiedz o tym na"
292
 
293
+ #: ../wp-math-captcha.php:1112
294
  msgid "Support forum"
295
  msgstr "Forum pomocy"
296
 
297
+ #: ../wp-math-captcha.php:1114
298
  msgid "Do you like this plugin?"
299
  msgstr "Lubisz tę wtyczkę?"
300
 
301
+ #: ../wp-math-captcha.php:1115
302
  msgid "Rate it 5"
303
  msgstr "Oceń ją na 5"
304
 
305
+ #: ../wp-math-captcha.php:1115
306
  msgid "on WordPress.org"
307
  msgstr "na WordPress.org"
308
 
309
+ #: ../wp-math-captcha.php:1116
310
  msgid "Blog about it & link to the"
311
  msgstr "Napisz o niej i dodaj link do"
312
 
313
+ #: ../wp-math-captcha.php:1116
314
  msgid "plugin page"
315
  msgstr "strony wtyczki"
316
 
317
+ #: ../wp-math-captcha.php:1117
318
  msgid "Check out our other"
319
  msgstr "Sprawdź nasze inne"
320
 
321
+ #: ../wp-math-captcha.php:1117
322
  msgid "WordPress plugins"
323
  msgstr "wtyczki do WordPressa"
324
 
325
+ #: ../wp-math-captcha.php:1170
326
  msgid "Support"
327
  msgstr "Forum pomocy"
328
 
329
+ #: ../wp-math-captcha.php:1192
330
  msgid "Settings"
331
  msgstr "Ustawienia"
332
 
658
  #~ msgid "Display widget options in groups"
659
  #~ msgstr "Wyświetl opcje widgetów w grupach"
660
 
 
 
 
 
 
 
661
  #~ msgid "Single %s"
662
  #~ msgstr "Pojedyncze %s"
663
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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
 
@@ -26,12 +26,17 @@ For more information, check out the [plugin page](http://www.dfactory.eu/plugins
26
  * Option to set captcha input time
27
  * .pot file for translations included
28
 
 
 
 
 
 
29
 
30
  == Installation ==
31
 
32
- 1. Install Math Captcha either via the WordPress.org plugin directory, or by uploading the files to your server</li>
33
- 1. Activate the plugin through the 'Plugins' menu in WordPress</li>
34
- 1. Go to the Math Captcha menu and set your captcha display settings.</li>
35
 
36
  == Frequently Asked Questions ==
37
 
@@ -43,16 +48,20 @@ No questions yet.
43
 
44
  == Changelog ==
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
-
52
  = 1.0.0 =
53
  * Initial release
54
 
55
  == Upgrade Notice ==
56
 
57
- = 1.0.1.1 =
58
- Fix: Captcha time expired error on bbPress
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.2
7
+ Stable tag: 1.0.2
8
  License: MIT License
9
  License URI: http://opensource.org/licenses/MIT
10
 
26
  * Option to set captcha input time
27
  * .pot file for translations included
28
 
29
+ = Translations: =
30
+
31
+ * Polish - by Bartosz Arendt
32
+ * Persian - by [Ali Mirzaei](http://alimir.ir/)
33
+
34
 
35
  == Installation ==
36
 
37
+ 1. Install Math Captcha either via the WordPress.org plugin directory, or by uploading the files to your server
38
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
39
+ 3. Go to the Math Captcha menu and set your captcha display settings.
40
 
41
  == Frequently Asked Questions ==
42
 
48
 
49
  == Changelog ==
50
 
51
+ = 1.0.2 =
52
+ * New: Option to delete plugin settings on deactivation
53
+ * New: Persian translation by Ali Mirzaei
54
+ * Fix: Captcha time expired error - thanks to Aaron and Simo
55
+
56
  = 1.0.1 =
57
  * Fix: Math Captcha not available in Contact Form 7 if hide for logged in users selected
58
  * Fix: Captcha time expired error on bbPress
59
  * Tweak: Empty captcha title
60
 
 
61
  = 1.0.0 =
62
  * Initial release
63
 
64
  == Upgrade Notice ==
65
 
66
+ = 1.0.2 =
67
+ Fix: Final fix for Captcha time expired error
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.1
6
  Author: dFactory
7
  Author URI: http://www.dfactory.eu/
8
  Plugin URI: http://www.dfactory.eu/plugins/math-captcha/
@@ -43,10 +43,11 @@ class Math_Captcha
43
  'numbers' => TRUE,
44
  'words' => FALSE
45
  ),
46
- 'time' => 300
 
47
  );
48
  public static $options = array();
49
- private $choice = array();
50
  private $enable_for = array();
51
  private $mathematical_operations = array();
52
  private $groups = array();
@@ -62,7 +63,7 @@ class Math_Captcha
62
  register_activation_hook(__FILE__, array(&$this, 'activation'));
63
  register_deactivation_hook(__FILE__, array(&$this, 'deactivation'));
64
 
65
- $this->options = get_option('mc_options');
66
 
67
  //actions
68
  add_action('plugins_loaded', array(&$this, 'init_mc_session'), 1);
@@ -91,9 +92,7 @@ class Math_Captcha
91
  if($this->options['enable_for']['comment_form'] === TRUE)
92
  {
93
  if(!is_user_logged_in())
94
- {
95
  add_action('comment_form_after_fields', array(&$this, 'add_captcha_form'));
96
- }
97
  else
98
  {
99
  if($this->options['hide_for_logged_users'] === FALSE)
@@ -171,8 +170,10 @@ class Math_Captcha
171
  case 'session_id':
172
  case 'crypt_key':
173
  return $this->{$attr};
 
174
  case 'title':
175
  return $this->options['title'];
 
176
  default:
177
  return '';
178
  }
@@ -194,56 +195,38 @@ class Math_Captcha
194
  if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
195
  {
196
  if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
197
- {
198
  $this->errors->add('math-captcha-error', $this->err_msg['wrong']);
199
- }
200
  }
201
  else
202
- {
203
  $this->errors->add('math-captcha-error', $this->err_msg['time']);
204
- }
205
  }
206
  else
207
- {
208
  $this->errors->add('math-captcha-error', $this->err_msg['fill']);
209
- }
210
 
211
  //checks user_login (from wp-login.php)
212
  if(empty($_POST['user_login']))
213
- {
214
  $user_error = TRUE;
215
- }
216
  elseif(strpos($_POST['user_login'], '@'))
217
  {
218
  $user_data = get_user_by('email', trim($_POST['user_login']));
219
 
220
  if(empty($user_data))
221
- {
222
  $user_error = TRUE;
223
- }
224
  }
225
  else
226
- {
227
  $user_data = get_user_by('login', trim($_POST['user_login']));
228
- }
229
 
230
  if(!$user_data)
231
- {
232
  $user_error = TRUE;
233
- }
234
 
235
  //something went wrong?
236
  if(!empty($this->errors->errors))
237
  {
238
  //nasty hack (captcha is wrong but user_login is ok)
239
  if($user_error === FALSE)
240
- {
241
  add_filter('allow_password_reset', array(&$this, 'add_lostpassword_wp_message'));
242
- }
243
  else
244
- {
245
  add_filter('login_errors', array(&$this, 'add_lostpassword_captcha_message'));
246
- }
247
  }
248
  }
249
 
@@ -276,19 +259,13 @@ class Math_Captcha
276
  if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
277
  {
278
  if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
279
- {
280
  $errors->add('math-captcha-error', $this->err_msg['wrong']);
281
- }
282
  }
283
  else
284
- {
285
  $errors->add('math-captcha-error', $this->err_msg['time']);
286
- }
287
  }
288
  else
289
- {
290
  $errors->add('math-captcha-error', $this->err_msg['fill']);
291
- }
292
 
293
  return $errors;
294
  }
@@ -333,9 +310,7 @@ class Math_Captcha
333
  }
334
 
335
  if($error === FALSE || isset($_GET['captcha']))
336
- {
337
  return $redirect;
338
- }
339
  else
340
  {
341
  wp_clear_auth_cookie();
@@ -365,19 +340,13 @@ class Math_Captcha
365
  if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
366
  {
367
  if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
368
- {
369
  $results['errors']->add('math-captcha-error', $this->err_msg['wrong']);
370
- }
371
  }
372
  else
373
- {
374
  $results['errors']->add('math-captcha-error', $this->err_msg['time']);
375
- }
376
  }
377
  else
378
- {
379
  $results['errors']->add('math-captcha-error', $this->err_msg['fill']);
380
- }
381
 
382
  return $results;
383
  }
@@ -395,28 +364,18 @@ class Math_Captcha
395
  if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
396
  {
397
  if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) === 0)
398
- {
399
  return $comment;
400
- }
401
  else
402
- {
403
  wp_die($this->err_msg['wrong']);
404
- }
405
  }
406
  else
407
- {
408
  wp_die($this->err_msg['time']);
409
- }
410
  }
411
  else
412
- {
413
  wp_die($this->err_msg['fill']);
414
- }
415
  }
416
  else
417
- {
418
  return $comment;
419
- }
420
  }
421
 
422
 
@@ -426,18 +385,11 @@ class Math_Captcha
426
  public function init_mc_session()
427
  {
428
  if(isset($_COOKIE['mc_session_id']))
429
- {
430
  $this->session_id = $_COOKIE['mc_session_id'];
431
- }
432
  else
433
- {
434
- include_once(ABSPATH.'wp-includes/class-phpass.php');
435
-
436
- $hasher = new PasswordHash(8, FALSE);
437
- $this->session_id = sha1($hasher->get_random_bytes(64));
438
- }
439
 
440
- setcookie('mc_session_id', $this->session_id, current_time('timestamp') + apply_filters('math_captcha_time', $this->options['time']), COOKIEPATH, COOKIE_DOMAIN);
441
  }
442
 
443
 
@@ -448,15 +400,18 @@ class Math_Captcha
448
  {
449
  if(is_admin())
450
  return;
451
-
452
  $captcha_title = apply_filters('math_captcha_title', $this->options['title']);
453
-
454
- echo '<p class="math-captcha-form">';
455
- if (!empty($captcha_title))
456
- {
457
- echo '<label>'.$captcha_title.'<br /></label>';
458
- }
459
- echo '<span>'.$this->generate_captcha_phrase('default').'</span>
 
 
 
460
  </p>';
461
  }
462
 
@@ -471,14 +426,15 @@ class Math_Captcha
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
 
@@ -493,19 +449,13 @@ class Math_Captcha
493
  if($this->session_id !== '' && get_transient('bbp_'.$this->session_id) !== FALSE)
494
  {
495
  if(strcmp(get_transient('bbp_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
496
- {
497
  bbp_add_error('math-captcha-wrong', $this->err_msg['wrong']);
498
- }
499
  }
500
  else
501
- {
502
  bbp_add_error('math-captcha-wrong', $this->err_msg['time']);
503
- }
504
  }
505
  else
506
- {
507
  bbp_add_error('math-captcha-wrong', $this->err_msg['fill']);
508
- }
509
  }
510
 
511
 
@@ -573,9 +523,7 @@ class Math_Captcha
573
  );
574
 
575
  if(isset($words[$number]))
576
- {
577
  return $words[$number];
578
- }
579
  else
580
  {
581
  $reverse = FALSE;
@@ -585,14 +533,17 @@ class Math_Captcha
585
  case 'de-DE':
586
  $spacer = 'und';
587
  $reverse = TRUE;
588
- break;
 
589
  case 'nl-NL':
590
  $spacer = 'en';
591
  $reverse = TRUE;
592
- break;
 
593
  case 'pl-PL':
594
  $spacer = ' ';
595
- break;
 
596
  case 'en-EN':
597
  default:
598
  $spacer = '-';
@@ -625,18 +576,14 @@ class Math_Captcha
625
  foreach($this->options['mathematical_operations'] as $operation => $enable)
626
  {
627
  if($enable === TRUE)
628
- {
629
  $operations[] = $operation;
630
- }
631
  }
632
 
633
  //available groups
634
  foreach($this->options['groups'] as $group => $enable)
635
  {
636
  if($enable === TRUE)
637
- {
638
  $groups[] = $group;
639
- }
640
  }
641
 
642
  //number of groups
@@ -669,7 +616,8 @@ class Math_Captcha
669
  }
670
 
671
  $number[2] = $number[0] + $number[1];
672
- break;
 
673
  case 'subtraction':
674
  if($rnd_input === 0)
675
  {
@@ -688,7 +636,8 @@ class Math_Captcha
688
  }
689
 
690
  $number[2] = $number[0] - $number[1];
691
- break;
 
692
  case 'multiplication':
693
  if($rnd_input === 0)
694
  {
@@ -707,7 +656,8 @@ class Math_Captcha
707
  }
708
 
709
  $number[2] = $number[0] * $number[1];
710
- break;
 
711
  case 'division':
712
  if($rnd_input === 0)
713
  {
@@ -733,7 +683,7 @@ class Math_Captcha
733
  {
734
  $number[2] = (int)($number[0] / $number[1]);
735
  }
736
- break;
737
  }
738
 
739
  //words
@@ -766,9 +716,7 @@ class Math_Captcha
766
  $number[2] = $this->numberToWords($number[2]);
767
  }
768
  else
769
- {
770
  $number[$tmp = mt_rand(1, 2)] = $this->numberToWords($number[$tmp]);
771
- }
772
  }
773
  elseif($rnd_input === 1)
774
  {
@@ -778,9 +726,7 @@ class Math_Captcha
778
  $number[2] = $this->numberToWords($number[2]);
779
  }
780
  else
781
- {
782
  $number[$tmp = array_rand(array(0 => 0, 2 => 2), 1)] = $this->numberToWords($number[$tmp]);
783
- }
784
  }
785
  elseif($rnd_input === 2)
786
  {
@@ -790,9 +736,7 @@ class Math_Captcha
790
  $number[1] = $this->numberToWords($number[1]);
791
  }
792
  else
793
- {
794
  $number[$tmp = mt_rand(0, 1)] = $this->numberToWords($number[$tmp]);
795
- }
796
  }
797
  }
798
 
@@ -800,17 +744,11 @@ class Math_Captcha
800
  {
801
  //position of empty input
802
  if($rnd_input === 0)
803
- {
804
  $return = $input.' '.$number[3].' '.$this->encode_operation($number[1]).' = '.$this->encode_operation($number[2]);
805
- }
806
  elseif($rnd_input === 1)
807
- {
808
  $return = $this->encode_operation($number[0]).' '.$number[3].' '.$input.' = '.$this->encode_operation($number[2]);
809
- }
810
  elseif($rnd_input === 2)
811
- {
812
  $return = $this->encode_operation($number[0]).' '.$number[3].' '.$this->encode_operation($number[1]).' = '.$input;
813
- }
814
 
815
  $transient_name = ($form === 'bbpress' ? 'bbp' : 'mc');
816
  }
@@ -860,7 +798,8 @@ class Math_Captcha
860
  */
861
  public function deactivation()
862
  {
863
- delete_option('mc_options');
 
864
  }
865
 
866
 
@@ -884,7 +823,7 @@ class Math_Captcha
884
  'contact_form_7' => __('contact form 7', 'math-captcha')
885
  );
886
 
887
- $this->choice = array(
888
  'yes' => __('yes', 'math-captcha'),
889
  'no' => __('no', 'math-captcha')
890
  );
@@ -917,6 +856,7 @@ class Math_Captcha
917
  add_settings_field('mc_groups', __('Display captcha as', 'math-captcha'), array(&$this, 'mc_groups'), 'mc_options', 'math_captcha_settings');
918
  add_settings_field('mc_title', __('Captcha field title', 'math-captcha'), array(&$this, 'mc_title'), 'mc_options', 'math_captcha_settings');
919
  add_settings_field('mc_time', __('Captcha time', 'math-captcha'), array(&$this, 'mc_time'), 'mc_options', 'math_captcha_settings');
 
920
  }
921
 
922
 
@@ -926,7 +866,7 @@ class Math_Captcha
926
  public function mc_enable_captcha_for()
927
  {
928
  echo '
929
- <div id="mc_enable_for">';
930
 
931
  foreach($this->enable_for as $val => $trans)
932
  {
@@ -947,9 +887,9 @@ class Math_Captcha
947
  public function mc_hide_for_logged_users()
948
  {
949
  echo '
950
- <div id="mc_hide_for_logged">';
951
 
952
- foreach($this->choice as $val => $trans)
953
  {
954
  echo '
955
  <input id="mc-hide-for-logged-'.$val.'" type="radio" name="mc_options[hide_for_logged_users]" value="'.$val.'" '.checked(($val === 'yes' ? TRUE : FALSE), $this->options['hide_for_logged_users'], FALSE).' />
@@ -968,7 +908,7 @@ class Math_Captcha
968
  public function mc_title()
969
  {
970
  echo '
971
- <div id="mc_title">
972
  <input type="text" name="mc_options[title]" value="'.$this->options['title'].'" />
973
  <p class="description">'.__('Select what kind of mathematical operations will be used to generate captcha.', 'math-captcha').'</p>
974
  </div>';
@@ -981,20 +921,41 @@ class Math_Captcha
981
  public function mc_time()
982
  {
983
  echo '
984
- <div id="mc_time">
985
  <input type="text" name="mc_options[time]" value="'.$this->options['time'].'" />
986
  <p class="description">'.__('Enter the time (in seconds) a user has to enter captcha value.', 'math-captcha').'</p>
987
  </div>';
988
  }
989
 
990
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
991
  /**
992
  * Setting field - methematical operations
993
  */
994
  public function mc_mathematical_operations()
995
  {
996
  echo '
997
- <div id="mc_mathematical_operations">';
998
 
999
  foreach($this->mathematical_operations as $val => $trans)
1000
  {
@@ -1015,7 +976,7 @@ class Math_Captcha
1015
  public function mc_groups()
1016
  {
1017
  echo '
1018
- <div id="mc_groups">';
1019
 
1020
  foreach($this->groups as $val => $trans)
1021
  {
@@ -1059,14 +1020,10 @@ class Math_Captcha
1059
  }
1060
 
1061
  if(!is_plugin_active('contact-form-7/wp-contact-form-7.php') && $this->options['enable_for']['contact_form_7'] === TRUE)
1062
- {
1063
  $input['enable_for']['contact_form_7'] = TRUE;
1064
- }
1065
 
1066
  if(!is_plugin_active('bbpress/bbpress.php') && $this->options['enable_for']['bbpress'] === TRUE)
1067
- {
1068
  $input['enable_for']['bbpress'] = TRUE;
1069
- }
1070
 
1071
  if(empty($input['mathematical_operations']))
1072
  {
@@ -1100,8 +1057,12 @@ class Math_Captcha
1100
  $input['groups'] = $groups;
1101
  }
1102
 
1103
- $input['hide_for_logged_users'] = (isset($input['hide_for_logged_users']) && in_array($input['hide_for_logged_users'], array_keys($this->choice)) ? ($input['hide_for_logged_users'] === 'yes' ? TRUE : FALSE) : $this->defaults['hide_for_logged_users']);
 
 
 
1104
  $input['title'] = trim(sanitize_text_field($input['title']));
 
1105
  $time = (int)$input['time'];
1106
  $input['time'] = ($time < 0 ? $this->defaults['time'] : $time);
1107
  }
@@ -1173,11 +1134,11 @@ class Math_Captcha
1173
  {
1174
  wp_enqueue_script(
1175
  'math-captcha',
1176
- plugins_url('/js/math-captcha-admin.js', __FILE__),
1177
  array('jquery', 'jquery-ui-core', 'jquery-ui-button')
1178
  );
1179
 
1180
- wp_enqueue_style('math-captcha-admin', plugins_url('/css/math-captcha-admin.css', __FILE__));
1181
  wp_enqueue_style('math-captcha-front', plugins_url('/css/wp-like-ui-theme.css', __FILE__));
1182
  }
1183
  }
@@ -1202,7 +1163,7 @@ class Math_Captcha
1202
 
1203
  $plugin = plugin_basename(__FILE__);
1204
 
1205
- if ($file == $plugin)
1206
  {
1207
  return array_merge(
1208
  $links,
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.2
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
+ 'deactivation_delete' => FALSE
48
  );
49
  public static $options = array();
50
+ private $choices = array();
51
  private $enable_for = array();
52
  private $mathematical_operations = array();
53
  private $groups = array();
63
  register_activation_hook(__FILE__, array(&$this, 'activation'));
64
  register_deactivation_hook(__FILE__, array(&$this, 'deactivation'));
65
 
66
+ $this->options = array_merge($this->defaults, get_option('mc_options'));
67
 
68
  //actions
69
  add_action('plugins_loaded', array(&$this, 'init_mc_session'), 1);
92
  if($this->options['enable_for']['comment_form'] === TRUE)
93
  {
94
  if(!is_user_logged_in())
 
95
  add_action('comment_form_after_fields', array(&$this, 'add_captcha_form'));
 
96
  else
97
  {
98
  if($this->options['hide_for_logged_users'] === FALSE)
170
  case 'session_id':
171
  case 'crypt_key':
172
  return $this->{$attr};
173
+
174
  case 'title':
175
  return $this->options['title'];
176
+
177
  default:
178
  return '';
179
  }
195
  if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
196
  {
197
  if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
 
198
  $this->errors->add('math-captcha-error', $this->err_msg['wrong']);
 
199
  }
200
  else
 
201
  $this->errors->add('math-captcha-error', $this->err_msg['time']);
 
202
  }
203
  else
 
204
  $this->errors->add('math-captcha-error', $this->err_msg['fill']);
 
205
 
206
  //checks user_login (from wp-login.php)
207
  if(empty($_POST['user_login']))
 
208
  $user_error = TRUE;
 
209
  elseif(strpos($_POST['user_login'], '@'))
210
  {
211
  $user_data = get_user_by('email', trim($_POST['user_login']));
212
 
213
  if(empty($user_data))
 
214
  $user_error = TRUE;
 
215
  }
216
  else
 
217
  $user_data = get_user_by('login', trim($_POST['user_login']));
 
218
 
219
  if(!$user_data)
 
220
  $user_error = TRUE;
 
221
 
222
  //something went wrong?
223
  if(!empty($this->errors->errors))
224
  {
225
  //nasty hack (captcha is wrong but user_login is ok)
226
  if($user_error === FALSE)
 
227
  add_filter('allow_password_reset', array(&$this, 'add_lostpassword_wp_message'));
 
228
  else
 
229
  add_filter('login_errors', array(&$this, 'add_lostpassword_captcha_message'));
 
230
  }
231
  }
232
 
259
  if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
260
  {
261
  if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
 
262
  $errors->add('math-captcha-error', $this->err_msg['wrong']);
 
263
  }
264
  else
 
265
  $errors->add('math-captcha-error', $this->err_msg['time']);
 
266
  }
267
  else
 
268
  $errors->add('math-captcha-error', $this->err_msg['fill']);
 
269
 
270
  return $errors;
271
  }
310
  }
311
 
312
  if($error === FALSE || isset($_GET['captcha']))
 
313
  return $redirect;
 
314
  else
315
  {
316
  wp_clear_auth_cookie();
340
  if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
341
  {
342
  if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
 
343
  $results['errors']->add('math-captcha-error', $this->err_msg['wrong']);
 
344
  }
345
  else
 
346
  $results['errors']->add('math-captcha-error', $this->err_msg['time']);
 
347
  }
348
  else
 
349
  $results['errors']->add('math-captcha-error', $this->err_msg['fill']);
 
350
 
351
  return $results;
352
  }
364
  if($this->session_id !== '' && get_transient('mc_'.$this->session_id) !== FALSE)
365
  {
366
  if(strcmp(get_transient('mc_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) === 0)
 
367
  return $comment;
 
368
  else
 
369
  wp_die($this->err_msg['wrong']);
 
370
  }
371
  else
 
372
  wp_die($this->err_msg['time']);
 
373
  }
374
  else
 
375
  wp_die($this->err_msg['fill']);
 
376
  }
377
  else
 
378
  return $comment;
 
379
  }
380
 
381
 
385
  public function init_mc_session()
386
  {
387
  if(isset($_COOKIE['mc_session_id']))
 
388
  $this->session_id = $_COOKIE['mc_session_id'];
 
389
  else
390
+ $this->session_id = sha1(wp_generate_password(64, TRUE, TRUE));
 
 
 
 
 
391
 
392
+ setcookie('mc_session_id', $this->session_id, current_time('timestamp', TRUE) + apply_filters('math_captcha_time', $this->options['time']), COOKIEPATH, COOKIE_DOMAIN);
393
  }
394
 
395
 
400
  {
401
  if(is_admin())
402
  return;
403
+
404
  $captcha_title = apply_filters('math_captcha_title', $this->options['title']);
405
+
406
+ echo '
407
+ <p class="math-captcha-form">';
408
+
409
+ if(!empty($captcha_title))
410
+ echo '
411
+ <label>'.$captcha_title.'<br /></label>';
412
+
413
+ echo '
414
+ <span>'.$this->generate_captcha_phrase('default').'</span>
415
  </p>';
416
  }
417
 
426
 
427
  $captcha_title = apply_filters('math_captcha_title', $this->options['title']);
428
 
429
+ echo '
430
+ <p class="math-captcha-form">';
431
 
432
  if(!empty($captcha_title))
433
+ echo '
434
+ <label>'.$captcha_title.'<br /></label>';
 
435
 
436
+ echo '
437
+ <span>'.$this->generate_captcha_phrase('bbpress').'</span>
438
  </p>';
439
  }
440
 
449
  if($this->session_id !== '' && get_transient('bbp_'.$this->session_id) !== FALSE)
450
  {
451
  if(strcmp(get_transient('bbp_'.$this->session_id), sha1($this->crypt_key.$_POST['mc-value'].$this->session_id, FALSE)) !== 0)
 
452
  bbp_add_error('math-captcha-wrong', $this->err_msg['wrong']);
 
453
  }
454
  else
 
455
  bbp_add_error('math-captcha-wrong', $this->err_msg['time']);
 
456
  }
457
  else
 
458
  bbp_add_error('math-captcha-wrong', $this->err_msg['fill']);
 
459
  }
460
 
461
 
523
  );
524
 
525
  if(isset($words[$number]))
 
526
  return $words[$number];
 
527
  else
528
  {
529
  $reverse = FALSE;
533
  case 'de-DE':
534
  $spacer = 'und';
535
  $reverse = TRUE;
536
+ break;
537
+
538
  case 'nl-NL':
539
  $spacer = 'en';
540
  $reverse = TRUE;
541
+ break;
542
+
543
  case 'pl-PL':
544
  $spacer = ' ';
545
+ break;
546
+
547
  case 'en-EN':
548
  default:
549
  $spacer = '-';
576
  foreach($this->options['mathematical_operations'] as $operation => $enable)
577
  {
578
  if($enable === TRUE)
 
579
  $operations[] = $operation;
 
580
  }
581
 
582
  //available groups
583
  foreach($this->options['groups'] as $group => $enable)
584
  {
585
  if($enable === TRUE)
 
586
  $groups[] = $group;
 
587
  }
588
 
589
  //number of groups
616
  }
617
 
618
  $number[2] = $number[0] + $number[1];
619
+ break;
620
+
621
  case 'subtraction':
622
  if($rnd_input === 0)
623
  {
636
  }
637
 
638
  $number[2] = $number[0] - $number[1];
639
+ break;
640
+
641
  case 'multiplication':
642
  if($rnd_input === 0)
643
  {
656
  }
657
 
658
  $number[2] = $number[0] * $number[1];
659
+ break;
660
+
661
  case 'division':
662
  if($rnd_input === 0)
663
  {
683
  {
684
  $number[2] = (int)($number[0] / $number[1]);
685
  }
686
+ break;
687
  }
688
 
689
  //words
716
  $number[2] = $this->numberToWords($number[2]);
717
  }
718
  else
 
719
  $number[$tmp = mt_rand(1, 2)] = $this->numberToWords($number[$tmp]);
 
720
  }
721
  elseif($rnd_input === 1)
722
  {
726
  $number[2] = $this->numberToWords($number[2]);
727
  }
728
  else
 
729
  $number[$tmp = array_rand(array(0 => 0, 2 => 2), 1)] = $this->numberToWords($number[$tmp]);
 
730
  }
731
  elseif($rnd_input === 2)
732
  {
736
  $number[1] = $this->numberToWords($number[1]);
737
  }
738
  else
 
739
  $number[$tmp = mt_rand(0, 1)] = $this->numberToWords($number[$tmp]);
 
740
  }
741
  }
742
 
744
  {
745
  //position of empty input
746
  if($rnd_input === 0)
 
747
  $return = $input.' '.$number[3].' '.$this->encode_operation($number[1]).' = '.$this->encode_operation($number[2]);
 
748
  elseif($rnd_input === 1)
 
749
  $return = $this->encode_operation($number[0]).' '.$number[3].' '.$input.' = '.$this->encode_operation($number[2]);
 
750
  elseif($rnd_input === 2)
 
751
  $return = $this->encode_operation($number[0]).' '.$number[3].' '.$this->encode_operation($number[1]).' = '.$input;
 
752
 
753
  $transient_name = ($form === 'bbpress' ? 'bbp' : 'mc');
754
  }
798
  */
799
  public function deactivation()
800
  {
801
+ if($this->options['deactivation_delete'] === TRUE)
802
+ delete_option('mc_options');
803
  }
804
 
805
 
823
  'contact_form_7' => __('contact form 7', 'math-captcha')
824
  );
825
 
826
+ $this->choices = array(
827
  'yes' => __('yes', 'math-captcha'),
828
  'no' => __('no', 'math-captcha')
829
  );
856
  add_settings_field('mc_groups', __('Display captcha as', 'math-captcha'), array(&$this, 'mc_groups'), 'mc_options', 'math_captcha_settings');
857
  add_settings_field('mc_title', __('Captcha field title', 'math-captcha'), array(&$this, 'mc_title'), 'mc_options', 'math_captcha_settings');
858
  add_settings_field('mc_time', __('Captcha time', 'math-captcha'), array(&$this, 'mc_time'), 'mc_options', 'math_captcha_settings');
859
+ add_settings_field('mc_deactivation_delete', __('Deactivation', 'math-captcha'), array(&$this, 'mc_deactivation_delete'), 'mc_options', 'math_captcha_settings');
860
  }
861
 
862
 
866
  public function mc_enable_captcha_for()
867
  {
868
  echo '
869
+ <div class="wplikebtns">';
870
 
871
  foreach($this->enable_for as $val => $trans)
872
  {
887
  public function mc_hide_for_logged_users()
888
  {
889
  echo '
890
+ <div class="wplikebtns">';
891
 
892
+ foreach($this->choices as $val => $trans)
893
  {
894
  echo '
895
  <input id="mc-hide-for-logged-'.$val.'" type="radio" name="mc_options[hide_for_logged_users]" value="'.$val.'" '.checked(($val === 'yes' ? TRUE : FALSE), $this->options['hide_for_logged_users'], FALSE).' />
908
  public function mc_title()
909
  {
910
  echo '
911
+ <div>
912
  <input type="text" name="mc_options[title]" value="'.$this->options['title'].'" />
913
  <p class="description">'.__('Select what kind of mathematical operations will be used to generate captcha.', 'math-captcha').'</p>
914
  </div>';
921
  public function mc_time()
922
  {
923
  echo '
924
+ <div>
925
  <input type="text" name="mc_options[time]" value="'.$this->options['time'].'" />
926
  <p class="description">'.__('Enter the time (in seconds) a user has to enter captcha value.', 'math-captcha').'</p>
927
  </div>';
928
  }
929
 
930
 
931
+ /**
932
+ * Setting field - delete settings during deactivation
933
+ */
934
+ public function mc_deactivation_delete()
935
+ {
936
+ echo '
937
+ <div class="wplikebtns">';
938
+
939
+ foreach($this->choices as $val => $trans)
940
+ {
941
+ echo '
942
+ <input id="mc-deactivation-delete-'.$val.'" type="radio" name="mc_options[deactivation_delete]" value="'.$val.'" '.checked(($val === 'yes' ? TRUE : FALSE), $this->options['deactivation_delete'], FALSE).' />
943
+ <label for="mc-deactivation-delete-'.$val.'">'.$trans.'</label>';
944
+ }
945
+
946
+ echo '
947
+ <p class="description">'.__('Delete settings on plugin deactivation', 'math-captcha').'</p>
948
+ </div>';
949
+ }
950
+
951
+
952
  /**
953
  * Setting field - methematical operations
954
  */
955
  public function mc_mathematical_operations()
956
  {
957
  echo '
958
+ <div class="wplikebtns">';
959
 
960
  foreach($this->mathematical_operations as $val => $trans)
961
  {
976
  public function mc_groups()
977
  {
978
  echo '
979
+ <div class="wplikebtns">';
980
 
981
  foreach($this->groups as $val => $trans)
982
  {
1020
  }
1021
 
1022
  if(!is_plugin_active('contact-form-7/wp-contact-form-7.php') && $this->options['enable_for']['contact_form_7'] === TRUE)
 
1023
  $input['enable_for']['contact_form_7'] = TRUE;
 
1024
 
1025
  if(!is_plugin_active('bbpress/bbpress.php') && $this->options['enable_for']['bbpress'] === TRUE)
 
1026
  $input['enable_for']['bbpress'] = TRUE;
 
1027
 
1028
  if(empty($input['mathematical_operations']))
1029
  {
1057
  $input['groups'] = $groups;
1058
  }
1059
 
1060
+ $input['hide_for_logged_users'] = (isset($input['hide_for_logged_users']) && in_array($input['hide_for_logged_users'], array_keys($this->choices)) ? ($input['hide_for_logged_users'] === 'yes' ? TRUE : FALSE) : $this->defaults['hide_for_logged_users']);
1061
+
1062
+ $input['deactivation_delete'] = (isset($input['deactivation_delete']) && in_array($input['deactivation_delete'], array_keys($this->choices)) ? ($input['deactivation_delete'] === 'yes' ? TRUE : FALSE) : $this->options['deactivation_delete']);
1063
+
1064
  $input['title'] = trim(sanitize_text_field($input['title']));
1065
+
1066
  $time = (int)$input['time'];
1067
  $input['time'] = ($time < 0 ? $this->defaults['time'] : $time);
1068
  }
1134
  {
1135
  wp_enqueue_script(
1136
  'math-captcha',
1137
+ plugins_url('/js/admin.js', __FILE__),
1138
  array('jquery', 'jquery-ui-core', 'jquery-ui-button')
1139
  );
1140
 
1141
+ wp_enqueue_style('math-captcha-admin', plugins_url('/css/admin.css', __FILE__));
1142
  wp_enqueue_style('math-captcha-front', plugins_url('/css/wp-like-ui-theme.css', __FILE__));
1143
  }
1144
  }
1163
 
1164
  $plugin = plugin_basename(__FILE__);
1165
 
1166
+ if($file == $plugin)
1167
  {
1168
  return array_merge(
1169
  $links,