| @@ -1,36 +1,36 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use Beyondwords\Wordpress\Core\Uninstaller; | |
| 3 | +declare( strict_types = 1 ); | |
| 4 | 4 | |
| 5 | +defined( 'ABSPATH' ) || exit; | |
| 6 | + | |
| 7 | +use BeyondWords\Core\Uninstaller; | |
| 8 | + | |
| 5 | 9 | /** |
| 6 | 10 | * Uninstall script for BeyondWords. |
| 7 | 11 | * |
| 8 | - * Executed when BeyondWords is uninstalled via built-in WordPress commands. | |
| 9 | - * | |
| 10 | 12 | * @since 3.7.0 |
| 11 | 13 | * |
| 12 | 14 | * @SuppressWarnings(PHPMD.ExitExpression) |
| 13 | 15 | */ |
| 14 | -function beyondwords_uninstall() | |
| 15 | -{ | |
| 16 | - if ( | |
| 17 | - ! defined('WP_UNINSTALL_PLUGIN') || | |
| 18 | - ! WP_UNINSTALL_PLUGIN || | |
| 19 | - dirname(WP_UNINSTALL_PLUGIN) !== dirname(plugin_basename(__FILE__)) | |
| 20 | - ) { | |
| 21 | - status_header(404); | |
| 16 | +function beyondwords_uninstall() { | |
| 17 | + if ( | |
| 18 | + ! defined( 'WP_UNINSTALL_PLUGIN' ) || | |
| 19 | + ! WP_UNINSTALL_PLUGIN || | |
| 20 | + dirname( WP_UNINSTALL_PLUGIN ) !== dirname( plugin_basename( __FILE__ ) ) | |
| 21 | + ) { | |
| 22 | + status_header( 404 ); | |
| 22 | 23 | exit; // phpcs:ignore |
| 23 | - } | |
| 24 | + } | |
| 24 | 25 | |
| 25 | - if (! defined('BEYONDWORDS__PLUGIN_DIR')) { | |
| 26 | - define('BEYONDWORDS__PLUGIN_DIR', plugin_dir_path(__FILE__)); | |
| 27 | - } | |
| 26 | + if ( ! defined( 'BEYONDWORDS__PLUGIN_DIR' ) ) { | |
| 27 | + define( 'BEYONDWORDS__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); | |
| 28 | + } | |
| 28 | 29 | |
| 29 | - require BEYONDWORDS__PLUGIN_DIR . 'vendor/autoload.php'; | |
| 30 | + require BEYONDWORDS__PLUGIN_DIR . 'vendor/autoload.php'; | |
| 30 | 31 | |
| 31 | - Uninstaller::cleanupPluginOptions(); | |
| 32 | - Uninstaller::cleanupCustomFields(); | |
| 32 | + Uninstaller::run(); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // phpcs:disable |
| 36 | 36 | beyondwords_uninstall(); |