← Todas las plantillas

Hooks en lugar de editar el core, salida escapada, nonces en cada formulario.

Constitution — WordPress plugin

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the project. A spec may add rules; it never weakens these.

  1. Hooks instead of core edits. The plugin changes behavior only through actions and filters. It never edits WordPress core, a theme or another plugin's files.

  2. Escaped output. Every value is escaped when it is printed, with esc_html, esc_attr, esc_url or wp_kses_post. PHPCS with the WordPress-Extra standard runs in CI and unescaped output fails the build.

  3. Nonces and capabilities on every write. Every form, admin-ajax call and REST write checks a nonce (check_admin_referer, wp_verify_nonce) and current_user_can. Every REST route declares a real permission_callback.

  4. Sanitized input, prepared queries. Input is sanitized on arrival (sanitize_text_field, absint) and every query with a variable uses $wpdb->prepare. String-built SQL fails the review.

  5. Prefixed and translatable. Functions, classes, options, hooks and handles carry the plugin prefix or namespace. Every visible string goes through __() or esc_html__() with the plugin's text domain.

  6. Clean lifecycle. Activation sets up only what the plugin needs, and uninstall.php removes its options, tables and scheduled events. CI tests the minimum PHP and WordPress versions the plugin declares.