<commit_before><commit_msg>add basic plugin file<commit_after><?php
/**
 * Plugin Name: WP Laravel Elixir
 * Plugin URI: https://github.com/sourceboat/wp-laravel-elixir/
 * Description: Get versioned Laravel Elixir file paths in WordPress.
 * Version: 1.0.0
 * Author: Sourceboat
 * Author URI: https://sourceboat.com/
 * License: MIT License
 */

if (! function_exists('elixir')) {
    /**
     * Get the path to a versioned Elixir file.
     *
     * @param  string  $file
     * @param  string  $buildDirectory
     * @return string
     *
     * @throws \InvalidArgumentException
     */
    function elixir($file, $buildDirectory = 'build')
    {
        static $manifest = [];
        static $manifestPath;

        $public_path = get_stylesheet_directory() . '/dist/';
        $public_uri = get_stylesheet_directory_uri() . '/dist/';

        if (empty($manifest) || $manifestPath !== $buildDirectory) {
            $path = $public_path . $buildDirectory . '/rev-manifest.json';

            if (file_exists($path)) {
                $manifest = json_decode(file_get_contents($path), true);
                $manifestPath = $buildDirectory;
            }
        }

        if (isset($manifest[$file])) {
            return $public_uri . trim($buildDirectory . '/' . $manifest[$file], '/');
        }

        $unversioned = $public_path . $file;

        if (file_exists($unversioned)) {
            return $public_uri . trim($file, '/');
        }

        throw new InvalidArgumentException("File {$file} not defined in asset manifest.");
    }
}

{'fraction_non_alphanumeric': 0.13946015424164523, 'fraction_numerical': 0.0019280205655526992, 'mean_word_length': 2.362850971922246, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3450773', 'n_tokens_mistral': 467, 'n_tokens_neox': 444, 'n_words': 103}