# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## What this is

Live production WordPress install serving https://kingsheadwye.com (The King's Head, Wye — a pub/restaurant site). This directory **is** the webroot; there is no build pipeline, no staging copy, no git. Edits land on the live site immediately. Treat every change as production.

- WordPress core: 6.9.4
- PHP: 8.1 (pinned via `AddHandler application/x-httpd-ea-php81` in `.htaccess` — cPanel-managed)
- DB: MySQL on `localhost:3306`, table prefix **`CrTab8WT_`** (not the default `wp_`)
- Active theme: `twentytwentyfive` (stock default, unmodified)
- Active plugins: `disable-xml-rpc`, `wp-cloudflare-page-cache` (Super Page Cache), `wordpress-seo` (Yoast)
- `WP_ALLOW_MULTISITE` is `true` in `wp-config.php` but multisite is **not** set up — single site only
- `WP_DEBUG` is off by default; toggle via `wp-config.php` for troubleshooting

## WP-CLI

WP-CLI is installed globally at `/usr/local/bin/wp`. There is no `wp-cli.yml`, so always pass `--path`:

```bash
wp --path=/home/biglinkindex/public_html/kingsheadwye.com <command>
```

Common:
- `wp --path=... plugin list` / `wp --path=... theme list`
- `wp --path=... db query "SELECT ..."` — remember the `CrTab8WT_` prefix
- `wp --path=... cache flush` and `wp --path=... transient delete --all` after changes that touch cached data
- `wp --path=... search-replace OLD NEW --dry-run` before any real search-replace

## Caching — important

WP Cloudflare Super Page Cache is active and ships a dropin at `wp-content/advanced-cache.php`. After any change to theme files, CSS/JS, active plugin code, or content that should appear immediately:

1. Purge via WP admin → **WP Cloudflare Page Cache** → Purge cache, or
2. `wp --path=... cache flush` (WP object cache) **plus** clearing the page cache via the plugin (no direct CLI command — purge through admin or by deleting `wp-content/wp-cloudflare-super-page-cache/kingsheadwye.com/`).

`.htaccess` contains a `# BEGIN WP Cloudflare Super Page Cache` block that sets long `Cache-Control` headers for static assets and is regenerated by the plugin. Don't hand-edit that block — it will be overwritten. The WordPress rewrite block above it is likewise plugin-managed.

## Theme layout

- `wp-content/themes/twentytwentyfive/` — active theme, **untouched default WP theme**. Don't edit it directly; if styling changes are needed, use a child theme or the Site Editor (this is a block theme, driven by `theme.json` + `templates/` + `parts/` + `patterns/`). The theme has a small npm build (`npm run build` produces `style.min.css` via postcss/cssnano) but it's only needed if you modify `style.css` in the parent theme itself.
- `wp-content/themes/code.html` — standalone static HTML mockup using Tailwind CDN + Material Symbols. This is a **design-system reference / visual spec** for the site (colors, typography, layout primitives). It is not served by WordPress and is not part of any theme. Treat it as a design source when building blocks/patterns that need to match the brand.

## Custom code

Only one piece of custom code lives here: `wp-content/plugins/disable-xml-rpc/disable-xml-rpc.php` — a one-line plugin that disables XML-RPC. All other plugins and the theme are upstream/vendor code; do not modify them — changes will be lost on update.

New custom functionality should go in a new plugin under `wp-content/plugins/` (preferred) or a child theme — never in the stock `twentytwentyfive` theme or inside `wp-cloudflare-page-cache` / `wordpress-seo` / `akismet`.

## Editing discipline

- No git history exists in this directory, so changes are not recoverable via `git`. Before editing a file, consider whether a `.bak` copy is warranted — especially for `wp-config.php`, `.htaccess`, and any plugin dropin.
- `wp-config.php` contains live DB credentials and salts. Never commit, paste, or upload it anywhere.
- The `.htaccess` WordPress and Cloudflare blocks are auto-generated; put any custom rules **outside** those markers.
