Hooks instead of core edits, escaped output, nonces on every form.
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.
-
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.
-
Escaped output. Every value is escaped when it is printed, with
esc_html,esc_attr,esc_urlorwp_kses_post. PHPCS with the WordPress-Extra standard runs in CI and unescaped output fails the build. -
Nonces and capabilities on every write. Every form, admin-ajax call and REST write checks a nonce (
check_admin_referer,wp_verify_nonce) andcurrent_user_can. Every REST route declares a realpermission_callback. -
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. -
Prefixed and translatable. Functions, classes, options, hooks and handles carry the plugin prefix or namespace. Every visible string goes through
__()oresc_html__()with the plugin's text domain. -
Clean lifecycle. Activation sets up only what the plugin needs, and
uninstall.phpremoves its options, tables and scheduled events. CI tests the minimum PHP and WordPress versions the plugin declares.