=== AI SEO Automation - AYSA ===
Contributors: aysaai
Tags: seo, analysis, research, domain authority, keyword research
Requires at least: 5.9
Requires PHP: 7.4
Tested up to: 7.0
Stable tag: 1.3.131-beta.69
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

A powerful SEO research and analysis tool for WordPress that helps you analyze domain authority, discover keywords, and analyze competitors.

== Description ==

Aysa.ai is a comprehensive SEO research and analysis tool that provides valuable insights for your website's optimization. The plugin offers the following features:

* Domain Authority Analysis
* Keyword Discovery
* Competitor Keyword Gap Analysis
* Competitor Identification
* Competitor Backlink Analysis
* Competitor Content Strategy
* Google Local SEO & Listings

= Features =

* **Domain Authority Analysis**: Get detailed insights about your domain's authority and performance metrics.
* **Keyword Discovery**: Find relevant keywords for your content strategy.
* **Competitor Analysis**: Analyze your competitors' strategies and identify opportunities.
* **Local SEO**: Optimize your local search presence and listings.

= External Services =

This plugin connects to AYSA services because the SEO research, AI-assisted recommendations, activation, billing, credits, worker status, Google integration orchestration, and projection synchronization are provided by AYSA as a Software as a Service platform.

The plugin may send the following data to AYSA services after the plugin is activated and configured: site URL and host, WordPress user ID for the active administrator workflow, AYSA activation/access key, project and website identifiers, selected language, Business Profile setup data entered by the administrator, SEO profile fields, page/post/product/category metadata needed for SEO analysis, keyword and ranking data, audit snapshots, action status, billing/credit usage events, and email notification metadata.

The plugin connects to:

* `https://api.aysa.ai` for activation, project binding, SEO research, worker orchestration, Google/OAuth brokered operations, wallet/credit synchronization, projection sync, and AI-assisted SEO actions.
* `https://app.aysa.ai` for account, website, activation key, billing, checkout, and user-facing AYSA application links.

An AYSA account and activation/access key are required for the plugin's service-backed features. Terms and privacy information are available at `https://aysa.ai/terms` and `https://aysa.ai/privacy`.

= Privacy And Data Retention =

The plugin stores activation and project binding data in the WordPress database so the site remains connected to the correct AYSA project. It may store local SEO snapshots, keyword associations, audit history, wallet/credit state, notification state, and generated workflow state.

The plugin exposes projection sync endpoints for AYSA service callbacks. These endpoints require a bearer secret, reject oversized payloads, and are rate limited. They are used to synchronize worker results back into the local WordPress database.

The plugin may send email notifications for AYSA workflows such as audit completion, approval requests, or billing/order events. AYSA branding/signatures are limited to AYSA-generated emails only.

Some technical SEO actions need to update WordPress root files in order to perform the requested operation:

* `.htaccess` may be updated when an administrator explicitly creates, removes, or marks redirect/Gone rules from the AYSA technical optimization tools.
* `robots.txt` may be updated when an administrator explicitly saves the robots editor content or restores the recommended robots.txt content.
* `sitemap_index.xml` may be generated or replaced when an administrator explicitly runs the AYSA sitemap generator.

These file writes are not automatic background writes. They are initiated from administrator tools, require WordPress nonce and capability checks, validate/sanitize the submitted data, check file or directory writability before writing, and return an error if WordPress cannot safely update the target file. They are required for the redirect, Gone URL, robots.txt, and sitemap features to work directly from WordPress.

On uninstall, plugin tables are preserved unless the administrator explicitly enabled deletion of AYSA tables. Plugin options listed by the uninstall script are removed when the plugin is deleted.

= Installation =

1. Upload the `aysaaiseo` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Navigate to 'Aysa.ai' in your WordPress admin menu to access the dashboard

= Frequently Asked Questions =

= Does this plugin require API credentials? =

Yes. The plugin requires an active AYSA account, authentication, and a valid activation/access key to unlock features.

= Can I use this plugin on multiple sites? =

Yes, the plugin is licensed under GPL v2, which allows you to use it on multiple sites.

