=== Lottery Sambad Receiver ===
Tags: lottery, results, api, receiver, sambad
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 7.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Receive 1 PM, 6 PM and 8 PM Lottery Sambad result images and matching result text from the Sambad.tv Result API.

== Description ==

Lottery Sambad Receiver provides secure REST endpoints for receiving 1 PM, 6 PM and 8 PM result images and result text on a WordPress website.

Features include:

* API-key connection to Sambad.tv.
* Secret-authenticated REST push endpoints.
* Separate 1 PM, 6 PM and 8 PM receiver controls.
* Today and supported back-date result receiving.
* Image-first delivery with a later text-only update.
* Protection against an empty image delivery erasing result text already received.
* Date-wise received data in WordPress Admin.
* Result image and result text shortcodes.
* Compatibility with existing `LS_1PM_SYNC_SECRET`, `LS_6PM_SYNC_SECRET` and `LS_8PM_SYNC_SECRET` constants.
* Optional Sambad.tv source credit. It is disabled by default and is shown only after the site administrator explicitly enables it.

This plugin provides lottery result information only. It does not sell lottery tickets, conduct lottery draws or provide betting functionality.

== External Service ==

This plugin can connect to the Sambad.tv Result API, an external service operated by Sambad TV.

When an administrator enters an API key and clicks **Connect**, the plugin sends the following data to `https://sambad.tv/wp-json/slrp-client/v1/connect`:

* The WordPress site URL.
* The WordPress site name.
* A generated receiver shared secret used to authenticate result deliveries.
* The installed plugin version.
* The API key entered by the administrator.

After connection, Sambad.tv can send result data to the secure REST endpoints created by this plugin. Result image URLs supplied by the service are downloaded into the site's WordPress Media Library. Result text is stored in WordPress so it can be displayed by the receiving site.

The plugin also requests the Sambad.tv Contact Us page when an administrator opens the plugin's Contact Us screen, so current support information can be shown. This contact content is cached temporarily in WordPress.

Service information: https://sambad.tv/api
Support: https://sambad.tv/contact-us/
Privacy policy: https://lottery.sambad.tv/privacy-policy/
Terms and conditions: https://lottery.sambad.tv/terms-and-conditions/

No public-facing source credit or external link is enabled by default. The site administrator may opt in from Receiver Settings.

== Installation ==

1. Upload the plugin ZIP from **Plugins > Add New Plugin > Upload Plugin**, or install it from the WordPress Plugin Directory after publication.
2. Activate **Lottery Sambad Receiver**.
3. Open **Lottery Receiver** in WordPress Admin.
4. Enter the API key supplied by Sambad.tv and click **Connect**.
5. Confirm the 1 PM, 6 PM and 8 PM receiver settings.
6. Optionally enable the Sambad.tv homepage source credit if you want to display it.

For legacy/manual connections, the plugin can use the existing per-slot secret constants or a shared secret configured in Receiver Settings.

== Shortcodes ==

Use these shortcodes on pages or posts:

`[sambad_result_image slot="1pm"]`

`[sambad_result_text slot="1pm"]`

Supported slot values are `1pm`, `6pm` and `8pm`.

For a specific date, use DD-MM-YYYY:

`[sambad_result_image slot="6pm" date="16-08-2026"]`

`[sambad_result_text slot="6pm" date="16-08-2026"]`

Compatibility aliases are also available:

`[ulsr_result_image]`

`[ulsr_result_text]`

== Frequently Asked Questions ==

= Can the result image arrive before the text? =

Yes. Version 7.0.0 supports image-first delivery and a later text-only update. The image does not need to be downloaded again just to update the result text.

= Can the plugin receive older result dates? =

Yes, when **Accept back-date result image + text** is enabled. Future dates are rejected.

= Is the Sambad.tv homepage credit mandatory? =

No. In version 7.0.0 the public source credit is optional, disabled by default and shown only when the site administrator explicitly enables it.

= Does the plugin sell lottery tickets? =

No. It only receives and displays result information supplied through the configured result service.

== Changelog ==

= 7.0.0 =
* Updated plugin version to 7.0.0.
* Added WordPress.org-style plugin headers, GPL license declaration and standard `readme.txt` metadata.
* Changed the public Sambad.tv source credit to explicit opt-in and disabled it by default.
* Added secret authentication directly to REST route permission callbacks.
* Added REST argument sanitization for result pushes.
* Added text-only follow-up delivery so result text can arrive after the image without re-downloading the image.
* Prevented an image-only delivery with empty text from erasing previously received result text.
* Kept today, back-date, shortcodes, date-wise data, API-key connection and legacy secret compatibility.

= 6.0.0 =
* Standardized the blue branded hero header across Lottery Receiver detail pages.
* Kept the standard WordPress admin sidebar icon and existing receiver functionality.

= 5.5.0 =
* Removed the custom logo from the WordPress admin sidebar Lottery Receiver menu.

= 5.0.0 =
* Added receiver branding assets and plugin-list branding.

== Upgrade Notice ==

= 7.0.0 =
Adds WordPress.org-oriented compliance improvements, stronger REST permission checks and image-first/text-later delivery support.
