<?xml version="1.0"?>
<ruleset name="WF Cookie Consent">
	<description>Coding standards for the WF Cookie Consent plugin.</description>

	<!-- Only the shipped plugin code lives in trunk/. -->
	<file>trunk</file>

	<!-- Scan PHP only; skip tooling, deps and generated assets. -->
	<arg name="extensions" value="php"/>
	<exclude-pattern>*/node_modules/*</exclude-pattern>
	<exclude-pattern>*/vendor/*</exclude-pattern>
	<exclude-pattern>*/js/*</exclude-pattern>
	<exclude-pattern>*/css/*</exclude-pattern>

	<!-- CLI defaults: relative paths, color, parallel, show sniff codes + progress. -->
	<arg name="basepath" value="."/>
	<arg name="colors"/>
	<arg name="parallel" value="8"/>
	<arg value="ps"/>

	<!-- WordPress best practices + security (omits the strict Docs standard on purpose). -->
	<rule ref="WordPress-Extra">
		<!-- Purely stylistic, no correctness impact; relaxed for this legacy code base. -->
		<exclude name="WordPress.PHP.YodaConditions"/>
		<exclude name="WordPress.NamingConventions.ValidVariableName"/>
	</rule>

	<!-- Verify translatable strings use this plugin's text domain. -->
	<rule ref="WordPress.WP.I18n">
		<properties>
			<property name="text_domain" type="array">
				<element value="wf-cookie-consent"/>
			</property>
		</properties>
	</rule>

	<!-- Verify global functions/constants/hooks are prefixed to avoid collisions. -->
	<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
		<properties>
			<property name="prefixes" type="array">
				<element value="wf_cookieconsent"/>
				<element value="WFCOOKIECONSENT"/>
			</property>
		</properties>
	</rule>

	<!-- Check syntax/functions against the declared minimum PHP and WP versions. -->
	<config name="testVersion" value="7.0-"/>
	<rule ref="PHPCompatibilityWP"/>
	<config name="minimum_wp_version" value="4.7"/>
</ruleset>
