plugin-icon

CFB Must Login

제작자: Code For Broke·
Require users to log in before viewing your site with easy admin toggle controls. Includes REST API protection and automatic cache clearing.
버전
1.0.0
최근 업데이트일
Dec 31, 2025

Must Login is a lightweight, user-friendly plugin that allows you to require login for your entire site with just one click. Perfect for membership sites, private blogs, intranets, or any site that needs to restrict access to registered users only.

Features

  • One-Click Toggle – Enable or disable login requirement instantly from the admin bar
  • REST API Protection – Configurable authentication requirement for REST API endpoints
  • Automatic Cache Clearing – Automatically clears popular caching plugins when toggling protection
  • Admin Bar Status Indicator – Always see at a glance whether login is required
  • Simple Settings Page – Easy-to-use settings interface
  • Admin Override – Administrators always have access, even when login is required
  • Smart Redirects – Users are redirected to login and then back to their intended page
  • Selective Endpoint Access – Allow specific REST API endpoints for forms and authentication
  • Cache Compatibility – Works with WP Super Cache, W3 Total Cache, WP Rocket, and more
  • No Configuration Needed – Works perfectly out of the box
  • Lightweight – Minimal impact on site performance
  • Translation Ready – Fully internationalized and ready for translation

How It Works

  1. Install and activate the plugin
  2. Click the lock icon in the admin bar to toggle login requirement
  3. That’s it! Your site is now protected

When enabled, all visitors must log in to view any page on your site. Administrators can quickly toggle this on or off from anywhere on the site using the admin bar.

Developer Documentation

Filters

cfb_must_login_redirect_url – Customize the login redirect URL

add_filter('cfb_must_login_redirect_url', function($redirect_url, $redirect_to) { return 'https://example.com/custom-login'; }, 10, 2);

cfb_must_login_allowed_rest_routes – Allow additional REST API endpoints

add_filter('cfb_must_login_allowed_rest_routes', function($routes) { $routes[] = '/my-plugin/v1/public'; return $routes; });

Actions

cfb_must_login_clear_cache – Triggered when cache is cleared

add_action('cfb_must_login_clear_cache', function() { // Custom cache clearing logic });

Capabilities

The plugin uses the cfb_must_login_manage capability, which is mapped to manage_options by default. You can customize this using the map_meta_cap filter.

무료유료 요금제에서
설치하면 WordPress.com 서비스 약관서드파티 플러그인 약관에 동의하게 됩니다.
테스트된 버전
WordPress 6.9.6
이 플러그인은 다운로드할 수 있으며 에서 사용할 수 있습니다.