=== BitSplit Media Delivery ===
Contributors: frolpaxa
Tags: images, video, media protection, hotlinking, scraping
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Replace ready-to-download media URLs with on-demand browser reconstruction to deter hotlinking and generic scraping.

== Description ==

BitSplit changes how WordPress delivers public media. Instead of keeping a
complete file at a stable public URL, it stores the original and generated sizes
as incomplete blocks and reconstructs each file in the visitor's browser through
a short-lived session.

It is a media-protection layer for photography portfolios, publishers, member
sites, and other WordPress sites where making direct downloads and bulk collection
harder is valuable.

= Why use BitSplit? =

* **No stable ready-to-download media URL** - public paths serve incomplete
  blocks rather than finished files.
* **Images, video, and audio** - every supported media type is handled by the
  same delivery flow.
* **Normal WordPress workflow** - use the Media Library, Gutenberg Image, Gallery,
  Video and Audio blocks, featured images, and responsive `srcset` markup as usual.
* **Two access modes** - keep media public while adding download friction, or
  require visitors to sign in before reconstruction.
* **No external service** - reconstruction runs on your WordPress site and in the
  visitor's browser, with no SaaS account, license key, quota, or payment.
* **Backup and recovery tools** - export a recovery manifest before site changes
  and restore attachment mappings when needed.

BitSplit is **not encryption, DRM, or a promise that downloading is impossible**.
A determined viewer can inspect the browser flow, automate reconstruction, or
capture rendered content. Use it when raising the cost of casual downloading is
valuable; use established encryption and access control when confidentiality is
required.

= Included functionality =

The plugin protects any number of image, video, and audio attachments.
Every feature is free: there is no paid tier, license key, trial, add-on, or
usage quota, and the plugin contacts no external service.

It includes public or logged-in-only access, Gutenberg image, gallery, video and
audio support, featured-image and `srcset` handling, and backup/recovery tools.

= Delivery flow =

1. WordPress stores each file as an incomplete BitSplit block, with reconstruction
   data stored separately in attachment metadata.
2. Front-end markup receives a placeholder instead of the original media URL.
3. The browser establishes an ephemeral P-256 ECDH session.
4. Reconstruction data is transported with HKDF and AES-256-GCM.
5. Block bytes require a short-lived, session-bound signed token.
6. The browser reconstructs the file into a temporary Blob URL. Video and audio
   are streamed through a Service Worker so playback can seek.

The transport encryption protects reconstruction data in transit; the BitSplit
block itself is not encrypted and contains most source bytes.

= Access modes =

* **Public visitors** - public media remains viewable; BitSplit adds download and
  scraping friction.
* **Logged-in users only** - anonymous visitors cannot obtain reconstruction data
  or block bytes.

= WordPress coverage =

BitSplit handles normal attachment images, Gutenberg Image, Gallery, Video and
Audio blocks, featured images, `srcset`, classic content containing `wp-image-ID`,
and the `[bitsplit id="123"]` shortcode.

= Storage =

Incomplete blocks are stored in a plugin-owned directory resolved through
`wp_upload_dir()`, while reconstruction data stays in WordPress post metadata.
The plugin does not write web-server configuration files or require users to edit
server configuration.

= Requirements =

* PHP 7.4 or newer
* GMP extension
* OpenSSL with ECDH support

== Screenshots ==

1. Enable split media delivery and choose whether public or logged-in visitors may reconstruct media.
2. See how BitSplit replaces a stable media file URL with incomplete storage and on-demand browser reconstruction.

== Installation ==

1. Upload the `bitsplit-media-delivery` folder to `/wp-content/plugins/`.
2. Activate **BitSplit Media Delivery**.
3. Open **Tools -> BitSplit**.
4. Choose an access mode.
5. Enable split media delivery.
6. Export the recovery manifest and store it safely.

== Frequently Asked Questions ==

= Does BitSplit make downloading impossible? =

No. Public content must reach the viewer's browser. BitSplit removes the simple
ready-file URL and makes downloaders reproduce the reconstruction protocol.

= Is BitSplit encryption? =

No. The reconstruction-data transport uses standard cryptography, but the stored
BitSplit block is an incomplete, unencrypted representation of the source.

= Is any functionality locked behind payment? =

No. The plugin is entirely free: every feature and all executable code ship in this
package, with no paid tier, license, trial, or quota.

= What happens when I deactivate or delete the plugin? =

The plugin attempts to restore protected attachments to their normal public
paths before removing its metadata. Keep a current exported manifest and filesystem
backup before bulk operations.

= Does it need Python? =

No. The codec is implemented in PHP with GMP and in browser JavaScript.

== Changelog ==

= 1.3.0 =
* Make the plugin fully free: image, video, and audio delivery ship in one package.
* Remove the licensing runtime and the separate paid package.

= 1.2.4 =
* Make the directory package a self-contained image plugin with no locked functionality.
* Move separately distributed media-type integrations out of the directory package.
* Store images only as keyless blocks and do not write web-server configuration.

= 1.2.3 =
* Store images as keyless blocks and migrate records created by earlier versions.

= 1.2.2 =
* Improve activation and deactivation recovery.

= 1.2.1 =
* Preserve protected image settings during updates.

= 1.2.0 =
* Add unlimited image attachment protection.

= 1.1.0 =
* Add public and logged-in-only access policies.
* Add short-lived session-bound tokens and same-origin checks.
* Add Gutenberg Image/Gallery, featured-image, classic-content, and srcset coverage.
* Stream block creation for large image files.

= 1.0.0 =
* Initial image delivery prototype with ECDH key transport, browser reconstruction,
  and recovery manifests.
