This commit is contained in:
Javier Casares 2026-07-18 15:37:26 +00:00
commit 8d5551a8b5
9 changed files with 1560 additions and 366 deletions

View file

@ -1,5 +1,42 @@
== Changelog == == Changelog ==
= 2.0.2 [2026-07-18] =
**Fixed**
* Bulk action "Enable Robots Override" no longer creates duplicate `postmeta` rows. The previous implementation used `INSERT ... ON DUPLICATE KEY UPDATE`, but WordPress's `postmeta` table has no unique key on `(post_id, meta_key)`, so the `ON DUPLICATE KEY UPDATE` branch never fired and every bulk run on a post that already had the meta inserted a duplicate row. The bulk handler now uses `update_post_meta()` and `delete_post_meta()` exclusively.
* Bulk action "Disable Robots Override" now removes the override meta entirely (previously set its value to `0`, leaving a redundant row).
**Changed**
* Removed three dead contexts (`feed`, `comment_feed`, `robots`) that were registered, migrated, and cleaned up but never evaluated at runtime and never exposed in the admin UI. The plugin now consistently registers and evaluates 22 page contexts (down from a nominal 25). Existing orphan options from earlier installs are cleaned by the uninstall routine's wildcard delete.
* Extracted `noindex_seo_get_contexts()` as the single source of truth for the context list shared by settings registration, v2 migration, form processing. `uninstall.php` retains its own copy (technical constraint: the main plugin file is not loaded during uninstall) with a sync warning comment.
* Corrected `phpcs.xml` `minimum_supported_wp_version` from `6.6` to `5.7` to match the plugin header. This setting was stale from before the 2.0.1 minimum-WP correction.
* Updated `readme.txt` description counts from 25 to 22 page contexts.
* **Bulk action performance characteristic changed**: the rewrite from a single batched SQL statement to per-post `update_post_meta()` / `delete_post_meta()` calls trades O(1) queries for O(N) queries on bulk selections, in exchange for correctness (no more duplicate rows) and proper WP meta-cache invalidation. Typical admin bulk selections (≤200 posts) are unaffected; very large selections (thousands of posts) may take noticeably longer.
**Deprecated**
* `noindex_seo_clear_transient()`: was hooked to `update_option_noindexseo`, a hook that never fires because `noindexseo` is the Settings API group name, not an option name. The function now emits a deprecation notice via `_deprecated_function()` and continues to clear the `noindex_seo_options` transient if called directly. The transient is cleared correctly inside `noindex_seo_process_form()` after every successful save. The function will be removed in a future release.
**Code Quality**
* `bin/preflight.sh`: hardened temp-file handling (mktemp moved to script top, `trap … EXIT` cleanup, no more predictable `/tmp/composer-audit.*` paths that were vulnerable to symlink overwrite on shared hosting); fixed `2>/null` typo; added rsync / `.distignore` / build-tree-non-empty guards so the forbidden-artefact scan cannot pass vacuously; replaced npm-audit subshell with `pushd`/`popd` so gate counters are not lost.
* Added `bin/preflight.sh`: automated pre-deploy verification covering PHPCS, PHPStan level 9, PHPCompatibility, PHPUnit, dependency audit, and candidate-ZIP artefact inspection. Prints a PASS/FAIL report per section and exits non-zero on any failure.
* Added `.claude/settings.json` deny rules for `deploy.sh`, `git push`, `git tag`, and `git merge`, enforcing the agent operating boundaries mandated by AGENTS.md mechanically rather than only in prose.
**Compatibility**
* WordPress: 5.7 - 7.1
* PHP: 7.2 - 8.5
**Tests**
* PHP Coding Standards: 3.13.5
* WordPress Coding Standards: 3.3.0
* PHPStan: 2.1.55
* PHPUnit: 9.6.34
= 2.0.1 [2026-05-25] = = 2.0.1 [2026-05-25] =
**Added** **Added**

BIN
languages/noindex-seo-ca.mo Normal file

Binary file not shown.

583
languages/noindex-seo-ca.po Normal file
View file

