=== Allure Connect SCORM and xAPI ===
Contributors: allureconnect
Tags: scorm, xapi, elearning, learndash, lms
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.4.9
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Cloud-hosted SCORM, embed it in WordPress, and sync completion with LearnDash, LifterLMS, Tutor LMS, or LearnPress—plus xAPI tracking.

== Description ==

**Run SCORM in WordPress without running your own SCORM engine.**

Allure Connect hosts your SCORM 1.2 and SCORM 2004 packages and delivers them to signed-in WordPress learners. Add a course to any post or page with the Allure SCORM Player block or `[allure_scorm]` shortcode, then choose an embedded player, lightbox, or new window.

Learners can resume incomplete sessions. Administrators can review progress, scores, time spent, completion status, and related xAPI activity. When you use LearnDash, LifterLMS, Tutor LMS, or LearnPress, the plugin can also mark the linked lesson complete after the package reports SCORM completion.

Allure Connect keeps the hosted runtime, session data, and xAPI Learning Record Store together, so your WordPress site can deliver and track interactive training without maintaining a local SCORM engine.

Learn more and create a free sandbox account: https://allureconnect.com

= Third-Party Services =

This plugin requires Allure Connect, a hosted SaaS described at https://allureconnect.com.

The connector sends service requests to the Allure Connect application at https://app.allureconnect.com for API credentials, SCORM package upload and hosting, learner launches, session and progress tracking, xAPI storage, and analytics. The plugin cannot upload, launch, resume, or track SCORM content without an active Allure Connect account and valid API credentials.

Depending on the feature used, requests may include your configured API key and Tenant ID, package metadata and ZIP uploads, WordPress user identifiers, linked post IDs, LMS identifiers, learner progress, scores, completion status, session identifiers, and xAPI statement data.

Use of the Allure Connect service is governed by:

* Terms: https://allureconnect.com/legal/terms
* Privacy Policy: https://allureconnect.com/legal/privacy

= Features =

* **Host SCORM outside WordPress** - Upload SCORM 1.2 and SCORM 2004 ZIP packages from WordPress while Allure Connect hosts and serves the runtime
* **Embed without custom code** - Add training to posts and pages with the Allure SCORM Player block or `[allure_scorm]` shortcode
* **Choose the learner experience** - Launch content embedded, in a lightbox, or in a new window
* **Resume incomplete sessions** - Return each learner to an existing incomplete session
* **Track learning outcomes** - Review progress, scores, time spent, completion status, and related xAPI activity
* **Sync LMS completion** - Optionally complete a linked LMS lesson after the package reports SCORM completion
* **Connect four WordPress LMS plugins** - Built-in adapters for LearnDash, LifterLMS, Tutor LMS, and LearnPress

= LMS Integrations =

This connector includes named compatibility for these major WordPress LMS plugins:

* **LearnDash** - Add SCORM content to lessons and topics and mark LearnDash items complete after SCORM completion.
* **LifterLMS** - Add SCORM content to LifterLMS lessons and mark lessons complete from SCORM completion.
* **Tutor LMS** - Add interactive SCORM modules to Tutor LMS lessons and sync completion.
* **LearnPress** - Add SCORM packages to LearnPress lessons and sync lesson completion.

SCORM packages can also be embedded on standard WordPress posts and pages without an LMS. When an LMS lesson is linked to a package, the plugin passes the WordPress post ID and LMS identifier through launch, progress, and completion routing so reused packages complete the correct lesson.

All third-party LMS names are trademarks of their respective owners. Compatibility does not imply endorsement by those vendors.

= How It Works =

1. Create an Allure Connect account and open **Dashboard → Integrations → API Keys**
2. Install the plugin, enter your API key and Tenant ID, and test the connection
3. Upload a valid SCORM 1.2 or SCORM 2004 ZIP from **Allure xAPI → Packages**
4. Add the course with the Gutenberg block, shortcode, or a supported LMS lesson integration
5. Let signed-in learners launch or resume the course, then review sessions, scores, completion, and related xAPI activity

= Shortcode Usage =

`[allure_scorm id="package-uuid"]`

**Options:**
* `id` - Package UUID (required)
* `width` - Player width (default: 100%)
* `height` - Player height in pixels (default: 600)
* `mode` - Display mode: embed, lightbox, or new_window (default: embed)
* `title` - Optional title for lightbox/new_window modes
* `post_id` - Optional WordPress post ID used for LMS completion routing when a SCORM package is reused
* `lms` - Optional LMS identifier used with `post_id` for LMS-specific routing

= Requirements =

