=== SocialCrew Widgets ===
Contributors: alexandrecarbonell
Tags: widgets, embed, shortcode, block-editor, sports
Requires at least: 6.2
Tested up to: 6.9
Requires PHP: 8.0
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed SocialCrew widgets in WordPress using shortcodes or a Gutenberg block, without pasting script snippets by hand.

== Description ==

SocialCrew Widgets loads the official SocialCrew widget runtime from `widgets-api.socialcrew.io` when a page contains a widget shortcode or the SocialCrew block.

* Shortcode `[socialcrew_widget]` with catalog parameters (type, team, league) or a direct `space` id.
* Shortcode `[socialcrew_widget_saved]` for presets you save under **Settings → SocialCrew Widgets**.
* Gutenberg block **SocialCrew Widget** to pick a saved preset.
* Settings screen with a shortcode builder, preview in a new window, and saved widget management.

The plugin ships a compressed local catalog (JSON, gzip+base64) so allowed type/team/league combinations resolve to a `space` id without an extra API call for the catalog.

== External services ==

This plugin relies on SocialCrew's hosted widget loader to render widgets in the visitor's browser.

**What the service is:** The endpoint `https://widgets-api.socialcrew.io/load` serves the JavaScript module that powers the widget UI (tables, fixtures, polls, etc.) when your site outputs the plugin shortcode or block.

**What data is sent and when:** On each page view where a widget is embedded (or when you use the admin preview), the visitor's browser requests that URL. Typical query parameters are `space` (the widget identifier), `adaptive=true`, and optional `showHeader`. The plugin does not intentionally send WordPress user credentials or private admin data to SocialCrew—only the public widget parameters needed to render the embed.

**Documentation (widgets product):** [SocialCrew Widgets](https://widgets.socialcrew.io/)

**Terms of Use:** [https://widgets.socialcrew.io/termos-de-uso](https://widgets.socialcrew.io/termos-de-uso)

**Privacy policy:** [https://widgets.socialcrew.io/politica-de-privacidade](https://widgets.socialcrew.io/politica-de-privacidade)

== Installation ==

1. Upload the `socialcrew-widgets` folder to `/wp-content/plugins/`, or upload the ZIP via **Plugins → Add New → Upload Plugin**.
2. Activate the plugin through the **Plugins** screen.
3. Go to **Settings → SocialCrew Widgets** to build shortcodes or save widgets.
4. Place `[socialcrew_widget ...]` or `[socialcrew_widget_saved id="..."]` in a post or page, or insert the **SocialCrew Widget** block.

== Frequently Asked Questions ==

= Does this plugin work without an internet connection? =

No. The widget script is loaded from `https://widgets-api.socialcrew.io/load` when the shortcode or block output is present on the page.

= Where are saved widgets stored? =

In the WordPress database, option `socialcrew_widgets_saved_presets`. They are removed if you uninstall the plugin (see uninstall handler).

= Can I use a custom loader URL? =

Not in this version; the loader URL is fixed to the SocialCrew production endpoint.

== Screenshots ==

1. Settings page with shortcode builder and saved widgets list.

== Changelog ==

= 1.0.2 =
* Readme: terms and privacy links now point to the dedicated pages on widgets.socialcrew.io.

= 1.0.1 =
* WordPress.org review: enqueue admin/block editor JavaScript (no inline `<script>` in PHP), document external services with legal links, remove redundant `load_plugin_textdomain()` for directory-hosted builds, safer widget preview window.

= 1.0.0 =
* Initial public release for WordPress.org: shortcodes, saved presets, Gutenberg block, readme and i18n-ready strings.

== Upgrade Notice ==

= 1.0.2 =
Readme update: legal links for the SocialCrew widget service.

= 1.0.1 =
Review fixes for WordPress.org compliance.

= 1.0.0 =
First stable release on the plugin directory.

== Privacy ==

When a visitor loads a page that embeds a SocialCrew widget, the browser requests a JavaScript module from **widgets-api.socialcrew.io**. Query parameters may include the widget `space` id, `adaptive=true`, and optional `showHeader`.

The plugin does not send your WordPress user data to SocialCrew by default. Site administrators configure widgets in wp-admin; only public widget parameters are used in the front-end script URL.

For questions about data processed by SocialCrew’s servers, refer to the **External services** section above, the privacy policy at [widgets.socialcrew.io/politica-de-privacidade](https://widgets.socialcrew.io/politica-de-privacidade), and the terms at [widgets.socialcrew.io/termos-de-uso](https://widgets.socialcrew.io/termos-de-uso).
