=== Nigeria GeoData ===
Tags: nigeria, geodata, forms, elections, locations
Requires at least: 6.3
Tested up to: 7.1
Stable tag: 1.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Provision Nigerian administrative and electoral geography into WordPress and use it in cascading selectors, APIs and forms.

== Description ==

Nigeria GeoData by Govware gives WordPress sites a local, queryable Nigerian administrative and electoral geography layer.

Site administrators can provision an authorised geography scope from the CampaignManager.ng Nigeria GeoData service, then use the imported data entirely from their own WordPress database. The plugin includes cascading selectors, a local REST API, PHP and JavaScript APIs, a native Contact Form 7 integration, and built-in GeoForms for collecting and storing submissions.

Supported geography includes:

* Nigeria and geopolitical zones
* States / FCT
* Senatorial Districts
* Federal Constituencies
* LGAs / Area Councils
* Wards / Registration Areas
* Polling Units

The local relationship graph supports flexible paths. A site can use State -> LGA -> Ward -> Polling Unit, include electoral levels, or skip levels where the stored relationships allow it.

= Additive coverage =

A WordPress installation is not limited to one purchase. Each provisioning key is one-time-use for its authorised scope, while the same site can add additional coverage later.

For example, a site can provision one LGA today, another LGA later, then a complete State or National package in the future. Existing matching geography is reused and new records are merged into the same local dataset. Completed coverage is not deleted when another scope is added.

= Built-in GeoForms =

Nigeria GeoData can create complete forms without another form plugin. Supported fields include Text, Email, Phone, Textarea, Select, Checkbox and configurable GeoData selector groups.

GeoForm submissions are stored locally in WordPress. Administrators can view submissions, export them as CSV, receive submission notifications, and optionally send confirmation emails to submitters.

= Contact Form 7 =

When Contact Form 7 is active, Nigeria GeoData registers native geography form-tags such as:

`[ngd_state* state]`
`[ngd_lga* lga depends:state]`
`[ngd_ward* ward depends:lga]`
`[ngd_polling_unit* polling_unit depends:ward]`

Selected values can be used in Contact Form 7 mail tags.

= Theme and design compatibility =

Frontend output uses normal semantic HTML form controls with lightweight layout CSS and plugin-specific class names. Themes and site builders can style or override the selectors and GeoForms using normal CSS.

= External service disclosure =

Nigeria GeoData uses the CampaignManager.ng Nigeria GeoData provisioning service to supply authorised Nigerian geography datasets. Payment is for the external data-provisioning service and authorised dataset scope; the WordPress plugin code itself is GPL-licensed and is not trialware.

Service page: https://campaignmanager.ng/nigeria-geodata/wordpress

External Service & Privacy Disclosure: https://campaignmanager.ng/legal/nigeria-geodata-wordpress-service-disclosure

Terms: https://campaignmanager.ng/legal/campaign-manager-agreement

When an administrator starts provisioning, the plugin sends the provisioning key, the site's WordPress home URL, a randomly generated installation identifier, the plugin version and provisioning-session data to CampaignManager.ng. The plugin may also request the public product/pricing catalog from CampaignManager.ng on its own administration screens.

Normal visitor geography queries, local REST/API reads, Contact Form 7 submissions and built-in GeoForm submissions do not send their submitted form data to CampaignManager.ng. After provisioning, geography selections are served from the site's local WordPress database.

== Installation ==

1. Install and activate Nigeria GeoData.
2. Open **Nigeria GeoData** in WordPress Admin.
3. Review the available coverage scopes and purchase a provisioning key for this WordPress site.
4. Enter the `NGWP-...` key and click **Provision Geography**.
5. Leave the provisioning screen open while the authorised datasets import in batches. Interrupted active sessions can be resumed.
6. After provisioning, use **Data Explorer**, **Forms**, **Integrations** or **Developer** to use the local data.

For a normal WordPress page, try:

`[nigeria_geodata fields="state,lga,ward,polling_unit"]`

For a complete built-in form, create one under **Nigeria GeoData -> Forms**, then place its generated shortcode on a page, for example:

`[nigeria_geodata_form id="1"]`

== Frequently Asked Questions ==

= Is the plugin itself free? =

Yes. The plugin code is GPL-licensed. CampaignManager.ng charges for the external geography provisioning service and the authorised dataset scope selected by the site owner.

= Does my website keep contacting CampaignManager.ng after provisioning? =

No for normal frontend use. Cascading selectors, local APIs and form geography queries use the local WordPress tables. CampaignManager.ng is contacted for provisioning and for limited service/catalog information on Nigeria GeoData administration screens.

= Can I add more geography later? =

Yes. Coverage is additive. You can add another LGA, a constituency, another State-level scope, or a National package later using another valid key registered to the same WordPress site. Existing overlapping records are reused.

= What happens if a provisioning session is interrupted? =

An active session can be resumed. A key is consumed only after successful completion. If a remote session expires before completion, the same unconsumed key can be used to start again.

= Does uninstalling the plugin delete the paid geography? =

No. Provisioned geography is intentionally preserved to avoid destructive loss of a paid local dataset.

= Does it work with Contact Form 7? =

Yes. A native Contact Form 7 adapter is included. The plugin also includes its own GeoForms builder. Other form builders can use the local REST, PHP or JavaScript APIs; dedicated native adapters may be added in later releases.

= Can I style the forms and selectors? =

Yes. The output uses normal HTML controls and plugin-specific CSS classes. Your theme or custom CSS can change colours, spacing, typography, borders and layout.

= Where are built-in form submissions stored? =

They are stored in custom tables in the site's own WordPress database. Email notifications are sent through the site's normal WordPress mail configuration.

== Privacy ==

Nigeria GeoData can store personal information when a site administrator creates a built-in GeoForm that requests such information. The exact fields collected are controlled by that site administrator. GeoForm submission data is stored locally in the WordPress database and may be included in notification emails configured by the site administrator.

The plugin does not send built-in GeoForm submissions or Contact Form 7 submission contents to CampaignManager.ng. Provisioning does send the site URL, installation identifier, plugin version, provisioning key and provisioning-session information to CampaignManager.ng as described above.

For a dedicated description of the external provisioning service, transmitted data, payment handling, retention and local-versus-remote processing, see: https://campaignmanager.ng/legal/nigeria-geodata-wordpress-service-disclosure

Site owners should disclose the fields they collect, their retention policy, and any email/SMTP provider used by their WordPress installation in their own privacy policy.

== Screenshots ==

1. Provisioned dashboard showing local geography coverage and record counts.
2. Data Explorer with cascading administrative and electoral geography selectors.
3. Coverage & Expansion showing additive geography packages on one WordPress site.
4. Built-in GeoForms editor combining normal fields with Nigerian geography selectors.
5. Contact Form 7 integration instructions and native GeoData form-tags.
6. Local submissions dashboard with submission review and CSV export.

== Changelog ==

= 1.0.0 =

* Initial public release by Govware.
* Paid, site-bound Nigeria GeoData provisioning with resumable batched imports.
* Clear per-dataset provisioning progress and expected-record counts for each authorised coverage.
* Additive multi-package coverage with idempotent geography merging.
* Local relationship-aware query engine and REST/PHP/JavaScript APIs.
* Cascading selector shortcode with flexible geography paths.
* Nigeria and geopolitical-zone materialisation.
* Native Contact Form 7 geography fields.
* Built-in GeoForms builder, local submissions, email notifications and CSV export.
* Data Explorer, Coverage & Expansion, Integrations and Developer admin tools.
