Login With Ajax is for sites that need user logins or registrations and would like to avoid the normal wordpress login pages, this plugin adds the capability of placing a login widget in the sidebar with smooth AJAX login effects.
Some of the features:
- AJAX-powered, no screen refreshes!
- Remember/Reset Password
- Custom Login/Logout redirections
- Redirect users to custom URLs on Login and Logout
- Redirect users with different roles to custom URLs
- WPML – Language-specific redirects
- Compatible with WordPress, MultiSite, BuddyPress and many other plugins that alter the login/registration form (e.g. captcha plugins)
- Customizable, upgrade-safe widgets
- shortcode and template tags available
- Widget specific option to show link to profile page
If you have any problems with the plugin after reading the FAQ, Other Notes, etc. please visit the support forums.
Translated Languages Available
Here’s a list of currently translated languages. Translations that have been submitted are greatly appreciated and hopefully make this plugin a better one. If you’d like to contribute, please have a look at our translation site, or let us know on the support forums.
- Afrikaans – Johnny Dunhin
- Albanian – Besnik Bleta
- Arabic (SA) – Adel Madshel
- Bosnian – Nenad Cvetkovic
- Catalan – Xavi Valenti
- Chinese – Simon Lau
- Czech – Marek Liolias, Ondra Kalous, Henry Greek, Viktor Jezek
- Danish – Christian B.
- Dutch – Sjors Spoorendonk
- Estonian – Oliver Busch
- Finnish – Jaakko Kangosjärvi
- French – Geoffroy Deleury
- German – Linus Metzler
- Greek – George Alexakis, Lamprakis Fousekis
- Hebrew – Menachem Shapiro
- Hindi – Anonymous
- Hungarian – Lorinc Borda
- Italian – Marco aka teethgrinder
- Japanese – Ryuei Sasaki
- Limburgish – Anonymous
- Lithuanian – Gera Dieta
- Persian – Mohammad Hosein Ameri, Mohammad Akbari
- Polish – Ryszard Rysz
- Portuguese (Brazil) – Humberto S. Ribeiro, Diogo Goncalves, Fabiano Arruda
- Romanian – Gabriel Berzescu
- Russian – xl32,
- Slovak – Branco
- Spanish – Myself and Danilo Casati
- Swedish – Tommy Wahlund
- Turkish – Mesut Soylu, Oskay Yurtturk
Upgrading from v3 to v3.1
Due to the improvmenets necessary (specifically allowing multiple LWA widgets on one page), it was important to modify the template files to use classnames instead of ids.
If you have customized your widgets as per the instructions below, you will need make some modifications to your templates, and probably re-evaluate whether you still need custom JS if you went that far.
We’ve tried to minimize potential conflicts arising from this, but you should consider revising your template regarding these two points:
- LoginWithAjax is now a static class, so things like $this->function() and $this->variable should become LoginWithAjax::function() and LoginWithAjax::$variable
- Element IDs are now classnames, and are converted like so (we do have backwards compatibility to account for this, but still recommended):
- LoginWithAjax becomes lwa
- classname is all lowercase
- underscores become hyphens
- Example : LoginWithAjax_Form > lwa-form
Shortcodes & Template Tags
- profile_link – (1 or 0)
- If value is 1 (default), a profile link to wp-admin appears.
- registration – (1 or 0)
- If value is 1 (default), a registration link appears, providing you have registration enabled in your WP settings.
- template – (template name/directory)
- If this template directory exists, this template will be used. Default is ‘default’ template.
- remember – (1 or 0)
- If value is 1 (default), a remember password link appears for password recovery
- Successful logins are redirected to this URL
To force SSL, see https://codex.wordpress.org/Administration_Over_SSL. The plugin will automatically detect the wordpress settings.
Customizing the Widget
You can customize the html widgets in an upgrade-safe manner by copying files and editing them within your theme. Firstly, you need to understand how Login With Ajax loads templates:
When looking for files/templates there is an order of precedence – active child theme (if applicable), active parent themes, and finally the plugin folder:
Login With Ajax loads only one CSS and JS file which contains code for all templates. The plugin checks the locations above and loads the one it finds first. The default files are:
login-with-ajax.source.js, a non-minified version of the normal JS file.
Login With Ajax then checks for template folders which are loaded according to the preference highlighted above.
- When a user is logged out, the
widget_out.phpwill be used.
- If logged out, then
widget_in.phpwill be used
- If either of these files don’t exist in your template, the one located in the default folder will be used (which you can also override in your theme).
- When a user is logged out, the
If you wanted to change some text on the default theme, you could simply copy
wp-content/themes/yourtheme/plugins/login-with-ajax/default and edit the files as needed.
If you need to change the CSS file, copy the file
wp-content/plugins/login-with-ajax/widget/widget.css over to
wp-content/themes/yourtheme/plugins/login-with-ajax/widget.css and edit accordingly.
- Installation Instructions
Upload this plugin to the
/wp-content/plugins/directory and unzip it, or simply upload the zip file within your wordpress installation.
Activate the plugin through the ‘Plugins’ menu in WordPress
If you want login/logout redirections, go to Settings > Login With Ajax in the admin area and fill out the form.
Add the login with ajax widget to your sidebar, [lwa] on your pages, or use login_with_ajax() in your template.
Happy logging in!
- The registration link doesn’t show! What’s wrong?
Before you start troubleshooting, make sure your blog has registrations enabled via the admin area (Settings > General) and that your widget has the registration link box checked.
- AJAX Registrations don’t work! What’s wrong?
Firstly, you should make sure that you can register via the normal wp-admin login, if something goes wrong there the problem is not login with ajax. Please note that currently there is no AJAX registration with BuddyPress due to it rewriting the login area (this will be resolved soon).
- How can I customize the login widget?
See the notes section about customizing a widget.
- How do I use SSL with this plugin?
Yes, see the notes section.
- Do you have a shortcode or template tag?
Yes, see the notes section.
For further questions and answers (or to submit one yourself) go to our [http://netweblogic.com/forums/](support forums).
This is truly a great plugin. I use it on several sites. It works very well, and if offers exactly the features I was looking for.
Thanks a lot to the author!!
Really nice login form with ajax, works well !
Works great but make sure you don’t have other plugins that also do login functions. Can conflict.
It works fine!
And is therefore unusable
Contributors & Developers
“Login With Ajax” is open source software. The following people have contributed to this plugin.Contributors
- fixed XSS security vulnerability on LWA settings page allowing code injection if an authorized user follows a properly structured url to that page, this does not affect the security of the login forms, only the settings page. Kudos Neven Biruski from DefenceCode for responsible disclosure.
- changed our hooks logout_url and login_redirect added as actions to filters which prevented functionality in some situations
- added Persian translation, thanks to Mohammad Akbari
- fixed PHP 7 deprecated construct error
- fixed deprecated get_currentuserinfo function PHP warning
- added option to show direct links (no AJAX forms) to password recovery and registration forms
- fixed missing text domain in widget/modal/widget_out.php
- fixed server errors when deactivating BuddyPress whilst LWA is active
- fixed 4.3 password update which now sends a link for user to set password instead
- fixed login redirect issues when using shortcode and template tags
- added script localization via LWA JS parameter,
- changed JS destination url to admin-ajax.php which fixes some incompatibilities with WPML
- fixed WPML status messages not being translated upon login/registration/password-recovery
- added and updated loads of languages, see here for full list – http://translate.netweblogic.com/projects/login-with-ajax/
- added some minor label layout improvements for admin area labels/forms
- added minor widget admin settings layout improvements
- fixed MIME type errors between HTTP <> HTTPS ajax requests,
- added redirect shortcode attribute
- fixed JS/CSS file overriding problems
- fixed class html error in widget/default/widget_in.php
- fixed redirection issues when not using JS
- fixed MultiSite registrations not adding user to blog with default role only ‘subscriber’ (props to Renato Baccaro)
- fixed vulnerability where registration is still possible even if registration is disabled in settings (props to Kevin Niehage @weizenspreu)
- fixed problems when trying to log in from an http page when admin ssl is enforced
- fixed CSS to hide table borders of default widget for the twenty fourteen theme
- added Hebrew, thanks to Menachem Shapiro
- fixed HTML validation issues in widgets
- added error fallback during ajax request
- added new icons and headers for wordpress.org plugin pages
- added redirect shortcode attribute for custom redirect
- updated Russian, Swedish and POT language files
- added Afrikaans translation
- added login_form action to divs-only and modal templates,
- fixed php warning in login-with-ajax.php
- fixed custom registration email not working since 3.1
- fixed logged in ‘hi’ title not showing up and is now configurable in widget settings
- fixed graceful fallback for themes with broken JS
- added loading of source JS if WP_DEBUG is enabled
- moved reveal.js source code into source js file
- fixed shortcode php warning
- added template shortcode/template attribute
- profile_link and registration arguments are now considered true/1 by default, to avoid confusion with missing links
- added ‘remember’ argument which controls whether to show/hide password recovery link
- fixed widget settings not remembering unchecked checkboxes
- added Slovak
- removed strtolower and using CSS now in widget_in.php
- moved register_widget into own function called by widgets_init
- changed some lwa-… ids to classes in widget_in.php
- added Slovak, updated Russian languages
- updated the POT file
- fixed json_encode issue
- overhaul of JS, now leaner and meaner
- modified template structure to allow multiple login forms
- added template selection to each widget
- added title choice to widget
- removed inclusion of wp-includes/registration.php during regsitration (not needed since WP 3.1)
- added two new templates to choose in widgets
- new light-weight modal using tweaked Reveal library – http://zurb.com/playground/reveal-modal-plugin
- improved css
- improved html structures in widget templates
- added sainitization in widget templates
- fixed CSRF vulnerability in admin settings page – thanks to Charlie Eriksen via Secunia SVCRP
- moved WP Widget before/after and open/close tags out of templates and into the WP_Widget class
- LoginWithAjax class is now completely static
- added some MS fixes for registration, now works with BuddyPress
- fixed xss vulnerability for re-enlistment on wordpress repo, more on the way
- updated russian translation
- added japanese
- updated iranian
- added registration attribute to template tags/shortcode
- scrollbar issue in default widget
- added hungarian
- got rid of (hopefully all) php warnings
- Fixed unexpected #LoginWithAjax_Footer showing up at bottom
- Fixed link problems for sub-directory blogs (using bloginfo(‘wpurl’) now)
- Added Albanian
- Replace Spanish with revised version
- Option to choose from various widget templates.
- %LASTURL% now works for logins as well
- Profile link plays nice with buddypress
- Added fix to stop wp_new_user_notification conflicts
- Empty logins now have an error message too.
- Various bug fixes
- Ajax Registration Option
- Redirect bug fix
- Hopefully fixed encoding issue
- Added Polish, Turkish and Brazilian Translation
- Fixed buddypress avatar not showing when logged in
- Removed capitalization of username in logged in widget
- Fixed all other known bugs
- Added placeholders for redirects (e.g. %USERNAME% for username when logged in)
- Added seamless login, screen doesn’t refresh upon successful login.
- Changed logged in widget to fix avatar display issue for both BuddyPress and WP. (Using ID instead of email for get_avatar and changed depreciated BP function).
- Added Danish Translation
- Added Chinese Translations
- CSS compatability with themes improvement.
- Added Italian Translations
- Added space in widget after “Hi” when logged in.
- CSS compatability with themes improvement.
- Added German Translations
- Fixed JS url encoding issue
- Added Finnish, Russian and French Translations
- Made JS success message translatable
- Fixed encoding issue (e.g. # fails in passwords) in the JS