uhm-coe / authorizer

Authorizer is a WordPress plugin that uses Google, CAS, LDAP, or an OAuth2 provider for logins, and can prevent public access to a WordPress site. It also blocks repeated failed login attempts.
GNU General Public License v3.0
65 stars 38 forks source link

Is is possible to remove Internal content from search #128

Closed ramrajone closed 1 year ago

ramrajone commented 1 year ago

I am testing the authorizer plugin to create a site with Internal and Public content, which works well Just one small issue is WordPress's built-in search shows an excerpt of Internal content in search results, once you click on it, it makes you sign in.

I did not see any settings to void that or maybe I am missing something let me know if it's possible Thanks

figureone commented 1 year ago

Good catch! We'll look into whether we can hook into site searches and exclude any pages listed as Private in Authorizer if the user is anonymous. Might want to also verify they don't appear in the REST API also.

ramrajone commented 1 year ago

Another thing I noticed was, the categories level top making public does not make sub-categories public or vis versa, not sure if this was by design or another bug, the same thing with tags Thank you for making a great plugin, it's very simple to set up and use for sure.

figureone commented 1 year ago

Aloha, we added code to only show public pages in search results and archive pages if that setting is enabled: https://github.com/uhm-coe/authorizer/commit/0b3302bee949bcf780d58c531b7ea6398ae2ac19

Re: sub-categories, yes we intentionally didn't include sub-categories if a parent category was marked public, just to err on the side of caution ("private-by-default"). You can explicitly add all the sub-categories to the public list if needed. Let us know if there's an edge case that makes that process difficult, though.

This will be included in the next release, but you can check out this repo into your wp-content/plugins folder if you want to test it out before then!

figureone commented 1 year ago

Aloha, version 3.6.3 has been released with this fix. Thanks!