=== Merge PDF with Cross Service Solutions integration ===
Contributors: xssdevelopment
Donate link: https://cross-service-solutions.com/xss-pdf-solutions-plugins
Tags: pdf, merge, combine, pdf organization
Requires at least: 5.0
Tested up to: 6.8
Stable tag: 1.0.2
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A WordPress plugin to merge PDF files using the service of XSS (Cross Service Solutions) Pte Ltd.

== Description ==

The **Merge PDF** plugin allows users to combine multiple PDF files directly from their WordPress site. It provides an easy-to-use interface for merging PDFs securely.

### Features:
- Seamlessly merge multiple PDF files into one.
- Widget-based interface for file uploading and merging.
- Uploaded files can be sorted by drag-and-drop.
- Simple settings to add and validate an API key for accessing the service.
- Compatible with Gutenberg: Embed the widget using a custom block in the editor.
- Shortcode support for embedding the PDF merging form anywhere on your site.
- Customize the block color through **WordPress Appearance -> Customize** in the Color tab.
- **Optional attribution**: Display a "Provided by" message to credit the service provider (disabled by default).

### Supported Languages:
- Deutsch
- English
- Français
- Italiano
- Español
- Português
- ไทย
- Bahasa Indonesia
- Tiếng Việt
- 中文
- Türkçe
- 日本語
- 한국어
- Русский Язык
- العربية

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/merge-pdf` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to the plugin settings (`Settings > XSS Settings`) and enter your API key.
4. Use the `[cross_service_solutions_merge_widget]` shortcode or the block editor to add the PDF merging widget to any page or post.

== Frequently Asked Questions ==

= How do I get my API key? =
You can get your API key by visiting https://login.cross-service-solutions.com/ 

= Can I use this plugin without an API key? =
No, a valid API key is required to use the PDF merging service.

= Is there a limit to the number of PDFs I can merge? =
There is no limit to the amount of usage, but it is considered under fair use policy.

= How do I add the Merge PDF widget to my post or page? =
You can either use the shortcode `[cross_service_solutions_merge_widget]` or add the block via the Gutenberg editor under the "Widgets" section.

= Can I display an attribution for the service provider? =
Yes, this plugin includes an **optional attribution** to credit the service provider. By default, this feature is disabled. You can enable it by going to the plugin settings and checking the "Show "Provided by" info" option. This ensures compliance with WordPress guidelines by making the feature explicitly opt-in.

== External Services ==

This plugin connects to the external service **Cross Service Solutions API**. This service processes PDF files and provides solutions such as compressing, merging, flattening PDFs, generating QR codes, and more.

### What data is sent and when:
- The PDF file or other input data (e.g., user-uploaded content) is sent to the external service whenever the user submits a request for processing.
- Metadata, such as API key and basic request details, may also be sent to verify access and ensure proper functionality.

### Why this data is sent:
The data is required to perform the requested operations (e.g., compress a PDF, merge files) and return the processed result to the user.

### Where this data is sent:
The data is sent securely to the **Cross Service Solutions API** hosted by XSS (Cross Service Solutions) Pte Ltd. 

### Links to terms and privacy policy:
- Terms and Conditions: [https://login.cross-service-solutions.com/en/terms-and-conditions](https://login.cross-service-solutions.com/en/terms-and-conditions)

By using this plugin, users agree to the terms and privacy policy of the external service.

== Screenshots ==

1. Plugin Settings Page - Allows users to enter their API key.
2. Front-End View - Example of the merging widget in action.
3. List of Sortable Files - Displays the uploaded files in a sortable list format.

== Changelog ==

= 1.0.2 =
* Updated verify and polling API endpoints

= 1.0.1 = 
* Implemented nonce validation for polling status GET request.
* Ensuring the global object in JavaScript is unique.

= 1.0.0 =
* Initial release of the Merge PDF plugin.

== Upgrade Notice ==

= 1.0.0 =
Initial release, no updates required.

== License ==
This plugin is licensed under the GPLv2 or later. See [https://www.gnu.org/licenses/gpl-2.0.html](https://www.gnu.org/licenses/gpl-2.0.html) for more details.

This plugin includes the following third-party libraries:
- **Sortable.js** (Version 1.15.6): A lightweight JavaScript library for drag-and-drop sorting of items. [Sortable.js GitHub](https://github.com/SortableJS/Sortable)
- **PDF.js** (Version 2.16.105): A JavaScript library to parse, render, and manipulate PDFs directly in the browser. [PDF.js GitHub](https://github.com/mozilla/pdf.js)

Please refer to the respective licenses and documentation of these libraries for more details.