-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwp-quick-purge-debug.php
82 lines (63 loc) · 2.33 KB
/
wp-quick-purge-debug.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
<?php
/**
* Plugin Name: Quick Purge Debug for WordPress
* Plugin URI: https://github.com/norcross/wp-quick-purge-debug
* Description: Add ways to quickly purge the debug log file.
* Author: Andrew Norcross
* Author URI: https://andrewnorcross.com
* Text Domain: quick-purge-debug
* Domain Path: /languages
* Version: 0.0.2
*
* @package QuickPurgeDebug
*/
// Call our namepsace.
namespace Norcross\QuickPurgeDebug;
// Call our CLI namespace.
use WP_CLI;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
// Define our plugin version.
define( __NAMESPACE__ . '\VERS', '0.0.2' );
// Plugin root file.
define( __NAMESPACE__ . '\FILE', __FILE__ );
// Define our file base.
define( __NAMESPACE__ . '\BASE', plugin_basename( __FILE__ ) );
// Plugin Folder URL.
define( __NAMESPACE__ . '\URL', plugin_dir_url( __FILE__ ) );
// Set our includes path constants.
define( __NAMESPACE__ . '\INCLUDES_PATH', __DIR__ . '/includes' );
// Set the various prefixes for our actions and filters.
define( __NAMESPACE__ . '\HOOK_PREFIX', 'quick_purge_debug_' );
define( __NAMESPACE__ . '\NONCE_PREFIX', 'qk_prgdb_nonce_' );
// Set some defined IDs.
define( __NAMESPACE__ . '\ADMIN_BAR_ID', 'quick-purge-debug-ab' );
// Set the name of the debug file.
define( __NAMESPACE__ . '\DEBUG_LOGFILE', WP_CONTENT_DIR . '/debug.log' );
// Now we handle all the various file loading.
ncr_quick_purge_debug_file_load();
/**
* Actually load our files.
*
* @return void
*/
function ncr_quick_purge_debug_file_load() {
// Pull in the helper.
require_once __DIR__ . '/includes/helpers.php';
// Now our admin pieces.
require_once __DIR__ . '/includes/admin/admin-bar.php';
require_once __DIR__ . '/includes/admin/setup.php';
require_once __DIR__ . '/includes/admin/request.php';
require_once __DIR__ . '/includes/admin/notices.php';
// Check that we have the CLI constant available.
if ( defined( 'WP_CLI' ) && WP_CLI ) {
// Load our commands file.
require_once dirname( __FILE__ ) . '/includes/cli-commands.php';
// And add our command.
WP_CLI::add_command( 'quick-debug-purge', QuickPurgeDebugCLICommands::class );
}
// Load the triggered file loads.
require_once __DIR__ . '/includes/activate.php';
require_once __DIR__ . '/includes/deactivate.php';
require_once __DIR__ . '/includes/uninstall.php';
}