<?php
/**
 * Example integration for another WD Online plugin.
 *
 * This file is documentation only and is not loaded by Support Diagnostics.
 */

add_filter(
	'wdo_support_diagnostics_providers',
	function ( $providers ) {
		$providers['wd-example-plugin'] = array(
			'name'    => 'WD Example Plugin',
			'version' => '1.2.3',
			'tests'   => function () {
				return array(
					array(
						'id'      => 'dependency-check',
						'label'   => 'WooCommerce dependency',
						'status'  => class_exists( 'WooCommerce' ) ? 'good' : 'critical',
						'message' => class_exists( 'WooCommerce' ) ? 'WooCommerce is available.' : 'WooCommerce is missing.',
						'code'    => 'WDO-EX-0001',
					),
				);
			},
		);

		return $providers;
	}
);

if ( function_exists( 'wdo_support_diagnostics_log' ) ) {
	wdo_support_diagnostics_log(
		'wd-example-plugin',
		'WDO-EX-0101',
		'Example workflow reached the calculation step.',
		array(
			'item_count' => 3,
			'mode'       => 'automatic',
		)
	);
}
