=== Content Console ===
Contributors: mustakim5
Tags: content, google-search-console, seo, ai-content, content-marketing
Requires at least: 7.0
Requires PHP: 7.4
Stable tag: 0.1.4
Tested up to: 7.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Turn Google Search Console data into SEO content opportunities, content briefs, and AI-assisted WordPress drafts.

== Description ==

Content Console is an AI-assisted SEO and content workflow for WordPress. It connects your Google Search Console data with your content strategy to help you discover search opportunities, create content briefs, generate WordPress drafts, and refresh existing content.

Instead of starting your content strategy with a blank page, Content Console starts with the search queries and pages already generating impressions for your website.

Connect Google Search Console, sync your search performance data, and discover potential content opportunities based on impressions, clicks, CTR, and average search position. Then use the WordPress AI Client to turn those opportunities into structured content briefs or AI-assisted drafts for review.

You can also add your business and brand context, including your audience, tone of voice, differentiators, competitors, and content goals, to help generate more relevant content.

### Discover Content Opportunities From Google Search Console

Content Console analyzes stored Google Search Console query and page data to help surface potential SEO opportunities.

You can discover:

* **Refresh opportunities** for pages ranking in positions 8–20 with meaningful impressions.
* **Create opportunities** for search queries that generate impressions but have weaker existing rankings.
* **Improve opportunities** where existing search performance may have room for improvement.

Each opportunity includes useful search performance data such as impressions, clicks, CTR, average position, and an opportunity score.

### Create AI-Assisted SEO Content Briefs

Turn a Search Console opportunity into a structured content brief using the WordPress AI Client.

Generated briefs can include:

* Search intent
* Recommended action
* Working title
* Content angle
* Content outline
* Related topics
* Call-to-action ideas
* Internal linking ideas

Use the brief as a starting point for your content workflow before creating a WordPress draft.

### Generate AI-Assisted WordPress Drafts

Once you have a content opportunity or brief, Content Console can generate an AI-assisted content draft using your search data and business context.

Generated content is presented for review before it becomes a WordPress post. You can edit the title and content before saving it as a Gutenberg draft.

### Refresh Existing WordPress Content

Already have a page targeting a valuable search query?

Content Console can use a Search Console opportunity and your existing article to generate an AI-assisted content refresh.

The refresh can help improve:

* Content structure
* Clarity
* Completeness
* Freshness
* Relevance to the search opportunity

You decide what changes to keep before updating the existing WordPress post.

### Add Your Business and Brand Context

Use the built-in Brand Profile to give AI generation more context about your business and content strategy.

Add information such as:

* Business name
* Industry
* Target audience
* Tone of voice
* USPs and differentiators
* Competitors
* Content goals

This information can be used when generating content briefs, drafts, and content refreshes.

### Built for WordPress

Content Console works inside your WordPress admin and uses the WordPress AI Client for AI text generation.

AI-generated content can be converted into Gutenberg-compatible content and saved as WordPress drafts, allowing you to review and edit everything in the familiar WordPress editor.

### Review Before Publishing

Content Console does not automatically publish AI-generated content.

You remain in control of the final content. Review and edit generated briefs, drafts, and refreshes before creating or updating a WordPress post.

### No Built-In Telemetry

Content Console does not include its own telemetry or analytics tracking.

== Features ==

* Connect Google Search Console with OAuth.
* Import Google Search Console query and page performance data.
* Discover SEO content opportunities from search performance data.
* Identify potential content refresh opportunities.
* Identify potential new content opportunities.
* Generate AI-assisted SEO content briefs.
* Generate AI-assisted WordPress content drafts.
* Refresh existing WordPress content with AI assistance.
* Add business and brand context to AI generation.
* Create Gutenberg-compatible WordPress drafts.
* Review AI-generated content before publishing.
* Use AI providers configured through the WordPress AI Client.
* Store Google OAuth tokens encrypted in the WordPress database.
* No built-in telemetry or analytics tracking.

== How It Works ==

1. Connect your Google Search Console property.
2. Sync your site's search performance data.
3. Review the content opportunities identified by Content Console.
4. Select an opportunity and generate a content brief.
5. Review the brief and generate an AI-assisted draft.
6. Edit the title and content as needed.
7. Save the result as a WordPress draft.
8. For existing content, generate a refresh and review the changes before updating the post.

== Use Cases ==

### Find New Content Ideas From Search Console

Use real search queries and impressions from Google Search Console to uncover topics your website is already appearing for.

### Find Pages Worth Refreshing

Identify pages with search impressions and rankings that may benefit from a content refresh.

### Build an SEO Content Workflow

Move from search performance data to content opportunities, briefs, drafts, and WordPress editing without switching between multiple tools.

### Create Content With Business Context

Use your business and brand profile to give AI-generated briefs and drafts more context about your audience, positioning, tone, and content goals.

== Installation ==

