Skip to content

Commit aa31503

Browse files
committed
- added readme.txt file
1 parent 7044afc commit aa31503

9 files changed

+121
-72
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ __Note:__ This is a free extension created for the community. The Ultimate Membe
77
__Note:__ This is an update of the "Ultimate Member - Math Captcha in Register forms" extension in the [Extended](https://github.com/ultimatemember/Extended/tree/main) package.
88

99
## Key features
10-
- Displays the Math Captcha field in the registration form.
10+
- Adds the Math Captcha field to the registration form.
1111

1212
## Installation
1313

@@ -21,7 +21,7 @@ Open git bash, navigate to the plugins folder and execute this command:
2121
Once the plugin is cloned, enter your site admin dashboard and go to _wp-admin > Plugins > Installed Plugins_. Find the "Ultimate Member - Math Captcha" plugin and click the "Activate" link.
2222

2323
### How to install from ZIP archive
24-
You can install this plugin from the [ZIP file](https://drive.google.com/file/d/1gLBbclH1Yrmh78BwVsq7MdL4Pa3_D57g/view?usp=sharing) as any other plugin. Follow [this instruction](https://wordpress.org/support/article/managing-plugins/#upload-via-wordpress-admin).
24+
You can install this plugin from the [ZIP file](https://drive.google.com/file/d/1qd0rQXfRG8hZ2SPCGbtUHKoP3j7s_uWL/view?usp=sharing) as any other plugin. Follow [this instruction](https://wordpress.org/support/article/managing-plugins/#upload-via-wordpress-admin).
2525

2626
## How to use
2727

includes/class-um-math-captcha.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function __construct() {
6262

6363
add_action( 'um_after_register_fields', array( $this, 'add_field' ), 10, 1 );
6464
add_action( 'um_submit_form_errors_hook__registration', array( $this, 'validate' ), 10, 2 );
65+
add_action( 'plugins_loaded', array( $this, 'textdomain' ), 9 );
6566
}
6667

6768

@@ -117,4 +118,14 @@ public function validate( $post_form, $form_data ) {
117118
}
118119
}
119120

121+
122+
/**
123+
* Loads a plugin's translated strings.
124+
*/
125+
public function textdomain() {
126+
$locale = get_locale() ? get_locale() : 'en_US';
127+
load_textdomain( um_math_captcha_textdomain, WP_LANG_DIR . '/plugins/' . um_math_captcha_textdomain . '-' . $locale . '.mo' );
128+
load_plugin_textdomain( um_math_captcha_textdomain, false, dirname( um_math_captcha_plugin ) . '/languages/' );
129+
}
130+
120131
}

languages/um-math-captcha-de_DE.mo

-16 Bytes
Binary file not shown.

languages/um-math-captcha-de_DE.po

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ msgstr ""
33
"Project-Id-Version: Ultimate Member - Math Captcha in Register form\n"
44
"Report-Msgid-Bugs-To: \n"
55
"POT-Creation-Date: 2023-10-28 21:51+0000\n"
6-
"PO-Revision-Date: 2023-10-29 10:20+0000\n"
7-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8-
"Language-Team: Unknown\n"
9-
"Language: zxx\n"
6+
"PO-Revision-Date: 2023-10-29 12:14+0000\n"
7+
"Last-Translator: Denis Baran\n"
8+
"Language-Team: German\n"
9+
"Language: de_DE\n"
1010
"Plural-Forms: nplurals=2; plural=n!=1;\n"
1111
"MIME-Version: 1.0\n"
1212
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,24 +17,32 @@ msgstr ""
1717
"X-Domain: um-math-captcha\n"
1818
"X-Loco-Parser: loco_parse_po"
1919

20+
#. Description of the plugin
21+
msgid "Adds the Math Captcha field to the registration form."
22+
msgstr "Fügt dem Registrierungsformular das Mathe-Captcha-Feld hinzu."
23+
2024
#. Author URI of the plugin
21-
msgid "http://ultimatemember.com/"
25+
msgid "https://github.com/umdevelopera"
2226
msgstr ""
2327

24-
#: includes/class-um-math-captcha.php:107
28+
#. URI of the plugin
29+
msgid "https://github.com/umdevelopera/um-math-captcha"
30+
msgstr ""
31+
32+
#: includes/class-um-math-captcha.php:117
2533
msgid "Incorrect answer. Please try again."
2634
msgstr "Falsche Antwort. Bitte nochmal versuchen!"
2735

28-
#: includes/class-um-math-captcha.php:105
36+
#: includes/class-um-math-captcha.php:115
2937
msgid "Math Captcha is required."
3038
msgstr "Mathe-Captcha ist erforderlich."
3139

32-
#: includes/class-um-math-captcha.php:70
40+
#: includes/class-um-math-captcha.php:79
3341
msgid "Solve this simple Math: "
34-
msgstr "Lösen Sie diese einfache Rechnung:"
42+
msgstr "Lösen Sie diese einfache Rechnung: "
3543

3644
#. %s - plugin name.
37-
#: um-math-captcha.php:39
45+
#: um-math-captcha.php:46
3846
#, php-format
3947
msgid ""
4048
"The <strong>%s</strong> extension requires the Ultimate Member plugin to be "
@@ -45,18 +53,14 @@ msgstr ""
4553
" Erweiterung richtig funktioniert. Du kannst es <a href=\"https://wordpress."
4654
"org/plugins/ultimate-member\">hier</a> herunterladen."
4755

48-
#. Description of the plugin
49-
msgid "This plugin adds math challenge in the Register forms"
50-
msgstr "Dieses Plugin fügt Rechenaufgaben in das Registrier-Formular ein."
51-
52-
#. Author of the plugin
53-
msgid "Ultimate Member"
56+
#. Name of the plugin
57+
msgid "Ultimate Member - Math Captcha"
5458
msgstr ""
5559

56-
#. Name of the plugin
57-
msgid "Ultimate Member - Math Captcha in Register form"
60+
#. Author of the plugin
61+
msgid "umdevelopera"
5862
msgstr ""
5963

60-
#: includes/class-um-math-captcha.php:78
64+
#: includes/class-um-math-captcha.php:82
6165
msgid "Your answer..."
6266
msgstr "Ihre Antwort..."

languages/um-math-captcha-en_US.mo

0 Bytes
Binary file not shown.

languages/um-math-captcha-en_US.po

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgstr ""
33
"Project-Id-Version: Ultimate Member - Math Captcha in Register form\n"
44
"Report-Msgid-Bugs-To: \n"
55
"POT-Creation-Date: 2023-10-28 21:51+0000\n"
6-
"PO-Revision-Date: 2023-10-28 21:52+0000\n"
6+
"PO-Revision-Date: 2023-10-29 12:13+0000\n"
77
"Last-Translator: Denis Baran\n"
88
"Language-Team: English (United States)\n"
99
"Language: en_US\n"
@@ -15,43 +15,47 @@ msgstr ""
1515
"X-Loco-Version: 2.6.6; wp-6.4-RC2\n"
1616
"X-Domain: um-math-captcha"
1717

18+
#. Description of the plugin
19+
msgid "Adds the Math Captcha field to the registration form."
20+
msgstr ""
21+
1822
#. Author URI of the plugin
19-
msgid "http://ultimatemember.com/"
23+
msgid "https://github.com/umdevelopera"
24+
msgstr ""
25+
26+
#. URI of the plugin
27+
msgid "https://github.com/umdevelopera/um-math-captcha"
2028
msgstr ""
2129

22-
#: includes/class-um-math-captcha.php:107
30+
#: includes/class-um-math-captcha.php:117
2331
msgid "Incorrect answer. Please try again."
2432
msgstr ""
2533

26-
#: includes/class-um-math-captcha.php:105
34+
#: includes/class-um-math-captcha.php:115
2735
msgid "Math Captcha is required."
2836
msgstr ""
2937

30-
#: includes/class-um-math-captcha.php:70
38+
#: includes/class-um-math-captcha.php:79
3139
msgid "Solve this simple Math: "
3240
msgstr ""
3341

3442
#. %s - plugin name.
35-
#: um-math-captcha.php:39
43+
#: um-math-captcha.php:46
3644
#, php-format
3745
msgid ""
3846
"The <strong>%s</strong> extension requires the Ultimate Member plugin to be "
3947
"activated to work properly. You can download it <a href=\"https://wordpress."
4048
"org/plugins/ultimate-member\">here</a>"
4149
msgstr ""
4250

43-
#. Description of the plugin
44-
msgid "This plugin adds math challenge in the Register forms"
51+
#. Name of the plugin
52+
msgid "Ultimate Member - Math Captcha"
4553
msgstr ""
4654

4755
#. Author of the plugin
48-
msgid "Ultimate Member"
49-
msgstr ""
50-
51-
#. Name of the plugin
52-
msgid "Ultimate Member - Math Captcha in Register form"
56+
msgid "umdevelopera"
5357
msgstr ""
5458

55-
#: includes/class-um-math-captcha.php:78
59+
#: includes/class-um-math-captcha.php:82
5660
msgid "Your answer..."
5761
msgstr ""

languages/um-math-captcha.pot

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgid ""
33
msgstr ""
44
"Project-Id-Version: Ultimate Member - Math Captcha in Register form\n"
55
"Report-Msgid-Bugs-To: \n"
6-
"POT-Creation-Date: 2023-10-28 21:51+0000\n"
6+
"POT-Creation-Date: 2023-10-29 12:13+0000\n"
77
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
88
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
99
"Language-Team: \n"
@@ -16,43 +16,47 @@ msgstr ""
1616
"X-Loco-Version: 2.6.6; wp-6.4-RC2\n"
1717
"X-Domain: um-math-captcha"
1818

19+
#. Description of the plugin
20+
msgid "Adds the Math Captcha field to the registration form."
21+
msgstr ""
22+
1923
#. Author URI of the plugin
20-
msgid "http://ultimatemember.com/"
24+
msgid "https://github.com/umdevelopera"
25+
msgstr ""
26+
27+
#. URI of the plugin
28+
msgid "https://github.com/umdevelopera/um-math-captcha"
2129
msgstr ""
2230

23-
#: includes/class-um-math-captcha.php:107
31+
#: includes/class-um-math-captcha.php:117
2432
msgid "Incorrect answer. Please try again."
2533
msgstr ""
2634

27-
#: includes/class-um-math-captcha.php:105
35+
#: includes/class-um-math-captcha.php:115
2836
msgid "Math Captcha is required."
2937
msgstr ""
3038

31-
#: includes/class-um-math-captcha.php:70
39+
#: includes/class-um-math-captcha.php:79
3240
msgid "Solve this simple Math: "
3341
msgstr ""
3442

3543
#. %s - plugin name.
36-
#: um-math-captcha.php:39
44+
#: um-math-captcha.php:46
3745
#, php-format
3846
msgid ""
3947
"The <strong>%s</strong> extension requires the Ultimate Member plugin to be "
4048
"activated to work properly. You can download it <a href=\"https://wordpress."
4149
"org/plugins/ultimate-member\">here</a>"
4250
msgstr ""
4351

44-
#. Description of the plugin
45-
msgid "This plugin adds math challenge in the Register forms"
52+
#. Name of the plugin
53+
msgid "Ultimate Member - Math Captcha"
4654
msgstr ""
4755

4856
#. Author of the plugin
49-
msgid "Ultimate Member"
50-
msgstr ""
51-
52-
#. Name of the plugin
53-
msgid "Ultimate Member - Math Captcha in Register form"
57+
msgid "umdevelopera"
5458
msgstr ""
5559

56-
#: includes/class-um-math-captcha.php:78
60+
#: includes/class-um-math-captcha.php:82
5761
msgid "Your answer..."
5862
msgstr ""

readme.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
=== Ultimate Member - Math Captcha ===
2+
3+
Author: umdevelopera
4+
Author URI: https://github.com/umdevelopera
5+
Plugin URI: https://github.com/umdevelopera/um-math-captcha
6+
Tags: ultimate member, math captcha, registration
7+
8+
Requires at least: 5.5
9+
Tested up to: 6.3.2
10+
Requires UM core at least: 2.6.8
11+
Tested UM core up to: 2.7.0
12+
Stable tag: 1.1.0
13+
14+
License: GNU Version 2 or Any Later Version
15+
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
16+
17+
== Description ==
18+
19+
Math Captcha allows you to use simple math problems for users to prove their human identity on registration and protect your site from bots.
20+
21+
= Key Features =
22+
23+
* Adds the Math Captcha field to the registration form.
24+
25+
= Documentation & Support =
26+
27+
This is a free extension created for the community. The Ultimate Member team does not provide any support for this extension. Open new issue in the GitHub repository if you face a problem: https://github.com/umdevelopera/um-math-captcha/issues
28+
29+
== Installation ==
30+
31+
Download ZIP file from GitHub or Google Drive. You can find download links here: https://github.com/umdevelopera/um-math-captcha
32+
You can install this plugin from the ZIP file as any other plugin. Follow this instruction: https://wordpress.org/support/article/managing-plugins/#upload-via-wordpress-admin
33+
34+
== Changelog ==
35+
36+
= 1.1.0: October 29, 2023 =
37+
38+
* Added: POT template file for translations.
39+
* Added: language files for a German translation.
40+
* Fixed: compatibility with the UM core version 2.0.7

um-math-captcha.php

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
<?php
22
/**
3-
* Plugin Name: Ultimate Member - Math Captcha in Register form
4-
* Plugin URI: https://github.com/ultimatemember/Extended/tree/main/um-math-captcha
5-
* Description: This plugin adds Math Captcha field to the registration form.
6-
*
7-
* Author: Ultimate Member
8-
* Author URI: http://ultimatemember.com/
9-
* License: GPL v2 or later
10-
*
3+
* Plugin Name: Ultimate Member - Math Captcha
4+
* Plugin URI: https://github.com/umdevelopera/um-math-captcha
5+
* Description: Adds the Math Captcha field to the registration form.
6+
* Author: umdevelopera
7+
* Author URI: https://github.com/umdevelopera
118
* Text Domain: um-math-captcha
129
* Domain Path: /languages
1310
*
14-
* Version: 1.1.0
15-
* UM version: 2.7.0
16-
*
1711
* Requires at least: 5.5
1812
* Requires PHP: 5.6
13+
* UM version: 2.7.0
14+
* Version: 1.1.0
1915
*
20-
* @package UM
16+
* @license GPL-2.0-or-later
17+
* @package UM Extended
2118
*/
2219

2320
if ( ! defined( 'ABSPATH' ) ) {
@@ -56,14 +53,3 @@ function () {
5653
}
5754
}
5855
add_action( 'plugins_loaded', 'um_math_captcha_check_dependencies', 2 );
59-
60-
61-
// Loads a plugin's translated strings.
62-
if ( ! function_exists( 'um_math_captcha_plugins_loaded' ) ) {
63-
function um_math_captcha_plugins_loaded() {
64-
$locale = ( get_locale() !== '' ) ? get_locale() : 'en_US';
65-
load_textdomain( um_math_captcha_textdomain, WP_LANG_DIR . '/plugins/' . um_math_captcha_textdomain . '-' . $locale . '.mo' );
66-
load_plugin_textdomain( um_math_captcha_textdomain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
67-
}
68-
}
69-
add_action( 'plugins_loaded', 'um_math_captcha_plugins_loaded', 6 );

0 commit comments

Comments
 (0)