Download the PHP package bitbabit/magento2-dev-tools without Composer
On this page you can find all versions of the php package bitbabit/magento2-dev-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bitbabit/magento2-dev-tools
More information about bitbabit/magento2-dev-tools
Files in bitbabit/magento2-dev-tools
Package magento2-dev-tools
Short Description Advanced developer tools for Magento 2 with dynamic control and visualization
License MIT
Homepage https://github.com/bitbabit/magento2-dev-tools
Informations about the package magento2-dev-tools
BitBabit Developer Tools for Magento 2
Overview
BitBabit Developer Tools is a comprehensive development and debugging suite for Magento 2 that provides real-time performance monitoring, database query profiling, and advanced debugging capabilities. It features a modern, interactive web-based toolbar similar to Symfony's DebugBar or Laravel Debugbar.
Key Features
🔍 Database Query Profiling
- Real-time SQL query monitoring with execution times
- Slow query detection and highlighting
- Query parameter binding visualization
- Query type analysis (SELECT, INSERT, UPDATE, DELETE)
- Comprehensive query statistics
⚡ Performance Monitoring
- Application execution time tracking
- Memory usage monitoring (current, peak, real usage)
- Bootstrap time measurement
- Server load monitoring
- OPcache status and statistics
🛡️ Security & Authentication
- API key-based authentication system
- Secure header validation (
X-Debug-Api-Key) - Developer mode restrictions
- Cookie-based session management
🌐 Request Analysis
- HTTP request/response monitoring
- Header inspection
- Parameter analysis (GET, POST, FILES)
- Session data examination
- AJAX request interception
🖥️ Environment Information
- PHP version and configuration
- Server software details
- Operating system information
- PHP extensions listing
- Timezone and locale settings
🐛 Advanced Debugging
- Multi-level debug logging (info, warning, error, debug)
- Contextual debug messages
- Interactive JSON tree visualization
- Real-time message collection
📱 Interactive Web Interface
- Modern, responsive toolbar widget
- Real-time data updates
- Collapsible panels
- Multi-request tracking
- Mobile-friendly design
Installation
Via Composer (Recommended)
If the package is not yet published to Packagist, you can install with explicit version:
Manual Installation
- Download the module files
- Extract to
app/code/BitBabit/DeveloperTools/ - Run the following commands:
Quick Setup
After installation, follow these steps to get started:
Monolithic Frontend Widget Activation
To enable the profiler widget and save the API key to cookies for persistent profiling:
This will:
- Enable the profiler widget on your frontend
- Save the API key to cookies for automatic profiling on subsequent requests
- Allow you to see the profiler widget on all pages
Note: Boot time and memory management features are currently under development, so data may not be 100% accurate.
Configuration
Admin Configuration
Navigate to Stores → Configuration → BitBabit → Developer Tools
Basic Settings
- Enable Developer Tools: Master toggle for the entire module
- Profiler Header Key: HTTP header to trigger profiling (default:
X-Debug-Mode) - Enable HTML Output: Show profiler data for web requests
- Enable JSON Injection: Inject profiler data into API responses
- Developer Mode Only: Restrict profiling to developer mode
- Slow Query Threshold: Highlight queries exceeding this time (ms)
- Toolbar Widget: Enable/disable the floating toolbar
- Memory Limit: Auto-disable threshold to prevent memory issues
API Security Settings
- Enable API Key Validation: Require API key for access
- API Key: Plain-text storage in
core_config_data(pathbitbabit/dev_tools/api_key)
Console Commands
Enable/Disable Profiler
API Key Management
Usage
Basic Usage
- Enable the module in admin configuration
- Generate an API key using the console command
- Configure your browser to send the debug header:
- Header:
X-Debug-Api-Key - Value: Your generated API key
- Header:
- Visit any frontend page to see the toolbar
Browser Extension Integration
The module is designed to work with browser extensions that can inject custom headers:
Programmatic Debug Logging
API Integration
For AJAX requests, profiler data is automatically injected into JSON responses:
Architecture
Core Components
Interfaces
ProfilerConfigInterface: Main configuration contract defining all settings and validation methods
Models
ProfilerConfig: Configuration implementation with scope integrationDebugInfo: Singleton for collecting debug messages
Services
ComprehensiveProfilerService: Main profiling engine collecting all dataApiKeyCookieManagerService: Secure API key management with cookie support
Console Commands
EnableCommand: Enable profiler via CLIDisableCommand: Disable profiler via CLIStatusCommand: Show current profiler statusGenerateApiKeyCommand: API key generation and management
Observers & Plugins
ResponseObserver: Injects profiler data into responsesHttpLaunchPlugin: Initializes profiling for each request
Frontend Components
profiler-widget.js: Interactive JavaScript toolbarprofiler-widget.css: Responsive styling
Data Flow
- Request Initialization:
HttpLaunchPluginchecks if profiling should be enabled - Data Collection:
ComprehensiveProfilerServicegathers metrics throughout request - Response Injection:
ResponseObserveradds profiler data to output - Frontend Display: JavaScript widget renders interactive toolbar
Security Features
- API Key Authentication: Secure access control
- Timing-Safe Comparison: Prevents timing attacks
- Developer Mode Restriction: Production safety
- Cookie Security: Secure, HTTP-only cookie handling
Data Structure
Profiler Data Schema
Frontend Interface
Toolbar Panels
- Database Queries: SQL query analysis with parameters and timing
- Performance: Execution times, server load, OPcache status
- Memory: Current, peak, and real memory usage statistics
- Request: HTTP request details, headers, parameters, session
- Environment: PHP info, server details, extensions
- OPcache: Cache statistics and memory usage
- Debug: Custom debug messages with context data
Interactive Features
- Collapsible panels for organized data viewing
- Multi-request tracking for AJAX monitoring
- Real-time updates without page refresh
- JSON tree visualization for complex data
- Responsive design for mobile debugging
- Request selector to switch between tracked requests
Browser Extension Support
Chrome Extension Integration
Performance Considerations
Memory Management
- Automatic profiler disable when memory limit exceeded
- Configurable memory thresholds
- Efficient data structure usage
- Storage cleanup on page refresh
Storage Options
- IndexedDB: Primary storage (highest capacity)
- localStorage: Fallback option
- Cookies: Minimal fallback for basic functionality
Query Optimization
- Minimal performance overhead
- Optional profiling activation
- Selective data collection
- Efficient query parameter handling
Security Considerations
API Key Security
- Cryptographically secure key generation
- Timing-safe string comparison
- Secure cookie attributes
- URL parameter cleanup
Access Control
- Developer mode restrictions
- API key authentication
- Request header validation
Data Privacy
- Limited sensitive data collection (session data capped at 10 items)
- Configurable data exposure levels
- Secure transmission headers
- Memory usage limits to prevent resource exhaustion
Troubleshooting
Common Issues
Toolbar Not Appearing
- Check if module is enabled:
bin/magento module:status BitBabit_DeveloperTools - Verify API key configuration
- Ensure correct headers are sent
- Check browser console for JavaScript errors
Performance Issues
- Increase memory limits
- Disable in production environments
- Reduce slow query threshold
- Monitor server resources
API Key Problems
- Regenerate API key:
bin/magento bitbabit:devtools:generate-api-key --regenerate - Clear browser storage
- Verify header transmission
- Check admin configuration
Debug Mode
Enable debug logging in the JavaScript widget:
Log Files
Check Magento logs for profiler-related issues:
var/log/developer_tools.logvar/log/system.logvar/log/exception.log
Development
Extending the Module
Adding Custom Collectors
Frontend Customization
Testing
Run the included PHPUnit tests:
Test coverage includes:
- Configuration management
- Console commands
- API key generation
- Debug info collection
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Support
- Documentation: This README and inline code comments
- Issues: GitHub Issues tracker
- Email: [email protected]
Changelog
v1.2.0
- Initial public release
- Complete profiling suite
- API key authentication
- Interactive web interface
- Console command integration
- Comprehensive test coverage
⚠️ Important: This module is designed for development environments. While it includes security features, it should be thoroughly tested before any production use.
All versions of magento2-dev-tools with dependencies
magento/framework Version ^103.0
magento/module-backend Version ^102.0
magento/module-config Version ^101.0
magento/module-store Version ^101.0