A secure system for file access control on WordPress websites.
- WordPress-based authentication (only logged-in users can access protected files)
- Role-based access control via
$role_foldersinsecure-config.php - User-based access control via
$user_folders— map individual users by WordPress user ID to a specific folder - Files stored outside the WebRoot, served only through the PHP gatekeeper
- MIME-type whitelist with hard rejection of non-whitelisted extensions
- Per-extension Content-Security-Policy for safe inline rendering of HTML and SVG
- Persistent access log independent of
DEBUG_MODE, with anonymised IP addresses (efl_anonymize_ip()) - Default-deny
.htaccessfallback whenmod_rewriteis unavailable
-
Download the latest version:
-
Extract
protected.zipto your WordPress installation root directory -
Extract
secure-files.zipoutside your WordPress installation root directory -
Configure permissions as described in the documentation
- Log in to WordPress as a
subscriber. - Visit
https://your-domain/protected/group-1/example-1.pdf→ file should render. - Visit
https://your-domain/protected/group-2/example-2.pdf→ response should be403 Forbidden. - Check
secure-files/logs/access.logand confirm both anALLOW 200and aDENY 403line are present.
- Technical Documentation
- Configuration Guide
- Installation Guide
- Security Policy
- Changelog
- Troubleshooting
See CONTRIBUTING.md for guidelines on reporting issues and submitting pull requests. For security vulnerabilities, see SECURITY.md — do not file public issues.
This project is licensed under the MIT License - see the license file for details.