=== PIR Site Structure Mapper ===
Contributors: fgauer
Donate link: https://pirsolutions.com
Tags: site map, templates, navigation, theme analysis, link checker
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Visualize your WordPress site structure — templates, pages, navigation flow, widget areas, and link health — all in one dashboard.

== Description ==

PIR Site Structure Mapper gives you a complete visual map of how your WordPress site is structured. It reads your theme's templates, pages, navigation menus, and content links, then presents everything in an interactive dashboard so you can understand and manage your site architecture at a glance.

**Works with three theme types:**

* **Block themes (Full Site Editing)** — templates, template parts, patterns, block trees, and the full template hierarchy
* **Elementor sites** — Theme Builder templates, saved templates, widget trees, display conditions, and navigation
* **Classic themes** — PHP template files, template hierarchy resolution, widget areas, and navigation menus

**Key features:**

* **Site Navigation** — visual flow map showing how pages connect through menus, content links, and template links
* **Template analysis** — see which templates exist, which pages use them, and how the template hierarchy resolves
* **Page inspector** — template resolution chain, content block/widget trees, and link analysis per page
* **Link health** — internal, external, and unresolved links with live verification via HTTP HEAD requests
* **Live crawl** — HTTP-based site crawling to discover pages and links as rendered
* **Widget areas** (classic themes) — registered sidebars and their active widgets
* **Plugin routes** — custom post types, taxonomies, and special pages registered by plugins
* **Guard system** — configurable safety limits prevent runaway processing on large sites

== Installation ==

1. Upload the `pir-site-structure-mapper` folder to `/wp-content/plugins/`
2. Activate the plugin through the Plugins menu in WordPress
3. Click "PIR Site Structure Mapper" in the admin sidebar to open the dashboard

The plugin works immediately with no configuration required. It automatically detects your theme type (block, Elementor, or classic) and loads the appropriate data provider.

== Frequently Asked Questions ==

= Which themes are supported? =

All three major WordPress theme types: block themes (FSE), Elementor-built sites, and classic PHP themes. The plugin detects your theme type automatically.

= Does this plugin modify my site? =

No. PIR Site Structure Mapper is read-only. It reads your existing theme files, templates, pages, menus, and widgets but never modifies them. The only data it stores is a version number and a welcome notice flag.

= Will this slow down my site? =

The plugin only loads on its own admin dashboard page. It does not add any code to your public-facing site, so there is no performance impact for visitors.

= What happens on very large sites? =

The plugin includes a guard system with configurable limits for block nesting depth, crawl page counts, and link extraction. Safety limits prevent excessive processing and are displayed in the dashboard if triggered.

== Screenshots ==

1. Site Navigation flow — visual map of your site's navigation structure and link relationships
2. Template analysis — categorized template list with source badges and page usage
3. Page inspector — template hierarchy resolution, content blocks, and link analysis
4. Widget Areas — registered sidebars and active widgets (classic themes)
5. Live crawl — HTTP-based site discovery with link verification

== Development ==

The full source code for this plugin is publicly available at:
https://bitbucket.org/fgauer/wp-plugin-visual-editor/

= Source Files =

The compiled files in `build/` are generated from human-readable source code included in the plugin:

* `src/admin/` — Admin dashboard React components and CSS (builds to `build/admin.js` and `build/style-admin.css`)
* `src/public/` — Public-facing JS and CSS (builds to `build/public.js` and `build/style-public.css`)

= Build Tools =

* Node.js (LTS recommended)
* `@wordpress/scripts` — WordPress wrapper around webpack, Babel, and PostCSS

= Building from Source =

To regenerate the compiled files:

1. Install dependencies: `npm install`
2. Build assets: `npm run build`
3. For development with live reload: `npm start`

= Third-Party Libraries =

All JavaScript dependencies are WordPress core packages (`@wordpress/element`, `@wordpress/api-fetch`, `@wordpress/components`, etc.) loaded at runtime via the WordPress script dependency system. No third-party libraries are bundled into the compiled files.

== Changelog ==

= 1.0.0 =
* Initial release
* Block theme (FSE) data provider — templates, patterns, pages, navigation
* Elementor data provider — Theme Builder templates, saved templates, pages, navigation
* Classic theme data provider — template files, pages, navigation, widget areas
* Site Navigation panel with live crawl and link verification
* Theme Info, Templates, Patterns, Pages, and Widget Areas panels
* Plugin routes detection (CPTs, taxonomies, special pages)
* Guard system with configurable safety limits

== Upgrade Notice ==

= 1.0.0 =
Initial release.
