forked from JJJ/ab-testing-for-wp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathab-testing-for-wp.php
More file actions
66 lines (58 loc) · 1.89 KB
/
ab-testing-for-wp.php
File metadata and controls
66 lines (58 loc) · 1.89 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
<?php
/**
* @package ABTestingForWP
* @version 1.18.2
*/
/*
Plugin Name: A/B Testing for WordPress
Plugin URI: https://abtestingforwp.com
Description: Easiest way to create split tests on your WordPress sites, right from the content editor!
Version: 1.18.2
Author: CleverNode
Author URI: https://theclevernode.com
Text Domain: ab-testing-for-wp
License: GPL v3
Copyright 2019 - CleverNode
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 <http://www.gnu.org/licenses/>.
*/
namespace ABTestingForWP;
if (!defined('ABSPATH')) {
header('Status: 403 Forbidden');
header('HTTP/1.1 403 Forbidden');
exit;
}
require __DIR__ . '/vendor/autoload.php';
function bootstrap() {
// on every request
new RegisterGutenbergBlocks(__FILE__);
new RegisterCustomPostType();
new RegisterShortcode();
new BootStrapIntegrations();
// only on admin
if(is_admin()) {
if(!defined('DOING_AJAX') || !DOING_AJAX) {
new RegisterAdminPage(__FILE__);
}
}
// only on frontend
if(!is_admin()) {
new RegisterRenderScripts(__FILE__);
new RegisterFrontendAdminBar(__FILE__);
}
}
function bootstrapREST() {
new RegisterREST();
}
// register WordPress hooks
new Installer(__FILE__);
bootstrap();
add_action('rest_api_init', 'ABTestingForWP\\bootstrapREST');