Skip to content

WB Gamification 1.5.1 - PHP 8.0/8.1 compatibility hotfix

Choose a tag to compare

@vapvarun vapvarun released this 01 Jun 13:07
· 339 commits to main since this release

PHP compatibility hotfix

Fixes a fatal error that crashed sites on PHP 8.1 and below, and restores full PHP 8.0 support.

Fixed

  • Fatal E_COMPILE_ERROR on PHP 8.1 and below. KudosEngine::send() declared a true|WP_Error return type. The standalone true literal type only exists in PHP 8.2+, so on PHP 8.0/8.1 it was parsed as a class name (WBGam\Engine\true) and crashed the whole site (Cannot use 'WBGam\Engine\true' as class name as it is reserved). Changed to bool|WP_Error.
  • Event value object used readonly properties (PHP 8.1+). Broke parsing on PHP 8.0. Properties are now plain public; immutability is enforced by convention.
  • OpenApiCommand::error() used the never return type (PHP 8.1+). Changed to void.

Changed

  • Minimum supported PHP lowered from 8.1 to 8.0. CI now lints PHP 8.0 through 8.4.

Verification

  • php -l clean on PHP 8.0 / 8.1 / 8.2 / 8.3 / 8.4 (source + shipped vendor).
  • Local-CI green; GitHub CI (CI + Tests workflows) all green.

Upgrade strongly recommended for any site on PHP 8.1 or below. No schema changes.