=== LeTDK ===
Contributors: laobuluo
Donate link: https://www.lezaiyun.com/donate/
Tags: seo, meta tags, title, description, open graph
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A lightweight WordPress SEO plugin to customize homepage, category, and post titles, descriptions, keywords, and optional Open Graph tags.

== Description ==

LeTDK helps you manage your site's TDK (Title, Description, Keywords) from a simple settings screen—no heavy SEO suite required.

**Features**

* **Homepage TDK** — Custom homepage title, description, keywords, and title separator
* **Category TDK** — SEO fields on category add/edit screens; falls back to the category name or description when empty
* **Post TDK** — SEO meta box on posts; falls back to the post title or trimmed content when empty
* **Document title** — Uses `pre_get_document_title` for front-end `<title>` output
* **Meta tags** — Outputs `description` and optional `keywords`
* **Social sharing (Open Graph)** — Optional Open Graph and Twitter Card tags with a default share image
* **Robots meta** — Optional control for archive indexing and robots directives
* **Master switch** — Disable all front-end SEO output from this plugin when needed

**Highlights**

* Settings live under **Settings → LeTDK**
* Dependent fields hide when the master switch is off
* Keyword input converts Chinese commas to English commas
* Homepage title (60) and description (160) length checks support UTF-8 when mbstring is available
* Uninstall removes plugin options via `uninstall.php`

**Note**

If you already use a full SEO plugin, avoid duplicate meta tags—enable only one plugin to control titles and meta output.

This plugin is developed by **Lezaiyun Studio** and maintained by LaoJiang.

🔗 Official product page: [https://www.lezaiyun.com/letdk.html](https://www.lezaiyun.com/letdk.html)

👤 Developer Blog: [https://www.laojiang.me](https://www.laojiang.me)

== Installation ==

= Automatic installation =

1. In your WordPress admin, go to **Plugins → Add New**
2. Search for **LeTDK**
3. Click **Install Now**, then **Activate**

= Manual installation =

1. Upload the `letdk` folder to `/wp-content/plugins/`
2. Activate the plugin on the **Plugins** screen
3. Open **Settings → LeTDK**

= Initial setup =

1. Enable **TDK optimization**
2. Set homepage title, description, and keywords (use commas between keywords)
3. Optionally enable category TDK, post TDK, social meta tags, and robots meta
4. Click **Save Changes**

== Frequently Asked Questions ==

= The page title does not change after I enable LeTDK =

Make sure **TDK optimization** is checked. If another SEO plugin also controls titles, disable one of them to avoid conflicts.

= I do not see SEO fields on categories or posts =

Enable **Category TDK** and/or **Post TDK** on the LeTDK settings page. Category fields appear on **Posts → Categories**; post fields appear in the **SEO settings** meta box when editing a post.

= What keyword format should I use? =

Use comma-separated keywords, for example: `WordPress,SEO,plugin`. Chinese commas entered in the admin are converted to English commas automatically.

= How does the default social share image work? =

After you enable **Social sharing tags (OG Meta)**, single posts use the featured image when available; otherwise the default image from settings is used.

= Does uninstalling remove all data? =

Uninstalling deletes the `letdk_options` site option. Custom SEO post meta and term meta are kept so your content data is not lost.

= What PHP version is required? =

PHP 7.4 or newer.

== Screenshots ==

1. LeTDK settings page — homepage TDK and feature toggles
2. Post editor — SEO meta box
3. Category editor — SEO fields

== Changelog ==

= 1.1.1 =
* WordPress.org review: English readme and plugin header description
* Security: sanitize and unslash nonce and POST inputs; escape admin output with esc_html_e / esc_attr_e
* Settings: restrict title_separator to allowed values; register_setting type array
* Removed load_plugin_textdomain (WordPress.org handles translations)
* Settings menu moved under Settings → LeTDK

= 1.1.0 =
* Fix: pass site name to admin JS via wp_localize_script
* Fix: robots meta noindex/index conflict
* Fix: textdomain path and loading timing
* Perf: load admin assets only on the settings page; cache options per request
* UTF-8 length validation for homepage title and description
* Standard uninstall.php

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.1.1 =
Security and WordPress.org compliance updates. Recommended for all users.
