=== BSX File Exchange ===
Contributors: bs279
Tags: file sharing, document exchange, secure upload, host guest, client portal
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 1.0.3
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Private, bidirectional file exchange between paired users. Built for clinics, law firms, coaches, and any service needing secure client file sharing.

== Description ==

**BSX File Exchange** turns your WordPress site into a private file-sharing portal between you and your clients — no third-party services, no public links, no extra accounts.

You create Host/Guest pairs. Both sides can upload and download files. Every transfer is logged, every download is authenticated, and nothing is ever accessible by direct URL.

= How it works =

1. Create a **Host/Guest pair** in the admin panel — linking any two registered users
2. Both users log into your site and see their **private dashboard** via the `[bsxfe_dashboard]` shortcode
3. Either side uploads a file — the other receives an **email notification** instantly
4. Downloads go through a secure PHP endpoint with **token-based authentication** — no public file URLs ever exist

= Who is it for =

* **Medical practices** — share test results, prescriptions, and referrals with patients
* **Law firms** — exchange contracts, briefs, and case documents with clients
* **Coaches and consultants** — share materials, homework, and session notes with coachees
* **Accountants** — deliver reports, invoices, and tax documents to businesses
* **Any service** requiring private, tracked, bilateral document exchange with clients

= Features =

* **Bidirectional exchange** — both Host and Guest can upload and download files
* **Secure storage** — files live in `/wp-content/uploads/bsx-file-exchange/` behind an `.htaccess` that blocks all direct access
* **Token-based downloads** — every download link is unique and authenticated; sharing the URL with someone else does nothing
* **Email notifications** — automatic alerts when a new file is uploaded
* **Multi-pair support** — one user can belong to multiple pairs; the dashboard lets them switch between pairs without page reload
* **Read/unread tracking** — recipients see which files are new
* **Activity log** — every upload, download, and deletion is logged with timestamp, IP address, and user agent; exportable as CSV
* **Privacy modes** — choose between pair-only visibility, admin read-only, or admin full access
* **Frontend shortcode** — embed the dashboard anywhere with `[bsxfe_dashboard]`
* **Full wp-admin panel** — manage pairs, view files per pair, browse activity, configure settings, and run system diagnostics from a dedicated Debug page
* **Customizable color palette** — set primary and secondary colors from Settings to match your brand
* **Ultimate Member integration** — adds a tab to UM account and profile pages automatically when Ultimate Member is active
* **i18n ready** — fully translatable, Spanish included

= What's included =

* Unlimited Host/Guest pairs
* Bidirectional upload and download for all pairs
* Email notifications (sender name and address configurable)
* Frontend shortcode dashboard with drag-and-drop upload
* wp-admin panel with Pairs, Hosts, Guests, Activity, Settings, and Debug pages
* Activity log with CSV export
* File size limit configurable up to server maximum
* Configurable allowed file types (PDF, DOCX, XLSX, JPG, PNG, ZIP, and more)
* Optional data deletion on uninstall

== Installation ==

1. Upload the `bsx-file-exchange` folder to `/wp-content/plugins/`, or install directly from the WordPress plugin directory
2. Activate the plugin from the **Plugins** menu in WordPress
3. Go to **BSX File Exchange → Settings** and configure your preferences (allowed file types, size limit, colors, notification email)
4. Create a WordPress page and add the shortcode `[bsxfe_dashboard]` to it
5. In Settings, set that page as the Dashboard page
6. Go to **BSX File Exchange → Pairs** and click **+ New pair** to create your first Host/Guest connection
7. Both users will see the dashboard automatically when they log in and visit the shortcode page

== Frequently Asked Questions ==

= Are files publicly accessible? =

No. Files are stored in `/wp-content/uploads/bsx-file-exchange/` with an `.htaccess` file that denies all direct HTTP access. Every download goes through a PHP authentication endpoint that verifies the requesting user has an active pair linked to that specific file before serving it.

