Automattic\WooCommerce\Internal\Admin

Events::possibly_refresh_data_source_pollers()protectedWC 1.0

Refresh transient for the following DataSourcePollers on wc_admin_daily cron job.

  • PaymentGatewaySuggestionsDataSourcePoller
  • RemoteFreeExtensionsDataSourcePoller

Method of the class: Events{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->possibly_refresh_data_source_pollers();

Events::possibly_refresh_data_source_pollers() code WC 8.9.0

protected function possibly_refresh_data_source_pollers() {
	$completed_tasks = get_option( 'woocommerce_task_list_tracked_completed_tasks', array() );

	if ( ! in_array( 'payments', $completed_tasks, true ) && ! in_array( 'woocommerce-payments', $completed_tasks, true ) ) {
		PaymentGatewaySuggestionsDataSourcePoller::get_instance()->read_specs_from_data_sources();
	}

	if ( ! in_array( 'store_details', $completed_tasks, true ) && ! in_array( 'marketing', $completed_tasks, true ) ) {
		RemoteFreeExtensionsDataSourcePoller::get_instance()->read_specs_from_data_sources();
	}
}