=== WPSprintPlan Delivery Area Checker ===
Contributors: iqbal1486
Tags: delivery, zipcode, postal code, area checker, ecommerce, widget
Requires at least: 4.7
Tested up to: 7.0
Requires PHP: 7.0
Stable tag: 1.1.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Delivery area checker plugin for WordPress with zone mapping, service mapping, AJAX search, embeddable widget, and analytics.

== Description ==

WPSprintPlan Delivery Area Checker helps website visitors quickly check whether delivery is available in their area.
Users can search by zip code, postal code, or area name.

The plugin includes:

* Delivery zone management
* Zone code mapping
* Multiple delivery services per zone
* AJAX-based frontend checker with loading and result messages
* Embeddable script for non-WordPress websites
* Search analytics
* CSV import and dummy data import

This plugin is useful for restaurants, grocery stores, local services, and any business with delivery coverage rules.

== Features ==

* Search by zip code, postal code, or area
* Success and failure messages with zone/area details
* Multiple services shown for one area
* Admin tabs for Zones, Codes, and Services
* Add / update / delete records in admin
* Code-to-zone and service-to-zone mapping
* CSV import support
* Dummy data import support
* Clear all data option for testing
* REST API endpoints for check, suggest, and stats
* Embeddable script via `widget.js`
* WordPress shortcode support: `[wpsprintplan_delivery_area_checker]`

== Installation ==

1. Upload `wpsprintplan-delivery-area-checker` folder to `/wp-content/plugins/`.
2. Activate the plugin through the `Plugins` screen in WordPress.
3. Go to `Delivery Checker` menu in wp-admin.
4. Add zones, codes, and services from `Data Manager`.
5. Add shortcode `[wpsprintplan_delivery_area_checker]` to a page.

== Usage ==

= WordPress shortcode =

Use:

`[wpsprintplan_delivery_area_checker]`

= Embeddable widget =

Add script on any site:

`<script src="https://yourdomain.com/widget.js"></script>`

Then add:

`<div id="delivery-checker"></div>`

= API endpoints =

* `GET /wp-json/wpspdear/v1/check?query=90210`
* `GET /wp-json/wpspdear/v1/suggest?q=902`
* `GET /wp-json/wpspdear/v1/stats` (requires administrator; `manage_options`)

== Frequently Asked Questions ==

= Can I use area names instead of only zip codes? =

Yes. You can map area names and searchable text values in Codes and Zones.

= Can one zone have multiple delivery services? =

Yes. Add multiple service rows and map them to the same zone.

= Does it work without WordPress frontend page builder? =

Yes. You can use shortcode in any post/page or embed with `widget.js`.

= Is there a premium version? =

Additional features such as Google Sheets sync and advanced reporting are available as a separate plugin from https://www.wpsprintplan.com/ (not included in this WordPress.org release).

== Changelog ==

= 1.1.4 =
* Renamed internal prefix from zdc to wpspdear (4+ characters) for options, hooks, REST routes, and database tables.
* Restricted `/stats` REST endpoint to users with manage_options.
* Added migration for existing sites using the legacy zdc_ tables and options.

= 1.1.3 =
* Removed bundled Pro/trialware code so the WordPress.org plugin is fully functional on its own.
* Removed custom external update checker hooks (WordPress.org handles updates).

= 1.1.2 =
* Fixed WordPress.org i18n checks by using literal text domain in translation functions.

= 1.1.1 =
* Renamed plugin to WPSprintPlan Delivery Area Checker (slug: wpsprintplan-delivery-area-checker).
* Updated shortcode to [wpsprintplan_delivery_area_checker].

= 1.1.0 =
* Added table-based architecture for zones, codes, services, and logs.
* Added REST APIs for check, suggest, and stats.
* Added AJAX frontend checker flow with loading and result states.
* Added tabbed admin manager for zones, codes, and services.
* Added CSV import, dummy import, and clear-all options.
* Added embeddable widget script endpoint.

