<?xml version="1.0"?>
<ruleset name="Checkout Origin Guard">
  <description>Local PHPCS rules scoped for this plugin.</description>

  <!-- Use WordPress coding standards -->
  <rule ref="WordPress-Core" />
  <rule ref="WordPress-Docs" />
  <rule ref="WordPress-Extra" />

  <!-- Keep WP version context consistent -->
  <config name="minimum_supported_wp_version" value="6.0" />

  <!-- Only analyze this plugin file by default -->
  <file>checkout-origin-guard.php</file>

  <!-- Allow direct queries in THIS file only (custom logging table). -->
  <rule ref="WordPress.DB.DirectDatabaseQuery.DirectQuery">
    <exclude-pattern>*/checkout-origin-guard.php</exclude-pattern>
  </rule>
  <rule ref="WordPress.DB.DirectDatabaseQuery.NoCaching">
    <exclude-pattern>*/checkout-origin-guard.php</exclude-pattern>
  </rule>

  <!-- Be chatty in CLI: phpcs -p -->
  <arg value="p"/>
</ruleset>
