HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/cwd/wp-content/plugins/shortpixel-image-optimiser/class/Controller/ErrorController.php
<?php
namespace ShortPixel\Controller;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

use ShortPixel\ShortPixelLogger\ShortPixelLogger as Log;

class ErrorController
{

			public function __construct()
			{

			}

			public static function start()
			{
					if (true === \wpSPIO()->env()->is_debug)
					{
				 		register_shutdown_function(array(self::class, 'checkErrors'));
					}
			}

			public static function checkErrors()
			{
				 $error = error_get_last();

				 // Nothing, happy us.
				 if (is_null($error))
				 {
					  return;
				 }
				 elseif (1 !== $error['type']) // Nothing fatal.
				 {
					  return;
				 }
				 else {
					 if (ob_get_length() > 0)
					 {
					  ob_clean(); // try to scrub other stuff
					 }
				 		echo '<PRE>' . $error['message'] .  ' in ' . $error['file']  . ' on line ' . $error['line'] . '<br> Last Item ID: ' . QueueController::getLastId() . '</PRE>';
						exit(' <small><br> -ShortPixel Error Handler- </small>');
				 }
			}
}