name: storegrowth-code-review description: Review StoreGrowth (Sales Booster) code changes and pull requests for conventions, security, and architecture compliance. Use when reviewing PRs, auditing code, or checking quality before merge.
StoreGrowth Code Review
Review changes against StoreGrowth conventions. Consult storegrowth-backend-dev, storegrowth-frontend-dev, and storegrowth-module-dev for the detailed standards each item references.
Critical violations to flag
Backend PHP — architecture
- Hooks registered ad-hoc — new WordPress hooks should live in a class implementing
HookRegistry(auto-registered), not scatteredadd_actioncalls in random constructors. Seestoregrowth-backend-dev. - REST controller not auto-wired — controllers must extend
WP_REST_Controllerand be registered in a provider (tagged soBootstrap::register_rest_routes()finds them). Namespace must besales-booster/v1. - Service not registered via a provider — new services belong in the appropriate
ServiceProvider/BootstrapServiceProviderusingadd_with_implements_tags()/share_with_implements_tags(); avoidnew ClassName()for things that should be container-managed. - Wrong namespace / path — must follow
StorePulse\StoreGrowth\…with matching file path. Watch forLeague\Container\…imports that should be the mozart-prefixedStorePulse\StoreGrowth\ThirdParty\Packages\League\Container\…. - Hand-edited
lib/— that directory is mozart-generated; changes belong incomposer.json+ regeneration.
Backend PHP — modules
- Module not extending
BaseModule/ not implementing theModuleSkeletonmethods (get_id,get_name,get_icon,get_banner,get_description,get_module_category). - Module not fully wired — missing
require_onceinstoregrowth-sales-booster.php, missing PSR-4 autoload entry, or missingwatch:/build:scripts. Seestoregrowth-module-dev. - Runtime services registered in the always-on provider — module runtime services go in
BootstrapServiceProvider(booted only when active), not the registrationServiceProvider.
Backend PHP — naming & i18n
- camelCase methods/variables — must be
snake_case. - Unprefixed hook names — feature hooks must start with
spsg_(lifecycle hooksstoregrowth_). Generic/unprefixed names risk collisions. - Wrong text domain — must be
storegrowth-sales-boosterfor every__(),esc_html__(), etc. - Concatenated translations — use
sprintf()with a/* translators: */comment; never concatenate.
Backend PHP — security
- Missing
permission_callbackon any REST route (never omit). - Unsanitized
$requestinput — sanitize everything (absint,sanitize_text_field,wc_clean, …). - Unescaped output — escape with
esc_html,esc_attr,wp_kses_post, etc., especially intemplates/. - Raw SQL — dynamic values must go through
$wpdb->prepare(). - Loose comparisons — use
===/!==;in_array()must passtrueas the third arg.
Versioning & docs
- Hardcoded
@sinceon new code — new symbols must use the literal@since SPSG_VERSIONplaceholder, NOT a version number (it's replaced at release bybin/version-replace.sh). Flag any newly added@since X.Y.Z. Do not touch existing real@sincenumbers. - Missing PHPDoc /
@sinceon new public/protected methods, hooks, and filters.
Frontend (React)
- Class components — functional only.
- Admin page not registered via
spsg_routes— module UI must push routes throughaddFilter('spsg_routes', 'spsg', …); store must beregister()-ed (@wordpress/data). Seestoregrowth-frontend-dev. - Direct state mutation — go through store actions.
- Wrong i18n — use
@wordpress/i18nwith text domainstoregrowth-sales-booster; translator comments beforesprintf();_n()for plurals. - New entry/module not in build — missing
assets/package.jsonor rootpackage.jsonwatch:/build:script.
Process checks
- Run
composer phpcson changed files — the PR workflow (.github/workflows/phpcs.yml) runs PHPCS on changed PHP and must pass. - Verify the branch targets
develop(seestoregrowth-git). - Confirm
readme.txt/CHANGELOG.mdupdated for user-facing changes.
Output format
For each finding:
[SEVERITY]: [specific problem]
Location: [file:line]
Standard: [which storegrowth-* skill section]
Fix: [brief correct example]
Severity: CRITICAL (security / data loss / breakage) · ERROR (standards violation / missing required pattern) · WARNING (suboptimal) · SUGGESTION (improvement).
Reviewer principles
- Correct — does it fulfill the requirement?
- Secure — sanitized, escaped, permission-checked, prepared SQL?
- Consistent — fits the module/provider/hook architecture and naming?
- Extensible — appropriate
spsg_filters/actions for the pro plugin (storegrowth_pro_is_active) to hook into?