-
Notifications
You must be signed in to change notification settings - Fork 4
/
plugin.php
executable file
·65 lines (55 loc) · 1.94 KB
/
plugin.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
<?php
/**
* WP Scrubber
*
* @package TenUpWPScrubber
*
* @wordpress-plugin
* Plugin Name: WP Scrubber
* Plugin URI: https://github.com/10up/wp-scrubber
* Description: A tool for scrubbing sensitive data from production databases. Available through CLI. Includes actions and filters for extensibility.
* Version: 1.0.3
* Requires PHP: 8.0+
* Author: 10up
* Author URI: https://10up.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Update URI: https://github.com/10up/wp-scrubber
* Text Domain: wp-scrubber
* Domain Path: /languages
*/
// Useful global constants.
define( 'TENUP_WP_SCRUBBER_VERSION', '1.0.3' );
define( 'TENUP_WP_SCRUBBER_URL', plugin_dir_url( __FILE__ ) );
define( 'TENUP_WP_SCRUBBER_PATH', plugin_dir_path( __FILE__ ) );
define( 'TENUP_WP_SCRUBBER_INC', TENUP_WP_SCRUBBER_PATH . 'includes/' );
// Require Composer autoloader if it exists.
if ( file_exists( TENUP_WP_SCRUBBER_PATH . 'vendor/autoload.php' ) ) {
require_once TENUP_WP_SCRUBBER_PATH . 'vendor/autoload.php';
} else {
spl_autoload_register(
// phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames
function ( $class ) {
// project-specific namespace prefix.
$prefix = 'TenUpWPScrubber\\';
// base directory for the namespace prefix.
$base_dir = __DIR__ . '/includes/classes/';
// does the class use the namespace prefix?
$len = strlen( $prefix );
if ( strncmp( $prefix, $class, $len ) !== 0 ) {
return;
}
$relative_class = substr( $class, $len );
$file = $base_dir . str_replace( '\\', '/', $relative_class ) . '.php';
// if the file exists, require it.
if ( file_exists( $file ) ) {
require $file;
}
}
);
// Include files.
require_once TENUP_WP_SCRUBBER_INC . '/core.php';
require_once TENUP_WP_SCRUBBER_INC . '/helpers.php';
}
// Bootstrap.
TenUpWPScrubber\Core\setup();