=== AISmart Content Studio ===
Contributors: aismartcontent
Tags: ai, content, onboarding, multilingual, token
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 2.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AISmart Content Studio connects your WordPress site to AISmartContent to manage AI content workflows, onboarding, and token usage from the WordPress admin.

== Description ==

AISmart Content Studio provides a WordPress admin interface for connecting a site to AISmartContent, onboarding a workspace, and operating content/token workflows from one dashboard.

Key capabilities:

* Guided onboarding flow for first-time setup.
* Automatic app environment sync from WordPress configuration (no manual .env editing per site).
* Workspace-aware token and usage operations from admin pages.
* Multilingual integration support for translation workflows.
* Hardened API transport with signed requests and TLS verification.
* WordPress-native admin pages with secure outbound launch links for cloud actions (no embedded admin iframe).

This plugin is intended for site administrators and agency operators who need centralized control of AISmartContent integration per WordPress site.

== External Services ==

This plugin connects to AISmartContent cloud services to complete onboarding, workspace linking, token usage operations, and content workflow actions.

This plugin may call Google Translate public endpoint as a translation fallback for multilingual workflows.

This plugin may call LoremFlickr as an image fallback source when upstream image generation is unavailable.

Service endpoints:

* https://aismartcontent.co
* https://translate.googleapis.com (fallback translation requests)
* https://loremflickr.com (fallback image requests)

Data sent to the service may include:

* Site URL and site domain
* Admin email (for onboarding and account linking)
* Workspace and user context returned by onboarding
* Plugin version and request metadata used to authenticate signed API requests
* Translation text payloads and language codes when fallback translation is used
* Image search query text and requested image dimensions when fallback image generation is used

Why data is sent:

* To authenticate and connect your WordPress site with an AISmartContent workspace
* To execute plugin features that require cloud API processing
* To translate content when multilingual fallback translation is requested
* To return a placeholder image when image generation fallback is requested

Service terms and policies:

* AISmartContent Terms: https://aismartcontent.co
* AISmartContent Privacy: https://aismartcontent.co
* Google Terms: https://policies.google.com/terms
* Google Privacy: https://policies.google.com/privacy
* LoremFlickr service site: https://loremflickr.com

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install the plugin zip from WordPress admin.
2. Activate AISmart Content Studio in WordPress admin.
3. Open `AISmart Content Studio > Onboarding` and complete connection steps.
4. Use the dashboard and related pages to configure workspace behavior.

== Frequently Asked Questions ==

= Do I need SSH/Composer on shared hosting? =

Normally no for this packaged release because dependencies are bundled in the plugin.

= Does this plugin call OpenAI or Gemini directly from WordPress? =

No. This plugin is designed to call AISmartContent APIs, and AISmartContent handles downstream provider operations.

= Where are credentials stored? =

Onboarding and signing configuration is stored in WordPress options. Runtime app configuration is synced for plugin runtime execution.

== Screenshots ==

1. Content Manager with Article Type selector cards.
2. Advanced schedule controls with timezone-aware presets.
3. AI topic generation workflow in Content Manager.
4. Translation panel publish and translate workflow.
5. Workspace and token operations dashboard.
6. Manage Users CTA and workspace-owner guidance panel.

== Changelog ==

= 2.6 =
* Restored and upgraded automation schedule controls in Content Manager with WordPress timezone-aware labels.
* Added richer schedule presets: once daily, 3 times daily, 5 times weekly (with day/time selection), and every N hours.
* Added backend schedule normalization and validation for weekly day lists and hourly intervals to improve cron reliability.
* Improved auto-blog due-slot resolution so schedule execution follows configured local-time windows more consistently.
* Preserved and rebuilt Phase2 body-image metadata from existing inline content when regeneration is skipped.
* Refined template body-image insertion behavior for advanced types to improve section placement stability.

= 2.5 =
* Extended Phase2 body-image automation beyond Advanced template to Type 3 (Design Case Study), Type 4 (Fully Article), and Type 5 (Premium Hybrid AI + SEO).
* Added per-template Phase2 image counts for richer layouts (Type 3: 2 body images, Type 4: 3 body images, Type 5: 3 body images).
* Added template-aware section-anchor image insertion for Type 3-5 to improve visual structure stability.
* Updated create-flow unit accounting to include all Phase2 body images for non-simple templates.

= 2.4 =
* Fixed Advanced template regression where Type B could return basic-style output with featured image only.
* Restored robust Phase2 Type B body-image injection with duplicate guards and media sideload persistence.
* Added safer template-switch regeneration path so changing article type on existing draft can regenerate with selected template.
* Preserved and exposed Phase2 diagnostics fields for API/response verification (`phase2_body_images_applied`, `phase2_body_images_count`, `phase2_body_image_urls`).

