| 1 |
<?php |
| 2 |
declare(strict_types=1); |
| 3 |
|
| 4 |
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 5 |
http_response_code( 404 ); |
| 6 |
echo '404 Not Found'; |
| 7 |
exit; |
| 8 |
} |
| 9 |
|
| 10 |
if ( ! defined( 'BOTBLOCKER' ) ) { |
| 11 |
define( 'BOTBLOCKER', true ); |
| 12 |
} |
| 13 |
define( 'BOTBLOCKER_DIR', plugin_dir_path( __FILE__ ) ); |
| 14 |
|
| 15 |
if ( |
| 16 |
! file_exists( BOTBLOCKER_DIR . 'includes/inc-botblocker-define.php' ) |
| 17 |
|| ! file_exists( BOTBLOCKER_DIR . 'includes/database/inc-botblocker-tables.php' ) |
| 18 |
|| ! file_exists( BOTBLOCKER_DIR . 'includes/install/class-botblocker-install.php' ) |
| 19 |
) { |
| 20 |
if ( defined( 'BBCS_DEBUG' ) && BBCS_DEBUG ) { |
| 21 |
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log |
| 22 |
error_log( '[BBCS DEBUG] [Uninstall] Required files missing, aborting.' ); |
| 23 |
} |
| 24 |
exit; |
| 25 |
} |
| 26 |
|
| 27 |
require_once BOTBLOCKER_DIR . 'includes/inc-botblocker-define.php'; |
| 28 |
require_once BOTBLOCKER_DIR . 'includes/database/inc-botblocker-tables.php'; |
| 29 |
require_once BOTBLOCKER_DIR . 'includes/install/class-botblocker-install.php'; |
| 30 |
require_once BOTBLOCKER_DIR . 'includes/cron/class-botblocker-cron.php'; |
| 31 |
require_once BOTBLOCKER_DIR . 'includes/install/class-botblocker-uninstaller.php'; |
| 32 |
|
| 33 |
Botblocker_Uninstaller::uninstall(); |
| 34 |
|