= Can one user be in multiple pairs? =

Yes. A Host can be paired with multiple Guests, and a Guest can be linked to multiple Hosts. The dashboard shows all active pairs and lets the user switch between them with a single click and no page reload.

= What file types are supported? =

By default: PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT, CSV, JPG, JPEG, PNG, GIF, WebP, ZIP, and RAR. You can enable or disable any type from **BSX File Exchange → Settings**.

= What happens to files when I delete a pair? =

All files belonging to that pair — along with their database records, notifications, activity logs, and the physical files on disk — are permanently and irreversibly deleted.

= Can I limit file size? =

Yes. Go to **Settings** and set the maximum file size. The effective limit is automatically capped to your server's `upload_max_filesize` and `post_max_size` PHP settings — you can verify this in the **Debug** page.

= Does it work with Ultimate Member? =

Yes. When Ultimate Member is active, BSX File Exchange automatically adds a tab to both the account and profile pages, so users can access their file exchange dashboard directly from their UM profile without needing a separate shortcode page.

= Does it work with multisite? =

The plugin works on individual sites within a multisite network. Network-wide activation is not currently supported.

= Is there a Pro version? =

A Pro version is planned for a future release with features including: no file size limit, file expiry dates, password-protected download links, inline preview for images and PDFs, and per-pair notification customization. It is not available yet — follow the plugin page for updates when it launches.

== Screenshots ==

1. wp-admin Pairs panel — overview with stat cards and pair list
2. Frontend dashboard — Received files tab with download buttons
3. Frontend dashboard — Send file tab with drag-and-drop upload zone
4. wp-admin Settings — file types, size limit, and color palette configuration
5. wp-admin Debug — system status and server configuration checks
6. Ultimate Member integration — file exchange tab in UM account page

== Privacy Policy ==

BSX File Exchange stores the following data in your WordPress database:

* File metadata (filename, size, MIME type, upload date) linked to registered WordPress users
* Download and upload events with IP address and user agent string for audit purposes
* Email notification records (recipient, timestamp)

No data is transmitted to external servers. All files are stored locally within your WordPress installation under the standard uploads directory. Administrators can permanently remove all plugin data — including database tables, options, and uploaded files — by enabling the **Delete all data on uninstall** option in Settings before deactivating and deleting the plugin.

== Changelog ==

= 1.0.3 =
* Fixed admin stylesheet not loading for users with the Administrator role due to an inverted logic condition in the asset enqueue function
* Redesigned admin page header — cleaner two-level layout with brand row (logo + version) separated from the page title and subtitle
* Improved spacing and visual hierarchy throughout the admin panel

= 1.0.2 =
* Fixed admin and frontend CSS/JS asset versioning — inconsistent version suffixes were causing browser cache conflicts that prevented stylesheets from loading after updates

= 1.0.1 =
* Normalized asset version strings across all enqueue calls
* Bumped stable tag

= 1.0.0 =
* Initial release
* Bidirectional file exchange between Host and Guest users
* Secure file storage with `.htaccess` protection and token-based download authentication
* Email notifications on file upload
* Activity log with IP tracking and CSV export
* Frontend shortcode `[bsxfe_dashboard]` with drag-and-drop upload and AJAX pair switching
* Full wp-admin panel: Pairs, Hosts, Guests, Activity, Settings, Debug
* Ultimate Member 2.x integration — account and profile tabs
* Customizable color palette for the frontend dashboard
* Multi-pair support with no-reload pair switching
* i18n ready — Spanish (es_ES) translation included
* Configurable allowed file types and file size limit
* Privacy modes: pair-only, admin read-only, admin full access
* Optional full data deletion on uninstall

== Upgrade Notice ==

= 1.0.3 =
Fixes admin stylesheet not loading for Administrator-role users. Update recommended.

= 1.0.2 =
Fixes stylesheet caching issue after updates. Update recommended.
