-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththrail-crm.php
98 lines (80 loc) · 2.11 KB
/
thrail-crm.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
<?php
/**
* Plugin Name: Thrail CRM
* Plugin URI: https://github.com/sadekur/thrail-crm
* Description: Thrail CRM is a powerful WordPress plugin designed to help you manage your customer relationships efficiently. Capture leads, manage them with ease, and automate email communication.
* Version: 1.0.1
* Require plugin: FluentSMTP
* Requires at least: 5.9
* Requires PHP: 7.4
* Author: Sadekur Rahman
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: thrail-crm
* Domain Path: /languages
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
require_once __DIR__ . '/vendor/autoload.php';
require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
register_activation_hook(__FILE__, 'thrail_crm_activate');
/**
* The main plugin class
*/
final class Thrail_Crm{
/**
* Plugin version
*
* @var string
*/
const version = '1.0';
/**
* Class construcotr
*/
private function __construct() {
$this->define_constants();
add_action( 'plugins_loaded', [ $this, 'init_plugin' ] );
}
public static function init() {
static $instance = false;
if ( ! $instance ) {
$instance = new self();
}
return $instance;
}
/**
* Define the required plugin constants
*
* @return void
*/
public function define_constants() {
define( 'THRAIL_CRM_VERSION', self::version );
define( 'THRAIL_CRM_FILE', __FILE__ );
define( 'THRAIL_CRM_PATH', __DIR__ );
define( 'THRAIL_CRM_URL', plugins_url( '', THRAIL_CRM_FILE ) );
define( 'THRAIL_CRM_ASSETS', THRAIL_CRM_URL . '/assets' );
}
/**
* Initialize the plugin
*
* @return void
*/
public function init_plugin() {
new Thrail\Crm\Assets();
new Thrail\Crm\Email();
new Thrail\Crm\RestAPI();
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
new Thrail\Crm\Ajax();
}
if ( is_admin() ) {
new Thrail\Crm\Admin();
} else {
new Thrail\Crm\Frontend();
}
}
}
function thrail_crm() {
return Thrail_Crm::init();
}
thrail_crm();