=== Wundraiser ===
Contributors:      woracious
Tags:              donation, fundraising, paypal, donate, gutenberg
Tested up to:      6.9
Stable tag:        1.0.0
Requires at least: 5.8
Requires PHP:      7.4
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Accept donations with PayPal, campaign tracking, and a beautiful Gutenberg block.

== Description ==

Wundraiser is a donation management plugin built for WordPress. It provides a complete fundraising solution through a native Gutenberg block that handles campaign creation, payment processing, donor communication, and webhook event tracking — all from within the WordPress admin.

The donation form follows Apple design principles with rounded corners, clean typography, smooth animations, and responsive layouts that adapt from desktop to mobile without breaking. Donors select a preset amount or enter a custom value, choose between one-time and recurring frequencies, fill in their details, and complete payment through PayPal — all without leaving the page.

Each Gutenberg block instance creates and manages its own campaign. Campaign name, target amount, currency, donation presets, and design colours are configured directly in the block sidebar. A live progress bar tracks total raised against the target with real-time donor count.

**What Wundraiser handles out of the box:**

- PayPal payment processing (sandbox and live modes)
- One-time donations with automatic order creation and capture
- Campaign creation and management through Gutenberg blocks
- Real-time progress bar with fundraising goal tracking
- Donor and admin email notifications on every successful donation
- Webhook event logging with status tracking and event filtering
- CSV export of webhook events for reporting
- Test data import and cleanup tools for development
- Processing fee coverage option for donors
- Multi-currency support (USD, EUR, GBP, INR)

**Admin dashboard features:**

- Donations list with search, sort, and status filtering
- Dashboard widget showing total raised, donation count, and donor count
- Payments page for PayPal credential management and webhook configuration
- Settings page for email customisation and plugin preferences
- Tools page for test data operations and diagnostics
- Webhook events page with filtering, bulk actions, and purge controls

**Built for developers:**

Wundraiser uses PSR-4 autoloading, namespaced classes, repository pattern for all database operations, a service provider container, and structured error handling with a custom exception hierarchy. The codebase passes WordPress Plugin Check with zero errors.

== Installation ==

1. Upload the wundraiser folder to the /wp-content/plugins/ directory, or install the plugin through the WordPress plugins screen.
2. Activate the plugin through the Plugins screen in WordPress.
3. Navigate to Wundraiser in the admin menu to configure your PayPal credentials.
4. Add the Wundraiser Donation Form block to any page or post using the Gutenberg editor.
5. Configure the campaign name, target amount, currency, and donation presets in the block sidebar.
6. Publish the page and start accepting donations.

== Frequently Asked Questions ==

= What payment gateways are supported? =

Wundraiser supports PayPal for both sandbox testing and live payment processing. Additional gateways are planned for future releases.

= Can I run multiple campaigns? =

Yes. Each Donation Form block instance creates its own campaign. You can place multiple blocks on different pages, each with its own campaign name, target amount, currency, and donation presets.

= Does it support recurring donations? =

The donation form includes a recurring frequency selector with monthly and annual options. Recurring subscription processing is available in Wundraiser Pro.

= Is it compatible with the block editor? =

Wundraiser is built as a native Gutenberg block. It uses server-side rendering for the frontend and the WordPress block editor sidebar for all campaign configuration. It does not use shortcodes.

= Does it work with Full Site Editing themes? =

Yes. The Gutenberg block works in any FSE theme that supports the widgets block category.

= How do I test payments before going live? =

Configure your PayPal sandbox credentials on the Wundraiser Payments page. All transactions will process through the PayPal sandbox environment. Switch to live credentials when ready to accept real payments.

== Screenshots ==

1. Donation form on the frontend with progress bar and preset amounts
2. Gutenberg block editor with campaign settings sidebar
3. Admin donations list with search and filtering
4. Payments page with PayPal configuration
5. Webhook events page with status tracking
6. Dashboard widget with fundraising overview

== External services ==

This plugin connects to PayPal to process donations and manage webhooks.

= PayPal REST API =

The plugin sends requests to the PayPal REST API to create and capture payment orders, manage subscription plans, register and delete webhooks, and verify webhook event signatures. Data sent includes the donation amount, currency, donor email, return URLs, and webhook endpoint URL. Requests are made when a donor submits a donation on the frontend, when the admin configures PayPal credentials or webhooks on the Payments page, and when PayPal sends webhook event notifications. The API endpoint is https://api-m.paypal.com for live mode and https://api-m.sandbox.paypal.com for sandbox mode.

= PayPal JavaScript SDK =

The plugin loads the PayPal JavaScript SDK on frontend pages that contain a donation form block. The SDK renders the PayPal payment buttons and handles the client-side payment flow. The SDK is loaded from https://www.paypal.com/sdk/js with the site's PayPal Client ID passed as a URL parameter.

PayPal terms of use: https://www.paypal.com/us/legalhub/useragreement-full
PayPal privacy policy: https://www.paypal.com/us/legalhub/privacy-full

== Changelog ==

= 1.0.0 =
Initial release.

== Upgrade Notice ==

= 1.0.0 =
First release of Wundraiser. Accept donations with PayPal through a native Gutenberg block.
