This repository was archived by the owner on Sep 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
65 lines (54 loc) · 2.03 KB
/
plugin.php
File metadata and controls
65 lines (54 loc) · 2.03 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
<?php
/**
* @link https://wordpress.org/plugins/ferret
* @since 1.0.0
* @package Ferret
*
* @wordpress-plugin
* Plugin Name: Ferret
* Plugin URI: https://wordpress.org/plugins/ferret
* Description: Reports all errors to the Sentry error logging service automatically.
* Version: 2.1.0
* Author: LEAP Spark
* Author URI: https://leapsparkagency.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: ferret
* Domain Path: /languages
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* == :: WHAT'S THIS? :: ==========
* We want to use PHP 7.1 or greater. If the version isn't sufficient we show an error and then deactivate/prevent the
* plugin from being activated.
*/
if ( ! version_compare( phpversion(), '7.1', '>=' ) ) {
add_action( 'admin_init', function () {
deactivate_plugins( plugin_basename( __FILE__ ) );
} );
add_action( 'admin_notices', function () {
?>
<div class="notice notice-error is-dismissible">
<p><?php _e( 'Ferret is not compatible with your version of PHP. You need at least PHP 7.1 or greater.',
FERRET_PLUGIN_NAME ); ?></p>
</div>
<?php
if ( isset( $_GET['activate'] ) ) {
unset( $_GET['activate'] );
}
} );
} else {
require_once __DIR__ . '/vendor/autoload.php';
define( 'FERRET_VERSION', '2.1.0' );
define( 'FERRET_PLUGIN_NAME', 'ferret' );
define( 'FERRET_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
require_once FERRET_PLUGIN_PATH . 'includes/functions.php';
require_once FERRET_PLUGIN_PATH . 'includes/options.php';
require_once FERRET_PLUGIN_PATH . 'includes/loader.php';
require_once FERRET_PLUGIN_PATH . 'includes/sentry-adapter.php';
require_once FERRET_PLUGIN_PATH . 'admin/admin.php';
require_once FERRET_PLUGIN_PATH . 'public/client.php';
require_once FERRET_PLUGIN_PATH . 'includes/ferret.php';
}