* WordPress 5.8 or higher
* PHP 7.4 or higher
* Allure Connect account and API credentials (start at https://allureconnect.com)

== Installation ==

1. Upload the `allure-xapi-connect` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu
3. Open **Dashboard → Integrations → API Keys** in Allure Connect, then enter both the API key and Tenant ID in **Allure xAPI > Settings**
4. Upload SCORM packages via **Allure xAPI > Packages**
5. Embed content using shortcodes or the Gutenberg block

== Frequently Asked Questions ==

= Is an Allure Connect account required? =

Yes. This plugin is a connector for the hosted Allure Connect service. An active account, API key, and Tenant ID are required to upload, launch, resume, and track packages.

= Do I need a separate LRS? =

No. Allure Connect includes a workspace Learning Record Store. SCORM learner activity processed through Allure Connect can be recorded and reviewed as related xAPI activity.

= Is this the official Allure Connect plugin? =

Yes. This plugin is maintained by Allure Connect for WordPress sites that use the Allure Connect SCORM/xAPI service.

= Where do I get my API key and Tenant ID? =

Sign in to the Allure Connect dashboard and open Integrations → API Keys to find your API key and Tenant ID.

= What standards are supported? =

The hosted runtime supports SCORM 1.2 and SCORM 2004. The Allure Connect LRS supports xAPI 1.0.3.

= Can learners resume where they left off? =

Yes. The plugin reopens an existing incomplete session for the same learner and course context. The exact resume point depends on the SCORM data saved by the course package.

= Who can launch a course? =

The plugin requires a logged-in WordPress user before creating a learner launch. Access to the surrounding page, lesson, enrollment, or membership remains controlled by WordPress and your installed LMS or access-control plugin.

= How does LMS completion sync work? =

When auto-completion is enabled for a linked lesson, the plugin marks that lesson complete after the SCORM package reports completion. Built-in adapters are included for LearnDash, LifterLMS, Tutor LMS, and LearnPress.

= Do I need coding skills? =

No. Add the Allure SCORM Player block in the WordPress editor, choose a package, and select a display mode. A shortcode is also available for classic-editor and template workflows.

= Can I use the plugin without a WordPress LMS? =

Yes. Add a SCORM package to a regular WordPress post or page with the Gutenberg block or `[allure_scorm]` shortcode.

= Which WordPress LMS plugins are supported by name? =

Allure Connect SCORM and xAPI includes built-in compatibility for LearnDash, LifterLMS, Tutor LMS, and LearnPress. It can also embed SCORM/xAPI packages on regular WordPress posts and pages with the SCORM Player block or `[allure_scorm]` shortcode.

== Screenshots ==

1. Run a hosted Allure Connect course inside a signed-in WordPress page.
2. Upload and manage SCORM 1.2 or SCORM 2004 courses without hosting the runtime in WordPress.
3. Add a course to any page or supported LMS lesson with the Allure SCORM Player block.
4. Review learner completion, pass/fail, score, and time spent from WordPress.
5. Confirm the Allure Connect connection and see course usage at a glance.

== Changelog ==

= 1.4.9 =
* Lead the WordPress.org listing with the customer outcome: run SCORM in WordPress without maintaining a local SCORM engine.
* Replace release-QC screenshots with a clean upload → embed → learn → measure product story captured from a disposable WordPress site and the hosted Allure Connect demo.
* Use `allureconnect.com` for public brand, documentation, and legal links while keeping `app.allureconnect.com` for authenticated application and connector traffic.
* Clarify the hosted-service dependency, xAPI scope, learner access boundary, SCORM support wording, and resume behavior.
* Update embedding security behavior, including CSP and frame-header handling, while leaving SCORM launch, progress, and completion logic unchanged.

= 1.4.8 =
* Update the plugin display name to the official Allure Connect SCORM/xAPI naming for WordPress.org owner validation.
* WordPress.org review readiness: resolved all Plugin Check errors and warnings — prepared statements / escaping and sortable-column whitelisting for admin reporting queries, and documented direct database access on the plugin's own tables.
* Fix the package score-distribution histogram (literal % was mis-parsed by prepared statements).
* Replace a WordPress 6.1-only function with a 5.8-compatible equivalent and remove the redundant text-domain loading call.
* Allow large SCORM uploads to finish processing by using a longer, filterable API timeout (fixes request timeouts on big packages).
* Declare the Gutenberg editor bundle's WordPress runtime dependencies so the Allure SCORM Player block registers reliably on a fresh site.
* Expand cached package ID columns, run a schema-only migration, and normalize live package IDs in the report filter so long Connect package IDs persist and completed launches render cleanly in the Sessions report.
* Omit absent optional scores from progress requests so WordPress REST validation accepts completion updates instead of leaving sessions at Unknown.

= 1.4.7 =
* Reliability: the player script now loads once per page (prevents duplicate progress submissions) and reliably flushes final progress when a learner closes the tab.
* Security: player messages are validated by their source and completion webhook callbacks require a signed (HMAC) request.
* Store each launch's WordPress post and LMS context (adds a session database column on update) so reused SCORM packages always complete the correct lesson.
* Validate uploaded SCORM files as real ZIP archives before processing.
* Admin analytics charts now load from a bundled copy of Chart.js (no external CDN).
* Minor fixes to storage/quota display and completion-status handling.

= 1.4.6 =
* Add block keywords so the SCORM Player block surfaces quickly in the block editor.
* Improve WordPress.org listing copy with named compatibility for LearnDash, LifterLMS, Tutor LMS, and LearnPress.
* Pass WordPress post/LMS context through SCORM launch and progress routing so reused packages complete the correct LMS lesson.
* Harden session completion routing for reused SCORM packages and require signed/API-key-authenticated webhook callbacks.
* Improve WordPress.org readiness: sanitize saved player settings, use consistent nonces for frontend launches, and document the Allure Connect service dependency.
* Package release files are built from the maintained WordPress plugin source.

= 1.0.0 =
* Initial release
* SCORM 1.2/2004 support
* Shortcode and Gutenberg block
* LearnDash, LifterLMS, Tutor LMS, and LearnPress integrations
* Session tracking and reporting

== Upgrade Notice ==

= 1.4.9 =
WordPress.org positioning, screenshots, and service-language refresh. Embedding security behavior, including CSP and frame-header handling, was updated; SCORM launch, progress, and completion logic remains unchanged.

= 1.4.8 =
WordPress.org review hardening, reliable Gutenberg block registration, package-ID cache migration, a score-distribution histogram fix, and WP 5.8 compatibility.

= 1.4.7 =
Reliability and security hardening for launches, progress, and completion webhooks; reused-package LMS routing now stores LMS context (adds a session database column on update).

= 1.4.6 =
Adds quick block-editor discovery, improves reused-package LMS routing, and hardens webhook/session handling.

= 1.0.0 =
Initial release.
