From 138339c95feb314be05fbd8d8629cf8cf798243c Mon Sep 17 00:00:00 2001
From: Piotr Potrebka <piotr.potrebka@wpdesk.net>
Date: Mon, 18 Mar 2024 10:50:00 +0100
Subject: [PATCH] fix: duplicates

---
 CHANGELOG.md                              | 4 ++++
 src/WPDesk/Notice/AjaxHandler.php         | 2 +-
 src/WPDesk/Notice/views/admin-head-js.php | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 325f248..575421b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## [3.2.5] - 2024-03-18
+### Fixed
+- remove duplicates for JS
+
 ## [3.2.4] - 2024-03-11
 ### Fixed
 - permission check on notice dismiss action
diff --git a/src/WPDesk/Notice/AjaxHandler.php b/src/WPDesk/Notice/AjaxHandler.php
index 64c9b71..23276a4 100644
--- a/src/WPDesk/Notice/AjaxHandler.php
+++ b/src/WPDesk/Notice/AjaxHandler.php
@@ -66,7 +66,7 @@ class AjaxHandler implements HookablePluginDependant {
      * Add Java Script to admin header.
      */
     public function addScriptToAdminHead() {
-        include __DIR__ . '/views/admin-head-js.php';
+        require_once __DIR__ . '/views/admin-head-js.php';
     }
 
     /**
diff --git a/src/WPDesk/Notice/views/admin-head-js.php b/src/WPDesk/Notice/views/admin-head-js.php
index 5509cb4..7db9ca2 100644
--- a/src/WPDesk/Notice/views/admin-head-js.php
+++ b/src/WPDesk/Notice/views/admin-head-js.php
@@ -4,5 +4,5 @@ if ( ! defined( 'ABSPATH' ) ) {
 } // Exit if accessed directly
 ?>
 <script type="text/javascript">
-    <?php include dirname(__FILE__, 5) . '/assets/js/notice.js'; ?>
+    <?php require_once dirname(__FILE__, 5) . '/assets/js/notice.js'; ?>
 </script>
-- 
GitLab