=== Demfilz Membership ===
Contributors: demfilz
Tags: membership, user profile, registration, content restriction, user groups
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Membership made simple: registration, login, member accounts with avatars and photo galleries, custom fields, groups and content restriction.

== Description ==

Demfilz Membership turns any WordPress site into a members site:

* **Registration form** - `[dmem_register]` with your own custom fields, optional avatar upload, terms acceptance, honeypot and rate-limit spam protection, and an optional admin-approval mode.
* **Login form** - `[dmem_login]` with lost-password link and configurable redirects.
* **Member accounts** - `[dmem_account]` gives every member a tabbed account page: edit profile details and custom fields, upload an avatar, manage photo galleries, change password, delete account.
* **Uploadable avatars** - the member's photo replaces their avatar everywhere WordPress shows one (comments, author boxes, admin bar). Admins can manage avatars from the user edit screen too.
* **Custom member fields** - build your own fields: text, paragraph, number, email, URL, date, dropdown, radio, checkboxes, single image and photo gallery. Choose per field whether it appears on registration, is editable on the account page, is required, and whether it is public or private.
* **Photo galleries** - a gallery field lets each member upload their own photos (with a per-field limit) and shows them as a grid on their public profile.
* **Member groups** - create any number of groups, assign members manually, in bulk from the user screen, or automatically on registration.
* **Content restriction** - a "Membership access" box on every page and post: everyone, logged-in members, or selected groups. Blocked visitors see a customizable message with login/register buttons, or are redirected. Excerpts, feeds, comments and (optionally) archives are protected as well.
* **Inline restriction** - `[dmem_restricted groups="gold"]...[/dmem_restricted]` hides just part of a page; `state="out"` shows content to logged-out visitors only.
* **Member directory and profiles** - `[dmem_members]` is a searchable member directory; `[dmem_profile]` shows a member's public profile with avatar, public fields and galleries. Both can be disabled.
* **Import and export** - bulk-import members from CSV (create or update by email, with groups, status and custom field values), export all members to CSV, and move your whole configuration (fields, groups, access texts, settings) between sites as JSON.
* **Admin tools** - a Members screen with approval queue and filters, welcome/approval emails, and integration with the WordPress privacy export and erase tools.

Everything runs on your site. The plugin makes no calls to external services.

= Pro version =

A separate Membership Pro add-on (from demfilz.com) adds paid membership plans billed through your own Stripe account: members subscribe via Stripe Checkout, are added to the groups each plan grants, and are downgraded automatically when a subscription ends.

== Installation ==

1. Install and activate the plugin.
2. Create pages for Register, Login, Account, Profile and Members - they can be empty.
3. Map those pages under Membership, Settings. Each mapped page renders its form automatically; use the matching shortcode instead (see Membership, Shortcodes) only when you want the form in a specific spot.
4. Add groups (Membership, Groups) and custom fields (Membership, Fields).
5. Restrict content from any page or post edit screen using the "Membership access" box.

== Frequently Asked Questions ==

= I mapped a page in Settings but it shows old text or nothing - why? =

A mapped page renders its membership form automatically after whatever content the page already has. If the page still shows leftover text (for example a shortcode from another plugin, printed literally), edit the page and delete that text - the form itself needs nothing added. Only use the dmem shortcodes when you want to control exactly where the form sits.

= Do members get access to wp-admin? =

No. Members are standard WordPress subscriber accounts and use the front-end account page you create. Groups are independent of roles and never grant admin capabilities.

= Where are avatars and photos stored? =

In your regular WordPress media library, marked as owned by the member. When a member removes a photo (or deletes their account), images the member uploaded through the plugin are deleted as well.

= Can I approve members before they can log in? =

Yes. Enable approval mode in Settings. New registrations are held as "pending", cannot log in, and appear in an approval queue under Membership, Members with one-click approve/reject (both send an email).

= How do I restrict a whole page to a group? =

Edit the page and use the "Membership access" box: choose "Selected groups", tick the groups, and pick whether blocked visitors see a message or get redirected.

= Can I import members from another site or plugin? =

Yes. Membership, Import / Export accepts a CSV with a header row: `email` is required; `username`, `first_name`, `last_name`, `display_name`, `password`, `status` (active|pending), `groups` (keys separated by |) and any of your custom field keys are optional. Existing members can be updated when matched by email. New members without a password get a strong random one. Imported users are always regular subscribers - roles are never imported.

= Why is an existing user missing from the member directory? =

The directory and public profiles list members - accounts registered through the plugin. Accounts created before the plugin (or imported) join the directory as soon as you save the Membership section on their user profile in wp-admin.

= Does the registration rate limit work behind a proxy or CDN? =

The per-IP limit uses the server-reported address. Behind a reverse proxy or CDN, pass the real visitor IP through the `dmem_client_ip` filter. Only successful registrations count toward the limit.

= Does it hide restricted posts from archives and search? =

Excerpts and feeds are always protected. Optionally, enable "Hide restricted content" in Settings to also remove inaccessible posts from archive and search listings (pagination counts on mixed pages may then run slightly short).

= Does the plugin call any external services? =

No. The free plugin communicates with no external service and loads no external assets.

== Screenshots ==

1. The registration form with custom fields and avatar upload.
2. The member account page with its Profile, Avatar, Photos and Password tabs.
3. A public member profile with photo gallery.
4. The member directory.
5. The Members admin screen with the approval queue.
6. Building custom member fields.
7. The "Membership access" restriction box on a page.
8. Import / Export: member CSV import and configuration transfer.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
