| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A WordPress plugin by Tech Matters that provides a contact/newsletter subscription form with Airtable integration.
Website: https://bd4d.org/ Version: 1.0.5 License: GPL-2.0-or-later
bd4d-plugin/ # Repo root (build tools & config)
├── Gruntfile.js # Build task configuration
├── package.json # NPM dependencies
├── composer.json # PHP dependencies
├── phpcs.xml # PHP CodeSniffer config
├── .github/ # CI/CD workflows (not deployed)
│ └── workflows/
│ ├── wpcs.yml # WordPress coding standards check
│ └── check-commits.yml # Conventional commits validation
│
└── wp-content/ # ← DEPLOYED TO PRESSABLE
└── plugins/
└── bd4d/ # The WordPress plugin
├── bd4d.php # Main plugin entry point
├── includes/
│ ├── class-bd4d.php # Core form & Airtable integration
│ ├── class-google-recaptcha.php # ReCAPTCHA verification
│ └── settings/
│ ├── class-settings.php # Base settings class
│ └── class-contact-form-settings.php # Admin settings
├── assets/
│ ├── css/src/main.scss # Styles (→ main.min.css)
│ └── js/src/main.js # Form JS (→ main.min.js)
└── template-parts/
├── form-email.php # Newsletter form HTML
└── auto-reply.php # Email template
npm install && composer install # Install dependencies
npx grunt # Run all build tasks
npx grunt watch # Watch for changes
npx grunt css-js # Build CSS and JS only
npx grunt php # Run PHP linting/standardsSettings are managed in WordPress Admin under the BD4D settings page:
The plugin writes form submissions to Airtable via the REST API (https://api.airtable.com/v0).
| Airtable Field | Form Input | Type | Required |
|---|---|---|---|
| Email Address | Email input | No | |
| First Name | First name input | Text | Yes |
| Last Name | Last name input | Text | Yes |
| Affiliation | Affiliation input | Text | No |
| Form Comments | Message textarea | Text | No |
| Email-Opted In? | Newsletter checkbox | Boolean | Always sent |
| Endorser? | Endorser checkbox | Boolean | Always sent |
| Adoption? | Adoption checkbox | Boolean | Always sent |
| CotW-Opted In? | Supporter checkbox — removed from form (v1.0.6); field retained for historical opt-ins | Boolean | No longer sent |
Note: First and Last Name are required. Email Address is required only when an opt-in checkbox (newsletter / endorser / adoption) is checked; otherwise it is optional.
The form authenticates to Airtable with a Personal Access Token (PAT) stored in WP Admin → BD4D → Contact Form Settings → Airtable Token. If that token is revoked, expires, or loses access to the base, submissions fail with "Unable to send message" and wp-content/debug.log shows a 403:
BD4D contact form Airtable API rejected submission: HTTP 403 body:
{"error":{"type":"INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND", ...}}
To issue a replacement token:
Tip: create the token under a shared/service Airtable account rather than an individual's, so it does not break when a person loses access to the base.
The plugin sends a confirmation email after successful form submission. The email content varies based on which checkboxes were selected.
| Case | Newsletter | Supporter | Adoption |
|---|---|---|---|
| A | ✓ | ✗ | ✗ |
| B | ✗ | ✓ | ✗ |
| C | ✓ | ✓ | ✗ |
| D | any | any | ✓ |
| E | ✗ | ✗ | ✗ |
| Environment | URL | Branch | Deploy Method |
|---|---|---|---|
| Production | bd4d.org | main | Auto-deploy on push/merge to main (confirmed 2026-07-18) |
| Staging | bd4d-staging.mystagingwebsite.com | staging | Auto-deploy on push to staging (configured 2026-07-19) |
| Sandbox | bd4dsandbox.mystagingwebsite.com | N/A | Static clone from staging (Oct 2025) |
Confirmed working 2026-07-18: merging a PR to main auto-deployed to production within a couple of minutes with no manual "Set and Deploy" click. Only the bd4d plugin directory was updated, and the deployed files were verified byte-identical to main.
These notes are not specific to this plugin and could still change based on Pressable-side configuration unrelated to this repo, so re-verify if a deploy ever behaves unexpectedly.
Each Pressable site (production and staging) has its own GitHub Integration pointing at this repo. A push/merge to a site's configured branch auto-deploys within a couple of minutes.
GitHub Pressable ────────────────── ───────────────────────────────────────── main branch ─────► production (bd4d.org) staging branch ─────► staging (bd4d-staging.mystagingwebsite.com) wp-content/plugins/bd4d ─────► htdocs/wp-content/plugins/bd4d (both sites)
Each site's integration (Pressable dashboard → site → GitHub Integration) uses per-directory Include and Delete toggles. Verified configuration for both sites:
| Setting | Production | Staging |
|---|---|---|
| Branch | main | staging |
| Include plugins directory | Yes | Yes |
| Include themes directory | No | No |
| Include MU Plugins directory | No | No |
| Delete plugin files not in repo | No | No |
| Delete theme files not in repo | No | No |
| Delete MU plugin files not in repo | No | No |
With "Include plugins: Yes" and the "Delete" toggles off, a deploy only adds/updates the bd4d plugin and never removes or touches anything else. Note: selecting a branch in the dropdown does nothing until you click Set and Deploy to commit it.
This repo contains only wp-content/plugins/bd4d. The server runs ~14 plugins (Divi Pixel, Jetpack, Autoptimize, WordPress SEO, etc.) that are not in this repo. Enabling "Delete plugin files not in repository" would delete all of them on the next deploy. Keep all three red "Delete …" toggles off, permanently.
"Include MU Plugins" is off, so files under wp-content/mu-plugins/ must be copied to the server manually (SFTP/rsync). Routine plugin deploys never touch them.
Server architecture:
Test on staging first, then promote to production:
feature branch ──► staging branch ──► staging site (test)
│
▼ (open PR, merge)
main branch ──► production (live)
Recommended: Always backup before deploying (see backup.sh in repo root)
Best for: When staging and production should be identical mirrors (content, settings, everything).
Pros: Single source of truth, staging exactly matches what goes to production Cons: Copies EVERYTHING (database, uploads, settings) - overwrites any production-only content
| Scenario | Recommended |
|---|---|
| Plugin changes only | Option A (GitHub deploy) |
| Staging/production are identical mirrors | Option B (Clone) |
| Production has unique content or settings | Option A (GitHub deploy) |
| Unsure | Option A (safer) |
Note: Form submissions go to Airtable, not WordPress, so no form data is lost either way.
As of 2026-07-19 the staging branch is the deploy source for the staging site (it was previously stale and unused). It was fast-forwarded to main, and the staging site's GitHub Integration was pointed at it (Selected Branch: staging). Push feature work to staging to deploy it to the staging site for testing; it doesn't need to stay perfectly in sync with main between tests.
First-push note: the staging integration was (re)configured on 2026-07-19 after previously pointing at a deleted branch. The auto-deploy-on-push behavior is expected to work like production but should be confirmed on the first real push to staging (check the deployed file timestamps on the server). If it doesn't fire, deploy manually via Set and Deploy or rsync, and re-check the integration.
Last updated: Jan 2026
| Back | FazBrowse Home | New Git URL |