= Why does the plugin need to write to .htaccess, robots.txt, or sitemap_index.xml? =

Those writes are only used for administrator-requested technical SEO actions. Redirect and Gone URL tools need `.htaccess` rules on Apache-based sites. The robots editor needs to save `robots.txt`. The sitemap generator needs to write the AYSA sitemap file. The plugin checks permissions and nonces before these actions and reports an error instead of writing if WordPress cannot update the file safely.

= Support =

For support, please visit our [support page](https://aysa.ai/support).

= Changelog =

= 1.3.131-beta.7 =
* Split featured and inline article image generation into separate requests to avoid API timeouts.

= 1.3.131-beta.6 =
* Generate distinct featured and inline article images for Content Strategy posts.

= 1.3.131-beta.5 =
* Publish controlled beta update after Agent8 content calendar cadence fixes.

= 1.3.131-beta.4 =
* Disable Agent 8 QA and reset controls by default for controlled beta builds.

= 1.3.131-beta.3 =
* Route post-activation apprentice redirects to the registered Agent 8 beta page.

= 1.3.131-beta.2 =
* Allow the Activation Key async conversation request through the pre-activation AJAX gate.

= 1.3.131-beta.1 =
* Gate the beta admin root behind Activation Key until a valid access key exists.
* Hide Agent8 QA/debug/full reset controls in controlled beta unless QA is explicitly enabled.

= 1.2.18 =
* Publish important conversational events to AYSA Notification Center.
* Send keyword refresh completion/failure and approval-required events through the app notification pipeline.
* Keep plugin chat notifications aligned with app notifications and conversational email delivery.

= 1.2.17 =
* Moved keyword suggestion refresh to a background worker flow in chat and Keyword Discovery.
* Added live completion/failure notifications for background keyword refresh jobs.
* Improved async intent contract for keyword refresh in the conversational agent.

= 1.2.1 =
- Fix duplicate "Connect Google" setup button and add inline Google CTA inside the setup chat.

= 1.2.0 =
* Introduced AYSA Apprentice as the main novice-first experience
* Unified setup and execution into a single visible agent flow
* Reduced visible navigation so users can work through the agent without module hopping
* Improved action-first guidance with approval before sensitive SEO changes

= 1.1.0 =
* Fixed credit display issues in settings page - now loads credits from dashboard component
* Implemented proper credit analytics loading with current balance, total used, monthly usage, and daily average
* Fixed transaction history balance calculations - now correctly shows running balance from current credits
* Enhanced credit data loading with proper error handling and fallback mechanisms
* Improved transaction formatting with proper date display and transaction type badges
* Added comprehensive credit summary statistics and transaction history rendering
* Fixed "Balance After" calculations to show correct historical balances
* Enhanced credit component integration across all settings page sections

= 1.0.9 =
* Converted settings page from jQuery to plain JavaScript for better compatibility
* Fixed "Unexpected end of input" syntax error by properly closing all functions
* Replaced jQuery AJAX calls with native fetch API
* Improved tab switching functionality using vanilla JavaScript
* Enhanced error handling and null checks throughout the settings page
* Added proper function closures and modular code structure
* Fixed authentication status display and API controls
* Improved range input functionality and advanced settings
* Made utility functions globally available for onclick handlers

= 1.0.7 =
* Fixed settings page display issues - added missing HTML content structure
* Resolved JavaScript errors preventing settings page from loading
* Added proper null checks for DOM elements to prevent errors
* Fixed authentication status display and chart rendering issues
* Enhanced settings page with complete tab navigation and content areas
* Improved error handling for missing DOM elements

= 1.0.6 =
* Added calculable "Balance After" field in credit transaction history
* Improved credit analytics display with proper balance tracking
* Enhanced transaction history with running balance calculations
* Fixed horizontal tab navigation in settings page
* Added proper date formatting for transaction history

= 1.0.5 =
* Enhanced dashboard with call-to-action buttons
* Improved user experience with better navigation

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.0.8 =
This update fixes critical JavaScript errors in the settings page that were causing "Cannot set properties of null" errors. All DOM element access now includes proper null checks, and missing helper functions have been added for complete functionality. 
