Gravity Forms Git Sync WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/studiorepublic/gravity-forms-git-sync/releases/download/v1.0.7/gravity-forms-git-sync.zipStore Gravity Forms and add-on feeds as deterministic JSON in Git. Sync via admin UI or WP-CLI. Updates via GitHub releases (Plugin Update Checker).
Requirements
- WordPress 6+
- PHP 8.1+
- Gravity Forms 2.8+
Installation
From GitHub release (recommended):
- Install Gravity Forms.
- Download the latest release zip from Releases.
- Extract into
wp-content/plugins/gravity-forms-git-sync/. - Activate via Plugins screen.
Release zips are self-contained (include vendor/). No Composer needed.
From source (development):
- Clone the repo into
wp-content/plugins/gravity-forms-git-sync/. - Run
composer installin the plugin directory. - Activate via Plugins screen.
Storage
JSON files are stored in the active theme by default:
wp-content/themes/YOUR-THEME/sync/gravity-forms/
forms/ # {sr_key}.form.json
feeds/ # {sr_key}.feed.json
maps/ # {sr_key}.map.json (field ID mapping)
meta/ # index.json (hashes for sync status)
archive/ # Deleted forms/feeds (if GF_GIT_SYNC_ARCHIVE_DELETES)
On multisite, non-main sites use sites/{blog_id}/ subfolders.
Usage
Admin UI
Forms → Git Sync — View sync status, export/import individual forms, bulk actions. When a form is out of sync, use View diff to compare Database vs JSON file side-by-side.
WP-CLI
# Export all forms and feeds (multisite: exports from all sites)
wp gf-git-sync export --all
# Export a specific form (current site only)
wp gf-git-sync export --form=contact-us
# Import (sync mode)
wp gf-git-sync import
# Import with options
wp gf-git-sync import --form=donate --mode=sync --allow-missing-secrets
# Dry run
wp gf-git-sync import --dry-run
# Validate JSON
wp gf-git-sync validate
Multisite
wp gf-git-sync export --all --url=concordia.test/seasonal/
wp gf-git-sync import --url=concordia.test/seasonal/
Stable Keys (sr_key)
Forms are identified by sr_key. On export:
- Use
gf_git_sync_sr_keyif set (form settings) - Otherwise
form_keyif set (GF 2.5+) - Otherwise derive from form title slug
On import, the plugin uses sr_key from the JSON content (or filename) to match existing forms. Matching is by meta index and gf_git_sync_sr_key only—never by form ID or form_key, so multiple forms import correctly on fresh sites.
Feeds use {form_sr_key}.{addon_slug}.{feed_name}.
Field Mapping
For feeds that reference field IDs, use sr: in the field Admin Label (e.g. sr:email). The plugin maps these to numeric IDs per environment.
Placeholders
Secrets are replaced with placeholders on export. Resolve on import via:
- Environment variables
- WordPress constants (
GF_GIT_SYNC_STRIPE_SECRET_KEY, etc.) - Optional
.env(requires vlucas/phpdotenv)
Configuration
| Constant | Default | Description |
|---|---|---|
GF_GIT_SYNC_BASE_PATH |
theme/sync/gravity-forms | Storage path |
GF_GIT_SYNC_AUTO_EXPORT |
true (non-prod) | Auto-export on save |
GF_GIT_SYNC_AUTO_EXPORT_ON_PROD |
false | Enable on production |
GF_GIT_SYNC_ARCHIVE_DELETES |
true | Archive deleted items |
Manual Test Checklist
- Create a new form → confirm JSON created automatically.
- Edit form → confirm JSON updated.
- Add Stripe feed → confirm feed JSON created.
- Admin Sync screen → status reflects changes.
- Click Export from admin → file updates.
- Modify JSON in repo → admin shows JSON ahead; click Import → DB updates.
wp gf-git-sync validate→ passes.- Multisite: On a sub-site, Git Sync → View JSON opens the correct
sites/{blog_id}/forms/file.
Building Releases
Release zips include vendor/ so the plugin is self-contained.
Release script (recommended):
./scripts/release.sh 1.0.4
Bumps version, commits, tags, and pushes. The GitHub Action then builds the zip and creates the release. The script is excluded from release zips.
Manual tag push: Alternatively, bump version and changelog yourself, then:
git tag v1.0.4
git push origin v1.0.4
Manual build: To build locally and attach the zip yourself:
./scripts/build-release.sh [version]
The zip is written to dist/. Attach it to the GitHub release.
Releases
7 releases. Each count is every asset in that release; expand a row for the breakdown.