-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from wpdev10/master
Settings reset to default all the time we activate plugin
- Loading branch information
Showing
7 changed files
with
120 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
var holderId; | ||
jQuery(document).ready(function($) { | ||
//uwp_init_recaptcha(); | ||
}); | ||
|
||
function uwp_init_recaptcha() { | ||
if ( jQuery('.uwp-captcha-render').length) { | ||
|
||
jQuery('.uwp-captcha-render').each(function() { | ||
if(jQuery(this).html()==''){ | ||
var container = jQuery(this).attr('id'); | ||
if (container) { | ||
try { | ||
//uwp_display_captcha(container); | ||
} catch(err) { | ||
console.log(err); | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
|
||
function uwp_display_captcha(element){ | ||
try { | ||
if(uwp_recaptcha_data.captcha_version == 'v3'){ | ||
grecaptcha.ready( | ||
function() { | ||
holderId = grecaptcha.execute(uwp_recaptcha_data.site_key, {action: 'uwp_captcha'}).then(function (token) { | ||
document.getElementById(element).value = token; | ||
}); | ||
} | ||
); | ||
} else if(uwp_recaptcha_data.captcha_version == 'invisible'){ | ||
grecaptcha.ready( | ||
function() { | ||
holderId = grecaptcha.render(element, { | ||
'sitekey': uwp_recaptcha_data.site_key, | ||
'size': 'invisible', | ||
'badge': 'bottomright', | ||
'callback': function (token) { | ||
uwp_maybe_check_recaptcha(element); | ||
} | ||
}); | ||
} | ||
); | ||
} else { | ||
holderId = grecaptcha.render(element , { 'sitekey' : uwp_recaptcha_data.site_key, 'theme' : uwp_recaptcha_data.captcha_theme, 'size' : uwp_recaptcha_data.captcha_size }); | ||
} | ||
} catch(err) { | ||
console.log(err); | ||
} | ||
} | ||
|
||
function uwp_reset_captcha(element){ | ||
if(uwp_recaptcha_data.captcha_version == 'v3') { | ||
if (typeof grecaptcha != 'undefined') { | ||
holderId = grecaptcha.execute(uwp_recaptcha_data.site_key, {action: 'uwp_captcha'}).then(function (token) { | ||
document.getElementById(element).value = token; | ||
}); | ||
} | ||
|
||
} else { | ||
if (typeof grecaptcha != 'undefined') { | ||
grecaptcha.reset(holderId); | ||
} | ||
} | ||
} | ||
|
||
function uwp_maybe_execute_captcha(element){ | ||
if(uwp_recaptcha_data.captcha_version == 'invisible') { | ||
if (typeof grecaptcha != 'undefined') { | ||
grecaptcha.execute(holderId); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: UsersWP - ReCaptcha 1.2.0\n" | ||
"Project-Id-Version: UsersWP - ReCaptcha 1.2.1\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2019-10-30 16:00+0000\n" | ||
"PO-Revision-Date: 2019-10-30 16:00+0000\n" | ||
"POT-Creation-Date: 2020-01-23 19:46+0530\n" | ||
"PO-Revision-Date: 2020-01-23 19:46+0530\n" | ||
"Last-Translator: \n" | ||
"Language-Team: AyeCode <[email protected]>\n" | ||
"Language: en_US\n" | ||
|
@@ -15,7 +15,7 @@ msgstr "" | |
"X-Poedit-Basepath: ..\n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Poedit-SourceCharset: UTF-8\n" | ||
"X-Generator: Poedit 1.8.7.1\n" | ||
"X-Generator: Poedit 2.2.1\n" | ||
"X-Poedit-SearchPath-0: .\n" | ||
|
||
#: admin/settings.php:6 | ||
|
@@ -167,19 +167,19 @@ msgstr "" | |
msgid "Invisible ReCaptcha" | ||
msgstr "" | ||
|
||
#: includes/class-uwp-recaptcha.php:167 | ||
#: includes/class-uwp-recaptcha.php:166 | ||
#, php-format | ||
msgid "" | ||
"UsersWP ReCaptcha addon: API Key and API Secret not set. %sclick here%s to " | ||
"set one." | ||
msgstr "" | ||
|
||
#: includes/class-uwp-recaptcha.php:169 | ||
#: includes/class-uwp-recaptcha.php:168 | ||
#, php-format | ||
msgid "UsersWP ReCaptcha addon: API Key not set. %sclick here%s to set one." | ||
msgstr "" | ||
|
||
#: includes/class-uwp-recaptcha.php:171 | ||
#: includes/class-uwp-recaptcha.php:170 | ||
#, php-format | ||
msgid "UsersWP ReCaptcha addon: API Secret not set. %sclick here%s to set one." | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters