Skip to content

Commit 10d4eca

Browse files
committed
fix: ensure constants are only defined if not already set
1 parent e5c6ac6 commit 10d4eca

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

conversion-tracking.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,24 @@ public function includes() {
150150
* @return void
151151
*/
152152
public function define_constants() {
153-
define( 'WCCT_VERSION', $this->version );
154-
define( 'WCCT_FILE', __FILE__ );
155-
define( 'WCCT_PATH', dirname( WCCT_FILE ) );
156-
define( 'WCCT_INCLUDES', WCCT_PATH . '/includes' );
157-
define( 'WCCT_URL', plugins_url( '', WCCT_FILE ) );
158-
define( 'WCCT_ASSETS', WCCT_URL . '/assets' );
153+
if ( ! defined( 'WCCT_VERSION' ) ) {
154+
define( 'WCCT_VERSION', $this->version );
155+
}
156+
if ( ! defined( 'WCCT_FILE' ) ) {
157+
define( 'WCCT_FILE', __FILE__ );
158+
}
159+
if ( ! defined( 'WCCT_PATH' ) ) {
160+
define( 'WCCT_PATH', dirname( WCCT_FILE ) );
161+
}
162+
if ( ! defined( 'WCCT_INCLUDES' ) ) {
163+
define( 'WCCT_INCLUDES', WCCT_PATH . '/includes' );
164+
}
165+
if ( ! defined( 'WCCT_URL' ) ) {
166+
define( 'WCCT_URL', plugins_url( '', WCCT_FILE ) );
167+
}
168+
if ( ! defined( 'WCCT_ASSETS' ) ) {
169+
define( 'WCCT_ASSETS', WCCT_URL . '/assets' );
170+
}
159171
}
160172

161173
/**

0 commit comments

Comments
 (0)