=== LF Drive ===
Contributors: agadzhango
Tags: media, cloud storage, file sharing, audio, video
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your LF Drive library to WordPress. Add images, video, audio, PDFs, download buttons, paid file links and upload forms.

== Description ==
LF Drive connects WordPress to the LF Drive cloud file storage and sharing service.
Browse your library, search files, choose projects, upload files, copy links and view file statistics from WordPress.
Insert files using the LF Drive tab in the media dialog, dedicated blocks, shortcodes or the Elementor widget.

Features include:
* A shared media library and dedicated image, video, audio and PDF blocks.
* Custom video and audio controls, including playback, seeking, volume and speed.
* A PDF reader with page navigation, zoom and text selection.
* Download buttons, paid file cards and visitor upload forms.
* Individual block colors, typography, spacing, width and rounded corners.
* File replacement without changing the public link, when permitted by your LF Drive plan.

The plugin is free. An LF Drive account and a dedicated WordPress integration token are required. Service features and storage limits depend on your LF Drive plan. Paid links and upload forms must be available and configured in your account. This plugin does not move an existing WordPress media library to LF Drive automatically.

== External services ==
This plugin connects to LF Drive at https://lfdrive.ru/app/wordpress-api.php over HTTPS after the user connects an account.
The WordPress server sends the authorization token, library requests, selected upload files, file and project IDs, search terms, statistics parameters and form titles to LF Drive to provide the requested actions.

When visitors view embedded files or forms, their browser requests content from LF Drive. Forms send visitor-provided data and files to LF Drive according to the form owner's settings.
The PDF reader first requests a public document directly. If browser cross-origin restrictions prevent loading, WordPress may retrieve the document through a signed, public LF Drive file URL. The proxy accepts only signed public file URLs, checks safe redirects and PDF content, and limits documents to 32 MB. Temporary files are deleted after retrieval. LF Drive remains responsible for file access rules.

The integration token is encrypted in the WordPress database using a key derived from WordPress salts. Changing salts requires reconnecting the account.
Service website: https://lfdrive.ru/
Terms of service: https://lfdrive.ru/oferta.html
Privacy policy: https://lfdrive.ru/privacy.html

== Installation ==
1. Install LF Drive from the WordPress plugin directory, or upload the plugin ZIP through Plugins > Add New > Upload Plugin.
2. Activate the plugin.
3. Sign in to your LF Drive account or create one at https://lfdrive.ru/.
4. Generate a dedicated WordPress token at https://lfdrive.ru/app/wordpress.php.
5. Open Media > LF Drive in your WordPress dashboard, enter the token and connect your account.
6. Use the LF Drive tab in the media dialog or add a dedicated LF Drive block.

== Frequently Asked Questions ==
= Are files copied to my WordPress hosting? =
Media selections create attachment records with external URLs. The original files remain in LF Drive. The PDF fallback proxy can temporarily retrieve a document on the WordPress server and removes the temporary file after retrieval.

= What happens when I disconnect my account? =
The site's integration token is removed. Previously inserted links and attachment records remain. File availability depends on LF Drive and the owner's access settings.

= Can I use protected or paid files as ordinary media? =
No. Use a paid file card or an appropriate access link. Protected materials must not be exposed as public images or ordinary media.

= Why does a replaced image still show the old version? =
Browser, CDN or WordPress caches can retain the previous response. Clear the applicable cache. The plugin preserves the URL but does not manage third-party caches.

= Does WordPress generate thumbnails for remote images? =
No local image sizes are generated. External images use the original file without local cropping or srcset. Editors with separate media interfaces may require additional integration.

= What is the upload size limit? =
The limit is the smallest of the WordPress limit, the LF Drive PHP limit and 64 MB per plugin upload. LF Drive also checks your account storage allowance.

= What can I customize? =
Select a block and open its LF Drive appearance settings. Change colors, spacing, rounded corners, width and text sizes, and enable available player controls. The interior of a visitor upload form is configured in LF Drive; WordPress controls the surrounding block. PDF page contents retain the document's original colors.

== Screenshots ==
1. LF Drive library in WordPress: search, project filters, uploads and file insertion. Demonstration account and files.
2. Select a file from LF Drive while working in WordPress. Demonstration file.
3. A paid file block with editable title, description, button text and appearance settings. Demonstration material.
4. Example page with a paid file card, video and audio players, and the PDF reader. Demonstration media and custom colors.

== Changelog ==
= 1.2.4 =
Moved the integration page to Media. Limited administration assets to supported media/editor screens and explicitly enqueued media dialogs. Expanded all grouped selectors to retain explicit LF Drive scoping. Introduced full-length internal prefixes with compatibility reads for existing tokens and attachment metadata. Limited public assets to LF Drive content and prevented repeated frontend configuration output.

= 1.2.3 =
Updated the author URL to distinguish the developer profile from the plugin website.

= 1.2.2 =
Updated compatibility declaration after testing rendering, HTML filtering and PDF proxy filesystem handling with WordPress 7.1.3 core components.

= 1.2.1 =
Improved input sanitization and Elementor HTML filtering. Reworked temporary PDF file handling with WordPress filesystem APIs. Updated plugin directory documentation and removed a development guide from the release package.

= 1.2.0 =
Added individual block appearance settings, light/dark/transparent presets, custom video and audio players, and a bundled PDF.js reader with page navigation and zoom.

= 1.1.1 =
Compact controls in the WordPress media dialog.

= 1.1.0 =
Updated library interface, custom selects, dedicated media blocks, explanatory text and plan-aware form and sale actions.

= 1.0.1 =
PHP 7.4 compatibility.

== Upgrade Notice ==
= 1.2.4 =
WordPress administration compatibility fixes. Existing LF Drive connections, attachment records, blocks and shortcodes are retained. Open the integration under Media > LF Drive.

= 1.2.1 =
Input handling, Elementor output filtering, temporary PDF file handling and plugin directory documentation improvements. Existing tokens and block settings are retained.

== Third-party libraries and source code ==
PDF.js 6.4.299 by Mozilla is bundled locally in assets/pdfjs under the Apache License 2.0. It is not loaded from a third-party CDN.
License: assets/pdfjs/LICENSE
Source project: https://github.com/mozilla/pdf.js
Source release: https://github.com/mozilla/pdf.js/tree/v6.4.299
Distributed package: https://www.npmjs.com/package/pdfjs-dist/v/6.4.299
Build instructions: https://github.com/mozilla/pdf.js#building-pdfjs
The package includes the module, worker, CMaps, standard fonts and WASM assets with their included licenses.
The LF Drive plugin JavaScript and CSS are provided as readable source files in assets.
