Recaptcha Fails #1

Open
opened 2025-06-18 14:20:34 +10:00 by j · 0 comments
Owner

Recaptcha fails when submitting forms. The following error appears in the error display hook of Wordpress

reCAPTCHA verification failed.

It appears that that Javascript is correctly loading with keys stored in the database, and that the form is correctly marked up.

The HTML generated for the wp-admin login form:

<div id="login">
		<h1 role="presentation" class="wp-login-logo"><a href="https://wordpress.org/">Powered by WordPress</a></h1>
	<div id="login_error" class="notice notice-error"><p>reCAPTCHA verification failed.</p></div>
		<form name="loginform" id="loginform" action="https://test.example.com/wp-login.php" method="post">
			<p>
				<label for="user_login">Username or Email Address</label>
				<input type="text" name="log" id="user_login" aria-describedby="login_error" class="input" value="" size="20" autocapitalize="none" autocomplete="username" required="required">
			</p>

			<div class="user-pass-wrap">
				<label for="user_pass">Password</label>
				<div class="wp-pwd">
					<input type="password" name="pwd" id="user_pass" aria-describedby="login_error" class="input password-input" value="" size="20" autocomplete="current-password" spellcheck="false" required="required">
					<button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="Show password">
						<span class="dashicons dashicons-visibility" aria-hidden="true"></span>
					</button>
				</div>
			</div>
						<p class="forgetmenot"><input name="rememberme" type="checkbox" id="rememberme" value="forever"> <label for="rememberme">Remember Me</label></p>
			<p class="submit">
				<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Log In">
									<input type="hidden" name="redirect_to" value="https://test.example.com/wp-admin/">
									<input type="hidden" name="testcookie" value="1">
			</p>
		</form>

					<p id="nav">
				<a class="wp-login-lost-password" href="https://test.example.com/wp-login.php?action=lostpassword">Lost your password?</a>			</p>
			<script>
function wp_attempt_focus() {setTimeout( function() {try {d = document.getElementById( "user_login" );d.focus(); d.select();} catch( er ) {}}, 200);}
wp_attempt_focus();
if ( typeof wpOnload === 'function' ) { wpOnload() }
</script>
		<p id="backtoblog">
			<a href="https://test.example.com/">← Go to Example</a>		</p>
			</div>

Ah, noting now that the script for recaptcha is not loaded into the page.

Recaptcha fails when submitting forms. The following error appears in the error display hook of Wordpress ``` reCAPTCHA verification failed. ``` It appears that that Javascript is correctly loading with keys stored in the database, and that the form is correctly marked up. The HTML generated for the wp-admin login form: ``` <div id="login"> <h1 role="presentation" class="wp-login-logo"><a href="https://wordpress.org/">Powered by WordPress</a></h1> <div id="login_error" class="notice notice-error"><p>reCAPTCHA verification failed.</p></div> <form name="loginform" id="loginform" action="https://test.example.com/wp-login.php" method="post"> <p> <label for="user_login">Username or Email Address</label> <input type="text" name="log" id="user_login" aria-describedby="login_error" class="input" value="" size="20" autocapitalize="none" autocomplete="username" required="required"> </p> <div class="user-pass-wrap"> <label for="user_pass">Password</label> <div class="wp-pwd"> <input type="password" name="pwd" id="user_pass" aria-describedby="login_error" class="input password-input" value="" size="20" autocomplete="current-password" spellcheck="false" required="required"> <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="Show password"> <span class="dashicons dashicons-visibility" aria-hidden="true"></span> </button> </div> </div> <p class="forgetmenot"><input name="rememberme" type="checkbox" id="rememberme" value="forever"> <label for="rememberme">Remember Me</label></p> <p class="submit"> <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Log In"> <input type="hidden" name="redirect_to" value="https://test.example.com/wp-admin/"> <input type="hidden" name="testcookie" value="1"> </p> </form> <p id="nav"> <a class="wp-login-lost-password" href="https://test.example.com/wp-login.php?action=lostpassword">Lost your password?</a> </p> <script> function wp_attempt_focus() {setTimeout( function() {try {d = document.getElementById( "user_login" );d.focus(); d.select();} catch( er ) {}}, 200);} wp_attempt_focus(); if ( typeof wpOnload === 'function' ) { wpOnload() } </script> <p id="backtoblog"> <a href="https://test.example.com/">← Go to Example</a> </p> </div> ``` Ah, noting now that the script for recaptcha is not loaded into the page.
j added this to the MVP project 2025-06-18 14:20:34 +10:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: free-wordpress/fwp-recaptcha#1
No description provided.