# Project Overview

This is a WordPress plugin called "Nudge SEO AI". It acts as a personal SEO assistant, providing competitive "nudges" based on real-time SERP analysis directly within the WordPress editor. The plugin helps content creators write more comprehensive and competitive articles by analyzing top-ranking content and suggesting topics to cover.

## Main Technologies

*   **Backend:** PHP
*   **Frontend:** JavaScript (jQuery), CSS
*   **Environment:** WordPress

## Architecture

The plugin follows a standard WordPress plugin architecture:

*   **`nudge-seo-ai.php`:** The main plugin file that initializes the plugin and includes other necessary files.
*   **`includes/`:** This directory contains the core logic of the plugin, separated into classes:
    *   `class-nudge-seo-ai-admin.php`: Handles the admin-side functionality, such as enqueuing scripts and styles.
    *   `class-nudge-seo-ai-api.php`: Manages the AJAX API for fetching and analyzing competitor content. It scrapes H2 headings from a list of URLs and returns a list of common topics.
    *   `class-nudge-seo-ai-metabox.php`: Creates the meta box in the WordPress editor, which serves as the user interface for the plugin.
*   **`assets/`:** This directory contains the CSS and JavaScript files for the plugin's UI.
*   **`languages/`:** This directory contains the translation files for the plugin.

# Building and Running

This is a WordPress plugin, so it needs to be installed and activated on a WordPress site.

1.  **Installation:**
    *   Create a zip archive of the plugin directory.
    *   In the WordPress admin panel, go to "Plugins" > "Add New" > "Upload Plugin".
    *   Upload the zip file and activate the plugin.
2.  **Running:**
    *   Once activated, the "Nudge SEO AI" meta box will appear on the post and page edit screens.
    *   Enter a keyword and optional reference URLs, then click "Get Competitive Nudges" to run an analysis.

# Development Conventions

*   **Coding Style:** The code follows the WordPress coding standards, including the use of inline documentation and clear naming conventions.
*   **Singleton Pattern:** The main plugin class uses the singleton pattern to ensure only one instance is loaded.
*   **AJAX:** The plugin uses AJAX to fetch data from the server without reloading the page. The AJAX functionality is handled in `class-nudge-seo-ai-api.php`.
*   **Localization:** The plugin is localized using the `load_plugin_textdomain` function and a `languages` directory.
