Is this plugin abandoned? Wordfence seems to think so.
]]>If the user closes the browser or walks away for a few hours, will the password time-out? How can I ensure it does so after 24 hours?
]]>No Custom Posts.
It’s been over a year now.
Updating the parent page removes the password protection for the child pages.
After updating the plugin and updating WordPress, it is fixed in the local environment but not in the production environment.
We are using AWS, is there a problem with the configuration?
Anyone else using AWS?
I need help.
===================
WordPres Ver.6.0.2
Plugin Ver 1.4.0
===================
Hi!
It is a very useful feature and I would love to use it, but when I set the password on the parent page, check the checkbox and save, it reverts to normal password protection and the child pages remain public. I have custom post types with hierarchy turned on and have tried updating to wordpress versions 5.4.10 and 6.0.1, but the same situation. We hope you can help us with this issue.
]]>Hi, Our custom post types are no longer working with the child page password protection (since version 1.4) – it just protects the parent page, even when you tick “protect child pages” and the “protect child pages” checkbox doesnt show when you have password protection enabled, it only shows if you click back to “public” and the “password” again. We have downgraded to version 1.2.3 and this fixes the issue. Can you let me know if this is a bug your are going to have fixed? and when it has been fixed so we can upgrade the plugin again?
]]>Hi,
The current version of the plugin has a bug in the ProtectTheChildren_Helpers::isEnabled() function that causes the code to target the wrong post object when certain conditions are met.
The error is most visible under these conditions:
This is caused because the plugin checks the new pages ancestors and does not find a password protected ancestor among them.
Tracking this error back, it appears to be because a conditional statement is allowed to fall through in the isEnabled function mentioned earlier.
In that function the passed $post argument is handled differently if an array of post IDs is passed, i.e. the return value from get_post_ancestors(). However, if that check fails to find a password protected ancestor, the foreach loop never returns a value and therefore the code falls through to the second if statement (line 39) that cannot handle being passed an array.
There are 2 possible fixes for this issue.
You can either add a ‘return false;’ after the foreach loop finishes, or use an elseif on line 39 to ensure it is only executed for non-array arguments.
I’ve prepared a patch (I hope correctly!) adding the ‘return false;’ line which can be seen here:
Patch ataylor-isEnabled
Thanks,
Adam
I’ve been using the plugin successfully for a while now but today I noticed that the toggle was off so I clicked it on and tried to save the page but I got this error:
Updating failed. Sorry, you are not allowed to edit the protect_children custom field.
Any help is greatly appreciated! =-)
]]>Hi,
Thanks for the great plugin.
I have just noticed an issue and was hoping you may be able to shed some light on it… When enabling the Block Editor on a Custom Post Type and pressing update (simply publishing a standard page, no password) I get this error:
The editor has encountered an unexpected error.
Attempt Recovery
Copy Post Text
Copy Error
The copy error option gives:
Error: An error occurred while running 'mapSelect': Cannot read property 'protect_children' of undefined
The error may be correlated with this previous error:
TypeError: Cannot read property 'protect_children' of undefined
at https://example.local/wp-content/plugins/protect-the-children/build/index.js?ver=5.7.1:1:958
at Object.current (https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:31396)
at https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:30908
at s (https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:25154)
at Object.__experimentalMarkListeningStores (https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:25561)
at https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:30208
at e (https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:30885)
at t (https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:31063)
at https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:22102
at p (https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:11569)
Original stack trace:
at Ge (https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:30611)
at https://example.local/wp-includes/js/dist/data.min.js?ver=943087ae96d075f126df689839bb96b9:2:31371
at we (https://example.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.13.1:84:293)
at He (https://example.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.13.1:97:464)
at zj (https://example.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.13.1:228:406)
at Th (https://example.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.13.1:152:223)
at tj (https://example.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.13.1:152:152)
at Te (https://example.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.13.1:146:151)
at https://example.local/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.13.1:61:68
at unstable_runWithPriority (https://example.local/wp-includes/js/dist/vendor/react.min.js?ver=16.13.1:25:260)
I also see this in the browser console when a CPT post page loads:
data.min.js?ver=943087ae96d075f126df689839bb96b9:2
An error occurred while running 'mapSelect': Cannot read property 'protect_children' of undefined
It seems to be related to the plugin. Any ideas?
Thanks so much
Update:
I also see this error when editing a Reusable block in WP admin. Perhaps the plugin needs updating to ignore CPTs and Reusable blocks?
Plugin seems to break footer, once signed in all okay, just the login page
]]>Hi,
first of all thank you for making this nice and simple plugin.
I have the following issue:
If I directly visit a child site (e.g. /internal/events) and enter the correct password, I am redirected to the homepage ( / ). Afterwards the site is unlocked and I can visit it without problems. When I do this on the parent page (/internal) I am not redirected to the homepage.
Is this a known problem or maybe I’m doing something wrong?
Thanks for the help in advance
Best
Bannix
Your ‘Protect the Children!’ plugin is working great for us. However, it does not show an “invalid password” message when an incorrect password is entered. It simply clears the password entry box.
Is there some PHP code we can add to the create an ‘invalid password’ error message, or is there a way to do this within the plugin. If not, adding a password error message option would be a great way to make a good plugin even better.
Thanks,
Christie
I have a parent page in WordPress 5.5.3 that has several children pages protected with this plugin. When I update the parent page, I am noticing that the toggle to protect these children pages toggles to off and I need to manually toggle it back to on each time and re-save. Any idea what might be happening?
]]>Hi, I think, that you should do like this via post_password_required.
add_action( 'template_redirect', 'test_template_redirect', 10 );
function test_template_redirect() {
$post_id = get_the_ID();
$parent_ids = get_post_ancestors( $post_id );
if ( ! $parent_ids || empty( $parent_ids ) ) {
return;
}
ksort( $parent_ids );
foreach ( $parent_ids as $parent_id ) {
// better would be detect parent of post and redirect, but for my personal purpouse I need to redirect to top parent post.
if ( post_password_required( $parent_id ) ) {
wp_redirect( get_the_permalink( $parent_ids[0] ) );
exit();
}
}
};
]]>
Hello!
I have a landing page that is password protected and this page has a child page I’m developing to test this Plugin. I’ve ticked the ‘Password Protect all children’ checkbox on the parent page and have left the child page as the default ‘Public’ visibility.
The password box appears on the parent page, but I am able to navigate to the child page directly without first entering the password on the parent page. When I view my pages the parent page is correctly marked “Password protected” but the child page is not. It is Public. According to the documentation the child page is supposed to show this status – “Password protected by parent.”
Did I miss a setting? I am running WP 5.5. Thank you.
]]>Notice: Trying to get property ‘ID’ of non-object in /Users/jonnynoble/Sites/mft-odn/web/wp-content/plugins/protect-the-children/_inc/helpers.php on line 57
Which is stopping elements in the head section from being executed.
]]>Hello,
Nice plugin, thank you very much for your time!
I’m wondering if you plan in the future to support Custom Post Types. I’m using them for portfolio items, and I would like to protect them besides some pages, without the need for the visitor to enter the password several times.
For setting the portfolio I use this plugin: https://www.ads-software.com/plugins/portfolio-post-type/
I am not sure if making the portfolio items being the child of a protected page will do the trick, as it is explained here:
https://stackoverflow.com/questions/53564205/make-custom-post-type-child-of-page
or vice-versa:
https://wordpress.stackexchange.com/questions/81711/can-a-custom-post-type-have-a-parent-page/81715
Who knows, maybe a slight change in the way the Custom Post Type is defined can password-protect portfolio items.
Looking forward to your thoughts. Thank you for reading.
]]>A notice is thrown on the top of the page…
Notice: Undefined index: wp-postpass_4a5ad001f6dce197cb93782aa9259f50 in /home/rithos/chemonline.info/wp-content/plugins/protect-the-children/index.php on line 57
not sure what I did wrong or is it a cookie problem.
Ritchie
]]>Is there a way to check if protect the children’s user is logged in? I’d like to only show a link to the protected content if the user is logged in. WordPress
if ( is_user_logged_in() ) {
echo '<a href="">Some Link</a>';
}
doesn’t seem to work.
]]>Hi,
nice plugin! How can I remove the “Chráněno:” before page title?
I mean this -> THERE
]]>hi,
i use elementor with Hello theme, when i load my child page password protected , it load without header and footer, only content page.
thanks for help
When I try to activate the plugin I receive the following error:
The plugin does not have a valid header.
What can I do about this? Thanks!
]]>We have logged a new GitHub issue here:
https://github.com/Miller-Media/protect-the-children/issues/6
Any help from the community would be great in the event you can get to it before us. Thanks!
]]>This looks like just the plugin to help satisfy a need we have on a multisite installation. However, we have updated to WP5.0.3, we are using the block editor (Gutenberg), and the checkbox is not available to enable this tool on children of the password-protected page/post.
Are there plans to find a working model for this plugin in Gutenberg?
Thank you!
]]>Great with the quick update! Though I’m having some issues with this update. First time I visit a protected child page after entering the password, I get the password form once again. Though I can just click the submit button to make it go away, and then I can browse all the protected children. When going back to the previous version, this does not occur.
Any fix for this?
]]>This plugin seem to work as intended for direct children of a password protected page, but grandchild pages are still accessible without password. Is this intended? I want all levels below a password protected page to be password protected.
]]>Correct password is testpassword but when I try to add invalid or correct pass it redirects me to blank page with wp-login.php?action=postpass.
One more thing here.. Is there a way to protect the page global as now it shows some buttons and video there. They are not added inside the content but with advanced custom fields before the loop ?
Thanks !
]]>Hi,
Just checking how this is supposed to work. I have a native WP Page that has some children pages. I’ve ticked the ‘Password Protect All Child Posts’ checkbox on that parent page and have left all the children pages as the default ‘Public’ visibility.
The password box appears on the parent page, but when I click through to a link to a child page then the password box appears again on that page, and it won’t accept the password of the parent page. I can see that it has the wp-postpass_xxxxxx cookie that is set once the user has inputted the correct password.
I had assumed that once a user has correctly inputted the password on the child page, it won’t then ask for the password again for each of the child pages?
Tested on the latest version of WP (4.9.4) with all other plugins deactivated and on the default twentyseventeen theme.
Thanks,
Ben
I’m sad.
I got the error when I activated the plugin.
The Error was:
Fatal error: Can’t use function return value in write context in /home/xxxx/xxxxxxx/wp-content/plugins/protect-the-children/index.php on line 84
I found out This plugin !! But,I’m sad.
I am using the wordpress 4.8.2-ja.
Please Help me.
Thank you.
]]>