Skip to content

Commit

Permalink
1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ovx committed Aug 7, 2024
1 parent ec922a1 commit e33053c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 38 deletions.
8 changes: 3 additions & 5 deletions altcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
* 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.
* Author: Altcha.org
* Author URI: https://altcha.org
* Version: 1.4.0
* Stable tag: 1.4.0
* Version: 1.5.0
* Stable tag: 1.5.0
* Requires at least: 5.0
* Requires PHP: 7.3
* Tested up to: 6.6
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

define('ALTCHA_VERSION', '1.4.0');
define('ALTCHA_VERSION', '1.5.0');
define('ALTCHA_WEBSITE', 'https://altcha.org/');
define('ALTCHA_WIDGET_VERSION', '0.6.7');
define('ALTCHA_LANGUAGES', [
Expand Down Expand Up @@ -51,7 +51,6 @@
"zh-CN" => "Chinese (simplified)",
]);


// required for is_plugin_active
require_once ABSPATH . 'wp-admin/includes/plugin.php';

Expand Down Expand Up @@ -100,7 +99,6 @@ function altcha_activate()
update_option(AltchaPlugin::$option_secret, AltchaPlugin::$instance->random_secret());
update_option(AltchaPlugin::$option_language, 'en');
update_option(AltchaPlugin::$option_hidefooter, true);
update_option(AltchaPlugin::$option_wp_api_prefix, rest_get_url_prefix());
update_option(AltchaPlugin::$option_send_ip, true);
}

Expand Down
14 changes: 1 addition & 13 deletions includes/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ class AltchaPlugin

public static $option_hidelogo = "altcha_hidelogo";

public static $option_wp_api_prefix = "altcha_wp_api_prefix";

public static $option_integration_contact_form_7 = "altcha_integration_contact_form_7";

public static $option_integration_custom = "altcha_integration_custom";
Expand Down Expand Up @@ -176,11 +174,6 @@ public function get_delay()
return trim(get_option(AltchaPlugin::$option_delay));
}

public function get_wp_api_prefix()
{
return trim(get_option(AltchaPlugin::$option_wp_api_prefix));
}

public function get_integration_contact_form_7()
{
return trim(get_option(AltchaPlugin::$option_integration_contact_form_7));
Expand Down Expand Up @@ -256,12 +249,7 @@ public function get_challengeurl()
{
$api = $this->get_api();
if ($api === "selfhosted") {
$base_url = get_site_url();
$prefix = $this->get_wp_api_prefix();
if (empty($prefix)) {
$prefix = "wp-json";
}
return "$base_url/$prefix/altcha/v1/challenge";
return get_rest_url(null, "/altcha/v1/challenge");
}
$api_key = $this->get_api_key();
return "https://$api.altcha.org/api/v1/challenge?apiKey=$api_key";
Expand Down
18 changes: 0 additions & 18 deletions includes/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ function altcha_settings_init()
AltchaPlugin::$option_delay
);

register_setting(
'altcha_options',
AltchaPlugin::$option_wp_api_prefix
);

register_setting(
'altcha_options',
AltchaPlugin::$option_integration_contact_form_7
Expand Down Expand Up @@ -351,19 +346,6 @@ function altcha_settings_init()
)
);

add_settings_field(
'altcha_settings_wp_api_prefix_field',
__('REST API prefix', 'altcha-spam-protection'),
'altcha_settings_field_callback',
'altcha_admin',
'altcha_widget_settings_section',
array(
"name" => AltchaPlugin::$option_wp_api_prefix,
"hint" => "Override REST API prefix for self-hosted mode (default: wp-json).",
"type" => "text"
)
);

// Section
add_settings_section(
'altcha_integrations_settings_section',
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Tags: altcha, captcha, spam, anti-spam, anti-bot, antispam, recaptcha, hcaptcha, gdpr
Author: Altcha.org
Author URI: https://altcha.org
Version: 1.4.0
Stable tag: 1.4.0
Version: 1.5.0
Stable tag: 1.5.0
Requires at least: 5.0
Requires PHP: 7.3
Tested up to: 6.6
Expand Down Expand Up @@ -94,6 +94,9 @@ All source code for the plugin, and the ALTCHA widget is available on GitHub. In

== Changelog ==

= 1.5.0 =
* Fix REST base URL (+ REST prefix removed from settings) [#13]

= 1.4.0 =
* Support for Elementor Pro Forms
* Widget updated to 0.6.7
Expand Down

0 comments on commit e33053c

Please sign in to comment.