Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 54122d3d95 | |||
| 3cf187303e | |||
| 1086e369e3 | |||
| fb0ef03b73 | |||
| 0ec665db60 | |||
| 7b3c00cacc | |||
| b66c727a95 | |||
| a50d125883 | |||
| 80b8db8289 |
13 changed files with 7349 additions and 2873 deletions
36
README.md
36
README.md
|
|
@ -1,36 +0,0 @@
|
|||
# noindex SEO
|
||||
|
||||
Control search engine indexing with robots directives (`noindex`, `nofollow`, `noarchive`, `nosnippet`, `noimageindex`) for specific parts of your WordPress site.
|
||||
|
||||
## For end users
|
||||
|
||||
See [`readme.txt`](readme.txt) for installation, usage, and the WordPress.org-format changelog.
|
||||
|
||||
## For developers / contributors
|
||||
|
||||
- **[`CLAUDE.md`](CLAUDE.md)** — project-specific architecture, data model, tooling setup, and deliberate exceptions to the AGENTS defaults. Read this first.
|
||||
- **[`AGENTS.md`](AGENTS.md)** — index to the contribution guidelines (security, compatibility, tooling, testing, deployment). Topic-specific rules live in the `AGENTS-*.md` files.
|
||||
|
||||
## Common commands
|
||||
|
||||
```bash
|
||||
composer install # Install dev dependencies
|
||||
vendor/bin/phpcs # WordPress Coding Standards
|
||||
vendor/bin/phpstan analyse --memory-limit=1G # Static analysis (level 9)
|
||||
vendor/bin/phpunit # Test suite (71 tests)
|
||||
bash bin/preflight.sh # Full pre-deploy verification
|
||||
```
|
||||
|
||||
## Test setup
|
||||
|
||||
Copy the sample config and fill in your local DB credentials:
|
||||
|
||||
```bash
|
||||
cp tests/wp-tests-config.sample.php tests/wp-tests-config.php
|
||||
```
|
||||
|
||||
The WordPress test library must be installed at `/tmp/wordpress-tests-lib` (or set `WP_TESTS_DIR`).
|
||||
|
||||
## License
|
||||
|
||||
GPL-3.0-or-later. See [LICENSE](LICENSE).
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
/**
|
||||
* noindex SEO - Admin Panel Styles
|
||||
* Version: 2.0.0
|
||||
* Modern, visual admin interface
|
||||
* noindex SEO - Admin styles
|
||||
*
|
||||
* Follows the WordPress admin color scheme via the --wp-admin-theme-color
|
||||
* custom property (with the core default as fallback) and the core admin
|
||||
* status palette. Uses logical properties so RTL works out of the box.
|
||||
*/
|
||||
|
||||
/* ===========================
|
||||
|
|
@ -12,63 +14,19 @@
|
|||
margin: 20px 0;
|
||||
}
|
||||
|
||||
/* Header styles removed - using WordPress default styles */
|
||||
|
||||
/* ===========================
|
||||
Tabs Navigation
|
||||
=========================== */
|
||||
.noindex-seo-tabs {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-bottom: 30px;
|
||||
border-bottom: 2px solid #e5e7eb;
|
||||
flex-wrap: wrap;
|
||||
/* Tab navigation uses the native WordPress nav-tab classes. */
|
||||
.noindex-seo-admin-wrap .nav-tab-wrapper {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.noindex-seo-tab {
|
||||
padding: 12px 24px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: #6b7280;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
border-bottom: 3px solid transparent;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
/* Section titles inside a tab panel. Vertical separation between
|
||||
sections comes from the content blocks' own bottom margins. */
|
||||
.noindex-seo-section-title {
|
||||
margin: 0 0 12px 0;
|
||||
}
|
||||
|
||||
.noindex-seo-tab:hover {
|
||||
color: #667eea;
|
||||
}
|
||||
|
||||
.noindex-seo-tab.active {
|
||||
color: #667eea;
|
||||
border-bottom-color: #667eea;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Tab Content
|
||||
=========================== */
|
||||
.noindex-seo-tab-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.noindex-seo-tab-content.active {
|
||||
display: block;
|
||||
animation: fadeIn 0.3s ease;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(10px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
.noindex-seo-section-title + .description {
|
||||
margin: 0 0 12px 0;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
|
|
@ -80,13 +38,13 @@
|
|||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 20px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #e5e7eb;
|
||||
border: 1px solid #c3c4c7;
|
||||
}
|
||||
|
||||
.noindex-seo-card-header {
|
||||
padding: 20px 24px;
|
||||
background: #f9fafb;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
background: #f6f7f7;
|
||||
border-bottom: 1px solid #c3c4c7;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
|
@ -95,28 +53,28 @@
|
|||
}
|
||||
|
||||
.noindex-seo-card-header:hover {
|
||||
background: #f3f4f6;
|
||||
background: #f0f0f1;
|
||||
}
|
||||
|
||||
.noindex-seo-card-header h3 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #111827;
|
||||
color: #2c3338;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.noindex-seo-card-header .dashicons {
|
||||
color: #667eea;
|
||||
color: var(--wp-admin-theme-color, #2271b1);
|
||||
font-size: 20px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.noindex-seo-card-toggle {
|
||||
color: #9ca3af;
|
||||
color: #8c8f94;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
|
|
@ -124,6 +82,10 @@
|
|||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
[dir="rtl"] .noindex-seo-card.collapsed .noindex-seo-card-toggle {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.noindex-seo-card-body {
|
||||
padding: 24px;
|
||||
display: grid;
|
||||
|
|
@ -140,10 +102,10 @@
|
|||
=========================== */
|
||||
.noindex-seo-option {
|
||||
padding: 24px;
|
||||
background: #f9fafb;
|
||||
background: #f6f7f7;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e5e7eb;
|
||||
transition: all 0.2s ease;
|
||||
border: 1px solid #c3c4c7;
|
||||
transition: border-color 0.2s ease;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
|
|
@ -152,15 +114,15 @@
|
|||
}
|
||||
|
||||
.noindex-seo-option:hover {
|
||||
background: #f3f4f6;
|
||||
border-color: #d1d5db;
|
||||
background: #f0f0f1;
|
||||
border-color: #8c8f94;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.noindex-seo-option-header {
|
||||
margin-bottom: 18px;
|
||||
padding-bottom: 14px;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
border-bottom: 1px solid #c3c4c7;
|
||||
}
|
||||
|
||||
.noindex-seo-option-title {
|
||||
|
|
@ -169,7 +131,7 @@
|
|||
gap: 8px;
|
||||
margin-bottom: 6px;
|
||||
font-size: 15px;
|
||||
color: #111827;
|
||||
color: #2c3338;
|
||||
}
|
||||
|
||||
.noindex-seo-option-title strong {
|
||||
|
|
@ -177,32 +139,12 @@
|
|||
}
|
||||
|
||||
.noindex-seo-option-description {
|
||||
color: #6b7280;
|
||||
color: #646970;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.noindex-seo-view-link {
|
||||
color: #667eea;
|
||||
text-decoration: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 13px;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.noindex-seo-view-link:hover {
|
||||
color: #5568d3;
|
||||
}
|
||||
|
||||
.noindex-seo-view-link .dashicons {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Directives Checkboxes
|
||||
=========================== */
|
||||
|
|
@ -219,18 +161,18 @@
|
|||
gap: 10px;
|
||||
padding: 10px 14px;
|
||||
background: #fff;
|
||||
border: 2px solid #e5e7eb;
|
||||
border: 2px solid #c3c4c7;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
transition: border-color 0.2s ease;
|
||||
user-select: none;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
color: #3c434a;
|
||||
}
|
||||
|
||||
.noindex-seo-directive-checkbox:hover {
|
||||
border-color: #d1d5db;
|
||||
border-color: #8c8f94;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
|
|
@ -239,21 +181,16 @@
|
|||
width: 18px;
|
||||
height: 18px;
|
||||
cursor: pointer;
|
||||
accent-color: #667eea;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.noindex-seo-directive-checkbox input[type="checkbox"]:checked {
|
||||
background-color: #667eea;
|
||||
}
|
||||
|
||||
.noindex-seo-directive-checkbox:has(input:checked) {
|
||||
border-color: #667eea;
|
||||
background-color: #eff6ff;
|
||||
border-color: var(--wp-admin-theme-color, #2271b1);
|
||||
background-color: #f0f6fc;
|
||||
}
|
||||
|
||||
.noindex-seo-directive-checkbox:has(input:checked) .directive-label {
|
||||
color: #667eea;
|
||||
color: var(--wp-admin-theme-color, #2271b1);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
|
|
@ -265,6 +202,22 @@
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
/* SVG directive icons (WP 7.1+ via the core Icons API; emoji fallback
|
||||
inherits the surrounding text metrics instead). */
|
||||
svg.noindex-seo-directive-icon {
|
||||
vertical-align: text-bottom;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.directive-icon .noindex-seo-directive-icon {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.noindex-seo-badge-item .noindex-seo-directive-icon {
|
||||
margin-inline-end: 2px;
|
||||
}
|
||||
|
||||
.directive-label {
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 13px;
|
||||
|
|
@ -273,21 +226,22 @@
|
|||
}
|
||||
|
||||
.directive-description {
|
||||
color: #6b7280;
|
||||
color: #646970;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
font-family: inherit;
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Toggle Switch (Modern)
|
||||
Toggle Switch
|
||||
=========================== */
|
||||
.noindex-seo-switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 48px;
|
||||
height: 26px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.noindex-seo-switch input {
|
||||
|
|
@ -303,7 +257,7 @@
|
|||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #cbd5e1;
|
||||
background-color: #8c8f94;
|
||||
transition: 0.3s;
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
|
@ -315,24 +269,34 @@
|
|||
width: 20px;
|
||||
left: 3px;
|
||||
bottom: 3px;
|
||||
background-color: white;
|
||||
background-color: #fff;
|
||||
transition: 0.3s;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
input:checked + .noindex-seo-slider {
|
||||
background-color: #667eea;
|
||||
background-color: var(--wp-admin-theme-color, #2271b1);
|
||||
}
|
||||
|
||||
input:focus + .noindex-seo-slider {
|
||||
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
|
||||
input:focus-visible + .noindex-seo-slider {
|
||||
outline: 2px solid var(--wp-admin-theme-color, #2271b1);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
input:checked + .noindex-seo-slider:before {
|
||||
transform: translateX(22px);
|
||||
}
|
||||
|
||||
[dir="rtl"] .noindex-seo-slider:before {
|
||||
left: auto;
|
||||
right: 3px;
|
||||
}
|
||||
|
||||
[dir="rtl"] input:checked + .noindex-seo-slider:before {
|
||||
transform: translateX(-22px);
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Badges & Indicators
|
||||
=========================== */
|
||||
|
|
@ -348,18 +312,18 @@ input:checked + .noindex-seo-slider:before {
|
|||
}
|
||||
|
||||
.noindex-seo-badge.recommended {
|
||||
background: #dcfce7;
|
||||
color: #166534;
|
||||
background: #edfaef;
|
||||
color: #076b32;
|
||||
}
|
||||
|
||||
.noindex-seo-badge.not-recommended {
|
||||
background: #fee2e2;
|
||||
color: #991b1b;
|
||||
background: #fcf0f1;
|
||||
color: #b32d2e;
|
||||
}
|
||||
|
||||
.noindex-seo-badge.neutral {
|
||||
background: #e0e7ff;
|
||||
color: #3730a3;
|
||||
background: #f0f0f1;
|
||||
color: #3c434a;
|
||||
}
|
||||
|
||||
.noindex-seo-badge .dashicons {
|
||||
|
|
@ -368,12 +332,19 @@ input:checked + .noindex-seo-slider:before {
|
|||
height: 14px;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
"Apply Recommended Defaults" form
|
||||
=========================== */
|
||||
.noindex-seo-apply-form {
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
General Config Section
|
||||
=========================== */
|
||||
.noindex-seo-general-config {
|
||||
background: #fffbeb;
|
||||
border: 1px solid #fcd34d;
|
||||
background: #fff;
|
||||
border: 1px solid #c3c4c7;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin-bottom: 30px;
|
||||
|
|
@ -382,14 +353,14 @@ input:checked + .noindex-seo-slider:before {
|
|||
.noindex-seo-general-config h2 {
|
||||
margin: 0 0 16px 0;
|
||||
font-size: 18px;
|
||||
color: #92400e;
|
||||
color: #2c3338;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.noindex-seo-general-config .dashicons {
|
||||
color: #f59e0b;
|
||||
color: var(--wp-admin-theme-color, #2271b1);
|
||||
}
|
||||
|
||||
.noindex-seo-config-option {
|
||||
|
|
@ -398,18 +369,38 @@ input:checked + .noindex-seo-slider:before {
|
|||
gap: 12px;
|
||||
}
|
||||
|
||||
.noindex-seo-config-option + .noindex-seo-config-option {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.noindex-seo-config-option label {
|
||||
color: #78350f;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.noindex-seo-config-body {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.noindex-seo-config-label {
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.noindex-seo-config-label-danger {
|
||||
color: #b32d2e;
|
||||
}
|
||||
|
||||
.noindex-seo-config-select {
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Alert / Notice
|
||||
=========================== */
|
||||
.noindex-seo-alert {
|
||||
background: #fef3c7;
|
||||
border-left: 4px solid #f59e0b;
|
||||
background: #fcf9e8;
|
||||
border-inline-start: 4px solid #dba617;
|
||||
padding: 16px 20px;
|
||||
margin-bottom: 24px;
|
||||
border-radius: 4px;
|
||||
|
|
@ -419,22 +410,17 @@ input:checked + .noindex-seo-slider:before {
|
|||
}
|
||||
|
||||
.noindex-seo-alert .dashicons {
|
||||
color: #d97706;
|
||||
color: #dba617;
|
||||
flex-shrink: 0;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.noindex-seo-alert p {
|
||||
margin: 0;
|
||||
color: #92400e;
|
||||
color: #3c434a;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Submit Button
|
||||
=========================== */
|
||||
/* Submit button styles removed - using WordPress default submit_button() */
|
||||
|
||||
/* ===========================
|
||||
Search/Filter
|
||||
=========================== */
|
||||
|
|
@ -445,17 +431,12 @@ input:checked + .noindex-seo-slider:before {
|
|||
.noindex-seo-search input {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
padding: 10px 16px;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.noindex-seo-search input:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
||||
border-color: var(--wp-admin-theme-color, #2271b1);
|
||||
box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
|
|
@ -469,23 +450,23 @@ input:checked + .noindex-seo-slider:before {
|
|||
}
|
||||
|
||||
.noindex-seo-stat-card {
|
||||
background: white;
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e5e7eb;
|
||||
border: 1px solid #c3c4c7;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.noindex-seo-stat-number {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
color: #667eea;
|
||||
color: var(--wp-admin-theme-color, #2271b1);
|
||||
margin: 0;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.noindex-seo-stat-label {
|
||||
color: #6b7280;
|
||||
color: #646970;
|
||||
font-size: 13px;
|
||||
margin-top: 8px;
|
||||
font-weight: 500;
|
||||
|
|
@ -495,65 +476,42 @@ input:checked + .noindex-seo-slider:before {
|
|||
View Link
|
||||
=========================== */
|
||||
.noindex-seo-view-link {
|
||||
color: #667eea;
|
||||
color: var(--wp-admin-theme-color, #2271b1);
|
||||
text-decoration: none;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.noindex-seo-view-link:hover {
|
||||
color: #764ba2;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.noindex-seo-view-link .dashicons {
|
||||
font-size: 16px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Responsive Design
|
||||
=========================== */
|
||||
@media (max-width: 782px) {
|
||||
.noindex-seo-card-body {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.noindex-seo-tabs {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.noindex-seo-tab {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.noindex-seo-stats {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
font-size: 14px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Success Message
|
||||
=========================== */
|
||||
.noindex-seo-success {
|
||||
background: #dcfce7;
|
||||
border-left: 4px solid #16a34a;
|
||||
background: #edfaef;
|
||||
border-inline-start: 4px solid #00a32a;
|
||||
padding: 16px 20px;
|
||||
margin: 20px 0;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
animation: slideDown 0.3s ease;
|
||||
animation: noindexSeoSlideDown 0.3s ease;
|
||||
}
|
||||
|
||||
@keyframes slideDown {
|
||||
@keyframes noindexSeoSlideDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-10px);
|
||||
|
|
@ -565,13 +523,13 @@ input:checked + .noindex-seo-slider:before {
|
|||
}
|
||||
|
||||
.noindex-seo-success .dashicons {
|
||||
color: #16a34a;
|
||||
color: #00a32a;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.noindex-seo-success p {
|
||||
margin: 0;
|
||||
color: #166534;
|
||||
color: #076b32;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
|
|
@ -585,14 +543,14 @@ input:checked + .noindex-seo-slider:before {
|
|||
}
|
||||
|
||||
.noindex-seo-tooltip .dashicons {
|
||||
color: #9ca3af;
|
||||
color: #8c8f94;
|
||||
font-size: 16px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.noindex-seo-tooltip:hover .dashicons {
|
||||
color: #667eea;
|
||||
color: var(--wp-admin-theme-color, #2271b1);
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
|
|
@ -602,7 +560,7 @@ input:checked + .noindex-seo-slider:before {
|
|||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
position: relative;
|
||||
background: #f9fafb;
|
||||
background: #f6f7f7;
|
||||
}
|
||||
|
||||
.noindex-seo-option.disabled::before {
|
||||
|
|
@ -621,17 +579,158 @@ input:checked + .noindex-seo-slider:before {
|
|||
}
|
||||
|
||||
.noindex-seo-option.disabled .noindex-seo-option-title {
|
||||
color: #9ca3af;
|
||||
color: #8c8f94;
|
||||
}
|
||||
|
||||
.noindex-seo-option.disabled .noindex-seo-option-description {
|
||||
color: #d1d5db;
|
||||
color: #a7aaad;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Post meta box (classic editor)
|
||||
=========================== */
|
||||
.noindex-seo-meta-override {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.noindex-seo-meta-note {
|
||||
margin: 8px 0 12px 0;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.noindex-seo-directive-list {
|
||||
border-top: 1px solid #dcdcde;
|
||||
padding-top: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.noindex-seo-directive-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.noindex-seo-reference {
|
||||
margin-top: 12px;
|
||||
padding: 10px;
|
||||
background: #f6f7f7;
|
||||
border: 1px solid #c3c4c7;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.noindex-seo-reference-title {
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: #3c434a;
|
||||
}
|
||||
|
||||
.noindex-seo-ref {
|
||||
margin: 0 0 4px 0;
|
||||
padding: 6px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.noindex-seo-ref:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.noindex-seo-ref code {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.noindex-seo-ref-override {
|
||||
background: #f0f6fc;
|
||||
border-inline-start: 3px solid #72aee6;
|
||||
}
|
||||
|
||||
.noindex-seo-ref-none {
|
||||
background: #fcf9e8;
|
||||
border-inline-start: 3px solid #dba617;
|
||||
}
|
||||
|
||||
.noindex-seo-ref-global {
|
||||
background: #fff;
|
||||
border-inline-start: 3px solid #c3c4c7;
|
||||
}
|
||||
|
||||
.noindex-seo-ref-ok {
|
||||
background: #edfaef;
|
||||
border-inline-start: 3px solid #00a32a;
|
||||
color: #076b32;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Term edit panel
|
||||
=========================== */
|
||||
.noindex-seo-term-directives {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.noindex-seo-term-directive {
|
||||
display: inline-block;
|
||||
margin-inline-end: 12px;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
List-table columns (posts and terms)
|
||||
=========================== */
|
||||
.noindex-seo-col-empty {
|
||||
color: #8c8f94;
|
||||
}
|
||||
|
||||
.noindex-seo-badges {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.noindex-seo-badge-item {
|
||||
display: inline-block;
|
||||
padding: 2px 6px;
|
||||
background: #f0f6fc;
|
||||
border: 1px solid var(--wp-admin-theme-color, #2271b1);
|
||||
border-radius: 3px;
|
||||
font-size: 11px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Quick Edit
|
||||
=========================== */
|
||||
.noindex-seo-quick-edit-list {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.noindex-seo-quick-edit-label {
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.noindex-seo-quick-edit-nested {
|
||||
margin-inline-start: 20px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.noindex-seo-quick-edit-option {
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Responsive Design
|
||||
=========================== */
|
||||
@media screen and (max-width: 782px) {
|
||||
@media (max-width: 782px) {
|
||||
.noindex-seo-card-body {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.noindex-seo-stats {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.noindex-seo-directive-checkbox {
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
|
|
@ -639,7 +738,7 @@ input:checked + .noindex-seo-slider:before {
|
|||
|
||||
.directive-description {
|
||||
flex-basis: 100%;
|
||||
margin-left: 52px;
|
||||
margin-inline-start: 52px;
|
||||
margin-top: 4px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
|
@ -662,3 +761,122 @@ input:checked + .noindex-seo-slider:before {
|
|||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Value directives & rules (3.6.0)
|
||||
=========================== */
|
||||
|
||||
/* Settings-grid value cells: number, select and datetime inputs. */
|
||||
.noindex-seo-directive-value input[type="number"],
|
||||
.noindex-seo-directive-value input[type="datetime-local"] {
|
||||
width: 130px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.noindex-seo-directive-value select {
|
||||
width: 130px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.noindex-seo-directive-value .directive-label {
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* Meta-box and term-panel value rows. */
|
||||
.noindex-seo-value-list {
|
||||
margin-top: 10px;
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid #c3c4c7;
|
||||
}
|
||||
|
||||
.noindex-seo-values-title {
|
||||
margin: 0 0 6px;
|
||||
}
|
||||
|
||||
.noindex-seo-value-row input[type="number"],
|
||||
.noindex-seo-value-row input[type="datetime-local"] {
|
||||
width: 150px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.noindex-seo-value-row select {
|
||||
width: 110px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.noindex-seo-term-directive-value {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.noindex-seo-term-directive-value input[type="number"],
|
||||
.noindex-seo-term-directive-value input[type="datetime-local"] {
|
||||
width: 150px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Quick Edit value rows. */
|
||||
.noindex-seo-quick-edit-value input[type="number"],
|
||||
.noindex-seo-quick-edit-value input[type="datetime-local"] {
|
||||
width: 130px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.noindex-seo-quick-edit-value select {
|
||||
width: 110px;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Conditional-rules table. */
|
||||
.noindex-seo-rules-table {
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.noindex-seo-rule-head,
|
||||
.noindex-seo-rule-row {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 44px;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.noindex-seo-rule-head {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.noindex-seo-rule-remove .dashicons {
|
||||
margin-top: 4px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
Robots.txt management (3.7.0)
|
||||
=========================== */
|
||||
|
||||
.noindex-seo-robotstxt-table {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.noindex-seo-robotstxt-table input[type="text"] {
|
||||
width: 100%;
|
||||
max-width: 320px;
|
||||
}
|
||||
|
||||
.noindex-seo-robotstxt-preview {
|
||||
max-width: 480px;
|
||||
padding: 12px;
|
||||
background: #fff;
|
||||
border: 1px solid #c3c4c7;
|
||||
border-radius: 3px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.noindex-seo-robotstxt-preview code {
|
||||
font-family: Consolas, Monaco, monospace;
|
||||
font-size: 12px;
|
||||
white-space: pre;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,43 +13,86 @@
|
|||
* Initialize the admin panel
|
||||
*/
|
||||
function init() {
|
||||
initTabs();
|
||||
initCollapsibleCards();
|
||||
initSearch();
|
||||
initStats();
|
||||
initTooltips();
|
||||
initMethodDependentFields();
|
||||
initRules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize tabs functionality
|
||||
* Initialize the rule tables (conditional rules + robots.txt):
|
||||
* add / remove rows, and the robots.txt preset buttons.
|
||||
*/
|
||||
function initTabs() {
|
||||
$( '.noindex-seo-tab' ).on(
|
||||
function initRules() {
|
||||
// Add rule: clone the last row of the target container and clear it.
|
||||
$( '.noindex-seo-rule-add' ).on(
|
||||
'click',
|
||||
function (e) {
|
||||
e.preventDefault();
|
||||
function () {
|
||||
const target = $( this ).data( 'target' ) || '.noindex-seo-rule-rows';
|
||||
const $rows = $( target ).first();
|
||||
const max = parseInt( $rows.data( 'max-rules' ) || 20, 10 );
|
||||
|
||||
const tabId = $( this ).data( 'tab' );
|
||||
if ( $rows.find( '.noindex-seo-rule-row' ).length >= max ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update active tab.
|
||||
$( '.noindex-seo-tab' ).removeClass( 'active' );
|
||||
$( this ).addClass( 'active' );
|
||||
|
||||
// Update active content.
|
||||
$( '.noindex-seo-tab-content' ).removeClass( 'active' );
|
||||
$( '#' + tabId ).addClass( 'active' );
|
||||
|
||||
// Save last active tab to localStorage.
|
||||
localStorage.setItem( 'noindexSeoActiveTab', tabId );
|
||||
const $clone = $rows.find( '.noindex-seo-rule-row' ).last().clone();
|
||||
$clone.find( 'input[type="text"], input[type="number"], input[type="datetime-local"]' ).val( '' );
|
||||
$rows.append( $clone );
|
||||
}
|
||||
);
|
||||
|
||||
// Restore last active tab.
|
||||
const lastTab = localStorage.getItem( 'noindexSeoActiveTab' );
|
||||
if (lastTab && $( '#' + lastTab ).length) {
|
||||
$( '.noindex-seo-tab[data-tab="' + lastTab + '"]' ).click();
|
||||
}
|
||||
// Remove rule: drop the row, or clear it when it is the last one left.
|
||||
$( document ).on(
|
||||
'click',
|
||||
'.noindex-seo-rule-remove',
|
||||
function () {
|
||||
const $row = $( this ).closest( '.noindex-seo-rule-row' );
|
||||
const $rows = $( this ).closest( '.noindex-seo-rule-rows' );
|
||||
|
||||
if ( $rows.find( '.noindex-seo-rule-row' ).length > 1 ) {
|
||||
$row.remove();
|
||||
} else {
|
||||
$row.find( 'input[type="text"]' ).val( '' );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Robots.txt presets: append one blocked row per bot of the preset
|
||||
// (skipping agents that already have a rule).
|
||||
$( '.noindex-seo-robotstxt-preset' ).on(
|
||||
'click',
|
||||
function () {
|
||||
const preset = $( this ).data( 'preset' );
|
||||
const bots = ( 'search' === preset ) ? ( window.noindexSeoAdmin.searchBots || [] ) : ( window.noindexSeoAdmin.aiBots || [] );
|
||||
const $rows = $( '.noindex-seo-robotstxt-rows' ).first();
|
||||
const max = parseInt( $rows.data( 'max-rules' ) || 30, 10 );
|
||||
|
||||
const existing = {};
|
||||
$rows.find( 'input[name="noindex_seo_robotstxt_agent[]"]' ).each(
|
||||
function () {
|
||||
existing[ $( this ).val().toLowerCase() ] = true;
|
||||
}
|
||||
);
|
||||
|
||||
bots.forEach(
|
||||
function ( bot ) {
|
||||
if ( existing[ bot.toLowerCase() ] ) {
|
||||
return;
|
||||
}
|
||||
if ( $rows.find( '.noindex-seo-rule-row' ).length >= max ) {
|
||||
return;
|
||||
}
|
||||
|
||||
const $clone = $rows.find( '.noindex-seo-rule-row' ).last().clone();
|
||||
$clone.find( 'input[name="noindex_seo_robotstxt_agent[]"]' ).val( bot );
|
||||
$clone.find( 'select' ).val( 'block' );
|
||||
$rows.append( $clone );
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -163,63 +206,6 @@
|
|||
// Can be enhanced with a tooltip library if needed.
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize method-dependent field states
|
||||
* Some fields only work with HTTP headers, not HTML meta tags
|
||||
*/
|
||||
function initMethodDependentFields() {
|
||||
const methodSelect = $( '#noindex_seo_config_method' );
|
||||
|
||||
if (methodSelect.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update field states based on selected implementation method
|
||||
*/
|
||||
function updateFieldStates() {
|
||||
const method = methodSelect.val();
|
||||
const isHeaderEnabled = (method === 'header' || method === 'both');
|
||||
|
||||
// Contexts that ONLY work with HTTP headers (non-HTML content).
|
||||
const headerOnlyContexts = [
|
||||
'attachment', // Attachment pages (may contain PDFs, images, etc.).
|
||||
'feed', // RSS/Atom feeds (XML, not HTML).
|
||||
'comment_feed' // Comment feeds (XML, not HTML).
|
||||
];
|
||||
|
||||
headerOnlyContexts.forEach(
|
||||
function (context) {
|
||||
// Find all directive checkboxes for this context.
|
||||
const directiveCheckboxes = $( 'input[name$="_seo_' + context + '"]' );
|
||||
const option = directiveCheckboxes.first().closest( '.noindex-seo-option' );
|
||||
|
||||
if ( ! isHeaderEnabled) {
|
||||
// Disable all directives for this context.
|
||||
directiveCheckboxes.prop( 'disabled', true );
|
||||
directiveCheckboxes.prop( 'checked', false );
|
||||
option.addClass( 'disabled' );
|
||||
option.attr( 'title', 'This option only works with HTTP Headers implementation method' );
|
||||
} else {
|
||||
// Enable all directives for this context.
|
||||
directiveCheckboxes.prop( 'disabled', false );
|
||||
option.removeClass( 'disabled' );
|
||||
option.removeAttr( 'title' );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Update stats after changing field states.
|
||||
updateStats();
|
||||
}
|
||||
|
||||
// Listen for method changes.
|
||||
methodSelect.on( 'change', updateFieldStates );
|
||||
|
||||
// Execute on page load.
|
||||
updateFieldStates();
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand all cards
|
||||
*/
|
||||
|
|
@ -325,9 +311,15 @@
|
|||
if (urlParams.get( 'updated' ) === 'true') {
|
||||
showSuccessMessage( noindexSeoAdmin.successMessage || 'Settings saved successfully!' );
|
||||
|
||||
// Remove the parameter from URL without reload.
|
||||
const newUrl = window.location.pathname + window.location.hash;
|
||||
window.history.replaceState( {}, document.title, newUrl );
|
||||
// Remove only the success flag, keeping the page and tab
|
||||
// parameters intact (tabs are URL-based since 3.3.0).
|
||||
urlParams.delete( 'updated' );
|
||||
const remaining = urlParams.toString();
|
||||
window.history.replaceState(
|
||||
{},
|
||||
document.title,
|
||||
window.location.pathname + ( remaining ? '?' + remaining : '' )
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
/**
|
||||
* Noindex SEO - Gutenberg Sidebar Panel
|
||||
* Version: 2.0.0
|
||||
* Version: 3.0.0
|
||||
*
|
||||
* Provides a native Gutenberg sidebar panel for controlling robots directives
|
||||
* on individual posts and pages.
|
||||
* on individual posts and pages: boolean flags plus the value directives
|
||||
* introduced in 3.6.0 (max-snippet, max-image-preview, max-video-preview,
|
||||
* unavailable_after).
|
||||
*
|
||||
* @package noindex-seo
|
||||
*/
|
||||
|
|
@ -11,11 +13,21 @@
|
|||
(function (wp) {
|
||||
const { registerPlugin } = wp.plugins;
|
||||
const { PluginDocumentSettingPanel } = wp.editPost;
|
||||
const { CheckboxControl, PanelRow } = wp.components;
|
||||
const { CheckboxControl, PanelRow, SelectControl, TextControl } = wp.components;
|
||||
const { useSelect, useDispatch } = wp.data;
|
||||
const { createElement: el } = wp.element;
|
||||
const { __ } = wp.i18n;
|
||||
|
||||
/**
|
||||
* Boolean directives: checkbox controls backed by integer meta (0/1).
|
||||
*/
|
||||
const booleanDirectives = ['noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex', 'notranslate'];
|
||||
|
||||
/**
|
||||
* Value directives: inputs backed by string meta ('' = off).
|
||||
*/
|
||||
const valueDirectives = ['max-snippet', 'max-image-preview', 'max-video-preview', 'unavailable_after'];
|
||||
|
||||
/**
|
||||
* Robots Directives Sidebar Panel Component
|
||||
*/
|
||||
|
|
@ -29,34 +41,42 @@
|
|||
|
||||
const { editPost } = useDispatch( 'core/editor' );
|
||||
|
||||
// Current values.
|
||||
const override = Boolean( postMeta._noindex_seo_override );
|
||||
const noindex = Boolean( postMeta._noindex_seo_noindex );
|
||||
const nofollow = Boolean( postMeta._noindex_seo_nofollow );
|
||||
const noarchive = Boolean( postMeta._noindex_seo_noarchive );
|
||||
const nosnippet = Boolean( postMeta._noindex_seo_nosnippet );
|
||||
const noimageindex = Boolean( postMeta._noindex_seo_noimageindex );
|
||||
// Current override state.
|
||||
const override = Boolean( postMeta._noindex_seo_override );
|
||||
|
||||
// Update meta function.
|
||||
const updateMeta = function (key, value) {
|
||||
// Update a boolean meta value (0/1).
|
||||
const updateBoolean = function (key, value) {
|
||||
const newMeta = {};
|
||||
newMeta[key] = value ? 1 : 0;
|
||||
editPost( { meta: newMeta } );
|
||||
};
|
||||
|
||||
// Update a value-directive meta value (string, '' = off).
|
||||
const updateValue = function (key, value) {
|
||||
const newMeta = {};
|
||||
newMeta[key] = value || '';
|
||||
editPost( { meta: newMeta } );
|
||||
};
|
||||
|
||||
// Clear all directive meta values.
|
||||
const clearAllDirectives = function () {
|
||||
const directives = ['noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex'];
|
||||
directives.forEach(
|
||||
const newMeta = {};
|
||||
booleanDirectives.forEach(
|
||||
function (directive) {
|
||||
updateMeta( '_noindex_seo_' + directive, false );
|
||||
newMeta['_noindex_seo_' + directive] = 0;
|
||||
}
|
||||
);
|
||||
valueDirectives.forEach(
|
||||
function (directive) {
|
||||
newMeta['_noindex_seo_' + directive] = '';
|
||||
}
|
||||
);
|
||||
editPost( { meta: newMeta } );
|
||||
};
|
||||
|
||||
// Handle override toggle.
|
||||
const handleOverrideChange = function (value) {
|
||||
updateMeta( '_noindex_seo_override', value );
|
||||
updateBoolean( '_noindex_seo_override', value );
|
||||
|
||||
// If disabling override, clear all directives.
|
||||
if ( ! value) {
|
||||
|
|
@ -64,26 +84,91 @@
|
|||
}
|
||||
};
|
||||
|
||||
// Get active directives for preview.
|
||||
// Build the preview list: names for booleans, name:value for values.
|
||||
const activeDirectives = [];
|
||||
if (override) {
|
||||
if (noindex) {
|
||||
activeDirectives.push( 'noindex' );
|
||||
}
|
||||
if (nofollow) {
|
||||
activeDirectives.push( 'nofollow' );
|
||||
}
|
||||
if (noarchive) {
|
||||
activeDirectives.push( 'noarchive' );
|
||||
}
|
||||
if (nosnippet) {
|
||||
activeDirectives.push( 'nosnippet' );
|
||||
}
|
||||
if (noimageindex) {
|
||||
activeDirectives.push( 'noimageindex' );
|
||||
}
|
||||
booleanDirectives.forEach(
|
||||
function (directive) {
|
||||
if ( Boolean( postMeta['_noindex_seo_' + directive] ) ) {
|
||||
activeDirectives.push( directive );
|
||||
}
|
||||
}
|
||||
);
|
||||
valueDirectives.forEach(
|
||||
function (directive) {
|
||||
const value = postMeta['_noindex_seo_' + directive];
|
||||
if ( value ) {
|
||||
activeDirectives.push( directive + ':' + value );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Boolean directive rows.
|
||||
const booleanRows = booleanDirectives.map(
|
||||
function (directive) {
|
||||
return el(
|
||||
PanelRow,
|
||||
{ key: directive + '-row' },
|
||||
el(
|
||||
CheckboxControl,
|
||||
{
|
||||
label: __( directive, 'noindex-seo' ),
|
||||
checked: Boolean( postMeta['_noindex_seo_' + directive] ),
|
||||
onChange: function (value) {
|
||||
updateBoolean( '_noindex_seo_' + directive, value ); },
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Value directive rows.
|
||||
const valueRows = valueDirectives.map(
|
||||
function (directive) {
|
||||
const metaKey = '_noindex_seo_' + directive;
|
||||
|
||||
if ( 'max-image-preview' === directive) {
|
||||
return el(
|
||||
PanelRow,
|
||||
{ key: directive + '-row' },
|
||||
el(
|
||||
SelectControl,
|
||||
{
|
||||
label: __( directive, 'noindex-seo' ),
|
||||
value: postMeta[metaKey] || '',
|
||||
options: [
|
||||
{ value: '', label: __( 'Off', 'noindex-seo' ) },
|
||||
{ value: 'none', label: __( 'none', 'noindex-seo' ) },
|
||||
{ value: 'standard', label: __( 'standard', 'noindex-seo' ) },
|
||||
{ value: 'large', label: __( 'large', 'noindex-seo' ) },
|
||||
],
|
||||
onChange: function (value) {
|
||||
updateValue( metaKey, value ); },
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const inputType = ( 'unavailable_after' === directive) ? 'datetime-local' : 'number';
|
||||
|
||||
return el(
|
||||
PanelRow,
|
||||
{ key: directive + '-row' },
|
||||
el(
|
||||
TextControl,
|
||||
{
|
||||
type: inputType,
|
||||
label: __( directive, 'noindex-seo' ),
|
||||
value: ( postMeta[metaKey] || '' ).toString().replace( ' ', 'T' ),
|
||||
onChange: function (value) {
|
||||
updateValue( metaKey, value ); },
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
return el(
|
||||
PluginDocumentSettingPanel,
|
||||
{
|
||||
|
|
@ -119,141 +204,68 @@
|
|||
}
|
||||
},
|
||||
[
|
||||
el(
|
||||
'p',
|
||||
{
|
||||
key: 'directives-label',
|
||||
style: {
|
||||
fontSize: '12px',
|
||||
fontWeight: '600',
|
||||
marginBottom: '12px',
|
||||
color: '#1e1e1e',
|
||||
}
|
||||
},
|
||||
__( 'Robots Directives:', 'noindex-seo' )
|
||||
),
|
||||
|
||||
el(
|
||||
PanelRow,
|
||||
{ key: 'noindex-row' },
|
||||
el(
|
||||
CheckboxControl,
|
||||
{
|
||||
label: '🔍 ' + __( 'noindex', 'noindex-seo' ),
|
||||
help: __( 'Prevent search engines from indexing', 'noindex-seo' ),
|
||||
checked: noindex,
|
||||
onChange: function (value) {
|
||||
updateMeta( '_noindex_seo_noindex', value ); },
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
el(
|
||||
PanelRow,
|
||||
{ key: 'nofollow-row' },
|
||||
el(
|
||||
CheckboxControl,
|
||||
{
|
||||
label: '🔗 ' + __( 'nofollow', 'noindex-seo' ),
|
||||
help: __( 'Prevent search engines from following links', 'noindex-seo' ),
|
||||
checked: nofollow,
|
||||
onChange: function (value) {
|
||||
updateMeta( '_noindex_seo_nofollow', value ); },
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
el(
|
||||
PanelRow,
|
||||
{ key: 'noarchive-row' },
|
||||
el(
|
||||
CheckboxControl,
|
||||
{
|
||||
label: '💾 ' + __( 'noarchive', 'noindex-seo' ),
|
||||
help: __( 'Prevent cached versions in search results', 'noindex-seo' ),
|
||||
checked: noarchive,
|
||||
onChange: function (value) {
|
||||
updateMeta( '_noindex_seo_noarchive', value ); },
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
el(
|
||||
PanelRow,
|
||||
{ key: 'nosnippet-row' },
|
||||
el(
|
||||
CheckboxControl,
|
||||
{
|
||||
label: '📄 ' + __( 'nosnippet', 'noindex-seo' ),
|
||||
help: __( 'Prevent text snippets in search results', 'noindex-seo' ),
|
||||
checked: nosnippet,
|
||||
onChange: function (value) {
|
||||
updateMeta( '_noindex_seo_nosnippet', value ); },
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
el(
|
||||
PanelRow,
|
||||
{ key: 'noimageindex-row' },
|
||||
el(
|
||||
CheckboxControl,
|
||||
{
|
||||
label: '🖼️ ' + __( 'noimageindex', 'noindex-seo' ),
|
||||
help: __( 'Prevent image indexing', 'noindex-seo' ),
|
||||
checked: noimageindex,
|
||||
onChange: function (value) {
|
||||
updateMeta( '_noindex_seo_noimageindex', value ); },
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
// Preview section.
|
||||
activeDirectives.length > 0 && el(
|
||||
'div',
|
||||
{
|
||||
key: 'preview-section',
|
||||
style: {
|
||||
marginTop: '16px',
|
||||
padding: '12px',
|
||||
background: '#f0f6fc',
|
||||
border: '1px solid #0969da',
|
||||
borderRadius: '4px',
|
||||
}
|
||||
},
|
||||
[
|
||||
el(
|
||||
'p',
|
||||
{
|
||||
key: 'preview-label',
|
||||
style: {
|
||||
fontSize: '11px',
|
||||
fontWeight: '600',
|
||||
marginBottom: '8px',
|
||||
color: '#0969da',
|
||||
textTransform: 'uppercase',
|
||||
}
|
||||
},
|
||||
__( 'Active Directives:', 'noindex-seo' )
|
||||
),
|
||||
el(
|
||||
'code',
|
||||
{
|
||||
key: 'preview-code',
|
||||
key: 'directives-label',
|
||||
style: {
|
||||
fontSize: '12px',
|
||||
display: 'block',
|
||||
padding: '8px',
|
||||
background: '#fff',
|
||||
border: '1px solid #d0d7de',
|
||||
borderRadius: '3px',
|
||||
wordBreak: 'break-word',
|
||||
fontWeight: '600',
|
||||
marginBottom: '12px',
|
||||
color: '#1e1e1e',
|
||||
}
|
||||
},
|
||||
activeDirectives.join( ', ' )
|
||||
__( 'Robots Directives:', 'noindex-seo' )
|
||||
),
|
||||
booleanRows,
|
||||
valueRows,
|
||||
|
||||
// Preview section.
|
||||
activeDirectives.length > 0 && el(
|
||||
'div',
|
||||
{
|
||||
key: 'preview-section',
|
||||
style: {
|
||||
marginTop: '16px',
|
||||
padding: '12px',
|
||||
background: '#f0f6fc',
|
||||
border: '1px solid #0969da',
|
||||
borderRadius: '4px',
|
||||
}
|
||||
},
|
||||
[
|
||||
el(
|
||||
'p',
|
||||
{
|
||||
key: 'preview-label',
|
||||
style: {
|
||||
fontSize: '11px',
|
||||
fontWeight: '600',
|
||||
marginBottom: '8px',
|
||||
color: '#0969da',
|
||||
textTransform: 'uppercase',
|
||||
}
|
||||
},
|
||||
__( 'Active Directives:', 'noindex-seo' )
|
||||
),
|
||||
el(
|
||||
'code',
|
||||
{
|
||||
key: 'preview-code',
|
||||
style: {
|
||||
fontSize: '12px',
|
||||
display: 'block',
|
||||
padding: '8px',
|
||||
background: '#fff',
|
||||
border: '1px solid #d0d7de',
|
||||
borderRadius: '3px',
|
||||
wordBreak: 'break-word',
|
||||
}
|
||||
},
|
||||
activeDirectives.join( ', ' )
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
|||
355
changelog.txt
355
changelog.txt
|
|
@ -1,5 +1,360 @@
|
|||
== Changelog ==
|
||||
|
||||
= 3.7.0 =
|
||||
|
||||
_Release date: 2026-11-03_
|
||||
|
||||
**Highlights**
|
||||
|
||||
* Import from other SEO plugins (spec section 5): on-demand migration of the noindex / nofollow flags stored by Yoast SEO, Rank Math, SEOPress and All in One SEO into noindex SEO per-post and per-term overrides — detected from data presence (the source plugin does not need to be installed), user-confirmed, and never overwriting content that already has its own override.
|
||||
* Virtual robots.txt management (spec section 7): block (`Disallow: /`) or allow (`Allow: /`) individual crawlers, appended to the robots.txt WordPress generates virtually — never replacing it — with one-click presets for the well-known AI and search-engine crawlers. Inactive by default.
|
||||
|
||||
**Added**
|
||||
|
||||
* **Import from other plugins.** A new section on the Import / Export tab lists every supported source plugin together with how many posts and terms carry its robots flags, and imports the checked ones on explicit confirmation. The runner converts source flags into granular overrides (`_noindex_seo_override=1` plus noindex / nofollow), skips and reports content that already carries a noindex SEO override row (an explicit "off" counts as data), re-verifies LIKE-based matches (Rank Math's serialized arrays) per post so false positives are dropped, and whitelists source slugs server-side. Sources are data-driven and filterable (`noindex_seo_import_sources`) so third parties can register or correct one.
|
||||
* **Robots.txt tab.** A fourth settings tab manages up to 30 bot rules (User-agent token + block/allow policy; `*` wildcard supported, duplicates collapse, agents stripped to the robots.txt-legal charset). The rules are appended through core's `robots_txt` filter only while the feature is enabled, a live preview shows the exact block appended, and preset buttons add the well-known AI crawlers (GPTBot, ClaudeBot, Google-Extended, CCBot, Bytespider… — filterable via `noindex_seo_ai_bots`) or the main search engine crawlers (`noindex_seo_search_bots`) as blocked rules. The core output — and a physical robots.txt or "Discourage search engines" — always takes precedence.
|
||||
* The robots.txt settings ride the consolidated option and the JSON export/import.
|
||||
|
||||
**Changed**
|
||||
|
||||
* The settings page gained a fourth tab (General / SEO Settings / Import-Export / Robots.txt); the rule-table JavaScript is now shared between the conditional rules and the robots.txt tables, scoped per container.
|
||||
|
||||
**Fixed**
|
||||
|
||||
* Block editor granular overrides now save on custom post types registered without `custom-fields` support (a very common CPT registration). Without that support the REST API exposes no `meta` field for the post type, so the editor sidebar's saves were silently dropped with an HTTP 200 — the override checkbox appeared to do nothing. The plugin now adds `custom-fields` support for exactly the post types it registers meta on (while per-post granular control is enabled).
|
||||
|
||||
**Security**
|
||||
|
||||
* No new attack surface: the import handler is `manage_options` + nonce gated with whitelisted sources, writes only through the meta API after re-reading each source flag, and skips content with existing override data; robots.txt agents are charset-stripped (no newline or comment injection into the file) and policies are whitelisted; the tab form rides the existing nonce + capability path. PHPCS/PHPStan/composer audit clean.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 7.0 - 7.2
|
||||
* PHP: 8.3 - 8.6
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHPUnit: 9.6.38 (230 tests, 1152 assertions, all passing) on the WordPress 7.2-beta3 test library, run under PHP 8.3, 8.4, 8.5 and 8.6.0RC3 — including the new robots.txt sanitization/output/filter/form suites and the import detection/conversion/never-overwrite/false-positive/handler suites.
|
||||
* PHPCompatibility: 0 errors on the declared range 8.3-8.6 and on the full review range 5.6-8.6.
|
||||
* PHPCS (WordPress-Core, -Docs, -Extra) and PHPStan level 9: 0 errors.
|
||||
* Translations: Catalan and Spanish catalogs regenerated and 100% complete (209 strings each).
|
||||
|
||||
= 3.6.0 =
|
||||
|
||||
_Release date: 2026-11-03_
|
||||
|
||||
**Highlights**
|
||||
|
||||
* Modern robots directives (TODO #5): `notranslate`, `max-snippet`, `max-image-preview`, `max-video-preview` and `unavailable_after` join the five existing booleans — on every surface: the global context grid, per-post and per-term granular overrides, Quick Edit, the block editor sidebar, the REST `/effective` endpoint and WP-CLI (`name=value` tokens).
|
||||
* Conditional auto-noindex rules (TODO #11): apply `noindex` automatically to any post whose custom field (for example an ACF field) exactly matches a value; matched posts also drop out of the core XML sitemap.
|
||||
* Multisite behavior documented (TODO #9, docs variant): per-site by design, with an export/import-based rollout recipe.
|
||||
|
||||
**Added**
|
||||
|
||||
* **Value directives everywhere.** Boolean directives are flags; value directives carry a value and render as `name:value` (`max-snippet:-1`, `max-image-preview:large`, `unavailable_after: Tue, 01 Jan 2030 09:00:00 +0000` in site time with a numeric UTC offset). They are configured with typed inputs (number, size select, `datetime-local`) on the settings grid, the post meta box, Quick Edit, the term panel and the Gutenberg sidebar; stored in the consolidated option (contexts) and in `_noindex_seo_{directive}` post/term meta; registered with the REST API (`register_post_meta`/`register_term_meta` with per-type sanitization); exported/imported with normalization; and supported by WP-CLI — `wp noindex-seo set archive max-snippet=-1 max-image-preview=large`, `wp noindex-seo unset archive max-snippet` (plain name clears the value), and `list` reports the configured value (`max-snippet:-1`) or `off`.
|
||||
* **`notranslate`** as the sixth boolean directive, including a matching SVG icon in the plugin's icon registry and membership in the "Apply Recommended Defaults" set (which enables the six booleans; value directives stay untouched — "enabling" them without a value is meaningless).
|
||||
* **Conditional rules (TODO #11).** A "Conditional rules" card on the SEO Settings tab manages up to 20 exact-match rules (custom field name + value; rows with empty field/value are ignored, and the plugin's own `_noindex_seo_` meta keys are rejected). Rules run on the front-end below an explicit per-post override and above per-CPT/global defaults; matched posts surface as `source: auto_rule` in `/effective` and are excluded from the pages sitemap. The rules read plain post meta, so no ACF installation is required.
|
||||
* A `notranslate` SVG directive icon, plus badge support for value directives in the Robots columns (`max-snippet:-1` tokens).
|
||||
|
||||
**Changed**
|
||||
|
||||
* `noindex_seo_metarobots()` now takes a directive **map** (`name => true|value`); a flat list of boolean names (the pre-3.6.0 third-party calling convention) is still accepted and normalized. The `wp_robots` integration passes directive values through to core (`$robots['max-snippet'] = '-1'`).
|
||||
* `noindex_seo_get_setting()` returns the normalized string value for value directives ('' = off) instead of coercing everything to 0/1; the hourly transient cache stores values the same way.
|
||||
* The WP-CLI `set`/`unset` default (no directive arguments) now enables/disables the six boolean directives; value directives always require explicit `name=value` tokens (a value on a boolean, or an invalid/missing value, is rejected with a descriptive error). Datetime values need quoting or a `T` separator because of the space: `unavailable_after=2030-01-01T09:00`.
|
||||
* Block editor sidebar labels dropped their emoji prefixes (matching the 3.5.0 admin UI icon direction), and the sidebar gained controls for all five new directives.
|
||||
|
||||
**Fixed**
|
||||
|
||||
* Nothing.
|
||||
|
||||
**Security**
|
||||
|
||||
* No new attack surface: rules and value directives ride the existing nonce + capability paths (settings form: `manage_options` + `check_admin_referer`; meta box/Quick Edit: `edit_post`; term panel: `manage_categories`); every value normalizes through a single whitelist-driven normalizer (integers ≥ -1, a none/standard/large enum, a parse-validated datetime); rule fields strip everything but `[A-Za-z0-9_-]` and values go through `sanitize_text_field()`; sitemap rule clauses use WP_Query's `meta_query` (prepared by core). PHPCS/PHPStan/composer audit clean.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 7.0 - 7.2
|
||||
* PHP: 8.3 - 8.6
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHPUnit: 9.6.38 (216 tests, 1107 assertions, all passing) on the WordPress 7.2-beta3 test library, run under PHP 8.3, 8.4, 8.5 and 8.6.0RC3 — including the new registry/normalization, settings-merge, form-roundtrip, front-end value output, granular value overrides, REST formatted tokens, CLI name=value, rules sanitization/matching/precedence/sitemap/auto_rule suites.
|
||||
* PHPCompatibility: 0 errors on the declared range 8.3-8.6 and on the full review range 5.6-8.6.
|
||||
* PHPCS (WordPress-Core, -Docs, -Extra) and PHPStan level 9: 0 errors.
|
||||
* Translations: Catalan and Spanish catalogs regenerated and 100% complete (188/187 strings), including the previously untranslated strings found during the merge.
|
||||
|
||||
= 3.5.0 =
|
||||
|
||||
_Release date: 2026-11-03_
|
||||
|
||||
**Highlights**
|
||||
|
||||
* WooCommerce special-page contexts (TODO #8): dedicated directives for the WooCommerce Cart, Checkout and My Account pages, detected through the page-ID options (no WooCommerce code needed), recommended by default, and mirrored across the front-end, the REST `/effective` endpoint and the core XML sitemaps.
|
||||
* Compatibility window narrowed to WordPress 7.0 - 7.2 and PHP 8.3 - 8.6: `Requires at least` raised from 4.7 to 7.0, `Requires PHP` raised from 5.6 to 8.3, `Tested up to` set to WordPress 7.2 (verified on 7.2-beta3) and PHP support documented through 8.6 (verified on 8.6.0RC3).
|
||||
* Fixed `wp noindex-seo list`, which fatalled on every real WP-CLI invocation since 3.4.0 (nonexistent static API call; `--context` filter renamed to `--only` to avoid WP-CLI 2.11+'s reserved global flag).
|
||||
* Directive icons modernized for the SVG era: on WordPress 7.2+ the five directive icons render through the core Icons API — the same system WordPress 7.2 uses for its own admin chrome — while WordPress 7.0 - 7.1 keep the legacy emoji glyphs as a retrocompatible fallback.
|
||||
|
||||
**Added**
|
||||
|
||||
* **WooCommerce contexts** (`woo_cart`, `woo_checkout`, `woo_myaccount`): the Cart, Checkout and My Account pages are regular pages that conventionally deserve noindex but previously fell into the generic `page` bucket. Each now has its own context with all five directives, a "WooCommerce" section on the SEO Settings tab (rendered only when the store pages are configured), and Recommended badges — the three contexts also joined the "Apply Recommended Defaults" set (now 15 contexts).
|
||||
* Detection is option-driven (`woocommerce_cart_page_id`, `woocommerce_checkout_page_id`, `woocommerce_myaccount_page_id`): no WooCommerce class or function dependency; without WooCommerce the contexts are inert. My Account endpoints (order history, addresses) and the checkout order-pay / order-received endpoints share their parent page's ID, so they are covered automatically.
|
||||
* Precedence: the dedicated contexts run before the generic `page` context on the front-end and in `/wp-json/noindex-seo/v1/effective`, so a Woo page with directives gets them instead of the page-level ones; with no dedicated directives the page context still applies.
|
||||
* Sitemap: special pages whose context has `noindex=1` drop out of the pages sitemap even when the `page` context is not noindexed.
|
||||
* **SVG directive icons (retrocompatible).** The five robots-directive icons render as color-adaptive 16px SVGs through the WordPress Icons API (`wp_register_icon()` / `wp_get_icon()`), registered in a private `noindex-seo` icon collection — everywhere they appear: the settings grid, the post meta box, Quick Edit, and the post and taxonomy list-table Robots columns. The SVG path is gated to WordPress 7.2+, whose icon sanitizer understands the stroke-based designs (rect/circle, `stroke*` attributes) and whose registry supports private collections; on WordPress 7.0 - 7.1 the legacy emoji glyphs remain (7.1's narrower sanitizer would strip the SVGs to unstyled fragments), so rendering stays correct on every supported version — and consistent on every OS, unlike the emoji (which each platform draws differently). Follows the core direction of replacing admin dashicons with SVG (wordpress-develop#12270, landed in WP 7.2's admin chrome). The Quick Edit label strings dropped their emoji prefix; the plain directive names were already in the translation catalogs, so no translations were lost.
|
||||
|
||||
**Changed**
|
||||
|
||||
* Compatibility window: WordPress 7.0 - 7.2 (was 4.7 - 7.2), PHP 8.3 - 8.6 (was 5.6 - 8.5). The full-range PHPCompatibility scan (PHP 5.6 - 8.6) still passes clean — the code keeps its PHP 5.6-parseable syntax — but the declared and supported window is now 7.0 / 8.3 and up, per the product support policy. The runtime guards for WordPress APIs older than 7.0 remain in place as harmless no-ops and may be removed in 4.0.
|
||||
* Tooling aligned with the new window: `phpcs.xml` `testVersion` 8.3-8.6 and `minimum_supported_wp_version` 7.0, `phpstan.neon` `phpVersion` 80300, `bin/preflight.sh` gates scanning the declared range, `composer.json` PHP constraint `>=8.3`, and the obsolete `WPCompat.*` PHPStan ignores removed (every guarded hook exists since 7.0).
|
||||
* Development dependencies refreshed via `composer update`: PHPUnit 9.6.38, PHPStan 2.3.5, wordpress-stubs 7.1.2 (no CVEs; `composer audit` clean).
|
||||
* The "Apply Recommended Defaults" set grew from 12 to 15 contexts (button title and description updated; existing configurations are untouched — the button is opt-in).
|
||||
|
||||
**Fixed**
|
||||
|
||||
* `wp noindex-seo list` was broken on real WP-CLI installs since 3.4.0: the output call went to `WP_CLI\Utils::format_items()` (a static method that does not exist — the real API is the namespaced `WP_CLI\Utils\format_items()` function), and the `--context` filter parameter collided with the `--context` global flag reserved by WP-CLI 2.11+, so the value never reached the handler. The filter is now `--only=<context>` and the command renders through the real function API. The unit-test stub was aligned with the real WP-CLI surface (namespaced function, not a Utils class), and every `wp noindex-seo` command was smoke-tested against the real WP-CLI 2.12 phar.
|
||||
|
||||
**Security**
|
||||
|
||||
* No security changes; the new contexts reuse the consolidated settings storage and existing sanitization paths, and PHPCS/PHPStan/composer audit stay clean.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 7.0 - 7.2
|
||||
* PHP: 8.3 - 8.6
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHPUnit: 9.6.38 (198 tests, 817 assertions, all passing) on the WordPress 7.2-beta3 test library, run under PHP 8.3, 8.4, 8.5 and 8.6.0RC3 — including the icon registration, SVG rendering, emoji fallback and admin-markup tests.
|
||||
* PHPCompatibility: 0 errors on the declared range 8.3-8.6 and on the full review range 5.6-8.6.
|
||||
* PHPCS (WordPress-Core, WordPress-Docs, WordPress-Extra) and PHPStan level 9: 0 errors.
|
||||
|
||||
= 3.4.0 =
|
||||
|
||||
_Release date: 2026-09-19_
|
||||
|
||||
**Highlights**
|
||||
|
||||
* WP-CLI support (TODO #7): a `wp noindex-seo` command namespace with list, set, unset, export, import and bulk per-post overrides — automation-friendly and scaling past the ~200-post ceiling of the bulk UI.
|
||||
|
||||
**Added**
|
||||
|
||||
* **WP-CLI commands.** `wp noindex-seo list [--context=] [--format=table|csv|json|yaml]` (every context × directive pair with its status), `wp noindex-seo set <context> [<directive>...]` / `wp noindex-seo unset <context> [<directive>...]` (default: all five directives; saving clears the transient cache), `wp noindex-seo export [<file>]` (JSON payload to STDOUT or a file, same as the tools tab), `wp noindex-seo import <file> [--dry-run]` (same validation and sanitization as the import form; `--dry-run` reports the number of values that would change), and `wp noindex-seo override <post_id>... [--off]` (bulk per-post granular overrides without the UI's selection limit; `--off` clears the override and directive meta). The commands enforce the same rules as the settings page: unknown contexts/directives are rejected and the attachment context refuses to enable while the implementation method is meta-only.
|
||||
* `stubs/wp-cli-stubs.php`: minimal WP-CLI signatures for PHPStan and a recording stub for the test suite (never shipped; excluded from the release ZIP and from PHPCS).
|
||||
* The undefined "migrate-attachments" command from the original TODO was replaced by the general-purpose `override` bulk command, which covers the same need for every post type.
|
||||
|
||||
**Changed**
|
||||
|
||||
* Nothing.
|
||||
|
||||
**Fixed**
|
||||
|
||||
* Nothing.
|
||||
|
||||
**Security**
|
||||
|
||||
* No security changes; the CLI handlers reuse the existing validated/sanitized helpers, operator-supplied file paths are checked with `is_readable()` before reading, and PHPCS/PHPStan/composer audit stay clean.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 4.7 - 7.2
|
||||
* PHP: 5.6 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHPUnit: 9.6.36 (185 tests, all passing): command registration, set/unset round-trips (including transient invalidation and defaults), unknown context/directive rejection, the attachment header-only invariant, list rows and filtering, export to STDOUT and file, import dry-run/apply/rejection, and override enable/disable/skip-missing.
|
||||
|
||||
= 3.3.0 =
|
||||
|
||||
_Release date: 2026-09-19_
|
||||
|
||||
**Highlights**
|
||||
|
||||
* The settings page is reorganized with the native WordPress tab navigation (General / SEO Settings / Import-Export) and titled sections, built exclusively on core `nav-tab` classes with URL-based switching — no proprietary tab CSS or JavaScript.
|
||||
|
||||
**Added**
|
||||
|
||||
* Native WordPress tab navigation on the settings page (`nav-tab-wrapper` / `nav-tab`, the same pattern as the core Updates and Plugins screens): General (implementation method and configuration options), SEO Settings (the directive grid), and Import / Export (the JSON tools). Tabs switch through the `tab` query parameter and the active panel renders server-side, so they work without JavaScript and are bookmarkable.
|
||||
* Titled sections inside the tabs: "Recommended settings" (one-click defaults), "Overview" (the number cards) and "Page contexts" (the directive grid) on SEO Settings; "Export settings" and "Import settings" headers on the Import / Export tab. Spacing added between the tab bar and the content below.
|
||||
|
||||
**Changed**
|
||||
|
||||
* `noindex_seo_process_form()` is now tab-scoped: saving from the General tab updates only the configuration and preserves the directive grid, saving from SEO Settings updates only the directives and preserves the configuration — hidden tabs can no longer reset each other's values. The form carries a `noindex_seo_form_scope` marker and the redirect returns to the tab the user saved from.
|
||||
* The header-only restriction for the attachment context now follows the saved implementation method (the method select lives on the General tab), and switching the method to meta/HTML-only from General zeroes the attachment directives to keep the invariant consistent.
|
||||
* The apply-suggestions redirect and the import success/error redirects return to their source tabs (`tab=settings`, `tab=tools`).
|
||||
* Removed the dead custom tab machinery: the `.noindex-seo-tab*` CSS rules, the `initTabs()` JavaScript with its localStorage persistence, and the unused `.noindex-seo-apply-note` class (previously flagged as dead code by the 3.1.6 deploy audit).
|
||||
|
||||
**Fixed**
|
||||
|
||||
* Nothing.
|
||||
|
||||
**Security**
|
||||
|
||||
* No security changes; the tab parameter is strictly safelisted server-side (`sanitize_key` + allow list) and PHPCS/PHPStan/composer audit stay clean.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 4.7 - 7.2
|
||||
* PHP: 5.6 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHPUnit: 9.6.36 (172 tests, all passing): tab markup (three tabs, active class, unknown-tab fallback), per-tab rendering isolation, scope-aware saving (config-only / grid-only / preserve-other-side / attachment invariant / tab-aware redirect), and section ordering.
|
||||
|
||||
= 3.2.0 =
|
||||
|
||||
_Release date: 2026-09-18_
|
||||
|
||||
**Highlights**
|
||||
|
||||
* Two roadmap features: JSON export/import of the settings (#6) and runtime conflict verification against the `wp_robots` API (#10).
|
||||
|
||||
**Added**
|
||||
|
||||
* **Export / Import of settings (JSON).** Two new controls on the settings page: "Export settings" downloads the consolidated settings as a JSON file (`noindex-seo-settings-{date}.json`), and "Import settings" restores the global settings from a previously exported file. Imports are strictly validated and sanitized: plugin marker check, 1 MB size limit, `is_uploaded_file()` verification, the upload is never persisted to the uploads directory, every directive is normalized to 0/1, config values go through the same safelists as the settings form, and contexts that do not exist on the importing site (e.g. custom post types from another install) are dropped. Per-post and per-term granular overrides are content data and are never touched by an import. Both actions require `manage_options` and a nonce; success and error notices survive the redirect.
|
||||
* **Runtime conflict verification (TODO #10).** When no known SEO plugin conflicts, `noindex_seo_detect_conflicts()` now also inspects the callbacks actually registered on the `wp_robots` filter (WordPress 5.7+): anything that is not a core callback or one of ours — a foreign function, a class method, or a closure from a theme or unknown plugin — produces a dismissible admin notice naming the detected callback. The core callback safelist is filterable via `noindex_seo_core_robots_callbacks`. The notice honours the existing "disable compatibility warnings" opt-out.
|
||||
|
||||
**Changed**
|
||||
|
||||
* Nothing.
|
||||
|
||||
**Fixed**
|
||||
|
||||
* Nothing.
|
||||
|
||||
**Security**
|
||||
|
||||
* No security changes; the new endpoints follow the canonical checklist (capability + nonce on both actions, strict input validation, safelisted config values, no persistence of uploads) and PHPCS/PHPStan/composer audit stay clean.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 4.7 - 7.2
|
||||
* PHP: 5.6 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHPUnit: 9.6.36 (165 tests, all passing): export payload shape and JSON round-trip, import sanitizer (happy path, normalization, unknown-context dropping, malformed-payload rejection), handler guards, foreign-callback detection (functions, class methods, closures, own-prefix skipping, filterable safelist) and the runtime notice.
|
||||
|
||||
= 3.1.6 =
|
||||
|
||||
_Release date: 2026-09-18_
|
||||
**Highlights**
|
||||
|
||||
* Admin UI modernization: all inline styles removed in favour of WordPress admin color-scheme-aware, RTL-ready classes (audit finding M7), plus the two minor items deferred from the 3.1.5 deploy audit (stale wp_die message, unreachable REST fallbacks).
|
||||
|
||||
**Added**
|
||||
|
||||
* Regression tests locking in the new UI conventions: the settings page and meta box render without any `style="..."` attribute, and the stylesheet is verified to load on the post-list / post-edit / term-edit screens (gated by the granular flags) while staying off everything else.
|
||||
|
||||
**Changed**
|
||||
|
||||
* All 61 inline `style="..."` attributes removed from the settings page, post meta box, term edit panel, Quick Edit, and the post/term list "Robots" columns. Styling now lives in `assets/css/admin.css` under semantic class names.
|
||||
* Admin styling now follows the WordPress admin color scheme: accents use `var(--wp-admin-theme-color, #2271b1)`, status boxes and badges use the core admin palette, and neutral grays match wp-admin. The UI adapts to Light / Blue / Midnight / Coffee / Ocean / etc. instead of hardcoded Material-Design colors.
|
||||
* RTL support: layout uses logical CSS properties (`margin-inline-start`, `border-inline-start`) and the toggle switch mirrors under `[dir="rtl"]`.
|
||||
* Dynamic visibility (override toggles in the meta box and term panel) uses the core `.hidden` class with `classList.toggle()` instead of inline `display` manipulation.
|
||||
* `assets/css/admin.css` also enqueues on the admin screens where the plugin renders UI (post list, post editor, term editor), gated by the granular-control flags; the interactive JavaScript remains settings-page-only.
|
||||
* Admin stylesheet cleanup: duplicate `.noindex-seo-view-link` rule block removed; keyframe names prefixed to avoid collisions.
|
||||
|
||||
**Fixed**
|
||||
|
||||
* Stale `wp_die()` message in the two form handlers: after the 3.1.5 nonce split only the capability path is reachable there, so the message is now "Permission denied." instead of "Permission denied or invalid nonce." (deploy-audit finding I2). Catalan and Spanish translations and the `.pot` template updated; `.mo` files recompiled.
|
||||
* Unreachable `function_exists( 'rest_authorization_required_code' )` ternaries removed from both REST permission callbacks — the function exists on every supported WordPress version (deploy-audit finding I5).
|
||||
|
||||
**Security**
|
||||
|
||||
* No security changes; the full canonical checklist (`AGENTS-security.md`), PHPCS security sniffs and `composer audit` remain clean.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 4.7 - 7.2
|
||||
* PHP: 5.6 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHPUnit: 9.6.36 (150 tests, all passing). Coverage maintained above the 80% floor.
|
||||
|
||||
= 3.1.5 =
|
||||
|
||||
_Release date: 2026-09-18_
|
||||
|
||||
**Highlights**
|
||||
|
||||
* Maintenance review: composer update, code review, security review and compatibility review (WordPress 4.7 - 7.2, PHP 5.6 - 8.5). Declared WordPress floor corrected to the real tested minimum (4.7). Test suite expanded to 147 tests with 94.78% line coverage, meeting the 80% AGENTS target.
|
||||
|
||||
**Added**
|
||||
|
||||
* 76 new PHPUnit tests: front-end output (`noindex_seo_metarobots`, all major `noindex_seo_show` contexts, overrides, CPT defaults, transient shortcut), admin surface (settings page, meta boxes, Quick Edit, bulk actions, columns, filters, enqueues, conflict detection, helpers), sitemap per-term exclusion, and uninstall cleanup.
|
||||
|
||||
**Changed**
|
||||
|
||||
* Minimum WordPress requirement raised from 4.0 to 4.7 in the plugin header, `readme.txt` and `phpcs.xml` (`minimum_supported_wp_version`). Version 4.7 is the oldest release in the tested range and the first with the complete REST API, so every advertised feature (including the `/wp-json/noindex-seo/v1/` endpoints) is available on all supported versions. Newer-API integrations keep degrading gracefully above the floor (`wp_robots` 5.7+, sitemaps 5.5+, block editor 5.0+, `register_post_meta`, term meta).
|
||||
* Tested up to WordPress 7.2 in `readme.txt`.
|
||||
* Removed three now-obsolete `WPCompat` PHPStan ignores (`rest_api_init` action, `WP_REST_Request::get_param()` × 2): with the 4.7 floor those APIs always exist, and PHPStan reports unmatched ignores as errors.
|
||||
* Dev dependencies updated via `composer update` (`phpstan/phpstan` 2.2.8 → 2.2.14, `nikic/php-parser` 5.8.0 → 5.9.0, `php-stubs/wordpress-stubs` 6.9.4 → 7.1.0, `szepeviktor/phpstan-wordpress` 2.0.3 → 2.0.4, `wp-hooks/wordpress-core` 1.12.0 → 1.13.0). No production code ships these packages.
|
||||
* Coverage regression floor in `bin/preflight.sh` raised from 25% to 80% now that the suite meets the AGENTS target.
|
||||
|
||||
**Fixed**
|
||||
|
||||
* Dead nonce check in `noindex_seo_process_form()` and `noindex_seo_process_apply_suggestions()`: `! check_admin_referer()` with a specific action can never be true (the function exits on failure instead of returning false), so the `||` branch was dead code flagged by PHPStan level 9 with the updated WordPress stubs. Both handlers now check `current_user_can( 'manage_options' )` first and call `check_admin_referer()` separately, which dies on an invalid nonce. No behavior change for valid requests.
|
||||
|
||||
**Security**
|
||||
|
||||
* Full canonical checklist (`AGENTS-security.md`) reviewed against the release diff: no findings. Input validation (safelist + strict types), sanitization (`sanitize_text_field`, `absint`, `sanitize_key`), late output escaping, nonces on every state-changing action, capability checks in UI and execution logic, `$wpdb->prepare()` on all custom SQL, no dangerous functions, REST `permission_callback`s intact, no secrets in code. `composer audit` clean.
|
||||
* The nonce-handler fix above is hardening only: the previous code was still safe in practice because `check_admin_referer()` dies on failure.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 4.7 - 7.2
|
||||
* PHP: 5.6 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHP Coding Standards: 3.13.6
|
||||
* WordPress Coding Standards: 3.4.1
|
||||
* PHPUnit: 9.6.36 (147 tests, 569 assertions — all passing on WordPress 7.1.1 test library; staging site runs WordPress 7.2-alpha, PHP 8.5.10, MariaDB 11.8.9)
|
||||
* PHPCompatibility 5.6-8.5 scan: clean (declared PHP floor 5.6 confirmed)
|
||||
* PHPStan level 9: clean; `bin/preflight.sh`: full PASS (coverage 94.78%, above the 80% AGENTS target and floor)
|
||||
|
||||
= 3.1.3 =
|
||||
|
||||
_Release date: 2026-08-17_
|
||||
|
||||
**Highlights**
|
||||
|
||||
* Compatibility release: WordPress 4.0+ and PHP 5.6+ supported again (declared floors now match the real compatibility of the code), and branding moved to robotstxt.software.
|
||||
|
||||
**Added**
|
||||
|
||||
* Classic `<meta name="robots">` output on `wp_head` for WordPress versions older than 5.7, restoring the pre-`wp_robots` fallback so the declared WordPress 4.0 floor is real. On WordPress 5.7+ the directives keep flowing through the core `wp_robots` API.
|
||||
* `noindex_seo_get_cpt_label()` helper returning a safe display label for custom post types on the settings page.
|
||||
|
||||
**Changed**
|
||||
|
||||
* Minimum requirements lowered back to WordPress 4.0 and PHP 5.6 in the plugin header, `readme.txt`, `composer.json` and `phpcs.xml`, verified with a full-range PHPCompatibility 5.6-8.5 scan (clean) and the WP-Compat report.
|
||||
* Plugin URI and Author URI now point to robotstxt.software.
|
||||
* `register_setting()` calls use the two-argument form: the `$args` array parameter requires WordPress 4.7+, and all sanitization already happens in the admin-post form handler.
|
||||
|
||||
**Fixed**
|
||||
|
||||
* Potential fatal errors on older WordPress versions: `is_privacy_policy()` (WP 5.2+), `is_customize_preview()`, `get_term_meta()` (WP 4.4+), `register_post_meta()`, `register_term_meta()`, `wp_set_script_translations()` (WP 5.0+) and `WP_Screen::is_block_editor` (WP 5.0+) are now guarded; the features that depend on them degrade gracefully instead of crashing.
|
||||
* Removed PHP 7-only syntax (strict types, scalar type hints, return type declarations, null coalescing operator) so the code parses and runs on PHP 5.6 as declared.
|
||||
* Restored the repository governance files (`CLAUDE.md`, `.claude/settings.json`) that were accidentally dropped from the repository during the 3.1.2 release cleanup.
|
||||
* Bundled translations (Catalan and Spanish) regenerated against the current source: 9 strings added in 3.0.2–3.1.0 are now translated, 7 fuzzy entries reviewed, 149 messages complete per locale with 0 untranslated and 0 fuzzy.
|
||||
|
||||
**Security**
|
||||
|
||||
* No security changes; the 5.6-8.5 PHPCompatibility scan, the dependency audit and the WordPress Coding Standards security sniffs are clean.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 4.0 - 7.1
|
||||
* PHP: 5.6 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHP Coding Standards: 3.13.6
|
||||
* WordPress Coding Standards: 3.4.1
|
||||
* PHPUnit: 9.6.36 (71 tests, 385 assertions)
|
||||
|
||||
= 3.1.2 [2026-08-10] =
|
||||
|
||||
Audit-driven maintenance release.
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
3928
noindex-seo.php
3928
noindex-seo.php
File diff suppressed because it is too large
Load diff
420
readme.txt
420
readme.txt
|
|
@ -1,11 +1,11 @@
|
|||
=== noindex SEO ===
|
||||
Contributors: javiercasares
|
||||
Contributors: robotstxt, javiercasares
|
||||
Tags: seo, noindex, nofollow, noarchive, robots
|
||||
Requires at least: 5.7
|
||||
Tested up to: 7.1
|
||||
Stable tag: 3.1.2
|
||||
Requires PHP: 7.2
|
||||
Version: 3.1.2
|
||||
Requires at least: 7.0
|
||||
Tested up to: 7.2
|
||||
Stable tag: 3.7.0
|
||||
Requires PHP: 8.3
|
||||
Version: 3.7.0
|
||||
License: GPL-3.0-or-later
|
||||
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
||||
|
||||
|
|
@ -13,9 +13,9 @@ Control search engine indexing with robots directives using HTML meta tags or HT
|
|||
|
||||
== Description ==
|
||||
|
||||
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.
|
||||
Fine-grained control over how search engines index and display your WordPress content. Apply 10 robots directives to 25 different page contexts with flexible implementation methods.
|
||||
|
||||
**5 Robots Directives:**
|
||||
**5 Boolean Robots Directives:**
|
||||
|
||||
* **noindex**: Prevent search engines from indexing the page
|
||||
* **nofollow**: Prevent search engines from following links on the page
|
||||
|
|
@ -23,6 +23,16 @@ Fine-grained control over how search engines index and display your WordPress co
|
|||
* **nosnippet**: Prevent search engines from showing text snippets in results
|
||||
* **noimageindex**: Prevent search engines from indexing images on the page
|
||||
|
||||
**5 Value Robots Directives (3.6.0):**
|
||||
|
||||
* **notranslate**: Ask search engines not to translate the page
|
||||
* **max-snippet**: Limit the text snippet length in characters (-1 = no limit)
|
||||
* **max-image-preview**: Limit the image preview size (none / standard / large)
|
||||
* **max-video-preview**: Limit the video preview length in seconds (-1 = no limit)
|
||||
* **unavailable_after**: Stop indexing the page after a date and time
|
||||
|
||||
**Conditional rules (3.6.0):** automatically apply noindex to any post whose custom field (for example an ACF field) exactly matches a value you define.
|
||||
|
||||
**Implementation Methods:**
|
||||
|
||||
* HTML Meta Tags: Traditional method, easy to verify in page source (default)
|
||||
|
|
@ -31,7 +41,7 @@ Fine-grained control over how search engines index and display your WordPress co
|
|||
|
||||
**Control Levels:**
|
||||
|
||||
* Global Settings: Apply directives to 22 different page contexts (posts, pages, archives, etc.)
|
||||
* Global Settings: Apply directives to 25 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
|
||||
|
||||
**Perfect for:**
|
||||
|
|
@ -68,6 +78,12 @@ Fine-grained control over how search engines index and display your WordPress co
|
|||
* Time: Block the indexing when an hourly, "minutely", or "secondly" archive of the site. The lists where the posts appear.
|
||||
* Year: Block the indexing when a yearly archive of the site. The lists where the posts appear.
|
||||
|
||||
**WooCommerce**
|
||||
|
||||
* Cart: Block the indexing of the WooCommerce cart page.
|
||||
* Checkout: Block the indexing of the WooCommerce checkout page.
|
||||
* My Account: Block the indexing of the WooCommerce customer account pages (including order history and address endpoints).
|
||||
|
||||
**Archives**
|
||||
|
||||
* Archive: Block the indexing of any type of Archive page. Category, Tag, Author and Date based pages are all types of Archives. The lists where the posts appear.
|
||||
|
|
@ -97,6 +113,54 @@ Fine-grained control over how search engines index and display your WordPress co
|
|||
|
||||
Important note: if you have any doubt about any of the following items it is best not to activate the option as you could lose results in the search engines.
|
||||
|
||||
== Using the plugin ==
|
||||
|
||||
= WP-CLI =
|
||||
|
||||
The plugin ships a `wp noindex-seo` command namespace (WP-CLI 2.x required):
|
||||
|
||||
* `wp noindex-seo list [--only=<context>] [--format=<format>]` — lists every context × directive pair and its on/off status (table, csv, json or yaml).
|
||||
* `wp noindex-seo set <context> [<directive>...]` — enables directives on a context (default: all six boolean directives). Boolean directives go by name; value directives as `name=value`: `wp noindex-seo set search noindex noarchive`, `wp noindex-seo set archive max-snippet=-1 max-image-preview=large`.
|
||||
* `wp noindex-seo unset <context> [<directive>...]` — disables directives on a context.
|
||||
* `wp noindex-seo export [<file>]` — prints the settings payload as JSON to STDOUT, or writes it to a file.
|
||||
* `wp noindex-seo import <file> [--dry-run]` — restores settings from an export; `--dry-run` reports how many values would change without saving.
|
||||
* `wp noindex-seo override <post_id>... [--off]` — bulk per-post granular overrides; scales past the ~200-post ceiling of the bulk UI. `--off` also clears the directive meta.
|
||||
|
||||
The commands enforce the same rules as the settings page (unknown contexts and directives are rejected; the attachment context refuses to enable while the implementation method is meta-only).
|
||||
|
||||
= Export / Import =
|
||||
|
||||
The settings page includes an "Export settings" button that downloads the current global settings as a JSON file, and an "Import settings" form that restores them on the same or another site (useful for migrations and staging-to-production copies). Imports are strictly validated, and per-post / per-term overrides are never touched.
|
||||
|
||||
= Robots.txt =
|
||||
|
||||
A dedicated "Robots.txt" tab extends the robots.txt that WordPress generates virtually with bot rules — it never replaces the core output and is inactive until you enable it:
|
||||
|
||||
* Block (`Disallow: /`) or allow (`Allow: /`) individual crawlers, with `*` wildcard rules supported.
|
||||
* One-click presets add the well-known AI crawlers (GPTBot, ClaudeBot, Google-Extended, CCBot, Bytespider…) or the main search engine crawlers (Googlebot, Bingbot, DuckDuckBot…) as blocked rules — edit them freely afterwards. Both lists are filterable.
|
||||
* Rules only apply when WordPress serves robots.txt itself: a physical robots.txt file in the site root, or "Discourage search engines" in Reading settings, takes precedence.
|
||||
|
||||
= Import from other plugins =
|
||||
|
||||
The "Import / Export" tab detects robots data left by other SEO plugins — Yoast SEO, Rank Math, SEOPress and All in One SEO (installed or not) — and imports their noindex / nofollow flags as per-post and per-term overrides. Nothing imports automatically: you pick the detected plugins and confirm. Content that already has its own override — even a disabled one — is never touched and is reported as skipped.
|
||||
|
||||
= REST API =
|
||||
|
||||
The plugin exposes two read-only endpoints under `/wp-json/noindex-seo/v1/` so headless consumers can read the configuration:
|
||||
|
||||
* `GET /settings`: returns the consolidated settings array (contexts and directives plus config). Requires an authenticated user with the `manage_options` capability.
|
||||
* `GET /effective?post_id=123`: returns the list of active directives for a specific post, computed with the same precedence used on the front-end (per-post override, then conditional rules, then per-post-type default, then the built-in context). Value directives return as `name:value` tokens (e.g. `max-snippet:-1`); `source` is `post_meta`, `auto_rule` (a conditional rule matched) or `global_setting`. Public only for published, non-password-protected posts; everything else requires `edit_post` capabilities.
|
||||
|
||||
On WordPress versions with XML sitemaps (5.5+), URLs that are noindexed are automatically excluded from the core sitemaps.
|
||||
|
||||
== Multisite ==
|
||||
|
||||
The plugin is designed **per site** and works on WordPress Multisite when activated on each site individually (or via the Network Admin's "Add Plugin" per-site flow):
|
||||
|
||||
* Directives are site-content concerns, so every site keeps its own independent settings, per-post overrides, per-term overrides and conditional rules (stored per site, no network-wide storage).
|
||||
* There is no network-admin settings page and no `Network: true` header by design: activating the plugin network-wide would apply each site's own settings anyway (each site reads its own options), so per-site activation is the intended and documented mode.
|
||||
* To roll out the same configuration across sites, use the built-in export/import (Tools tab, JSON) or `wp noindex-seo export` / `wp noindex-seo import` per site — for example with WP-CLI's `--url` switch.
|
||||
|
||||
== Installation ==
|
||||
|
||||
= Automatic download =
|
||||
|
|
@ -107,329 +171,44 @@ Visit the plugin section in your WordPress, search for [noindex-seo]; download a
|
|||
|
||||
Extract the contents of the ZIP and upload the contents to the `/wp-content/plugins/noindex-seo/` directory. Once uploaded, it will appear in your plugin list.
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= Does the noindex directive remove the URL from the XML sitemap? =
|
||||
|
||||
Yes. On WordPress 5.5 or newer, any URL that receives a noindex directive from the plugin is excluded from the core XML sitemaps (`/wp-sitemap.xml`), both through the global context settings and through the granular per-post / per-term overrides.
|
||||
|
||||
= What is the difference between the HTML meta tags and the HTTP headers implementation methods? =
|
||||
|
||||
Both send the same robots directives to search engines. The meta tag method outputs a `<meta name="robots">` tag in the HTML head and is easy to verify in the page source. The HTTP header method sends an `X-Robots-Tag` header, which also works for non-HTML content such as PDFs, images and feeds. The "Both" method sends the two signals at the same time.
|
||||
|
||||
= Will I lose my settings when I uninstall the plugin? =
|
||||
|
||||
No. By default all plugin data is preserved on uninstall. If you want a complete cleanup, enable the "Delete all plugin data on uninstall" option in the settings page before removing the plugin.
|
||||
|
||||
== Compatibility ==
|
||||
|
||||
* WordPress: 5.7 - 7.1
|
||||
* PHP: 7.2 - 8.5
|
||||
* WordPress: 7.0 - 7.2
|
||||
* PHP: 8.3 - 8.6
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 3.1.2 [2026-08-10] =
|
||||
= 3.7.0 =
|
||||
|
||||
Audit-driven maintenance release.
|
||||
Feature release: on-demand import of robots overrides from other SEO plugins (Yoast SEO, Rank Math, SEOPress, All in One SEO — detected with or without them installed, never overwriting existing data) and virtual robots.txt management: block or allow individual crawlers (AI and search-engine presets included) appended to the robots.txt WordPress generates, inactive by default.
|
||||
|
||||
**Security**
|
||||
= 3.6.0 =
|
||||
|
||||
* Fixed the composer-audit gate in `bin/preflight.sh`. The previous version grepped for "security vulnerability advisory" (singular), which never matched Composer's actual output "security vulnerability advisories" (plural) — the y→i pluralization change silently disabled CVE detection, green-lighting every release regardless of known vulnerabilities. The gate now uses Composer's bitmask exit code (bit 0 = security), which is immune to wording changes.
|
||||
* Bumped `squizlabs/php_codesniffer` to ^3.13.6 and `wp-coding-standards/wpcs` to ^3.4.1, fixing CVE-2026-67434 (OS command injection) and CVE-2026-45293 (arbitrary code execution) in the development tooling. These are dev-only dependencies and were never shipped in the release ZIP.
|
||||
Feature release: 5 modern robots directives (notranslate, max-snippet, max-image-preview, max-video-preview, unavailable_after) available on every surface — global contexts, per-post and per-term overrides, Quick Edit, the block editor sidebar, REST and WP-CLI (name=value tokens); conditional auto-noindex rules that apply noindex when a custom field (e.g. an ACF field) exactly matches a value (matched posts also drop out of the XML sitemap); Multisite behavior documented (per-site by design, with export/import-based rollout).
|
||||
|
||||
**Fixed**
|
||||
= 3.5.0 =
|
||||
|
||||
* Nested `<form>` elements on the settings page. The "Apply Recommended Defaults" form was physically nested inside the main settings form — HTML5 forbids this, and the stray `</form>` could close the main form early, orphaning the "Save Changes" button and all directive checkboxes. The apply-suggestions form is now a standalone sibling rendered before the main form.
|
||||
* Meta-box "Effective Directives" reference panel now reads from the consolidated `noindex_seo_settings` option via `noindex_seo_get_setting()` instead of the stale legacy individual options that may diverge after a settings save.
|
||||
WooCommerce special-page contexts: dedicated robots directives for the Cart, Checkout and My Account pages (detected through the page-ID options, no WooCommerce code needed), recommended by default and mirrored across the front-end, the REST /effective endpoint and the core XML sitemaps. Compatibility window updated to WordPress 7.0 - 7.2 and PHP 8.3 - 8.6 (tested on WordPress 7.2-beta3 and PHP 8.6.0RC3). The five directive icons now render as SVG through the WordPress Icons API on WP 7.2+ (legacy emoji fallback on WP 7.0 - 7.1), matching the SVG direction of the WordPress 7.2 admin. Fixed the `wp noindex-seo list` command, which fatalled on real WP-CLI installs (its `--context` filter collided with WP-CLI 2.11+'s reserved global flag, now `--only`, and the output call used a nonexistent API).
|
||||
|
||||
**Added**
|
||||
= Previous versions =
|
||||
|
||||
* `load_plugin_textdomain('noindex-seo')` hooked on `init`. The plugin ships `.mo` files for Catalan and Spanish (es_ES) in `languages/`, but without this call WordPress only loaded translations from `wp-content/languages/plugins/` — the bundled translations were effectively dead code.
|
||||
* PHPUnit coverage measurement in `bin/preflight.sh` (requires Xdebug). Enforces a 25% regression floor against the current 26.64% baseline; the AGENTS target remains 80%.
|
||||
* `<coverage>` configuration in `phpunit.xml` so `--coverage-text` produces a report.
|
||||
* `README.md` for developer and contributor onboarding.
|
||||
* `tests/wp-tests-config.sample.php` template. The real `tests/wp-tests-config.php` is now gitignored and reads from environment variables.
|
||||
If you want to see the full changelog, visit the [noindex SEO plugin page](https://www.robotstxt.software/plugins/noindex-seo/).
|
||||
|
||||
**Changed**
|
||||
|
||||
* Pinned all remaining wildcard `"*"` dev dependencies to caret constraints in `composer.json` (`phpcsutils` ^1.2, `php-compatibility` ^9.3, `dealerdirect/phpcodesniffer-composer-installer` ^1.2). Unpinned ranges were how the CVE-affected versions were resolved.
|
||||
* Lowered `phpstan.neon` `phpVersion` from 80500 (PHP 8.5) to 80200 (PHP 8.2) so PHPStan flags any accidental use of PHP 8.3+ syntax that would break on the development floor.
|
||||
* Refreshed `CLAUDE.md` to reflect 3.1.x reality (version, line count, v3 consolidated storage model, four-priority output logic, current 8-file test suite). Documented the uninstall direct-DB exception.
|
||||
* Updated `TODO.md` to mark shipped items (#1–#4).
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 5.7 - 7.1
|
||||
* PHP: 7.2 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* 71 tests, 385 assertions — all passing. Coverage measured at 26.64% (471/1768 lines).
|
||||
|
||||
= 3.1.1 [2026-07-18] =
|
||||
|
||||
**Security**
|
||||
|
||||
* Tightened the ACL on the two REST endpoints introduced in 3.1.0. The original release used `__return_true` for both `permission_callback`s, which would have leaked the full noindex configuration to anyone hitting `/wp-json/noindex-seo/v1/settings`. Fixed callbacks:
|
||||
- `/settings` now requires `manage_options`. The consolidated array reveals the site's full SEO strategy in a single response, so it is admin-only.
|
||||
- `/effective?post_id=N` is public only for posts with `post_status=publish` and no password (the directives for those would appear in the HTML `<meta>` tag of the rendered page anyway). Drafts, private posts, scheduled posts, password-protected posts, and trashed posts require `edit_post` capability for the specific post.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 5.7 - 7.1
|
||||
* PHP: 7.2 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* Added 4 tests covering the new permission model: unauthenticated rejected on `/settings`, editor rejected on `/settings`, unauthenticated/subscriber rejected on `/effective` for drafts, public access preserved on `/effective` for published posts.
|
||||
|
||||
= 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**
|
||||
|
||||
* Moved the "Apply Recommended Defaults" button from above the Search Results section to immediately above the "Search options…" input box. The previous position pushed the button below the fold on smaller screens; the new position sits it next to the search field where users naturally look for global actions.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 5.7 - 7.1
|
||||
* PHP: 7.2 - 8.5
|
||||
|
||||
= 3.0.3 [2026-07-18] =
|
||||
|
||||
**Added**
|
||||
|
||||
* **"Robots" column on taxonomy list tables.** When per-term granular control is on, the Categories / Tags / custom taxonomy list pages now show a "Robots" column with the same directive badges (🔍 noindex, 🔗 nofollow, 💾 noarchive, 📄 nosnippet, 🖼️ noimageindex) used on the post list. Makes it possible to scan at a glance which terms have an override and which directives are active — parity with the existing post-list UX.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 5.7 - 7.1
|
||||
* PHP: 7.2 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* Added 3 tests covering the term column renderer (no override, with override, passthrough for other columns).
|
||||
|
||||
= 3.0.2 [2026-07-18] =
|
||||
|
||||
**Fixed**
|
||||
|
||||
* Duplicate "Search Engine Visibility" panel in the block editor. The plugin previously registered both a classic PHP meta box (`add_meta_box`) AND a native Gutenberg sidebar panel (`PluginDocumentSettingPanel` via `assets/js/editor-sidebar.js`) with the same title — both showed up in the block editor sidebar as two panels with the same name. The classic meta box is now suppressed on block-editor screens (detected via `get_current_screen()->is_block_editor`, which respects the Classic Editor plugin's per-request override). Classic editor users still get the meta box.
|
||||
|
||||
**Added**
|
||||
|
||||
* **Per-term granular control for taxonomies.** Mirrors the existing per-post granular pattern: when "Enable per-term granular control" is on, every public taxonomy (`category`, `post_tag`, and any custom public taxonomy like WooCommerce's `product_cat` / `product_tag`) gets a "Search Engine Visibility" panel on the Edit Tag screen with an override checkbox and the five directive checkboxes. Term-level directives take precedence over the global `category` / `tag` / `post_type_archive` settings when the term has the override enabled. Backed by `register_term_meta()` with `show_in_rest=true` so headless consumers can read them.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 5.7 - 7.1
|
||||
* PHP: 7.2 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* Added `tests/test-term-meta.php` covering registration, save handler, front-end override precedence, and uninstall cleanup.
|
||||
|
||||
= 3.0.1 [2026-07-18] =
|
||||
|
||||
**Fixed**
|
||||
|
||||
* Self-healing v3 migration. If `noindex_seo_config_version` claims migration completed (version >= 3) but the consolidated `noindex_seo_settings` option is somehow missing, `noindex_seo_check_migration()` now re-runs the migration automatically. This recovers silently from partial failures: object-cache staleness after the write, request interrupted mid-migration, a third-party plugin clearing options, or DB write errors that did not raise a PHP error. Without this guard, the front-end would fall back to all-zero defaults (site fully indexable) until someone re-saved the settings page.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 5.7 - 7.1
|
||||
* PHP: 7.2 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* Added test for the self-healing migration path.
|
||||
|
||||
= 3.0.0 [2026-07-18] =
|
||||
|
||||
**Major release — storage consolidation.** Settings are now stored in a single autoloaded option (`noindex_seo_settings`) instead of ~110 individual options. Reduces `wp_options` autoload weight on every page load. Legacy options are preserved (marked non-autoloaded) for one major version to allow safe rollback to 2.x; they will be removed in 4.0.
|
||||
|
||||
**Added**
|
||||
|
||||
* **"Apply recommended defaults" button** on the settings page. One click enables all 12 contexts flagged as "Recommended" in the UI (privacy policy, date archives, pagination, search results, attachment pages, preview/customize-preview, and 404). Previously required ~60 individual checkbox toggles.
|
||||
* **Filterable conflict-detection list.** The list of plugins that may conflict with noindex SEO is now passed through `apply_filters('noindex_seo_conflicting_plugins', ...)`. Third-party code can extend or replace the list without editing the plugin.
|
||||
|
||||
**Changed**
|
||||
|
||||
* **Storage consolidated**: 110 directive options (`{directive}_seo_{context}`) + 5 config options (`noindex_seo_config_*`) merged into one `noindex_seo_settings` array. Reads go through new accessors (`noindex_seo_get_settings()`, `noindex_seo_get_setting()`, `noindex_seo_get_config()`). The hourly transient cache is preserved on top.
|
||||
* **Transient invalidation is now automatic**: any update to `noindex_seo_settings` clears the `noindex_seo_options` transient via the `update_option_noindex_seo_settings` hook. Previously only the admin form save cleared it, leaving WP-CLI / REST / programmatic edits stale for up to one hour.
|
||||
* **Migration**: existing 2.x installs are migrated automatically on `plugins_loaded` (idempotent, version-gated by `noindex_seo_config_version`). Legacy options are kept and marked non-autoloaded so a rollback to 2.x restores the pre-3.0 state.
|
||||
* **Uninstall retrocompatibility**: `uninstall.php` deletes both the new consolidated option and all legacy individual options (via wildcard SQL). Sites that upgrade from 2.x and later uninstall will be cleaned up completely regardless of whether migration ran.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 5.7 - 7.1
|
||||
* PHP: 7.2 - 8.5
|
||||
|
||||
**Tests**
|
||||
|
||||
* Added PHPUnit test suite (previously the project shipped only a plugin-header smoke test). Coverage: contexts helper, settings accessors, v2→v3 migration, form save, bulk actions, meta box save, conflict-detection filter.
|
||||
|
||||
= 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] =
|
||||
|
||||
**Added**
|
||||
|
||||
* New option "Delete all plugin data on uninstall" (Settings → noindex SEO → General Configuration). By default, all data is preserved when the plugin is uninstalled. Enable this option to remove all settings and per-post directives on uninstall.
|
||||
|
||||
**Changed**
|
||||
|
||||
* Lowered minimum WordPress requirement from 6.6 to 5.7.
|
||||
* Custom post types registered by plugins or themes on the `init` hook now correctly receive the Robots column, bulk actions, and list filter in granular control mode.
|
||||
|
||||
**Code Quality**
|
||||
|
||||
* Added `NOINDEX_SEO_VERSION` constant for asset cache-busting.
|
||||
* PHP type safety improvements; passes PHPStan level 9 on PHP 8.5 with zero errors.
|
||||
* Extracted `noindex_seo_save_directives_from_post()` helper to eliminate duplicated save logic.
|
||||
* Removed dead code and dead hook registration.
|
||||
|
||||
**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.0 [2026-01-20] =
|
||||
|
||||
**New Features**
|
||||
|
||||
* 5 independent robots directives: noindex, nofollow, noarchive, nosnippet, noimageindex
|
||||
* Each directive can be enabled independently for any page context (125 total options)
|
||||
* HTTP Headers support: Choose between HTML meta tags, HTTP headers, or both
|
||||
* Granular per-post/page control (optional):
|
||||
- Override global settings for individual posts/pages
|
||||
- Meta boxes for Classic Editor
|
||||
- Native Gutenberg sidebar panel for Block Editor
|
||||
- Quick Edit support for fast inline editing
|
||||
- Bulk actions to enable/disable overrides
|
||||
- Custom "Robots" column in post lists
|
||||
- Filter posts by override status
|
||||
* Modern checkbox-based interface with emoji icons and tooltips
|
||||
|
||||
**Security & Code Quality**
|
||||
|
||||
* Modernized code with PHP 7.2+ strict types and type declarations
|
||||
|
||||
**Compatibility & Migration**
|
||||
|
||||
* WordPress: 5.7 - 7.1
|
||||
* PHP: 7.2 - 8.5
|
||||
* Automatic migration from v1.x (your existing settings are preserved)
|
||||
* No manual configuration needed - just update and go
|
||||
* Fully backward compatible
|
||||
|
||||
= 1.2.0 [2025-04-08] =
|
||||
|
||||
**Changes**
|
||||
|
||||
* Improved functions documentation.
|
||||
|
||||
**Fixes**
|
||||
|
||||
* The way the options are saved.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 4.1 - 6.8
|
||||
* PHP: 5.6 - 8.4
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHP Coding Standards: 3.12.1
|
||||
* WordPress Coding Standards: 3.1.0
|
||||
* Plugin Check (PCP): 1.4.0
|
||||
|
||||
= 1.1.1 [2024-11-04] =
|
||||
|
||||
**Added**
|
||||
|
||||
* Configuration option to dismiss other SEO plugin incompatibilities.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 4.1 - 6.7
|
||||
* PHP: 5.6 - 8.4
|
||||
|
||||
= 1.1.0 [2024-11-02] =
|
||||
|
||||
**Added**
|
||||
|
||||
* Detects other WordPress SEO plugins, and creates a notice about it, to avoid conflicts.
|
||||
* Has filters, so other plugins can hack.
|
||||
|
||||
**Changed**
|
||||
|
||||
* Uses native wp_robots functions (since WP 5.7+)
|
||||
* Big refactory.
|
||||
* Less size, improved code quality.
|
||||
|
||||
**Compatibility**
|
||||
|
||||
* WordPress: 4.1 - 6.7
|
||||
* PHP: 5.6 - 8.4
|
||||
|
||||
**Tests**
|
||||
|
||||
* PHP Coding Standards: 3.10.3
|
||||
* WordPress Coding Standards: 3.1.0
|
||||
* Plugin Check (PCP): 1.1.0
|
||||
|
||||
== Security ==
|
||||
== Compliance ==
|
||||
|
||||
This plugin adheres to the following security measures and review protocols for each version:
|
||||
|
||||
|
|
@ -445,7 +224,6 @@ This plugin adheres to the following security measures and review protocols for
|
|||
|
||||
== Vulnerabilities ==
|
||||
|
||||
* No vulnerabilities have been published up to version 2.0.1.
|
||||
* Version 2.0.0 includes proactive security hardening based on comprehensive security audit (see docs/SECURITY-2026-01-20.md).
|
||||
* No vulnerabilities have been published up to version 3.7.0.
|
||||
|
||||
Found a security vulnerability? Please report it to us privately at the [noindex SEO GitHub repository](https://github.com/javiercasares/noindex-seo/security/advisories/new).
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
* until they explicitly uninstall.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// Exit if uninstall not called from WordPress.
|
||||
if ( ! defined( 'ABSPATH' ) || ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
||||
exit;
|
||||
|
|
@ -32,7 +30,7 @@ if ( ! defined( 'ABSPATH' ) || ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
|||
$noindex_seo_delete = 0;
|
||||
$noindex_seo_consolidated = get_option( 'noindex_seo_settings', array() );
|
||||
$noindex_seo_consolidated = is_array( $noindex_seo_consolidated ) ? $noindex_seo_consolidated : array();
|
||||
$noindex_seo_consolidated_cfg = $noindex_seo_consolidated['config'] ?? array();
|
||||
$noindex_seo_consolidated_cfg = isset( $noindex_seo_consolidated['config'] ) ? $noindex_seo_consolidated['config'] : array();
|
||||
$noindex_seo_consolidated_cfg = is_array( $noindex_seo_consolidated_cfg ) ? $noindex_seo_consolidated_cfg : array();
|
||||
if ( isset( $noindex_seo_consolidated_cfg['delete_on_uninstall'] ) ) {
|
||||
$noindex_seo_delete = $noindex_seo_consolidated_cfg['delete_on_uninstall'] ? 1 : 0;
|
||||
|
|
@ -72,6 +70,9 @@ $noindex_seo_contexts = array(
|
|||
'singular',
|
||||
'tag',
|
||||
'time',
|
||||
'woo_cart',
|
||||
'woo_checkout',
|
||||
'woo_myaccount',
|
||||
'year',
|
||||
'error',
|
||||
);
|
||||
|
|
@ -136,7 +137,8 @@ $wpdb->query(
|
|||
)
|
||||
);
|
||||
|
||||
// Clean up post meta (granular control).
|
||||
// Clean up post meta (granular control). The 3.6.0 value directives store
|
||||
// their per-post values under the same prefix.
|
||||
$noindex_seo_meta_keys = array(
|
||||
'_noindex_seo_override',
|
||||
'_noindex_seo_noindex',
|
||||
|
|
@ -144,6 +146,11 @@ $noindex_seo_meta_keys = array(
|
|||
'_noindex_seo_noarchive',
|
||||
'_noindex_seo_nosnippet',
|
||||
'_noindex_seo_noimageindex',
|
||||
'_noindex_seo_notranslate',
|
||||
'_noindex_seo_max-snippet',
|
||||
'_noindex_seo_max-image-preview',
|
||||
'_noindex_seo_max-video-preview',
|
||||
'_noindex_seo_unavailable_after',
|
||||
);
|
||||
|
||||
foreach ( $noindex_seo_meta_keys as $noindex_seo_meta_key ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue