=== SahlDesk ===
Contributors: asheikh0
Donate link: https://sahldesk.com
Tags: ticketing system, helpdesk, customer support, woocommerce, ai agent
Requires at least: 5.9
Tested up to: 7.1
Stable tag: 1.6.98
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Advanced ticketing system to centralize customer support with a WooCommerce helpdesk built directly into your dashboard.

== Description ==

SahlDesk is a WooCommerce helpdesk and ticketing system built directly into your WordPress dashboard. Managing a growing e-commerce store means dealing with customer emails, inquiries, and delayed responses. SahlDesk solves this by centralizing your customer support workflow into one interface. Whether your customers need help with order tracking, general inquiries, or managing RMA (Return Merchandise Authorization) and order returns, SahlDesk helps ensure no message falls through the cracks. 

Our WooCommerce integration syncs customer data, allowing your customer service team to provide responses without leaving WordPress. SahlDesk features native Bilingual/RTL support out of the box, ensuring your interface and customer-facing widgets display correctly in both Arabic and English. Transform your store's support experience and save administrative work with a functional helpdesk.

### Key Free Features
* **Unified Support Inbox:** Centralize customer inquiries into a single ticketing dashboard.
* **Smart Ticket Categories:** Organize your workflow with customizable Ticket Categories, ensuring inquiries are routed correctly.
* **WooCommerce Customer Sync:** View customer order details and history directly alongside their support tickets.
* **Native Bilingual & RTL Support:** Localized for Arabic and English, providing a native experience for both your agents and customers.
* **Frictionless Setup Wizard:** Get your helpdesk running with our onboarding process.
* **Interactive Floating Widget:** Embed a support portal on your storefront for customers to submit tickets.

### 🚀 SahlDesk Pro (Premium Features)
Upgrade your customer service operations with SahlDesk Pro, designed for growing teams that need advanced organization, automation, and our AI support agent.
* **Advanced User Role Management:** Scale your team by assigning custom permissions for Agents, Managers, and Admins.
* **Time-Saving Canned Responses:** Reduce response times by creating pre-written reply templates for common questions like shipping times and order returns.
* **Custom Sub-Statuses:** Track your internal workflows precisely by creating custom ticket statuses beyond just "Open" and "Closed."
* **Advanced Analytics Dashboard:** Gain insights into your team's performance, average resolution times, and ticket volumes.
* **AI Support Agent:** Automate initial responses and triage incoming requests using AI integration.

