=== PublisherKits BioBuilder ===
Contributors: blackandwhitedigital
Tags: author, biography, profile, social media, SEO
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 0.9.9
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Stop leaving author profiles blank. BioBuilder automatically finds and fills in bios, social handles, and job titles — no manual research needed.

== Description ==

If your WordPress site has more than a handful of authors, chances are most of their profiles are incomplete. A name, an email address, and nothing else. No bio. No social links. No job title.

BioBuilder fixes that automatically.

When a post is published, BioBuilder searches the web for the author's professional profile, extracts their biography, social handles, job title, and employer, and writes it directly to their WordPress user account. No copy-pasting. No chasing contributors for headshots. No manual anything.

**Who it's for**

* **Publishers and editorial managers** with large or rotating author rosters — guest contributors, freelancers, industry experts — who accumulate thin profiles faster than anyone can fill them in manually
* **SEO and marketing professionals** who know that complete author profiles improve search rankings, support rich results, and demonstrate expertise to Google
* **Web developers** managing multi-author WordPress sites who want enrichment to happen automatically without building it themselves
* **Content editors** who are tired of asking contributors to fill in their bios and never getting a response

**What it does**

On every post publish, BioBuilder runs a web search for the author, uses AI to assess the results, and populates the following fields automatically:

* Professional biography (short and long versions with Pro)
* Job title and employer
* LinkedIn URL
* X (Twitter) handle
* Bluesky handle
* Facebook profile URL
* Instagram handle
* Threads handle
* Profile photo URL
* Professional hashtags

The Author Status table in your WordPress admin gives you a clear view of every author — their enrichment status, email data quality, and profile completeness — so you always know where the gaps are.

**Free features**

* Automatic enrichment on post publish
* Web search pipeline via Serper API (2,500 free searches/month)
* Populates bio, social handles, job title, employer, and photo URL
* Email confidence scoring — flags placeholder addresses, PR contacts, and free email providers so you know which authors are worth enriching
* Author Status admin table with completeness tracking
* Manual enrichment trigger per author
* API usage estimator

**Pro features** *(upgrade at publisherkits.com)*

* Draft / Approval Mode — review all proposed changes before they go live, with approve, reject, or edit-and-approve per field
* Bulk Enrich — scan every past post author and enrich in batches, not one by one
* AI biography drafting — full bio (150-200 words) and short bio (40-60 words), written by the AI model configured in your WordPress AI connector
* AI match confidence scoring — know how reliable each enrichment result is before it touches your data
* AI topic hashtag generation — relevant hashtags based on the author's expertise
* Social post templates — per-post, platform-specific copy for X, LinkedIn, and Bluesky, ready to use or schedule
* Scheduled re-enrichment — keep profiles current automatically
* Enrichment audit log — full history of every change made to every profile
* Author Types — classify each author as house, staff, freelance, expert or supplier, with a bulk roster assigner, so house bylines and outside experts stay out of your in-house staff figures
* Multi-site support

**Add-on: Author Plugin Integrations** *(available separately or included with Pro)*

Works alongside the author plugins your site already uses:

* Molongui Authorship
* Co-Authors Plus
* Simple Author Box

**Why complete author profiles matter**

Google's quality guidelines place significant weight on demonstrating author expertise, particularly for sites publishing health, finance, legal, or news content. Complete author profiles with verifiable credentials, social links, and professional biographies are one of the clearest signals you can send. BioBuilder makes that achievable at scale — without adding to anyone's workload.

