=== Speed in China | Test Website Speed from Mainland China | GFW Optimization & Google Fonts ===
Contributors: gauchoplugins, brandonfire, freemius
Author URI: https://gauchoplugins.com/
Plugin URI: https://speedinchinaplugin.com/
Tags: china, performance, google fonts, page speed, firewall
Requires at least: 5.3
Tested up to: 7.1
Stable tag: 1.0.2
Requires PHP: 7.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Test website speed from mainland China, scan Great Firewall blocked resources, and localize Google Fonts from your WordPress dashboard.

== Description ==

How fast is your website for visitors in mainland China? Speed in China runs real HTTP speed tests from Chinese servers, scans for Great Firewall blocked resources, and localizes Google Fonts — all from your WordPress Dashboard.

## ⚡ FREE MAINLAND CHINA SPEED TESTS
> Run one free speed test every 30 days using multiple servers in mainland China with the click of a button.

## 🌏 MULTIPLE SERVER LOCATIONS
> Speed tests run from servers in different Chinese provinces — including Beijing, Shenzhen, Guangzhou, Shanghai, and Qingdao — to give you a comprehensive picture of your site's performance in China.

## 🔍 CHINA RESOURCE ANALYSIS
> Automatically scan your site for resources blocked by the Great Firewall (GFW). Detects Google services, social media embeds, blocked CDNs, and other China-incompatible resources.

## 🔤 LOCALIZE GOOGLE FONTS
> Google Fonts (fonts.googleapis.com) are blocked in China. Enable one-click localization to download and serve Google Fonts locally so Chinese visitors see your site with the correct fonts.

## 📊 OPTIMIZATION INSIGHTS
> After each speed test, get actionable suggestions to improve your site's performance in China based on DNS, TCP, TLS, TTFB, and total load time metrics.