= 2.3 =
* Fixed blog type selector race condition that could reset selected type to Basic during async resume load.
* Hardened create payload to always submit the latest selected `type_blog` value from UI state.
* Improved heavy-action request transport behavior by limiting keepalive usage on large create/queue/image requests.
* Normalized frontend timeout/fetch error handling for more consistent long-running create actions.

= 2.2 =
* Fixed Translation Controller title rendering to clean legacy multilingual wrappers from old WPGlobus/qTranslate content.
* Added server-side translation-panel title normalization to show clean source title instead of mixed multi-language marker strings.
* Applied consistent title sanitization across provider branches to reduce false duplicate-looking rows in translation status list.

= 2.1 =
* Upgraded Add Topic (AI mode) to advanced topic lifecycle using suggest/claim API flow.
* Added `topics/suggest` and `topics/claim` integration with request IDs, idempotency keys, and workspace/site context payloads.
* Added best-effort `topics/feedback` reporting for queued topics.
* Added safe fallback to local topic generation when advanced topic endpoints are unavailable.

= 2.0 =
* Added new Article Type selector (B1-B5) in Content Manager with interactive hover previews.
* Added end-to-end `type_blog` support in create flow, API payload routing, post metadata, and post-data response.
* Added normalized blog type handling and label mapping for types 1-9 in backend create/update paths.
* Added richer preview-card UI styles and selection state sync for article-type workflow.
* Added Phase2 for Advanced Blog Template: injects 2 additional in-body images on fresh create flows.
* Added safe responsive body-image markup with duplicate guards to reduce malformed layout risks.
* Added Phase2 tracking fields and metadata for body-image injection diagnostics.
* Added project roadmap document `WP_Advance_PostType.md` covering Phase1/Phase2 scope and next phases.

= 1.6 =
* Fixed Translation panel row getting stuck in draft-style progress after Publish and Translate.
* Added explicit row publish endpoint and publish-then-queue translation flow for draft rows.
* Added anti-loop polling guard when language provider context changes during status refresh.
* Added timeout recovery refresh for row publish actions to avoid stale UI states.
* Standardized action labels to "Publish and Translate" across Content Manager.

= 1.5 =
* Hardened Content Manager AJAX timeout handling for heavy Draft Now and queue actions.
* Added action-specific timeout windows for long-running create/queue/translate/image workflows.
* Prevented false 30-second timeout failures after multilingual plugin switching.
* Added graceful timeout recovery flow that refreshes settings, topics, and translations.
* Improved cross-plugin reliability when switching providers and returning to Polylang.

= 1.4 =
* Fixed a critical admin fatal caused by duplicate AJAX output guard function declaration.
* Removed duplicate `aismart_bootstrap_ajax_output_guard` definition and duplicate hook registration.
* Restored stable plugin bootstrap flow so admin pages no longer crash after loading the plugin.
* Confirmed plugin remains active and Content Manager endpoints return valid JSON after fix.

= 1.3 =
* Fixed Content Manager loading freeze after multilingual provider switching.
* Added frontend AJAX timeout (30s) with stronger JSON recovery from noisy responses.
* Added graceful fallback UI when workspace settings cannot load, preventing permanent loading states.
* Added backend AJAX output guard for AISmart actions to reduce warning/noise JSON contamination.
* Fixed frontend initialization blocker that could prevent workspace, credit, and topic loaders from running.
* Improved cross-plugin reliability across Polylang, TranslatePress, WPML, Bogo, and WPGlobus.

= 1.2 =
* Improved multilingual translation reliability for large language sets.
* Added safer background processing for heavy translation workflows to avoid timeout-related failures.
* Extended queued translation handling for high-locale workloads so create/publish responses return faster.
* Hardened AJAX response handling against noisy runtime output and mixed JSON payloads.
* Improved translation status accuracy for WPML projects with stricter completion checks.
* Added backend queued-state exposure and frontend auto-resume polling after hard refresh.
* Improved translation progress UX and overall Content Manager stability across WPML, Polylang, and TranslatePress.

= 1.1 =
* Improved multilingual provider compatibility and translation status reliability across Bogo, Polylang, WPML, and TranslatePress.
* Fixed translation panel progress resets so in-progress translations remain accurate after refresh.
* Improved translated-content visibility so existing translated topics are recognized more accurately.
* Enhanced image relevance in Create Post and auto-translate workflows.
* Reduced repeated and near-duplicate topic suggestions with stronger dedupe logic.
* Added workspace-scoped recent topic memory (last 100) to reduce cross-session topic repetition.
* Improved queue processing stability and overall Content Manager experience.

= 1.0 =
* Initial public package of AISmart Content Studio.
* Added onboarding and workspace connection flow.
* Added automatic environment sync and security hardening for packaged release.
