-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjerc.php
97 lines (88 loc) · 2.17 KB
/
jerc.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
<?php
/**
* A Wordpress Plugin to collect and report Javascript errors back to the site.
*
* PHP version 7
*
* @category WP-Plugin
* @package Jerc
* @author James Amner <jdamner@me.com>
* @license GNU GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
* @link https://amner.me
* @since 1.0.0
*
* @wordpress-plugin
* Plugin Name: Javascript Error Reporting Client
* Plugin URI: https://www.amner.me/
* Description: A plugin to collect data about client javascript errors.
* Version: 1.0.3
* Author: James Amner <jdamner@me.com>
* Author URI: https://www.amner.me
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
// Check we can access some core WP functions, just to make sure we're in WP land!
if (!(is_callable('plugin_dir_path') && is_callable('register_activation_hook') && is_callable('register_deactivation_hook'))) {
die;
}
/**
* The plugin version
*
* @var string The plugin version
*/
define('JERC_VERSION', '1.0.3');
/**
* Activation Function
*
* Calls in the relevant class and fires the activation routines.
*
* @return void
*/
function activateJerc()
{
include_once plugin_dir_path(__FILE__) . 'includes/class-jerc-activator.php';
JercActivator::activate();
}
/**
* Deactivation Function
*
* Calls in the relevant class and fires the deactivation routines.
*
* @return void
*/
function deactivateJerc()
{
include_once plugin_dir_path(__FILE__) . 'includes/class-jerc-deactivator.php';
JercDeactivator::deactivate();
}
/**
* Register the functions against their hooks
*/
register_activation_hook(__FILE__, 'activateJerc');
register_deactivation_hook(__FILE__, 'deactivateJerc');
/**
* Include the main class file.
*/
require plugin_dir_path(__FILE__) . 'includes/class-jerc.php';
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*
* @return void
*/
function runJerc()
{
/**
* Instatiate the plugin and run
*/
$plugin = new Jerc();
$plugin->run();
}
runJerc();