The number of ob_start()'s werent being ended properly, causing a buffer to carry through all the way to the end of the page.
Eventually it was found to be a simple mistake.
The use of "ob_clean()" instead of "ob_end_clean()".
$ret = ob_get_contents();Please! Just use "ob_start()" and "ob_get_clean()" !!!
They're both one line, respect the current buffering level and incredibly simple to use!