Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 54122d3d95 | |||
| 3cf187303e | |||
| 1086e369e3 | |||
| fb0ef03b73 | |||
| 0ec665db60 | |||
| 7b3c00cacc | |||
| b66c727a95 |
12 changed files with 6927 additions and 2636 deletions
|
|
@ -1,7 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* noindex SEO - Admin Panel Styles
|
* noindex SEO - Admin styles
|
||||||
* Version: 2.0.0
|
*
|
||||||
* Modern, visual admin interface
|
* 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;
|
margin: 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Header styles removed - using WordPress default styles */
|
/* Tab navigation uses the native WordPress nav-tab classes. */
|
||||||
|
.noindex-seo-admin-wrap .nav-tab-wrapper {
|
||||||
/* ===========================
|
margin-bottom: 20px;
|
||||||
Tabs Navigation
|
|
||||||
=========================== */
|
|
||||||
.noindex-seo-tabs {
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
border-bottom: 2px solid #e5e7eb;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-tab {
|
/* Section titles inside a tab panel. Vertical separation between
|
||||||
padding: 12px 24px;
|
sections comes from the content blocks' own bottom margins. */
|
||||||
background: transparent;
|
.noindex-seo-section-title {
|
||||||
border: none;
|
margin: 0 0 12px 0;
|
||||||
color: #6b7280;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 500;
|
|
||||||
cursor: pointer;
|
|
||||||
border-bottom: 3px solid transparent;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
position: relative;
|
|
||||||
top: 2px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-tab:hover {
|
.noindex-seo-section-title + .description {
|
||||||
color: #667eea;
|
margin: 0 0 12px 0;
|
||||||
}
|
|
||||||
|
|
||||||
.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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================
|
/* ===========================
|
||||||
|
|
@ -80,13 +38,13 @@
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1px solid #e5e7eb;
|
border: 1px solid #c3c4c7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-card-header {
|
.noindex-seo-card-header {
|
||||||
padding: 20px 24px;
|
padding: 20px 24px;
|
||||||
background: #f9fafb;
|
background: #f6f7f7;
|
||||||
border-bottom: 1px solid #e5e7eb;
|
border-bottom: 1px solid #c3c4c7;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
@ -95,28 +53,28 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-card-header:hover {
|
.noindex-seo-card-header:hover {
|
||||||
background: #f3f4f6;
|
background: #f0f0f1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-card-header h3 {
|
.noindex-seo-card-header h3 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #111827;
|
color: #2c3338;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-card-header .dashicons {
|
.noindex-seo-card-header .dashicons {
|
||||||
color: #667eea;
|
color: var(--wp-admin-theme-color, #2271b1);
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-card-toggle {
|
.noindex-seo-card-toggle {
|
||||||
color: #9ca3af;
|
color: #8c8f94;
|
||||||
transition: transform 0.3s ease;
|
transition: transform 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,6 +82,10 @@
|
||||||
transform: rotate(-90deg);
|
transform: rotate(-90deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[dir="rtl"] .noindex-seo-card.collapsed .noindex-seo-card-toggle {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
|
||||||
.noindex-seo-card-body {
|
.noindex-seo-card-body {
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|
@ -140,10 +102,10 @@
|
||||||
=========================== */
|
=========================== */
|
||||||
.noindex-seo-option {
|
.noindex-seo-option {
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
background: #f9fafb;
|
background: #f6f7f7;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 1px solid #e5e7eb;
|
border: 1px solid #c3c4c7;
|
||||||
transition: all 0.2s ease;
|
transition: border-color 0.2s ease;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -152,15 +114,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-option:hover {
|
.noindex-seo-option:hover {
|
||||||
background: #f3f4f6;
|
background: #f0f0f1;
|
||||||
border-color: #d1d5db;
|
border-color: #8c8f94;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-option-header {
|
.noindex-seo-option-header {
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
padding-bottom: 14px;
|
padding-bottom: 14px;
|
||||||
border-bottom: 1px solid #e5e7eb;
|
border-bottom: 1px solid #c3c4c7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-option-title {
|
.noindex-seo-option-title {
|
||||||
|
|
@ -169,7 +131,7 @@
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
color: #111827;
|
color: #2c3338;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-option-title strong {
|
.noindex-seo-option-title strong {
|
||||||
|
|
@ -177,32 +139,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-option-description {
|
.noindex-seo-option-description {
|
||||||
color: #6b7280;
|
color: #646970;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
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
|
Directives Checkboxes
|
||||||
=========================== */
|
=========================== */
|
||||||
|
|
@ -219,18 +161,18 @@
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
padding: 10px 14px;
|
padding: 10px 14px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 2px solid #e5e7eb;
|
border: 2px solid #c3c4c7;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: border-color 0.2s ease;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #374151;
|
color: #3c434a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-directive-checkbox:hover {
|
.noindex-seo-directive-checkbox:hover {
|
||||||
border-color: #d1d5db;
|
border-color: #8c8f94;
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -239,21 +181,16 @@
|
||||||
width: 18px;
|
width: 18px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
accent-color: #667eea;
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-directive-checkbox input[type="checkbox"]:checked {
|
|
||||||
background-color: #667eea;
|
|
||||||
}
|
|
||||||
|
|
||||||
.noindex-seo-directive-checkbox:has(input:checked) {
|
.noindex-seo-directive-checkbox:has(input:checked) {
|
||||||
border-color: #667eea;
|
border-color: var(--wp-admin-theme-color, #2271b1);
|
||||||
background-color: #eff6ff;
|
background-color: #f0f6fc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-directive-checkbox:has(input:checked) .directive-label {
|
.noindex-seo-directive-checkbox:has(input:checked) .directive-label {
|
||||||
color: #667eea;
|
color: var(--wp-admin-theme-color, #2271b1);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -265,6 +202,22 @@
|
||||||
text-align: center;
|
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 {
|
.directive-label {
|
||||||
font-family: 'Courier New', monospace;
|
font-family: 'Courier New', monospace;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|
@ -273,21 +226,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.directive-description {
|
.directive-description {
|
||||||
color: #6b7280;
|
color: #646970;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
font-family: inherit;
|
||||||
flex: 2;
|
flex: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================
|
/* ===========================
|
||||||
Toggle Switch (Modern)
|
Toggle Switch
|
||||||
=========================== */
|
=========================== */
|
||||||
.noindex-seo-switch {
|
.noindex-seo-switch {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 26px;
|
height: 26px;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-switch input {
|
.noindex-seo-switch input {
|
||||||
|
|
@ -303,7 +257,7 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background-color: #cbd5e1;
|
background-color: #8c8f94;
|
||||||
transition: 0.3s;
|
transition: 0.3s;
|
||||||
border-radius: 34px;
|
border-radius: 34px;
|
||||||
}
|
}
|
||||||
|
|
@ -315,24 +269,34 @@
|
||||||
width: 20px;
|
width: 20px;
|
||||||
left: 3px;
|
left: 3px;
|
||||||
bottom: 3px;
|
bottom: 3px;
|
||||||
background-color: white;
|
background-color: #fff;
|
||||||
transition: 0.3s;
|
transition: 0.3s;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
input:checked + .noindex-seo-slider {
|
input:checked + .noindex-seo-slider {
|
||||||
background-color: #667eea;
|
background-color: var(--wp-admin-theme-color, #2271b1);
|
||||||
}
|
}
|
||||||
|
|
||||||
input:focus + .noindex-seo-slider {
|
input:focus-visible + .noindex-seo-slider {
|
||||||
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
|
outline: 2px solid var(--wp-admin-theme-color, #2271b1);
|
||||||
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input:checked + .noindex-seo-slider:before {
|
input:checked + .noindex-seo-slider:before {
|
||||||
transform: translateX(22px);
|
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
|
Badges & Indicators
|
||||||
=========================== */
|
=========================== */
|
||||||
|
|
@ -348,18 +312,18 @@ input:checked + .noindex-seo-slider:before {
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-badge.recommended {
|
.noindex-seo-badge.recommended {
|
||||||
background: #dcfce7;
|
background: #edfaef;
|
||||||
color: #166534;
|
color: #076b32;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-badge.not-recommended {
|
.noindex-seo-badge.not-recommended {
|
||||||
background: #fee2e2;
|
background: #fcf0f1;
|
||||||
color: #991b1b;
|
color: #b32d2e;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-badge.neutral {
|
.noindex-seo-badge.neutral {
|
||||||
background: #e0e7ff;
|
background: #f0f0f1;
|
||||||
color: #3730a3;
|
color: #3c434a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-badge .dashicons {
|
.noindex-seo-badge .dashicons {
|
||||||
|
|
@ -368,12 +332,19 @@ input:checked + .noindex-seo-slider:before {
|
||||||
height: 14px;
|
height: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===========================
|
||||||
|
"Apply Recommended Defaults" form
|
||||||
|
=========================== */
|
||||||
|
.noindex-seo-apply-form {
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* ===========================
|
/* ===========================
|
||||||
General Config Section
|
General Config Section
|
||||||
=========================== */
|
=========================== */
|
||||||
.noindex-seo-general-config {
|
.noindex-seo-general-config {
|
||||||
background: #fffbeb;
|
background: #fff;
|
||||||
border: 1px solid #fcd34d;
|
border: 1px solid #c3c4c7;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
|
|
@ -382,14 +353,14 @@ input:checked + .noindex-seo-slider:before {
|
||||||
.noindex-seo-general-config h2 {
|
.noindex-seo-general-config h2 {
|
||||||
margin: 0 0 16px 0;
|
margin: 0 0 16px 0;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
color: #92400e;
|
color: #2c3338;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-general-config .dashicons {
|
.noindex-seo-general-config .dashicons {
|
||||||
color: #f59e0b;
|
color: var(--wp-admin-theme-color, #2271b1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-config-option {
|
.noindex-seo-config-option {
|
||||||
|
|
@ -398,18 +369,38 @@ input:checked + .noindex-seo-slider:before {
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.noindex-seo-config-option + .noindex-seo-config-option {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.noindex-seo-config-option label {
|
.noindex-seo-config-option label {
|
||||||
color: #78350f;
|
|
||||||
font-weight: 500;
|
|
||||||
cursor: pointer;
|
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
|
Alert / Notice
|
||||||
=========================== */
|
=========================== */
|
||||||
.noindex-seo-alert {
|
.noindex-seo-alert {
|
||||||
background: #fef3c7;
|
background: #fcf9e8;
|
||||||
border-left: 4px solid #f59e0b;
|
border-inline-start: 4px solid #dba617;
|
||||||
padding: 16px 20px;
|
padding: 16px 20px;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|
@ -419,22 +410,17 @@ input:checked + .noindex-seo-slider:before {
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-alert .dashicons {
|
.noindex-seo-alert .dashicons {
|
||||||
color: #d97706;
|
color: #dba617;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-alert p {
|
.noindex-seo-alert p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: #92400e;
|
color: #3c434a;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================
|
|
||||||
Submit Button
|
|
||||||
=========================== */
|
|
||||||
/* Submit button styles removed - using WordPress default submit_button() */
|
|
||||||
|
|
||||||
/* ===========================
|
/* ===========================
|
||||||
Search/Filter
|
Search/Filter
|
||||||
=========================== */
|
=========================== */
|
||||||
|
|
@ -445,17 +431,12 @@ input:checked + .noindex-seo-slider:before {
|
||||||
.noindex-seo-search input {
|
.noindex-seo-search input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 400px;
|
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 {
|
.noindex-seo-search input:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
border-color: #667eea;
|
border-color: var(--wp-admin-theme-color, #2271b1);
|
||||||
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
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 {
|
.noindex-seo-stat-card {
|
||||||
background: white;
|
background: #fff;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 1px solid #e5e7eb;
|
border: 1px solid #c3c4c7;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-stat-number {
|
.noindex-seo-stat-number {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #667eea;
|
color: var(--wp-admin-theme-color, #2271b1);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-stat-label {
|
.noindex-seo-stat-label {
|
||||||
color: #6b7280;
|
color: #646970;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
@ -495,65 +476,42 @@ input:checked + .noindex-seo-slider:before {
|
||||||
View Link
|
View Link
|
||||||
=========================== */
|
=========================== */
|
||||||
.noindex-seo-view-link {
|
.noindex-seo-view-link {
|
||||||
color: #667eea;
|
color: var(--wp-admin-theme-color, #2271b1);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 500;
|
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
transition: color 0.2s ease;
|
transition: color 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-view-link:hover {
|
.noindex-seo-view-link:hover {
|
||||||
color: #764ba2;
|
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-view-link .dashicons {
|
.noindex-seo-view-link .dashicons {
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
width: 16px;
|
width: 14px;
|
||||||
height: 16px;
|
height: 14px;
|
||||||
}
|
|
||||||
|
|
||||||
/* ===========================
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================
|
/* ===========================
|
||||||
Success Message
|
Success Message
|
||||||
=========================== */
|
=========================== */
|
||||||
.noindex-seo-success {
|
.noindex-seo-success {
|
||||||
background: #dcfce7;
|
background: #edfaef;
|
||||||
border-left: 4px solid #16a34a;
|
border-inline-start: 4px solid #00a32a;
|
||||||
padding: 16px 20px;
|
padding: 16px 20px;
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
animation: slideDown 0.3s ease;
|
animation: noindexSeoSlideDown 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes slideDown {
|
@keyframes noindexSeoSlideDown {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(-10px);
|
transform: translateY(-10px);
|
||||||
|
|
@ -565,13 +523,13 @@ input:checked + .noindex-seo-slider:before {
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-success .dashicons {
|
.noindex-seo-success .dashicons {
|
||||||
color: #16a34a;
|
color: #00a32a;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-success p {
|
.noindex-seo-success p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: #166534;
|
color: #076b32;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -585,14 +543,14 @@ input:checked + .noindex-seo-slider:before {
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-tooltip .dashicons {
|
.noindex-seo-tooltip .dashicons {
|
||||||
color: #9ca3af;
|
color: #8c8f94;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-tooltip:hover .dashicons {
|
.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;
|
opacity: 0.6;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #f9fafb;
|
background: #f6f7f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-option.disabled::before {
|
.noindex-seo-option.disabled::before {
|
||||||
|
|
@ -621,17 +579,158 @@ input:checked + .noindex-seo-slider:before {
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-option.disabled .noindex-seo-option-title {
|
.noindex-seo-option.disabled .noindex-seo-option-title {
|
||||||
color: #9ca3af;
|
color: #8c8f94;
|
||||||
}
|
}
|
||||||
|
|
||||||
.noindex-seo-option.disabled .noindex-seo-option-description {
|
.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
|
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 {
|
.noindex-seo-directive-checkbox {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
@ -639,7 +738,7 @@ input:checked + .noindex-seo-slider:before {
|
||||||
|
|
||||||
.directive-description {
|
.directive-description {
|
||||||
flex-basis: 100%;
|
flex-basis: 100%;
|
||||||
margin-left: 52px;
|
margin-inline-start: 52px;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|
@ -662,3 +761,122 @@ input:checked + .noindex-seo-slider:before {
|
||||||
display: none;
|
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,44 +13,87 @@
|
||||||
* Initialize the admin panel
|
* Initialize the admin panel
|
||||||
*/
|
*/
|
||||||
function init() {
|
function init() {
|
||||||
initTabs();
|
|
||||||
initCollapsibleCards();
|
initCollapsibleCards();
|
||||||
initSearch();
|
initSearch();
|
||||||
initStats();
|
initStats();
|
||||||
initTooltips();
|
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() {
|
function initRules() {
|
||||||
$( '.noindex-seo-tab' ).on(
|
// Add rule: clone the last row of the target container and clear it.
|
||||||
|
$( '.noindex-seo-rule-add' ).on(
|
||||||
'click',
|
'click',
|
||||||
function (e) {
|
function () {
|
||||||
e.preventDefault();
|
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.
|
const $clone = $rows.find( '.noindex-seo-rule-row' ).last().clone();
|
||||||
$( '.noindex-seo-tab' ).removeClass( 'active' );
|
$clone.find( 'input[type="text"], input[type="number"], input[type="datetime-local"]' ).val( '' );
|
||||||
$( this ).addClass( 'active' );
|
$rows.append( $clone );
|
||||||
|
|
||||||
// Update active content.
|
|
||||||
$( '.noindex-seo-tab-content' ).removeClass( 'active' );
|
|
||||||
$( '#' + tabId ).addClass( 'active' );
|
|
||||||
|
|
||||||
// Save last active tab to localStorage.
|
|
||||||
localStorage.setItem( 'noindexSeoActiveTab', tabId );
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Restore last active tab.
|
// Remove rule: drop the row, or clear it when it is the last one left.
|
||||||
const lastTab = localStorage.getItem( 'noindexSeoActiveTab' );
|
$( document ).on(
|
||||||
if (lastTab && $( '#' + lastTab ).length) {
|
'click',
|
||||||
$( '.noindex-seo-tab[data-tab="' + lastTab + '"]' ).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 );
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize collapsible card sections
|
* Initialize collapsible card sections
|
||||||
|
|
@ -163,63 +206,6 @@
|
||||||
// Can be enhanced with a tooltip library if needed.
|
// 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
|
* Expand all cards
|
||||||
*/
|
*/
|
||||||
|
|
@ -325,9 +311,15 @@
|
||||||
if (urlParams.get( 'updated' ) === 'true') {
|
if (urlParams.get( 'updated' ) === 'true') {
|
||||||
showSuccessMessage( noindexSeoAdmin.successMessage || 'Settings saved successfully!' );
|
showSuccessMessage( noindexSeoAdmin.successMessage || 'Settings saved successfully!' );
|
||||||
|
|
||||||
// Remove the parameter from URL without reload.
|
// Remove only the success flag, keeping the page and tab
|
||||||
const newUrl = window.location.pathname + window.location.hash;
|
// parameters intact (tabs are URL-based since 3.3.0).
|
||||||
window.history.replaceState( {}, document.title, newUrl );
|
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
|
* Noindex SEO - Gutenberg Sidebar Panel
|
||||||
* Version: 2.0.0
|
* Version: 3.0.0
|
||||||
*
|
*
|
||||||
* Provides a native Gutenberg sidebar panel for controlling robots directives
|
* 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
|
* @package noindex-seo
|
||||||
*/
|
*/
|
||||||
|
|
@ -11,11 +13,21 @@
|
||||||
(function (wp) {
|
(function (wp) {
|
||||||
const { registerPlugin } = wp.plugins;
|
const { registerPlugin } = wp.plugins;
|
||||||
const { PluginDocumentSettingPanel } = wp.editPost;
|
const { PluginDocumentSettingPanel } = wp.editPost;
|
||||||
const { CheckboxControl, PanelRow } = wp.components;
|
const { CheckboxControl, PanelRow, SelectControl, TextControl } = wp.components;
|
||||||
const { useSelect, useDispatch } = wp.data;
|
const { useSelect, useDispatch } = wp.data;
|
||||||
const { createElement: el } = wp.element;
|
const { createElement: el } = wp.element;
|
||||||
const { __ } = wp.i18n;
|
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
|
* Robots Directives Sidebar Panel Component
|
||||||
*/
|
*/
|
||||||
|
|
@ -29,34 +41,42 @@
|
||||||
|
|
||||||
const { editPost } = useDispatch( 'core/editor' );
|
const { editPost } = useDispatch( 'core/editor' );
|
||||||
|
|
||||||
// Current values.
|
// Current override state.
|
||||||
const override = Boolean( postMeta._noindex_seo_override );
|
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 );
|
|
||||||
|
|
||||||
// Update meta function.
|
// Update a boolean meta value (0/1).
|
||||||
const updateMeta = function (key, value) {
|
const updateBoolean = function (key, value) {
|
||||||
const newMeta = {};
|
const newMeta = {};
|
||||||
newMeta[key] = value ? 1 : 0;
|
newMeta[key] = value ? 1 : 0;
|
||||||
editPost( { meta: newMeta } );
|
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.
|
// Clear all directive meta values.
|
||||||
const clearAllDirectives = function () {
|
const clearAllDirectives = function () {
|
||||||
const directives = ['noindex', 'nofollow', 'noarchive', 'nosnippet', 'noimageindex'];
|
const newMeta = {};
|
||||||
directives.forEach(
|
booleanDirectives.forEach(
|
||||||
function (directive) {
|
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.
|
// Handle override toggle.
|
||||||
const handleOverrideChange = function (value) {
|
const handleOverrideChange = function (value) {
|
||||||
updateMeta( '_noindex_seo_override', value );
|
updateBoolean( '_noindex_seo_override', value );
|
||||||
|
|
||||||
// If disabling override, clear all directives.
|
// If disabling override, clear all directives.
|
||||||
if ( ! value) {
|
if ( ! value) {
|
||||||
|
|
@ -64,25 +84,90 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get active directives for preview.
|
// Build the preview list: names for booleans, name:value for values.
|
||||||
const activeDirectives = [];
|
const activeDirectives = [];
|
||||||
if (override) {
|
if (override) {
|
||||||
if (noindex) {
|
booleanDirectives.forEach(
|
||||||
activeDirectives.push( 'noindex' );
|
function (directive) {
|
||||||
}
|
if ( Boolean( postMeta['_noindex_seo_' + directive] ) ) {
|
||||||
if (nofollow) {
|
activeDirectives.push( directive );
|
||||||
activeDirectives.push( 'nofollow' );
|
|
||||||
}
|
|
||||||
if (noarchive) {
|
|
||||||
activeDirectives.push( 'noarchive' );
|
|
||||||
}
|
|
||||||
if (nosnippet) {
|
|
||||||
activeDirectives.push( 'nosnippet' );
|
|
||||||
}
|
|
||||||
if (noimageindex) {
|
|
||||||
activeDirectives.push( 'noimageindex' );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
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(
|
return el(
|
||||||
PluginDocumentSettingPanel,
|
PluginDocumentSettingPanel,
|
||||||
|
|
@ -132,81 +217,8 @@
|
||||||
},
|
},
|
||||||
__( 'Robots Directives:', 'noindex-seo' )
|
__( 'Robots Directives:', 'noindex-seo' )
|
||||||
),
|
),
|
||||||
|
booleanRows,
|
||||||
el(
|
valueRows,
|
||||||
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.
|
// Preview section.
|
||||||
activeDirectives.length > 0 && el(
|
activeDirectives.length > 0 && el(
|
||||||
|
|
|
||||||
272
changelog.txt
272
changelog.txt
|
|
@ -1,5 +1,277 @@
|
||||||
== Changelog ==
|
== 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 =
|
= 3.1.5 =
|
||||||
|
|
||||||
_Release date: 2026-09-18_
|
_Release date: 2026-09-18_
|
||||||
|
|
|
||||||
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
3476
noindex-seo.php
3476
noindex-seo.php
File diff suppressed because it is too large
Load diff
87
readme.txt
87
readme.txt
|
|
@ -1,11 +1,11 @@
|
||||||
=== noindex SEO ===
|
=== noindex SEO ===
|
||||||
Contributors: robotstxt, javiercasares
|
Contributors: robotstxt, javiercasares
|
||||||
Tags: seo, noindex, nofollow, noarchive, robots
|
Tags: seo, noindex, nofollow, noarchive, robots
|
||||||
Requires at least: 4.7
|
Requires at least: 7.0
|
||||||
Tested up to: 7.2
|
Tested up to: 7.2
|
||||||
Stable tag: 3.1.5
|
Stable tag: 3.7.0
|
||||||
Requires PHP: 5.6
|
Requires PHP: 8.3
|
||||||
Version: 3.1.5
|
Version: 3.7.0
|
||||||
License: GPL-3.0-or-later
|
License: GPL-3.0-or-later
|
||||||
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
|
||||||
|
|
@ -13,9 +13,9 @@ Control search engine indexing with robots directives using HTML meta tags or HT
|
||||||
|
|
||||||
== Description ==
|
== Description ==
|
||||||
|
|
||||||
Fine-grained control over how search engines index and display your WordPress content. Apply 5 independent robots directives to 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
|
* **noindex**: Prevent search engines from indexing the page
|
||||||
* **nofollow**: Prevent search engines from following links on 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
|
* **nosnippet**: Prevent search engines from showing text snippets in results
|
||||||
* **noimageindex**: Prevent search engines from indexing images on the page
|
* **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:**
|
**Implementation Methods:**
|
||||||
|
|
||||||
* HTML Meta Tags: Traditional method, easy to verify in page source (default)
|
* 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:**
|
**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
|
* Granular Control (Optional): Override global settings for individual posts, pages, and custom post types via meta boxes in the editor
|
||||||
|
|
||||||
**Perfect for:**
|
**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.
|
* 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.
|
* 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**
|
**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.
|
* 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.
|
||||||
|
|
@ -99,15 +115,52 @@ Important note: if you have any doubt about any of the following items it is bes
|
||||||
|
|
||||||
== Using the plugin ==
|
== 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 =
|
= REST API =
|
||||||
|
|
||||||
The plugin exposes two read-only endpoints under `/wp-json/noindex-seo/v1/` so headless consumers can read the configuration:
|
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 /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 per-post-type default, then the built-in context). Public only for published, non-password-protected posts; everything else requires `edit_post` capabilities.
|
* `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.
|
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 ==
|
== Installation ==
|
||||||
|
|
||||||
= Automatic download =
|
= Automatic download =
|
||||||
|
|
@ -134,22 +187,22 @@ No. By default all plugin data is preserved on uninstall. If you want a complete
|
||||||
|
|
||||||
== Compatibility ==
|
== Compatibility ==
|
||||||
|
|
||||||
* WordPress: 4.7 - 7.2
|
* WordPress: 7.0 - 7.2
|
||||||
* PHP: 5.6 - 8.5
|
* PHP: 8.3 - 8.6
|
||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
= 3.1.5 =
|
= 3.7.0 =
|
||||||
|
|
||||||
Maintenance review: WordPress floor corrected to 4.7 (oldest tested version, first with the complete REST API) and tested up to 7.2; nonce verification in the form handlers split into a capability check plus a standalone `check_admin_referer()`; dev dependencies updated; test suite expanded to 147 tests with 94.78% coverage.
|
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.
|
||||||
|
|
||||||
= 3.1.3 =
|
= 3.6.0 =
|
||||||
|
|
||||||
Compatibility release: WordPress 4.0+ and PHP 5.6+ supported again (the classic `<meta name="robots">` output covers WordPress versions without the `wp_robots` API, and every newer-API integration degrades gracefully). Branding moved to robotstxt.software.
|
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).
|
||||||
|
|
||||||
= 3.1.2 =
|
= 3.5.0 =
|
||||||
|
|
||||||
Audit-driven maintenance release: fixed the composer-audit gate in the preflight script, un-nested the settings page forms, added `load_plugin_textdomain()` for the bundled translations, pinned all dev dependencies, wired up coverage measurement.
|
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).
|
||||||
|
|
||||||
= Previous versions =
|
= Previous versions =
|
||||||
|
|
||||||
|
|
@ -171,6 +224,6 @@ This plugin adheres to the following security measures and review protocols for
|
||||||
|
|
||||||
== Vulnerabilities ==
|
== Vulnerabilities ==
|
||||||
|
|
||||||
* No vulnerabilities have been published up to version 3.1.5.
|
* 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).
|
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).
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,9 @@ $noindex_seo_contexts = array(
|
||||||
'singular',
|
'singular',
|
||||||
'tag',
|
'tag',
|
||||||
'time',
|
'time',
|
||||||
|
'woo_cart',
|
||||||
|
'woo_checkout',
|
||||||
|
'woo_myaccount',
|
||||||
'year',
|
'year',
|
||||||
'error',
|
'error',
|
||||||
);
|
);
|
||||||
|
|
@ -134,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_meta_keys = array(
|
||||||
'_noindex_seo_override',
|
'_noindex_seo_override',
|
||||||
'_noindex_seo_noindex',
|
'_noindex_seo_noindex',
|
||||||
|
|
@ -142,6 +146,11 @@ $noindex_seo_meta_keys = array(
|
||||||
'_noindex_seo_noarchive',
|
'_noindex_seo_noarchive',
|
||||||
'_noindex_seo_nosnippet',
|
'_noindex_seo_nosnippet',
|
||||||
'_noindex_seo_noimageindex',
|
'_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 ) {
|
foreach ( $noindex_seo_meta_keys as $noindex_seo_meta_key ) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue