generated from carmelosantana/WordPress-Plugin-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpaca-bot.php
executable file
·38 lines (34 loc) · 1.13 KB
/
alpaca-bot.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
<?php
/*
Plugin Name: Alpaca Bot
Plugin URI: https://github.com/carmelosantana/alpaca-bot
Description: A privately hosted WordPress AI chatbot.
Version: 0.4.17
Author: Carmelo Santana
Author URI: https://carmelosantana.com/
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Requires at least: 6.4
*/
if (!defined('ABSPATH')) exit; // Exit if accessed directly
// Defines
define('ALPACA_BOT', 'alpaca-bot');
define('ALPACA_BOT_TITLE', 'Alpaca Bot');
define('ALPACA_BOT_DIR_URL', plugin_dir_url(__FILE__));
define('ALPACA_BOT_DIR_PATH', plugin_dir_path(__FILE__));
// Composer
if (!file_exists($composer = plugin_dir_path(__FILE__) . 'vendor/autoload.php')) {
// display error message when activating plugin
trigger_error(
sprintf(
/* translators: %s: plugin name */
esc_html__('Error locating %s autoloader. Please run <code>composer install</code>.', 'alpaca-bot'),
esc_html__('Alpaca Bot', 'alpaca-bot')
),
E_USER_ERROR
);
}
require $composer;
add_action('plugins_loaded', function () {
new \AlpacaBot\AlpacaBot();
}, 9);