=== Structure Viewer === Contributors: blincks Tags: plugins, themes, file structure, developer tools, debugging Requires at least: 5.0 Tested up to: 6.9 Stable tag: 2.0 Requires PHP: 7.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Plugin URI: https://wordpress.org/plugins/structure-viewer Author URI: https://www.blincks.com View, search, and export the complete file structure of your WordPress plugins and themes with an advanced file viewer. == Description == **Structure Viewer 2.0** is a comprehensive developer toolkit for WordPress that provides deep insight into your installed plugins and themes. Beyond simple file browsing, it offers powerful search capabilities, in-file content viewing, multiple export formats, and intelligent filteringβ€”all within a clean, modern interface. ### πŸš€ **Core Features:** **πŸ“ Advanced File Explorer** - **Tree View Navigation**: Expandable folder structure with intuitive icons - **File Information**: View file sizes and modification dates on demand - **Image Handling**: Image files automatically open in new tabs - **Modal File Viewer**: View file contents directly in the admin with syntax highlighting - **Keyboard Navigation**: Use arrow keys to navigate through the file tree **πŸ” Powerful Search & Filter** - **Real-time Search**: Instantly search across all files and folders - **File Type Filtering**: Filter by specific file types (PHP, JS, CSS, Images, etc.) - **Extension-based Search**: Search by file extension (e.g., `.php`, `.js`) - **Contextual Results**: Results show full file paths and metadata **πŸ“€ Multi-Format Export** - **Export as TXT**: Plain text structure for easy sharing - **Export as JSON**: Structured data for API integration - **Export as XML**: Standardized format for data processing - **Clipboard Copy**: One-click copy of entire structure to clipboard - **Direct Downloads**: Export files with proper naming and MIME types **🎨 Enhanced User Experience** - **Responsive Design**: Works perfectly on desktop, tablet, and mobile - **Loading Indicators**: Visual feedback during operations - **Persistent Settings**: Remember your preferences between sessions - **Accessibility**: Keyboard navigation and focus management - **Clean Interface**: Modern WordPress admin styling **⚑ **Advanced Features:** - **WP-CLI Integration**: Manage structures from command line - **Security Focused**: Strict permission checks and path validation - **Performance Optimized**: Efficient file scanning with exclusions - **Nonce Protection**: Secure AJAX operations - **Smart Exclusions**: Automatically ignores `node_modules`, `.git`, and system files ### πŸ›  **Professional Use Cases:** **πŸ”§ Development & Debugging** - Quickly locate specific files in complex plugin structures - Identify missing or misplaced files causing issues - Understand plugin/theme architecture for customization - Debug file permission or path-related problems **πŸ“Š **Auditing & Security** - Review third-party plugin structures for suspicious files - Verify file integrity after updates - Check for unnecessary or redundant files - Ensure proper file organization standards **πŸ€– AI-Assisted Development** - Export complete structures for AI analysis (ChatGPT, Claude, etc.) - Provide AI with context about plugin architecture - Get precise code modification suggestions - Example: "Here's WooCommerce's structure, how do I modify cart functionality?" **πŸ“‹ **Documentation & Collaboration** - Generate structure documentation for teams - Share plugin layouts with remote developers - Create visual maps of complex projects - Maintain reference documentation for future development == Installation == 1. **Download the Plugin**: - Download the `structure-viewer` folder (as a ZIP file if needed). 2. **Upload to WordPress**: - Via WordPress Admin: Go to Plugins > Add New > Upload Plugin, then upload the ZIP file and click "Install Now". - Via FTP: Upload the `structure-viewer` folder to the `/wp-content/plugins/` directory on your server. 3. **Activate the Plugin**: - Go to Plugins > Installed Plugins, find "Structure Viewer", and click "Activate". 4. **Access the Tool**: - Navigate to **Tools > Structure Viewer** in your WordPress admin dashboard. - Or click the "Explore" link in your plugin listing. == Frequently Asked Questions == = Who can use Structure Viewer? = This plugin requires the `manage_options` capability, meaning only administrators and users with similar permissions can access it. = Can I view all plugins/themes at once? = Yes! Select "All Plugins" or "All Themes" from the dropdown to view comprehensive structures of all installed items. = How does the file viewer work? = Non-image files open in a modal viewer within WordPress. Image files (JPG, PNG, GIF, etc.) automatically open in new browser tabs. = What file types can I export? = Structure Viewer supports three export formats: TXT (plain text), JSON (structured data), and XML (standardized format). = Is there a file size limit for viewing? = Yes, for security and performance, the file viewer has a 1MB limit. Larger files should be accessed directly. = Can I search within specific file types? = Absolutely! Use the File Type filter to show only PHP files, JavaScript files, CSS files, images, or other specific file types. = Does this work with WP-CLI? = Yes! Structure Viewer includes WP-CLI commands: - `wp structure-viewer export ` - Export structures via command line - `wp structure-viewer list ` - List available items = Is my data secure? = Structure Viewer includes multiple security layers: nonce verification, path traversal prevention, capability checks, and input sanitization. = What files are excluded from scans? = By default: `node_modules`, `.git`, `.svn`, `.DS_Store`, log files, and system files are excluded for performance. == Changelog == = 2.0 - Major Upgrade = * **Complete UI/UX Overhaul**: Modernized interface with improved controls and responsive design * **Advanced File Viewer**: Modal-based file content viewer with syntax highlighting * **Multi-Format Export**: Added JSON and XML export formats alongside existing TXT * **Enhanced Search**: Real-time search with file type filtering and contextual results * **Clipboard Integration**: One-click copy of entire structures to clipboard * **Keyboard Navigation**: Full keyboard support for accessibility * **WP-CLI Commands**: Added command-line interface for developers * **Performance Improvements**: Optimized file scanning and AJAX handling * **Security Enhancements**: Improved validation and permission checks * **Mobile Responsive**: Fully responsive design for all screen sizes * **Persistent Settings**: UI preferences saved between sessions = 1.2 = * Enhanced the UI of the export button for better visibility and styling. * Added a "Settings" link in the plugin listing to quickly access the Structure Viewer page. = 1.1 = * Added export functionality to download the structure as a text file. = 1.0 = * Initial release of Structure Viewer. * Basic functionality to view plugin and theme structures. == Upgrade Notice == = 2.0 = **Major Update** - This version completely rebuilds the plugin with modern JavaScript architecture, multiple export formats, advanced search, and a file content viewer. Backward compatible with existing structures. = 1.2 = This update enhances the export button's UI for better visibility and adds a "Settings" link in the plugin listing for quick access to the Structure Viewer page. = 1.1 = This update adds the ability to export the file structure as a text file, making it easier to share or analyze with other tools. == Additional Information == - **Security**: Requires `manage_options` capability with nonce protection, input validation, output escaping, and directory traversal prevention. - **Performance**: Lightweight modular architecture with optimized file scanning and selective asset loading. - **Compatibility**: Tested with WordPress 6.9 and PHP 7.2+. - **Support**: For support, feature requests, or bug reports, please visit the plugin page. - **Contributing**: Developers can contribute via GitHub (link in plugin description). == Screenshots == 1. Main interface showing plugin structure tree 2. File viewer modal with syntax highlighting 3. Search results with file type filtering 4. Export options with multiple format choices == Credits == Developed by Blincks - Professional WordPress development tools for developers and agencies.