New answers tagged

0

I know it's late, but I am posting the solution so that it can help someone in need at the moment. This is what I am doing and it is working perfectly. function redirect_user_tologin(){ global $post; $post_slug = $post->post_name; if(!is_user_logged_in()){ if($post_slug == 'my-account') { //can add multiple conditions //create ...


0

If the request is not authenticated by the time it enters init you can run your authentication logic if you wish. If you want to be mindful of other plugins, you could run on init with a priority of 0 as an example (or a negative value). Plugins (may) hook onto init at the default priority or a priority above the default and or another hook. You won't ...


2

So, we figured out what it was. In the options table (wp_options for some, we chose to do away with the wp prefix), there's a user_roles (or wp_user_roles value). One of the plugins we used (Yoast SEO in this case) had an update that zapped the value of that option, removing the Administrator role from that list. As a result, no admin could log into the ...


1

The correct answer is to use SSL. However, you could use javascript to encrypt the password somehow before sending it to the server, but this isn't going to offer much more protection because anyone looking at the data could just as easily unencrypt the password. Here's more on that: https://stackoverflow.com/questions/12291495/how-to-encrypt-form-data. ...


-1

There are several ways to achieve what you are looking for, but I am going to cover two in this answer: WordPress, No Custom Coding (via Multisite) A WordPress multisite gives you the ability to have two separate websites utilizing the same WordPress installation. You can set up your main domain (example.com) as the main multisite domain. Then, create a ...


2

You can add the static form code to your main site's code (your domain in this case is example.com and your subdomain is sub.example.com): <form name="loginform" id="loginform" action="https://sub.example.com/wp-login.php" method="post"> <p> <label for="user_login">Username or Email Address</label> ...


0

I can't comment on the answer of @Rarst so I will answer here. You have to make sure that you do not have this line define('FORCE_SSL_ADMIN', true); in your wp-config.php file as this will also cause this behaviour in addition to the changes that has to be made in the wp-options table if your site url is set to https.


0

I am speculating here after reviewing your logic/comments above, yet let's try as follows Possible issue: During login, although you are setting the auth cookie, you are not setting the current user and this is potentially the cause of the break-down upon logout due to is_user_logged_in returning a false-positive/negative result. Possible resolution: In ...


0

wp_authenticate() just checks user data, but not actually authenticating - docs. You can use wp_signon, which uses and wp_authenticate: source, like this: $credentials = [ 'user_login' => $name, 'user_password' => $password, 'rememberme' => true, ]; $signon = wp_signon($credentials, true); // true - use HTTP ...


1

Answers in comments here solved this one for me: Clear cookies for the site in your browser.


0

For a plugin, definitely consider Login No Captcha reCAPTCHA by Robert Peake. If you're looking to roll something into your theme without introducing another plugin to the mix, Megan at Megabyte created an article. <?php /** * These Functions Add and Verify the Invisible Google reCAPTCHA on Login */ add_action('login_enqueue_scripts', '...


0

You can except to go to that logout page. Only you need to change your logout link in your frontend. <a href="<?php echo wp_logout_url()?>">logout</a> this code, make the logout without confirmation window. But also if you really need a confirmation, you can create a "new page" named "confirmation" now, in your frontend the logout can ...


0

Happy new year. Here is plugin for this : https://wordpress.org/plugins/login-recaptcha/ Please check. i am sure you can get your requirements are fulfill.


Top 50 recent answers are included