Hotfix:
1. Open password-protected.php in your plugins/password-protected/ folder.
2. Look at the end of the file around line 800
3. There is a function called “only_allow_logged_in_rest_access”, this function needs a modification
4. Look at the if-condition:
if ( ! $this->is_user_logged_in() && ! is_user_logged_in() && ! (bool) get_option( 'password_protected_rest' ) ) {
return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'password-protected' ), array( 'status' => rest_authorization_required_code() ) );
}
Replace it with:
if ( (bool) get_option('password_protected_status') && ! $this->is_user_logged_in() && ! is_user_logged_in() && ! (bool) get_option( 'password_protected_rest' ) ) {
return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'password-protected' ), array( 'status' => rest_authorization_required_code() ) );
}
Done!
Explaination:
The rest api will be blocked always if the user isn’t logged in and the option to allow rest is not checked. Now, with the hotfix, the status checkbox to activate the plugin on the password protected option page needs also to be checked to block the api.