Changed source root directory

This commit is contained in:
2026-03-05 16:30:11 +01:00
parent dc85447ee1
commit 538f85d7a2
5868 changed files with 749734 additions and 99 deletions

View File

@@ -0,0 +1,48 @@
<?php
/**
* Asset cache busting utility.
*
* @package contact-form-7-mailchimp-extension
* @author renzo.johnson@gmail.com
* @copyright 2014-2026 https://renzojohnson.com
* @license GPL-3.0+
*/
defined( 'ABSPATH' ) || exit;
class Cmatic_Buster {
private string $plugin_version;
private bool $is_debug;
private static ?self $instance = null;
public function __construct( string $plugin_version = SPARTAN_MCE_VERSION, ?bool $is_debug = null ) {
$this->plugin_version = $plugin_version;
$this->is_debug = $is_debug ?? ( defined( 'WP_DEBUG' ) && WP_DEBUG );
}
public function get_version( string $file_path ): string {
$version_parts = array( $this->plugin_version );
if ( file_exists( $file_path ) ) {
$version_parts[] = (string) filemtime( $file_path );
$version_parts[] = substr( md5_file( $file_path ), 0, 8 );
}
if ( $this->is_debug ) {
$version_parts[] = (string) time();
}
return implode( '-', $version_parts );
}
public static function instance(): self {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
}