Actually, your issue is not an infinite loop–because the redirect ends on the login screen when you try to “visit site.” An infinite loop would be if you tried to visit the frontend and then you’re redirected to the login screen, which then redirects you back to the frontend, which then redirects you to the login screen again… over and over; never ending.
Instead, it sounds like when you try to view the frontend of the site, it doesn’t recognize you’re already logged in and thus my plugin does its job and redirects you to the login page.
You said you’re able to view the profile page after logging in; does this mean you’re able to view all the other admin area pages as well? Like the Dashboard or Pages…etc?Obviously depending on the user level you’re logging in as, what’s available to view may differ.
Since you’re able to view the admin area, it sounds like the issue is caused only when trying to view the frontend of your site. This makes me think that some code that runs on the frontend is causing the redirect to continue.
I understand you tried my advice to determine if the plugin works with a pre-installed WordPress theme. Are there other plugins installed? Did you activate any other plugins? And did you try activating one at a time and testing to see if a particular plugin is causing the site to continue redirecting?
Based on what you described, I don’t believe the issue is with my plugin but rather something else is causing the frontend of your site to think you’re not logged in and thus my plugin does the redirect as expected.