src/abstract-plugin.php
public function autoload( $class ) {
		$parent               = explode( '\\', get_class( $this ) );
		$class_array          = explode( '\\', $class );
		$intersect            = array_intersect_assoc( $parent, $class_array );
		$intersect_depth      = count( $intersect );
		$autoload_match_depth = static::$autoload_ns_match_depth;
		// Confirm $class is in same namespace as this autoloader.
		if ( $intersect_depth >= $autoload_match_depth ) {
			$file = $this->get_file_name_from_class( $class );
			if ( 'classmap' === static::$autoload_type && is_array( $this->autoload_dir ) ) {
				foreach ( $this->autoload_dir as $dir ) {
					$this->load_file( $this->installed_dir . $dir . $file );
				}
			} else {
				$this->load_file( $this->installed_dir . $file );
			}
		}

	}
public function autoload( $class ) {
		$parent               = explode( '\\', get_class( $this ) );
		$class_array          = explode( '\\', $class );
		$intersect            = array_intersect_assoc( $parent, $class_array );
		$intersect_depth      = count( $intersect );
		$autoload_match_depth = static::$autoload_ns_match_depth;
		// Confirm $class is in same namespace as this autoloader.
		if ( $intersect_depth >= $autoload_match_depth ) {
			$file = $this->get_file_name_from_class( $class );
			if ( 'classmap' === static::$autoload_type && is_array( $this->autoload_dir ) ) {
				foreach ( $this->autoload_dir as $dir ) {
					$this->load_file( $this->installed_dir . $dir . $file );
				}
			} else {
				$this->load_file( $this->installed_dir . $file );
			}
		}

	}
public function autoload ( $ class ) { $ parent = explode ( '\\' , get_class ( $ this ) ) ; $ class_array = explode ( '\\' , $ class ) ; $ intersect = array_intersect_assoc ( $ parent , $ class_array ) ; $ intersect_depth = count ( $ intersect ) ; $ autoload_match_depth = static :: $ autoload_ns_match_depth ; // Confirm $class is in same namespace as this autoloader. if ( $ intersect_depth >= $ autoload_match_depth ) { $ file = $ this -> get_file_name_from_class ( $ class ) ; if ( 'classmap' === static :: $ autoload_type && is_array ( $ this -> autoload_dir ) ) { foreach ( $ this -> autoload_dir as $ dir ) { $ this -> load_file ( $ this -> installed_dir . $ dir . $ file ) ; } } else { $ this -> load_file ( $ this -> installed_dir . $ file ) ; } } }
Auto-load classes on demand to reduce memory consumption. Classes must have a namespace so as to resolve
performance issues around auto-loading classes unrelated to current plugin.

@param string $class The name of the class object.
Auto - load classes on demand to reduce memory consumption . Classes must have a namespace so as to resolve performance issues around auto - loading classes unrelated to current plugin .