Quick Start Guide - Jankx Debug System
Table of Contents
Quick Start Guide - Jankx Debug System
Bắt đầu nhanh
Hướng dẫn này sẽ giúp bạn bắt đầu sử dụng Jankx Debug System trong 5 phút.
Bước 1: Kích hoạt Debug Mode
Thêm dòng sau vào file wp-config.php
hoặc functions.php
:
define('JANKX_DEBUG', true);
Bước 2: Truy cập Debug Panel
Frontend
- Mở trang web của bạn
- Debug panel sẽ xuất hiện ở góc dưới bên phải
- Click vào panel để expand/collapse
Admin
- Đăng nhập vào WordPress admin
- Click vào “📝 Gutenberg Blocks” trong admin bar
- AJAX request sẽ load debug information
Bước 3: Xem thông tin cơ bản
Debug panel hiển thị:
- ⏱️ Response Time: Thời gian phản hồi
- 💾 Memory Usage: Sử dụng bộ nhớ
- 🗄️ Database Queries: Số lượng queries
Bước 4: Cache Comparison
- Refresh trang lần đầu (không có cache)
- Refresh lại lần nữa (có cache)
- Xem section “⚡ Cache vs No-Cache Comparison”
Bước 5: Clear Cache
Click “🗑️ Clear Debug Cache” trong admin bar để reset cache data.
Ví dụ thực tế
Trang có cache
⚡ Performance Info
├── Response Time: 0.0456s
├── Memory Usage: 12.8 MB
├── Memory Limit: 256 MB
└── Memory Usage %: 5.0%
⚡ Cache vs No-Cache Comparison
├── Response Time:
│ ├── Current: 0.0456s
│ ├── Cached: 0.1234s
│ ├── Difference: -0.0778s
│ └── Improvement: 63.0%
Trang không có cache
⚡ Performance Info
├── Response Time: 0.1234s
├── Memory Usage: 45.2 MB
├── Memory Limit: 256 MB
└── Memory Usage %: 17.7%
⚡ Cache vs No-Cache Comparison
├── Response Time:
│ ├── Current: 0.1234s
│ ├── Cached: 0.0456s
│ ├── Difference: +0.0778s
│ └── Improvement: -63.0%
Troubleshooting
Debug panel không hiển thị
// Kiểm tra debug mode
if (defined('JANKX_DEBUG') && JANKX_DEBUG) {
echo 'Debug mode is active';
}
Cache comparison không hoạt động
- Clear debug cache
- Refresh trang nhiều lần
- Kiểm tra browser console
AJAX errors
- Kiểm tra quyền admin
- Xem WordPress debug log
- Verify AJAX endpoint
Next Steps
- Cache Comparison - Chi tiết về cache comparison
- Performance Monitoring - Theo dõi hiệu suất
- API Reference - AJAX endpoints và methods