@ -0,0 +1,583 @@
# Translation of noindex SEO into Catalan.
# Copyright (C) 2026 ROBOTSTXT
# This file is distributed under the GPL-3.0-or-later license.
msgid ""
msgstr ""
"Project-Id-Version: noindex SEO 2.0.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/noindex-seo\n"
"POT-Creation-Date: 2026-07-18T14:48:42+00:00\n"
"PO-Revision-Date: 2026-07-18T14:50+00:00\n"
"Last-Translator: ROBOTSTXT <https://www.robotstxt.es/>\n"
"Language-Team: Catalan — https://translate.wordpress.org/locale/ca/default/\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: manual translation per AGENTS-translation-ca.md\n"
"X-Domain: noindex-seo\n"
#. Plugin Name of the plugin
#: noindex-seo.php noindex-seo.php:509 noindex-seo.php:510
msgid "noindex SEO"
msgstr "noindex SEO"
#. Plugin URI of the plugin
#: noindex-seo.php
msgid "https://wordpress.org/plugins/noindex-seo/"
msgstr "https://wordpress.org/plugins/noindex-seo/"
#. Description of the plugin
#: noindex-seo.php
msgid "Control search engine indexing with robots directives (noindex, nofollow, noarchive, nosnippet, noimageindex) for specific parts of your WordPress site."
msgstr "Controla la indexació als cercadors amb directrius robots (noindex, nofollow, noarchive, nosnippet, noimageindex) per a parts específiques del vostre lloc WordPress."
#. Author of the plugin
#: noindex-seo.php
msgid "ROBOTSTXT"
msgstr "ROBOTSTXT"
#. Author URI of the plugin
#: noindex-seo.php
msgid "https://www.robotstxt.es/"
msgstr "https://www.robotstxt.es/"
#: noindex-seo.php:418
msgid "Settings saved successfully!"
msgstr "S'han desat els ajustaments correctament."
#: noindex-seo.php:419
msgid "Expand All"
msgstr "Expandeix-ho tot"
#: noindex-seo.php:420
msgid "Collapse All"
msgstr "Redueix-ho tot"
#: noindex-seo.php:489
msgid "Settings"
msgstr "Ajustaments"
#. translators: plugin name.
#: noindex-seo.php:718
#, php-format
msgid "noindex SEO has detected that %s is active. This may cause conflicts. Please configure the options accordingly."
msgstr "noindex SEO ha detectat que %s és actiu. Això pot causar conflictes. Configureu les opcions en conseqüència."
#: noindex-seo.php:748
msgid "Permission denied or invalid nonce."
msgstr "S'ha denegat el permís o el nonce no és vàlid."
#: noindex-seo.php:914 assets/js/editor-sidebar.js:91
msgid "Search Engine Visibility"
msgstr "Visibilitat als cercadors"
#: noindex-seo.php:967 noindex-seo.php:1308 assets/js/editor-sidebar.js:102
msgid "Override global settings"
msgstr "Sobreescriu els ajustaments globals"
#: noindex-seo.php:972
msgid "When enabled, these directives will override the global settings for this specific content."
msgstr "En activar-se, aquestes directrius sobreescriuran els ajustaments globals per a aquest contingut específic."
#: noindex-seo.php:979
msgid "Prevent indexing"
msgstr "Evita la indexació"
#: noindex-seo.php:984
msgid "Prevent link following"
msgstr "Evita el seguiment d'enllaços"
#: noindex-seo.php:989
msgid "Prevent caching"
msgstr "Evita la memòria cau"
#: noindex-seo.php:994
msgid "Prevent snippets"
msgstr "Evita els fragments"
#: noindex-seo.php:999 assets/js/editor-sidebar.js:203
msgid "Prevent image indexing"
msgstr "Evita la indexació d'imatges"
#: noindex-seo.php:1007
msgid "Effective Directives:"
msgstr "Directrius efectives:"
#: noindex-seo.php:1032
msgid "Override active:"
msgstr "Sobreescriptura activa:"
#: noindex-seo.php:1037
msgid "Override enabled but no directives selected"
msgstr "Sobreescriptura activada però sense directrius seleccionades"
#: noindex-seo.php:1043
msgid "Global settings:"
msgstr "Ajustaments globals:"
#: noindex-seo.php:1048
msgid "No restrictions (indexable)"
msgstr "Sense restriccions (indexable)"
#: noindex-seo.php:1165 noindex-seo.php:1171
msgid "Robots"
msgstr "Robots"
#: noindex-seo.php:1232
msgid "Override (none)"
msgstr "Sobreescriptura (cap)"
#: noindex-seo.php:1304
msgid "Robots Directives"
msgstr "Directrius Robots"
#: noindex-seo.php:1313
msgid "🔍 noindex"
msgstr "🔍 noindex"
#: noindex-seo.php:1317
msgid "🔗 nofollow"
msgstr "🔗 nofollow"
#: noindex-seo.php:1321
msgid "💾 noarchive"
msgstr "💾 noarchive"
#: noindex-seo.php:1325
msgid "📄 nosnippet"
msgstr "📄 nosnippet"
#: noindex-seo.php:1329
msgid "🖼️ noimageindex"
msgstr "🖼️ noimageindex"
#: noindex-seo.php:1440
msgid "Enable Robots Override"
msgstr "Activa la sobreescriptura Robots"
#: noindex-seo.php:1441
msgid "Disable Robots Override"
msgstr "Desactiva la sobreescriptura Robots"
#. translators: %d: Number of posts updated
#: noindex-seo.php:1538
#, php-format
msgid "Robots override enabled for %d post."
msgid_plural "Robots override enabled for %d posts."
msgstr[0] "S'ha activat la sobreescriptura Robots per a %d entrada."
msgstr[1] "S'ha activat la sobreescriptura Robots per a %d entrades."
#. translators: %d: Number of posts updated
#: noindex-seo.php:1559
#, php-format
msgid "Robots override disabled for %d post."
msgid_plural "Robots override disabled for %d posts."
msgstr[0] "S'ha desactivat la sobreescriptura Robots per a %d entrada."
msgstr[1] "S'ha desactivat la sobreescriptura Robots per a %d entrades."
#: noindex-seo.php:1608
msgid "All robots settings"
msgstr "Tots els ajustaments robots"
#: noindex-seo.php:1610
msgid "With override"
msgstr "Amb sobreescriptura"
#: noindex-seo.php:1613
msgid "Without override"
msgstr "Sense sobreescriptura"
#: noindex-seo.php:1727
msgid "You do not have sufficient permissions to access this page."
msgstr "No teniu permisos suficients per a accedir a aquesta pàgina."
#: noindex-seo.php:1728
msgid "Permission Denied"
msgstr "Permís denegat"
#: noindex-seo.php:1750
msgid "Main Pages"
msgstr "Pàgines principals"
#: noindex-seo.php:1753
msgid "Front Page"
msgstr "Pàgina d'inici"
#: noindex-seo.php:1754 noindex-seo.php:1761 noindex-seo.php:1773 noindex-seo.php:1779 noindex-seo.php:1786 noindex-seo.php:1792 noindex-seo.php:1803 noindex-seo.php:1809 noindex-seo.php:1820 noindex-seo.php:1826 noindex-seo.php:1832 noindex-seo.php:1838 noindex-seo.php:1844 noindex-seo.php:1855 noindex-seo.php:1861 noindex-seo.php:1867 noindex-seo.php:1878 noindex-seo.php:1889 noindex-seo.php:1900 noindex-seo.php:1911 noindex-seo.php:1917 noindex-seo.php:1928 noindex-seo.php:2136
msgid "Recommended"
msgstr "Recomanat"
#: noindex-seo.php:1756
msgid "Block the indexing of the site's front page."
msgstr "Bloqueja la indexació de la pàgina d'inici del lloc."
#: noindex-seo.php:1760
msgid "Home"
msgstr "Inici"
#: noindex-seo.php:1763
msgid "Block the indexing of the site's home page."
msgstr "Bloqueja la indexació de la pàgina principal del lloc."
#: noindex-seo.php:1769
msgid "Pages and Posts"
msgstr "Pàgines i entrades"
#: noindex-seo.php:1772
msgid "Page"
msgstr "Pàgina"
#: noindex-seo.php:1775
msgid "Block the indexing of site pages."
msgstr "Bloqueja la indexació de les pàgines del lloc."
#: noindex-seo.php:1778
msgid "Privacy Policy"
msgstr "Política de privadesa"
#: noindex-seo.php:1781
msgid "Block the indexing of the privacy policy page."
msgstr "Bloqueja la indexació de la pàgina de política de privadesa."
#: noindex-seo.php:1785
msgid "Single Post"
msgstr "Entrada individual"
#: noindex-seo.php:1788
msgid "Block the indexing of individual posts."
msgstr "Bloqueja la indexació d'entrades individuals."
#: noindex-seo.php:1791
msgid "Singular"
msgstr "Singular"
#: noindex-seo.php:1794
msgid "Block the indexing of any singular content (post or page)."
msgstr "Bloqueja la indexació de qualsevol contingut singular (entrada o pàgina)."
#: noindex-seo.php:1799
msgid "Taxonomies"
msgstr "Taxonomies"
#: noindex-seo.php:1802
msgid "Category"
msgstr "Categoria"
#: noindex-seo.php:1805
msgid "Block the indexing of category archive pages."
msgstr "Bloqueja la indexació de les pàgines d'arxiu de categories."
#: noindex-seo.php:1808
msgid "Tag"
msgstr "Etiqueta"
#: noindex-seo.php:1811
msgid "Block the indexing of tag archive pages."
msgstr "Bloqueja la indexació de les pàgines d'arxiu d'etiquetes."
#: noindex-seo.php:1816
msgid "Date Archives"
msgstr "Arxius de data"
#: noindex-seo.php:1819
msgid "Date"
msgstr "Data"
#: noindex-seo.php:1822
msgid "Block the indexing of any date-based archive page."
msgstr "Bloqueja la indexació de qualsevol pàgina d'arxiu basada en data."
#: noindex-seo.php:1825
msgid "Day"
msgstr "Dia"
#: noindex-seo.php:1828
msgid "Block the indexing of daily archive pages."
msgstr "Bloqueja la indexació d'arxius diaris."
#: noindex-seo.php:1831
msgid "Month"
msgstr "Mes"
#: noindex-seo.php:1834
msgid "Block the indexing of monthly archive pages."
msgstr "Bloqueja la indexació d'arxius mensuals."
#: noindex-seo.php:1837
msgid "Time"
msgstr "Hora"
#: noindex-seo.php:1840
msgid "Block the indexing of time-based archive pages."
msgstr "Bloqueja la indexació d'arxius basats en hora."
#: noindex-seo.php:1843
msgid "Year"
msgstr "Any"
#: noindex-seo.php:1846
msgid "Block the indexing of yearly archive pages."
msgstr "Bloqueja la indexació d'arxius anuals."
#: noindex-seo.php:1851
msgid "Archives"
msgstr "Arxius"
#: noindex-seo.php:1854
msgid "Archive"
msgstr "Arxiu"
#: noindex-seo.php:1857
msgid "Block the indexing of any type of archive page."
msgstr "Bloqueja la indexació de qualsevol tipus de pàgina d'arxiu."
#: noindex-seo.php:1860
msgid "Author"
msgstr "Autor"
#: noindex-seo.php:1863
msgid "Block the indexing of author archive pages."
msgstr "Bloqueja la indexació de les pàgines d'arxiu d'autor."
#: noindex-seo.php:1866
msgid "Post Type Archive"
msgstr "Arxiu de tipus de contingut"
#: noindex-seo.php:1869
msgid "Block the indexing of post type archive pages."
msgstr "Bloqueja la indexació de les pàgines d'arxiu de tipus de contingut."
#: noindex-seo.php:1874
msgid "Pagination"
msgstr "Paginació"
#: noindex-seo.php:1877
msgid "Paginated Pages"
msgstr "Pàgines paginades"
#: noindex-seo.php:1880
msgid "Block the indexing of pagination pages (page 2, 3, etc.)."
msgstr "Bloqueja la indexació de les pàgines de paginació (pàgina 2, 3, etc.)."
#: noindex-seo.php:1885
msgid "Search"
msgstr "Cerca"
#: noindex-seo.php:1888
msgid "Search Results"
msgstr "Resultats de cerca"
#: noindex-seo.php:1891
msgid "Block the indexing of search result pages."
msgstr "Bloqueja la indexació de les pàgines de resultats de cerca."
#: noindex-seo.php:1896
msgid "Attachments"
msgstr "Adjunts"
#: noindex-seo.php:1899
msgid "Attachment Pages"
msgstr "Pàgines d'adjunts"
#: noindex-seo.php:1902
msgid "Block the indexing of attachment pages (does not affect the file itself)."
msgstr "Bloqueja la indexació de les pàgines d'adjunts (no afecta el fitxer en si)."
#: noindex-seo.php:1907
msgid "Previews"
msgstr "Previsualitzacions"
#: noindex-seo.php:1910
msgid "Customize Preview"
msgstr "Previsualització del personalitzador"
#: noindex-seo.php:1913
msgid "Block the indexing when content is in customize preview mode."
msgstr "Bloqueja la indexació quan el contingut és en mode de previsualització del personalitzador."
#: noindex-seo.php:1916
msgid "Post Preview"
msgstr "Previsualització de l'entrada"
#: noindex-seo.php:1919
msgid "Block the indexing when viewing post previews."
msgstr "Bloqueja la indexació en veure previsualitzacions d'entrades."
#: noindex-seo.php:1924
msgid "Error Pages"
msgstr "Pàgines d'error"
#: noindex-seo.php:1927
msgid "Error 404"
msgstr "Error 404"
#: noindex-seo.php:1930
msgid "Block the indexing of 404 error pages."
msgstr "Bloqueja la indexació de les pàgines d'error 404."
#: noindex-seo.php:1953 assets/js/editor-sidebar.js:142
msgid "noindex"
msgstr "noindex"
#: noindex-seo.php:1954
msgid "Prevent search engines from indexing this page"
msgstr "Evita que els cercadors indexin aquesta pàgina"
#: noindex-seo.php:1958 assets/js/editor-sidebar.js:157
msgid "nofollow"
msgstr "nofollow"
#: noindex-seo.php:1959
msgid "Prevent search engines from following links on this page"
msgstr "Evita que els cercadors segueixin els enllaços en aquesta pàgina"
#: noindex-seo.php:1963 assets/js/editor-sidebar.js:172
msgid "noarchive"
msgstr "noarchive"
#: noindex-seo.php:1964
msgid "Prevent search engines from showing a cached version"
msgstr "Evita que els cercadors mostrin una versió en memòria cau"
#: noindex-seo.php:1968 assets/js/editor-sidebar.js:187
msgid "nosnippet"
msgstr "nosnippet"
#: noindex-seo.php:1969
msgid "Prevent search engines from showing text snippets"
msgstr "Evita que els cercadors mostrin fragments de text"
#: noindex-seo.php:1973 assets/js/editor-sidebar.js:202
msgid "noimageindex"
msgstr "noimageindex"
#: noindex-seo.php:1974
msgid "Prevent search engines from indexing images"
msgstr "Evita que els cercadors indexin imatges"
#: noindex-seo.php:1981
msgid "noindex SEO Settings"
msgstr "Ajustaments de noindex SEO"
#: noindex-seo.php:1982
msgid "Control how search engines index and display your WordPress content using robots directives."
msgstr "Controla com els cercadors indexen i mostren el vostre contingut de WordPress fent servir directrius robots."
#: noindex-seo.php:1992
msgid "Total Options"
msgstr "Opcions totals"
#: noindex-seo.php:1996
msgid "Enabled"
msgstr "Activades"
#: noindex-seo.php:2000
msgid "Recommended to Enable"
msgstr "Recomanades per a activar"
#: noindex-seo.php:2008
msgid "General Configuration"
msgstr "Configuració general"
#: noindex-seo.php:2022
msgid "Disable compatibility warnings with other SEO plugins"
msgstr "Desactiva els avisos de compatibilitat amb altres complements de SEO"
#: noindex-seo.php:2029
msgid "Implementation Method"
msgstr "Mètode d'implementació"
#: noindex-seo.php:2037
msgid "HTML Meta Tags (default, easier to verify)"
msgstr "Etiquetes meta HTML (per defecte, més fàcil de comprovar)"
#: noindex-seo.php:2040
msgid "HTTP Headers (more robust, works with PDFs/images)"
msgstr "Capçaleres HTTP (més robust, funciona amb PDFs/imatges)"
#: noindex-seo.php:2043
msgid "Both (maximum compatibility)"
msgstr "Ambdós (màxima compatibilitat)"
#: noindex-seo.php:2047
msgid "Choose how noindex directives are sent to search engines. Meta tags work for HTML pages. HTTP headers work for all content types including PDFs, images, and feeds."
msgstr ""
"Trieu com s'envien les directrius noindex als cercadors. Les etiquetes meta funcionen "
"per a pàgines HTML. Les capçaleres HTTP funcionen per a tots els tipus de contingut, "
"incloent-hi PDFs, imatges i feeds."
#: noindex-seo.php:2065
msgid "Enable per-post/page granular control"
msgstr "Activa el control granular per entrada/pàgina"
#: noindex-seo.php:2068
msgid "When enabled, a meta box will appear in the post/page editor allowing you to override global settings for individual content. Useful for specific pages that need different robots directives."
msgstr ""
"En activar-se, apareixerà una meta box a l'editor d'entrades/pàgines que us permet "
"sobreescriure els ajustaments globals per a contingut individual. Útil per a pàgines "
"específiques que necessiten directrius robots diferents."
#: noindex-seo.php:2086
msgid "Delete all plugin data on uninstall"
msgstr "Suprimeix totes les dades del complement en desinstal·lar"
#: noindex-seo.php:2089
msgid "When enabled, all settings and per-post robots directives will be permanently deleted when the plugin is uninstalled. By default data is preserved."
msgstr ""
"En activar-se, tots els ajustaments i les directrius robots per entrada se suprimiran "
"de forma permanent en desinstal·lar el complement. Per defecte, les dades es conserven."
#: noindex-seo.php:2098
msgid "Important: Enabling noindex on the wrong pages can harm your search engine rankings. Only enable options you fully understand."
msgstr ""
"Important: Activar noindex a les pàgines equivocades pot perjudicar el vostre "
"posicionament als cercadors. Activeu només les opcions que enteneu completament."
#: noindex-seo.php:2105
msgid "Search options..."
msgstr "Cerca opcions…"
#: noindex-seo.php:2106
msgid "Search options"
msgstr "Cerca opcions"
#: noindex-seo.php:2129
msgid "This option only works with HTTP Headers implementation method"
msgstr "Aquesta opció només funciona amb el mètode d'implementació de capçaleres HTTP"
#: noindex-seo.php:2138
msgid "Not Recommended"
msgstr "No recomanat"
#: noindex-seo.php:2143
msgid "View Page"
msgstr "Mostra la pàgina"
#: assets/js/editor-sidebar.js:103
msgid "Enable to set custom robots directives for this content"
msgstr "Activeu per a establir directrius robots personalitzades per a aquest contingut"
#: assets/js/editor-sidebar.js:133
msgid "Robots Directives:"
msgstr "Directrius robots:"
#: assets/js/editor-sidebar.js:143
msgid "Prevent search engines from indexing"
msgstr "Evita que els cercadors indexin"
#: assets/js/editor-sidebar.js:158
msgid "Prevent search engines from following links"
msgstr "Evita que els cercadors segueixin els enllaços"
#: assets/js/editor-sidebar.js:173
msgid "Prevent cached versions in search results"
msgstr "Evita versions en memòria cau als resultats de cerca"
#: assets/js/editor-sidebar.js:188
msgid "Prevent text snippets in search results"
msgstr "Evita fragments de text als resultats de cerca"
#: assets/js/editor-sidebar.js:237
msgid "Active Directives:"
msgstr "Directrius actives:"

