=== DataStackLogic Schema Manager ===
Contributors: datastacklogic
Tags: schema, structured data, AI, JSON-LD, local SEO
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Structured data plugin for WordPress. Outputs Organization, LocalBusiness, and FAQPage schema, and manages AI crawler directives in robots.txt.

== Description ==

**DataStackLogic Schema Manager** is a structured data plugin for WordPress that helps configure the schema markup used by AI systems and search engines to understand your business. All settings are managed from the WordPress admin, no coding required.

As AI-powered search evolves, structured data helps search engines and AI systems understand your site content. This plugin provides tools to configure that structured data.

= What It Does =

**Organization Schema** — Outputs a complete Organization JSON-LD block in the `<head>` of every page on your site. Covers your legal name, schema type, description, logo, address, phone, founding date, and social profiles (sameAs). This is the foundational GEO signal — without it, AI systems have to guess who you are.

**LocalBusiness Schema** — Map any WordPress page to a physical location. Each entry outputs a LocalBusiness JSON-LD block with full address, geo-coordinates, opening hours, and phone number. Critical for location-based AI answers.

**FAQPage Schema** — Assign Q&A pairs to any page or post. Outputs as FAQPage JSON-LD — the highest-value GEO signal. When ChatGPT or Perplexity answer a question, they heavily favor pages with structured FAQ data. Includes a bulk CSV importer and a Site Scanner that automatically pulls FAQ content from your WordPress REST API.

**AI Crawler Control** — Manages robots.txt directives for all 15 major AI crawlers including GPTBot (ChatGPT), ClaudeBot (Anthropic), PerplexityBot, Google-Extended (Gemini), Bingbot (Copilot), Applebot-Extended, Meta-ExternalAgent, Amazonbot, CCBot, Cohere-AI, YouBot, Bytespider, MistralAI, and more. One toggle per crawler — no manual robots.txt editing needed.

**Product Schema** — 14 schema types for financial products and services: AutoLoan, MortgageLoan, CreditCard, CheckingAccount, SavingsAccount, HomeEquityLoan, StudentLoan, PersonalLoan, BusinessLoan, InsuranceProduct, InvestmentAccount, MoneyTransfer, PaymentCard, and DepositAccount.

= Key Features =

* No coding required — everything configured through the WordPress admin
* Works with any WordPress theme (Elementor, Divi, Astra, GeneratePress, block themes)
* Compatible with Yoast SEO and RankMath — does not conflict
* Bulk CSV import for locations and FAQ pages
* Site Scanner — automatically pulls FAQ content from any WordPress site's REST API
* Export/Import — move your configuration from development to production in one click
* Clean JSON-LD output in `<head>` — no shortcodes, no page builder dependencies
* Dashboard-ready — includes a Connect tab for linking to the GEO monitoring dashboard

= Who It's For =

* Local service businesses with multiple locations
* Financial institutions (credit unions, banks, insurance)
* Healthcare providers
* Real estate agencies
* Any business that wants AI visibility alongside traditional SEO

= Privacy =

This plugin does not collect any user data. No external services are called on the frontend. All configuration is stored in your WordPress database.

== Installation ==

1. Upload the `datastacklogic-schema-manager` folder to `/wp-content/plugins/`, or install directly through the WordPress Plugins screen
2. Activate the plugin through the Plugins menu in WordPress
3. Go to **DataStackLogic Schema Manager** in the WordPress admin sidebar
4. Start with the **Organization** tab — fill in your business name, type, address, and social profiles
5. Add locations in the **Locations** tab if you have physical premises
6. Add FAQ schema in the **FAQ Pages** tab — use the Site Scanner to pull existing FAQ content automatically
7. Enable AI crawler directives on the **Robots.txt** tab

== Frequently Asked Questions ==

= Does this work with my theme? =

Yes. DataStackLogic Schema Manager works with every WordPress theme. It outputs JSON-LD in the document head — no page builder integration required.

= Will this conflict with Yoast SEO or RankMath? =

No. This plugin outputs additional schema types that Yoast and RankMath do not cover (LocalBusiness per page, FAQPage per page, AI crawler directives). They work alongside each other.

= What is GEO? =

GEO stands for Generative Engine Optimization — the practice of structuring your website so AI answer engines like ChatGPT, Perplexity, and Google AI cite your content in their responses.

= Does this slow down my site? =

No. All schema output is server-side PHP — no JavaScript, no extra HTTP requests on the frontend.

= Is there a Pro version? =

Yes. The Pro version ($99/year) includes the GEO Health Score monitoring dashboard, additional product schema types, and priority support. Available at datastacklogic.com.

== Screenshots ==

