<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards">
	<description>Apply WordPress Coding Standards</description>

	<!-- WordPress Core currently supports PHP 8.0+. -->
	<config name="testVersion" value="8.0"/>


	<arg name="extensions" value="php" /> <!-- Only sniff PHP files. -->
	<arg name="colors" /><!-- Use colors -->
	<arg value="s" /><!-- Show sniff codes in all reports. -->
	<arg value="p" /><!-- Show progress. -->

	<!-- Prefix globals -->
	<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
		<properties>
			<property name="prefixes" type="string" value="alm" />
			<property name="prefixes" type="string" value="ajax_load_more" />
			<property name="prefixes" type="string" value="AjaxLoadMore" />
		</properties>
	</rule>

	<!-- I18n rules -->
	<rule ref="WordPress.WP.I18n">
		<properties>
			<property name="text_domain" type="string" value="ajax-load-more"/>
		</properties>
	</rule>

	<rule ref="WordPress-Docs" />
	<rule ref="PHPCompatibilityWP" />
	<rule ref="Generic.Arrays.DisallowLongArraySyntax" />

	<rule ref="WordPress">
		<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
		<exclude name="WordPress.NamingConventions.PrefixAllGlobals.ShortPrefixPassed"/>
		<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
		<exclude name="WordPress.WP.PostsPerPage.posts_per_page_posts_per_page"/>
		<exclude name="WordPress.Security.NonceVerification.Recommended" />
		<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
		<exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores" />
		<exclude name="Universal.Files.SeparateFunctionsFromOO.Mixed" />
		<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />
	</rule>

	<!-- Exclude these files and folders -->
	<exclude-pattern>/*.asset.php</exclude-pattern>
	<exclude-pattern>/build/*</exclude-pattern>
	<exclude-pattern>/node_modules/*</exclude-pattern>
	<exclude-pattern>/vendor/*</exclude-pattern>
	<exclude-pattern>/lang/*</exclude-pattern>

	<!-- Allow . in hook names. -->
	<rule ref="WordPress.NamingConventions.ValidHookName">
		<properties>
			<property name="additionalWordDelimiters" value="." />
		</properties>
	</rule>
</ruleset>
