=== Sonic KQXS ===
Contributors: qycaca
Tags: lottery, kqxs, xsmb, xsmn, vietlott
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display Vietnam lottery results, live updates, statistics, and prediction summaries with responsive WordPress shortcodes.

== Description ==

Sonic KQXS displays public Vietnam lottery results in WordPress with shortcode-based views, live refreshes, local caching, statistics, and prediction summary modules.

The plugin supports Northern (XSMB), Central (XSMT), and Southern (XSMN) regions, province history, weekday history, and Vietlott results. Historical result views use AJAX loading and cache-aware rendering so initial pages stay lightweight.

Features:

* Vietnam lottery results for XSMB, XSMT, and XSMN.
* Province-based and weekday-based result views.
* Vietlott Mega 6/45 and Power 6/55 support.
* Live result refresh with optimized caching.
* AJAX loading for historical results.
* Statistics views for frequency, missing numbers, cycles, and head-tail analysis.
* Prediction summary display with scheduled data preparation.
* Responsive front-end layout for mobile and desktop.
* Vietnamese and English localization.
* WordPress locale-aware language selection.

Shortcodes:

* `[kqxs_home]` - Main lottery dashboard.
* `[kqxs_mien region="mb"]` - Regional results. Supported values: `mb`, `mt`, `mn`.
* `[kqxs_tinh province="ha-noi"]` - Province result history.
* `[kqxs_ngay date="2026-06-06"]` - Results by date.
* `[kqxs_thu day="thu-2"]` - Results by weekday.
* `[kqxs_vietlott game="mega645"]` - Vietlott results.

== External Services ==

Sonic KQXS uses the 383.im data service and connects to configured HTTPS JSON endpoints under `api.383.im` to display public Vietnam lottery results.

Service website: https://383.im/
Terms of Service: https://383.im/terms-of-service/
Privacy Policy: https://383.im/privacy-policy/

Requests are made when:

* A lottery shortcode is rendered.
* Live data is refreshed.
* Historical results are loaded through AJAX.
* A scheduled refresh task runs.
* An administrator prebuilds cache from the plugin admin screen.

The request may include the server IP address, the plugin User-Agent, and the requested endpoint path. The plugin does not send visitor personal data to the service and does not add the site domain to its request User-Agent.

Example endpoint patterns:

* `https://api.383.im/lottery/live.json`
* `https://api.383.im/lottery/region/*.json`
* `https://api.383.im/lottery/province/*.json`
* `https://api.383.im/lottery/weekday/*.json`

== Installation ==

1. Upload the `sonic-kqxs` folder to `/wp-content/plugins/`.
2. Activate "Sonic KQXS" from the WordPress Plugins screen.
3. Review the API settings under the Sonic KQXS admin page.
4. Add a Sonic KQXS shortcode to any page, post, or widget area that supports shortcodes.

== Frequently Asked Questions ==

= Does this plugin support live results? =

Yes. Live results are refreshed through the plugin data layer with caching to avoid unnecessary repeated requests.

= Does it store historical data? =

Yes. Historical result responses can be cached locally for performance and refreshed by scheduled tasks or admin tools.

= Does it support Vietlott? =

Yes. Mega 6/45 and Power 6/55 result displays are supported.

= Does it include prediction features? =

Yes. The plugin includes prediction summary displays based on prepared statistical data.

= Is any visitor personal data sent to the external service? =

No. The plugin requests public lottery JSON endpoints. It does not send visitor personal data to the external API.

== Screenshots ==

1. Lottery dashboard with regional result sections.
2. Province and weekday result views.
3. Statistics analysis panel.
4. Mobile responsive layout.

== Changelog ==

= 1.0.5 =

* Finalized WordPress.org review cleanup for bundled PHP, JavaScript, CSS, and translation files.
* Documented the external data service with service website, Terms of Service, and Privacy Policy links.
* Improved PHP 7.4 compatibility and uninstall cleanup.
* Added a translation template file for maintainable localization updates.

= 1.0.4 =

* Documented the external data service, Terms of Service, and Privacy Policy.
* Reworked bundled JavaScript into readable source files.
* Cleaned and grouped front-end and admin CSS.
* Improved AJAX request sanitization and nonce handling.
* Removed broad cache flushing and tightened cache cleanup scope.
* Updated Vietnamese and English translation files.

= 1.0.3 =

* Fixed guideline compliance issues.
* Improved sanitization, escaping, and admin permission checks.

= 1.0.2 =

* Added statistical analysis module for lottery result insights.
* Added prediction display system with scheduled summaries.
* Updated external API endpoint to api.383.im.
* Improved performance and caching structure.

= 1.0.1 =

* Added Vietnam lottery result displays for MB, MT, and MN.
* Added Vietlott Mega 6/45 and Power 6/55 support.
* Added province, weekday, and regional shortcodes.
* Added statistics dashboard views.
* Added AJAX-based loading for historical results.
* Added English and Vietnamese localization.
* Improved mobile UI and front-end performance.

= 1.0.0 =

* Initial release.

== Upgrade Notice ==

= 1.0.5 =

This update finalizes WordPress.org review cleanup, updates bundled assets and translations, and improves PHP 7.4 compatibility.
