-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathowlstack.php
More file actions
53 lines (43 loc) · 1.72 KB
/
owlstack.php
File metadata and controls
53 lines (43 loc) · 1.72 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
<?php
/**
* Plugin Name: Owlstack
* Plugin URI: https://owlstack.dev
* Description: Publish content to Telegram, X (Twitter), Facebook, Instagram, LinkedIn, Discord, and more — directly from WordPress.
* Version: 1.0.1
* Requires at least: 6.4
* Requires PHP: 8.1
* Author: Ali Hesari
* Author URI: https://alihesari.com
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: owlstack
* Domain Path: /languages
*/
declare(strict_types=1);
// Prevent direct access.
if (! defined('ABSPATH')) {
exit;
}
// Plugin constants.
define('OWLSTACK_VERSION', '1.0.1');
define('OWLSTACK_FILE', __FILE__);
define('OWLSTACK_DIR', plugin_dir_path(__FILE__));
define('OWLSTACK_URL', plugin_dir_url(__FILE__));
define('OWLSTACK_BASENAME', plugin_basename(__FILE__));
// Require Composer autoloader.
if (! file_exists(OWLSTACK_DIR . 'vendor/autoload.php')) {
add_action('admin_notices', static function (): void {
echo '<div class="notice notice-error"><p>';
echo esc_html__('Owlstack requires Composer dependencies. Please run "composer install" in the plugin directory.', 'owlstack');
echo '</p></div>';
});
return;
}
require_once OWLSTACK_DIR . 'vendor/autoload.php';
// Boot the plugin.
$owlstackPlugin = \Owlstack\WordPress\Plugin::instance();
// Activation / Deactivation hooks.
register_activation_hook(__FILE__, [\Owlstack\WordPress\Activator::class, 'activate']);
register_deactivation_hook(__FILE__, [\Owlstack\WordPress\Deactivator::class, 'deactivate']);
// Initialize on plugins_loaded (ensures all plugins are available).
add_action('plugins_loaded', [$owlstackPlugin, 'boot']);