From 6537bfc81d6a0c6f017a45cebdbb45bd81ddbc75 Mon Sep 17 00:00:00 2001 From: Ajay D'Souza Date: Wed, 20 Nov 2024 20:02:34 +0000 Subject: [PATCH] Check if constants are defined --- better-search.php | 72 +++++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/better-search.php b/better-search.php index 1fa0df9..3617589 100644 --- a/better-search.php +++ b/better-search.php @@ -13,7 +13,7 @@ * Plugin Name: Better Search * Plugin URI: https://webberzone.com/plugins/better-search/ * Description: Replace the default WordPress search with a contextual search. Search results are sorted by relevancy ensuring a better visitor search experience. - * Version: 4.0.0-RC2 + * Version: 4.0.0-RC3 * Author: WebberZone * Author URI: https://webberzone.com/ * Text Domain: better-search @@ -29,40 +29,50 @@ die; } -/** - * Holds the version of Better Search. - * - * @since 2.9.3 - */ -define( 'BETTER_SEARCH_VERSION', '4.0.0' ); +if ( ! defined( 'BETTER_SEARCH_VERSION' ) ) { + /** + * Holds the version of Better Search. + * + * @since 2.9.3 + */ + define( 'BETTER_SEARCH_VERSION', '4.0.0' ); +} -/** - * Holds the filesystem directory path (with trailing slash) for Better Search - * - * @since 2.2.0 - */ -define( 'BETTER_SEARCH_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); +if ( ! defined( 'BETTER_SEARCH_PLUGIN_DIR' ) ) { + /** + * Holds the filesystem directory path (with trailing slash) for Better Search + * + * @since 2.2.0 + */ + define( 'BETTER_SEARCH_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); +} -/** - * Holds the filesystem directory path (with trailing slash) for Better Search - * - * @since 2.2.0 - */ -define( 'BETTER_SEARCH_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); +if ( ! defined( 'BETTER_SEARCH_PLUGIN_URL' ) ) { + /** + * Holds the filesystem directory path (with trailing slash) for Better Search + * + * @since 2.2.0 + */ + define( 'BETTER_SEARCH_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); +} -/** - * Holds the filesystem directory path (with trailing slash) for Better Search - * - * @since 2.2.0 - */ -define( 'BETTER_SEARCH_PLUGIN_FILE', __FILE__ ); +if ( ! defined( 'BETTER_SEARCH_PLUGIN_FILE' ) ) { + /** + * Holds the filesystem directory path (with trailing slash) for Better Search + * + * @since 2.2.0 + */ + define( 'BETTER_SEARCH_PLUGIN_FILE', __FILE__ ); +} -/** - * Holds the version of Better Search. - * - * @since 3.3.0 - */ -define( 'BETTER_SEARCH_DB_VERSION', '2.0' ); +if ( ! defined( 'BETTER_SEARCH_DB_VERSION' ) ) { + /** + * Holds the version of Better Search. + * + * @since 3.3.0 + */ + define( 'BETTER_SEARCH_DB_VERSION', '2.0' ); +} // Load Freemius. require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/load-freemius.php';