Skip to main content
< All Topics
Print

WordPress Development

name: wordpress-development

description: Develop WordPress plugins, themes, and customizations using best practices, hooks, security standards, and the ITI shared library. Use when building new WordPress plugins, extending existing plugins, developing custom themes, or implementing WordPress-specific architecture patterns.

WordPress Development

Instructions

Build secure, maintainable WordPress plugins and themes using ITI conventions.

ITI shared library (always load first):


require_once plugin_dir_path(__FILE__) . '../shared/wordpress/class-iti-shared-loader.php';

Available: ITI_Claude_API v2.0, ITI_Tavily_API, ITI_Pinecone_API, ITI_MCP_Client, ITI_Base_Agent, ITI_Orchestrator_Base v2.0, ITI_Token_Budget_Manager, ITI_KB_Parser, ITI_Conversation_Summarizer

Plugin structure:


my-plugin/
├── my-plugin.php          # Main plugin file (header, activation hooks)
├── includes/              # Core PHP classes
├── admin/                 # Admin UI, settings pages
├── public/                # Frontend assets
├── assets/                # CSS, JS, images
└── languages/             # i18n .pot files

Security rules (non-negotiable):

  • Every file: if (!defined('ABSPATH')) { exit; } guard at top
  • Sanitize all inputs: sanitize_text_field(), absint(), wp_kses_post()
  • Escape all outputs: esc_html(), esc_attr(), esc_url()
  • Nonces on all forms and AJAX: wp_nonce_field() / check_admin_referer()
  • Capability checks before privileged actions: current_user_can()
  • Prepared statements for all DB queries: $wpdb->prepare()

Hooks pattern:

  • Use plugins_loaded to initialize; avoid code execution on include
  • Prefix all function names, hooks, options, and table names with plugin slug
  • Use register_activation_hook() / register_deactivation_hook() for setup/teardown

Agent pattern (extend ITI base):


class My_Agent extends ITI_Base_Agent {
    protected function get_system_prompt(): string { return '...'; }
    public function run($input, $context = []): array { ... }
}

Antigravity browser QA for WordPress:

After building or modifying a WordPress plugin, use Antigravity’s browser sub-agent to test the admin UI:

  • Navigate to the local dev URL (*.local or configured dev domain) and log in as admin
  • Test settings pages: verify options save/load, nonce validation, and default value display
  • Test AJAX handlers: verify spinner, response rendering, and error state handling
  • Test at multiple viewports (1440px, 1024px, 768px, 375px) for responsive admin layouts
  • Verify no raw PHP errors visible on any admin screen
  • Capture browser recordings and screenshots as Walkthrough artifacts for review

Dispatch via the /browser-test workflow in Antigravity Agent Manager. See the antigravity-browser-qa skill for the full WordPress admin QA test matrix.

Outputs: Plugin skeleton with correct structure, class implementations following ITI patterns, security checklist, hook reference for the plugin’s use cases

Table of Contents