=== SocraNext ===
Contributors: socranext
Tags: faq, schema, structured-data, ai, articles
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: socranext

AI-ready content: articles CPT and per-page FAQ widget with FAQ JSON-LD. Integrates with the SocraNext platform for auto-publishing.

== Description == 

**What the plugin provides**
- **Custom Post Type** `socranext_post` for AI-optimized articles (default URL slug `artikelen-sn`, configurable via the SocraNext platform).
- **Custom Taxonomy** `socranext` (hierarchical) for categorizing those articles.
- **Template-based rendering** for single/archive article views (plugin templates via `template_include`).
- **Admin screens** under **SocraNext** (Overview, Articles, Categories). FAQ management is handled via the SocraNext platform.
- **Cache flush** on (de)activation to correctly register permalinks.

**Display**
The plugin renders views via bundled templates for:
- Single SocraNext articles and archive list.

**Structured Data**
- The FAQ display includes **FAQPage JSON-LD** to help search engines and AI systems better understand the Q&As.
- SocraNext articles output their own SEO title, meta description, Open Graph tags and Article JSON-LD (independent of third-party SEO plugins; mirrored into Yoast / AIOSEO / Rank Math when present).

**REST API (for platform integration)**
Under the namespace `socranext/v1`, routes include:
- `GET /pages` and `GET /pages/{id}` – list site pages (for adding/showing FAQ widgets).
- `POST /toggle` – enable/disable the FAQ widget per page.
- `POST /store-aio-information` and `GET /aio-information/{page_id}` – store/retrieve per-page FAQ data.
- `POST /blog` and `POST /store-blog-custom` – create articles and store global custom HTML/CSS/JS for article display.
- `POST /collection-slugs` – sync the configurable articles URL slug from the SocraNext platform (rewrite flush + cache purge).
- `GET /articles-list-custom` – retrieve configuration for list views.
- `POST /llmstxt` and `GET /llmstxt` – publish and read `llms.txt` / `llms-full.txt` content from the SocraNext platform; served at `/llms.txt` and `/llms-full.txt` on the site.

> Note: without an account/connection to **app.socranext.ai**, the auto-generation routes are typically not used, but the created post types, taxonomy, and pages remain available for display.

**Privacy & external services**
- The plugin does not call external APIs on its own; the integration is typically initiated by the SocraNext platform to your website.
- Websites: product site **https://socranext.ai** and platform **https://app.socranext.ai**.

== Prefix & naming policy ==
- All plugin identifiers use the unique prefix family "SocraNext":
  - Functions, hooks, options, AJAX actions, REST namespace, script/style handles: `socranext_*` (lowercase)
  - Constants: `SOCRANEXT_*` (uppercase)
  - Human-facing labels and PHP namespaces (if used): `SocraNext` (PascalCase)
- We avoid reserved prefixes like `wp_`, `_`, and `__` for custom identifiers.
- Existing options and routes already comply; no migrations are required.

== Installation ==
1. Upload the plugin and activate it via *Plugins → Installed Plugins*.  
2. (Optional) Connect your site in the SocraNext platform to automatically generate and publish content and FAQs.

== Screenshots ==
1. SocraNext Admin page
2. SocraNext Posts list
3. SocraNext Categorys list

== Changelog ==

= 1.8.0 =
* Fixed: Publishing the same article twice no longer creates a duplicate.
* Fixed: An article keeps its category when that category was deleted in WordPress; the category is recreated by name.

= 1.7.0 =
* Added: Every language version of a page can now have its own FAQ, so a Dutch page and its English translation no longer share one set of questions.
* Added: SocraNext articles and article categories can be translated with WPML or Polylang.
* Fixed: WPML no longer overwrites FAQs that are managed per language in SocraNext.

= 1.6.5 =
* Fixed: The FAQ block no longer appears at the top of the page on themes such as The7; it is placed above the footer as intended.
* Fixed: Articles and the FAQ block now use the full content width on themes with a sidebar layout, such as The7.
* Fixed: Article and FAQ headings are no longer cramped on themes that set their own heading line height.

= 1.6.4 =
* Changed: Maintenance and compatibility improvements.

= 1.6.3 =
* Changed: Maintenance and compatibility improvements.

= 1.6.2 =
* Changed: Internal improvements.

= 1.6.1 =
* Changed: Maintenance and reliability improvements.

= 1.6.0 =
* Changed: Maintenance and reliability improvements.

= 1.5.0 =
* Added: The plugin interface is available in English and Dutch and follows the language of your site.

