Debugging & Testing
Debugging
Section titled “Debugging”Tools and techniques for debugging DealAI.lt.
WordPress Debug Mode
Section titled “WordPress Debug Mode”define('WP_DEBUG', true);define('WP_DEBUG_LOG', true);define('WP_DEBUG_DISPLAY', false);View logs:
tail -f /var/www/html/wp-content/debug.logDatabase Debugging
Section titled “Database Debugging”// Log queriespg_last_error($connection);
// Query profiling$start = microtime(true);$result = pg_query($query);$duration = microtime(true) - $start;error_log("Query took: {$duration}s");Elasticsearch Debugging
Section titled “Elasticsearch Debugging”// Enable verbose logging$client = ClientBuilder::create() ->setHosts([ELASTICSEARCH_HOST]) ->setLogger(new Logger()) ->build();Next Steps
Section titled “Next Steps”- Troubleshooting - Common issues
- Performance - Optimization