forked from jameschaya/celerate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcelerate.php
More file actions
83 lines (73 loc) · 2.05 KB
/
celerate.php
File metadata and controls
83 lines (73 loc) · 2.05 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* Celerate
*
* Turn every inquiry into action: organize leads and get reminded to follow up.
*
* Plugin Name: Celerate - Lead Management & Follow-up Tracker
* Plugin URI: https://github.com/jameschaya/celerate
* Description: A lightweight, action-oriented lead manager.
* Author: James Chaya
* Author URI: https://github.com/jameschaya
* Version: 0.1.0
* Requires at least: 6.0
* Requires PHP: 7.4
* Text Domain: celerate
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* Domain Path: /languages
*
* @since 0.1.0
* @author James Chaya
* @license GNU General Public License, version 3
* @copyright James Chaya
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
// Plugin version.
define( 'CELERATE_VERSION', '0.1.0' );
// Absolute path to the plugin dir (with trailing slash).
define( 'CELERATE_PATH', plugin_dir_path( __FILE__ ) );
// URL to the plugin dir (with trailing slash).
define( 'CELERATE_URL', plugin_dir_url( __FILE__ ) );
// Plugin basename
define( 'CELERATE_BASENAME', plugin_basename( __FILE__ ) );
/**
* Load Composer autoloader.
*/
if ( file_exists( CELERATE_PATH . 'vendor/autoload.php' ) ) {
require_once CELERATE_PATH . 'vendor/autoload.php';
}
/**
* Runs on plugin activation.
*
* @since 0.1.0
*/
function celerate_activate() {
\Celerate\Database::create_table();
\Celerate\Reminders::schedule_cron();
}
register_activation_hook( __FILE__, 'celerate_activate' );
/**
* Runs on plugin deactivation.
*
* @since 0.1.0
*/
function celerate_deactivate() {
\Celerate\Reminders::clear_cron();
}
register_deactivation_hook( __FILE__, 'celerate_deactivate' );
/**
* Bootstraps the plugin.
*
* @since 0.1.0
*/
function celerate_init() {
// Boot the admin menu
if ( is_admin() ) {
new \Celerate\Admin\Menu();
}
// Always register the cron callback so it fires even outside the admin.
\Celerate\Reminders::init();
}
add_action( 'plugins_loaded', 'celerate_init' );