In real this is not related to STS it self, but to changes done to includes/application_top.php because of option types V2 addon
Option types require to move this
// initialize the message stack for output messages
require(DIR_WS_CLASSES . 'message_stack.php');
$messageStack = new messageStack;
some lines higher than it's original position
So the STS addition
// START STS 4.5.8
require (DIR_WS_CLASSES.'sts.php');
$sts= new sts();
$sts->start_capture();
// END STS 4.5.8
comes after that, and exactly this is causing the error
Make sure you have the STS code in your application_top.php and that you place it just before the message stack code.