wpexpertsio / password-protected

Password protect your WordPress site quickly and simply
https://wordpress.org/plugins/password-protected/
69 stars 63 forks source link

Plugin will not work #164

Closed nick907 closed 4 years ago

nick907 commented 4 years ago

I have 8 sites using this plugin. All same hosting plan. No caching plugins. The plugin works on 6 sites. The last 2 sites are the newest. I took one site and deactivated every plugin and re-installed wordpress and it will still not work. Password protected is the only active plugin. All sites using latest wordpress V 5.4.1

By not work I mean you visit the site, the plugin is active and asks for the password. You type in the password, browser spins for a bit and then the page is just refreshed asking for the password again.

I tried long passwords and short. Current password is 1234. Cant gain access.

If I switch to the "Hide my site" plugin it works fine it just doesn't look as nice or integrate with login logo.

What can I try at this point? Why is it working on the other sites and not these?

nick907 commented 4 years ago

From my host: According to our check, the cookie file is not being generated

benhuson commented 4 years ago

Hi Nick,

Please download this version of the plugin to which I have added a debugging feature: https://github.com/benhuson/password-protected/archive/feature/debugging.zip

Install that and:

  1. Go to the Password Protected Settings and check the "Enable Debugging" checkbox.
  2. Go to the frontend and recreate the issue with the password not working.
  3. Go back to the Password Protected Settings page and at the bottom there should be a log of what happened.
  4. Copy the log and email it to me so I can see if its gives any clues.

Disabling the "Enable Debugging" checkbox will clear the log. Just keep if on while testing it - don't leave it on as it will keep generating a long log!

Thanks

benhuson commented 4 years ago

The issue may also be fixed by the change #166 if you would like to try it.

benhuson commented 4 years ago

Just found another older issue where a user found that NameCheap didn't like the test cookie that is set. Please see link below how you can edit the password-protected-login.php file in the plugin to see if this helps with your issue.

https://wordpress.org/support/topic/password-protected-plug-in-408-request-time-out/

nick907 commented 4 years ago

Hi Ben,

Thanks fro doing that. Here is the log and also a snapshot


Start validating cookie. Auth cookie malformed.

Start validating cookie. Auth cookie malformed.

Start validating cookie. Auth cookie malformed.

[image: image.png]

On Fri, May 15, 2020 at 5:52 PM Ben Huson notifications@github.com wrote:

Hi Nick,

Please download this version of the plugin to which I have added a debugging feature:

https://github.com/benhuson/password-protected/archive/feature/debugging.zip

Install that and:

  1. Go to the Password Protected Settings and check the "Enable Debugging" checkbox.
  2. Go to the frontend and recreate the issue with the password not working.
  3. Go back to the Password Protected Settings page and at the bottom there should be a log of what happened.
  4. Copy the log and email it to me so I can see if its gives any clues.

Disabling the "Enable Debugging" checkbox will clear the log. Just keep if on while testing it - don't leave it on as it will keep generating a long log!

Thanks

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/benhuson/password-protected/issues/164#issuecomment-629512264, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANMJVBV4FBIH3VZOY5OG75LRRW2RLANCNFSM4NA2YESQ .

nick907 commented 4 years ago

This namecheap solution below worked!! Debugging log was empty.

file location: wp-content/plugins/password-protected/theme/password-protected-login.php line number: 115 change this: to this:

For me it was line 132

The only baffling thing left is how the 6 other sites on the same namecheap plan work. I think the reason is related to their origin. The 6 working sites were built a while ago at Go Daddy and migrated to Namecheap. The 2 sites that werent working were new and built on Namecheap.

Either way thanks for your help in solving this.

benhuson commented 4 years ago

Great, I’ll make sure the fix is included in the next release!

Thank you for helping to test

Ben

benhuson commented 4 years ago

Hi @nick907

Just one more test if you could....?

In the wp-content/plugins/password-protected/theme/password-protected-login.php file, where you changed the value of "testcookie" to "testcookie_fix" around line 132, please could you try changing it to "password_protected_cookie_test".

Then also in the same file around line 52 there is another instance of "testcookie" - please could you also change that to "password_protected_cookie_test".

The test in line 52 should check if your browser supports cookies OK, and just changing the one instance of "testcookie" further down in the page breaks this check. I'm keen to see if it is the cookie test that is broken, or whether it is just the name "testcookie" that is causing an issue.

Thanks

Ben

benhuson commented 4 years ago

I have found support threads for other plugin expanding on the Namecheap cookie issue. It would seem they block all requests that contain a "testcookie" POST parameter, so changing to anything else should work. Will be change to "password_protected_cookie_test" in the next release of the plugin.