=== LAPDI Member Portal ===
Contributors: sharrondenice, letaprodoit
Donate link: https://buymeacoffee.com/letaprodoit
Tags: members, membership, protected content, login, access control
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Gate protected pages to logged-in members and give them a self-service account page.

== Description ==

LAPDI Member Portal gates protected pages, post types and other plugins' member-only content to logged-in users, and gives members a self-service front-end account page. It ships with sensible, universal defaults and is fully configurable from its own settings screen — nothing is hardcoded to any one site's setup.

= Features =

* A front-end account/login page with a nonce-protected profile form (first name, last name, display name, email)
* Any number of portal roles, each with independent access settings
* Renameable `Portal Member` and full-access `Portal Board Member` starter roles
* Portal role creation, deletion, renaming, and user assignment from the settings screen
* `[lapdi_portal_role]` conditional content, including nested third-party shortcodes
* `[lapdi_member_account]` shortcode for the account page
* WordPress-native password recovery and nonce-protected logout
* `noindex,nofollow` on account and protected front-end requests

= Required framework =

LAPDI Member Portal requires TSP Easy Dev to be installed and active. WordPress blocks activation until that dependency is available and active.

= Works with LAPDI Events =

If [LAPDI Events](https://wordpress.org/plugins/lapdi-events/) is also active, its "Members only" event visibility automatically recognizes users assigned to any configured portal role — no extra setup required.

== Installation ==

1. Install and activate TSP Easy Dev.
2. Upload the plugin under **Plugins → Add New → Upload Plugin** and activate it.
3. Activation creates the `Portal Member` and `Portal Board Member` starter roles and creates (or fills, if empty) an Account page containing `[lapdi_member_account]`.
4. Open **LAPDI Plugins → Member Portal** to add, rename, or delete roles, configure each role, and assign roles to users.
5. Confirm the protected paths/post types match your site's actual structure; the settings screen lists everything currently on the site to choose from.

== Frequently asked questions ==

= Do I need to create a custom role or capability myself? =

No. The plugin creates `Portal Member` and `Portal Board Member` starter roles automatically. You can rename either role or create more roles from the plugin settings screen.

= How do I protect an additional page or post type? =

Open **LAPDI Plugins → Member Portal**, and add the page slug or post type in the relevant field — start typing or click into the field to see suggestions drawn from your site's actual pages/post types.

= What personal data does the plugin store? =

The account form updates the current user's standard WordPress first name, last name, display name and email fields. WordPress includes those core account fields in its personal-data export and erasure tools. Member Portal stores site-wide access settings, an account page ID, and role capabilities, but it does not create a separate profile-data table or send profile data to an external service.

= What happens when I delete the plugin? =

Permanent deletion removes all plugin-created portal roles, Member Portal settings, and plugin-managed capabilities. Users whose only role was a portal role receive the site's default role so they are not left roleless. The Account page and standard WordPress user profile fields are preserved because they may contain administrator-authored content or user-owned data. Ordinary deactivation does not remove anything.

== Changelog ==
= 1.0.0 =
* Add the WordPress.org View details link to the Plugins screen.
* Initial general release with unlimited, renameable portal roles and independent access settings.
* Add full-access roles, portal role assignment for users, and role-conditional page content with `[lapdi_portal_role]`.
* Preserve word boundaries in custom role IDs and migrate role IDs created by the earlier 1.0.0 builder.
* Add configurable capabilities and editable settings with autocomplete for allowed paths, post types, and capabilities.
* Require TSP Easy Dev through WordPress's native dependency header and path-independent runtime detection.
* Keep the account interface theme-independent and document use of WordPress core profile data.
* Internationalize and contextually escape the Member Portal administration interface.
* Clean up the Portal Member role, plugin-owned capabilities, and settings safely when the plugin is deleted.

== Upgrade notice ==
= 1.0.0 =
First general release. If upgrading from the earlier single-site build, roles/capabilities migrate automatically — no action needed.
