Developer Reference
This section is for developers who want to extend, customize, or integrate with the ID Payment Link Generator plugin. Whether you’re building an add-on, connecting the plugin to a CRM, or writing custom automation, this reference covers everything you need.
What’s Covered
- Hooks & Filters — All available WordPress actions and filters you can hook into, with practical code examples for each.
- AJAX Endpoints — A complete reference of every AJAX and admin-post endpoint the plugin registers, including parameters, authentication requirements, and response formats.
- Database Schema — Full documentation of the three custom database tables (Pro), their column definitions, indexes, and the static CRUD classes you can use to interact with them.
Architecture Overview
The plugin follows WordPress coding standards and leverages core WordPress APIs throughout:
- Settings API — All plugin settings are registered via
register_setting()and rendered using the Settings API sections and fields pattern. Settings are stored in theidplg_settingsoption as a serialized associative array. - AJAX API — All dynamic operations (sending emails, searching customers, managing templates) use
wp_ajax_hooks with proper nonce verification and capability checks. - WP_List_Table — The Pro email log and customer list views extend
WP_List_Tablefor a native WordPress admin experience with sorting, pagination, search, and bulk actions. - dbDelta() — Custom database tables are created and updated using WordPress’s
dbDelta()function for safe, incremental schema management.
Naming Conventions
All code in this plugin is prefixed with idplg_ to prevent conflicts with other plugins or themes:
- PHP functions and hooks:
idplg_prefix (e.g.,idplg_generator_before_buttons) - PHP classes:
IDPLG_prefix (e.g.,IDPLG_Customers) - JavaScript globals and AJAX actions:
idplg_prefix (e.g.,idplg_send_email) - Database tables:
{prefix}idplg_prefix (e.g.,wp_idplg_customers) - Options:
idplg_prefix (e.g.,idplg_settings,idplg_db_version) - Nonces:
idplg_prefix (e.g.,idplg_nonce,idplg_pro_nonce)
Requirements for Custom Development
Before building on top of this plugin, ensure you have:
- WordPress 5.8 or higher
- PHP 7.4 or higher
- A local development environment with
WP_DEBUGenabled - Familiarity with the WordPress Plugin API (
add_action,add_filter)
Tip: When developing extensions, load your code on the
plugins_loadedhook at a priority later than 10 to ensure the ID Payment Link Generator classes are available.
