diagnostic-performance-n1

Detect N+1 query patterns in custom WordPress PHP code.

27|1|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/dr-robert-li/cowork-wordpress-expert --skill diagnostic-performance-n1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diagnostic-performance-n1
Source: https://github.com/dr-robert-li/cowork-wordpress-expert/tree/main/skills/diagnostic-performance-n1
Command: npx skills add https://github.com/dr-robert-li/cowork-wordpress-expert --skill diagnostic-performance-n1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill identifies inefficient database query patterns within custom WordPress PHP code that can severely degrade website performance as content scales.

Core Features & Use Cases

  • N+1 Query Detection: Scans custom themes and plugins for common N+1 query anti-patterns.
  • Confidence Tiers: Classifies potential issues into High, Medium, and Low confidence levels.
  • Actionable Rewrite Suggestions: Provides specific code examples to optimize queries using actual variable names.
  • Use Case: A developer suspects their custom theme is causing slow page loads on high-traffic posts. This Skill pinpoints the exact loops and queries responsible and offers a clear path to optimization.

Quick Start

Analyze the local WordPress files for N+1 query patterns.

Frequently Asked Questions about diagnostic-performance-n1

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect N+1 query patterns in my custom WordPress theme?

Detect N+1 query patterns in custom WordPress themes by using static analysis to identify inefficient database calls within loops, providing specific rewrite suggestions with actual variable names for optimization.

What is an N+1 query problem in WordPress plugin development?

An N+1 query problem in WordPress plugin development occurs when database queries are executed inside loops, causing severe performance degradation as content scales, which static analysis can pinpoint in custom PHP code.

How do I find database queries inside loops in custom PHP code?

Find database queries inside loops in custom PHP code by running static analysis with AI contextual judgment that evaluates inefficient database calls and classifies potential issues into High, Medium, and Low confidence tiers.

Does N+1 query detection work with well-known third-party WordPress plugins?

N+1 query detection excludes well-known third-party WordPress plugins to focus specifically on user-modifiable code, ensuring analysis targets custom themes and plugins rather than established third-party plugin architectures.

How do I optimize WordPress database calls identified as N+1 issues?

Optimize WordPress database calls by applying actionable rewrite suggestions provided by the analysis, which offers specific code examples to fix inefficient queries using actual variable names detected in your custom PHP files.

Can I analyze local WordPress files for N+1 queries without a live database?

Analyze local WordPress files for N+1 queries without a live database because the detection process relies on static analysis of custom theme and plugin PHP code rather than executing live database transactions.