-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatalumo.php
More file actions
60 lines (50 loc) · 1.6 KB
/
Copy pathdatalumo.php
File metadata and controls
60 lines (50 loc) · 1.6 KB
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
<?php
/**
* Datalumo
*
* @wordpress-plugin
* Plugin Name: Datalumo
* Description: Sync your WordPress content into a Datalumo index and optionally power native search with it.
* Version: 0.1.0
* Requires at least: 6.0
* Requires PHP: 8.1
* Author: Jeffrey van Rossum
* Author URI: https://vanrossum.dev
* Text Domain: datalumo
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
use Datalumo\WordPress\Plugin;
if (! defined('ABSPATH')) {
exit;
}
define('DATALUMO_VERSION', '0.1.0');
define('DATALUMO_FILE', __FILE__);
define('DATALUMO_DIR', __DIR__);
define('DATALUMO_URL', plugin_dir_url(__FILE__));
if (! class_exists(Plugin::class)) {
if (is_file(__DIR__ . '/vendor/autoload_packages.php')) {
require_once __DIR__ . '/vendor/autoload_packages.php';
} elseif (is_file(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
}
if (is_file(__DIR__ . '/vendor/woocommerce/action-scheduler/action-scheduler.php')) {
require_once __DIR__ . '/vendor/woocommerce/action-scheduler/action-scheduler.php';
}
if (! class_exists(Plugin::class)) {
add_action('admin_notices', static function (): void {
echo '<div class="notice notice-error"><p>';
echo esc_html__('Datalumo could not load its dependencies. Run "composer install" in the plugin directory.', 'datalumo');
echo '</p></div>';
});
return;
}
/**
* Plugin singleton accessor.
*/
function datalumo(): Plugin
{
return Plugin::instance();
}
datalumo();