=== BG Labs — Animated Backgrounds ===
Contributors: bglabs
Tags: animation, background, canvas, design, visual
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add stunning animated backgrounds to any WordPress page. 40+ canvas effects, zero dependencies, automatic performance optimization.

== Description ==

**BG Labs** brings beautiful, high-performance animated backgrounds to your WordPress site. Choose from 40+ effects — particle fields, aurora, starfields, geometric meshes, matrix rain, and more — all rendered in the browser with zero external dependencies.

Animations are managed through the [BGLabs.app](https://bglabs.app) dashboard, where you can browse the full library, customize colors and speed, and assign animations to your domains. The plugin handles embedding with a simple shortcode or Gutenberg block.

= Why BG Labs? =

* **40+ animations** — From subtle gradients to immersive 3D particle nebulae
* **Zero dependencies** — Pure canvas rendering, no jQuery, no CSS frameworks
* **Auto-performance** — FPS monitoring, quality degradation, heap management
* **Domain-secured** — Animations are server-authorized, not client-cached
* **Works everywhere** — Classic Editor, Gutenberg, Elementor, Divi, WPBakery, Beaver Builder

= Free Plan =

Get started with a **free account** — 1 domain, full animation library access, no credit card required.

= How It Works =

1. Sign up at [BGLabs.app](https://bglabs.app) and get your API key
2. Paste it into the plugin settings
3. Add `[bglabs]` to any page — done!

Manage which animations appear on your site from the BG Labs dashboard. Authorize your domain there too.

The animation loads in a secure, sandboxed iframe with automatic performance management. Your site stays fast, your animation stays beautiful.

= External Service =

This plugin connects to **BGLabs.app** (`https://bglabs.app`), a third-party animation delivery service operated by BG Labs.

**What happens:** When a page containing a BGLabs animation is viewed by a visitor, a small JavaScript file is loaded from BGLabs.app servers. This script checks domain authorization and delivers the animation code.

**What data is sent:** Your API key (domain-locked, safe for frontend use) and standard HTTP request headers (Referer, User-Agent). No visitor personal data is collected or transmitted.

**When it connects:** On every page view of a page containing a BGLabs shortcode or block.

* [BGLabs.app](https://bglabs.app)
* [Terms of Service](https://bglabs.app/terms)
* [Privacy Policy](https://bglabs.app/privacy)

== Installation ==

1. Install and activate the plugin (upload the `bglabs` folder to `/wp-content/plugins/` or install via the WordPress Plugin Directory).
2. Sign up at [BGLabs.app](https://bglabs.app), get your API key, and authorize your domain.
3. Go to **BG Labs** in the admin sidebar, paste your API key, and add `[bglabs]` to any page.

== Screenshots ==

1. Admin dashboard — onboarding view with step-by-step setup guide
2. Admin dashboard — connected view with account status and quick links
3. Shortcode and block usage reference with code examples
4. Gutenberg block in the editor with sidebar settings panel
5. A live animation rendering as a full-page background

== Shortcode Reference ==

`[bglabs]` — Renders the animation assigned to your domain. Manage which animation appears from your BG Labs dashboard.

= Optional Attributes =

* `id` — (Advanced) Animation UUID to override the domain default with a specific animation.
* `target` — Attach the animation to a specific element by its HTML ID.
* `pick` — Select a specific animation by index (0, 1, 2) when multiple are assigned to your domain.
* `quality` — Performance profile: `auto`, `smooth`, `lightweight`, or `full`.

= Examples =

`[bglabs]`
`[bglabs quality="smooth"]`
`[bglabs target="hero-section" pick="2"]`
`[bglabs id="a1b2c3d4-e5f6-7890-abcd-ef1234567890"]`

== Frequently Asked Questions ==

= Do I need a BGLabs.app account? =

Yes. Sign up for free at [bglabs.app](https://bglabs.app). The free plan includes 1 domain with full access to 40+ animations.

= How much does it cost? =

The free plan is free forever — 1 domain, full animation library, includes a small "Powered by BG Labs" watermark. Paid plans start at $9/mo for 3 domains with no watermark. See [pricing](https://bglabs.app/pricing).

= Is the API key secret? =

No. The API key is a domain-locked authorization token. It is safe to include in frontend HTML because requests from unauthorized domains are rejected by the BGLabs server.

= Does this work with Elementor / Divi / WPBakery? =

Yes. Use the `[bglabs]` shortcode in any shortcode-compatible widget or module (e.g., Elementor Shortcode widget, Divi Code Module, WPBakery Text Block).

= Can I use multiple animations on one page? =

Yes. Each shortcode or block instance operates independently. Use different `id` or `pick` attributes to display different animations.

= Can I use a full-page background on every page? =

Yes. Add the `[bglabs]` shortcode to your theme header (e.g., via a "header scripts" plugin or your theme's `header.php` template).

= What happens if BGLabs.app is unreachable? =

The animation simply does not render — your page loads normally without any visible error. Animations are loaded asynchronously and never block page rendering.

= What happens if I deactivate the plugin? =

Your settings are preserved. Animations stop rendering but your configuration remains. Deleting the plugin (not just deactivating) removes all stored options.

= How does domain authorization work? =

When a visitor loads a page with a BGLabs animation, the embed script sends your API key and the page's domain to the BGLabs server. The server checks that this domain is authorized for your account. Unauthorized domains receive no animation code.

= Does this affect page performance? =

The embed script is small (~8KB) and loads asynchronously. Animations include automatic FPS monitoring and quality degradation — if the visitor's device struggles, the animation gracefully reduces quality or stops entirely.

== Changelog ==

= 2.0.0 =
* Complete plugin rebuild with branded admin dashboard.
* Step-by-step onboarding flow for new users.
* Account status display with tier, domain count, and connection health.
* Quick links to BGLabs dashboard, animation library, and pricing.
* Upgrade CTA with plan comparison for free-tier users.
* Full usage reference with code examples and attribute documentation.
* Modular class-based architecture (embed, shortcode, admin, block).
* Settings moved from Settings submenu to top-level BG Labs admin page.

= 1.0.0 =
* Initial release.
* Universal `[bglabs]` shortcode.
* Native Gutenberg block.
* Basic settings page for API key and server URL.

== Upgrade Notice ==

= 2.0.0 =
Major update: branded admin dashboard with onboarding, account status, and usage reference. Settings moved to the top-level BG Labs menu item.
