=== MarketLyft – Email Marketing & Automation ===
Contributors: marketlyft
Tags: marketing-automation, email-marketing, woocommerce, lead-generation, newsletter
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Marketing automation for WordPress & WooCommerce — email campaigns, contact segmentation, lead tracking. Free up to 300 contacts.

== Description ==

**MarketLyft is a complete marketing automation platform — free up to 300 contacts, no credit card.** Capture leads, segment your audience, send targeted email campaigns, and automate customer journeys.

This plugin connects your WordPress site to MarketLyft in 2 minutes. Every new user, customer, form submission, and newsletter signup flows automatically into your marketing automation — no manual exports, no Zapier, no extra cost.

[**Create your free MarketLyft account →**](https://marketlyft.app/?utm_source=wp-plugin-readme&utm_medium=marketplace&utm_campaign=description-cta)

**What you get with MarketLyft:**

* **Email campaigns** — design and send broadcast and triggered emails with built-in templates
* **Marketing automation workflows** — drip sequences, welcome flows, re-engagement campaigns
* **Contact segmentation** — group contacts by tags, behaviour, properties, and engagement
* **Lead scoring** — identify your most engaged contacts automatically
* **Reporting & analytics** — track open rates, click-through, conversions, and revenue
* **Free tier** — up to 300 contacts, no credit card required

**Why MarketLyft instead of Mailchimp, ActiveCampaign, or HubSpot?**

MarketLyft delivers the full marketing automation toolkit — email campaigns, automation workflows, contact segmentation, lead scoring, and reporting — with a generous free tier up to 300 contacts and no upsell traps. Built for small and growing businesses that need more than newsletters but don't want enterprise pricing.

**Supported data sources:**

* WordPress user registration, profile updates, login, deletion, role changes
* WooCommerce customers, orders, order status changes, payments (HPOS + Block Checkout compatible)
* Contact Form 7 submissions
* Gravity Forms submissions
* MailPoet 3 subscriber events
* The Newsletter Plugin subscriber events

**Key features:**

* Configurable field mapping (WP/WC/form fields → MarketLyft contact fields)
* Automatic tag management (add/remove tags based on events)
* Background processing via WP Cron (built-in) with optional Action Scheduler upgrade
* Encrypted credential storage (sodium)
* Retry with exponential backoff on API failures
* HPOS and Block Checkout (WC 8.3+) compatible

= Third-Party Service =

This plugin sends data to your MarketLyft instance — the URL you configure in Settings → MarketLyft Sync. No data is sent to any other external service.

**Data transmitted:**

* User profile information (name, email, website URL)
* WooCommerce billing details (address, phone, company) when WooCommerce module is enabled
* Form submission data (Contact Form 7, Gravity Forms) when Forms module is enabled
* Newsletter subscriber data (MailPoet, Newsletter Plugin) when Newsletter module is enabled

**When data is transmitted:**

* On user registration, profile update, login, deletion, and role change
* On WooCommerce checkout, order status change, and payment completion
* On form submission (Contact Form 7, Gravity Forms)
* On newsletter subscription, update, and unsubscription events

Data is transmitted only to the MarketLyft URL you have configured. No data is collected by the plugin author.

* [MarketLyft Privacy Policy](https://marketlyft.app/privacy)
* [MarketLyft Terms of Service](https://marketlyft.app/terms)

== Installation ==

1. Upload the `marketlyft-sync` folder to `/wp-content/plugins/` or install directly from the WordPress plugin directory.
2. Activate the plugin.
3. Go to Settings → MarketLyft Sync.
4. Enter your MarketLyft instance URL.
5. Choose an authentication method (Basic Auth or OAuth2) and enter your API credentials.
6. Enable the sync modules you need (Users, WooCommerce, Forms, Newsletter).
7. Click "Test Connection" to verify the connection.

= OAuth2 Setup =

1. In your MarketLyft/Mautic instance, go to Settings → API Credentials and create a new OAuth2 client.
2. Set the Redirect URI to the value shown on the plugin settings page.
3. Copy the Client ID and Client Secret into the plugin settings.
4. Click "Authorize" and follow the prompts.

= Credential Encryption (Recommended) =

To encrypt stored API credentials, add the following to your `wp-config.php`:

`define( 'MLWPS_ENCRYPTION_KEY', 'your-64-char-hex-string' );`

Generate a key with: `php -r "echo bin2hex(random_bytes(32));"`

= Background Processing =

The plugin processes sync jobs in the background using WordPress's built-in WP Cron. No extra plugin is required. If Action Scheduler is already installed on your site (for example via WooCommerce), the plugin uses it automatically for better performance on large migrations and for the Tools → Scheduled Actions admin UI.

== Frequently Asked Questions ==

= What is MarketLyft? =

MarketLyft is an all-in-one marketing automation platform for small and growing businesses. It includes email campaigns, contact segmentation, automation workflows, lead scoring, and reporting — with a free tier up to 300 contacts. Sign up at [marketlyft.app](https://marketlyft.app/?utm_source=wp-plugin-readme&utm_medium=marketplace&utm_campaign=faq-cta).

= Does this plugin work without WooCommerce? =

Yes. WooCommerce is optional. The core Users module works with any WordPress installation. WooCommerce, Forms, and Newsletter modules can be enabled or disabled independently.

= Does this plugin import data from MarketLyft into WordPress? =

No. Synchronization is strictly one-way: WordPress → MarketLyft. No data is ever pulled from MarketLyft into your WordPress database.

= What happens if the MarketLyft API is unreachable? =

API calls are queued via Action Scheduler and retried up to 5 times with exponential backoff (1, 2, 4, 8, 16 minutes). Client errors (4xx) are not retried and are logged immediately.

= Is Action Scheduler required? =

No. The plugin uses WordPress's built-in WP Cron by default — no extra plugin is needed. If Action Scheduler is already installed (e.g. via WooCommerce), the plugin picks it up automatically, which scales better for very large migrations (10k+ contacts) and provides a detailed admin UI at Tools → Scheduled Actions.

= How are my API credentials stored? =

If you define `MLWPS_ENCRYPTION_KEY` in `wp-config.php`, credentials are encrypted with XSalsa20-Poly1305 (libsodium) before being stored in the database. Without the key, credentials are stored in plain text.

= Which WordPress hooks does this plugin use? =

The plugin listens to 17 WordPress/WooCommerce/form/newsletter hooks. See the plugin documentation for the complete list.

== Screenshots ==

1. API connection settings with OAuth2 authorization
2. Sync module selection (Users, WooCommerce, Forms, Newsletter)
3. Field mapping interface
4. Successful connection test

== Changelog ==

= 1.1.2 =
* Bug fix.

= 1.1.1 =
* Onboarding redesign — first-time visitors to the settings page now see a welcome card with three setup steps (create a free MarketLyft account, get API keys, paste & authorize) instead of an empty technical form. Helps users who installed the plugin from the WordPress.org search without prior knowledge of MarketLyft.
* 24/7 support box prominently displayed on the settings page with the `hello@marketlyft.app` contact — round-the-clock setup help available on every plan, including the free tier.
* On-page FAQ — five common questions answered without leaving WordPress (what MarketLyft is, whether a paid account is needed, how to get OAuth credentials, what happens to existing users, who to contact for help).
* Cleaner settings page for new installations — advanced sections (Tags & Logging, Field Mapping, Sync Status) are now collapsed until the OAuth2 connection is authorized, reducing cognitive load on first visit.
* Plugin renamed to "MarketLyft – Email Marketing & Automation" in the WordPress.org directory.
* German translation updated with all new strings (132 strings total).

= 1.1.0 =
* First Sync — one-click bulk migration of existing WordPress users, WooCommerce customers, and newsletter subscribers (MailPoet / The Newsletter Plugin) to MarketLyft after OAuth2 authorization. Runs once, shows a live progress bar, and can be reset from the settings page if needed.
* No external dependency: background processing now uses WP Cron by default (built into WordPress core). Action Scheduler is still used automatically when present (e.g. on WooCommerce sites) — but it is no longer required.
* Privacy: sync error logs no longer include contact field values — emails are masked and other values are dropped. Prevents PII leakage on shared hosting and centralised log collectors.
* Credential storage warnings: the settings page now accurately reflects whether `MLWPS_ENCRYPTION_KEY` is configured, showing a warning when credentials fall back to plaintext or when a rotated key prevents decryption.

= 1.0.3 =
* WooCommerce OAuth2 integration

= 1.0.1 =
* OAuth2 authorization flow
* Improvements to settings page UI and field mapping
* WooCommerce HPOS and Block Checkout compatibility fixes
* Various bug fixes and stability improvements

= 1.0.0 =
* Initial release
* WordPress user sync (registration, profile update, login, deletion, role change)
* WooCommerce customer and order sync (HPOS + Block Checkout compatible)
* Contact Form 7 and Gravity Forms integration
* MailPoet 3 and Newsletter Plugin integration
* Configurable field mapping UI
* OAuth2 and Basic Auth support
* Encrypted credential storage (libsodium)
* Action Scheduler background processing with retry and exponential backoff

== Upgrade Notices ==

= 1.1.2 =
Bug fix.

= 1.1.1 =
Onboarding redesign for first-time users — welcome card with setup steps, on-page FAQ, and 24/7 support contact. No action required on update.

= 1.1.0 =
Adds a First Sync button so you can push existing users, customers, and newsletter subscribers to MarketLyft in one click. Background processing now works out of the box without Action Scheduler.

= 1.0.3 =
Adds OAuth2 support for WooCommerce.

= 1.0.0 =
Initial release.
