| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: WP Database Reset |
| 4 |
Plugin URI: https://wordpress.org/plugins/wordpress-database-reset/ |
| 5 |
Description: Reset all or some WP database tables back to their original state. |
| 6 |
Version: 3.1 |
| 7 |
Author: WebFactory Ltd |
| 8 |
Author URI: https://www.webfactoryltd.com/ |
| 9 |
License: GNU General Public License |
| 10 |
Text-domain: wordpress-database-reset |
| 11 |
*/ |
| 12 |
|
| 13 |
define( 'DB_RESET_VERSION', '3.1' ); |
| 14 |
define( 'DB_RESET_PATH', dirname( __FILE__ ) ); |
| 15 |
define( 'DB_RESET_NAME', basename( DB_RESET_PATH ) ); |
| 16 |
define( 'DB_RESET_FILE', __FILE__ ); |
| 17 |
define( 'AUTOLOADER', DB_RESET_PATH . '/lib/class-plugin-autoloader.php' ); |
| 18 |
|
| 19 |
require_once( DB_RESET_PATH . '/lib/helpers.php' ); |
| 20 |
|
| 21 |
register_activation_hook( __FILE__, 'db_reset_activate' ); |
| 22 |
|
| 23 |
load_plugin_textdomain( 'wordpress-database-reset' ); |
| 24 |
|
| 25 |
if ( file_exists( AUTOLOADER ) ) { |
| 26 |
require_once( AUTOLOADER ); |
| 27 |
new Plugin_Autoloader( DB_RESET_PATH ); |
| 28 |
|
| 29 |
add_action( |
| 30 |
'wp_loaded', |
| 31 |
array ( new DB_Reset_Manager( DB_RESET_VERSION ), 'run' ) |
| 32 |
); |
| 33 |
} |
| 34 |
|
| 35 |
if ( is_command_line() ) { |
| 36 |
require_once( __DIR__ . '/class-db-reset-command.php' ); |
| 37 |
} |
| 38 |
|