{"id":266322,"date":"2025-12-31T18:50:31","date_gmt":"2025-12-31T18:50:31","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/must-login\/"},"modified":"2025-12-31T18:50:14","modified_gmt":"2025-12-31T18:50:14","slug":"cfb-must-login","status":"publish","type":"plugin","link":"https:\/\/ne.wordpress.org\/plugins\/cfb-must-login\/","author":23189792,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0","stable_tag":"trunk","tested":"6.9.4","requires":"5.0","requires_php":"7.4","requires_plugins":null,"header_name":"CFB Must Login","header_author":"Code For Broke, Inc.","header_description":"Require users to log in before viewing your site with easy admin toggle controls","assets_banners_color":"","last_updated":"2025-12-31 18:50:14","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/codeforbroke\/must-login","header_author_uri":"https:\/\/codeforbroke.com","rating":0,"author_block_rating":0,"active_installs":0,"downloads":145,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.0.0":"<p>Initial release with full login protection, REST API security, and automatic cache clearing.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3430247,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3430247,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":3430247,"resolution":false,"location":"assets","locale":false}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":{"1":"Admin bar toggle with status indicator","2":"Simple settings page with REST API protection option","3":"Cache notice when caching plugins are detected"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[602,1919,870,23853,600],"plugin_category":[38,54,58],"plugin_contributors":[236095],"plugin_business_model":[],"class_list":["post-266322","plugin","type-plugin","status-publish","hentry","plugin_tags-login","plugin_tags-members","plugin_tags-private","plugin_tags-rest-api","plugin_tags-security","plugin_category-authentication","plugin_category-security-and-spam-protection","plugin_category-user-management","plugin_contributors-codeforbroke","plugin_committers-codeforbroke"],"banners":[],"icons":{"svg":"https:\/\/ps.w.org\/cfb-must-login\/assets\/icon.svg?rev=3430247","icon":"https:\/\/ps.w.org\/cfb-must-login\/assets\/icon.svg?rev=3430247","icon_2x":false,"generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>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.<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li><strong>One-Click Toggle<\/strong> - Enable or disable login requirement instantly from the admin bar<\/li>\n<li><strong>REST API Protection<\/strong> - Configurable authentication requirement for REST API endpoints<\/li>\n<li><strong>Automatic Cache Clearing<\/strong> - Automatically clears popular caching plugins when toggling protection<\/li>\n<li><strong>Admin Bar Status Indicator<\/strong> - Always see at a glance whether login is required<\/li>\n<li><strong>Simple Settings Page<\/strong> - Easy-to-use settings interface<\/li>\n<li><strong>Admin Override<\/strong> - Administrators always have access, even when login is required<\/li>\n<li><strong>Smart Redirects<\/strong> - Users are redirected to login and then back to their intended page<\/li>\n<li><strong>Selective Endpoint Access<\/strong> - Allow specific REST API endpoints for forms and authentication<\/li>\n<li><strong>Cache Compatibility<\/strong> - Works with WP Super Cache, W3 Total Cache, WP Rocket, and more<\/li>\n<li><strong>No Configuration Needed<\/strong> - Works perfectly out of the box<\/li>\n<li><strong>Lightweight<\/strong> - Minimal impact on site performance<\/li>\n<li><strong>Translation Ready<\/strong> - Fully internationalized and ready for translation<\/li>\n<\/ul>\n\n<h4>How It Works<\/h4>\n\n<ol>\n<li>Install and activate the plugin<\/li>\n<li>Click the lock icon in the admin bar to toggle login requirement<\/li>\n<li>That's it! Your site is now protected<\/li>\n<\/ol>\n\n<p>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.<\/p>\n\n<h3>Developer Documentation<\/h3>\n\n<h4>Filters<\/h4>\n\n<p><strong>cfb_must_login_redirect_url<\/strong> - Customize the login redirect URL<\/p>\n\n<pre><code>add_filter('cfb_must_login_redirect_url', function($redirect_url, $redirect_to) {\n    return 'https:\/\/example.com\/custom-login';\n}, 10, 2);\n<\/code><\/pre>\n\n<p><strong>cfb_must_login_allowed_rest_routes<\/strong> - Allow additional REST API endpoints<\/p>\n\n<pre><code>add_filter('cfb_must_login_allowed_rest_routes', function($routes) {\n    $routes[] = '\/my-plugin\/v1\/public';\n    return $routes;\n});\n<\/code><\/pre>\n\n<h4>Actions<\/h4>\n\n<p><strong>cfb_must_login_clear_cache<\/strong> - Triggered when cache is cleared<\/p>\n\n<pre><code>add_action('cfb_must_login_clear_cache', function() {\n    \/\/ Custom cache clearing logic\n});\n<\/code><\/pre>\n\n<h4>Capabilities<\/h4>\n\n<p>The plugin uses the <code>cfb_must_login_manage<\/code> capability, which is mapped to <code>manage_options<\/code> by default. You can customize this using the <code>map_meta_cap<\/code> filter.<\/p>\n\n<!--section=installation-->\n<h4>Automatic Installation<\/h4>\n\n<ol>\n<li>Log in to your dashboard<\/li>\n<li>Navigate to Plugins \u2192 Add New<\/li>\n<li>Search for \"Must Login\"<\/li>\n<li>Click \"Install Now\" and then \"Activate\"<\/li>\n<\/ol>\n\n<h4>Manual Installation<\/h4>\n\n<ol>\n<li>Download the plugin zip file<\/li>\n<li>Log in to your dashboard<\/li>\n<li>Navigate to Plugins \u2192 Add New \u2192 Upload Plugin<\/li>\n<li>Choose the zip file and click \"Install Now\"<\/li>\n<li>Activate the plugin<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='will%20this%20affect%20search%20engines%3F'><h3>Will this affect search engines?<\/h3><\/dt>\n<dd><p>Yes, when login is required, search engines cannot crawl your site. This is useful for private sites but should be disabled if you want search engine visibility.<\/p><\/dd>\n<dt id='what%20is%20rest%20api%20protection%3F'><h3>What is REST API protection?<\/h3><\/dt>\n<dd><p>REST API protection requires authentication to access WordPress REST API endpoints when login is required. This prevents unauthenticated access to your site's data through the API. You can enable or disable this feature separately in the settings.<\/p><\/dd>\n<dt id='which%20rest%20api%20endpoints%20are%20always%20accessible%3F'><h3>Which REST API endpoints are always accessible?<\/h3><\/dt>\n<dd><p>Even with REST API protection enabled, the following endpoints remain accessible:\n* Authentication endpoints (JWT, Simple JWT Login)\n* Contact form endpoints (Contact Form 7, WPForms, Gravity Forms)\n* oEmbed endpoints<\/p>\n\n<p>Developers can allow additional endpoints using the <code>cfb_must_login_allowed_rest_routes<\/code> filter.<\/p><\/dd>\n<dt id='does%20this%20work%20with%20caching%20plugins%3F'><h3>Does this work with caching plugins?<\/h3><\/dt>\n<dd><p>Yes! The plugin automatically detects and clears cache from popular caching plugins including:\n* WP Super Cache\n* W3 Total Cache\n* WP Rocket\n* LiteSpeed Cache\n* WP Fastest Cache\n* Autoptimize\n* Cache Enabler\n* Comet Cache\n* SG Optimizer\n* WP Optimize<\/p>\n\n<p>When you toggle the login requirement, the cache is automatically cleared to ensure the changes take effect immediately.<\/p><\/dd>\n<dt id='can%20i%20exclude%20certain%20pages%3F'><h3>Can I exclude certain pages?<\/h3><\/dt>\n<dd><p>Version 1.0.0 requires login for the entire site. Future versions may include page exclusion options.<\/p><\/dd>\n<dt id='what%20happens%20to%20users%20trying%20to%20access%20the%20site%3F'><h3>What happens to users trying to access the site?<\/h3><\/dt>\n<dd><p>Non-logged-in users are automatically redirected to the login page. After logging in, they're redirected back to the page they were trying to access.<\/p><\/dd>\n<dt id='does%20this%20work%20with%20membership%20plugins%3F'><h3>Does this work with membership plugins?<\/h3><\/dt>\n<dd><p>Yes! Must Login works alongside membership plugins and simply ensures users are logged in before viewing any content.<\/p><\/dd>\n<dt id='can%20i%20customize%20the%20redirect%20url%3F'><h3>Can I customize the redirect URL?<\/h3><\/dt>\n<dd><p>Yes, developers can use the <code>cfb_must_login_redirect_url<\/code> filter to customize the redirect URL.<\/p><\/dd>\n<dt id='how%20do%20i%20allow%20additional%20rest%20api%20endpoints%3F'><h3>How do I allow additional REST API endpoints?<\/h3><\/dt>\n<dd><p>Developers can use the <code>cfb_must_login_allowed_rest_routes<\/code> filter to add custom endpoints to the allowlist:<\/p>\n\n<pre><code>add_filter('cfb_must_login_allowed_rest_routes', function($routes) {\n    $routes[] = '\/my-plugin\/v1\/public-endpoint';\n    return $routes;\n});\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<li>One-click toggle via admin bar<\/li>\n<li>Configurable REST API protection<\/li>\n<li>Automatic cache clearing for popular caching plugins<\/li>\n<li>Support for WP Super Cache, W3 Total Cache, WP Rocket, and more<\/li>\n<li>Selective REST API endpoint access<\/li>\n<li>Admin notices for caching plugins<\/li>\n<li>Translation ready<\/li>\n<\/ul>","raw_excerpt":"Require users to log in before viewing your site with easy admin toggle controls. Includes REST API protection and automatic cache clearing.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/266322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=266322"}],"author":[{"embeddable":true,"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/codeforbroke"}],"wp:attachment":[{"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=266322"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=266322"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=266322"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=266322"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=266322"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ne.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=266322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}