By [PublisherKits](https://publisherkits.com) — essential tools for WordPress publishers.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/publisherkits-biobuilder/`, or install directly through the WordPress Plugins screen
2. Activate the plugin through the Plugins menu
3. Go to **BioBuilder → Settings** and enter your Serper API key (free at serper.dev — 2,500 searches/month included)
4. Optionally connect an AI provider at **Settings → Connectors** (WordPress 7.0+) for AI-powered biography drafting and match scoring (Pro) — BioBuilder uses the WordPress AI Client and stores no AI key of its own
5. Visit **BioBuilder → Author Status** to see your full author roster and trigger your first enrichment

== Frequently Asked Questions ==

= Do I need API keys? =

A Serper API key is required for web search enrichment. Serper is free to sign up and includes 2,500 searches per month — enough for most small to medium publishing sites. Sign up at serper.dev.

AI features (Pro) use the WordPress AI Client (WordPress 7.0+): configure your AI provider — for example Anthropic Claude or OpenAI — once at Settings → Connectors and every compatible plugin shares it. BioBuilder stores no AI key of its own. Provider usage is billed by the provider — typical enrichment costs are a fraction of a cent per author.

= Will BioBuilder overwrite my existing author data? =

No. By default, BioBuilder only fills in fields that are currently empty. Existing data is never touched unless you explicitly enable Force Re-enrich in settings.

= How accurate is the enrichment? =

Accuracy depends on how findable an author is online. For professionals with a LinkedIn profile, company page, or published bylines, accuracy is high. For authors with very common names or minimal online presence, BioBuilder will return a lower confidence score and leave fields blank rather than guess. The Pro confidence scoring feature makes this transparent.

= Is this GDPR compliant? =

BioBuilder only retrieves information that authors have made publicly available on their own professional profiles. The plugin does not create profiles, infer private information, or store data beyond what is returned and saved to the WordPress user account. You remain the data controller and are responsible for your own GDPR obligations. See publisherkits.com for full GDPR guidance.

= Does it work with guest author plugins? =

Yes — Molongui Authorship, Co-Authors Plus, and Simple Author Box are supported via the Author Plugin Integrations add-on (included with Pro or available separately).

= What happens if no profile is found? =

If BioBuilder cannot find a confident match, it leaves the author's profile unchanged and marks the enrichment as low confidence in the Author Status table. No guesses are written to your data.

= Can I review changes before they go live? =

Yes — this is the Draft / Approval Mode feature in Pro. Every proposed field change is held in a review queue where you can approve, reject, or edit individual fields before anything is written to the profile.

== Screenshots ==

1. Author Status — every author's enrichment status, email data quality, and profile completeness at a glance, with per-author enrich, sync and quick-edit actions
2. Insights — what BioBuilder has actually found across your roster, field-by-field coverage, and the email quality mix behind the search results
3. Author Types (Pro) — classify the roster as house, staff, freelance, expert or supplier, with your own custom types, so house bylines stay out of your staff figures
4. Bulk Enrich (Pro) — profile coverage across every field, live enrichment progress, and targeted re-enrichment for authors missing a specific field
5. Settings — Serper web search plus AI through the WordPress AI Client, configured once under Settings > Connectors; BioBuilder stores no AI key of its own

== External Services ==

This plugin connects to the following external services. By activating this plugin and using these features, you agree to the respective terms of service and privacy policies of each service.

**Serper (required for free and Pro)**

BioBuilder uses the Serper web search API to find publicly available information about authors. Search queries include the author's display name and your site's domain name. No sensitive personal data is transmitted.

* Service: [serper.dev](https://serper.dev)
* Terms of Service: [serper.dev/terms](https://serper.dev/terms)
* Privacy Policy: [serper.dev/privacy](https://serper.dev/privacy)

**AI provider via the WordPress AI Client (optional, Pro)**

When your site has an AI provider configured under Settings → Connectors (WordPress 7.0+), BioBuilder sends web search result snippets to that provider through the WordPress AI Client for AI-assisted data extraction and biography drafting. BioBuilder stores no AI credential; the provider and key are managed by WordPress. Which service receives the data depends on the connector you choose — for example:

* Anthropic Claude — Service: [anthropic.com](https://anthropic.com); Terms: [anthropic.com/legal/consumer-terms](https://www.anthropic.com/legal/consumer-terms); Privacy: [anthropic.com/legal/privacy](https://www.anthropic.com/legal/privacy)
* OpenAI — Service: [openai.com](https://openai.com); Terms: [openai.com/policies/terms-of-use](https://openai.com/policies/terms-of-use); Privacy: [openai.com/policies/privacy-policy](https://openai.com/policies/privacy-policy)

**PublisherKits Support Copilot service (optional, free and Pro)**

When you use the in-plugin Support Copilot (the Help button; managed under BioBuilder → Support), the assistant sends your typed question, the recent chat history, and a small read-only diagnostic snapshot — the plugin version, the versions of installed companion plugins, the admin screen name, and a short whitelist of non-sensitive settings — to the PublisherKits support service. This is used to fetch documentation matched to your installed version and, where your site has no AI provider of its own configured, to generate the answer on the service. No API keys, passwords, author records or site content are ever sent, and the assistant is read-only. If you choose "Send to support", the chat transcript and the diagnostic snapshot are sent to open a support ticket. Nothing is sent until a user with BioBuilder settings access accepts the in-widget privacy notice. The service answers a limited number of questions per month for free; sites answering on their own AI provider are not limited.

* Service: [publisherkits.com](https://publisherkits.com) (support endpoint: bwtlsupport.com)
* Privacy Policy: [publisherkits.com/privacy-policy](https://publisherkits.com/privacy-policy)

**Freemius (licence activation and updates)**

BioBuilder uses the Freemius SDK to validate and manage Pro licences and to deliver Pro updates. If you activate a Pro licence, Freemius may collect basic site and usage data as part of licence activation. This is subject to the Freemius Privacy Policy. No licence activation is required to use the free plan, and the free plan does not send data to Freemius unless you opt in.

* Service: [freemius.com](https://freemius.com)
* Privacy Policy: [freemius.com/privacy](https://freemius.com/privacy/)

**LinkedIn (Pro, internal verification only)**

When a LinkedIn profile URL is identified for an author, BioBuilder makes a direct HTTP request to that public LinkedIn profile page to verify that the author's name appears in the page content before writing the URL to their profile. This is a read-only verification check using publicly accessible pages — no LinkedIn API is used, no authentication credentials are transmitted, and no data is stored beyond the verified URL. This only occurs when a LinkedIn URL has been identified and is about to be saved.

* Service: [linkedin.com](https://www.linkedin.com)
* Terms of Service: [linkedin.com/legal/user-agreement](https://www.linkedin.com/legal/user-agreement)
* Privacy Policy: [linkedin.com/legal/privacy-policy](https://www.linkedin.com/legal/privacy-policy)

== Changelog ==

= 0.9.9 =
* Documentation: the External Services section now discloses Freemius, which handles Pro licence activation and updates, with a link to the Freemius privacy policy. The free plan needs no licence activation.
* Documentation: corrected the PublisherKits privacy policy link and updated the screenshot captions.

= 0.9.8 =
* Updated the bundled Freemius SDK from 2.13.1 to 2.13.4 (pricing page currency fixes, configurable API timeout, PHP compatibility and query-parameter handling improvements).

= 0.9.7 =
* Admin screens adopt the standard PublisherKits page header: a navy band with the plugin's identity mark and eyebrow, the page title, and the page description — consistent with the rest of the PublisherKits range. Admin notices now appear below the header instead of above the page.
* Fixed garbled characters on some admin screens (the Settings page title, the Author Status count line and search placeholder, and two Bulk Enrich labels) caused by mis-encoded punctuation.
* Admin stylesheet is now cache-busted on change, so styling updates appear without a hard refresh.

= 0.9.6 =
* Performance: the email confidence classifier no longer calls WordPress's filterable is_email() for its format check. Email-verification plugins that hook that filter with a remote API check (for example Antideo Email Validator) were being called once per author on the Insights screen — on a large roster that turned one page load into hundreds of remote requests and minutes of waiting. The classifier now uses an unfilterable local format check; on a measured 1,451-author site this took Insights from around 108 seconds to a normal page load. No behaviour change to classifications.

= 0.9.5 =
Three things in this release: AI now runs entirely through the WordPress AI Client, a new Support Copilot help assistant, and Pro author typing.

* **AI runs exclusively through the WordPress AI Client** (WordPress 7.0+, Settings → Connectors). The in-plugin AI provider selector, the Claude/OpenAI key fields and the shared PublisherKits key store have all been removed — no AI credential is stored or read by the plugin. Configure your provider once at Settings → Connectors and every compatible plugin shares it. A one-time admin notice explains the switch on sites without a connector configured. Field Discovery (Pro) AI classification routes through the AI Client too.
* **Support Copilot — a Help button on BioBuilder admin screens** that answers usage and setup questions in a popup chat, grounded in documentation matched to your installed version. Read-only: it can explain but never change anything, and any conversation can be sent on as a support ticket. Manage it under BioBuilder → Support. If your site has a WordPress AI provider configured, answers are generated on your own connector (labelled in the chat) with no limit; otherwise the PublisherKits support service answers a small number of questions per month for free (a higher allowance on Pro). The Help button also shows before the assistant is set up, with on-screen onboarding that points you to either registering this plugin for your free monthly answers or adding your own AI provider for unlimited answers. Nothing is sent to the support service until a user with BioBuilder settings access accepts the in-widget privacy notice; the onboarding itself is guidance only and sends nothing.
* **Pro: Author Types** — classify each author as house, staff, freelance, expert, supplier or a custom type, so house bylines and outside experts stay out of your in-house staff figures. A new Author Types screen manages the editable type list (add, rename, reorder, remove) with a bulk roster assigner sorted by post count so the biggest bylines are typed first, and a type dropdown is added to each author's profile screen.
* New PKBB_Read author-type read contract for reporting and author-markup consumers: get_author_types() returns the type per WordPress user ID and get_author_type_list() returns the configured list. Both are null-safe and return an empty array where unavailable. Author typing and list editing are Pro; the read contract itself is always present, so any consumer degrades gracefully on the free tier (no authors typed) with no dependency on BioBuilder Pro.

= 0.9.2 =
* New PKBB_Read read contract for the Insight Engine: get_coverage_stats() returns precomputed author-profile coverage (total authors, no bio, thin bio, missing job title/employer, LinkedIn, enriched count) in two bulk queries instead of a per-author scan.

= 0.9.1 =
* Hardening: guard the admin view helper functions against redeclare, removing a class of fatal error if a view is ever loaded twice in one request.
* Performance: prime the user-meta cache in one query before the Author Status render loop, replacing up to 50 per-author priming queries per page.

= 0.9.0 =
* Adopts the WordPress 7.0 core AI Client. Enrichment now routes through wp_ai_client_prompt() when available, using the shared key configured at Settings > Connectors with no key stored by the plugin.
* Falls back automatically to the existing shared PublisherKits key or a standalone key on pre-7.0 sites or where no connector is configured.
* New AI Client panel in Settings: shows the active path, a preferred-model dropdown populated from the models your connector key can actually use, an exact-model override, and an optional strict mode.
* Resolves the "AI connector has not been approved" block caused by direct provider calls under the new core AI stack.

= 0.8.31 =
* Pro: Field Discovery — scans site user meta for unknown profile fields from any plugin, theme, or developer
* Pattern matching (regex) classifies obvious fields instantly with no API cost
* AI classification handles ambiguous keys, seeded with known plugin examples (Yoast, AIOSEO, BuddyPress etc.)
* Admin confirmation table — review and adjust every suggested mapping before saving
* Saved field map used permanently by Author Plugin Bridge for all reads, writes, and syncs
* Individual map entries can be removed from the Field Discovery page

= 0.8.30 =
* Author Status: per-user Sync button imports data from active author plugins into BioBuilder (fills gaps, no overwrite)
* Author Status: site-wide Sync all button processes every author in one click with confirmation prompt
* Auto-sync: when a WordPress user profile is saved, BioBuilder automatically syncs with active author plugins
* Recursive sync guard prevents infinite loops when write_all triggers profile_update

= 0.8.27 =
* Pro: Author Plugin Bridge — reads from and writes to Molongui Authorship, Simple Author Box, VK Post Author, WP Post Author, Co-Authors Plus, and PublishPress Authors
* Enrichment context now enriched with employer/LinkedIn/bio from active author plugins before search query is built
* After successful enrichment, data is synced to all active author plugins automatically
* flush_user() and flush_all() methods for manual import of existing plugin data into BioBuilder meta

= 0.8.26 =
* AI prompt improved for authors with no employer context (phantom emails, PR emails) — distinctive names now scored 70+ when results consistently identify the same person

= 0.8.25 =
* Critical fix: AI extraction call was missing from enrichment pipeline — extracted data was always empty regardless of search results
* Added pattern-matching fallback when no AI key is configured
* Improved error messages in modal enrichment to show actual failure reason

= 0.8.20 =
* Settings: API key presence badge (Set/Not set) shown next to each key field
* Settings: masked key snippet displayed so you can identify which key is stored
* Settings: Test button per API key makes a live connection check and shows result
* Settings: Delete all data on uninstall checkbox added (off by default)
* Uninstall: API keys and enriched author data now preserved on uninstall unless deletion is explicitly opted in to

= 0.8.19 =
* Query builder: RED and GREY_FAKE authors now lead with name-only LinkedIn search
* Query builder: search_hint context field used in query construction
* Author detector: search_hint from user meta passed into enrichment context
* Quick Edit modal: search hint field added (stored as _pkbb_search_hint)
* Posts list: author profile traffic light column (red/amber/green dot by completeness)
* Posts list: click dot opens Quick Edit modal pre-filled with existing data
* Posts list: Enrich now button runs full pipeline synchronously and auto-fills fields
* New AJAX endpoint: pkbb_enrich_now_modal for synchronous modal enrichment

= 0.8.18 =
* Author Status: search box, column sorting, missing field filter bar
* Author Status: friendly field names as pills (replacing raw meta keys)
* Author Status: Data Quality and Enrichment Status legends
* Author Status: article count with link to filtered post list
* Author Status: recent 3 article links per author
* Author Status: Quick Edit modal for LinkedIn, Job Title, Company, X handle
* Author Status: Enrich Now button contrast fixed (navy, not grey)
* Author Status: AJAX handler for quick edit save (pkbb_quick_edit_author)

= 0.8.9 =
* Updated Freemius SDK from 2.13.0 to 2.13.1 (multisite, scheduling, bulk update fixes)

= 0.8.8 =
* Pro features moved to __premium_only files — free version contains upgrade prompts only, no gated code
* Inline scripts converted from <script> tags to wp_add_inline_script()
* LinkedIn URL verification documented in External Services section of readme.txt

= 0.8.7 =
* readme.txt rewritten with benefit-led copy and audience-focused description
* Screenshots section added
* Changelog cleaned up and deduplicated

= 0.8.6 =
* Fixed syntax error in class-biobuilder.php caused by incomplete load_plugin_textdomain removal

= 0.8.5 =
* Fixed syntax error in class-database.php caused by misplaced phpcs:ignore comment inside query string

= 0.8.4 =
* Fixed syntax error in class-biobuilder.php — orphaned arguments after load_plugin_textdomain removal

= 0.8.3 =
* Fixed WordPress.DB.PreparedSQL.NotPrepared warning — table name extracted to variable before use in query

= 0.8.2 =
* Fixed MissingTranslatorsComment errors in candidate-selector.php, draft-queue.php, author-status.php, bulk-enrich.php, and settings.php
* Fixed unescaped integer outputs in candidate-selector.php and draft-queue.php

= 0.8.1 =
* Fixed PreparedSQL phpcs:ignore placement in class-database.php
* Fixed remaining MissingTranslatorsComment errors across view files

= 0.8.0 =
* Plugin renamed from "PublisherKits WP BioBuilder" to "PublisherKits BioBuilder" — "WP" not permitted in WP.org plugin names or slugs
* Plugin slug changed from publisherkits-wp-biobuilder to publisherkits-biobuilder
* All i18n functions now use string literal text domain as required by WP.org
* Heredoc syntax replaced with string concatenation in class-ai-extractor.php
* parse_url() replaced with wp_parse_url() throughout
* strip_tags() replaced with wp_strip_all_tags() throughout
* wp_unslash() added to all POST/GET input handling
* Ordered printf placeholders (%1$d, %2$d) used throughout
* languages/ folder created
* load_plugin_textdomain() removed (not needed since WordPress 4.6)

= 0.7.0 =
* WP.org submission preparation: external services disclosure added, PHP minimum version set to 8.0, tested up to 6.9

= 0.6.9 =
* Removed uninstall.php — cleanup now handled via Freemius after_uninstall hook to preserve opt-out feedback

= 0.6.8 =
* Upgrade buttons now link directly to Freemius checkout
* Added pkbb_checkout_url() helper function

= 0.6.7 =
* Switched Pro gate to can_use_premium_code__premium_only() for correct WP.org free version stripping

= 0.6.6 =
* Restructured main plugin file to use correct Freemius if/else auto-deactivation pattern

= 0.6.5 =
* Added wp_org_gatekeeper token for WP.org compliance
* Freemius menu slug now correctly attaches Account page to BioBuilder menu

= 0.6.2 =
* Freemius SDK integrated — live licence activation, Pro feature gating, upgrade flows
* LinkedIn candidate selector UI complete
* Draft approval queue with approve, reject, and edit-and-approve per field
* Bulk Enrich with filter tabs (incomplete, never enriched, failed, all)
* Enrichment audit log

= 0.1.0 =
* Initial release

== Upgrade Notice ==

= 0.8.7 =
* readme.txt rewritten with benefit-led copy and audience-focused description
* Screenshots section added
* Changelog cleaned up and deduplicated

= 0.8.6 =
Fixes a syntax error that prevented the plugin loading on some configurations. Update recommended for all users.

= 0.8.0 =
Plugin renamed from PublisherKits WP BioBuilder. The slug has changed to publisherkits-biobuilder. If you have the previous version installed, deactivate and delete it before installing this version.
