HEX
Server: nginx/1.20.1
System: Linux VM-0-8-centos 3.10.0-1160.11.1.el7.x86_64 #1 SMP Fri Dec 18 16:34:56 UTC 2020 x86_64
User: www (1000)
PHP: 7.3.29
Disabled: passthru,system,chroot,chgrp,chown,shell_exec,popen,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,popepassthru,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.ycfawu.com/wp-content/plugins/woocommerce-paypal-payments/uninstall.php
<?php
/**
 * Uninstalls the plugin.
 *
 * @package WooCommerce\PayPalCommerce
 */

declare(strict_types=1);

use WooCommerce\PayPalCommerce\Uninstall\ClearDatabaseInterface;
use WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer;
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;

if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	die( 'Direct access not allowed.' );
}

$root_dir = __DIR__;
$main_plugin_file = "{$root_dir}/woocommerce-paypal-payments.php";

if ( !file_exists( $main_plugin_file ) ) {
    return;
}

require $main_plugin_file;

( static function (string $root_dir): void {

	$autoload_filepath = "{$root_dir}/vendor/autoload.php";
	if ( file_exists( $autoload_filepath ) && ! class_exists( '\WooCommerce\PayPalCommerce\PluginModule' ) ) {
		require $autoload_filepath;
	}

	try {
		$bootstrap = require "{$root_dir}/bootstrap.php";

		$app_container = $bootstrap( $root_dir );
		assert( $app_container instanceof CachingContainer );

		$settings = $app_container->get( 'wcgateway.settings' );
		assert( $settings instanceof Settings );

		$should_clear_db = $settings->has( 'uninstall_clear_db_on_uninstall' ) && $settings->get( 'uninstall_clear_db_on_uninstall' );
		if ( ! $should_clear_db ) {
			return;
		}

		$clear_db = $app_container->get( 'uninstall.clear-db' );
		assert( $clear_db instanceof ClearDatabaseInterface );

		$option_names           = $app_container->get( 'uninstall.ppcp-all-option-names' );
		$scheduled_action_names = $app_container->get( 'uninstall.ppcp-all-scheduled-action-names' );

		$clear_db->delete_options( $option_names );
		$clear_db->clear_scheduled_actions( $scheduled_action_names );
	} catch ( Throwable $throwable ) {
		$message = sprintf(
			'<strong>Error:</strong> %s <br><pre>%s</pre>',
			$throwable->getMessage(),
			$throwable->getTraceAsString()
		);

		add_action(
			'all_admin_notices',
			static function () use ( $message ) {
				$class = 'notice notice-error';
				printf(
					'<div class="%1$s"><p>%2$s</p></div>',
					esc_attr( $class ),
					wp_kses_post( $message )
				);
			}
		);
	}
} )($root_dir);