Forum Replies Created
-
AuthorPosts
-
RobL
ParticipantI guess we’ll call it “resolved”. In about an hour, I replaced Simple Membership with S2Member on my five sites and now I have exactly what I need with no fundamental flaws such as wp-admin and the membership pages getting confused with each other.
RobL
ParticipantPing.
RobL
ParticipantAny update on this?
RobL
ParticipantOK, thanks. Just to be clear, the problem is rather simple and easily reproducible. If I attempt to login to /wp-admin/ with a user who is both a WP User (administrator in this case) and SWPM member, the user is redirected by the SWPM redirection code.
RobL
ParticipantAfter yet further debugging, I realized that there was a flaw in my belief that one environment worked while the other didn’t. The difference is that on the one environment I was logging in to /wp-admin as a WP user who is NOT an SWPM member, thus swpm_after_login hook isn’t called (for reasons I’m not yet clear on) and thus there is no problem. If on the same environment I login as a user who IS an SWPM member, the same bad issue happens.
Unfortunately, that still leaves me unclear as to how to resolve this issue. I find it hard to believe that I’m the only SPWM consumer to have tried to login to /wp-admin/ as a user who is also an SWPM user.
RobL
ParticipantI did more debugging and it’s becoming more clear there’s something odd going on here. It would be nice if someone could comment on my situation. I turned on the SWPM debugging for an environment that has no problem and one that does and then I logged into /wp-admin. The log file content is dramatically different.
Problem environment
——————-
[10/20/2019 2:43 PM] – SUCCESS: wp_authenticate action. Empty username provided. Adding set_current_username hook to catch potential login attempt.
[10/20/2019 2:43 PM] – SUCCESS: wp_authenticate action. Handling login for username: webmaster
[10/20/2019 2:43 PM] – SUCCESS: SwpmAuth::login()
[10/20/2019 2:43 PM] – SUCCESS: Authentication request – Username: webmaster
[10/20/2019 2:43 PM] – SUCCESS: Authentication successful for username: webmaster. Executing swpm_login action hook.
[10/20/2019 2:43 PM] – SUCCESS: Trying wp_signon() with username: webmaster
[10/20/2019 2:43 PM] – SUCCESS: wp_authenticate action. User with username: webmaster is already logged in.
[10/20/2019 2:43 PM] – SUCCESS: wp_login hook triggered. Username: webmaster
[10/20/2019 2:43 PM] – SUCCESS: Setting current WP user to: webmaster
[10/20/2019 2:43 PM] – SUCCESS: Triggering swpm_after_login hook.No problem environment
———————-
[10/20/2019 2:45 PM] – SUCCESS: wp_authenticate action. Handling login for username: [user.name]
[10/20/2019 2:45 PM] – SUCCESS: SwpmAuth::login()
[10/20/2019 2:45 PM] – SUCCESS: Authentication request – Username: user.name
[10/20/2019 2:45 PM] – SUCCESS: wp_login hook triggered. Username: user.nameThe comment in the code that throws the “Empty username provided” text to the log file, says, “empty username can mean some plugin trying to login WP user using its own methods.” So I performed a test on the problem environment. I deactivated every single plugin, except the three Simple Membership plugins (main, after login and custom messages) and when I logged in to /wp-admin the problem still happens!
I went another step further. I hardcoded the username and password in the SWPM code to see if that would work. Unfortunately, even though the log is different the same problem exists. You’ll note that it still is saying “Executing swpm_login action hook.”
[10/20/2019 3:17 PM] – SUCCESS: wp_authenticate action. Handling login for username: webmaster
[10/20/2019 3:17 PM] – SUCCESS: SwpmAuth::login()
[10/20/2019 3:17 PM] – SUCCESS: Authentication request – Username: webmaster
[10/20/2019 3:17 PM] – SUCCESS: Authentication successful for username: webmaster. Executing swpm_login action hook.
[10/20/2019 3:17 PM] – SUCCESS: Trying wp_signon() with username: webmaster
[10/20/2019 3:17 PM] – SUCCESS: wp_authenticate action. User with username: webmaster is already logged in.
[10/20/2019 3:17 PM] – SUCCESS: wp_login hook triggered. Username: webmaster
[10/20/2019 3:17 PM] – SUCCESS: Setting current WP user to: webmaster
[10/20/2019 3:17 PM] – SUCCESS: Triggering swpm_after_login hook.Please tell me what do at this point.
Regards,
RobRobL
ParticipantHi again,
I just noticed something else related to this issue.
On site #1 that has this problem, when the admin attempts to login to /wp-admin/ he is redirected to the home page.
On site #2 that has this problem, when the admin attempts to login to /wp-admin/ he is redirected to a page that’s protected by Simple Membership (yes, really).What I noticed is that for site #2, that page is the value I have set for “After Login Redirection Page” in the Simple Membership settings. For site #1, that value is blank. And to be clear, for site #2 (and site #1) I have the Enable Redirect to Last Page turned on, so, in theory, that value in “After Login Redirection Page” should be ignored anyway.
More info…more crazy stuff.
Regards,
RobRobL
ParticipantHi,
Actually, I do understand what the login redirect is supposed to do and that’s why I’m completely puzzled as to what’s happening.
If someone goes to a page protected by Simple Membership, he is asked to login via the Simple Membership login and when he enters the proper credentials he is directed to the page he tried to access. So that is expected and correct.
However, on two sites now, Simple Membership is somehow affecting the “regular” login of someone accessing /wp-admin after the user is redirected to the wp-login URL. Additionally, I just noted that when a wp-admin user logs out, he is redirected NOT to the /wp-admin/?loggedout=true URL, rather he is redirected to the home page.
And, to repeat, if I deactivate Simple Membership only, the act of logging in to wp-admin pages word as expected. So, regardless of whether or not I’ve done something horrible (on multiple sites), the two issues are related.
I know you’re thinking to yourself that it’s not possible, but it’s really happening.
Regards,
RobRobL
ParticipantHi,
Sorry for the long delay. I tried deleting the plugin and reinstalling and the behavior is still the same. And now, as an added bonus, it’s happening on two of my websites.
Issue summary (since it’s been a while)
—————————————
With Simple WP Membership installed, if I try to access <mydomain>/wp-admin/ the FIRST time, the user is instead, redirected to <mydomain> (home page). If I then go to the location bar, put /wp-admin on the end of it and hit enter, the user is correctly directed to the WP admin dashboard.Relevant Facts
————–
1. I have the “Simple Membership After Login Redirection” plugin installed. And it is set up for ”
Enable Redirect to Last Page”.
2. If I disable only the Simple Membership plugin, the problem doesn’t occurThings tried
————
Everything above that you suggestedI’m asking at this point to simply direct me to the code that could or does redirect user logins so I can debug it.
Regards,
RobRobL
ParticipantHi,
I figured it out. My server’s email routing was set to Local Mail Exchanger instead of Remote Mail Exchanger. The addition of >: is an odd way to show it, but at least I figured it out.
Regards,
RobRobL
ParticipantHi,
Unfortunately it didn’t specifically help, however, it did inspire to look at the email delivery tracking in my host cPanel. I’m hoping you can explain why, when the recipient is in my domain, e.g., john@xyz.org, the recipient email address is shown in the delivery tracker as “john@xyz.org>:” with the greater than sign and the colon (and the result of “Unrouteable address”). For all other recipients with a different domain the greater than sign and colon are not there, thus the email is sent correctly.
Regards,
RobRobL
ParticipantHi,
OK, I’ll try that some time this week and get back to you.
Regards,
RobRobL
ParticipantHi,
To create a user & Simple Membership member I’ve used the following methods:
A. Using Simple Membership WP User Import to import a current WordPress user
and
B. Creating a user directly in Simple Membership Add Member featureThe last example of creating the new WP user that I mentioned, I created the user in WP’s Users are and then used the Simple Membership WP User Import.
Another bit of data – I checked some other sites I work with and have Simple Membership installed and the issue does not exist.
I’m as sure as I can be at this point that something in WP_USERS, WP_USERMETA or WP_OPTIONS got “corrupted”, though I’m not sure what to look for.
Regards,
RobRobL
ParticipantHi,
I was trying (and obviously failing 🙂 ) to be clear that I’d tried all those tests previously. The only way to make the issue go away is to deactivate the main Simple Membership plugin.
I do, however, have an important bit of information I didn’t mention previously. This issue only happens with users who are both WP users and Simple Membership members. I created a new WP user with editing privileges (Editor) and that user can login to /wp-admin with no issues. The instant I add that user to Simple Membership, the redirect issue occurs.
I’m a well-seasoned software guy and am happy to debug if you point me in the right direction.
Regards,
RobRobL
ParticipantHi,
I guess I have to say shame on me for reading the documentation and interpreting it differently. If I follow the steps exactly as written, it works correctly (go figure 🙂 ). I would like to say, with all due respect, that the UI process should be such that instructions aren’t needed, i.e., the bulk protect process is not intuitive.
Thanks for the help.
– Rob -
AuthorPosts