PluginProbe ʕ •ᴥ•ʔ
WooCommerce PayPal Payments / 4.1.0
WooCommerce PayPal Payments v4.1.0
4.1.0 4.0.4 4.0.3 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1.0 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.4.0 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.7.0 1.7.1 1.8.0 1.8.1 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.4.0 2.4.1 2.4.2 2.4.3 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.6.0 2.6.1 2.7.0 2.7.1 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 4.0.0 4.0.1 4.0.2
woocommerce-paypal-payments / uninstall.php
woocommerce-paypal-payments Last commit date
api 3 months ago assets 1 week ago lib 3 months ago modules 1 week ago src 1 month ago vendor 1 week ago LICENSE 5 years ago bootstrap.php 9 months ago changelog.txt 1 week ago modules.php 1 week ago readme.txt 1 week ago uninstall.php 1 month ago woocommerce-paypal-payments.php 1 week ago
uninstall.php
58 lines
1 <?php
2
3 /**
4 * Uninstalls the plugin.
5 *
6 * @package WooCommerce\PayPalCommerce
7 */
8 declare (strict_types=1);
9 namespace WooCommerce\PayPalCommerce;
10
11 use Throwable;
12 use WooCommerce\PayPalCommerce\Uninstall\ClearDatabase;
13 use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
14 use WooCommerce\PayPalCommerce\Settings\Data\GeneralSettings;
15 if (!defined('WP_UNINSTALL_PLUGIN')) {
16 die('Direct access not allowed.');
17 }
18 $root_dir = __DIR__;
19 $main_plugin_file = "{$root_dir}/woocommerce-paypal-payments.php";
20 if (!file_exists($main_plugin_file)) {
21 return;
22 }
23 require $main_plugin_file;
24 (static function (string $root_dir): void {
25 $autoload_filepath = "{$root_dir}/vendor/autoload.php";
26 if (file_exists($autoload_filepath) && !class_exists('\WooCommerce\PayPalCommerce\PluginModule')) {
27 require $autoload_filepath;
28 }
29 $bootstrap = require "{$root_dir}/bootstrap.php";
30 $app_container = $bootstrap($root_dir);
31 assert($app_container instanceof ContainerInterface);
32 $general_settings = $app_container->get('settings.data.general');
33 assert($general_settings instanceof GeneralSettings);
34 /**
35 * Delete the branded flag unconditionally so reinstalling from a different
36 * source (e.g. WordPress.org) does not silently re-enter branded-only mode.
37 * Unlike most settings, this flag must be cleared on every uninstall — even
38 * when the full-reset filter is off — because keeping it prevents merchants
39 * from ever escaping branded-only mode without direct DB intervention.
40 */
41 delete_option('woocommerce_paypal_branded');
42 if ($general_settings->reset_installation_path('plugin_uninstall')) {
43 $general_settings->save();
44 }
45 /**
46 * Allows a full reset of the plugin data.
47 *
48 * By default, this is false, preserving plugin settings in the DB during uninstallation.
49 * This filter has no toggle in the UI yet and can only be set using custom code.
50 */
51 $should_reset_db = apply_filters('woocommerce_paypal_payments_uninstall_full_reset', \false);
52 if ($should_reset_db) {
53 $clear_db = $app_container->get('uninstall.clear-db');
54 assert($clear_db instanceof ClearDatabase);
55 $clear_db->clean_up();
56 }
57 })($root_dir);
58