HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/bwcsports-site/wp-content/plugins/contact-widgets/includes/autoload.php
<?php

namespace WPCW;

if ( ! defined( 'ABSPATH' ) ) {

	exit;

}

spl_autoload_register(
	function( $resource ) {

		if ( 0 !== strpos( $resource, __NAMESPACE__ ) ) {

			return;

		}

			$resource = strtolower(
				str_replace(
					array( __NAMESPACE__ . '\\', '_' ),
					array( '', '-' ),
					$resource
				)
			);

			$parts = explode( '\\', $resource );
			$name  = array_pop( $parts );
			$files = str_replace( '//', '/', glob( sprintf( '%s/%s/*-%s.php', __DIR__, implode( '/', $parts ), $name ) ) );

		if ( isset( $files[0] ) && is_readable( $files[0] ) ) {

			require_once $files[0];

		}

	}
);

add_action( 'plugins_loaded', array( __NAMESPACE__ . '\Plugin', 'init' ) );