-
Notifications
You must be signed in to change notification settings - Fork 13
/
better-search.php
101 lines (89 loc) · 2.89 KB
/
better-search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
* Better Search is a plugin that will replace the default WordPress search page
* with highly relevant search results improving your visitors search experience.
*
* @package Better_Search
* @author Ajay D'Souza <[email protected]>
* @license GPL-2.0+
* @link https://webberzone.com
* @copyright 2009-2024 Ajay D'Souza
*
* @wordpress-plugin
* 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-beta2
* Author: WebberZone
* Author URI: https://webberzone.com/
* Text Domain: better-search
* License: GPL-2.0+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
* Domain Path: /languages
* GitHub Plugin URI: https://github.com/WebberZone/better-search/
*/
namespace WebberZone\Better_Search;
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* 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__ ) );
/**
* 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__ );
/**
* Holds the version of Better Search.
*
* @since 3.3.0
*/
define( 'BETTER_SEARCH_DB_VERSION', '2.0' );
// Load the autoloader.
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/autoloader.php';
if ( ! function_exists( __NAMESPACE__ . '\load_bsearch' ) ) {
/**
* The main function responsible for returning the one true WebberZone Snippetz instance to functions everywhere.
*
* @since 3.3.0
*/
function load_bsearch() {
Main::get_instance();
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\load_bsearch' );
}
/*
*----------------------------------------------------------------------------
* Include files
*----------------------------------------------------------------------------
*/
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/options-api.php';
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/class-better-search-core-query.php';
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/class-better-search-query.php';
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/functions.php';
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/general-template.php';
require_once BETTER_SEARCH_PLUGIN_DIR . 'includes/heatmap.php';
/**
* Declare $bsearch_settings global so that it can be accessed in every function
*
* @since 1.3
*/
global $bsearch_settings;
$bsearch_settings = bsearch_get_settings();