=== MemberJet ===
Contributors: hafenstudios
Tags: membership, members, courses, lms, e-learning
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Membership areas with native Digistore24 integration, AI course tools and a modern learning UX — quick to set up, safe by design.

== Description ==

MemberJet turns WordPress into a full membership and online-course platform. Purchases from Digistore24 unlock access automatically; refunds and cancellations revoke it reliably. Everything runs on your own WordPress — no SaaS lock-in, your data stays yours.

**Four things MemberJet does better**

* **Native Digistore24 integration** — a rock-solid IPN handler with SHA-512 signature verification (checked against the official test vector), idempotent processing that tolerates Digistore24's webhook retries, and a correct access lifecycle: unlock on payment, lock only on a missing payment or the last paid day — never prematurely on a cancellation.
* **Wizard setup** — a four-step wizard takes you from zero to a working members' area in minutes.
* **Modern learning UX** — courses and lessons with modules, drag-free ordering, a "mark as complete" progress bar, drip content, quizzes with self-assessment and a members' area via shortcode.
* **AI, bring your own key** — generate whole course drafts, lesson content and quizzes with Claude, and give members a RAG tutor that answers strictly from your course content (grounded, so it does not make things up).

**Core features**

* Automatic member creation on purchase (buyer email = access), secure one-time magic-link login
* Courses & lessons (custom post types) with module grouping and free ordering
* Content restriction: courses/lessons are fail-closed protected, plus a protection meta box for any page or post (logged-in only / specific product)
* Progress tracking with a completion bar, and drip content that unlocks lessons X days after access starts
* Members' area with `[memberjet_courses]` and a member account via `[memberjet_account]` (access list, change password, log out)
* AI course generator, lesson-content generator and quiz generator (multiple choice with explanations)
* Batch processing for whole courses — "generate all content" and "publish all" with a real, live progress bar (lesson by lesson)
* Duplicate a single lesson or a whole chapter into another course
* RAG tutor for members, grounded in your course content, without an external vector database (MySQL FULLTEXT)
* Community discussions under lessons (native WordPress comments, members-only)
* Branded HTML emails with customizable templates, plus an optional "access ended" notification
* Course-page design templates (Editorial / Minimal / Playful) and an adjustable AI writing style
* Import/export of complete courses as portable JSON (idempotent), for migration and AI-assisted authoring
* Multilingual UI: German (source), English, French, Spanish, Italian, Dutch + a language override
* REST API under `/wp-json/memberjet/v1/` for progress, discussions and course import/export

**Security by design**

* Digistore24 webhooks verified with `hash_equals` and processed idempotently
* REST endpoints use real permission callbacks (never open); WordPress nonces and capabilities are checked separately
* Secrets (passphrases, API keys) are encrypted at rest with libsodium; the key can live in `wp-config.php`
* Roles are only ever assigned from an allowlist, never from request input

== Installation ==

1. Upload the `memberjet` folder to `/wp-content/plugins/`, or install it through the Plugins screen.
2. Activate the plugin.
3. Open **MemberJet → Settings** and store your Digistore24 IPN passphrase.
4. Copy the displayed IPN URL into Digistore24 (Settings → IPN, type "Generic") and run "Test connection".
5. Under **MemberJet → Products**, map your Digistore24 product IDs to the access you want to grant.
6. (Optional) Add your Anthropic API key under Settings to enable the AI course tools and tutor.

== Frequently Asked Questions ==

= Do I need a Digistore24 account? =
MemberJet is built for Digistore24, so its automatic access management needs a Digistore24 account. You can still create free courses and members' areas without one.

= Are the AI features required? =
No. They are entirely optional. Without an API key, MemberJet works as a full membership and course plugin; the AI generators and tutor simply stay off.

= Which AI models are supported? =
Claude Opus, Sonnet and Haiku (selectable). You bring your own Anthropic API key; MemberJet stores it encrypted and only ever calls the API from your server.

= Is my data sent anywhere? =
Only if you choose to use the AI features with your own key (see "External services" below). The membership, course and progress data lives in your own WordPress database.

= In which languages is the interface available? =
German (the source language), English, French, Spanish, Italian and Dutch. You can force a specific language under Settings, independent of the site language.

= How do I get support? =
Email info@hafenstudios.com or call +49 174 3935796. MemberJet is a product of hafenstudios (https://hafenstudios.com).

== External services ==

MemberJet integrates with third-party services. It does not contact any external service on its own; the following only happens based on your own configuration.

**Digistore24** — When you enter your IPN passphrase, Digistore24 sends purchase/refund notifications (webhooks) to your site's IPN URL to unlock or revoke access. If you additionally enter a Digistore24 API key, MemberJet may call the Digistore24 API (https://www.digistore24.com/) to look up products or reconcile purchases. This is required for the automatic membership features. See Digistore24's terms (https://www.digistore24.com/page/terms) and privacy policy (https://www.digistore24.com/page/privacy).

**Anthropic (Claude API)** — Only when you enable the AI features and provide your own Anthropic API key, MemberJet sends requests to the Anthropic API (https://api.anthropic.com/). Data sent includes the topics, course and lesson text you generate from, and member questions asked to the tutor. Nothing is sent without a key and without you triggering a generation or a tutor reply. See Anthropic's terms (https://www.anthropic.com/legal/consumer-terms) and privacy policy (https://www.anthropic.com/legal/privacy).

== Screenshots ==

1. Members' area with courses and progress bars
2. Lesson view with completion, navigation and the AI tutor
3. AI assistant: course generator and batch content generation with live progress
4. Admin lesson list with course filter and course/module columns
5. Setup wizard
6. Settings with Digistore24, AI and language options

== Changelog ==

= 1.0.0 =
* Initial public release.
* Native Digistore24 IPN integration: SHA-512 signature verification (checked against the official test vector), idempotent processing, correct access lifecycle (lock only on missing payment / last paid day).
* Automatic member creation and secure magic-link login.
* Courses & lessons with modules, ordering, progress tracking, drip content and fail-closed content restriction; protection meta box for any page/post.
* AI (BYOK Claude): course, lesson and quiz generators; batch "generate all / publish all" with a live per-lesson progress bar; RAG tutor grounded strictly in your course content.
* Community discussions, branded emails, setup wizard, member account shortcode, system-status check.
* Import/export of courses as portable JSON, and duplication of lessons or whole chapters between courses.
* Multilingual UI: German (source), English, French, Spanish, Italian, Dutch + a language override.

== Upgrade Notice ==

= 1.0.0 =
First public release of MemberJet: native Digistore24 integration, a modern course experience with progress tracking, optional Claude-powered AI tools, community, and a six-language interface.
