Skip to content

Commit

Permalink
add in <noscript> to catch submissions when JS is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmatadeen committed Aug 9, 2015
1 parent 9a237b0 commit b6d3eb3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions no-captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function wr_no_captcha_login_form_script() {

function wr_no_captcha_render_login_captcha() {
echo '<div class="g-recaptcha" data-sitekey="' . get_option( 'wr_no_captcha_site_key' ) . '"></div>';
require_once( plugin_dir_path( __FILE__ ) . 'noscript/noscript.php');
}

function wr_no_captcha_verify_login_captcha($user, $password) {
Expand Down
21 changes: 21 additions & 0 deletions noscript/noscript.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<noscript>
<div style="width: 302px; height: 422px;">
<div style="width: 302px; height: 422px; position: relative;">
<div style="width: 302px; height: 422px; position: absolute;">
<iframe src="https://www.google.com/recaptcha/api/fallback?k=<?php echo get_option( 'wr_no_captcha_site_key' ); ?>"
frameborder="0" scrolling="no"
style="width: 302px; height:422px; border-style: none;">
</iframe>
</div>
<div style="width: 300px; height: 60px; border-style: none;
bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px;
background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;">
<textarea id="g-recaptcha-response" name="g-recaptcha-response"
class="g-recaptcha-response"
style="width: 250px; height: 40px; border: 1px solid #c1c1c1;
margin: 10px 25px; padding: 0px; resize: none;" >
</textarea>
</div>
</div>
</div>
</noscript>

0 comments on commit b6d3eb3

Please sign in to comment.