=== Tecunit Connect ===
Contributors: tecunit
Tags: remote management, backup, security, maintenance, dashboard
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your WordPress site to a Tecunit dashboard for backups, health checks, Local Sync, and remote maintenance actions.

== Description ==

Tecunit Connect links your WordPress site to a [Tecunit](https://tecunit.com) business management dashboard (your own Tecunit account and server URL — not included with this plugin).

**What this plugin does on your site**

* Adds authenticated REST API routes under `/wp-json/tecunit/v1/`
* Lets an administrator enter a **platform URL** and **connection key** from Tecunit
* Reports plugins, themes, and site health to Tecunit when you sync
* Supports optional remote actions (updates, backups, security scan) when enabled in your Tecunit account

**What you need**

* A Tecunit account and a connection key from your dashboard
* HTTPS on your WordPress site (required in production)

**Privacy and external services**

This plugin sends data to the **platform URL you configure** (your Tecunit installation), not to WordPress.org. Only connect sites you control and trust your Tecunit instance. See your Tecunit privacy policy for how data is stored.

**Plugin updates**

* Installations from **WordPress.org** receive plugin updates through **Dashboard → Updates** (standard WordPress update system).
* Custom platform-delivered plugin updates are only used in **self-hosted** connector packages distributed by Tecunit, not in the WordPress.org listing.

== Installation ==

1. Install and activate Tecunit Connect from the WordPress.org plugin directory (or upload the ZIP from your Tecunit dashboard).
2. In WordPress admin, open **Tecunit Connect** in the left menu.
3. Enter your **Platform URL** (your Tecunit app URL) and **connection key** from the Tecunit dashboard.
4. Click **Connect to Tecunit**.

**Verify the REST API**

`curl -s -H "Authorization: Bearer YOUR_CONNECTION_KEY" https://yoursite.example/wp-json/tecunit/v1/status`

You should receive JSON with site status fields.

**Tecunit platform health check**

Your Tecunit server should expose `GET /api/wordpress/connect` returning JSON such as `{"ok":true,"service":"wordpress-connect"}`.

== Frequently Asked Questions ==

= Do I need a Tecunit account? =

Yes. This plugin is a connector for the Tecunit platform. It does not provide hosting or a dashboard by itself.

= Does this plugin send data to WordPress.org? =

No. Data is sent only to the platform URL you enter in settings, when you connect or sync.

= How are plugin updates delivered? =

If you installed from WordPress.org, use **Dashboard → Updates** like any other plugin. Enable auto-updates on the Plugins screen if you wish.

= Is HTTPS required? =

Yes for production sites. Local development hosts (localhost) may use HTTP when connecting to a local Tecunit instance.

= Can I use this without Tecunit? =

The plugin can be activated, but connection, sync, and remote features require a valid platform URL and key.

== Screenshots ==

1. Tecunit Connect — connect with platform URL and key
2. Connected site overview with Local Sync heatmap, sync, and backup actions

== Changelog ==

= 1.9.7 =
* Stop sync and Restart bridge buttons in WordPress (live and local)
* Stop cancels the job on Tecunit; restart retries with a fresh archive
* Bridge download/import respects stop requests mid-transfer

= 1.9.6 =
* Local Sync pull: background bridge avoids PHP timeouts during large downloads
* Download progress updates every few seconds (no more stuck at 52%)
* More reliable archive download via cURL/streaming fallback

= 1.9.5 =
* Platform tells connected sites when a connector update is available (sync + heartbeat)
* Auto-update enabled by default for self-hosted Tecunit installs
* Checks Tecunit for new versions every 6 hours and after each sync

= 1.9.4 =
* Live → local pull: streaming archive download (fixes "Empty archive" on large sites)
* Fresh live backup created when local site runs the sync bridge (no stale download links)
* Clearer errors and 24-hour backup download tokens
* Pull instructions in Tecunit dashboard and WordPress admin

= 1.8.0 =
* Rebranded to **Tecunit Connect** with a top-level WordPress admin menu
* Redesigned admin UI with health stats, install/download sidebar, and Local Sync heatmap
* Legacy Settings → Tecunit Connector URLs redirect to the new menu page
* Local Sync bridge fixes for localhost download/upload URLs
* One-click activation opens the Tecunit Connect screen

= 1.7.0 =
* One-click setup link from Tecunit (auto-connect while logged into wp-admin)
* Heartbeat sync every 6 hours keeps the dashboard fresh
* Health overview cards: updates, security, SEO, SSL
* Admin bar link to Tecunit dashboard
* /capabilities endpoint and richer /status response

= 1.6.0 =
* Automated SEO fix via `POST /wp-json/tecunit/v1/seo-fix` — indexing, sitemap redirect, robots.txt, head meta fallbacks, JSON-LD
* Requires Tecunit platform SEO Fix feature (Connector v1.6+)

= 1.5.0 =
* Fix Local Sync upload (missing API key helper) — push/pull works on localhost and cPanel
* On-page SEO audit runs on the WordPress host via `/wp-json/tecunit/v1/seo-audit` and sync payload
* cPanel / reverse-proxy: correct client IP rate limits and HTTPS detection behind proxies
* Safer outbound HTTP (local dev SSL, shared `tecunit_connector_http_*` helpers)
* WordPress.org: `uninstall.php`, directory `index.php` guards, cleaner package layout

= 1.4.0 =
* Remote connector update from Tecunit dashboard (`update_connector` action)
* Improved platform update checks and dashboard download flow
* Self-hosted ZIP enables automatic updates on connected WordPress sites

= 1.3.1 =
* WordPress.org–ready readme and plugin headers
* Platform plugin updates only in self-hosted builds; WordPress.org uses core updates
* Connector update checks, Local Sync, SEO ranking support, and maintenance improvements

= 1.3.0 =
* Local Sync (push/pull files and database via Tecunit)
* Expanded backup and security features

= 1.2.0 =
* One-click admin login, security scan, bulk maintenance actions

= 1.0.0 =
* Initial public release

== Upgrade Notice ==

= 1.6.0 =
Adds automated SEO fixes from the Tecunit dashboard. Update via Dashboard → Updates or upload the latest ZIP from Tecunit.

= 1.5.0 =
Recommended for Local Sync and SEO fixes. Update via Dashboard → Updates or upload the latest ZIP from Tecunit.

= 1.3.1 =
WordPress.org installs should update via Dashboard → Updates. Improves compatibility with the plugin directory guidelines.
