PluginProbe
Debug Log Manager – Conveniently Monitor and Inspect Errors / 1.6.2
Debug Log Manager – Conveniently Monitor and Inspect Errors v1.6.2
2.5.2 2.5.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.3.0 1.3.1 1.3.3 1.4.0 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.8.0 1.8.2 1.8.3 1.8.4 All 49 releases
debug-log-manager / debug-log-manager.php

debug-log-manager.php in Debug Log Manager – Conveniently Monitor and Inspect Errors 1.6.2, at debug-log-manager.php

85 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: Debug Log Manager
5 * Plugin URI: https://wordpress.org/plugins/debug-log-manager/
6 * Description: Log errors via WP_DEBUG. Create, view and clear debug.log file.
7 * Version: 1.6.2
8 * Author: Bowo
9 * Author URI: https://bowo.io
10 * License: GPL-2.0+
11 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
12 * Text Domain: debug-log-manager
13 * Domain Path: /languages
14 */
15
16 // If this file is called directly, abort.
17 if ( ! defined( 'ABSPATH' ) ) {
18 exit;
19 }
20
21 define( 'DLM_VERSION', '1.6.2' );
22 define( 'DLM_SLUG', 'debug-log-manager' );
23 define( 'DLM_URL', plugins_url( '/', __FILE__ ) );
24 define( 'DLM_PATH', plugin_dir_path( __FILE__ ) );
25 // define( 'DLM_BASE', plugin_basename( __FILE__ ) );
26 // define( 'DLM_FILE', __FILE__ );
27
28 // Register autoloading classes
29 spl_autoload_register( 'dlm_autoloader' );
30
31 /**
32 * Autoload classes defined by this plugin
33 *
34 * @param string $class_name e.g. \DLM\Classes\The_Name
35 * @since 1.2.0
36 */
37 function dlm_autoloader( $class_name ) {
38
39 $namespace = 'DLM';
40
41 if ( false !== strpos( $class_name, $namespace ) ) {
42
43 // Assemble file path for the class
44 $path = str_replace( $namespace, "", $class_name ); // \DLM\Classes\The_Name => \Classes\The_Name
45 $path = str_replace( "\\", DIRECTORY_SEPARATOR, strtolower( $path ) ); // => /classes/the_name
46 $path = str_replace( "_", "-" , $path ) . '.php'; // => /classes/the-name.php
47 $path = str_replace( "classes" . DIRECTORY_SEPARATOR, "classes" . DIRECTORY_SEPARATOR . "class-", $path ); // => /classes/class-the-name.php
48 $path = DLM_PATH . $path; // => /plugin-path/classes/class-the-name.php
49
50 if ( file_exists( $path ) ) {
51 require_once( $path );
52 }
53
54 }
55
56 }
57
58 /**
59 * Code that runs on plugin activation
60 *
61 * @since 1.0.0
62 */
63 function dlm_on_activation() {
64 $activation = new DLM\Classes\Activation;
65 $activation->activate();
66 }
67
68 /**
69 * Code that runs on plugin deactivation
70 *
71 * @since 1.0.0
72 */
73 function dlm_on_deactivation() {
74 $deactivation = new DLM\Classes\Deactivation;
75 $deactivation->deactivate();
76 }
77
78 // Register code that runs on plugin activation
79 register_activation_hook( __FILE__, 'dlm_on_activation');
80
81 // Register code that runs on plugin deactivation
82 register_deactivation_hook( __FILE__, 'dlm_on_deactivation' );
83
84 // Bootstrap the core functionalities of this plugin
85 require DLM_PATH . 'bootstrap.php';