## ⏰ UPGRADE FOR MORE FREQUENT TESTS
> Because of API limitations and usage, you can upgrade to one of our [paid plans](https://speedinchinaplugin.com/#pricing) to run speed tests more frequently.

## ✅ PERFECT FOR:
* eCommerce stores selling to China.
* Agencies and developers with China-focused clients.
* Global websites with significant Chinese traffic.
* Anyone optimizing site speed behind the Great Firewall.

## 🆘 TOP-NOTCH SUPPORT
> Get red-carpet support from the [Gaucho Plugins](https://gauchoplugins.com/) team. Just [submit a ticket](https://support.gauchoplugins.com/).

🧠 [LEARN MORE >](https://speedinchinaplugin.com/)

🌱 [PLANS & PRICING >](https://speedinchinaplugin.com/#pricing)

⭐️ [CHINA PLUGINS BUNDLE](https://chinaplugins.com/)

### Roadmap:

* Email notifications about speed test results.
* Scheduled automatic speed tests.
* A map of your website's speed in each region in China.
* Export your speed test history.
* Display the latest speed results on the front-end.

Feel free to [contact our team](https://speedinchinaplugin.com/support/) to request other features.

Our plugin relies on the [Speed in China API](https://speedinchinaplugin.com) for speed tests. See our [terms of use](https://speedinchinaplugin.com/terms/) and [privacy policy](https://speedinchinaplugin.com/privacy/).

📕 [DOCUMENTATION](https://docs.speedinchinaplugin.com/)

🤝 [JOIN THE COMMUNITY](https://www.facebook.com/groups/559064778784087)

## ⭐️ SAVE 35% WITH CHINA PLUGINS BUNDLE ⭐️
Like the plugins? China Plugins Bundle covers eCommerce, uptime, and speed optimization to ensure your China-based website visitors have the best possible experience on your website.

[SAVE 35%](https://chinaplugins.com/) | [LEARN MORE](https://chinaplugins.com/)

### CHINA PAYMENTS PLUGIN
> Easily accept WeChat Pay and Alipay payments from Chinese customers.
[DOWNLOAD FREE](https://wordpress.org/plugins/wp-stripe-global-payments/) | [WEBSITE](https://chinapaymentsplugin.com)

### BLOCKED IN CHINA
> Check if your site is available from mainland China servers.
[DOWNLOAD FREE](https://wordpress.org/plugins/blocked-in-china/) | [WEBSITE](https://blockedinchina.io)

### SPEED IN CHINA
> Run website speed tests from mainland China servers.
[DOWNLOAD FREE](https://wordpress.org/plugins/speed-in-china/) | [WEBSITE](https://speedinchinaplugin.com)

## GAUCHO PLUGINS PORTFOLIO

**[Payment Page](https://wordpress.org/plugins/payment-page/)**: Start accepting payments in a beautiful payment form in less than 60 seconds

**[Split Pay Plugin](https://wordpress.org/plugins/bsd-woo-stripe-connect-split-pay/)**: Split WooCommerce payments across multiple connected Stripe accounts. 

**[Login for Stripe Customer Portal](https://wordpress.org/plugins/login-stripe-customer-portal/)**: Create an Account login area for your Stripe customers. 

**[Gyta Buyback](https://wordpress.org/plugins/gyta-buyback/)**: Create a trade-in / buyback business using WooCommerce. 

**[Version Info](https://wordpress.org/plugins/version-info/)**: Show WP, PHP, MySQL & Web Server Versions in the WP-Admin Dashboard.

**[China Payments Plugin](https://wordpress.org/plugins/wp-stripe-global-payments/)**: Accept WeChat Pay and Alipay payments from Chinese customers.   

**[Blocked in China](https://wordpress.org/plugins/blocked-in-china/)**: Check if your website is available in the Chinese mainland.  

**[Speed in China](https://wordpress.org/plugins/speed-in-china/)**: Check your website’s speed in the Chinese mainland.
== Installation ==

1. Download the plugin
2. Go to Plugins → Add New → Upload Plugin and upload the .zip file to your WordPress Dashboard.
3. Click Activate.
4. You will be redirected to the settings area, where you can run your first speed test.

== Screenshots ==

1. Speed Test Results
2. Optimizations & Google Font Localization

== Frequently Asked Questions ==

= How does the Speed in China API work? =

The Speed in China API uses the Globalping network (api.globalping.io) to run speed tests from servers located in mainland China. Results include DNS, TCP, TLS, TTFB, and total load time from each of the server locations.

= Where are the servers located? =

Servers are currently available in multiple regions across mainland China, including Beijing, Shenzhen, Guangzhou, Shanghai, and Qingdao.

= Why do I need to test my site's speed in China? =

Depending on your server location, your website speed may be faster in or outside of China. It's always good to test your site speed using mainland servers to fully understand the experience Chinese visitors might have on your site.

= How can I optimize my site speed in mainland China? =

There are a number of methods for optimizing your site speed in China. This plugin helps by identifying blocked resources, localizing Google Fonts, and providing optimization suggestions based on your speed test results.

= What does the China Resource Analysis do? =

It scans your site's HTML, CSS, and JavaScript to detect any external resources that are blocked or slow in China — such as Google services, Facebook embeds, and blocked CDNs — and provides recommendations for alternatives.

= Does my website have to be hosted in China to be fast in China? =

No. Your website can be hosted anywhere in the world. As long as the website can be optimized to avoid calling 3rd party services blocked by the Chinese firewall, your site should run well when accessed from mainland China.

= Is Speed in China related to Blocked in China? =

Yes — they are complementary plugins in the China Plugins stack. [Blocked in China](https://wordpress.org/plugins/blocked-in-china/) checks whether your site is reachable from mainland China, while Speed in China measures how fast it loads and helps you optimize performance for Chinese visitors.

= Do I need to opt in to use every feature? =

No. China Resource Analysis and Google Fonts localization work without connecting to our API. Speed tests require opting in (click "Allow & Continue") so we can run tests through the Globalping network on your behalf.

= What metrics does the speed test measure? =

Each test reports DNS lookup time, TCP connection time, TLS handshake time, Time to First Byte (TTFB), and total page load time from each mainland China probe location.

== External Services ==

This plugin connects to the following external services. None are contacted until you explicitly opt in (click "Allow & Continue" on the connect screen), with the single exception of the Google Fonts download flow, which only runs when you separately enable the "Localize Google Fonts" toggle on the Optimizations tab.

= Speed in China API (api.speedinchinaplugin.com) =
This plugin sends your public site URL to our backend API at `https://api.speedinchinaplugin.com/wp-json/speed-in-china-api/v1/speed-test` each time you click "Start Speed Test", which proxies the request to the Globalping network (api.globalping.io) to run real HTTP timings from probes in mainland China. We also perform a once-per-hour reachability health check by GETting `https://api.speedinchinaplugin.com/wp-json/`; no site data is sent. Speed test results are stored in your WordPress options table only; we do not retain them server-side.

* [Terms of Use](https://speedinchinaplugin.com/terms/)
* [Privacy Policy](https://speedinchinaplugin.com/privacy/)

= Globalping (api.globalping.io) =
Our Speed in China API runs your speed test through the Globalping network (operated by jsDelivr). Globalping probes in mainland China receive only your public site URL — no user-identifying data — and return raw timing/HTTP-status data to our API, which forwards it back to your WordPress site.

* [Globalping Terms](https://globalping.io/legal/terms-and-conditions)
* [Globalping Privacy](https://globalping.io/legal/privacy-policy)

= Freemius (api.freemius.com, freemius.com) =
This plugin uses the Freemius SDK for license activation and opt-in management. When you click "Allow & Continue" on the opt-in screen, Freemius receives your admin email, site URL, WordPress and PHP versions, and the plugin version, in order to issue a license token and (for premium customers) deliver license updates. Nothing is sent before you opt in; clicking "Skip" or "Maybe Later" keeps the plugin in anonymous mode and no Freemius requests are made.

* [Freemius Terms of Service](https://freemius.com/terms/)
* [Freemius Privacy Policy](https://freemius.com/privacy/)

= Google Fonts (fonts.googleapis.com, fonts.gstatic.com) =
When you enable Google Fonts localization on the Optimizations tab, this plugin connects to Google's Fonts API (fonts.googleapis.com and fonts.gstatic.com) to download font stylesheets and font files, which are then stored and served locally from your server. The font family names already present in your site's HTML are sent to Google as part of the download URL. No personal visitor data is transmitted to Google by this plugin. The toggle is off by default; no Google Fonts request is ever made until you enable it.

* [Google Terms of Service](https://policies.google.com/terms)
* [Google Privacy Policy](https://policies.google.com/privacy)

== Changelog ==

= 1.0.2 =
* Fixed a fatal "Cannot redeclare speeinch_log()" when the free and premium builds are installed side by side (e.g. right after upgrading) — the Freemius coexistence guard now wraps the whole main file
* Uninstall cleanup now runs via the Freemius `after_uninstall` action from a shipped include (`includes/uninstall-cleanup.php`); the root `uninstall.php` was removed
* Updated Freemius SDK to 2.13.4
* Tested up to WordPress 7.1
* Aligned `Requires at least` to WordPress 5.3 in both the plugin header and readme (uses `wp_date()`, introduced in 5.3)
* Added an ABSPATH guard to `admin/RestAPI/class-features.php`
* Renamed the admin-bar status node id from `bic-status` to `speeinch-status` so it no longer collides with Blocked in China

= 1.0.1 =
* WP 7.0 compatibility (Tested up to: 7.0)
* WordPress.org compliance: Cancel/Skip on opt-in, single-click anonymous mode (TC-10), prefixed CSS classes (no inline styles), WP_Filesystem for font cache, strict Google-host allow-list, XSS-safe JS helpers (escHtml/escUrl)
* Expanded External Services documentation: Speed in China API, Globalping, Freemius, Google Fonts — with consent-gating language
* Added dotlottie attribution (LICENSE + README) for the bundled lottie-player.js
* Renamed plugin constants and assets to `SPEEINCH_` / `speeinch-admin.*` for consistency
* Updated marketing URLs (blockedinchina.io → blockedinchinaplugin.com)
* Defensive normalization of `active_plugins` option for sandbox hosts (Playground, TasteWP)
* Cloud-bound R3 gating: features feed, notifications, scheduled tests, and manual speed test all bail out unless the user has explicitly opted in
* Persistent dismissible anonymous-mode notice on plugin admin pages with one-click reconnect

= 1.0.0 =
* First release!
* Speed tests from 5 mainland China server locations (Beijing, Shanghai, Shenzhen, Guangzhou, Qingdao)
* Great Firewall resource analysis with China compatibility score
* Google Fonts localization (automatic download + local serving)
* Speed test optimization suggestions based on performance thresholds
* Admin bar speed status indicator (paid plans)
* Scheduled automatic speed tests (Pro/Agency)
* Speed test history with logs and filtering
* China Plugins Bundle cross-install

See our full changelog in our [documentation](https://docs.speedinchinaplugin.com/changelog/changelog).
