=== aiProfile ===
Contributors: tonyarcus
Tags: profiles, people, locations, registrations, newsletters, email
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.5.15
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Manage people, locations, registrations, and references. Send scheduled emails and keep an audit trail.

== Description ==

aiProfile stores People, Locations, Registrations, and References for an organisation such as a campus, school, or ministry.

* People, locations, and registrations each have typed child fields.
* Newsletters and campaigns send scheduled emails. Recipients can answer required questions through `[pro_inputs]` using an email and input code.
* The audit card on a People, Location, Registration, or Reference record shows who changed which field, with select labels rather than raw ids.
* A REST API under `/wp-json/aiprofile/v1/` can list and update people, locations, registrations, and people child fields. It needs an administrator and a WordPress Application Password.
* AI Tip Jar licenses use the same people, locations, and registrations. Administrators issue and revoke keys under aiProfile → Licenses. A customer site activates and checks a key, and downloads the zip, without an administrator login.

Public shortcodes include `[pro_card]`, `[pro_child]`, `[pro_inputs]`, `[pro_profile]`, `[ai_location]`, `[ai_locations]`, `[ai_people]`, and `[pro_staff]`. `[pro_card]` returns nothing when nobody is logged in. `[pro_child]` is the logged-in field editor.

After activation, use **aiProfile → Check Table** so the plugin tables and seed rows exist.

Developer notes live in `README.md`.

== Installation ==

1. Upload the `aiprofile` folder to `/wp-content/plugins/`.
2. Activate aiProfile on the Plugins screen.
3. Open aiProfile, Check Table, and run Check Tables.
4. Open Members, Admin, or Super Admin from the plugin page, or place the matching shortcode on a page.

== Frequently Asked Questions ==

= Why is [pro_card] blank? =

The card is empty when no WordPress user is logged in.

= How do I update a person from the command line? =

Use a WordPress Application Password and PATCH `/wp-json/aiprofile/v1/people/{id}`. The account login password is rejected. Example:

`curl -u 'USER:APPLICATION_PASSWORD' -X PATCH -H 'Content-Type: application/json' -d '{"last_name":"Stratton"}' https://example.org/wp-json/aiprofile/v1/people/4`

= How do I update a child field? =

PATCH `/wp-json/aiprofile/v1/people/{id}/children/{prometatype}` with `{ "value": "..." }`. `prometatype` is the `pro_meta.id` for that child field.

= Check Tables keeps adding locations =

Location seeds are matched by name. Run Check Tables from the current plugin so existing names are updated instead of inserted again.

= Where is the changelog? =

This file, under Changelog. `changelog.txt` is a short copy.

== Changelog ==

= 1.5.14 =
* Updates for this free plugin come from WordPress.org.

= 1.5.13 =
* Release 1.5.13

= 1.5.12 =
* Release 1.5.12

= 1.5.11 =
* Release 1.5.11

= 1.5.10 =
* Release 1.5.10

= 1.5.9 =
* Maintenance release: version bump.

= 1.5.8 =
* Fix: never send blank newsletter emails (no published newsletter, or empty subject/body).
* Fix: only mark a newsletter as sent when the send succeeded.
* Fix: published-count check in next_newsletter now compares a real count.
* Fix: set_email_header now defines the local sender name/domain (settings 'Local Email Name' and 'Local Domain Name'), falling back as before.

= 1.5.7 =
* Published 1.5.7 at https://ai.net.nz/aiplugin/aiprofile.zip.

= 1.5.6 =
* Published 1.5.6 at https://ai.net.nz/aiplugin/aiprofile.zip.

= 1.5.5 =
* Published 1.5.5 at https://ai.net.nz/aiplugin/aiprofile.zip.

= 1.5.4 =
* Removed the Emails page scaffold. Email options, including scheduled sending, stay on the Admin screen.

= 1.5.3 =
* Check https://ai.net.nz/aiplugin/aiprofile.json for a newer version and install the zip published there.
* Published the install zip at https://ai.net.nz/aiplugin/aiprofile.zip.

= 1.5.2 =
* AI Tip Jar licenses. Administrators issue and revoke keys under aiProfile → Licenses.
* Customer sites can activate a key, check it, and download the update zip.

= 1.5.1 =
* Semantic versioning starts here. Earlier builds used a date stamp such as 0.26.04.22.
* People, Location, Registration, and Reference records with child fields.
* Audit trail with field names and select labels.
* REST API for people, people children, locations, and registrations.
* Public `/proinputs/` form for newsletter answers.
* Check Tables seeds locations by name.

= 0.26.04.22 =
* Last date-based version before 1.5.1.

== Upgrade Notice ==

= 1.5.1 =
Version numbers are now semantic (1.5.1) instead of date-based (0.26.04.22).