Binary file not shown.

View file

@ -0,0 +1,583 @@
# Translation of noindex SEO into Spanish (Spain).
# Copyright (C) 2026 ROBOTSTXT
# This file is distributed under the GPL-3.0-or-later license.
msgid ""
msgstr ""
"Project-Id-Version: noindex SEO 2.0.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/noindex-seo\n"
"POT-Creation-Date: 2026-07-18T14:48:42+00:00\n"
"PO-Revision-Date: 2026-07-18T14:50+00:00\n"
"Last-Translator: ROBOTSTXT <https://www.robotstxt.es/>\n"
"Language-Team: Spanish (Spain) — https://translate.wordpress.org/locale/es/default/\n"
"Language: es_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: manual translation per AGENTS-translation-es.md\n"
"X-Domain: noindex-seo\n"
#. Plugin Name of the plugin
#: noindex-seo.php noindex-seo.php:509 noindex-seo.php:510
msgid "noindex SEO"
msgstr "noindex SEO"
#. Plugin URI of the plugin
#: noindex-seo.php
msgid "https://wordpress.org/plugins/noindex-seo/"
msgstr "https://wordpress.org/plugins/noindex-seo/"
#. Description of the plugin
#: noindex-seo.php
msgid "Control search engine indexing with robots directives (noindex, nofollow, noarchive, nosnippet, noimageindex) for specific parts of your WordPress site."
msgstr "Controla la indexación en buscadores con directivas robots (noindex, nofollow, noarchive, nosnippet, noimageindex) para partes específicas de tu sitio WordPress."
#. Author of the plugin
#: noindex-seo.php
msgid "ROBOTSTXT"
msgstr "ROBOTSTXT"
#. Author URI of the plugin
#: noindex-seo.php
msgid "https://www.robotstxt.es/"
msgstr "https://www.robotstxt.es/"
#: noindex-seo.php:418
msgid "Settings saved successfully!"
msgstr "¡Ajustes guardados correctamente!"
#: noindex-seo.php:419
msgid "Expand All"
msgstr "Expandir todo"
#: noindex-seo.php:420
msgid "Collapse All"
msgstr "Contraer todo"
#: noindex-seo.php:489
msgid "Settings"
msgstr "Ajustes"
#. translators: plugin name.
#: noindex-seo.php:718
#, php-format
msgid "noindex SEO has detected that %s is active. This may cause conflicts. Please configure the options accordingly."
msgstr "noindex SEO ha detectado que %s está activo. Esto puede causar conflictos. Configura las opciones en consecuencia."
#: noindex-seo.php:748
msgid "Permission denied or invalid nonce."
msgstr "Permiso denegado o nonce no válido."
#: noindex-seo.php:914 assets/js/editor-sidebar.js:91
msgid "Search Engine Visibility"
msgstr "Visibilidad en buscadores"
#: noindex-seo.php:967 noindex-seo.php:1308 assets/js/editor-sidebar.js:102
msgid "Override global settings"
msgstr "Sobrescribir ajustes globales"
#: noindex-seo.php:972
msgid "When enabled, these directives will override the global settings for this specific content."
msgstr "Al activarse, estas directivas sobrescribirán los ajustes globales para este contenido específico."
#: noindex-seo.php:979
msgid "Prevent indexing"
msgstr "Evitar indexación"
#: noindex-seo.php:984
msgid "Prevent link following"
msgstr "Evitar seguimiento de enlaces"
#: noindex-seo.php:989
msgid "Prevent caching"
msgstr "Evitar caché"
#: noindex-seo.php:994
msgid "Prevent snippets"
msgstr "Evitar snippets"
#: noindex-seo.php:999 assets/js/editor-sidebar.js:203
msgid "Prevent image indexing"
msgstr "Evitar indexación de imágenes"
#: noindex-seo.php:1007
msgid "Effective Directives:"
msgstr "Directivas efectivas:"
#: noindex-seo.php:1032
msgid "Override active:"
msgstr "Sobrescritura activa:"
#: noindex-seo.php:1037
msgid "Override enabled but no directives selected"
msgstr "Sobrescritura activada pero sin directivas seleccionadas"
#: noindex-seo.php:1043
msgid "Global settings:"
msgstr "Ajustes globales:"
#: noindex-seo.php:1048
msgid "No restrictions (indexable)"
msgstr "Sin restricciones (indexable)"
#: noindex-seo.php:1165 noindex-seo.php:1171
msgid "Robots"
msgstr "Robots"
#: noindex-seo.php:1232
msgid "Override (none)"
msgstr "Sobrescritura (ninguna)"
#: noindex-seo.php:1304
msgid "Robots Directives"
msgstr "Directivas Robots"
#: noindex-seo.php:1313
msgid "🔍 noindex"
msgstr "🔍 noindex"
#: noindex-seo.php:1317
msgid "🔗 nofollow"
msgstr "🔗 nofollow"
#: noindex-seo.php:1321
msgid "💾 noarchive"
msgstr "💾 noarchive"
#: noindex-seo.php:1325
msgid "📄 nosnippet"
msgstr "📄 nosnippet"
#: noindex-seo.php:1329
msgid "🖼️ noimageindex"
msgstr "🖼️ noimageindex"
#: noindex-seo.php:1440
msgid "Enable Robots Override"
msgstr "Activar sobrescritura Robots"
#: noindex-seo.php:1441
msgid "Disable Robots Override"
msgstr "Desactivar sobrescritura Robots"
#. translators: %d: Number of posts updated
#: noindex-seo.php:1538
#, php-format
msgid "Robots override enabled for %d post."
msgid_plural "Robots override enabled for %d posts."
msgstr[0] "Sobrescritura Robots activada para %d entrada."
msgstr[1] "Sobrescritura Robots activada para %d entradas."
#. translators: %d: Number of posts updated
#: noindex-seo.php:1559
#, php-format
msgid "Robots override disabled for %d post."
msgid_plural "Robots override disabled for %d posts."
msgstr[0] "Sobrescritura Robots desactivada para %d entrada."
msgstr[1] "Sobrescritura Robots desactivada para %d entradas."
#: noindex-seo.php:1608
msgid "All robots settings"
msgstr "Todos los ajustes robots"
#: noindex-seo.php:1610
msgid "With override"
msgstr "Con sobrescritura"
#: noindex-seo.php:1613
msgid "Without override"
msgstr "Sin sobrescritura"
#: noindex-seo.php:1727
msgid "You do not have sufficient permissions to access this page."
msgstr "No tienes permisos suficientes para acceder a esta página."
#: noindex-seo.php:1728
msgid "Permission Denied"
msgstr "Permiso denegado"
#: noindex-seo.php:1750
msgid "Main Pages"
msgstr "Páginas principales"
#: noindex-seo.php:1753
msgid "Front Page"
msgstr "Página de inicio"
#: noindex-seo.php:1754 noindex-seo.php:1761 noindex-seo.php:1773 noindex-seo.php:1779 noindex-seo.php:1786 noindex-seo.php:1792 noindex-seo.php:1803 noindex-seo.php:1809 noindex-seo.php:1820 noindex-seo.php:1826 noindex-seo.php:1832 noindex-seo.php:1838 noindex-seo.php:1844 noindex-seo.php:1855 noindex-seo.php:1861 noindex-seo.php:1867 noindex-seo.php:1878 noindex-seo.php:1889 noindex-seo.php:1900 noindex-seo.php:1911 noindex-seo.php:1917 noindex-seo.php:1928 noindex-seo.php:2136
msgid "Recommended"
msgstr "Recomendado"
#: noindex-seo.php:1756
msgid "Block the indexing of the site's front page."
msgstr "Bloquear la indexación de la página de inicio del sitio."
#: noindex-seo.php:1760
msgid "Home"
msgstr "Inicio"
#: noindex-seo.php:1763
msgid "Block the indexing of the site's home page."
msgstr "Bloquear la indexación de la página principal del sitio."
#: noindex-seo.php:1769
msgid "Pages and Posts"
msgstr "Páginas y entradas"
#: noindex-seo.php:1772
msgid "Page"
msgstr "Página"
#: noindex-seo.php:1775
msgid "Block the indexing of site pages."
msgstr "Bloquear la indexación de las páginas del sitio."
#: noindex-seo.php:1778
msgid "Privacy Policy"
msgstr "Política de privacidad"
#: noindex-seo.php:1781
msgid "Block the indexing of the privacy policy page."
msgstr "Bloquear la indexación de la página de política de privacidad."
#: noindex-seo.php:1785
msgid "Single Post"
msgstr "Entrada individual"
#: noindex-seo.php:1788
msgid "Block the indexing of individual posts."
msgstr "Bloquear la indexación de entradas individuales."
#: noindex-seo.php:1791
msgid "Singular"
msgstr "Singular"
#: noindex-seo.php:1794
msgid "Block the indexing of any singular content (post or page)."
msgstr "Bloquear la indexación de cualquier contenido singular (entrada o página)."
#: noindex-seo.php:1799
msgid "Taxonomies"
msgstr "Taxonomías"
#: noindex-seo.php:1802
msgid "Category"
msgstr "Categoría"
#: noindex-seo.php:1805
msgid "Block the indexing of category archive pages."
msgstr "Bloquear la indexación de las páginas de archivo de categorías."
#: noindex-seo.php:1808
msgid "Tag"
msgstr "Etiqueta"
#: noindex-seo.php:1811
msgid "Block the indexing of tag archive pages."
msgstr "Bloquear la indexación de las páginas de archivo de etiquetas."
#: noindex-seo.php:1816
msgid "Date Archives"
msgstr "Archivos de fecha"
#: noindex-seo.php:1819
msgid "Date"
msgstr "Fecha"
#: noindex-seo.php:1822
msgid "Block the indexing of any date-based archive page."
msgstr "Bloquear la indexación de cualquier página de archivo basada en fecha."
#: noindex-seo.php:1825
msgid "Day"
msgstr "Día"
#: noindex-seo.php:1828
msgid "Block the indexing of daily archive pages."
msgstr "Bloquear la indexación de archivos diarios."
#: noindex-seo.php:1831
msgid "Month"
msgstr "Mes"
#: noindex-seo.php:1834
msgid "Block the indexing of monthly archive pages."
msgstr "Bloquear la indexación de archivos mensuales."
#: noindex-seo.php:1837
msgid "Time"
msgstr "Hora"
#: noindex-seo.php:1840
msgid "Block the indexing of time-based archive pages."
msgstr "Bloquear la indexación de archivos basados en hora."
#: noindex-seo.php:1843
msgid "Year"
msgstr "Año"
#: noindex-seo.php:1846
msgid "Block the indexing of yearly archive pages."
msgstr "Bloquear la indexación de archivos anuales."
#: noindex-seo.php:1851
msgid "Archives"
msgstr "Archivos"
#: noindex-seo.php:1854
msgid "Archive"
msgstr "Archivo"
#: noindex-seo.php:1857
msgid "Block the indexing of any type of archive page."
msgstr "Bloquear la indexación de cualquier tipo de página de archivo."
#: noindex-seo.php:1860
msgid "Author"
msgstr "Autor"
#: noindex-seo.php:1863
msgid "Block the indexing of author archive pages."
msgstr "Bloquear la indexación de las páginas de archivo de autor."
#: noindex-seo.php:1866
msgid "Post Type Archive"
msgstr "Archivo de tipo de contenido"
#: noindex-seo.php:1869
msgid "Block the indexing of post type archive pages."
msgstr "Bloquear la indexación de las páginas de archivo de tipos de contenido."
#: noindex-seo.php:1874
msgid "Pagination"
msgstr "Paginación"
#: noindex-seo.php:1877
msgid "Paginated Pages"
msgstr "Páginas paginadas"
#: noindex-seo.php:1880
msgid "Block the indexing of pagination pages (page 2, 3, etc.)."
msgstr "Bloquear la indexación de las páginas de paginación (página 2, 3, etc.)."
#: noindex-seo.php:1885
msgid "Search"
msgstr "Buscar"
#: noindex-seo.php:1888
msgid "Search Results"
msgstr "Resultados de búsqueda"
#: noindex-seo.php:1891
msgid "Block the indexing of search result pages."
msgstr "Bloquear la indexación de las páginas de resultados de búsqueda."
#: noindex-seo.php:1896
msgid "Attachments"
msgstr "Adjuntos"
#: noindex-seo.php:1899
msgid "Attachment Pages"
msgstr "Páginas de adjuntos"
#: noindex-seo.php:1902
msgid "Block the indexing of attachment pages (does not affect the file itself)."
msgstr "Bloquear la indexación de las páginas de adjuntos (no afecta al archivo en sí)."
#: noindex-seo.php:1907
msgid "Previews"
msgstr "Vistas previas"
#: noindex-seo.php:1910
msgid "Customize Preview"
msgstr "Vista previa del personalizador"
#: noindex-seo.php:1913
msgid "Block the indexing when content is in customize preview mode."
msgstr "Bloquear la indexación cuando el contenido está en modo de vista previa del personalizador."
#: noindex-seo.php:1916
msgid "Post Preview"
msgstr "Vista previa de entrada"
#: noindex-seo.php:1919
msgid "Block the indexing when viewing post previews."
msgstr "Bloquear la indexación al ver vistas previas de entradas."
#: noindex-seo.php:1924
msgid "Error Pages"
msgstr "Páginas de error"
#: noindex-seo.php:1927
msgid "Error 404"
msgstr "Error 404"
#: noindex-seo.php:1930
msgid "Block the indexing of 404 error pages."
msgstr "Bloquear la indexación de las páginas de error 404."
#: noindex-seo.php:1953 assets/js/editor-sidebar.js:142
msgid "noindex"
msgstr "noindex"
#: noindex-seo.php:1954
msgid "Prevent search engines from indexing this page"
msgstr "Evitar que los buscadores indexen esta página"
#: noindex-seo.php:1958 assets/js/editor-sidebar.js:157
msgid "nofollow"
msgstr "nofollow"
#: noindex-seo.php:1959
msgid "Prevent search engines from following links on this page"
msgstr "Evitar que los buscadores sigan los enlaces en esta página"
#: noindex-seo.php:1963 assets/js/editor-sidebar.js:172
msgid "noarchive"
msgstr "noarchive"
#: noindex-seo.php:1964
msgid "Prevent search engines from showing a cached version"
msgstr "Evitar que los buscadores muestren una versión en caché"
#: noindex-seo.php:1968 assets/js/editor-sidebar.js:187
msgid "nosnippet"
msgstr "nosnippet"
#: noindex-seo.php:1969
msgid "Prevent search engines from showing text snippets"
msgstr "Evitar que los buscadores muestren fragmentos de texto"
#: noindex-seo.php:1973 assets/js/editor-sidebar.js:202
msgid "noimageindex"
msgstr "noimageindex"
#: noindex-seo.php:1974
msgid "Prevent search engines from indexing images"
msgstr "Evitar que los buscadores indexen imágenes"
#: noindex-seo.php:1981
msgid "noindex SEO Settings"
msgstr "Ajustes de noindex SEO"
#: noindex-seo.php:1982
msgid "Control how search engines index and display your WordPress content using robots directives."
msgstr "Controla cómo los buscadores indexan y muestran tu contenido de WordPress usando directivas robots."
#: noindex-seo.php:1992
msgid "Total Options"
msgstr "Opciones totales"
#: noindex-seo.php:1996
msgid "Enabled"
msgstr "Activadas"
#: noindex-seo.php:2000
msgid "Recommended to Enable"
msgstr "Recomendadas para activar"
#: noindex-seo.php:2008
msgid "General Configuration"
msgstr "Configuración general"
#: noindex-seo.php:2022
msgid "Disable compatibility warnings with other SEO plugins"
msgstr "Desactivar avisos de compatibilidad con otros plugins de SEO"
#: noindex-seo.php:2029
msgid "Implementation Method"
msgstr "Método de implementación"
#: noindex-seo.php:2037
msgid "HTML Meta Tags (default, easier to verify)"
msgstr "Etiquetas meta HTML (predeterminado, más fácil de verificar)"
#: noindex-seo.php:2040
msgid "HTTP Headers (more robust, works with PDFs/images)"
msgstr "Cabeceras HTTP (más robusto, funciona con PDFs/imágenes)"
#: noindex-seo.php:2043
msgid "Both (maximum compatibility)"
msgstr "Ambos (máxima compatibilidad)"
#: noindex-seo.php:2047
msgid "Choose how noindex directives are sent to search engines. Meta tags work for HTML pages. HTTP headers work for all content types including PDFs, images, and feeds."
msgstr ""
"Elige cómo se envían las directivas noindex a los buscadores. Las etiquetas meta "
"funcionan para páginas HTML. Las cabeceras HTTP funcionan para todos los tipos de "
"contenido, incluidos PDFs, imágenes y feeds."
#: noindex-seo.php:2065
msgid "Enable per-post/page granular control"
msgstr "Activar control granular por entrada/página"
#: noindex-seo.php:2068
msgid "When enabled, a meta box will appear in the post/page editor allowing you to override global settings for individual content. Useful for specific pages that need different robots directives."
msgstr ""
"Al activarse, aparecerá una meta box en el editor de entradas/páginas que te permite "
"sobrescribir los ajustes globales para contenido individual. Útil para páginas "
"específicas que necesitan directivas robots diferentes."
#: noindex-seo.php:2086
msgid "Delete all plugin data on uninstall"
msgstr "Borrar todos los datos del plugin al desinstalar"
#: noindex-seo.php:2089
msgid "When enabled, all settings and per-post robots directives will be permanently deleted when the plugin is uninstalled. By default data is preserved."
msgstr ""
"Al activarse, todos los ajustes y las directivas robots por entrada se borrarán de "
"forma permanente al desinstalar el plugin. Por defecto, los datos se conservan."
#: noindex-seo.php:2098
msgid "Important: Enabling noindex on the wrong pages can harm your search engine rankings. Only enable options you fully understand."
msgstr ""
"Importante: Activar noindex en las páginas equivocadas puede perjudicar tu "
"posicionamiento en buscadores. Activa solo las opciones que entiendas completamente."
#: noindex-seo.php:2105
msgid "Search options..."
msgstr "Buscar opciones…"
#: noindex-seo.php:2106
msgid "Search options"
msgstr "Buscar opciones"
#: noindex-seo.php:2129
msgid "This option only works with HTTP Headers implementation method"
msgstr "Esta opción solo funciona con el método de implementación de cabeceras HTTP"
#: noindex-seo.php:2138
msgid "Not Recommended"
msgstr "No recomendado"
#: noindex-seo.php:2143
msgid "View Page"
msgstr "Ver página"
#: assets/js/editor-sidebar.js:103
msgid "Enable to set custom robots directives for this content"
msgstr "Activa para establecer directivas robots personalizadas para este contenido"
#: assets/js/editor-sidebar.js:133
msgid "Robots Directives:"
msgstr "Directivas robots:"
#: assets/js/editor-sidebar.js:143
msgid "Prevent search engines from indexing"
msgstr "Evitar que los buscadores indexen"
#: assets/js/editor-sidebar.js:158
msgid "Prevent search engines from following links"
msgstr "Evitar que los buscadores sigan los enlaces"
#: assets/js/editor-sidebar.js:173
msgid "Prevent cached versions in search results"
msgstr "Evitar versiones en caché en los resultados de búsqueda"
#: assets/js/editor-sidebar.js:188
msgid "Prevent text snippets in search results"
msgstr "Evitar fragmentos de texto en los resultados de búsqueda"
#: assets/js/editor-sidebar.js:237
msgid "Active Directives:"
msgstr "Directivas activas:"

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@
* Description: Control search engine indexing with robots directives (noindex, nofollow, noarchive, nosnippet, noimageindex) for specific parts of your WordPress site. * Description: Control search engine indexing with robots directives (noindex, nofollow, noarchive, nosnippet, noimageindex) for specific parts of your WordPress site.
* Requires at least: 5.7 * Requires at least: 5.7
* Requires PHP: 7.2 * Requires PHP: 7.2
* Version: 2.0.1 * Version: 2.0.2
* Author: ROBOTSTXT * Author: ROBOTSTXT
* Author URI: https://www.robotstxt.es/ * Author URI: https://www.robotstxt.es/
* License: GPL-3.0-or-later * License: GPL-3.0-or-later
@ -24,8 +24,9 @@ defined( 'ABSPATH' ) || die( 'Bye bye!' );
* Plugin version constant. Used for asset cache-busting and internal version checks. * Plugin version constant. Used for asset cache-busting and internal version checks.
* *
* @since 2.0.1 * @since 2.0.1
* @since 2.0.2 Bumped to 2.0.2 for bulk-action postmeta fix and dead-context cleanup.
*/ */
define( 'NOINDEX_SEO_VERSION', '2.0.1' ); define( 'NOINDEX_SEO_VERSION', '2.0.2' );
/** /**
* Outputs robots directives using the configured implementation method. * Outputs robots directives using the configured implementation method.
@ -343,33 +344,7 @@ function noindex_seo_check_migration(): void {
* @return void * @return void
*/ */
function noindex_seo_migrate_to_v2(): void { function noindex_seo_migrate_to_v2(): void {
$contexts = array( $contexts = noindex_seo_get_contexts();
'error',
'archive',
'attachment',
'author',
'category',
'comment_feed',
'customize_preview',
'date',
'day',
'feed',
'front_page',
'home',
'month',
'page',
'paged',
'post_type_archive',
'preview',
'privacy_policy',
'robots',
'search',
'single',
'singular',
'tag',
'time',
'year',
);
$new_directives = array( 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' ); $new_directives = array( 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );
@ -539,6 +514,50 @@ function noindex_seo_menu(): void {
); );
} }
/**
* Returns the canonical list of page contexts recognised by the plugin.
*
* Single source of truth for the contexts that the plugin registers options for,
* migrates, processes from form submissions, and cleans up on uninstall.
*
* The list is intentionally a flat indexed array of slugs; the per-context page
* detection map lives separately in {@see noindex_seo_show()} (where it can be
* filtered via the `noindex_seo_contexts` filter).
*
* Note: `uninstall.php` cannot call this function (the main plugin file is not
* loaded during uninstall), so it keeps its own copy in sync.
*
* @since 2.0.2
*
* @return array<int, string> List of context slugs.
*/
function noindex_seo_get_contexts(): array {
return array(
'archive',
'attachment',
'author',
'category',
'customize_preview',
'date',
'day',
'front_page',
'home',
'month',
'page',
'paged',
'post_type_archive',
'preview',
'privacy_policy',
'search',
'single',
'singular',
'tag',
'time',
'year',
'error',
);
}
/** /**
* Registers all settings used by the 'noindex SEO' plugin. * Registers all settings used by the 'noindex SEO' plugin.
* *
@ -553,41 +572,16 @@ function noindex_seo_menu(): void {
* WordPress Settings API when the options form is submitted. * WordPress Settings API when the options form is submitted.
* *
* Also registers the general configuration options. * Also registers the general configuration options.
* A transient cache is cleared upon update using the {@see 'update_option_noindexseo'} action. * The transient cache is cleared inside noindex_seo_process_form() after every successful form save.
* *
* @since 1.0.0 * @since 1.0.0
* @since 2.0.0 Added support for multiple directives per context. * @since 2.0.0 Added support for multiple directives per context.
* @since 2.0.2 Removed dead `update_option_noindexseo` reference (the hook never fired).
* *
* @return void * @return void
*/ */
function noindex_seo_register(): void { function noindex_seo_register(): void {
$contexts = array( $contexts = noindex_seo_get_contexts();
'error',
'archive',
'attachment',
'author',
'category',
'comment_feed',
'customize_preview',
'date',
'day',
'feed',
'front_page',
'home',
'month',
'page',
'paged',
'post_type_archive',
'preview',
'privacy_policy',
'robots',
'search',
'single',
'singular',
'tag',
'time',
'year',
);
$directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' ); $directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );
@ -650,26 +644,25 @@ function noindex_seo_register(): void {
} }
/** /**
* Clears the cached plugin settings stored in the transient. * Deprecated: clears the cached plugin settings stored in the transient.
* *
* This function deletes the 'noindex_seo_options' transient to ensure that updated * Was previously hooked to `update_option_noindexseo`, a hook that never fires
* option values are fetched fresh from the database on the next request. It is typically * because `noindexseo` is the Settings API group name, not an option name. The
* triggered after the plugin settings are updated to prevent stale data from being used. * transient is now cleared directly inside {@see noindex_seo_process_form()}
* after every successful form save.
* *
* Hooked to the {@see 'update_option_noindexseo'} action. * Kept as a deprecation shim for one release cycle in case third-party code
* called the function directly.
* *
* @since 1.0.0 * @since 1.0.0
* @since 2.0.0 Added admin context verification for security. * @since 2.0.2 Deprecated; no longer hooked by the plugin. Callers should
* delete the `noindex_seo_options` transient directly via
* `delete_transient( 'noindex_seo_options' )`.
* *
* @return void * @return void
*/ */
function noindex_seo_clear_transient(): void { function noindex_seo_clear_transient(): void {
// Verify we're in a valid admin context.. _deprecated_function( __FUNCTION__, '2.0.2', 'delete_transient( \'noindex_seo_options\' )' );
if ( ! is_admin() && ! wp_doing_ajax() ) {
return;
}
// Delete the transient cache..
delete_transient( 'noindex_seo_options' ); delete_transient( 'noindex_seo_options' );
} }
@ -755,33 +748,7 @@ function noindex_seo_process_form(): void {
wp_die( esc_html__( 'Permission denied or invalid nonce.', 'noindex-seo' ) ); wp_die( esc_html__( 'Permission denied or invalid nonce.', 'noindex-seo' ) );
} }
$contexts = array( $contexts = noindex_seo_get_contexts();
'error',
'archive',
'attachment',
'author',
'category',
'comment_feed',
'customize_preview',
'date',
'day',
'feed',
'front_page',
'home',
'month',
'page',
'paged',
'post_type_archive',
'preview',
'privacy_policy',
'robots',
'search',
'single',
'singular',
'tag',
'time',
'year',
);
$directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' ); $directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );
@ -794,7 +761,7 @@ function noindex_seo_process_form(): void {
$method_value = in_array( $method_value, array( 'meta', 'header', 'both' ), true ) ? $method_value : 'meta'; $method_value = in_array( $method_value, array( 'meta', 'header', 'both' ), true ) ? $method_value : 'meta';
// Fields that only work with HTTP headers. // Fields that only work with HTTP headers.
$header_only_contexts = array( 'attachment', 'feed', 'comment_feed' ); $header_only_contexts = array( 'attachment' );
$is_header_enabled = in_array( $method_value, array( 'header', 'both' ), true ); $is_header_enabled = in_array( $method_value, array( 'header', 'both' ), true );
// Reset all options to 0 and process form data. // Reset all options to 0 and process form data.
@ -1520,59 +1487,30 @@ function noindex_seo_handle_bulk_actions( string $redirect_to, string $action, a
// Replace original post IDs with filtered list. // Replace original post IDs with filtered list.
$post_ids = $editable_post_ids; $post_ids = $editable_post_ids;
global $wpdb;
if ( 'noindex_seo_enable_override' === $action ) { if ( 'noindex_seo_enable_override' === $action ) {
// Use direct SQL for better performance with large selections. // Use update_post_meta() — the WP postmeta table has no unique key on
// phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching // (post_id, meta_key), so a raw INSERT ... ON DUPLICATE KEY UPDATE would
// Direct database queries are necessary here for performance with bulk operations. // silently create duplicate rows on every bulk run. update_post_meta()
// This is an INSERT/UPDATE operation, so caching is not applicable. // correctly handles the single-value semantics enforced by registered meta.
// Update or insert override meta for all selected posts.
foreach ( $post_ids as $post_id ) { foreach ( $post_ids as $post_id ) {
$wpdb->query( update_post_meta( $post_id, '_noindex_seo_override', 1 );
$wpdb->prepare(
"INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value) VALUES (%d, '_noindex_seo_override', '1') ON DUPLICATE KEY UPDATE meta_value = '1'",
$post_id
)
);
} }
// phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
$redirect_to = add_query_arg( 'noindex_seo_bulk_enabled', count( $post_ids ), $redirect_to ); $redirect_to = add_query_arg( 'noindex_seo_bulk_enabled', count( $post_ids ), $redirect_to );
} }
if ( 'noindex_seo_disable_override' === $action ) { if ( 'noindex_seo_disable_override' === $action ) {
// Use direct SQL for better performance with large selections. // Remove the override flag entirely and clear any directive meta so the
// post falls back to the global context settings.
// phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
// Direct database queries are necessary here for performance with bulk operations.
// This is an UPDATE/DELETE operation, so caching is not applicable.
// Update override meta to 0 for all selected posts.
$wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->postmeta} SET meta_value = '0' WHERE meta_key = '_noindex_seo_override' AND post_id IN (" . implode( ',', array_fill( 0, count( $post_ids ), '%d' ) ) . ')',
...$post_ids
)
);
// Delete all directive meta for selected posts.
$directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' ); $directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );
foreach ( $directives as $directive ) {
// Build parameter array: meta_key + post IDs. foreach ( $post_ids as $post_id ) {
$prepare_params = array_merge( delete_post_meta( $post_id, '_noindex_seo_override' );
array( '_noindex_seo_' . $directive ),
$post_ids foreach ( $directives as $directive ) {
); delete_post_meta( $post_id, '_noindex_seo_' . $directive );
$wpdb->query( }
$wpdb->prepare(
"DELETE FROM {$wpdb->postmeta} WHERE meta_key = %s AND post_id IN (" . implode( ',', array_fill( 0, count( $post_ids ), '%d' ) ) . ')',
...$prepare_params
)
);
} }
// phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
$redirect_to = add_query_arg( 'noindex_seo_bulk_disabled', count( $post_ids ), $redirect_to ); $redirect_to = add_query_arg( 'noindex_seo_bulk_disabled', count( $post_ids ), $redirect_to );
} }
@ -2006,7 +1944,7 @@ function noindex_seo_admin(): void {
$option_config_delete_on_uninstall = is_scalar( $opt_delete ) ? absint( $opt_delete ) : 0; $option_config_delete_on_uninstall = is_scalar( $opt_delete ) ? absint( $opt_delete ) : 0;
// Define fields that only work with HTTP headers (non-HTML content). // Define fields that only work with HTTP headers (non-HTML content).
$header_only_fields = array( 'attachment', 'feed', 'comment_feed' ); $header_only_fields = array( 'attachment' );
$is_header_enabled = in_array( $option_config_method, array( 'header', 'both' ), true ); $is_header_enabled = in_array( $option_config_method, array( 'header', 'both' ), true );
// Define available directives with config. // Define available directives with config.

View file

@ -3,9 +3,9 @@ Contributors: javiercasares
Tags: seo, noindex, nofollow, noarchive, robots Tags: seo, noindex, nofollow, noarchive, robots
Requires at least: 5.7 Requires at least: 5.7
Tested up to: 7.1 Tested up to: 7.1
Stable tag: 2.0.1 Stable tag: 2.0.2
Requires PHP: 7.2 Requires PHP: 7.2
Version: 2.0.1 Version: 2.0.2
License: GPL-3.0-or-later License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.txt License URI: https://www.gnu.org/licenses/gpl-3.0.txt
@ -13,7 +13,7 @@ Control search engine indexing with robots directives using HTML meta tags or HT
== Description == == Description ==
Fine-grained control over how search engines index and display your WordPress content. Apply 5 independent robots directives to 25 different page contexts with flexible implementation methods. Fine-grained control over how search engines index and display your WordPress content. Apply 5 independent robots directives to 22 different page contexts with flexible implementation methods.
**5 Robots Directives:** **5 Robots Directives:**
@ -31,7 +31,7 @@ Fine-grained control over how search engines index and display your WordPress co
**Control Levels:** **Control Levels:**
* Global Settings: Apply directives to 25 different page contexts (posts, pages, archives, etc.) * Global Settings: Apply directives to 22 different page contexts (posts, pages, archives, etc.)
* Granular Control (Optional): Override global settings for individual posts, pages, and custom post types via meta boxes in the editor * Granular Control (Optional): Override global settings for individual posts, pages, and custom post types via meta boxes in the editor
**Perfect for:** **Perfect for:**
@ -114,6 +114,43 @@ Extract the contents of the ZIP and upload the contents to the `/wp-content/plug
== Changelog == == Changelog ==
= 2.0.2 [2026-07-18] =
**Fixed**
* Bulk action "Enable Robots Override" no longer creates duplicate `postmeta` rows. The previous implementation used `INSERT ... ON DUPLICATE KEY UPDATE`, but WordPress's `postmeta` table has no unique key on `(post_id, meta_key)`, so the `ON DUPLICATE KEY UPDATE` branch never fired and every bulk run on a post that already had the meta inserted a duplicate row. The bulk handler now uses `update_post_meta()` and `delete_post_meta()` exclusively.
* Bulk action "Disable Robots Override" now removes the override meta entirely (previously set its value to `0`, leaving a redundant row).
**Changed**
* Removed three dead contexts (`feed`, `comment_feed`, `robots`) that were registered, migrated, and cleaned up but never evaluated at runtime and never exposed in the admin UI. The plugin now consistently registers and evaluates 22 page contexts (down from a nominal 25). Existing orphan options from earlier installs are cleaned by the uninstall routine's wildcard delete.
* Extracted `noindex_seo_get_contexts()` as the single source of truth for the context list shared by settings registration, v2 migration, form processing. `uninstall.php` retains its own copy (technical constraint: the main plugin file is not loaded during uninstall) with a sync warning comment.
* Corrected `phpcs.xml` `minimum_supported_wp_version` from `6.6` to `5.7` to match the plugin header. This setting was stale from before the 2.0.1 minimum-WP correction.
* Updated `readme.txt` description counts from 25 to 22 page contexts.
* **Bulk action performance characteristic changed**: the rewrite from a single batched SQL statement to per-post `update_post_meta()` / `delete_post_meta()` calls trades O(1) queries for O(N) queries on bulk selections, in exchange for correctness (no more duplicate rows) and proper WP meta-cache invalidation. Typical admin bulk selections (≤200 posts) are unaffected; very large selections (thousands of posts) may take noticeably longer.
**Deprecated**
* `noindex_seo_clear_transient()`: was hooked to `update_option_noindexseo`, a hook that never fires because `noindexseo` is the Settings API group name, not an option name. The function now emits a deprecation notice via `_deprecated_function()` and continues to clear the `noindex_seo_options` transient if called directly. The transient is cleared correctly inside `noindex_seo_process_form()` after every successful save. The function will be removed in a future release.
**Code Quality**
* `bin/preflight.sh`: hardened temp-file handling (mktemp moved to script top, `trap … EXIT` cleanup, no more predictable `/tmp/composer-audit.*` paths that were vulnerable to symlink overwrite on shared hosting); fixed `2>/null` typo; added rsync / `.distignore` / build-tree-non-empty guards so the forbidden-artefact scan cannot pass vacuously; replaced npm-audit subshell with `pushd`/`popd` so gate counters are not lost.
* Added `bin/preflight.sh`: automated pre-deploy verification covering PHPCS, PHPStan level 9, PHPCompatibility, PHPUnit, dependency audit, and candidate-ZIP artefact inspection. Prints a PASS/FAIL report per section and exits non-zero on any failure.
* Added `.claude/settings.json` deny rules for `deploy.sh`, `git push`, `git tag`, and `git merge`, enforcing the agent operating boundaries mandated by AGENTS.md mechanically rather than only in prose.
**Compatibility**
* WordPress: 5.7 - 7.1
* PHP: 7.2 - 8.5
**Tests**
* PHP Coding Standards: 3.13.5
* WordPress Coding Standards: 3.3.0
* PHPStan: 2.1.55
* PHPUnit: 9.6.34
= 2.0.1 [2026-05-25] = = 2.0.1 [2026-05-25] =
**Added** **Added**

View file

@ -31,17 +31,17 @@ if ( ! $noindex_seo_delete ) {
// User has opted in to full data removal — proceed with cleanup. // User has opted in to full data removal — proceed with cleanup.
// Define contexts and directives. // Define contexts and directives.
// NOTE: this list must stay in sync with noindex_seo_get_contexts() in
// noindex-seo.php. The helper cannot be called here because the main plugin
// file is not loaded during uninstall.
$noindex_seo_contexts = array( $noindex_seo_contexts = array(
'error',
'archive', 'archive',
'attachment', 'attachment',
'author', 'author',
'category', 'category',
'comment_feed',
'customize_preview', 'customize_preview',
'date', 'date',
'day', 'day',
'feed',
'front_page', 'front_page',
'home', 'home',
'month', 'month',
@ -50,13 +50,13 @@ $noindex_seo_contexts = array(
'post_type_archive', 'post_type_archive',
'preview', 'preview',
'privacy_policy', 'privacy_policy',
'robots',
'search', 'search',
'single', 'single',
'singular', 'singular',
'tag', 'tag',
'time', 'time',
'year', 'year',
'error',
); );
$noindex_seo_directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' ); $noindex_seo_directives = array( 'noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex' );