Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

Commit 3f88741

Browse files
committed
1.14.0
1 parent f919b18 commit 3f88741

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

altcha.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@
77
* Description: ALTCHA is a free, open-source CAPTCHA alternative that offers robust protection without using cookies, ensuring full GDPR compliance by design. It also provides invisible anti-spam and anti-bot protection through ALTCHA's API.
88
* Author: Altcha.org
99
* Author URI: https://altcha.org
10-
* Version: 1.13.1
11-
* Stable tag: 1.13.1
10+
* Version: 1.14.0
11+
* Stable tag: 1.14.0
1212
* Requires at least: 5.0
1313
* Requires PHP: 7.3
1414
* Tested up to: 6.6
1515
* License: GPLv2 or later
1616
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
1717
*/
1818

19-
define('ALTCHA_VERSION', '1.13.1');
19+
define('ALTCHA_VERSION', '1.14.0');
2020
define('ALTCHA_WEBSITE', 'https://altcha.org/');
2121
define('ALTCHA_WIDGET_VERSION', '1.0.0');
2222
define('ALTCHA_LANGUAGES', [
23+
"auto" => "Auto",
2324
"bg" => "Bulgarian",
2425
"ca" => "Catalan",
2526
"cs" => "Czech",
@@ -102,7 +103,7 @@ function altcha_activate()
102103
update_option(AltchaPlugin::$option_api_key, '');
103104
update_option(AltchaPlugin::$option_expires, '3600');
104105
update_option(AltchaPlugin::$option_secret, AltchaPlugin::$instance->random_secret());
105-
update_option(AltchaPlugin::$option_language, 'en');
106+
update_option(AltchaPlugin::$option_language, 'auto');
106107
update_option(AltchaPlugin::$option_hidefooter, true);
107108
update_option(AltchaPlugin::$option_send_ip, true);
108109
update_option(AltchaPlugin::$option_integration_custom, 'captcha');

includes/admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function altcha_settings_link($links)
3333
));
3434
$settings_link = "<a href='$url'>" . __('Settings') . '</a>';
3535

36-
array_push(
36+
array_unshift(
3737
$links,
3838
$settings_link
3939
);

includes/core.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,15 @@ public function get_translations($language = null)
289289
if ($language === null) {
290290
$language = $this->get_language();
291291
}
292-
return ALTCHA_VERSION_TRANSLATIONS[$language] ?: ALTCHA_VERSION_TRANSLATIONS["en"];
292+
if ($language === "auto") {
293+
// Get the current locale
294+
$language = get_locale();
295+
if (!isset(ALTCHA_TRANSLATIONS[$language])) {
296+
// Wordpress uses full codes such as `fr_FR`; if no translation is found, try short version `fr`
297+
$language = substr($language, 0, 2);
298+
}
299+
}
300+
return ALTCHA_TRANSLATIONS[$language] ?: ALTCHA_TRANSLATIONS["en"];
293301
}
294302

295303

includes/translations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
$ALTCHA_WEBSITE = constant('ALTCHA_WEBSITE');
66

7-
define('ALTCHA_VERSION_TRANSLATIONS', array(
7+
define('ALTCHA_TRANSLATIONS', array(
88
"bg" => array(
99
"error" => "Верификацията не бе успешна. Моля, опитайте отново по-късно.",
1010
"footer" => "Защитено от <a href=\"$ALTCHA_WEBSITE\" target=\"_blank\">ALTCHA</a>",

readme.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Tags: altcha, captcha, spam, anti-spam, anti-bot, antispam, recaptcha, hcaptcha, gdpr
33
Author: Altcha.org
44
Author URI: https://altcha.org
5-
Version: 1.13.1
6-
Stable tag: 1.13.1
5+
Version: 1.14.0
6+
Stable tag: 1.14.0
77
Requires at least: 5.0
88
Requires PHP: 7.3
99
Tested up to: 6.6
@@ -72,6 +72,7 @@ This plugin requires the WordPress REST API. If you are using any "Disable REST
7272
* WP-Members
7373
* WordPress Login, Register, Password reset
7474
* WordPress Comments
75+
* WooCommerce
7576
* Custom HTML (with a short code `[altcha]`)
7677

7778
== Source Code ==
@@ -96,6 +97,10 @@ All source code for the plugin, and the ALTCHA widget is available on GitHub. In
9697

9798
== Changelog ==
9899

100+
= 1.14.0 =
101+
* Automatic language detection [#31]
102+
* Change placement of the "Settings" link in the plugin list [#32]
103+
99104
= 1.13.1 =
100105
* Ignore WooCommerce form submissions in WordPress integration [#30]
101106

0 commit comments

Comments
 (0)