includes/class-foo-bar.php * LaunchList\Integrations\Wpforms -> includes/integrations/class-wpforms.php */ spl_autoload_register( static function ( $class_name ) { if ( 0 !== strpos( $class_name, 'LaunchList\\' ) ) { return; } $parts = explode( '\\', substr( $class_name, strlen( 'LaunchList\\' ) ) ); $name = array_pop( $parts ); $dir = ''; foreach ( $parts as $part ) { $dir .= strtolower( str_replace( '_', '-', $part ) ) . '/'; } $file = LAUNCHLIST_DIR . 'includes/' . $dir . 'class-' . strtolower( str_replace( '_', '-', $name ) ) . '.php'; if ( is_readable( $file ) ) { require_once $file; } } ); register_activation_hook( __FILE__, array( 'LaunchList\\Plugin', 'activate' ) ); register_deactivation_hook( __FILE__, array( 'LaunchList\\Plugin', 'deactivate' ) ); add_action( 'plugins_loaded', array( 'LaunchList\\Plugin', 'boot' ) );