<?xml version="1.0"?>
<ruleset name="Pictaffil WordPress Plugin">
    <description>Pictaffil WordPress Plugin coding standards</description>

    <!-- Include the WordPress ruleset, but exclude some rules -->
    <rule ref="WordPress">
        <!-- Rules we explicitly exclude -->
        <exclude name="WordPress.Files.FileName"/>
        <!-- Completely disable text domain checks -->
        <exclude name="WordPress.WP.I18n.TextDomainMismatch"/>
        <exclude name="WordPress.WP.I18n.MissingArgDomain"/>
        <exclude name="WordPress.WP.I18n.NonSingularStringLiteralDomain"/>
        <exclude name="WordPress.WP.I18n.TextDomain" />
        <exclude name="WordPress.WP.I18n.TextDomainMismatch" />
    </rule>

    <!-- Disable textdomain warnings for the plugin headers -->
    <rule ref="WordPress.WP.PluginHeader">
        <properties>
            <property name="strict_header_text_domain" value="false"/>
        </properties>
    </rule>

    <!-- Define the text domain for the plugin but disable strict checking -->
    <config name="text_domain" value="Pictaffil"/>
    
    <!-- Define expected text_domain for i18n functions -->
    <rule ref="WordPress.WP.I18n">
        <properties>
            <property name="text_domain" type="array">
                <element value="Pictaffil"/>
                <!-- Add default text domains -->
                <element value="default"/>
            </property>
        </properties>
    </rule>

    <!-- Check all PHP files in the plugin directory -->
    <file>.</file>
    
    <!-- Exclude common directories that don't need to be checked -->
    <exclude-pattern>*/vendor/*</exclude-pattern>
    <exclude-pattern>*/node_modules/*</exclude-pattern>
    <exclude-pattern>*/tests/*</exclude-pattern>
    <exclude-pattern>*/third-party/*</exclude-pattern>

    <!-- Reduce memory usage by setting a lower memory limit for running PHPCS -->
    <ini name="memory_limit" value="512M"/>
</ruleset>