Skip to content

v1.0.3 - LMS shell no longer hijacks unrelated archives

Latest

Choose a tag to compare

@revdarkness revdarkness released this 30 Jul 03:55

Patch release. Display-only fix; no schema, data, or settings changes. Safe to apply directly over 1.0.0, 1.0.1, or 1.0.2.

Fixed

The LMS shell could take over an unrelated archive page and replace the active theme's template.

Sglms_Frontend::is_lms_screen() compared get_queried_object_id() against the stored catalog and dashboard page IDs without first confirming the request was a singular view. On a category, tag, author, or date archive, that call returns a term ID, and term IDs and post IDs are separate ID spaces. So a term whose ID happened to equal the catalog or dashboard page ID caused is_lms_screen() to return true, and the LMS shell rendered instead of the theme.

Reproduced on a fresh install where the catalog page was ID 5 and the category stem-curriculum was term 5: /category/stem-curriculum/ rendered the LMS shell rather than the theme.

The same missing guard also allowed the has_shortcode() check to match the first post of an archive loop when that post embedded [sglms_catalog] or [sglms_dashboard].

Both paths are now gated behind is_singular().

Who is affected

Any install where a term ID collides with the catalog or dashboard page ID. Fresh installs are the most exposed, because the auto-created LMS pages land on low IDs in the same numeric range as the first categories created. Sites where the LMS pages have high IDs are unlikely to collide today, but nothing prevents a future term from reaching those numbers.

Also

  • Adds bin/package.ps1, a Windows-native equivalent of bin/package.sh (which requires zip and rsync). It reads the version from SGLMS_VERSION and refuses to build if the plugin header or the readme Stable tag disagree.

Install

Sites running the plugin will see 1.0.3 in their normal Updates screen. Or download stemageddon-lms-1.0.3.zip below and upload via Plugins > Add New > Upload Plugin.