=== Login with FocalShift ===
Contributors: focalshiftai
Tags: login, oauth, openid connect, sso, single sign-on
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 1.0.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Let visitors and your team sign in to your WordPress site with their FocalShift account — a "Log in with FocalShift" button powered by OpenID Connect.

== Description ==

**Login with FocalShift** adds a *Log in with FocalShift* button to your WordPress login, registration, and (optionally) WooCommerce account pages. Visitors and team members sign in with their existing FocalShift account — no new password to remember.

It is a standards-based OpenID Connect client. It uses the **Authorization Code flow with PKCE**, validates the ID token signature against the issuer's published keys (JWKS), and never stores passwords.

**Features**

* One-click "Log in with FocalShift" button on login, registration, and WooCommerce account pages.
* Shortcodes: `[focalshift_login_button]`, `[focalshift_connect_account]`, `[focalshift_profile_badge]`.
* Create new WordPress users automatically, or link to existing users by verified email.
* Safe role mapping (administrator mapping is off by default and must be explicitly confirmed).
* Optional, consent-based extended profile data: Network Hub profile, Academy credentials, gamification badges, business reputation, partner status.
* WooCommerce-aware (customer login only — no payment or wallet data).
* Redacted activity log; tokens and secrets are never recorded.

**You will need**

A FocalShift account that has registered this website in *Mission Control &rarr; Login with FocalShift* (https://app.focalshift.ai/cloud-login-focalshift, also reached from WordPress Sites), which provides the Client ID and Client Secret used on the Setup tab.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/login-with-focalshift-ai` and activate it.
2. In Mission Control, open **Login with FocalShift** (https://app.focalshift.ai/cloud-login-focalshift), click **Add Website**, and copy the **Client ID** and **Client Secret**.
3. In WordPress, open **Settings &rarr; Login with FocalShift**, paste the Client ID and Client Secret, and copy the **Callback / Redirect URI** shown there back into Mission Control as the website's Redirect URI.
4. Click **Test connection**, then choose where the button appears on the **Login Button** tab.

== Frequently Asked Questions ==

= Does this send any data off my site? =
Only during sign-in, and only to the FocalShift issuer you configure. The plugin does not phone home or include any tracking.

= Is my Client Secret safe? =
The Client Secret is stored in the WordPress options table and is never output in any front-end page.

= Can someone become an administrator automatically? =
No. Administrator role mapping is disabled by default and requires two explicit confirmations to enable.

== Screenshots ==

1. The "Log in with FocalShift" button on the WordPress login form.
2. The Setup tab with Client ID, Client Secret, and the Callback URI.
3. User Mapping settings with safe default role and verified-email enforcement.

== Changelog ==

= 1.0.7 =
* The settings screen now draws in the FocalShift Graphite look: the same panels, switches, buttons and type as the Entrepreneur's Toolkit, light and dark. The Log in with FocalShift button keeps its colours and mark and gets sharper corners. Nothing else changed.

= 1.0.6 =
* The Log in with FocalShift button now shows the FocalShift mark. It used to show a plain square (white on the default button). Nothing else changed.

= 1.0.5 =
* The licence and the translation template now name the copyright holder as FocalShift Inc. Nothing about how the plugin works has changed.

= 1.0.4 =
* One name. The plugin, its settings page and its messages now say FocalShift. Nothing about how sign-in works has changed, and your settings are kept as they are.

= 1.0.3 =
* The button now reads "Log in with FocalShift" everywhere it appears. A site still showing the old default text is moved to the new one; a button text you typed yourself is left as it is.

= 1.0.2 =
* Updates now arrive through WordPress like any other plugin. New installs keep themselves up to date automatically; on a site that already runs this plugin, turn automatic updates on or off on the Plugins screen.
* A site still pointing at FocalShift's old sign-in address is moved to the current one (app.focalshift.ai) by itself.
* If your site uses the Entrepreneur's Toolkit, connecting it to FocalShift now sets this plugin up for you.

= 1.0.1 =
* The setup steps and the Setup tab now point to the Mission Control page that registers your website: Login with FocalShift.

= 1.0.0 =
* Initial release: OpenID Connect login (Authorization Code + PKCE), user create/link, role mapping, extended profile scopes, WooCommerce login, shortcodes, redacted logs.

== Privacy ==

This plugin acts as an OpenID Connect client to a FocalShift identity service that you configure. During sign-in it sends the standard OAuth parameters to that issuer and receives an ID token and the profile claims you requested (such as name, email, and avatar). It stores a FocalShift subject identifier and the claims you enable as WordPress user meta. It never receives or stores passwords, wallet balances, payment details, or private account data. Uninstalling the plugin removes its settings, cached data, and the user meta it created.
