Bug #20661
closedPassword Protected Plugin
0%
Description
Hi everyone,
The Password Protected plugin doesn't seem to be working. I use it on the BMCC OpenLab a lot, but when I activate it on this Commons site https://textbasedtasks.commons.gc.cuny.edu/wp-admin/plugins.php, I'm taken to a screen that gives me the option to Allow & Continue or Skip, but no matter which option I choose, going to dashboard > password protected or dashboard > settings > password protected takes me nowhere, so I'm not able to set the password.
This isn't urgent for us to use, but I wanted to report it in case others are having the same issue.
Thanks!
Files
Updated by Boone Gorges 4 months ago
- Assignee set to Raymond Hoh
Hi Syelle - I'm able to reproduce this, both on the Commons and in a local environment. The plugin uses the popular Freemius library for upsells. I tried to figure out why the skip is not working, but I couldn't. Ray, I recall #18434, and while this is a different type of problem, I wonder whether you think it might be appropriate to simply disable Freemius here as we did there.
Updated by Raymond Hoh 4 months ago
It looks like it is possible to reuse the same logic that we did for the tablepress
plugin with password-protected
. I've just done so in https://github.com/cuny-academic-commons/cac/commit/ac63d2dc03b48e95d8db4ade2c45e716242889b1 .
Boone, there are still a bunch of upsell items left over in the interface though. Here's some code I've written that will remove it:
// Dummy Password Protected Pro class.
add_action(
'init',
function() {
if ( ! class_exists( 'Password_Protected_Pro' ) ) {
class Password_Protected_Pro {}
}
},
9
);
// Dummy Login Designer class.
add_action(
'admin_init',
function() {
if ( ! class_exists( 'Login_designer' ) ) {
class Login_designer {}
}
}
);
// Remove some admin tabs.
add_filter(
'password_protected_setting_tabs',
function( $retval ) {
// Remove Multiple Passwords and Content Protection as they're Pro-only.
unset( $retval['manage_passwords'], $retval['content-protection'] );
// Set free-only sub-tabs.
$retval['advanced']['sub-tabs'] = [
'password-protected-page-description' => [
'title' => __( 'Protected Page Content', 'password-protected' ),
'slug' => 'password-protected-page-description',
],
];
$retval['security']['sub-tabs'] = [
'google-recaptcha' => [
'title' => __( 'Google ReCaptcha', 'password-protected' ),
'slug' => 'google-recaptcha',
],
];
$retval['logs']['sub-tabs'] = [
'activity-report' => [
'title' => __( 'Activity Report', 'password-protected' ),
'slug' => 'activity-report',
],
];
return $retval;
}
);
The iffy parts are the dummy Password_Protected_Pro
and Login_designer
classes. We can remove these snippets if we don't want to do this. It will just leave a bit of upsell cruft in the admin area. Let me know what you think once you've had a chance to test.
Updated by Boone Gorges 4 months ago
- Status changed from New to Staged for Production Release
- Target version set to 2.4.4
Thanks, Ray! I've tested this and it looks good to me. Syelle, this'll be part of our next maintenance release.
Updated by Boone Gorges 3 months ago
- Status changed from Staged for Production Release to Resolved
Updated by Syelle Graves 3 months ago
Boone and Ray, I just tested this and it's working beautifully! And perfect timing for a required report we need it for. Thank you!