=== CartNinja Recovery for WooCommerce ===
Contributors: krishnagajera
Tags: woocommerce, abandoned cart, cart recovery, email recovery, sms recovery
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Recover abandoned WooCommerce carts with email, SMS, and automated reminder workflows.

== Description ==

CartNinja Recovery for WooCommerce helps stores capture cart activity, detect abandonment, send email and SMS reminders, and restore the customer's cart with a secure recovery link.

= Free version features =

* Automatically tracks WooCommerce carts and detects abandoned checkouts.
* Captures guest email and phone details during checkout.
* Sends one cart recovery email when an email address is available.
* Sends one Twilio SMS recovery reminder when a phone number is available.
* Customizes recovery email subject, heading, message, button text, and additional content.
* Sends test recovery emails with sample cart data so the email body and styling can be reviewed before going live.
* Uses WooCommerce-style email templates with cart item summaries and theme override support.
* Restores the customer's cart from a secure recovery link.
* Shows abandoned, recovered, lost, and suppressed carts in the recovery queue.
* Includes dashboard analytics with abandoned/recovered chart filters.
* Provides Guest Abuse Protection to limit repeated guest cart tracking from the same IP address or blocked IP country.
* Removes old guest, suppressed, recovered, and lost cart records with configurable Data Cleanup.

= Premium version features =

* Includes all Free version features.
* Sends recovery reminders by email, SMS, and WhatsApp.
* Supports Twilio, Vonage, Sinch, and Plivo SMS gateways.
* Maps WhatsApp template body variables to CartNinja cart, customer, coupon, and recovery link values.
* Builds multi-step recovery sequences with custom reminder intervals.
* Adds optional coupons to recovery sequences.
* Shows revenue analytics, recovered revenue, channel reporting, and top abandoned products.
* Provides popup capture for collecting emails after Add to Cart and phone numbers before checkout abandonment.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin through the WordPress admin.
3. Ensure WooCommerce is active.
4. Configure your recovery settings under `Cart Recovery > Settings`.

== Frequently Asked Questions ==

= Does the free version support email reminders? =

The free version supports one Twilio SMS reminder and one email reminder per abandoned cart when contact details are available. Additional reminder channels are available in a separate Pro plugin hosted outside WordPress.org.


= Does this plugin require WooCommerce? =

Yes. WooCommerce must be active for cart capture, scheduling, and recovery.

== External Services ==

This plugin connects to the Twilio API to send SMS cart recovery reminders. A connection is made only when:

1. A cart is marked as abandoned and the customer provided a phone number
2. An admin clicks "Send Test SMS" in the settings page

Data sent: customer phone number and a recovery message containing the cart URL. No personal data beyond the phone number is transmitted.

Twilio is provided by Twilio Inc.

* Website: https://www.twilio.com
* Terms of Service: https://www.twilio.com/en-us/legal/tos
* Privacy Policy: https://www.twilio.com/en-us/legal/privacy


== Source Code ==

This plugin does not use compiled or minified assets.
Readable source for all plugin-owned JavaScript is included in this plugin package:

* admin/js/admin.js
* public/js/public.js

== Screenshots ==

1. Monitor abandoned carts, recovered revenue, and overall recovery performance from a centralized dashboard.
2. Configure cart abandonment rules, recovery URLs, and enabled reminder channels from the settings screen.
3. Connect Twilio credentials and test SMS delivery directly from the plugin settings.
4. Customize recovery email and SMS templates using dynamic customer and cart variables.
5. View and manage abandoned cart records, reminder activity, and delivery status in the recovery queue.

== Changelog ==

= 1.1.0 =

Added:
* [Free] Added a test email sender so store owners can send the current recovery email content to any address before enabling reminders.
* [Free] Added WooCommerce-style abandoned cart email templates with cart item summaries, recovery button text, optional footer content, and theme override support.
* [Free] Added dashboard abandoned/recovered chart visibility with richer date filters, including exact date, not on, before, after, between, monthly, yearly, and rolling ranges.
* [Premium] Added Add to Cart email capture popup support so shoppers can save their cart before reaching checkout.
* [Premium] Added WhatsApp template body variable mapping so each approved Meta template placeholder can be mapped to CartNinja values such as customer name, cart total, recovery URL, coupon code, email, or phone.

