WP Manifestindependent plugin directory
manifest / forms / basic-form-plugin

Basic form plugin

Really basic plugin for WP integrated with mailchimp and recaptcha

by Matt Bedford · github.com/mattbedford/basic-form-plugin

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/mattbedford/basic-form-plugin/archive/refs/heads/main.zip

A simple but configurable form plugin for WordPress.

  • ✅ Shortcode support: [basic_form]
  • ✅ Google reCAPTCHA v2/v3 integration
  • ✅ Post-submission redirects
  • ✅ Clean OOP structure with Composer autoloading (PSR-4)

🧰 Requirements

  • PHP 8.1+
  • WordPress 6.x+
  • Composer (for development only)

🛠 Development Workflow

1. Install dependencies

After cloning or pulling:

composer install

This will generate the vendor/ directory with the autoloader.


2. Dump the autoloader (when needed)

If you add new classes or change namespace mappings, run:

composer dump-autoload

This regenerates the Composer classmap and ensures autoloading works.

💡 Tip: You can also run composer dev (shorthand alias) if you've added this script to composer.json.


3. Working with Namespaces

The plugin uses PSR-4 autoloading via Composer.

Your PHP classes must:

  • Live inside the Src/ folder
  • Declare the namespace BasicForm

Example:

namespace BasicForm;

class FormShortcode {
    // ...
}

No need for include_once — the Composer autoloader handles loading.


🚀 Building a Production Release

To build a ZIP file ready for deployment:

./build-release.sh

This will:

  • Copy plugin files (excluding dev clutter)
  • Run composer install --no-dev
  • Bundle the vendor/ directory
  • Output basic-form-plugin-release.zip in the plugin root

🧼 Ideal for upload to a live WordPress site — no need to run Composer in production.


📁 Directory Structure

basic-form-plugin/
├── Src/                     → All PHP classes (PSR-4 namespace: BasicForm)
├── vendor/                 → Composer autoloader and dependencies
├── basic-form-plugin.php   → Main plugin file (bootstrap)
├── composer.json
├── build-release.sh
└── README.md

👤 Author

Matt Bedford
mailto:matt@mattbedford.com


📄 License

This plugin is distributed as UNLICENSED.
Not for public reuse or redistribution without explicit permission.