=== HLX Donate ===
Contributors: hacklayer
Tags: donation, donate, fundraising, charity, woocommerce
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 1.2.2
Requires PHP: 7.4
Requires Plugins: woocommerce
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A compact, one-page donation form with automatic email certificates, WooCommerce checkout support, and donor analytics.

== Description ==

HLX Donate adds a clean, single-page donation form to any post or page via the `[hlx_donate]` shortcode. Donors pick an amount, fill in their details, and (if WooCommerce is active) are sent through your normal WooCommerce checkout to pay with whatever gateway you already have configured — Razorpay, Stripe, PayPal, or any other WooCommerce-compatible processor.

**Core features**

* One-page donation form, no page reload — quick amount pills, custom amount, one-time/monthly frequency
* WooCommerce checkout integration for real payment collection — requires WooCommerce and a configured payment gateway
* Automatic PDF donation certificate emailed to every donor, no external PDF library required
* Certificate email delivery log, viewable from the admin dashboard
* Donations list and analytics dashboard (today/this month/total raised, top donors, last 7 days)
* Monthly donor reminder emails, sent automatically ~30 days after a monthly donation
* Configurable FAQ section and "where funds go" allocation breakdown shown on the form
* Optional social sharing icons (WhatsApp, Facebook, Twitter/X, LinkedIn)
* Fully theme-able button color, currency symbol, and copy from the Settings screen

= Roadmap =

Planned for future releases: direct payment gateway integration without requiring WooCommerce, recurring/subscription billing, campaign goal progress bars, and CSV export of donor data. If you'd like to see a specific feature prioritized, please open a topic in the support forum.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/hlx-donate`, or install the plugin through the WordPress Plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **HLX Donate → Settings** to configure the form title, currency, amounts, and button color.
4. Go to **HLX Donate → Email** to set the "From" address/name and send yourself a test certificate email.
5. Add the `[hlx_donate]` shortcode to any page or post.
6. Install and activate WooCommerce with a payment gateway (Razorpay, Stripe, PayPal, etc.) configured — required to collect donations. HLX Donate automatically creates a hidden "Donation" product once WooCommerce is active, no extra setup needed.

== Frequently Asked Questions ==

= Do I need WooCommerce? =

Yes. HLX Donate requires WooCommerce (with a payment gateway configured) to actually collect a donation. If WooCommerce isn't active, the donation form shows an "unavailable" notice instead of accepting submissions — this is intentional, so no donation is ever recorded or certificated without a real payment going through.

= Does this plugin require an external PDF library? =

No. Certificates are generated with a small built-in PDF writer — no Composer dependencies or third-party services involved.

= Where are certificate PDFs stored? =

Nowhere. As of 1.2.2 the certificate is generated in memory and attached directly to the outgoing email — it is never written to your uploads folder or any other public directory, so there is no file for anyone to guess the URL of.

= How do I change the currency symbol? =

HLX Donate → Settings → General → Currency Symbol. This is a display symbol only; actual payment currency (when using WooCommerce) is controlled by your WooCommerce settings.

== Screenshots ==

1. Donation form on the frontend
2. Settings screen — General tab
3. Analytics dashboard
4. Email certificate example

== Changelog ==

= 1.2.2 =
* Security: donation certificate PDFs are now attached to the email in-memory instead of being briefly written to the uploads folder — removes a predictable-filename exposure window that relied on `.htaccess` (which offers no protection on Nginx hosts)

= 1.2.1 =
* FAQ section is now collapsed behind a "Frequently Asked Questions" toggle instead of always showing every question — keeps the donation page compact now that it sits inside the theme's normal layout

= 1.2.0 =
* Funds allocation categories can now have an optional link — if set, clicking that category on the donation form opens the link in a new tab; if left blank, it stays a plain informational row, same as before
* Fixed several admin settings descriptions that were left in mixed Hindi/English text — all plugin text is now English

= 1.1.0 =
* Admin pages now use the full available page width instead of being capped at a fixed 1200px
* Removed the theme-guessing "fullpage" hack on the frontend donation form (it hid site header/footer/sidebar by guessing CSS class names, and used a hardcoded header-height offset). The form now renders inside the theme's normal layout as a self-contained card — works correctly on any theme, no more header overlap
* Fixed a race condition where a donor could receive the certificate email twice for the same order
* Added database indexes for donor email, status, and date lookups — keeps the Analytics dashboard and monthly reminders fast as donation volume grows

= 1.0.2 =
* Donations without an active WooCommerce + payment gateway are now blocked with a clear message, instead of being recorded as "completed" and certificated without any payment actually being collected

= 1.0.1 =
* Added WooCommerce HPOS (High-Performance Order Storage) compatibility declaration
* Removed in-dashboard "Premium" marketing tab

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.2.2 =
Security fix: donation certificate PDFs no longer touch disk during email delivery. Recommended update, especially if your host runs Nginx.

= 1.2.1 =
Compacts the donation page — FAQ is now collapsed behind a toggle instead of always expanded.

= 1.2.0 =
Funds categories now support an optional link, and all remaining Hindi/English mixed admin text has been fully translated to English.

= 1.1.0 =
Fixes admin page width, frontend header-overlap on non-default themes, a duplicate-certificate-email bug, and adds database indexes for performance. Recommended update.

= 1.0.2 =
Donations now require an active WooCommerce + payment gateway to be collected — no more unverified "donations" recorded without payment.

= 1.0.1 =
Adds WooCommerce HPOS compatibility. Recommended update if you run WooCommerce.
