=== Robots.txt Editor ===
Contributors: snehalpancholi
Tags: robots.txt, SEO, crawlers, search engines, bots
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Edit your WordPress robots.txt directly from the admin dashboard — no FTP required.

== Description ==

Robots.txt Editor gives you full control over your virtual robots.txt file without needing FTP access or a text editor. Edit crawler directives, block paths, and add sitemap references — all from **Settings > Robots.txt Editor**.

WordPress generates a virtual robots.txt dynamically when no physical robots.txt file exists in your site root. This plugin intercepts that output and replaces it with your custom content, stored safely in the database.

**Features:**

* Edit virtual robots.txt from the WordPress admin
* Pre-populated with sensible WordPress defaults on first use
* Status indicator showing whether custom content is active
* Physical file detection warning — alerts you if a static robots.txt overrides the virtual one
* Live preview link to your robots.txt URL
* Reset to WordPress default with a single click
* Inline quick-reference table for robots.txt syntax
* Changes take effect instantly — no cache clearing needed
* Lightweight: no external dependencies, no jQuery
* Secure: nonce-verified saves, capability checks, sanitized input

== Installation ==

1. Upload the `robots-txt-editor` folder to `/wp-content/plugins/`.
2. Activate the plugin via **Plugins > Installed Plugins**.
3. Navigate to **Settings > Robots.txt Editor**.
4. Edit the content in the textarea and click **Save Robots.txt**.
5. Click **View Live Robots.txt** to verify the output in your browser.

== Frequently Asked Questions ==

= Does this plugin create a physical robots.txt file? =

No. It hooks into WordPress's `robots_txt` filter to serve the custom content dynamically. Your root directory remains unchanged.

= What happens if a physical robots.txt file already exists? =

The plugin detects this and displays a warning. WordPress serves the physical file instead of the virtual one, so the editor will have no effect until the physical file is removed.

= What happens if I leave the editor empty? =

If the saved content is blank or contains only whitespace, the plugin falls back to the default WordPress robots.txt output.

= Is the content sanitized? =

Yes. The content is passed through `sanitize_textarea_field()` before being stored in the database, and escaped properly on output.

= Will this work with caching plugins? =

The robots.txt URL (`/robots.txt`) is typically excluded from page caches by default. If your host has a custom caching layer, you may need to purge the cache for the robots.txt URL after saving.

= Where is the content stored? =

In `wp_options` under the key `addlc_rte_content`. No custom database tables are created.

= What is removed on uninstall? =

The `addlc_rte_content` option and the update-check transient (`addlc_rte_update_cache`) are deleted. No other data is left behind.

== Screenshots ==

1. The main Robots.txt Editor page showing the monospace textarea and action buttons.
2. The info bar displaying the live robots.txt URL and active-content badge.
3. The quick reference table for robots.txt directives.

== Changelog ==

= 1.0.0 =
* Initial release.
* Virtual robots.txt editing from the WordPress admin.
* Pre-populated default content on first use.
* Physical file detection warning.
* Live preview link and quick-reference table.
* Reset to WordPress default button.
* AddonLogic automatic update system.

== Upgrade Notice ==

= 1.0.0 =
Initial release — no upgrade steps required.
