-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-insights-for-editors.php
69 lines (62 loc) · 1.88 KB
/
content-insights-for-editors.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
<?php
/**
* Plugin Name: Content Insights for Editors
* Description: Analyse content for your website
* Version: 2.2.0
* Author: Whitespace
* Text Domain: content-insights-for-editors
* Domain Path: /languages
*/
// Protect agains direct file access
if (!defined('WPINC')) {
die();
}
define('CONTENT_INSIGHTS_FOR_EDITORS_PATH', plugin_dir_path(__FILE__));
define('CONTENT_INSIGHTS_FOR_EDITORS_URL', plugins_url('', __FILE__));
define(
'CONTENT_INSIGHTS_FOR_EDITORS_MAIL_TEMPLATE_PATH',
CONTENT_INSIGHTS_FOR_EDITORS_PATH . '/mail-templates'
);
add_action('plugins_loaded', function () {
load_plugin_textdomain(
'content-insights-for-editors',
false,
dirname(plugin_basename(__FILE__)) . '/languages'
);
});
require_once CONTENT_INSIGHTS_FOR_EDITORS_PATH .
'source/php/Vendor/Psr4ClassLoader.php';
if (!class_exists('WP_List_Table')) {
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
}
// Instantiate and register the autoloader
$loader = new CONTENT_INSIGHTS_FOR_EDITORS\Vendor\Psr4ClassLoader();
$loader->addPrefix(
'CONTENT_INSIGHTS_FOR_EDITORS',
CONTENT_INSIGHTS_FOR_EDITORS_PATH
);
$loader->addPrefix(
'CONTENT_INSIGHTS_FOR_EDITORS',
CONTENT_INSIGHTS_FOR_EDITORS_PATH . 'source/php/'
);
$loader->register();
add_action(
'plugins_loaded',
function () {
if (!function_exists('register_fields_posttype_select')) {
require_once CONTENT_INSIGHTS_FOR_EDITORS_PATH .
'plugins/acf-post-type-field/acf-posttype-select.php';
}
require_once CONTENT_INSIGHTS_FOR_EDITORS_PATH .
'source/php/AcfFields/php/options-page.php';
},
99
);
register_deactivation_hook(__FILE__, 'cife_decativation');
if (!function_exists('cife_decativation')) {
function cife_decativation() {
wp_clear_scheduled_hook('cife_cron_mail');
}
}
// Start application
new \CONTENT_INSIGHTS_FOR_EDITORS\App();