=== Zakode Store Automation for WooCommerce ===
Contributors: zakode
Tags: woocommerce, automation, workflow, email, no-code
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

No-code WooCommerce automation workflows with a visual WHEN -> IF -> THEN builder.

== Description ==

Zakode Store Automation helps WooCommerce stores automate repetitive tasks without writing code.

Build workflows in three steps:
1. **WHEN** an event happens (trigger),
2. **IF** optional conditions match,
3. **THEN** actions are executed.

Workflows are processed asynchronously through Action Scheduler. Lower priority values are queued first, but final execution order can vary depending on Action Scheduler.

Supported languages:
- English (en_US)
- Polish (pl_PL)

Support: contact@zakode.pl

== Features ==

- Visual workflow builder in wp-admin (WHEN -> IF -> THEN).
- Trigger, condition, and action registries for extensibility.
- Workflow enable/disable state and queue priority.
- Execution logs (status, message, action, recipient, timestamp).
- Action Scheduler async processing with safe fallback.
- Optional retry scheduling for failed workflow runs.
- Email actions via `wp_mail()`.
- Logging toggle and uninstall data-retention setting.

== Installation ==

1. Upload the `zakode-store-automation` folder to `/wp-content/plugins/`.
2. Activate **Zakode Store Automation** in **Plugins**.
3. Ensure WooCommerce is active.
4. Go to **Zakode Store Automation -> Workflows**.

On activation, Zakode Store Automation creates:
- `{prefix}zakode_sa_workflows`
- `{prefix}zakode_sa_logs`

== Usage ==

1. Go to **Zakode Store Automation -> Add New**.
2. Enter workflow name, select trigger, set optional conditions, add actions.
3. Set workflow status (active/inactive) and priority.
4. Save workflow.
5. Check execution entries in **Zakode Store Automation -> Logs**.

== Screenshots ==

1. Workflow list with status toggle and quick actions.
2. Visual workflow editor (WHEN -> IF -> THEN).
3. Logs page with execution status and messages.

== FAQ ==

= Does Zakode Store Automation require WooCommerce? =

Yes. WooCommerce must be active.

= Does Zakode Store Automation guarantee strict workflow execution order? =

No. Lower priority values are queued first, but asynchronous execution depends on Action Scheduler processing.

= Why was an email action not delivered? =

Zakode Store Automation uses WordPress `wp_mail()`. Delivery depends on your server/SMTP configuration and mail provider.

= Can I disable logging? =

Yes. Use **Zakode Store Automation -> Settings**.

= Can I remove plugin data on uninstall? =

Yes. In **Zakode Store Automation -> Settings**, enable **Delete all Zakode Store Automation data when plugin is uninstalled**.

= Does Zakode Store Automation send any data to Zakode? =

Only if you explicitly opt in. By default, nothing is ever sent. See **Usage Data (opt-in)** below.

== Privacy ==

Zakode Store Automation stores automation-related operational data in WordPress database tables:
- workflow definitions (title, trigger, conditions, actions, status, priority),
- execution logs (workflow ID, order ID, user ID, action, recipient email, status, message, error text, timestamp),
- plugin options (version, DB version, logging toggle, uninstall data-retention preference).

This operational data always stays in your own WordPress database and is never sent anywhere.

= Usage Data (opt-in) =

Zakode Store Automation does not send any data to Zakode or any third party unless you explicitly opt in. Nothing is collected or transmitted by default.

If you click **"Allow & help improve"** on the notice shown after activation, or enable **"Share anonymous usage data"** in **Zakode Store Automation -> Settings**, the plugin sends the following to Zakode's servers when it is installed, updated, deactivated, or removed:
- a randomly generated, anonymous site identifier (not derived from your domain or any personal data),
- the plugin, WordPress, PHP, and WooCommerce version numbers,
- whether the site is a WordPress Multisite installation,
- the site locale.

No order data, customer data, product data, workflow content, or any other site content is ever collected or sent.

You may additionally opt in to sharing your WordPress admin email address (used only for update and support notices) via a separate checkbox in Settings. This is never collected unless you separately enable it.

You can withdraw either consent at any time in **Zakode Store Automation -> Settings**; a withdrawal notice is sent once, after which nothing further is transmitted. Data is retained by Zakode only for as long as needed to maintain aggregate installation statistics, and is not sold or shared with third parties. Requests are sent over HTTPS; standard web server access logs on the receiving end may include the site's IP address, as with any HTTP request.

For questions about this data or to request deletion of your site's usage data, contact contact@zakode.pl. Full privacy policy: https://zakode.pl/privacy

== Requirements ==

- WordPress 5.8 or newer
- PHP 7.4 or newer
- WooCommerce 6.0 or newer

== Changelog ==

= 1.1.2 =
* Fix: the opt-in telemetry endpoint now ships with a working default (Zakode's own collector) instead of an empty placeholder, so choosing "Allow" actually sends data — no site configuration needed. Nothing changes for sites that keep telemetry off.
* Internal: telemetry events now include a "product" identifier field, so the collector can distinguish between different Zakode plugins.

= 1.1.0 =
* New: opt-in, anonymous usage telemetry to help improve the plugin (off by default). See "Usage Data (opt-in)" under Privacy for exactly what is and isn't collected.
* New: consent notice with explicit Allow/No thanks choice, plus a toggle in Settings to change your choice at any time.
* New: optional separate opt-in to share your admin email for update/support notices.

= 1.0.1 =
* UI: secondary buttons (.button, .button-secondary, .button-action, .button-compact) now use standard WordPress styling instead of orange fill.
* UI: only .button-primary and submit inputs use the orange accent colour.
* UI: secondary button focus state shows an orange outline to match the theme accent.

= 1.0.0 =
- Initial public release.
- Visual WHEN -> IF -> THEN workflow builder.
- WooCommerce triggers, conditions, and actions.
- Async processing through Action Scheduler.
- Workflow logs and settings.
- English and Polish translations.

== Upgrade Notice ==

= 1.1.2 =
Fixes opt-in telemetry so it actually reaches Zakode once enabled. No action needed if you keep it off.

= 1.1.0 =
Adds optional, opt-in anonymous usage telemetry (off by default). No action required; nothing is sent unless you choose to enable it.

= 1.0.1 =
UI improvement: secondary buttons now match standard WordPress styling.

= 1.0.0 =
Initial release.
