gorilla-forms Svelte Themes

Gorilla Forms

A modern WordPress form builder plugin built on Svelte 5

Gorilla Forms

The source repository for Yakura Gorilla Forms — a modern WordPress form builder plugin built on Svelte 5.

A drag-and-drop WordPress form builder with conditional logic, multi-step forms, payments, conversational mode, and 37+ field types. Zero overhead on pages without forms — built on Svelte 5 with no jQuery dependency.


Features at a Glance

  • 37+ field types — text, email, phone, date, file upload, signature, rating, NPS, matrix, repeater, product, coupon, and more
  • Visual form builder — drag-and-drop editor with live preview, undo/redo, and a command palette
  • Conditional logic — show, hide, or modify fields with 10 operators and AND/OR grouping
  • Multi-step forms — page breaks, progress navigation, save & resume drafts
  • Conversational mode — toggle any form to one-question-at-a-time
  • Payments — Stripe and PayPal built into core, no add-on required
  • Field-level analytics — drop-off points, time per field, conversion funnels
  • Migrations — one-click import from Gravity Forms, WPForms, Ninja Forms, Contact Form 7
  • WCAG 2.1 AA accessible — proper ARIA, keyboard navigation, focus management
  • Zero page overhead — pages without forms get no extra CSS or JavaScript

For the full feature list, see readme.txt.


Repository Layout

gorilla-forms/
├── includes/              PHP backend (REST API, submission pipeline, integrations)
│   ├── rest-api.php       ~50 REST endpoints under yakura-gorilla-forms/v1
│   ├── submission.php     Form submission processing pipeline
│   ├── database.php       Dynamic per-form entry tables
│   └── integrations/      Stripe, PayPal, Mailchimp, webhooks, etc.
├── src/                   Svelte 5 + TypeScript frontend
│   ├── main.ts            Admin SPA entry point
│   ├── frontend/          Public-facing form rendering
│   └── lib/               Shared components, stores, types
├── tests/                 PHPUnit tests (unit + integration) + security scans
├── e2e/                   Playwright end-to-end tests
├── assets/                Build output target (generated, gitignored)
├── readme.txt             WordPress.org plugin readme
└── yakura-gorilla-forms.php  Plugin bootstrap file

Building from Source

This plugin's distributed JavaScript and CSS in assets/js/ and assets/css/ are generated from the Svelte/TypeScript source in src/ using Vite. To build them yourself:

Prerequisites

Install dependencies

# Frontend dependencies (Svelte, Vite, TypeScript)
npm install

# PHP dependencies (testing tools, static analysis)
composer install

Build the production assets

npm run build

This compiles two bundles:

  • assets/js/yakura-gorilla-forms.js + assets/css/yakura-gorilla-forms.css — the admin SPA mounted in wp-admin
  • assets/js/yakura-gorilla-forms-frontend.js + assets/css/yakura-gorilla-forms-frontend.css — the public-facing form renderer

After building, the plugin is ready to be zipped and installed in WordPress.

Development mode (hot reload)

npm run dev

Local WordPress Environment

The repository ships with @wordpress/env for a one-command local WordPress install:

npx wp-env start

WordPress will be available at http://localhost:8888 with the plugin pre-activated.


Testing

PHP unit tests (no WordPress required)

vendor/bin/phpunit --testsuite unit

PHP integration tests (requires wp-env)

PLUGIN_TESTSUITE=integration vendor/bin/phpunit --testsuite integration

JavaScript tests

npx vitest run

End-to-end tests (requires wp-env)

npx playwright test

Linting and type checks

vendor/bin/phpcs            # PHP coding standards
vendor/bin/phpstan analyse  # PHP static analysis (level 9)
npm run lint                # ESLint
npm run check               # svelte-check + tsc

Architecture Overview

Two build entry points:

  • Admin SPA (src/main.ts): Svelte 5 app for the WordPress admin form editor, entries list, settings, and analytics dashboard.
  • Public Forms (src/frontend/main.ts): discovers [data-gf-form] elements on the page, decodes the form schema from base64 data attributes, and mounts the form renderer.

PHP backend:

  • REST API under yakura-gorilla-forms/v1 namespace (~50 endpoints) in includes/rest-api.php
  • Submission pipeline (spam check → conditional visibility → sanitization → validation → calculations → entry creation → notifications) in includes/submission.php
  • Each form gets its own entries table wp_gf_entries_{form_id} for performance at scale

Conditional logic runs identically on both the JavaScript client and the PHP server, with parity enforced by a shared 76-case test table.

Payments use server-side amount verification: PayPal stores a transient with the expected amount before checkout and validates on capture; Stripe webhooks are HMAC-SHA256 verified with a 5-minute replay window.


Contributing

Issues and pull requests are welcome.

  1. Fork the repo
  2. Create a feature branch (git checkout -b my-feature)
  3. Run the test suite and linters before committing
  4. Open a pull request describing your change

For substantial changes, please open an issue first to discuss the approach.


License

GPL-2.0-or-later — see LICENSE.

Third-party libraries and their respective licenses are documented in THIRD_PARTY_NOTICES.md.


Top categories

Loading Svelte Themes