HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpicare/wp-content/plugins/tracking-code-manager/autoload.php
<?php
spl_autoload_register( 'tcmp_autoload' );
function tcmp_autoload( $class ) {
	$root = dirname( __FILE__ ) . '/includes/classes/';
	tcmp_autoload_root( $root, $class );
}
function tcmp_autoload_root( $root, $class ) {
	$slash = substr( $root, strlen( $root ) - 1 );
	if ( '/' !== $slash && '\\' !== $slash ) {
		$root .= '/';
	}
	$name = str_replace( TCMP_PLUGIN_PREFIX, '', $class );
	if ( strpos( $class, TCMP_PLUGIN_PREFIX ) === false ) {
		//autoload only plugin classes
		return;
	}

	$h = opendir( $root );
	while ( $file = readdir( $h ) ) {
		if ( is_dir( $root . $file ) && '.' !== $file && '..' !== $file ) {
			tcmp_autoload_root( $root . $file, $class );
		} elseif ( file_exists( $root . $name . '.php' ) ) {
			include_once( $root . $name . '.php' );
		} elseif ( file_exists( $root . $class . '.php' ) ) {
			include_once( $root . $class . '.php' );
		}
	}
}
function tcmp_include_php( $root ) {
	$h     = opendir( $root );
	$slash = substr( $root, strlen( $root ) - 1 );
	if ( '/' !== $slash && '\\' !== $slash ) {
		$root .= '/';
	}

	while ( $file = readdir( $h ) ) {
		if ( is_dir( $root . $file ) && '.' !== $file && '..' !== $file ) {
			tcmp_include_php( $root . $file );
		} elseif ( strlen( $file ) > 5 ) {
			$ext    = '.php';
			$length = strlen( $ext );
			$start  = $length * -1; //negative
			if ( strcasecmp( substr( $file, $start ), $ext ) === 0 ) {
				include_once( $root . $file );
			}
		}
	}
}