=== CASRAI CRediT Connector ===
Contributors: casrai
Tags: credit, contributor roles, orcid, schema, json-ld, e-e-a-t, authorship
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Show CRediT (Contributor Roles Taxonomy) metadata for your WordPress authors and link them to their verified CASRAI Contributor Directory profile.

== Description ==

The **CASRAI CRediT Connector** publishes machine-readable CRediT (Contributor
Roles Taxonomy, ANSI/NISO Z39.104-2022) metadata for your WordPress authors and
links each author back to their verified profile in the
[CASRAI Verified Contributor Directory](https://casrai.org/credit/authors).

**Why it matters — the identity handshake.** Your CASRAI profile already points
*out* to your ORCID iD and your journal. This plugin makes your journal/blog
point *back* to your CASRAI profile and ORCID, with CRediT roles, in Schema.org
JSON-LD. When both ends reference the same ORCID iD and link to each other,
search engines and knowledge graphs can resolve **one verified author entity** —
and that mutual corroboration is what strengthens **E-E-A-T** (experience,
expertise, authoritativeness, trustworthiness) for you and your publication.

**What it adds**

* A per-user identity panel (CASRAI profile URL, ORCID iD, default CRediT roles).
* A per-post "CRediT roles" box so you can record the roles performed on each post
  (CRediT is per-output, like a journal article's contribution statement).
* Schema.org `Person` JSON-LD on author archive pages, with `sameAs` to your
  CASRAI profile + ORCID — the identity handshake.
* Schema.org `BlogPosting` JSON-LD on single posts, with every contributor's
  CRediT roles encoded as Schema.org `Role` objects (`roleName` + canonical
  casrai.org role URI), each referencing its contributor by ORCID/CASRAI `@id`.
* **Multi-author support** — add any number of additional contributors per post
  (name + optional ORCID/CASRAI URL + their own CRediT roles), the way a journal
  article credits a full author team.
* A visible, journal-style **"Author contributions (CRediT)"** statement after
  the post, plus a `[casrai_credit_statement]` shortcode.
* An optional visible "CRediT-verified contributor on CASRAI" badge (with
  `rel="me"`) and a `[casrai_credit_badge]` shortcode.

**Works alongside Yoast SEO and Rank Math — no duplicate schema.** When a
schema-emitting SEO plugin is active, this plugin does *not* output a competing
JSON-LD block. It detects the plugin and **augments its existing graph** instead
(adding `sameAs` to your author entity and CRediT `Role`s to the article entity),
so the page keeps a single `Person` and a single `Article` node. With no such
plugin present, it emits its own self-contained JSON-LD.

This plugin requires a (free to read) CASRAI directory profile to link to. To get
a verified profile, see https://casrai.org/credit/authors.

== Installation ==

1. In WordPress admin go to **Plugins → Add New → Upload Plugin** and upload
   `casrai-credit-connector.zip`, then **Activate**.
2. Go to **Settings → CASRAI CRediT** and choose which outputs to enable.
3. For each author, open their **Users → Profile** screen and fill in the
   **CASRAI CRediT identity** section (profile URL, ORCID iD, default roles).
4. (Optional) When editing a post, set the post-specific CRediT roles in the
   **"CRediT roles (CASRAI)"** box.

== Frequently Asked Questions ==

= Do I need a CASRAI membership? =
You need a CASRAI Verified Contributor Directory profile to link to. The plugin
itself is free. See https://casrai.org/credit/wordpress-plugin.

= Does it change how my site looks? =
Only if you enable the visible badge. The JSON-LD is invisible structured data
for search engines and knowledge graphs.

= Will it conflict with my SEO plugin's schema? =
No. If **Yoast SEO** or **Rank Math** is active, the plugin does not emit its own
JSON-LD — it augments their graph in place (one `Person`, one `Article`, no
duplicates) via their official filters (`wpseo_schema_graph` /
`rank_math/json_ld`). With no schema plugin present, it emits its own
self-contained `Person` + `BlogPosting` JSON-LD. The **Settings → CASRAI CRediT**
page shows you which mode is active on your site.

= Can a post have more than one author? =
Yes. The WordPress post author is the primary contributor; in the **"CRediT roles
(CASRAI)"** box you can add any number of additional contributors, each with their
own name, optional ORCID iD / CASRAI profile URL, and CRediT roles. All of them
appear in the JSON-LD and in the visible contribution statement.

== Changelog ==

= 1.2.0 =
* New "Connect to CASRAI" button on the author's WordPress profile: paste your
  CASRAI profile URL (or just your username/slug) and the plugin fetches your
  verified identity from the public CASRAI directory and fills in your profile
  link and ORCID iD automatically — no manual transcription, no typos.
* Saving an author profile now verifies it against the live CASRAI directory and
  shows a "Verified" indicator; a blank ORCID is backfilled from the verified
  profile when available.
* Fix: the directory verification request now uses the correct public REST path
  (casrai.org/wp/wp-json), which previously failed silently.

= 1.1.0 =
* Multi-author support: add additional contributors per post, each with their own
  ORCID/CASRAI identity and CRediT roles.
* SEO-plugin conflict avoidance: when Yoast SEO or Rank Math is active, augment
  their existing schema graph (single Person + single Article) instead of emitting
  a competing JSON-LD block. Standalone JSON-LD only when no schema plugin is present.
* CRediT roles now encoded as Schema.org `Role` objects (correct CRediT-in-schema
  pattern) referencing each contributor by `@id`, replacing the prior `roleName`-on-DefinedTerm shape.
* New visible "Author contributions (CRediT)" statement + `[casrai_credit_statement]`
  shortcode, with an enable/disable toggle.
* Settings page now reports the detected SEO plugin and the active output mode.

= 1.0.0 =
* Initial release: per-user + per-post CRediT roles, author/post JSON-LD with
  sameAs identity handshake, visible badge, shortcode, settings page.
