wordpress-core

Develops WordPress plugins with proper structure, security checks, and standards.

2|Updated Nov 7, 2025
One-click install
npx skills add https://github.com/mikkelkrogsholm/wp-plugins --skill wordpress-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wordpress-core
Source: https://github.com/mikkelkrogsholm/wp-plugins/tree/main/.claude/skills/wordpress-core
Command: npx skills add https://github.com/mikkelkrogsholm/wp-plugins --skill wordpress-core

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides foundational knowledge for developing WordPress plugins, ensuring they are secure, performant, and adhere to best practices. It helps developers avoid common security vulnerabilities and leverage WordPress's powerful API system, saving time on debugging and refactoring.

Core Features & Use Cases

  • Security Principles: Implement critical security measures like input sanitization, output escaping, nonces, and capability checks to protect against common attacks (e.g., CSRF, XSS, SQL Injection).
  • Hooks System: Master WordPress actions and filters to extend and modify core functionality without altering core files, ensuring future compatibility and maintainability.
  • Database Operations: Safely interact with the WordPress database using $wpdb and prepared statements to prevent SQL injection, ensuring data integrity and security.
  • Use Case: Develop a new WordPress plugin that stores user-submitted data. This Skill guides you through sanitizing all user input, escaping output for display, using nonces for form submissions, and performing secure database inserts with $wpdb->prepare(), ensuring your plugin is robust and secure from day one.

Quick Start

Create a new WordPress plugin called 'my-custom-widget'. Outline the basic file structure and add a plugin header.

Frequently Asked Questions about wordpress-core

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

FAQPage Schema
How do I sanitize and escape user input in WordPress plugins?

Sanitize all user input at entry points using functions like `sanitize_text_field()` or `sanitize_email()`, then escape output with `esc_html()`, `esc_attr()`, or `wp_kses_post()` before display. This prevents XSS and injection attacks in your plugin.

What are WordPress hooks and how do I use actions and filters?

Hooks are extension points in WordPress code. Actions let you execute custom code at specific moments using `add_action()`, while filters modify data using `add_filter()`. Hooks let you extend functionality without editing core files, ensuring compatibility across updates.

How do I securely query the WordPress database with wpdb?

Use `$wpdb->prepare()` with placeholders to build safe SQL queries, preventing SQL injection. Execute with `$wpdb->get_results()` or `$wpdb->insert()`. Prepared statements ensure data integrity and protect against malicious input.

What security measures should a WordPress plugin include?

Implement nonces for form submission verification, capability checks using `current_user_can()`, input sanitization, output escaping, and proper authentication headers. These prevent CSRF attacks, unauthorized access, and data exposure in admin and public contexts.

What's the proper file structure and naming convention for WordPress plugins?

Create a main plugin file with required headers (Plugin Name, Version, Author), organize code into classes, use consistent naming (e.g., `my_plugin_function_name()`), and follow WordPress coding standards. Structure enables maintainability and prevents conflicts with other plugins.

Can I use custom database queries in WordPress instead of wpdb?

No; use `$wpdb` for all database operations. It abstracts the database layer, handles table prefixes, applies security filters, and ensures compatibility across WordPress installations. Custom queries bypass these protections.