This commit is contained in:
Javier Casares 2026-08-07 11:55:52 +00:00
commit 1a826e8404

View file

@ -3,9 +3,9 @@ Contributors: javiercasares
Tags: seo, noindex, nofollow, noarchive, robots
Requires at least: 5.7
Tested up to: 7.1
Stable tag: 3.0.4
Stable tag: 3.1.0
Requires PHP: 7.2
Version: 3.0.4
Version: 3.1.0
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
@ -114,6 +114,29 @@ Extract the contents of the ZIP and upload the contents to the `/wp-content/plug
== Changelog ==
= 3.1.0 [2026-07-18] =
Closes the three remaining HIGH-priority items from the original gap audit.
**Added**
* **WP core XML sitemap integration.** Hooks `wp_sitemaps_posts_query_args`, `wp_sitemaps_taxonomies_query_args`, and `wp_sitemaps_users_query_args` so URLs that should not be indexed drop out of `/wp-sitemap.xml`. Two layers of exclusion: (1) whole-type exclusion — if `singular.noindex=1` hides every post type; `single.noindex=1` hides all posts; `page.noindex=1` hides all pages; `attachment.noindex=1` hides all attachments; `cpt_{type}.noindex=1` hides that CPT; `category.noindex=1` / `tag.noindex=1` hide those taxonomies; `author.noindex=1` hides the entire users sitemap. (2) per-item exclusion — posts/terms with the granular `_noindex_seo_override=1` + `_noindex_seo_noindex=1` flag are excluded from their type's sitemap. Closes the biggest SEO-quality gap (Google Search Console flags noindexed URLs in sitemaps as a coverage warning).
* **Per-CPT global defaults.** Every public custom post type (anything public + non-built-in: WooCommerce `product`, EDD `download`, LMS lesson/course, etc.) now gets its own context `cpt_{post_type}` and a "Custom Post Types" section in the settings page. Previously every CPT single fell into the generic `single` bucket; now each CPT can have its own noindex / nofollow / noarchive / nosnippet / noimageindex defaults that apply globally to all of its items.
* **REST API exposure.** Two new read-only endpoints under `/wp-json/noindex-seo/v1/`:
- `GET /settings` — returns the consolidated settings array (contexts × directives + config), so headless consumers (Next.js, Gatsby, mobile apps) can read the global configuration.
- `GET /effective?post_id=123` — returns the active directive list for a specific post, computed by the same precedence used on the front-end (per-post override → per-CPT default → built-in `single`/`page`/`attachment` context). Includes the implementation `method` so consumers know whether to render a `<meta>` tag, an `X-Robots-Tag` header, or both.
**Compatibility**
* WordPress: 5.7 - 7.1
* PHP: 7.2 - 8.5
**Tests**
* Added `tests/test-sitemap.php` (per-post + global-context exclusion for posts/terms/users sitemaps).
* Added `tests/test-rest-api.php` (settings endpoint, effective endpoint for post-meta and CPT-default sources, 404 for unknown post).
* Added `tests/test-cpt-contexts.php` (dynamic context registration, per-CPT settings application).
= 3.0.4 [2026-07-18] =
**Changed**