1. Upload the `content-console` folder to `/wp-content/plugins/`, or install the plugin ZIP from the WordPress admin.
2. Activate **Content Console** from the **Plugins** screen.
3. Go to **Content Console > Settings**.
4. Configure a supported AI provider under **Settings > Connectors** if you want to use AI generation.
5. Configure your Google Search Console connection.
6. Connect a Google Search Console property.
7. Sync your Search Console data.
8. Open **Content Console > Opportunities** to review available opportunities.
9. Generate a content brief or AI-assisted draft.
10. Review the generated content before creating or updating a WordPress post.

== Frequently Asked Questions ==

= What does Content Console do? =

Content Console connects Google Search Console data with an AI-assisted WordPress content workflow. It helps you discover SEO content opportunities and turn them into content briefs, new drafts, or refreshes for existing posts.

= Does Content Console require Google Search Console? =

Google Search Console is required for the content-opportunity workflow. The plugin can be activated without connecting Search Console, but Search Console data will not be available until you connect a property and sync your data.

= Does Content Console publish content automatically? =

No. Content Console can generate AI-assisted content drafts, but it does not automatically publish them. Generated content is presented for review before you create a WordPress draft or update an existing post.

= Which AI providers does Content Console support? =

Content Console uses the WordPress AI Client for text generation. AI providers are configured by the site administrator through **Settings > Connectors** rather than through Content Console's own API key fields.

= Do I need to add an OpenAI or Anthropic API key to Content Console? =

No. Content Console does not have its own provider-specific API key fields. AI configuration is handled through the WordPress AI Client and the providers configured under **Settings > Connectors**.

= Can Content Console refresh existing WordPress posts? =

Yes. When an existing page matches a suitable Search Console opportunity, Content Console can generate an AI-assisted content refresh. You can review and edit the proposed content before updating the existing post.

= Can I create Gutenberg drafts with Content Console? =

Yes. AI-generated Markdown is converted into Gutenberg-compatible content and can be added as a WordPress draft for further editing.

= Can I add my brand information? =

Yes. The Brand Profile lets you provide your business name, industry, audience, tone of voice, USPs, competitors, and content goals. This information can be used as context during AI content generation.

= Does Content Console collect analytics or telemetry? =

No. Content Console does not include its own telemetry or analytics tracking.

= Where is my Content Console data stored? =

Business profile information, Google Search Console data, and AI generation history are stored in your WordPress database. Google OAuth access and refresh tokens are encrypted before storage.

== External Services ==

Content Console connects to external services only when the administrator configures and uses those integrations.

= Google Search Console =

Content Console uses the Google Search Console API to retrieve search performance data for an authorized property.

When you connect Google Search Console, Google OAuth is used to authorize access. Content Console requests read-only access using the `webmasters.readonly` scope. During synchronization, the selected Search Console property and requested date range are sent to the Google Search Console API.

Google privacy information:
https://policies.google.com/privacy

Google API Services User Data Policy:
https://developers.google.com/terms/api-services-user-data-policy

Google APIs Terms of Service:
https://developers.google.com/terms

= AI Providers Through the WordPress AI Client =

Content Console uses the WordPress AI Client for AI generation.

When an administrator requests a content brief, draft, or content refresh, relevant prompts and context are sent to the WordPress AI Client. The AI Client routes the request to an AI provider configured by the site administrator under **Settings > Connectors**.

Information sent as part of an AI request may include business profile information, Search Console opportunity data, and existing article content when generating a content refresh.

The privacy policy and terms of the configured AI provider apply to those requests.

== Privacy ==

Content Console stores the following information in the local WordPress database when the related features are used:

* Business profile information entered by an administrator.
* Google Search Console query, page, and performance data retrieved for the connected property.
* Google OAuth access and refresh tokens required to access the connected Search Console property.
* AI generation prompts and generated outputs.

Google Search Console data is requested only after an administrator explicitly connects a Google account and property.

AI prompts are sent only when an administrator requests AI generation.

Content Console does not send telemetry or analytics data to its own servers.

Site owners should maintain a privacy policy that accurately describes their use of Content Console and any external services they configure.

== Changelog ==

= 0.1.4 =

* Replaced direct OpenAI and Anthropic API integrations with the WordPress AI Client.
* Removed plugin-level AI API key storage and provider-specific connection tests.
* Prefixed plugin declarations, globals, options, transients, database tables, admin actions, page slugs, and asset handles with `contco`.
* Removed the unnecessary `load_plugin_textdomain()` call for WordPress.org translations.
* Updated the minimum WordPress version to 7.0.

= 0.1.3 =

* Updated the tested WordPress version to 7.1.

= 0.1.2 =

* Fixed WordPress.org automated security scan warnings for dynamic database table identifiers.
* Added the WordPress 6.9 tested-up-to header.

= 0.1.1 =

* Improved token encryption with random initialization vectors while retaining compatibility with previously stored encrypted values.
* Added safeguards around OAuth state validation and token refresh retries.
* Improved admin data validation and content handling.
* Added support for generating and reviewing content refreshes.

== Upgrade Notice ==

= 0.1.4 =

This release requires WordPress 7.0 or later and moves AI provider configuration to **Settings > Connectors**.

