-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelasticsearch-buddypress.php
executable file
·73 lines (65 loc) · 1.92 KB
/
elasticsearch-buddypress.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
<?php
/**
* Elasticsearch BuddyPress
*
* @package Elasticsearch\BuddyPress
* @author Renato Alves
* @version 0.1.0-alpha
* @license GPL-3.0-or-later
*
* @wordpress-plugin
* Plugin Name: Elasticsearch BuddyPress
* Plugin URI: https://github.com/renatonascalves/elasticsearch-buddypress
* GitHub Plugin URI: https://github.com/renatonascalves/elasticsearch-buddypress
* Description: BuddyPress integration with Elasticsearch.
* Version: 0.1.0-alpha
* Author: Renato Alves
* Author URI: https://ralv.es
* Text Domain: elasticsearch-buddypress
* Requires PHP: 8.3
* Requires WP: 6.1
* Tested up to: 6.5.2
* Requires Plugins: buddypress, elasticpress
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
declare(strict_types=1);
namespace Elasticsearch\BuddyPress;
/* Start Composer Loader */
// Check if Composer is installed.
if ( ! file_exists( __DIR__ . '/vendor/wordpress-autoload.php' ) ) {
if ( ! class_exists( \Composer\InstalledVersions::class ) ) {
\add_action(
'admin_notices',
function () {
?>
<div class="notice notice-error">
<p>
<?php
esc_html_e(
'ElasticSearch BuddyPress appears to have been installed without its dependencies. It will not work properly until dependencies are installed. This likely means you have cloned it from Github and need to run the command `composer install`.',
'elasticsearch-buddypress'
);
?>
</p>
</div>
<?php
}
);
return;
}
} else {
// Load Composer dependencies.
require_once __DIR__ . '/vendor/wordpress-autoload.php';
}
/* End Composer Loader */
/**
* Getting the instance of the controller class.
*
* @return Controller
*/
function elasticsearch_buddypress(): Controller {
return Registry::controller();
}
// Bootstrap the plugin.
elasticsearch_buddypress()->load_adapters();