=== 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.8
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WordPress to Allure Connect for cloud SCORM/xAPI delivery with LearnDash, LifterLMS, Tutor LMS, and LearnPress integrations.

== Description ==

**Allure Connect SCORM and xAPI** helps WordPress site owners add polished SCORM and xAPI training experiences without managing a local SCORM engine. Upload packages to Allure Connect, embed them with a block or shortcode, launch learners from WordPress, and send completion data back to supported LMS lessons.

= Third-Party Services =

This plugin connects your WordPress site to Allure Connect, an external SaaS service hosted at `app.allureconnect.com`.

Allure Connect is used to upload and host SCORM/xAPI packages, create learner launch sessions, store xAPI statements and progress data, and display cloud analytics. 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://www.allureconnect.com/legal/terms
* Privacy Policy: https://www.allureconnect.com/legal/privacy

= Features =

* **Cloud SCORM Upload** - Upload SCORM 1.2 and 2004 packages to Allure Connect hosting
* **Embed Anywhere** - Use shortcodes or the SCORM Player block to add content to any post or page
* **Multiple Display Modes** - Embedded, lightbox, or new window
* **Integrated LRS** - All xAPI statements stored automatically
* **Learner Tracking** - Track progress, scores, and completion status
* **Session Resume** - Learners can pick up where they left off
* **Major LMS Compatibility** - 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. Sign up for an Allure Connect SCORM API account
2. Install this plugin and add your API key
3. Upload SCORM packages via the WordPress admin
4. Embed content using shortcodes, the SCORM Player block, or a supported LMS lesson integration
5. Track learner progress and completions in the Sessions dashboard

= 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 SCORM API account (sign up at app.allureconnect.com)

== Installation ==

1. Upload the `allure-xapi-connect` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu
3. Go to **Allure xAPI > Settings** and enter your API key
4. Upload SCORM packages via **Allure xAPI > Packages**
5. Embed content using shortcodes or the Gutenberg block

== Frequently Asked Questions ==

= Do I need a separate LRS? =

No! Allure Connect includes an integrated LRS. All xAPI statements are stored automatically.

= 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 SCORM versions are supported? =

SCORM 1.2 and SCORM 2004 (all editions) are fully supported.

= Can learners resume where they left off? =

Yes! Progress is saved automatically and learners can resume at any time.

= Is my content secure? =

Yes. Content is served over HTTPS and requires authentication. Only logged-in users with access can view SCORM content.

= Do I need coding skills? =

No! The plugin provides a user-friendly interface and Gutenberg block for easy embedding.

= 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. Dashboard with connection status and usage
2. Package library management
3. Shortcode and Gutenberg block options
4. Learner sessions report
5. Settings page

== Changelog ==

= 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.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.
