<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Flexible Minimum Order" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
    <description>PHP_CodeSniffer ruleset for Flexible Minimum Order plugin</description>
    
    <!-- Check only PHP files -->
    <file>.</file>
    <exclude-pattern>*/node_modules/*</exclude-pattern>
    <exclude-pattern>*/vendor/*</exclude-pattern>
    <exclude-pattern>*.js</exclude-pattern>
    <exclude-pattern>*.css</exclude-pattern>
    
    <!-- Use WordPress Coding Standards -->
    <config name="minimum_supported_wp_version" value="6.1"/>
    
    <rule ref="WordPress">
        <!-- Exclude text domain mismatch check - we use flexible-minimum-order correctly -->
        <exclude name="WordPress.WP.I18n.TextDomainMismatch"/>
        <!--
            The plugin manages its own custom tables (flexmior_redirects, flexmior_checkout_fields, flexmior_size_charts).
            All $wpdb CRUD on these tables is justified by design. Annotating every call individually
            is noisy; the sniffs below are disabled globally for this reason. Queries against WP core
            tables still go through standard WP APIs.
        -->
        <exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery"/>
        <exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching"/>
    </rule>
    
    <!-- Configure text domain for I18n checks -->
    <rule ref="WordPress.WP.I18n">
        <properties>
            <property name="text_domain" type="array">
                <element value="flexible-minimum-order"/>
            </property>
        </properties>
    </rule>
</ruleset>

