=== MADigital COD Manager for WooCommerce ===
Contributors: muhammadaamir10
Tags: woocommerce, cash on delivery, cod, fake orders, fraud detection
Requires at least: 5.8
Tested up to: 7.1
Stable tag: 1.0.0
Requires PHP: 7.4
Requires Plugins: woocommerce
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Manage WooCommerce Cash on Delivery orders. Detect fake orders, blacklist customers, bulk cancel unconfirmed orders and reduce RTO rates.

== Description ==

**MADigital COD Manager for WooCommerce** is a plugin for businesses that rely on Cash on Delivery (COD) as a payment method. Reduce fake orders, manage RTO (Return to Origin) rates, and take full control of your COD orders — all from your WP admin.

### Why You Need This Plugin

Cash on Delivery is a dominant payment method in Pakistan, India, MENA, and Southeast Asia — accounting for 40–80% of all transactions. But COD comes with a serious problem: 15–40% of COD orders are fake or unconfirmed, leading to wasted shipping costs and high RTO rates.

MADigital COD Manager gives you the tools to fight back.

---

### Key Features

**COD Dashboard**
- Overview of all COD orders at a glance
- Stats: Total COD, Confirmed, Fake/Cancelled, Pending, Blacklisted
- Recent COD orders with risk scores

**Automatic Risk Detection**
- Risk score (0–100) calculated for every COD order
- Detects duplicate orders from same phone number
- Flags blacklisted customers automatically
- Color-coded risk badges: Low / Medium / High

**Customer Blacklist**
- Blacklist customers by phone number or email
- Blacklisted customers are auto-flagged with high risk
- Easy add/remove from dedicated Blacklist page
- One-click blacklist from order dashboard

**Custom COD Order Statuses**
- COD Pending Confirmation — new COD order awaiting verification
- COD Confirmed — order verified and ready to ship
- COD Fake/Cancelled — flagged as fake and cancelled

**Bulk Actions in Orders List**
- Bulk mark orders as COD Confirmed
- Bulk mark orders as COD Fake/Cancel
- Bulk blacklist customers directly from orders list

**Settings Panel**
- Enable/disable fraud detection
- Configure duplicate order detection window
- Toggle risk score column visibility
- Control order notes behavior

---

### Perfect For

- Pakistani eCommerce stores
- Indian D2C brands
- MENA and Gulf region sellers
- Southeast Asian WooCommerce stores
- Any store with high COD order volume

---

### How Risk Score Works

Factors that increase risk score:
- Customer is on blacklist (+80 points)
- Duplicate order from same phone within configured hours (+40 points)
- Guest checkout with no order history (+10 points)
- No previous completed orders (+15 points)

Score 0-29 is Low risk (safe to process), 30-59 is Medium risk (call to verify), 60+ is High risk (likely fake).

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/madigital-cod-manager/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Make sure **WooCommerce** is installed and active
4. Go to **COD Manager** in the admin menu to get started
5. Configure your fraud detection settings under **COD Manager → Settings**

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =

Yes, WooCommerce must be installed and activated. The plugin will show a notice if WooCommerce is missing.

= Will this plugin work for stores outside Pakistan? =

Absolutely! It works for any WooCommerce store using Cash on Delivery — India, Bangladesh, MENA, Southeast Asia, and more.

= Can I blacklist a customer directly from the orders list? =

Yes! Use the bulk actions dropdown in the WooCommerce orders list to blacklist customers with one click.

= Does the risk score appear in the orders list? =

Yes, a COD Risk column is added to your WooCommerce orders list showing Low/Medium/High badges for all COD orders.

= What happens when a blacklisted customer places an order? =

Their order automatically receives a High risk score (80+), making it easy to spot and cancel quickly.

= Can I remove someone from the blacklist? =

Yes, go to **COD Manager → Blacklist** and click Remove next to any entry.

== Screenshots ==

1. COD Manager Dashboard with stats and recent orders
2. Risk score column in WooCommerce orders list
3. Customer Blacklist management page
4. Settings panel with fraud detection options
5. Custom COD order statuses in action

== Changelog ==

= 1.0.0 =
* Initial release
* COD Dashboard with analytics
* Automatic risk score calculation
* Customer blacklist (phone and email)
* Custom COD order statuses (Pending, Confirmed, Fake)
* Bulk actions: confirm, mark fake, blacklist
* Risk score column in orders list
* Duplicate order detection
* Settings panel

== Upgrade Notice ==

= 1.0.0 =
Initial release of MADigital COD Manager for WooCommerce.
