generated from 10up/plugin-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsophi-debug-bar.php
executable file
·50 lines (43 loc) · 1.89 KB
/
sophi-debug-bar.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
<?php
/**
* Plugin Name: Debug Bar for Sophi
* Plugin URI: https://github.com/10up/sophi-debug-bar
* Description: Extends the Debug Bar plugin for the Sophi.io Site Automation service.
* Version: 0.3.0
* Requires at least: 5.6
* Requires PHP: 7.4
* Author: 10up
* Author URI: https://10up.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: debug-bar-for-sophi
*
* @package SophiDebugBar
*/
// Useful global constants.
define( 'SOPHI_DEBUG_BAR_VERSION', '0.3.0' );
define( 'SOPHI_DEBUG_BAR_URL', plugin_dir_url( __FILE__ ) );
define( 'SOPHI_DEBUG_BAR_PATH', plugin_dir_path( __FILE__ ) );
define( 'SOPHI_DEBUG_BAR_PLUGIN', plugin_basename( __FILE__ ) );
define( 'SOPHI_DEBUG_BAR_INC', SOPHI_DEBUG_BAR_PATH . 'includes/' );
$upload_dir = wp_upload_dir( null, false );
define( 'SOPHI_DEBUG_BAR_LOG_PATH', $upload_dir['basedir'] . '/sophi-logs' );
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG && file_exists( __DIR__ . '/dist/fast-refresh.php' ) ) {
require_once __DIR__ . '/dist/fast-refresh.php';
TenUpToolkit\set_dist_url_path( basename( __DIR__ ), SOPHI_DEBUG_BAR_URL . 'dist/', SOPHI_DEBUG_BAR_PATH . 'dist/' );
}
// Require Composer autoloader if it exists.
if ( file_exists( SOPHI_DEBUG_BAR_PATH . 'vendor/autoload.php' ) ) {
require_once SOPHI_DEBUG_BAR_PATH . 'vendor/autoload.php';
}
// Include files.
require_once SOPHI_DEBUG_BAR_INC . '/utility.php';
require_once SOPHI_DEBUG_BAR_INC . '/core.php';
require_once SOPHI_DEBUG_BAR_INC . '/log.php';
// Activation/Deactivation.
register_activation_hook( __FILE__, '\SophiDebugBar\Core\activate' );
register_deactivation_hook( __FILE__, '\SophiDebugBar\Core\deactivate' );
// Activate Debug Bar on WP VIP.
add_filter( 'debug_bar_enable', '__return_true' );
// Bootstrap.
add_action( 'init', 'SophiDebugBar\Core\setup' );