Login syntax error possible recaptcha plugin conflict
-
Hello,
We are no longer able to login via http://www.platinumrealty.bm/wp-admin nor /wp-login.php
We get the below error message:
We believe there is a conflict between your plugin and reCaptcha Pro by BestWebSoft
When we deactivate this plugin, it works.
We copied some of the code pointed out in Developer Tools when we tried to login into ChatGPT. It produced the below resolve:
Your provided code has some issues, including syntax errors and a missing reference to the jQuery library (assuming you intended to use it). I’ll debug the JavaScript code for you:
- The
eventobject is not defined within your functions. You should passeas a parameter to your functions and use it to access the event object. - Ensure you’re including the jQuery library before using jQuery functions like
jQuery('.login-container').
Here’s the corrected and annotated code:
window.onload = function(e) {
var capsLock = ‘off’;
var passwordField = document.getElementById(“user_pass”);if (passwordField) {
passwordField.onkeydown = function(e) {
var el = this;
// Use the parameter ‘e’ to access the event object
var caps = e.getModifierState && e.getModifierState(‘CapsLock’);
if (caps) {
capsLock = ‘on’;
el.nextElementSibling.style.display = “block”;
} else {
capsLock = ‘off’;
el.nextElementSibling.style.display = “none”;
}
};passwordField.onblur = function(e) { var el = this; el.nextElementSibling.style.display = "none"; }; passwordField.onfocus = function(e) { var el = this; if (capsLock == 'on') { el.nextElementSibling.style.display = "block"; } else { el.nextElementSibling.style.display = "none"; } };}
// Rest of your code (form submission and jQuery) goes here
// Example:
/*
if (document.getElementById(“loginform”)) {
document.getElementById(“loginform”).addEventListener(“submit”, _LoginPressFormSubmitLoader);
}
*//*
if (jQuery(‘.login-container’).length == 0) {
jQuery(‘.language-switcher’).appendTo(jQuery(‘#login’));
} else {
jQuery(‘.language-switcher’).appendTo(jQuery(‘.login-container’));
}
*/// Definition of the _LoginPressFormSubmitLoader function (uncomment this part if needed)
function _LoginPressFormSubmitLoader() {
var subButton = document.getElementsByClassName(“submit”);
var myButton = document.getElementById(“wp-submit”);
var image = document.createElement(“img”);
myButton.setAttribute(‘disabled’, ‘disabled’);
image.setAttribute(“src”, “https://platinumrealty.bm/wp-admin/images/loading.gif”);
image.setAttribute(“width”, “20”);
image.setAttribute(“height”, “20”);
image.setAttribute(“alt”, “Login Loader”);
image.setAttribute(“style”, “display: block; margin: 0 auto; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);”);
subButton[0].appendChild(image);
}
};Please make sure to adapt the rest of your code (form submissions and jQuery) accordingly, as you’ve commented them out. Additionally, ensure that you have the jQuery library included in your HTML file if you intend to use jQuery functions.
May you please advise how we resolve this issue, please? Thank you
The page I need help with: [log in to see the link]
- The
The topic ‘Login syntax error possible recaptcha plugin conflict’ is closed to new replies.