= 1.4.0 =
* Changed: Old article addresses keep working after you rename the articles URL; visitors are redirected to the new address.
* Fixed: Renaming a main article also updates the addresses of its in-depth articles.
* Fixed: A deleted article now redirects to the articles overview instead of showing a "page not found".

= 1.3.6 =
* Fixed: The FAQ shortcode no longer jumps to the bottom of the page.
* Fixed: The FAQ shortcode now also works on pages built with Elementor.

= 1.3.5 =
* Added: SocraNext articles have their own SEO title and description, plus article data that search engines and AI systems can read.
* Added: Those values are also filled in Yoast, All in One SEO and Rank Math when one of those plugins is active.

= 1.3.4 =
* Fixed: Connecting your site to SocraNext no longer fails on hosting that uses object caching (Redis or Memcached).

= 1.3.3 =
* Changed: Confirmed compatibility with WordPress 7.0.
* Fixed: Smaller fixes.

= 1.3.2 =
* Fixed: Smaller fixes.

= 1.3.1 =
* Changed: Removing the knowledge base is more reliable and only runs when SocraNext asks for it.
* Changed: The plugin reports its status to SocraNext more accurately, so updates run more smoothly.

= 1.3.0 =
* Removed: The SocraNext knowledge base page; existing knowledge base addresses redirect to the homepage.
* Changed: New installations no longer create a knowledge base page.
* Changed: The articles page address can be changed independently of the old knowledge base setup.

= 1.1.5 =
* Changed: Connecting your site to SocraNext no longer requires a SocraNext account; the button in the plugin is enough.
* Added: A site that is not connected yet connects itself once automatically after you activate the plugin.
* Security: The access key is no longer passed through the browser address bar.

= 1.1.4 =
* Added: Deleting the plugin now removes all SocraNext content from WordPress: articles, article categories, the pages it created, FAQ data and settings.

= 1.1.3 =
* Added: SocraNext can publish an llms.txt and llms-full.txt for your site, available at /llms.txt and /llms-full.txt so AI systems can read a curated summary.

= 1.1.2 =
* Fixed: Choosing an articles address that is already in use now shows a clear error, instead of silently saving a different address than the one you entered.
* Fixed: Renaming the knowledge base page keeps working when its setting was lost.

= 1.1.1 =
* Changed: SocraNext only shows filters for content types that actually exist on your site, so you no longer see empty tabs for blogs, products or categories.

= 1.1.0 =
* Added: The address of the articles overview page can be changed from SocraNext (default artikelen-sn). Existing sites keep their current addresses until you change them.

= 1.0.4 =
* Fixed: FAQ changes are visible to visitors right away on hosting with caching (Cloudways Breeze, WP-Optimize, NitroPack, Borlabs Cache and Varnish).

= 1.0.3 =
* Changed: Restyled the SocraNext admin screens and FAQ switches.
* Added: Search and paging in the page list, so sites with many pages stay workable.
* Added: Support for multilingual sites (WPML and Polylang) in all content lists.

= 1.0.2 =
* Fixed: Connection problems with SocraNext on certain hosting environments.

= 1.0.1 =
* Added: Article addresses now follow the article structure, for example /artikelen-sn/main-article/in-depth-article/.
* Added: Default styling per content type (FAQ, knowledge base, articles).
* Changed: Custom HTML, CSS and JavaScript for FAQ sections is managed in one place and refreshes reliably.
* Security: Improved escaping, input checks and key handling to match WordPress standards.

= 0.5.9 =
* Added: An optional disclaimer under the FAQs on pages, products and product categories, shown only when you fill it in.
* Added: FAQ data that search engines and AI systems can read on the knowledge base page.
* Fixed: Custom code is no longer added twice on the articles overview.
* Security: More robust handling of the access key.

= 0.5.8 =
* Added: Secure connection with the SocraNext platform.
* Changed: Fixes required for the WordPress plugin review.

= 0.5.7 =
* Changed: Improved the connection with the SocraNext platform.

= 0.5.6 =
* Changed: Reworked how the site authenticates with SocraNext.
* Added: Support for page meta data.

= 0.5.5 =
* Added: Support for custom post types.

= 0.5.4 =
* Added: Support for WooCommerce products.

= 0.5.3 =
* Added: Bundled styling and scripts for the FAQ and article views.

= 0.5.2 =
* Added: First public release: articles with categories, knowledge base page, shortcodes, admin screens and page templates.