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; } }