=== SAVP Boost for Leyka ===
Contributors: studioavp
Tags: leyka, donations, utm, analytics, fundraising
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires Plugins: leyka

Additional tools for the Leyka donation plugin: UTM tracking, form improvements and campaign controls. Requires Leyka 3.20+.

== Description ==

**SAVP Boost for Leyka** is an all-in-one add-on for the [Leyka](https://wordpress.org/plugins/leyka/) donation plugin. It combines three powerful modules into a single plugin, replacing the need for separate add-ons.

= UTM Tracker =

Track the source of every donation with full UTM attribution support.

* Captures UTM parameters (source, medium, campaign) from donor URLs and cookies
* First touch and last touch attribution models
* Donations table with filters by source, medium, campaign, status and date range
* Analytics dashboard: top traffic sources, top campaigns, first→last touch paths
* Pagination (25 records per page) and CSV export
* UTM link generator with history

= Toolkit =

Improve your Leyka donation forms with useful UI additions.

* Newsletter subscription checkbox — adds a customizable opt-in checkbox to donation forms, assigns a donor tag on successful donation
* Recurring payment consent checkbox — adds a mandatory consent checkbox for recurring donations, blocks form submission until checked, assigns a donor tag

= Close Campaign (Закрыть сбор) =

Give your team control over donation campaigns directly from the frontend.

* Toggle button on donation forms to open or close a campaign with one click
* Configurable minimum amount threshold and auto-toggle threshold
* Activation and deactivation statistics
* Customizable button appearance (colors, icon, border)

= Unified Event Log =

All three modules write to a single shared event log.

* Color-coded badges for modules and log levels (ERROR / INFO / DEBUG)
* Filter by module and log level
* Search by message
* Download log file
* Auto-rotation with configurable retention period (default: 30 days)

= Module Controls =

Each module can be enabled or disabled independently from the main Settings page.

== Installation ==

1. Make sure the [Leyka](https://wordpress.org/plugins/leyka/) plugin (version 3.20 or higher) is installed and active.
2. Upload the `savp-boost-for-leyka` folder to `/wp-content/plugins/`.
3. Activate the plugin through the **Plugins** menu in WordPress.
4. Go to **Leyka Boost → Settings** to configure each module.

**Note:** If you were previously using the separate leyka-utm-tracker, leyka-toolkit, or leyka-close-campaign plugins, deactivate and delete them before activating SAVP Boost for Leyka. Your existing data will be preserved.

== Frequently Asked Questions ==

= What plugins are required? =

SAVP Boost for Leyka requires the [Leyka](https://wordpress.org/plugins/leyka/) donation plugin version 3.20 or higher to be installed and active.

= Will I lose data if I switch from the separate add-ons? =

No. SAVP Boost for Leyka uses the same database table and option keys as the original separate plugins (leyka-utm-tracker, leyka-toolkit, leyka-close-campaign). Your existing UTM data, settings, and statistics will be available immediately after activation.

= Can I use only some modules? =

Yes. Each module (UTM Tracker, Toolkit, Close Campaign) can be enabled or disabled independently from **Leyka Boost → Settings**.

= Where are log files stored? =

Log files are stored in `wp-content/uploads/savp-boost-for-leyka/logs/`. The directory is protected from direct access via `.htaccess`. Log filenames include a random hash for additional security.

= Does it work with multisite? =

The plugin uses `wp_upload_dir()` for log file paths, which is multisite-compatible. Full multisite support has not been explicitly tested — use with caution on multisite installations.

= Is it compatible with the latest WordPress? =

Yes. SAVP Boost for Leyka has been tested up to WordPress 7.0.

= How do I export UTM data? =

Go to **Leyka Boost → UTM Tracker**, apply any filters you need, and click the **Export CSV** button. The export respects active filters.

= How does the Close Campaign toggle work? =

When enabled, a toggle button appears on donation forms on the frontend. Clicking it opens or closes the campaign. The toggle is visible only to users with the appropriate permissions (configurable in settings).

= What happens to my log files when I uninstall the plugin? =

When the plugin is deleted through the WordPress admin, all plugin options, the UTM tracker database table, and the log directory are removed. This behavior can be reviewed in `uninstall.php`.

== Screenshots ==

1. Main Settings page — manage modules and logging preferences
2. UTM Tracker — donation statistics with source analytics and filters
3. Toolkit — newsletter subscription and recurring payment consent settings

== Changelog ==

= 1.0.0 =
* Initial release.
* UTM Tracker: donation UTM tracking with first/last touch attribution, analytics, CSV export and link generator.
* Toolkit: newsletter subscription checkbox and recurring payment consent checkbox for donation forms.
* Close Campaign: frontend toggle button to open/close donation campaigns with statistics.
* Unified event log with module filtering, level badges, search and auto-rotation.
* Russian and English localization included.

== Upgrade Notice ==

= 1.0.0 =
Initial release.

