From 22f23630ecfe19338e339f4c91e96d87e550ae88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20S=C3=B8derlind?= <per@soderlind.no>
Date: Fri, 13 Jun 2025 15:19:18 +0200
Subject: [PATCH 1/6] Update changelog for version 1.1.3 and add reference to
 WordPress Plugin GitHub Updater

---
 README.md  | 6 ++++++
 readme.txt | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/README.md b/README.md
index 9023077..4bb93e6 100644
--- a/README.md
+++ b/README.md
@@ -68,6 +68,12 @@ The JavaScript is added at the end of the `<head>` section of your site with a p
 
 ## Changelog
 
+### 1.1.3
+* Use generic [WordPress Plugin GitHub Updater](https://github.com/soderlind/wordpress-plugin-gitHub-updater?tab=readme-ov-file#wordpress-plugin-github-updater)
+
+### 1.1.2
+* Minor code improvements
+
 ### 1.1.1
 - Add plugin updater
 
diff --git a/readme.txt b/readme.txt
index 023af54..023d5b1 100644
--- a/readme.txt
+++ b/readme.txt
@@ -62,6 +62,9 @@ The JavaScript is added at the end of the `<head>` section of your site with a p
 
 == Changelog ==
 
+= 1.1.3 =
+* Use generic [WordPress Plugin GitHub Updater](https://github.com/soderlind/wordpress-plugin-gitHub-updater?tab=readme-ov-file#wordpress-plugin-github-updater)
+
 = 1.1.2 =
 * Minor code improvements
 

From 3f973b4872341da90eeac944ad7f5977366e2811 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20S=C3=B8derlind?= <per@soderlind.no>
Date: Wed, 2 Jul 2025 13:01:12 +0200
Subject: [PATCH 2/6] Bump version to 1.1.4 in additional-javascript.php,
 package.json, package-lock.json, and readme.txt. Update stable tag to reflect
 the new version. Adjusted version reference in installed.php for consistency.
 Enhanced class loading for the GitHub plugin updater.

---
 README.md                     | 3 +++
 additional-javascript.php     | 8 +++++---
 package-lock.json             | 4 ++--
 package.json                  | 2 +-
 readme.txt                    | 5 ++++-
 vendor/composer/installed.php | 4 ++--
 6 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md
index 4bb93e6..6d8a4f6 100644
--- a/README.md
+++ b/README.md
@@ -68,6 +68,9 @@ The JavaScript is added at the end of the `<head>` section of your site with a p
 
 ## Changelog
 
+### 1.1.4
+* Enhanced class loading for the GitHub plugin updater.
+
 ### 1.1.3
 * Use generic [WordPress Plugin GitHub Updater](https://github.com/soderlind/wordpress-plugin-gitHub-updater?tab=readme-ov-file#wordpress-plugin-github-updater)
 
diff --git a/additional-javascript.php b/additional-javascript.php
index 3429d6e..d81bebe 100644
--- a/additional-javascript.php
+++ b/additional-javascript.php
@@ -12,7 +12,7 @@
  * Plugin URI:  https://github.com/soderlind/additional-javascript
  * GitHub Plugin URI: https://github.com/soderlind/additional-javascript
  * Description: Add additional JavaScript using the WordPress Customizer.
- * Version:     1.1.3
+ * Version:     1.1.4
  * Author:      Per Soderlind
  * Author URI:  https://soderlind.no
  * Text Domain: additional-javascript
@@ -25,13 +25,15 @@
 	die();
 }
 
-define( 'ADDITIONAL_JAVASCRIPT_VERSION', '1.1.1' );
+define( 'ADDITIONAL_JAVASCRIPT_VERSION', '1.1.4' );
 define( 'ADDITIONAL_JAVASCRIPT_FILE', __FILE__ );
 define( 'ADDITIONAL_JAVASCRIPT_PATH', plugin_dir_path( ADDITIONAL_JAVASCRIPT_FILE ) );
 
 require_once ADDITIONAL_JAVASCRIPT_PATH . 'vendor/autoload.php';
 // Include the generic updater class
-require_once dirname( __FILE__ ) . '/class-github-plugin-updater.php';
+if ( ! class_exists( 'Soderlind\WordPress\GitHub_Plugin_Updater' ) ) {
+	require_once ADDITIONAL_JAVASCRIPT_PATH . 'class-github-plugin-updater.php';
+}
 // Initialize the updater with configuration.
 $additional_javascript_updater = \Soderlind\WordPress\GitHub_Plugin_Updater::create_with_assets(
 	'https://github.com/soderlind/additional-javascript',
diff --git a/package-lock.json b/package-lock.json
index 7870853..84c6d06 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
 	"name": "additional-javascript",
-	"version": "1.1.2",
+	"version": "1.1.4",
 	"lockfileVersion": 3,
 	"requires": true,
 	"packages": {
 		"": {
 			"name": "additional-javascript",
-			"version": "1.1.2",
+			"version": "1.1.4",
 			"license": "GPLv2",
 			"devDependencies": {
 				"@soderlind/wp-project-version-sync": "^2.0.2"
diff --git a/package.json b/package.json
index d9d491a..62ed0f5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "additional-javascript",
-	"version": "1.1.3",
+	"version": "1.1.4",
 	"description": "Add additional JavaScript using the WordPress Customizer.",
 	"keywords": [
 		"wordpress",
diff --git a/readme.txt b/readme.txt
index 023d5b1..d29c5a5 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Tags: javascript, customizer, code, custom code, js
 Donate link: https://paypal.me/PerSoderlind
 Requires at least: 6.5
 Tested up to: 6.8
-Stable tag: 1.1.3
+Stable tag: 1.1.4
 Requires PHP: 8.2
 License: GPL-2.0+
 License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@@ -62,6 +62,9 @@ The JavaScript is added at the end of the `<head>` section of your site with a p
 
 == Changelog ==
 
+= 1.1.4 =
+* Enhanced class loading for the GitHub plugin updater.
+
 = 1.1.3 =
 * Use generic [WordPress Plugin GitHub Updater](https://github.com/soderlind/wordpress-plugin-gitHub-updater?tab=readme-ov-file#wordpress-plugin-github-updater)
 
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index 334a0d5..8119b0d 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
         'name' => 'soderlind/additional-javascript',
         'pretty_version' => 'dev-main',
         'version' => 'dev-main',
-        'reference' => 'f75e4faf5bf987362eca6385bb4c10d6dd9dbf9b',
+        'reference' => '22f23630ecfe19338e339f4c91e96d87e550ae88',
         'type' => 'wordpress-plugin',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
@@ -13,7 +13,7 @@
         'soderlind/additional-javascript' => array(
             'pretty_version' => 'dev-main',
             'version' => 'dev-main',
-            'reference' => 'f75e4faf5bf987362eca6385bb4c10d6dd9dbf9b',
+            'reference' => '22f23630ecfe19338e339f4c91e96d87e550ae88',
             'type' => 'wordpress-plugin',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),

From 8c61eff0b71eb7dc6426a556a4104dc619e491b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20S=C3=B8derlind?= <per@soderlind.no>
Date: Wed, 16 Jul 2025 20:56:21 +0200
Subject: [PATCH 3/6]  Fix deprecated PHP string interpolation syntax for PHP
 8.2+ compatibility in multiple files.

---
 CHANGELOG.md              | 40 +++++++++++++++++++++++++++++++++++++++
 additional-javascript.php |  6 +++---
 package.json              |  2 +-
 readme.txt                |  5 ++++-
 4 files changed, 48 insertions(+), 5 deletions(-)
 create mode 100644 CHANGELOG.md

diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..d3a7b41
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,40 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+## [1.1.5] - 2025-07-16
+
+### Fixed
+- Fixed deprecated PHP string interpolation syntax for PHP 8.2+ compatibility
+
+## [1.1.4] - 2024-XX-XX
+
+### Changed
+- Enhanced class loading for the GitHub plugin updater
+
+## [1.1.3] - 2024-XX-XX
+
+### Changed
+- Use generic [WordPress Plugin GitHub Updater](https://github.com/soderlind/wordpress-plugin-gitHub-updater?tab=readme-ov-file#wordpress-plugin-github-updater)
+
+## [1.1.2] - 2024-XX-XX
+
+### Changed
+- Minor code improvements
+
+## [1.1.1] - 2024-XX-XX
+
+### Added
+- Plugin updater
+
+## [1.1.0] - 2024-XX-XX
+
+### Changed
+- Updated compatibility with WordPress 6.5
+- Code improvements and optimization
+- Enhanced security measures
+
+## [1.0.0] - 2024-XX-XX
+
+### Added
+- Initial release
diff --git a/additional-javascript.php b/additional-javascript.php
index d81bebe..74449d9 100644
--- a/additional-javascript.php
+++ b/additional-javascript.php
@@ -12,7 +12,7 @@
  * Plugin URI:  https://github.com/soderlind/additional-javascript
  * GitHub Plugin URI: https://github.com/soderlind/additional-javascript
  * Description: Add additional JavaScript using the WordPress Customizer.
- * Version:     1.1.4
+ * Version:     1.1.5
  * Author:      Per Soderlind
  * Author URI:  https://soderlind.no
  * Text Domain: additional-javascript
@@ -374,10 +374,10 @@ function customize_preview_additional_javascript() {
 function on_customize_controls_enqueue_scripts() {
 	$suffix = is_rtl() ? '-rtl' : '';
 	$handle = 'additional-javascript-controls' . $suffix;
-	$src    = plugins_url( "/css/customize-controls-custom-javascript${suffix}.css", __FILE__ );
+	$src    = plugins_url( "/css/customize-controls-custom-javascript{$suffix}.css", __FILE__ );
 	$deps   = [ 'customize-controls' ];
 
-	if ( file_exists( plugin_dir_path( __FILE__ ) . "css/customize-controls-custom-javascript${suffix}.css" ) ) {
+	if ( file_exists( plugin_dir_path( __FILE__ ) . "css/customize-controls-custom-javascript{$suffix}.css" ) ) {
 		wp_enqueue_style( $handle, $src, $deps, ADDITIONAL_JAVASCRIPT_VERSION );
 	}
 }
diff --git a/package.json b/package.json
index 62ed0f5..28eaee0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "additional-javascript",
-	"version": "1.1.4",
+	"version": "1.1.5",
 	"description": "Add additional JavaScript using the WordPress Customizer.",
 	"keywords": [
 		"wordpress",
diff --git a/readme.txt b/readme.txt
index d29c5a5..9a27022 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Tags: javascript, customizer, code, custom code, js
 Donate link: https://paypal.me/PerSoderlind
 Requires at least: 6.5
 Tested up to: 6.8
-Stable tag: 1.1.4
+Stable tag: 1.1.5
 Requires PHP: 8.2
 License: GPL-2.0+
 License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@@ -62,6 +62,9 @@ The JavaScript is added at the end of the `<head>` section of your site with a p
 
 == Changelog ==
 
+= 1.1.5 =
+* Fixed deprecated PHP string interpolation syntax for PHP 8.2+ compatibility
+
 = 1.1.4 =
 * Enhanced class loading for the GitHub plugin updater.
 

From 206e6daade4573b55cea1040fb247c908192fd65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20S=C3=B8derlind?= <per@soderlind.no>
Date: Thu, 17 Jul 2025 10:34:07 +0200
Subject: [PATCH 4/6] Remove empty keywords array from package.json to clean up
 metadata.

---
 package.json | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package.json b/package.json
index 28eaee0..d9d17cd 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,6 @@
 		"type": "git",
 		"url": "git+https://github.com/soderlind/additional-javascript.git"
 	},
-	"keywords": [],
 	"author": "Per Søderlind",
 	"license": "GPLv2",
 	"bugs": {

From 7d40c7e7366b33dd353b84c149742dea3a719c48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20S=C3=B8derlind?= <per@soderlind.no>
Date: Mon, 11 Aug 2025 11:12:02 +0200
Subject: [PATCH 5/6] Bump version to 1.1.6 and update changelog

- Updated version number in additional-javascript.php, package.json, and package-lock.json to 1.1.6.
- Modified readme.txt to reflect the new stable tag of 1.1.6.
- Added changelog entries for version 1.1.6:
  - Inline the custom JavaScript using `wp_print_inline_script_tag()`.
  - Ensure the script is printed in the footer.
---
 CHANGELOG.md              |  6 ++++++
 additional-javascript.php | 10 +++-------
 package-lock.json         |  4 ++--
 package.json              |  2 +-
 readme.txt                |  6 +++++-
 5 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d3a7b41..155b74b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,12 @@
 
 All notable changes to this project will be documented in this file.
 
+## [1.1.6] - 2025-08-11
+
+### Fixed
+- Inline the custom javascript using `	()`
+- Ensure the script is printed in the footer
+
 ## [1.1.5] - 2025-07-16
 
 ### Fixed
diff --git a/additional-javascript.php b/additional-javascript.php
index 74449d9..e01e9e2 100644
--- a/additional-javascript.php
+++ b/additional-javascript.php
@@ -12,7 +12,7 @@
  * Plugin URI:  https://github.com/soderlind/additional-javascript
  * GitHub Plugin URI: https://github.com/soderlind/additional-javascript
  * Description: Add additional JavaScript using the WordPress Customizer.
- * Version:     1.1.5
+ * Version:     1.1.6
  * Author:      Per Soderlind
  * Author URI:  https://soderlind.no
  * Text Domain: additional-javascript
@@ -44,7 +44,7 @@
 );
 
 add_action( 'init', __NAMESPACE__ . '\register_post_type_javascript', 0 );
-add_action( 'wp_head', __NAMESPACE__ . '\soderlind_custom_javascript_cb', 110 );
+add_action( 'wp_footer', __NAMESPACE__ . '\soderlind_custom_javascript_cb', 110 );
 add_action( 'customize_register', __NAMESPACE__ . '\register_additional_javascript' );
 add_action( 'customize_preview_init', __NAMESPACE__ . '\customize_preview_additional_javascript' );
 add_action( 'customize_controls_enqueue_scripts', __NAMESPACE__ . '\on_customize_controls_enqueue_scripts' );
@@ -120,11 +120,7 @@ function register_post_type_javascript() {
 function soderlind_custom_javascript_cb() {
 	$javascript = soderlind_get_custom_javascript();
 	if ( $javascript || is_customize_preview() ) {
-		?>
-		<script id="soderlind-custom-javascript">
-			<?php echo $javascript; ?>
-		</script>
-		<?php
+		wp_print_inline_script_tag( $javascript, [ 'id' => 'soderlind-custom-javascript' ] );
 	}
 }
 
diff --git a/package-lock.json b/package-lock.json
index 84c6d06..085d9d2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
 	"name": "additional-javascript",
-	"version": "1.1.4",
+	"version": "1.1.6",
 	"lockfileVersion": 3,
 	"requires": true,
 	"packages": {
 		"": {
 			"name": "additional-javascript",
-			"version": "1.1.4",
+			"version": "1.1.6",
 			"license": "GPLv2",
 			"devDependencies": {
 				"@soderlind/wp-project-version-sync": "^2.0.2"
diff --git a/package.json b/package.json
index d9d17cd..ab62c84 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "additional-javascript",
-	"version": "1.1.5",
+	"version": "1.1.6",
 	"description": "Add additional JavaScript using the WordPress Customizer.",
 	"keywords": [
 		"wordpress",
diff --git a/readme.txt b/readme.txt
index 9a27022..3240c58 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Tags: javascript, customizer, code, custom code, js
 Donate link: https://paypal.me/PerSoderlind
 Requires at least: 6.5
 Tested up to: 6.8
-Stable tag: 1.1.5
+Stable tag: 1.1.6
 Requires PHP: 8.2
 License: GPL-2.0+
 License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@@ -62,6 +62,10 @@ The JavaScript is added at the end of the `<head>` section of your site with a p
 
 == Changelog ==
 
+= 1.1.6 =
+* Inline the custom javascript using `wp_print_inline_script_tag()`
+* Ensure the script is printed in the footer
+
 = 1.1.5 =
 * Fixed deprecated PHP string interpolation syntax for PHP 8.2+ compatibility
 

From 8647f203db36ba4031e5e5592cc0fe086f392095 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Per=20S=C3=B8derlind?= <per@soderlind.no>
Date: Thu, 14 Aug 2025 22:03:40 +0200
Subject: [PATCH 6/6] Fix inline custom JavaScript function in changelog for
 clarity

---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 155b74b..6282f2c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
 ## [1.1.6] - 2025-08-11
 
 ### Fixed
-- Inline the custom javascript using `	()`
+- Inline the custom javascript using `wp_print_inline_script_tag()`
 - Ensure the script is printed in the footer
 
 ## [1.1.5] - 2025-07-16
