-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompletionist.php
More file actions
137 lines (118 loc) · 3.54 KB
/
completionist.php
File metadata and controls
137 lines (118 loc) · 3.54 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/**
* Completionist
*
* @author Michelle Blanchette <michelle@purpleturtlecreative.com>
* @copyright 2025 Purple Turtle Creative, LLC
* @license GPL-3.0-or-later
*
* @wordpress-plugin
* Plugin Name: Completionist – Asana for WordPress
* Plugin URI: https://purpleturtlecreative.com/completionist/
* Description: Manage, pin, automate, and display Asana tasks in relevant areas of your WordPress admin and website frontend.
* Version: 4.6.1
* Requires PHP: 8.1
* Requires at least: 6.6
* Tested up to: 6.8
* Author: Purple Turtle Creative
* Author URI: https://purpleturtlecreative.com/
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.txt
*/
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
*/
namespace PTC_Completionist;
defined( 'ABSPATH' ) || die();
/**
* The full file path to this plugin's main file.
*
* @since 3.0.0
*/
define( 'PTC_Completionist\PLUGIN_FILE', __FILE__ );
/**
* The full file path to this plugin's directory ending with a slash.
*
* @since 3.0.0
*/
define( 'PTC_Completionist\PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
/**
* This plugin's current version.
*
* @since 3.0.0
*/
define( 'PTC_Completionist\PLUGIN_VERSION', get_file_data( __FILE__, array( 'Version' => 'Version' ), 'plugin' )['Version'] );
/**
* This plugin's basename.
*
* @since 3.0.0
*/
define( 'PTC_Completionist\PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
/**
* This plugin's directory basename.
*
* @since 3.2.0
*/
define( 'PTC_Completionist\PLUGIN_SLUG', dirname( PLUGIN_BASENAME ) );
/**
* The full url to this plugin's directory, NOT ending with a slash.
*
* @since 3.0.0
*/
define( 'PTC_Completionist\PLUGIN_URL', plugins_url( '', __FILE__ ) );
/**
* The namespace for all v1 REST API routes registered by this plugin.
*
* @since 3.4.0
*
* @var string REST_API_NAMESPACE_V1
*/
define( 'PTC_Completionist\REST_API_NAMESPACE_V1', PLUGIN_SLUG . '/v1' );
/* REGISTER PLUGIN FUNCTIONS ---------------------- */
/**
* Initializes the plugin's code.
*
* This ensures all variables are contained within the declared
* namespace to not contaminate the global namespace.
*
* @since 4.0.0
*/
function init() {
// Register class autoloading.
require_once PLUGIN_PATH . 'src/includes/class-autoloader.php';
Autoloader::register();
// Plugins loaded.
add_action(
'plugins_loaded',
function () {
// Ensure database tables are installed.
Database_Manager::init();
Database_Manager::install_all_tables();
// Enqueue automation actions.
Automations\Events::add_actions();
}
);
// Register public functionality.
Admin_Notices::register();
Request_Token::register();
REST_Server::register();
Shortcodes::register();
Uninstaller::register();
Upgrader::register();
// Register admin functionality.
if ( is_admin() ) {
Admin_Pages::register();
Admin_Widgets::register();
}
}
// Load the plugin code.
init();