<?xml version="1.0"?>
<ruleset name="ActiveTrail WooCommerce – Security Only">

    <description>
        WordPress plugin security ruleset.
        Focuses on sanitization, escaping, nonces and SQL safety.
        No formatting, no Yoda, no docs.
    </description>

    <!-- Scope -->
    <file>.</file>
    <exclude-pattern>vendor/*</exclude-pattern>
    <exclude-pattern>node_modules/*</exclude-pattern>
    <exclude-pattern>assets/*</exclude-pattern>
    <exclude-pattern>.gitignore</exclude-pattern>
    <exclude-pattern>.DS_Store</exclude-pattern>
    
    <!-- Note: Text domain 'activetrail-for-woocommerce' is correct per WordPress review requirements -->
    <!-- The warning about textdomain_mismatch is expected and can be ignored -->

    <!-- PHP versions -->
    <config name="testVersion" value="7.4-8.3"/>

    <!-- Text Domain -->
    <config name="text_domain" value="activetrail-for-woocommerce"/>

    <!-- ========================= -->
    <!-- BASE -->
    <!-- ========================= -->

    <rule ref="WordPress-Core">
        <!-- Ignore textdomain_mismatch warning for plugin header -->
        <exclude name="WordPress.WP.I18n.textdomain_mismatch"/>
        <!-- Ignore trademarked term warning - plugin name "ActiveTrail for WooCommerce" is allowed per WordPress guidelines -->
        <exclude name="WordPress.NamingConventions.ValidPluginName"/>
    </rule>

    <!-- ========================= -->
    <!-- SECURITY -->
    <!-- ========================= -->

    <rule ref="WordPress.Security.ValidatedSanitizedInput"/>
    <rule ref="WordPress.Security.EscapeOutput"/>
    <rule ref="WordPress.Security.NonceVerification"/>
    <rule ref="WordPress.DB.PreparedSQL"/>

    <!-- ========================= -->
    <!-- IGNORE NOISE -->
    <!-- ========================= -->

    <!-- Ignore Yoda -->
    <exclude name="WordPress.PHP.YodaConditions"/>

    <!-- Ignore docs -->
    <exclude name="WordPress.Commenting"/>

    <!-- Ignore formatting -->
    <exclude name="WordPress.WhiteSpace"/>
    <exclude name="Generic.WhiteSpace"/>

    <!-- Ignore text domain mismatch - we use 'activetrail-for-woocommerce' as required by WordPress review -->
    <!-- The text domain 'activetrail-for-woocommerce' is correct per WordPress review requirements -->
    <exclude name="WordPress.WP.I18n.TextDomainMismatch"/>
    <exclude name="WordPress.WP.I18n.textdomain_mismatch"/>
    <exclude name="WordPress.WP.textdomain_mismatch"/>
    <exclude name="WordPress.WP.I18n"/>
    <exclude name="WordPress.NamingConventions.ValidPluginName"/>
    <rule ref="WordPress.WP.I18n">
        <exclude name="WordPress.WP.I18n.TextDomainMismatch"/>
        <exclude name="WordPress.WP.I18n.textdomain_mismatch"/>
    </rule>
    

</ruleset>
