This plug-in allows site admins to make their site visible only to users who are logged in. It also provides options to make selected URIs publicly available, and to whitelist selected IPs so that they are not required to log in to view protected content.
- Install the plugin: cd wp-content/plugins && git clone https://github.com/dxw/dxw-members-only.git
- Enable the plugin
- Visit Settings > dxw Members Only
- Add URLs to the whitelist
- Add IP addresses to the whitelist or CIDR ranges (i.e.
192.168.1.1or192.168.1.1/24or2001:db8::/64) - Choose locations to redirect visitors to (usually /wp-login.php?redirect_to=%return_path%)
- Set max age for the cache-control header that will be served to any users who try to access restricted content when not logged in
To create a development build:
- Run
composer installto download dependencies
- Run
script/setup&&script/serverto spin up a local dev site, running the plugin. The site is at http://localhost, with username and password ofadmin. - If you want to allow-list your local IP address within the plugin, add
0.0.0.0/0to the IP allow list in the dxw Members Only settings page (this has the effect of allow-listing all IP addresses)
Please publish and tag new releases when they happen.
As well as the individual version tags, we also have a major version tag (currently v4) that tracks the latest release for that major version. That has to be manually updated after you've done the release on GitHub as follows:
(e.g. if you'd just published v4.5.0):
git checkout main
git fetch --tags -f
git tag -f v4 v4.5.0
git push origin -f --tags