Skip to content

Commit 004a9ef

Browse files
authored
Merge pull request #35 from humanmade/add-script-version-string
Add script tag version string
2 parents 46dd912 + 0008db1 commit 004a9ef

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.circleci/deploy.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ fi
6262

6363
rsync -av "$SRC_DIR/" "$BUILD_DIR" --exclude-from "$SRC_DIR/.circleci/deploy-exclude.txt"
6464

65+
# Swap commit placeholders
66+
find . -name '*.php' | xargs sed -i .bak 's/__SCRIPT_HASH__/'`md5 < build/analytics.js`'/g'
67+
find . -name '*.bak' -delete
68+
6569
# Add changed files
6670
git add .
6771

inc/namespace.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function async_scripts( string $tag, string $handle ) : string {
157157
function enqueue_scripts() {
158158
global $wp_scripts;
159159

160-
wp_enqueue_script( 'altis-analytics', plugins_url( 'build/analytics.js', __DIR__ ), [], null, false );
160+
wp_enqueue_script( 'altis-analytics', plugins_url( 'build/analytics.js', __DIR__ ), [], '__SCRIPT_HASH__', false );
161161
wp_add_inline_script(
162162
'altis-analytics',
163163
sprintf(

plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: Altis Analytics
44
* Description: Analytics layer for Altis powered by AWS Pinpoint.
5-
* Version: 1.0.2
5+
* Version: 1.0.3
66
* Author: Human Made Limited
77
* Author URI: https://humanmade.com/
88
*

0 commit comments

Comments
 (0)