Skip to content

Commit f286d93

Browse files
Use polyfill site.js in v1, update SDKs, lock version in update-sdk.sh (#137)
* Use polyfill site.js in v1, update SDKs, lock version in `update-sdk.sh` * update stable tag in readme --------- Co-authored-by: merlinfuchs <[email protected]>
1 parent 9dec9c6 commit f286d93

File tree

10 files changed

+40
-15
lines changed

10 files changed

+40
-15
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ node_modules/
2525
.DS_Store
2626

2727
vendor/
28+
!friendly-captcha/public/vendor/
29+
2830
bin/

friendly-captcha/friendly-captcha.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Plugin Name: Friendly Captcha for WordPress
55
* Description: Protect WordPress website forms from spam and abuse with Friendly Captcha, a privacy-first anti-bot solution.
6-
* Version: 1.15.1
6+
* Version: 1.15.2
77
* Requires at least: 5.0
88
* Requires PHP: 7.3
99
* Author: Friendly Captcha GmbH
@@ -19,9 +19,9 @@
1919
die;
2020
}
2121

22-
define('FRIENDLY_CAPTCHA_VERSION', '1.15.1');
23-
define('FRIENDLY_CAPTCHA_FRIENDLY_CHALLENGE_VERSION', '0.9.12');
24-
define('FRIENDLY_CAPTCHA_FRIENDLY_CAPTCHA_SDK_VERSION', '0.1.7');
22+
define('FRIENDLY_CAPTCHA_VERSION', '1.15.2');
23+
define('FRIENDLY_CAPTCHA_FRIENDLY_CHALLENGE_VERSION', '0.9.18');
24+
define('FRIENDLY_CAPTCHA_FRIENDLY_CAPTCHA_SDK_VERSION', '0.1.8');
2525
define('FRIENDLY_CAPTCHA_SUPPORTED_LANGUAGES', [
2626
"en" => "English",
2727
"de" => "German",
@@ -52,6 +52,11 @@
5252
"hu" => "Hungarian",
5353
"ro" => "Romanian",
5454
"zh" => "Chinese (simplified)",
55+
"vi" => "Vietnamese",
56+
"he" => "Hebrew",
57+
"th" => "Thai",
58+
"kr" => "Korean",
59+
"ar" => "Arabic"
5560
]);
5661

5762
register_activation_hook(__FILE__, 'frcaptcha_activate');

friendly-captcha/public/vendor/v1/widget.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

friendly-captcha/public/vendor/v1/widget.module.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

friendly-captcha/public/vendor/v1/widget.polyfilled.min.js

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

friendly-captcha/public/vendor/v2/site.compat.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

friendly-captcha/public/vendor/v2/site.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

friendly-captcha/public/widgets.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function frcaptcha_v1_enqueue_widget_scripts()
3333
/* Fallback for (very) old browsers */
3434
wp_enqueue_script(
3535
'friendly-captcha-widget-fallback',
36-
plugin_dir_url(__FILE__) . 'vendor/v1/widget.min.js',
36+
plugin_dir_url(__FILE__) . 'vendor/v1/widget.polyfilled.min.js',
3737
array(),
3838
$version,
3939
true
@@ -101,7 +101,7 @@ function frcaptcha_v1_echo_script_tags()
101101
$version = FriendlyCaptcha_Plugin::$friendly_challenge_version;
102102

103103
echo '<script async defer type="module" src="' . plugin_dir_url(__FILE__) . 'vendor/v1/widget.module.min.js?ver=' . $version . '"></script>';
104-
echo '<script async defer nomodule src="' . plugin_dir_url(__FILE__) . 'vendor/v1/widget.min.js?ver=' . $version . '"></script>';
104+
echo '<script async defer nomodule src="' . plugin_dir_url(__FILE__) . 'vendor/v1/widget.polyfilled.min.js?ver=' . $version . '"></script>';
105105
}
106106

107107

friendly-captcha/readme.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: captcha, antispam, spam, contact form, recaptcha, friendly-captcha, block
44
Requires at least: 5.0
55
Tested up to: 6.5
66
Requires PHP: 7.3
7-
Stable tag: 1.15.1
7+
Stable tag: 1.15.2
88
License: GPL v2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -96,6 +96,12 @@ However, you may wish to email the authors of plugins you'd like to support Frie
9696

9797
== Changelog ==
9898

99+
= 1.15.2 =
100+
101+
* Use polyfilled version of widgets for better old browser support for Friendly Captcha v1.
102+
* Update `friendly-captcha-sdk` to version `0.1.8`.
103+
* Update `friendly-challenge` to version `0.9.18` which adds support for more languages (Arabic, Korean, Hebrew, Thai).
104+
99105
= 1.15.1 =
100106

101107
* Don't call siteverify endpoint when Captcha solution is empty

scripts/update-sdk.sh

100644100755
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# V1
2-
curl -o ./friendly-captcha/public/vendor/v1/widget.module.min.js https://cdn.jsdelivr.net/npm/friendly-challenge/widget.module.min.js
3-
curl -o ./friendly-captcha/public/vendor/v1/widget.min.js https://cdn.jsdelivr.net/npm/friendly-challenge/widget.min.js
2+
V1_VERSION="0.9.18"
3+
curl -o ./friendly-captcha/public/vendor/v1/widget.module.min.js https://cdn.jsdelivr.net/npm/friendly-challenge@${V1_VERSION}/widget.module.min.js
4+
curl -o ./friendly-captcha/public/vendor/v1/widget.polyfilled.min.js https://cdn.jsdelivr.net/npm/friendly-challenge@${V1_VERSION}/widget.polyfilled.min.js
45

56
# V2
6-
curl -o ./friendly-captcha/public/vendor/v2/site.min.js https://cdn.jsdelivr.net/npm/@friendlycaptcha/sdk/site.min.js
7-
curl -o ./friendly-captcha/public/vendor/v2/site.compat.min.js https://cdn.jsdelivr.net/npm/@friendlycaptcha/sdk/site.compat.min.js
7+
V2_VERSION="0.1.8"
8+
curl -o ./friendly-captcha/public/vendor/v2/site.min.js https://cdn.jsdelivr.net/npm/@friendlycaptcha/sdk@${V2_VERSION}/site.min.js
9+
curl -o ./friendly-captcha/public/vendor/v2/site.compat.min.js https://cdn.jsdelivr.net/npm/@friendlycaptcha/sdk@${V2_VERSION}/site.compat.min.js

0 commit comments

Comments
 (0)