Replace jQuery in login-script.php
-
Hi. This isn’t anything critical, but it would be nice if the core of the plugin didn’t require jQuery.
jQuery is a big first byte loading bottleneck, and most sites do not need it until properly logged in (especially on the login page).
None of the other portions of the base plugin appear to need it as far as tested. Except the small portion at the bottom of login-script.php, which can easily be replaced with regular js.
if(jQuery('.login-container').length==0) {jQuery('.language-switcher').appendTo(jQuery('#login'));}else{jQuery('.language-switcher').appendTo(jQuery('.login-container'));
}javascript:
const loginContainer = document.querySelector('.login-container');
const languageSwitcher = document.querySelector('.language-switcher');
if (!loginContainer) {
const login = document.querySelector('#login');
if (loginContainer) login.appendChild(languageSwitcher);
} else {
loginContainer.appendChild(languageSwitcher);
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
You must be logged in to reply to this topic.