1. Organization Schema tab — configure your business identity
2. FAQ Pages tab — assign Q&A pairs to pages for AI citation
3. Locations tab — map pages to physical locations with geo-coordinates
4. Robots.txt tab — manage AI crawler permissions in robots.txt
5. Site Scanner — automatically pull FAQ content from your WordPress REST API

== Changelog ==

= 2.0.4 =
* Fixed: JSON import now accepts files exported from older plugin versions (legacy gsm_ option key support)
* Fixed: Import validation error message rebranded from "GEO Schema Manager" to "DataStackLogic Schema Manager"
* Fixed: Removed duplicate class files left from incomplete 2.0.1 trunk commit

= 2.0.3 =
* Fixed: Completed gsm- to datascma- prefix migration across all files — 24 JS selectors, 61 HTML IDs, 313 CSS selectors, and 643 class references in PHP views now use consistent datascma- prefix
* This resolves potential conflicts with other plugins using the gsm- namespace and ensures all interactive elements (Add Location, Add FAQ, Add Product, social profiles, robots toggles, scanner, help panel) work reliably

= 2.0.2 =
* Added upgrade system (class-datascma-upgrade.php) — runs on plugins_loaded priority 5, safe migration for existing users, no wizard redirect on upgrade or auto-update
* Fixed: Add Location and Add FAQ Page buttons were broken — JS clone templates were missing from locations.php and faq.php, and HTML IDs did not match JS selectors (datascma- prefix vs gsm- prefix)
* Fixed: Site Scanner always returned zero results — $content was read from an undefined variable instead of $datascma_content after apply_filters()
* Fixed: FAQ and branch location imports saved nothing — array_map('sanitize_text_field') on nested POST arrays flattened all sub-arrays to empty strings
* Fixed: CSV import (FAQ and Locations) always rejected valid uploads with "Upload error: 0" — sanitize_text_field converted integer error code 0 to string "0", breaking strict comparison with UPLOAD_ERR_OK
* Fixed: Stray ?> on line 4 of connect.php, products.php, robots.php, testing.php, tools.php, and help-panel.php caused PHP variable assignments to render as visible page text, making all variables undefined
* Fixed: PHPCS errors — missing translators comments on Step %1$s of %2$s strings in onboarding.php, direct script/style output replaced with wp_enqueue + wp_print, nonce verification suppression added to save_step1/2/3 private methods
* Fixed: jQuery enqueue version was null — now reads from $wp_scripts->registered['jquery-core']->ver
* Fixed: readme.txt Stable tag was 2.0.1, did not match plugin header version 2.0.2
* Fixed: CSV import overflow in admin panel — added min-width: 0 to grid children so overflow-x: auto works correctly on long CSV example lines
* Fixed: All geoschemamanager.com URLs replaced with correct datastacklogic.com/schema-manager and app.datastacklogic.com URLs throughout all view files, readme.txt, and PHP classes
* Fixed: All "GEO Schema Manager" brand references replaced with "DataStackLogic Schema Manager" in UI headers, admin menu, robots.txt comment output, error messages, and documentation
* Fixed: Tools tab showed wrong tab label ("Connect") for Dashboard link — now consistent with all other views ("Dashboard")
* Fixed: class-gsm-dsw-integration.php renamed to class-datascma-dsw-integration.php and class GSM_DSW_Integration renamed to DATASCMA_DSW_Integration to match required plugin prefix
* Renamed: All 13 class files to WordPress naming standard — class files now include full plugin prefix (e.g. class-admin.php → class-datascma-admin.php) to comply with WordPress.Files.FileName PHPCS rule

= 2.0.1 =
* Added DataStackLogic Suite integration — dashboard card shows connection status with Schema Pro for WooCommerce
* Exposes Organization data via dsw_organization_data filter for cross-plugin knowledge graph linking
* Fixed asset enqueue hook check (was checking for gsm- prefix, now correctly checks datascma-)
* Fixed plugin URI to point to datastacklogic.com/schema-manager
* Bumped DATASCMA_VERSION constant to match plugin header

= 1.8.1 =
* Removed client-specific placeholder text — all fields now show generic examples
* Fixed duplicate class-datascma-api.php require in main plugin file
* Removed GitHub updater from free version (WordPress.org handles updates)
* Updated sample CSV files with generic data

= 1.8.0 =
* Added Connect tab for GEO Dashboard integration
* Added REST API endpoints for dashboard health reporting
* Added export/import functionality for dev-to-production workflow
* Added 14 financial product schema types

= 1.0.0 =
* Initial release — Organization schema, LocalBusiness schema, FAQPage schema, robots.txt AI directives

== Upgrade Notice ==

= 2.0.2 =
Critical bug fixes — Scanner, CSV import, Add Location, and Add FAQ Page buttons were all broken in 2.0.1. Update immediately. Existing data and settings are preserved automatically.

= 1.8.1 =
Maintenance release. Update recommended for all users.
