Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/alexphex/lead-manager/archive/refs/heads/main.zipWordPress plugin that captures leads from a frontend form, saves them as a custom post type, and syncs them to an external CRM in the background.
Built as a portfolio project to practice plugin architecture, REST API, and background processing in WordPress.
What it does
[lead_form]shortcode renders a contact form on any page- Form submits via Fetch API to a custom REST endpoint
/agency-lead/v1/submit - Leads saved as CPT
agency_leadwith custom admin columns (name, email, status) - After saving — Action Scheduler queues a background HTTP request to external CRM
- Admin gets an email notification for each new lead
Stack
- PHP 8.2, OOP, type declarations
- Vanilla JS, Fetch API
- WP REST API
- Action Scheduler
- WordPress 6.7+
Setup
git clone https://github.com/alexphex/lead-manager.git wp-content/plugins/lead-manager
Install and activate Action Scheduler plugin. Activate Lead Manager. Add [lead_form] to any page.
A few notes
Nonce validation on the REST endpoint — requests without a valid nonce get a 403. Data is sanitized with sanitize_text_field() and sanitize_email() before hitting the database.
CRM sync runs via Action Scheduler so the form response is instant — the heavy HTTP request happens in the background a minute later.
Classes are autoloaded with spl_autoload_register() — no manual requires.