s2Member Missing Level Label Fix (2026-02-10)
Issue: PHP 8+ throws Undefined array key "level-1_label" in s2member/src/includes/classes/constants.inc.php around line 294. This can lead to shutdown-level errors.
Fix applied: Add a fallback for missing level{n}_label and log once. Implemented as a MU-plugin to survive s2Member updates.
Suggested upstream fix for s2Member core:
-
Replace direct access of
$GLOBALS['WS_PLUGIN__']['s2member']['o']['level'.$level.'_label']with a safe fallback: -
$level_label = $GLOBALS['WS_PLUGIN__']['s2member']['o'][$level_label_key] ?? ('Level '.$level); -
Then define the constant using
$level_label. -
Optional: log once if the label is missing.