Changed:
* [Free] Changed recovery email content settings to separate subject, heading, message, button text, additional content, and HTML template preview controls.
* [Free] Changed admin CSS and JavaScript asset loading to use file modification versions so settings-page changes are not hidden by browser cache.
* [Premium] Changed revenue dashboard filtering to use the same expanded date range options as the main dashboard.

Fixed:
* [Free] Fixed suppressed cart dashboard totals so they count actual suppressed cart records instead of daily suppression attempts.
* [Free] Fixed suppressed cart filtering by saving newly suppressed guest carts as suppressed records and preventing already suppressed carts from returning to tracked status.
* [Free] Fixed test email feedback so the button shows sending, success, and error states instead of appearing inactive.

= 1.0.11 =

* Enabled WooCommerce geolocation fallback when the local geolocation database is unavailable.

= 1.0.10 =

* Moved the Freemius SDK to Composer-managed dependencies.
* Moved premium WhatsApp dependencies into the premium package dependency tree.
* Replaced raw cart JSON in cart details with a product table including images, quantities, and totals.
* Hid guest carts from the cart list by default and added customer-type filters.
* Added IP country detection for cart records using WooCommerce geolocation.
* Added blocked country settings to suppress abandoned cart tracking for selected IP countries.
* Fixed abandoned dates being cleared when existing abandoned carts are updated.

= 1.0.9 =

* Added configurable cleanup settings for old guest, suppressed, recovered, and lost cart tracking records.
* Added explanatory info icons to Guest Abuse Protection and Data Cleanup settings.
* Fixed toggle-card setting controls so checkbox, icon, and label stay aligned on one line.

= 1.0.8 =

* Added guest abuse protection settings for IP-based cart tracking limits and blocked IPs.
* Added suppressed cart tracking status, customer IP storage, and related database indexes.
* Excluded suppressed carts from abandonment processing and dashboard recovery totals.
* Added suppressed cart visibility in the dashboard, cart list filters, and cart details.

= 1.0.7 =

* Kept the Freemius SDK in generated free builds so licensing and upgrade flows remain available.
* Added visible units to abandonment and lost threshold settings for clearer recovery rule configuration.

= 1.0.6 =

* Fixed third-party WordPress admin notices appearing inside CartNinja hero headings.
* Added plugin-list shortcuts for Settings, View Details, and auto-update toggling.

= 1.0.5 =

* Updated the admin UI color palette.

= 1.0.2 =

* Loaded Chart.js from the bundled plugin asset instead of a remote CDN.

= 1.0.1 =

* Updated plugin prefixes from `acs` to `cartninja` to avoid naming conflicts.
* Removed locked feature surfaces from the WordPress.org free build.
* Excluded Freemius and premium-only code from the generated free package.
* Moved dashboard chart JavaScript into the enqueued admin script.
* Added direct-access guards to plugin PHP files.
* Fixed free build compatibility when Freemius removes premium-only SDK methods.
* Prevented free and premium packages from loading duplicate bootstrap symbols in the same request.
* Added guarded Composer autoload loading for premium dependencies.
* Removed shared free-build references to premium license checks.
* Removed Pro-channel hooks, retry paths, scheduling, settings UI, and shared package references from the free build.
* Restored paid-channel wiring using Freemius premium-only stripping conditions.
* Kept paid-only WhatsApp and license-status functionality behind Freemius premium-only stripping conditions.
* Kept premium settings tabs in premium-only partials while keeping the generated free settings template free of paid tab handling.
* Guarded premium sequence table cleanup references behind premium build detection.
* Reworked cart list and recovery token database queries to use fixed prepared SQL strings for Plugin Check compliance.
