=== ID Payment Link Generator ===
Contributors: insightdezign, freemius
Tags: payment links, invoicing, client payments, payment form, link generator
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 2.0.1
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate payment links with pre-filled client details and send them via email with merge tag support.

== Description ==

Payment Link Generator is a WordPress plugin that allows administrators to quickly generate payment links pre-filled with a client's name, email, and amount. Point it at any payment page on your site, enter the client details, and get a ready-to-send link in seconds — or email it directly from the admin.

Perfect for freelancers, agencies, and small businesses that need to send custom payment links to clients without creating separate invoices.

= Key Features =

* **Quick Link Generation** — Enter client details to instantly generate a payment link
* **Email Integration** — Send payment links directly via email with customizable templates
* **Merge Tags** — Use {first_name}, {last_name}, {email}, {amount}, {payment_link}, {logo}, and {site_name} in email templates
* **Logo Upload** — Upload your business logo and include it in payment emails via the {logo} merge tag
* **Professional Email Template** — Pre-built invoice-style email template with amount box, Pay Now button, and branding
* **Configurable Parameters** — Map URL parameters to match any payment form
* **One-Click Copy** — Copy the generated link to your clipboard with a single click
* **Rich Email Editor** — Full WordPress editor for composing HTML email templates
* **Administrator Only** — Only users with manage_options capability can access the tool
* **Lightweight** — No external dependencies, minimal footprint
* **Clean Uninstall** — Removes all data when deleted

= Pro Features =

* **Customer Management** — Save and reuse client details with a searchable customer database. Quick-select customers on the generator page to auto-fill fields. Auto-save new customers when sending emails.
* **Payment Link Log** — Track every email sent with status, date, and recipient details. Filter by status and date range. Resend emails with one click. Export your log to CSV.
* **Email Templates** — Create and manage multiple email templates. Select which template to use when sending. Set a default template for quick sends.

= Use Cases =

* **Freelancers** — Send clients a direct link to pay for a project
* **Agencies** — Generate links for different clients and amounts on the fly
* **Small Businesses** — Quickly create payment links without a full invoicing system
* **Retainers** — Send recurring payment links with pre-filled amounts

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/payment-link-generator` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to Payment Links > Settings and select your payment page.
4. Configure your form field parameter mapping if needed.
5. Set up your email template with merge tags.
6. Navigate to Payment Links > Generate Link to start creating and sending links.

== Frequently Asked Questions ==

= What page should I select as my payment page? =

Select any page on your site that contains a payment form. The plugin will append your configured query parameters to that page's URL.

= How do I configure the URL parameters? =

Go to Payment Links > Settings > Form Field Mapping. Enter the parameter names that your payment form expects. For example, if your form reads `?first_name=Jane`, set the First Name Parameter to `first_name`.

= What merge tags can I use in emails? =

You can use: `{first_name}`, `{last_name}`, `{email}`, `{amount}`, `{payment_link}`, `{logo}`, and `{site_name}` in both the email subject and body.

= Who can access the link generator? =

Only users with the `manage_options` capability (typically administrators) can access the generator and settings.

= Does this plugin process payments? =

No. This plugin only generates and emails links. You need a separate payment form or gateway on your payment page to actually process payments.

== Screenshots ==

1. The link generator interface with client fields and generate/send buttons
2. Generated link with one-click copy button
3. Settings page — payment page selection and parameter mapping
4. Email configuration with merge tags reference and rich editor

== Changelog ==

= 2.0.1 =
* Improved WordPress Plugin Check compliance across all Pro class files.
* Refactored custom table queries for coding standards compatibility.
* Changed date() to gmdate() in CSV export.

= 2.0.0 =
* Added Pro plan with three premium features: Customer Management, Payment Link Log, and Email Templates.
* Customer Management: Save, edit, search, and quick-select client details on the generator page.
* Payment Link Log: Track all sent emails with status filters, date range filtering, resend capability, and CSV export.
* Email Templates: Create multiple email templates with the WordPress editor, set defaults, and select per email.
* Added auto-save customer option when sending emails.
* Added Freemius paid plan integration with license management.
* Free users see Pro menu items with upgrade teaser pages.
* Created custom database tables for customers, log entries, and email templates.
* Updated plugin architecture with includes/ directory for Pro class files.

= 1.4.0 =
* Added logo upload field in Email Configuration settings.
* Added professional invoice-style default email template with amount box, Pay Now button, and footer.
* Added {logo} merge tag for embedding business logo in emails.
* Added {site_name} merge tag for including the WordPress site name in emails.
* Default email template is pre-loaded in the editor for new installs.

= 1.3.0 =
* Added Freemius SDK integration.
* Internationalized default email subject and body strings.
* Updated tested up to WordPress 6.9.

= 1.2.0 =
* Added email sending with merge tag support.
* Added configurable form field parameter mapping.
* Added email template settings with WordPress rich editor.
* Renamed all prefixes to idplg for conflict prevention.
* Added minified assets with SCRIPT_DEBUG support.
* Added activation checks, translation support, and uninstall cleanup.

= 1.1.0 =
* Added separate first name and last name fields.
* Added email field for client contact.

= 1.0.0 =
* Initial release.
* Admin page for generating payment links.
* Settings page to select payment form page.
* One-click copy to clipboard.
* Administrator-only access.

== Upgrade Notice ==

= 2.0.0 =
Major update introducing Pro features: Customer Management, Payment Link Log, and Email Templates. Upgrade to Pro to unlock all features.

= 1.4.0 =
New logo upload field and professional invoice-style email template with {logo} and {site_name} merge tags.

= 1.2.0 =
Major update with email sending support and configurable parameters. All option prefixes have been updated.

== Additional Information ==

= Support =

For support, please visit https://insightdezign.com or email support@insightdezign.com

= Credits =

Developed by Insight Dezign - Professional WordPress Development Services
