diff --git a/admin/assets/wpdo-admin.css b/admin/assets/wpdo-admin.css index 0c284cc..661b6c3 100644 --- a/admin/assets/wpdo-admin.css +++ b/admin/assets/wpdo-admin.css @@ -1,8 +1,8 @@ /** - * WP Data Optimizer — Admin Styles (Morandi Design System) + * 2meet Data Optimizer — Admin Styles (Morandi Design System) * * Morandi tokens are provided via the 'morandi-design-system' CSS dependency - * registered in WPDO_Admin::enqueue_assets(). No @import needed. + * registered in TMDO_Admin::enqueue_assets(). No @import needed. */ /* ── KPI Hero Strip (v2.16.0) ────────────────────────────────────────── */ @@ -512,10 +512,377 @@ .nav-tab .wpdo-tab-dot { animation: none; } + .wpdo-bar-fill, + .wpdo-eb-bar-fill, + .wpdo-setup-progress-fill { transition-duration: 0.01ms; } } -/* ── Settings per-section instant save (v3.0.2 backport) ────────────── */ +/* ── v3.0.2 — Inline-style Elimination Utilities ────────────────────── */ +/* Margin / visibility */ +.wpdo-mt-0 { margin-top: 0; } +.wpdo-mt-24 { margin-top: 24px; } +.wpdo-hidden { display: none; } + +/* Semantic text colours */ +.wpdo-text-success { color: #155724; } +.wpdo-text-error { color: #721c24; } +.wpdo-text-muted { color: #999; } +.wpdo-text-warn { color: #856404; } +.wpdo-text-success-em { color: #46b450; font-weight: bold; } +.wpdo-text-warn-em { color: #dba617; font-weight: bold; } +.wpdo-text-neutral { color: #8c8f94; } +.wpdo-text-skip { color: #888; font-size: 0.9em; } +.wpdo-check-success { color: #155724; font-size: 12px; } + +/* Mode badges — small pill (Entity Bridge status table) */ +.wpdo-mode-sm { + display: inline-block; + padding: 2px 8px; + border-radius: 3px; + font-size: 12px; +} +/* Mode badges — round pill (Entity Bridge health cards) */ +.wpdo-mode-pill { + display: inline-block; + padding: 2px 10px; + border-radius: 20px; + font-size: 12px; + font-weight: 600; +} +.wpdo-mode--disabled { background: #e0e0e0; color: #444; } +.wpdo-mode--dual-write { background: #d4edda; color: #155724; } +.wpdo-mode--shadow-read { background: #fff3cd; color: #856404; } +.wpdo-mode--aeav-only { background: #cce5ff; color: #004085; } + +/* Entity Bridge grid */ +.wpdo-eb-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); + gap: 20px; + margin-top: 20px; +} +.wpdo-eb-card { + padding: 20px; + border-radius: 8px; + background: #fff; + box-shadow: 0 1px 4px rgba(0,0,0,.1); +} +.wpdo-eb-header { + display: flex; + justify-content: space-between; + align-items: flex-start; + margin-bottom: 12px; +} +.wpdo-eb-title { margin: 0 0 4px; font-size: 16px; } +.wpdo-mode-days { margin-left: 8px; font-size: 12px; color: var(--color-text-secondary, #666); } +.wpdo-mode-warn-sm { font-size: 12px; color: #856404; background: #fff3cd; padding: 2px 8px; border-radius: 4px; } +.wpdo-eb-pipeline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; font-size: 11px; } +.wpdo-pipeline-arrow { color: #999; } +.wpdo-stage-pill { padding: 2px 8px; border-radius: 3px; } +.wpdo-stage-pill--inactive { background: #f0f0f0; color: #666; } + +.wpdo-eb-tables-row { + margin-bottom: 14px; + padding: 6px 10px; + background: #f8f9fa; + border-radius: 4px; + font-size: 12px; + color: #555; + display: flex; + flex-wrap: wrap; + gap: 4px; + align-items: center; +} +.wpdo-eb-tables-label { font-weight: 600; margin-right: 4px; } +.wpdo-eb-sep { color: #ccc; } +.wpdo-code-xs { font-size: 11px; } + +.wpdo-eb-section { margin-bottom: 14px; } +.wpdo-eb-section-title { font-size: 12px; text-transform: uppercase; color: var(--color-text-secondary, #666); letter-spacing: .5px; font-weight: 600; } +.wpdo-eb-group { margin-top: 8px; } +.wpdo-eb-group-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; } +.wpdo-eb-group-name { font-size: 13px; font-weight: 500; } +.wpdo-eb-group-meta { font-size: 12px; color: var(--color-text-secondary, #666); } +.wpdo-eb-group-bar-row { display: flex; align-items: center; gap: 8px; } +.wpdo-eb-bar-track { flex: 1; height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; } +.wpdo-eb-bar-fill { height: 100%; width: var(--wpdo-eb-pct, 0%); background: var(--wpdo-eb-color, #28a745); transition: width .4s ease; border-radius: 4px; } +.wpdo-eb-pct-label { font-size: 12px; min-width: 42px; text-align: right; color: #333; } +.wpdo-eb-key-hint { font-size: 11px; color: #888; margin-top: 2px; } +.wpdo-eb-actions { margin-top: 6px; } + +.wpdo-eb-shadow-row { margin-bottom: 12px; padding: 8px; background: #f8f9fa; border-radius: 4px; font-size: 13px; } +.wpdo-eb-shadow-ok { color: #28a745; font-size: 12px; } +.wpdo-eb-shadow-warn { color: #dc3545; } + +.wpdo-eb-promote-row { margin-bottom: 12px; font-size: 12px; color: var(--color-text-secondary, #666); } +.wpdo-eb-auto-ok { color: #155724; } +.wpdo-eb-auto-warn { color: #856404; } +.wpdo-eb-auto-badge { background: #d4edda; color: #155724; padding: 1px 5px; border-radius: 3px; margin-left: 4px; font-size: 11px; } + +.wpdo-eb-info-row { + margin-bottom: 14px; + padding: 8px 10px; + background: #f0f4ff; + border-left: 3px solid #4f6ef7; + border-radius: 0 4px 4px 0; + font-size: 13px; + color: #333; +} +.wpdo-eb-button-row { display: flex; gap: 8px; flex-wrap: wrap; } +.wpdo-eb-btn-dim { opacity: .5; } + +.wpdo-eb-footer { margin-top: 24px; padding: 20px; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.1); } +.wpdo-eb-ol { margin-left: 20px; line-height: 1.9; font-size: 13px; } + +/* Stress-test table cells */ +.wpdo-td { padding: 6px; } +.wpdo-td-muted { padding: 6px; color: var(--color-text-secondary, #666); } +.wpdo-td-val { padding: 6px; font-weight: 600; } + +.wpdo-stats-table { width: 100%; font-size: 13px; margin-top: 10px; border-collapse: collapse; } + +/* Full-width progress bar */ +.wpdo-bar-track { height: 14px; background: var(--color-bg-tertiary, #e0e0e0); border-radius: 7px; overflow: hidden; } +.wpdo-bar-fill { height: 100%; background: linear-gradient(90deg, #28a745, #20c997); width: var(--wpdo-bar-width, 0%); transition: width 0.4s; } +.wpdo-bar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; } +.wpdo-bar-pct { font-weight: 600; } +.wpdo-bar-section { margin-bottom: 10px; } + +/* Layouts */ +.wpdo-grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; } +.wpdo-grid-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; max-width: 720px; margin: 1rem 0; } + +/* Notices */ +.wpdo-notice-error { + margin: 14px 0; + padding: 12px 14px; + background: #f8d7da; + color: #721c24; + border-left: 4px solid #dc3545; + border-radius: 4px; + font-size: 13px; + line-height: 1.6; +} +.wpdo-notice-warn-inline { margin: 0; font-size: 12px; color: #856404; background: #fff3cd; padding: 6px 10px; border-radius: 4px; line-height: 1.6; } + +/* Count badge */ +.wpdo-count-danger { font-size: 18px; color: #dc3545; } + +/* Form helpers */ +.wpdo-th-main { width: 35%; } +.wpdo-label-block { display: block; margin-bottom: 6px; } +.wpdo-hr-section { margin: 18px 0; } + +/* Lists */ +.wpdo-list-disc { list-style: disc; padding-left: 1.5em; } +.wpdo-list-ol { margin-left: 20px; line-height: 1.9; font-size: 13px; } +.wpdo-list-ol-tight { margin: 6px 0 8px 22px; padding: 0; } + +/* Max-width constraints */ +.wpdo-max-520 { max-width: 520px; } +.wpdo-max-600 { max-width: 600px; } +.wpdo-max-720 { max-width: 720px; } +.wpdo-max-800 { max-width: 800px; } + +/* Dashboard widget */ +.wpdo-widget-intro { font-size: 1.1em; margin-bottom: 0.6em; } +.wpdo-widget-link-right { float: right; padding-top: 4px; } +.wpdo-widget-notice { margin: 0.6em 0; padding: 0.6em 0.8em; border-radius: 3px; } +.wpdo-widget-notice-warn { background: #fff8e5; border-left: 3px solid #dba617; } +.wpdo-widget-notice-error { background: #fef0f0; border-left: 3px solid #dc3232; } +.wpdo-widget-notice-info { background: #e5f5fa; border-left: 3px solid #00a0d2; } +.wpdo-widget-notice-neutral { background: #f6f7f7; border-left: 3px solid #2271b1; } +.wpdo-widget-notice-ok { background: #ecf7ed; border-left: 3px solid #46b450; } + +/* Setup wizard */ +.wpdo-setup-progress-track { background: #f0f0f1; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 2em; } +.wpdo-setup-progress-fill { background: #2271b1; height: 100%; width: var(--wpdo-progress-pct, 0%); transition: width 0.3s; } +.wpdo-setup-card-full { max-width: none; padding: 2em; } +.wpdo-setup-banner { + background: #f0f6fc; + border-left: 4px solid #2271b1; + padding: 0.75em 1em; + margin-bottom: 1em; + display: flex; + align-items: center; + gap: 1em; +} +.wpdo-setup-banner-btn { white-space: nowrap; } + +/* HivePress / WC tabs */ +.wpdo-cli-block { background: #f6f7f7; padding: 12px; border-left: 4px solid #2271b1; } +.wpdo-opacity-60 { opacity: .6; } + +/* Text colour — strong danger / amber (stress-test status) */ +.wpdo-text-danger { color: #dc3545; } +.wpdo-text-amber { color: #dba617; } + +/* Inline code on white bg (mode-card context) */ +.wpdo-code-white { background: #fff; padding: 2px 6px; border-radius: 3px; } + +/* Mode info card (stress-test modal-status section) */ +.wpdo-mode-card { + border-left-width: 4px; + border-left-style: solid; + border-radius: 6px; + margin-top: 16px; + font-size: 13px; + line-height: 1.7; +} +.wpdo-mode-card--ok { background: #e8f5e9; border-left-color: #28a745; } +.wpdo-mode-card--warn { background: #fff3cd; border-left-color: #dba617; } + +/* Settings link margin */ +.wpdo-ml-2 { margin-left: 8px; } + +/* Matrix / details table helpers */ +.wpdo-summary-toggle { cursor: pointer; color: #0073aa; font-weight: 600; } +.wpdo-table-inset { background: #fff; font-size: 12px; } +.wpdo-tr-header th, .wpdo-tr-header td { background: #f0f0f0; } +.wpdo-tr-highlight { background: #fff8e1; } +.wpdo-tr-success { background: #e8f5e9; font-weight: 600; } + +/* Entity Bridge JS-hook class static styles (admin.php, updated by wpdo-entity-bridge.js) */ +.wpdo-entity-bridge-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); + gap: 20px; + margin-top: 20px; +} +.wpdo-mode-badge { + display: inline-block; + padding: 2px 10px; + border-radius: 20px; + font-size: 12px; + font-weight: 600; + transition: background-color var(--duration-normal, 200ms) var(--ease-default, ease), + color var(--duration-normal, 200ms) var(--ease-default, ease); +} +/* JS sets className = 'wpdo-mode-badge wpdo-mode-disabled' etc. */ +.wpdo-mode-badge.wpdo-mode-disabled { background: #e0e0e0; color: #444; } +.wpdo-mode-badge.wpdo-mode-dual-write { background: #d4edda; color: #155724; } +.wpdo-mode-badge.wpdo-mode-shadow-read { background: #fff3cd; color: #856404; } +.wpdo-mode-badge.wpdo-mode-aeav-only { background: #cce5ff; color: #004085; } + +.wpdo-pipeline { + display: flex; + align-items: center; + gap: 6px; + flex-wrap: wrap; + margin-bottom: 16px; + font-size: 11px; +} +.wpdo-pipeline-dot { padding: 2px 8px; border-radius: 3px; background: #f0f0f0; color: #666; } +.wpdo-pipeline-inactive { background: #f0f0f0; color: #666; } + +.wpdo-native-counts { + margin-bottom: 14px; + padding: 6px 10px; + background: #f8f9fa; + border-radius: 4px; + font-size: 12px; + color: #555; + display: flex; + flex-wrap: wrap; + gap: 4px; + align-items: center; +} +.wpdo-native-counts-label { font-weight: 600; margin-right: 4px; } +.wpdo-native-sep { color: #ccc; } + +.wpdo-mig-status { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: #f0f0f0; } + +.wpdo-cov-pct { font-size: 12px; min-width: 42px; text-align: right; color: #333; } +.wpdo-cov-bar-fill { height: 100%; width: var(--wpdo-cov-pct, 0%); background: var(--wpdo-cov-color, #28a745); transition: width .4s ease; border-radius: 4px; } + +.wpdo-recommendation { + margin-bottom: 14px; + padding: 8px 10px; + background: #f0f4ff; + border-left: 3px solid #4f6ef7; + border-radius: 0 4px 4px 0; + font-size: 13px; + color: #333; +} + +/* Settings tab helpers */ +.wpdo-h3-section { margin-top: 2em; } +.wpdo-h4-mb { margin-bottom: 6px; } +.wpdo-table-mb { margin-bottom: 14px; } +.wpdo-table-mb-sm { margin-bottom: 8px; } +.wpdo-pre-code { background: #f0f0f1; padding: 1em; overflow: auto; max-height: 400px; } +.wpdo-details-section { + margin-top: 1.5em; + border: 1px solid #c3c4c7; + border-radius: 3px; + padding: 0.6em 1em; +} +.wpdo-label-inline { display: inline-block; margin-right: 1em; margin-bottom: 0.3em; } +.wpdo-description-mt { margin-top: 1em; } +.wpdo-description-sm { margin-top: 0.25em; } +.wpdo-description-xs { margin-top: 0.5em; font-size: 12px; } +.wpdo-text-ok { color: #46b450; font-weight: bold; } +.wpdo-text-err { color: #dc3232; font-weight: bold; } +.wpdo-text-muted { color: #666; font-size: 12px; } +.wpdo-text-green { color: #155724; } +.wpdo-text-olive { color: #856404; } +.wpdo-text-green-bold { color: #28a745; font-weight: 600; } +.wpdo-text-red-bold { color: #dc3545; font-weight: 600; } +.wpdo-code-sm { margin-left: 8px; font-size: 11px; } +.wpdo-badge-mode { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 3px; font-size: 11px; } + +/* Advisor confidence bar (Classifier tab) */ +.wpdo-advisor-bar-track { + display: inline-block; + background: #f0f0f1; + border-radius: 3px; + width: 80px; + height: 18px; + position: relative; + vertical-align: middle; +} +.wpdo-advisor-bar-fill { + position: absolute; + inset: 0 auto 0 0; + background: var(--wpdo-adv-color, #c3c4c7); + width: var(--wpdo-adv-width, 0%); + border-radius: 3px; +} +.wpdo-advisor-bar-label { + position: absolute; + inset: 0; + text-align: center; + font-size: 11px; + line-height: 18px; +} + +/* EB card group section: empty state warning */ +.wpdo-eb-warn-box { + margin: 0; + font-size: 12px; + color: #856404; + background: #fff3cd; + padding: 6px 10px; + border-radius: 4px; + line-height: 1.6; +} + +/* Additional utilities */ +.wpdo-text-dark-red { color: #721c24; } +.wpdo-text-red { color: #dc3545; } +.wpdo-ml-2 { margin-left: 8px; } +.wpdo-form-table-mt0 { margin-top: 0; } +.wpdo-badge-mode.wpdo-mode-disabled { background: #e0e0e0; color: #444; } +.wpdo-badge-mode.wpdo-mode-dual-write { background: #d4edda; color: #155724; } +.wpdo-badge-mode.wpdo-mode-shadow-read { background: #fff3cd; color: #856404; } +.wpdo-badge-mode.wpdo-mode-aeav-only { background: #cce5ff; color: #004085; } +.wpdo-summary-section { cursor: pointer; font-weight: 600; font-size: 1.1em; } +.wpdo-notice-warn-desc { margin-top: 8px; color: #856404; background: #fff3cd; padding: 8px 12px; border-radius: 4px; } +.wpdo-card--light { background: #f6f7f7; } +.wpdo-h3-sm { font-size: 14px; } + +/* ── Settings section cards (task E) ─────────────────────────────── */ .wpdo-settings-section { background: var(--color-surface-card, #fbf7f0); border: 1px solid var(--color-border-soft, #e5dccd); @@ -541,3 +908,7 @@ .wpdo-section-save-status.visible { opacity: 1; } + +/* Inline form wrapper — the GET → POST hardening (v1.0.0) turned several + action links into single-button forms; they must not break the row flow. */ +.wpdo-form-inline { display: inline; } diff --git a/admin/class-tmdo-admin.php b/admin/class-tmdo-admin.php index 97846eb..fb916b2 100644 --- a/admin/class-tmdo-admin.php +++ b/admin/class-tmdo-admin.php @@ -997,7 +997,7 @@ class TMDO_Admin { $top_views = $wpdb->get_results( // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared $wpdb->prepare( "SELECT post_id, CAST(meta_value AS UNSIGNED) as views FROM `{$warm_table}` WHERE meta_key = %s AND (expires_at IS NULL OR expires_at > %s) ORDER BY views DESC LIMIT 10", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared - TMDO_Listing_Stats::VIEW_KEY, + TMDO_Zone_Warm::VIEW_KEY, $now_sql ), ARRAY_A @@ -1295,7 +1295,7 @@ class TMDO_Admin {
0 ) : ?> -