== External services ==
This plugin relies on the following third-party services to function:
* **SahlDesk Web Portal & Support Widget** (https://app.sahldesk.com): The plugin connects to the cloud portal and embeds responsive iframes for customer ticket shortcodes and the frontend floating support widget. Data such as your store's API key, user email, display name, and language settings are transmitted to authenticate and render the interface. Please review our [Terms of Service](https://sahldesk.com/terms-of-service/) and [Privacy Policy](https://sahldesk.com/privacy-policy/).
* **SahlDesk Cloud API** (https://api.sahldesk.com): This is our cloud backend engine. Data such as store settings, customer emails, support tickets, and WooCommerce order metadata are transmitted to this API to sync tickets, track order inquiries, and generate responses. Please review our [Terms of Service](https://sahldesk.com/terms-of-service/) and [Privacy Policy](https://sahldesk.com/privacy-policy).
* **Freemius** (https://checkout.freemius.com): We use Freemius to provide optional secure license management and premium upgrades. Please review their [Terms of Service](https://freemius.com/terms/) and [Privacy Policy](https://freemius.com/privacy/).
* **Cloudflare Turnstile** (https://challenges.cloudflare.com): Used on the support widget to protect against spam and bots. Please review Cloudflare's [Website Terms](https://www.cloudflare.com/website-terms/) and [Privacy Policy](https://www.cloudflare.com/privacypolicy/).

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/sahldesk` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Configure the plugin settings through the SahlDesk menu to connect your API.

== Frequently Asked Questions ==

= Does it support Freemius? =
Yes, we use Freemius for secure license and subscription management.

== Screenshots ==

1. The main SahlDesk unified support inbox and centralized ticketing dashboard.
2. The beautiful, interactive floating support widget from the customer's perspective.
3. Seamless WooCommerce order sync displaying real-time customer data alongside their ticket.
4. SahlDesk Pro: Time-saving Canned Responses and advanced Custom Sub-Statuses.
5. Native Bilingual and RTL (Arabic) support flawlessly localized for international stores.

== Changelog ==

= 1.6.98 =
* Core: Prefixed all public shortcodes with sahldesk_ to comply with WordPress.org guidelines.
* Docs: Refined external services disclosure and documentation.

= 1.6.97 =
* Core: Prefixed all shortcodes with sahldesk_ to comply with WordPress.org guidelines.

= 1.6.96 =
* Core: Refactored UI buttons to achieve 100% compliance with WordPress.org Review Directive 6 (zero inline event handlers).

= 1.6.95 =
* UI: Enforced LTR on email handle field and matched alignment of email/password to name fields.

= 1.6.94 =
* UI: Updated setup wizard connection string to be inclusive of both WordPress and WooCommerce and added Arabic translation.

= 1.6.93 =
* UI: Fixed RTL layout and text direction for the email handle input in the setup wizard.

= 1.6.92 =
* UI: Added missing dashboard strings to internal arabic gettext dictionary.

= 1.6.91 =
* UI: Compiled Arabic translation `.mo` file for dashboard string rendering.

= 1.6.90 =
* UI: Added localization/translation string wrappers to the unified dashboard portal.

= 1.6.89 =
* Security: Eliminated all inline scripts and raw `<script>` tags from the codebase.
* Security: Hooked Setup Wizard processing to `admin_init` to prevent header conflicts and unsafe redirects.
* Compliance: Refactored the dashboard to a 100% native UI hub, entirely removing all full-page iframe embeds.
* Compliance: Standardized all internal prefixes to `sahldesk_` and removed SVN display assets from the distribution zip.
= 1.6.86 =
* Compliance: Removed redundant Author URI header to comply with WordPress.org unique header URI guidelines.

= 1.6.85 =
* Compliance: Added explicit external services disclosure for app.sahldesk.com (embedded portal and floating support widget) in readme.txt per WordPress.org Guideline 6.

= 1.6.84 =
* Update: Updated Free vs Pro upgrade page feature comparison with inbound email-to-ticket conversion, instant email notifications, and WooCommerce order history sync.
* Fix: Removed non-existent community support reference from free tier.


= 1.6.83 =
* UX: Removed obsolete single ticket view shortcode from settings table and added graceful portal redirect fallback.
* Fix: Added responsive centering container for support portal iframe across block and custom themes.

= 1.6.82 =
* UX: Streamlined settings interface by keeping passwordless magic links active by default and removing redundant guest checkbox.

= 1.6.81 =
* Fix: Added dedicated toggle to enable or disable the floating support widget from General Settings.
* UX: Ensure floating widget scripts are strictly suppressed when disabled in settings.

= 1.6.80 =
* Feature: Upgraded floating support widget to lightweight iframe launcher communicating with centralized React portal.
* Enhancement: Added native in-dashboard upgrade experience with billing switcher and localized Arabic checkout.
* Hardening: Strengthened superglobal unslashing, sanitized query parameters, and implemented safe redirects.

= 1.6.58 =
* Compliance: Removed deprecated load_plugin_textdomain call in compliance with WordPress 4.6+ standards.
* UX: Replaced overlapping API key eye icon with a standard Show/Hide button properly aligned for RTL/LTR layouts.
* Integration: Connected direct Freemius product checkout with bilingual Arabic support.

= 1.6.57 =
* Branding: Preserved SahlDesk brand name untranslated across Arabic interface while localizing all functional menus and labels.
* Portal Bridge: Verified and refreshed React Upgrade portal routing for both staging and production environments.

= 1.6.56 =
* Localization: Added complete native Arabic translation for WordPress admin tabs (Inbox, Settings, Upgrade) and Configuration page.
* Feature: Integrated rich React Portal Upgrade bridge with interactive monthly/annual billing switcher and Freemius Arabic checkout.
* UX: Refined form fields and show/hide API key toggle for bidirectional LTR/RTL support.

= 1.6.55 =
* Fix: Suppressed false-positive NonceVerification linter warning on shortcode URL-parameter read.
* Fix: Restored Upgrade submenu visibility for Free/Trial users (was hidden due to Freemius pricing-page gate).

= 1.6.73 =
* Fix: Automatically passed WordPress admin locale (ar/en) to Freemius checkout, ensuring the checkout page displays in Arabic with RTL layout when the site language is Arabic.

= 1.6.72 =
* Fix: Streamlined Freemius deployment workflow to upload full codebase with preprocessor tags, ensuring Pro build includes all premium features (Reports, Canned Responses, Sub-Statuses, User Roles).
* Fix: Dynamic is_premium flag evaluation for seamless Pro license activation.

= 1.6.71 =
* Fix: Fetched live dynamic plan pricing directly from Freemius API for the in-dashboard upgrade screen.
* Fix: Removed trial configuration and trial labels to align with active Freemius plan setup.
* Fix: Updated CTA button to direct Pro upgrade with instant checkout.

= 1.6.70 =
* Fix: Resolved fatal error on activating SahlDesk Pro alongside Free version by adding dual-build lifecycle handler and defensive function wrappers.
* Feature: Added native in-dashboard WordPress upgrade experience with billing cycle switcher, avoiding external redirects.
* Localization: Added complete Arabic and English translations for the native upgrade dashboard.

= 1.6.54 =
* Feature: Replaced legacy API Key wizard with a native self-service registration form (Company Name, Email Handle, Admin credentials).
* Feature: Added API Key show/hide toggle on the Settings page so admins can view or copy their key.
* Security: Added nonce verification and strict sanitization (wp_unslash + sanitize_*) to all registration POST inputs.
* Fix: Synced readme.txt Stable tag with plugin header version.

= 1.5.14 =
* Architectural Refactor: Separated and enqueued all static assets correctly.
* Compliance: Updated description, added external services disclosure, and made footer links opt-in.
* Security: Hardened all variables with strict escaping and removed global sessions.

= 1.4.93 =
* Major internal code refactoring for strict WordPress Coding Standards compliance and enhanced security checking.

= 1.4.92 =
* Initial release on WordPress.org.
* Stable Core Baseline: Finalized architectural integrations and robust password generation logic for streamlined onboarding.
* Fix: Prevented split-brain account creation by strictly normalizing email casing.
* Fix: Corrected mojibake placeholder text in the "Forgot Password" form.

= 1.4.14 =
* Fix: Resolved an issue where Categories, Sub-Statuses, and Canned Responses were not being deleted properly from the backend API.
* Fix: Fixed a typo in the guest widget script that caused raw translation variable names to appear instead of the actual error messages.
* Fix: Implemented global HTML5 form validation overrides to ensure the browser strictly respects the WordPress site's Arabic translation settings.
* Update: Added missing Arabic translations for various frontend error messages.

