=== ContentGate – Content Restriction & Access Control by Login Status & User Role ===
Contributors: ThemeGrill
Tags: content restriction, access control
Requires at least: 5.5
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Restrict content access on your WordPress site based on user roles or login status. Protect posts, pages, or even your entire site with ease.

== Description ==

Restrict content on your WordPress website with simple, rule-based access control.

ContentGate lets you control who can view your content based on login status and user roles. Whether you want to hide pages from non-logged-in users, limit access by role, or protect specific posts, ContentGate makes it easy to create clear rules and apply them instantly.

Set conditions once and control content visibility across your site without complex setup.

---

## Key Features

### Rule-Based Content Restriction

Content Restriction based on:

- **Login Status** (Logged in vs logged out users)
- **WordPress user roles** (Administrator, Editor, Author, etc.)
- Combined conditions using AND logic

Create rules using a simple IF → THEN logic. Some examples:

- IF user is “Logged In” → access page A, B and C (logged out user cannot access A, B and C)
- IF user role is “subscriber” or “editor” → can access page A, B and C (Contributor cannot access pages)
- IF user is “Logged In” and role is “Author” → can access page A, B and C (Others will see content restriction message)

### Apply Rules to Your Content

Control access for:

- Entire website
- Specific pages
- Individual posts

---

### Global Restriction Message

Display a consistent message when unauthorized user tries accessing your restricted content:

- Show custom instructions
- Prompt users to log in
- Use smart tags for dynamic content

This helps users understand why content is hidden and what they need to do next, reducing confusion and improving overall experience.

---

## How It Works

ContentGate uses a simple rule system:

1. Create a rule
2. Set conditions (login status, user role, or both)
3. Choose content to restrict
4. Save and apply

Content visibility updates automatically based on your rules.

### Easy Rule Management

Create and manage your content restriction rules without complexity:

- Add, update, or delete rules anytime
- Clean interface focused on quick setup
- No coding or technical setup required

Designed to keep content restriction simple while giving you just enough control for common use cases.

## ContentGate Pro

Need more control? [ContentGate Pro](https://contentgate.net/pricing/?utm_source=wporg&utm_medium=readme&utm_campaign=upgrade-to-pro) adds:

**More conditions**

- **User Registered Date**: before, after or between dates
- **Registration Period**: how long ago a user signed up
- **Email Domain**: for example, only `@yourcompany.com` addresses
- **Min. Public Posts**: users who have published a set number of posts
- **Capabilities**: any WordPress capability, not just roles

**More actions**

- **Restrict**: block the users who match a rule, as well as allowing them
- **Redirect** to any URL, or to a page on your site
- **Custom restriction message** for each rule, with smart tags
- **Blur Content + CTA**: show a teaser of the content under a blurred overlay with your call-to-action, plus site-wide CTA defaults

**More content to protect**

- Post types, taxonomies, menu items and custom URIs
- Parts of a page, with the **Content Restriction** block

**Advanced rule management**

- AND/OR groups of conditions
- Drag and drop to set the order rules are checked in

[Get ContentGate Pro](https://contentgate.net/pricing/?utm_source=wporg&utm_medium=readme&utm_campaign=upgrade-to-pro)

## What You Can Do with ContentGate

ContentGate is designed for focused content restriction use cases:

- **Create a Login Requirement**: Require users to log in before accessing your content.
- **Restrict Content by Role**: Control which user roles can view specific content.
- **Protect Selected Content**: Restrict access to specific pages or posts without affecting the entire site.
- **Restrict Your Entire Website**: Make your whole website accessible only to selected users or logged-in visitors.
- **Combine Conditions for Better Control:** Use AND logic to apply multiple conditions together:
    - Logged in AND specific role
    - Logged out AND restricted content

## Who Is It For?

ContentGate is ideal for:

- Website owners who need simple content restriction
- Blogs that require login to view content
- Small websites with basic access control needs
- Private or internal websites
- Anyone looking for a lightweight restriction solution

## Why Content Restriction Matters

Without proper control, content can be accessed by anyone, which may not always be intended.

ContentGate helps you:

- Control who can view your content
- Protect sensitive or limited-access pages
- Manage visibility with simple rules

## Built for WordPress

- Uses native WordPress roles and login system
- Works with existing pages and posts
- Lightweight and performance-friendly

== External Services ==

1. Google Fonts

This plugin connects to Google Fonts to load typography for frontend display.

It sends the user's IP address to Google servers when fonts are requested. This request is made when a page containing the plugin is loaded.

This service is provided by Google LLC:
- Terms of Service: https://policies.google.com/terms
- Privacy Policy: https://policies.google.com/privacy

2. SelectWoo

This plugin includes the SelectWoo library to enhance select box UI functionality.

SelectWoo is bundled with the plugin and runs locally on the user's browser. No data is sent to external servers.

SelectWoo is an open-source library maintained by the WooCommerce team:
- Source: https://github.com/woocommerce/selectWoo

3. ThemeGrill

This plugin connects to ThemeGrill's API (api.themegrill.com) in two cases:
- Usage data, only if you turn on Settings → General → Usage Data (off by default). About once a day it sends your site address, WordPress version and language, active theme and plugins, and how many rules you use and which features they rely on. No post content or visitor data is sent.
- Deactivation feedback, only if you choose a reason in the form shown when you deactivate the plugin. It sends the reason, any comment you type, the plugin version, your site address and how long the plugin was active.

This service is provided by ThemeGrill:
- Terms of Service: https://themegrill.com/terms-and-conditions/
- Privacy Policy: https://themegrill.com/privacy-policy/

4. Formbricks

If Usage Data is turned on, ContentGate admin screens may show a short feedback survey, loaded from Formbricks (app.formbricks.com). Formbricks receives the plugin version, whether Pro is active and how many days the plugin has been installed, plus any answers you give.

This service is provided by Formbricks:
- Terms of Service: https://formbricks.com/terms
- Privacy Policy: https://formbricks.com/privacy

== Changelog ==

= 1.0.3 - 16-10-2026 =
* Feature - Pro features are now shown in the rule editor and settings, locked, with an Upgrade to Pro link.
* Feature - New Usage Data setting (off by default) to share usage data with ThemeGrill and see an occasional feedback survey.
* Feature - Optional feedback form when deactivating the plugin, and a one-click rollback to the previous version.
* Tweak - The plugin description now explains what ContentGate Pro adds.
* Tweak - Creating a rule through the REST API now also returns its rule_id.
* Fix - PHP warnings when ContentGate Pro is activated while ContentGate is active.
* Fix - Some labels shared with Pro used the wrong text domain and could not be translated.
* Fix - Condition and content menus no longer open behind the header on short screens.
* Fix - WooCommerce products and the Shop page restricted with per-post settings no longer cause a fatal error, and now show the restriction message on classic themes.

= 1.0.2 - 29-09-2026 =
* Fix - Log In link in the restriction message now returns to the gated page after login.
* Fix - Administrators are no longer locked out by rules that do not include the administrator role.

= 1.0.1 - 06-04-2026 =
* Fix - Hide unrelated admin notices

= 1.0.0 - 01-04-2026 =
* Initial Public Release
