| 开发者 | blincks |
|---|---|
| 更新时间 | 2026年5月10日 01:52 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
node_modules, vendor, build artifacts, or anything you don't want bloating your context.php, .js, .css, .jsonnode_modules, .git, vendor)wp structure-viewer export plugin <folder-name>
wp structure-viewer export theme <folder-name>
wp structure-viewer list plugins
wp structure-viewer list themes
🚀 Structure Viewer Pro
Unlock two powerful Pro tools for developers who need to go deeper.
🔀 Comparator — Know Exactly What Changed
Ever updated a plugin and wondered what actually changed? Comparator shows you a precise, color-coded, line-by-line diff between any two versions — so you can audit updates, review customizations, and catch unwanted changes before they cause problems.
manage_options capability required — administrators only, no public accessrealpath() and verifiedwp_unslash() + sanitize_text_field() before use.htaccess deny rulesStructure Viewer is a WordPress developer tool that lets you browse, search, view, and export the file structure of any installed plugin or theme — directly from your WordPress admin dashboard. It is used for code audits, plugin reviews, documentation, debugging, AI-assisted development, and general development workflows.
When you prompt an AI tool like ChatGPT, Claude, Cursor, or GitHub Copilot to work on a WordPress plugin or theme, the quality of its output depends almost entirely on the context you provide. Structure Viewer is built to make that first step painless. Instead of opening files one at a time and copy-pasting code into a chat, you can: export the complete file tree of any plugin or theme as a single clean TXT, JSON, or XML payload; copy it to your clipboard with one click; paste it into your AI prompt as ready-to-use structural context. The AI now knows what files exist, how they're organised, and where to look — before you've even asked it a question. From there, you can drill into specific files in the browser modal and copy targeted snippets as needed. For larger workflows, Structure Viewer Pro adds Comparator (so you can give the AI just the diff between two versions instead of two whole codebases) and FlatPack (so you can hand the AI only the PHP files, only the CSS, or any subset that matters for the task).
Yes — that is one of the main use cases. Use the Export tab to generate a TXT, JSON, or XML representation of any plugin or theme. The TXT format is intentionally token-efficient — clean ASCII tree, no markdown noise — so it fits cleanly inside an AI context window. You can also use the one-click clipboard copy to paste an emoji tree directly into ChatGPT, Claude, Cursor, or any other AI chat interface.
No. Structure Viewer works entirely through the WordPress admin interface. You do not need FTP, cPanel, SSH, or any server-level access. If you are a WordPress administrator, you have everything you need.
Only users with the manage_options capability — WordPress administrators by default. There is no frontend component and the plugin adds no public-facing pages or scripts.
Yes. Select "All Plugins" from the item picker to see a collapsed tree for every installed plugin. Expand any plugin heading to drill into its files. The same applies to themes with "All Themes".
Yes. Click any text-based file in the tree to open it in the inline file viewer with syntax highlighting. Image files open in a new browser tab. The viewer also shows file size, line count, and last modified date.
Yes. The file viewer has a one-click Download button. The file is served with the correct MIME type and its original filename.
TXT (plain ASCII tree), JSON (nested with metadata), XML, PDF, and Clipboard (emoji tree for pasting anywhere). You can choose your preferred clipboard format (JSON, Text, or XML) in Settings.
Yes. The Search tab lets you search by filename or extension across any plugin or theme in real time. Results show the full path, size, and last modified date.
Yes. Go to Settings → Security and Exclusions to toggle exclusions for hidden files and system directories, and to add your own custom patterns such as vendor, node_modules, *.log, or .git.
Yes. You can export plugin and theme structures from the command line:
wp structure-viewer export plugin <folder-name>
wp structure-viewer export theme <folder-name>
wp structure-viewer list plugins
wp structure-viewer list themes
Yes. Structure Viewer Pro adds two features: Comparator (compare any two plugin or theme versions with a color-coded diff view) and FlatPack (extract and filter files from any plugin or theme ZIP by file type). The free version includes the full Explorer, Search, Export, Dashboard, and Settings. Upgrade from Settings → Licence → Upgrade to Pro.
Upload two plugin ZIPs — or select an installed plugin and upload a ZIP to compare against it. Comparator produces a color-coded, file-by-file diff showing exactly which lines were added, removed, or changed. It handles large files and minified CSS/JS by tokenising them before diffing, so you get meaningful per-rule output instead of single-line change blocks.
Upload any plugin or theme ZIP. FlatPack extracts all its files and shows you a live-filterable preview. Select which file types you want — PHP, CSS and JS, images, or custom extensions — and click Run FlatPack. Only the matching files are packed into a single flat ZIP for download, no nested directories included.
Files with unique basenames keep their original name. When two or more files share the same basename (for example multiple style.css files from different directories), each is prefixed with its relative folder path — for example assets-style.css and css-style.css. Any remaining collisions get a numeric suffix.
No. Plugin assets are loaded only on the Structure Viewer admin page and have zero impact on your website's frontend. Dashboard stat counts are cached. No external requests are made at runtime.
Structure Viewer stores settings in the wp_options table under structureviewer_settings. Temporary files uploaded for Comparator or FlatPack are stored in the WordPress uploads directory and deleted immediately after processing. No user data or personal information is collected or transmitted.
The plugin is designed for single-site use. It may function on individual subsites within a Multisite network but Multisite-specific administration is not officially tested or supported.