| 1 |
<?php |
| 2 |
/** |
| 3 |
* Import External Data View |
| 4 |
* |
| 5 |
* @package Metasync |
| 6 |
*/ |
| 7 |
|
| 8 |
if (!defined('ABSPATH')) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
$importer = new Metasync_External_Importer($this->db_redirection); |
| 13 |
|
| 14 |
// Define sections |
| 15 |
$sections = [ |
| 16 |
'seo_metadata' => [ |
| 17 |
'title' => 'SEO Metadata', |
| 18 |
'icon' => 'dashicons-admin-settings', |
| 19 |
'desc' => 'Import SEO titles and descriptions from Yoast, Rank Math, or All in One SEO. One-click migration to preserve your search rankings.' |
| 20 |
], |
| 21 |
'redirections' => [ |
| 22 |
'title' => 'Redirections', |
| 23 |
'icon' => 'dashicons-randomize', |
| 24 |
'desc' => 'Import 301/302 redirections and 410 content deleted rules.' |
| 25 |
], |
| 26 |
'sitemap' => [ |
| 27 |
'title' => 'Sitemap Settings', |
| 28 |
'icon' => 'dashicons-networking', |
| 29 |
'desc' => 'Import sitemap configuration (enabled status, excluded post types).' |
| 30 |
], |
| 31 |
'robots' => [ |
| 32 |
'title' => 'Robots.txt', |
| 33 |
'icon' => 'dashicons-editor-code', |
| 34 |
'desc' => 'Import robots.txt content.' |
| 35 |
], |
| 36 |
'indexation' => [ |
| 37 |
'title' => 'Indexation Options', |
| 38 |
'icon' => 'dashicons-visibility', |
| 39 |
'desc' => 'Import per-post robots meta settings (noindex, nofollow, noarchive, etc.) and canonical URLs.' |
| 40 |
], |
| 41 |
'schema' => [ |
| 42 |
'title' => 'Schema Settings', |
| 43 |
'icon' => 'dashicons-layout', |
| 44 |
'desc' => 'Import per-post schema markup (Article, FAQPage, Product, Recipe) with field mapping and variable substitution.' |
| 45 |
] |
| 46 |
]; |
| 47 |
|
| 48 |
// Get active tab |
| 49 |
$active_tab = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : 'seo_metadata'; |
| 50 |
if (!array_key_exists($active_tab, $sections)) { |
| 51 |
$active_tab = 'seo_metadata'; |
| 52 |
} |
| 53 |
?> |
| 54 |
|
| 55 |
<style type="text/css"> |
| 56 |
/* Root Variables - Dashboard Color Scheme */ |
| 57 |
:root { |
| 58 |
--dashboard-bg: #0f1419; |
| 59 |
--dashboard-card-bg: #1a1f26; |
| 60 |
--dashboard-card-hover: #222831; |
| 61 |
--dashboard-text-primary: #ffffff; |
| 62 |
--dashboard-text-secondary: #9ca3af; |
| 63 |
--dashboard-accent: #3b82f6; |
| 64 |
--dashboard-accent-hover: #2563eb; |
| 65 |
--dashboard-success: #10b981; |
| 66 |
--dashboard-warning: #f59e0b; |
| 67 |
--dashboard-error: #ef4444; |
| 68 |
--dashboard-border: #374151; |
| 69 |
--dashboard-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 70 |
--dashboard-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1); |
| 71 |
--dashboard-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2); |
| 72 |
} |
| 73 |
|
| 74 |
/* Page background */ |
| 75 |
body { |
| 76 |
background: var(--dashboard-bg) !important; |
| 77 |
} |
| 78 |
|
| 79 |
.metasync-dashboard-wrap { |
| 80 |
background: var(--dashboard-bg) !important; |
| 81 |
color: var(--dashboard-text-primary) !important; |
| 82 |
margin: 0 0 0 -20px; |
| 83 |
padding: 20px; |
| 84 |
max-width: 100% !important; |
| 85 |
} |
| 86 |
|
| 87 |
/* Reusing and adapting styles from Redirection Importer */ |
| 88 |
.metasync-import-wrapper { |
| 89 |
display: flex; |
| 90 |
gap: 20px; |
| 91 |
margin-top: 20px; |
| 92 |
max-width: 1400px; |
| 93 |
} |
| 94 |
|
| 95 |
/* Sidebar Navigation */ |
| 96 |
.metasync-import-nav { |
| 97 |
width: 250px; |
| 98 |
flex-shrink: 0; |
| 99 |
background: var(--dashboard-card-bg); |
| 100 |
border: 1px solid var(--dashboard-border); |
| 101 |
border-radius: 12px; |
| 102 |
overflow: hidden; |
| 103 |
box-shadow: var(--dashboard-shadow); |
| 104 |
align-self: flex-start; |
| 105 |
} |
| 106 |
|
| 107 |
.metasync-nav-item { |
| 108 |
display: flex; |
| 109 |
align-items: center; |
| 110 |
gap: 10px; |
| 111 |
padding: 15px 20px; |
| 112 |
color: var(--dashboard-text-secondary); |
| 113 |
text-decoration: none; |
| 114 |
border-bottom: 1px solid var(--dashboard-border); |
| 115 |
transition: all 0.2s ease; |
| 116 |
font-weight: 500; |
| 117 |
font-size: 14px; |
| 118 |
} |
| 119 |
|
| 120 |
.metasync-nav-item:last-child { |
| 121 |
border-bottom: none; |
| 122 |
} |
| 123 |
|
| 124 |
.metasync-nav-item:hover { |
| 125 |
background: var(--dashboard-card-hover); |
| 126 |
color: var(--dashboard-text-primary); |
| 127 |
} |
| 128 |
|
| 129 |
.metasync-nav-item.active { |
| 130 |
background: var(--dashboard-accent); |
| 131 |
color: white; |
| 132 |
border-color: var(--dashboard-accent); |
| 133 |
} |
| 134 |
|
| 135 |
.metasync-nav-item .dashicons { |
| 136 |
font-size: 18px; |
| 137 |
width: 18px; |
| 138 |
height: 18px; |
| 139 |
} |
| 140 |
|
| 141 |
/* Main Content Area */ |
| 142 |
.metasync-import-content { |
| 143 |
flex: 1; |
| 144 |
min-width: 0; |
| 145 |
} |
| 146 |
|
| 147 |
.metasync-section-header { |
| 148 |
background: var(--dashboard-card-bg); |
| 149 |
border: 1px solid var(--dashboard-border); |
| 150 |
border-radius: 12px; |
| 151 |
padding: 24px; |
| 152 |
margin-bottom: 24px; |
| 153 |
box-shadow: var(--dashboard-shadow); |
| 154 |
} |
| 155 |
|
| 156 |
.metasync-section-title { |
| 157 |
color: var(--dashboard-text-primary); |
| 158 |
margin: 0 0 10px 0; |
| 159 |
font-size: 1.5rem; |
| 160 |
font-weight: 600; |
| 161 |
display: flex; |
| 162 |
align-items: center; |
| 163 |
gap: 10px; |
| 164 |
} |
| 165 |
|
| 166 |
.metasync-section-desc { |
| 167 |
color: var(--dashboard-text-secondary); |
| 168 |
margin: 0; |
| 169 |
font-size: 14px; |
| 170 |
line-height: 1.6; |
| 171 |
} |
| 172 |
|
| 173 |
/* Plugin Grid (Reused) */ |
| 174 |
.metasync-plugins-grid { |
| 175 |
display: grid; |
| 176 |
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); |
| 177 |
gap: 24px; |
| 178 |
} |
| 179 |
|
| 180 |
.metasync-plugin-card { |
| 181 |
background: var(--dashboard-card-bg); |
| 182 |
border: 1px solid var(--dashboard-border); |
| 183 |
border-radius: 12px; |
| 184 |
padding: 24px; |
| 185 |
box-shadow: var(--dashboard-shadow); |
| 186 |
transition: all 0.3s ease; |
| 187 |
display: flex; |
| 188 |
flex-direction: column; |
| 189 |
} |
| 190 |
|
| 191 |
.metasync-plugin-card:hover { |
| 192 |
background: var(--dashboard-card-hover); |
| 193 |
box-shadow: var(--dashboard-shadow-hover); |
| 194 |
transform: translateY(-2px); |
| 195 |
} |
| 196 |
|
| 197 |
.metasync-plugin-header { |
| 198 |
display: flex; |
| 199 |
justify-content: space-between; |
| 200 |
align-items: flex-start; |
| 201 |
margin-bottom: 16px; |
| 202 |
} |
| 203 |
|
| 204 |
.metasync-plugin-title { |
| 205 |
color: var(--dashboard-text-primary); |
| 206 |
font-size: 1.1rem; |
| 207 |
font-weight: 600; |
| 208 |
margin: 0; |
| 209 |
} |
| 210 |
|
| 211 |
.metasync-plugin-badge { |
| 212 |
padding: 4px 8px; |
| 213 |
border-radius: 4px; |
| 214 |
font-size: 11px; |
| 215 |
font-weight: 700; |
| 216 |
text-transform: uppercase; |
| 217 |
letter-spacing: 0.5px; |
| 218 |
} |
| 219 |
|
| 220 |
.metasync-badge-available { |
| 221 |
background: rgba(16, 185, 129, 0.15); |
| 222 |
color: var(--dashboard-success); |
| 223 |
border: 1px solid var(--dashboard-success); |
| 224 |
} |
| 225 |
|
| 226 |
.metasync-badge-unavailable { |
| 227 |
background: rgba(156, 163, 175, 0.15); |
| 228 |
color: var(--dashboard-text-secondary); |
| 229 |
border: 1px solid var(--dashboard-border); |
| 230 |
} |
| 231 |
|
| 232 |
.metasync-plugin-body { |
| 233 |
flex: 1; |
| 234 |
margin-bottom: 20px; |
| 235 |
color: var(--dashboard-text-secondary); |
| 236 |
font-size: 13px; |
| 237 |
line-height: 1.5; |
| 238 |
} |
| 239 |
|
| 240 |
.metasync-import-btn { |
| 241 |
background: var(--dashboard-accent); |
| 242 |
color: white; |
| 243 |
border: none; |
| 244 |
border-radius: 8px; |
| 245 |
padding: 10px 20px; |
| 246 |
font-weight: 600; |
| 247 |
cursor: pointer; |
| 248 |
transition: all 0.2s; |
| 249 |
width: 100%; |
| 250 |
text-align: center; |
| 251 |
} |
| 252 |
|
| 253 |
.metasync-import-btn:hover:not(:disabled) { |
| 254 |
background: var(--dashboard-accent-hover); |
| 255 |
transform: translateY(-1px); |
| 256 |
} |
| 257 |
|
| 258 |
.metasync-import-btn:disabled { |
| 259 |
background: var(--dashboard-card-hover); |
| 260 |
color: var(--dashboard-text-secondary); |
| 261 |
cursor: not-allowed; |
| 262 |
border: 1px solid var(--dashboard-border); |
| 263 |
} |
| 264 |
|
| 265 |
.metasync-import-btn.success { |
| 266 |
background: var(--dashboard-success); |
| 267 |
pointer-events: none; |
| 268 |
} |
| 269 |
|
| 270 |
.metasync-import-result { |
| 271 |
margin-top: 15px; |
| 272 |
padding: 12px; |
| 273 |
border-radius: 6px; |
| 274 |
font-size: 13px; |
| 275 |
display: none; |
| 276 |
} |
| 277 |
|
| 278 |
.metasync-import-result.success { |
| 279 |
background: rgba(16, 185, 129, 0.1); |
| 280 |
color: var(--dashboard-success); |
| 281 |
border: 1px solid var(--dashboard-success); |
| 282 |
} |
| 283 |
|
| 284 |
.metasync-import-result.error { |
| 285 |
background: rgba(239, 68, 68, 0.1); |
| 286 |
color: var(--dashboard-error); |
| 287 |
border: 1px solid var(--dashboard-error); |
| 288 |
} |
| 289 |
|
| 290 |
/* Responsive */ |
| 291 |
@media (max-width: 768px) { |
| 292 |
.metasync-import-wrapper { |
| 293 |
flex-direction: column; |
| 294 |
} |
| 295 |
.metasync-import-nav { |
| 296 |
width: 100%; |
| 297 |
display: flex; |
| 298 |
overflow-x: auto; |
| 299 |
} |
| 300 |
.metasync-nav-item { |
| 301 |
white-space: nowrap; |
| 302 |
border-bottom: none; |
| 303 |
border-right: 1px solid var(--dashboard-border); |
| 304 |
} |
| 305 |
} |
| 306 |
|
| 307 |
/* Description text styling */ |
| 308 |
.wrap .description, |
| 309 |
.wrap p.description { |
| 310 |
color: var(--dashboard-text-secondary, #9ca3af) !important; |
| 311 |
font-size: 13px !important; |
| 312 |
line-height: 1.5 !important; |
| 313 |
} |
| 314 |
|
| 315 |
/* Modal Overlay */ |
| 316 |
.metasync-modal-overlay { |
| 317 |
display: none; |
| 318 |
position: fixed; |
| 319 |
top: 0; |
| 320 |
left: 0; |
| 321 |
right: 0; |
| 322 |
bottom: 0; |
| 323 |
background: rgba(0, 0, 0, 0.75); |
| 324 |
z-index: 100000; |
| 325 |
justify-content: center; |
| 326 |
align-items: center; |
| 327 |
backdrop-filter: blur(4px); |
| 328 |
} |
| 329 |
|
| 330 |
.metasync-modal-overlay.active { |
| 331 |
display: flex; |
| 332 |
} |
| 333 |
|
| 334 |
/* Modal Container */ |
| 335 |
.metasync-modal { |
| 336 |
background: var(--dashboard-card-bg); |
| 337 |
border: 1px solid var(--dashboard-border); |
| 338 |
border-radius: 12px; |
| 339 |
max-width: 500px; |
| 340 |
width: 90%; |
| 341 |
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); |
| 342 |
animation: modalSlideIn 0.3s ease-out; |
| 343 |
} |
| 344 |
|
| 345 |
@keyframes modalSlideIn { |
| 346 |
from { |
| 347 |
transform: translateY(-50px); |
| 348 |
opacity: 0; |
| 349 |
} |
| 350 |
to { |
| 351 |
transform: translateY(0); |
| 352 |
opacity: 1; |
| 353 |
} |
| 354 |
} |
| 355 |
|
| 356 |
.metasync-modal-header { |
| 357 |
padding: 24px; |
| 358 |
border-bottom: 1px solid var(--dashboard-border); |
| 359 |
display: flex; |
| 360 |
justify-content: space-between; |
| 361 |
align-items: center; |
| 362 |
} |
| 363 |
|
| 364 |
.metasync-modal-title { |
| 365 |
color: var(--dashboard-text-primary); |
| 366 |
font-size: 1.25rem; |
| 367 |
font-weight: 600; |
| 368 |
margin: 0; |
| 369 |
} |
| 370 |
|
| 371 |
.metasync-modal-close { |
| 372 |
background: none; |
| 373 |
border: none; |
| 374 |
color: var(--dashboard-text-secondary); |
| 375 |
font-size: 24px; |
| 376 |
cursor: pointer; |
| 377 |
padding: 0; |
| 378 |
width: 32px; |
| 379 |
height: 32px; |
| 380 |
display: flex; |
| 381 |
align-items: center; |
| 382 |
justify-content: center; |
| 383 |
border-radius: 6px; |
| 384 |
transition: all 0.2s; |
| 385 |
} |
| 386 |
|
| 387 |
.metasync-modal-close:hover { |
| 388 |
background: var(--dashboard-card-hover); |
| 389 |
color: var(--dashboard-text-primary); |
| 390 |
} |
| 391 |
|
| 392 |
.metasync-modal-body { |
| 393 |
padding: 24px; |
| 394 |
} |
| 395 |
|
| 396 |
.metasync-modal-footer { |
| 397 |
padding: 16px 24px; |
| 398 |
border-top: 1px solid var(--dashboard-border); |
| 399 |
display: flex; |
| 400 |
gap: 12px; |
| 401 |
justify-content: flex-end; |
| 402 |
} |
| 403 |
|
| 404 |
/* Checkbox Group */ |
| 405 |
.metasync-checkbox-group { |
| 406 |
display: flex; |
| 407 |
flex-direction: column; |
| 408 |
gap: 16px; |
| 409 |
margin-bottom: 20px; |
| 410 |
} |
| 411 |
|
| 412 |
.metasync-checkbox-item { |
| 413 |
display: flex; |
| 414 |
align-items: flex-start; |
| 415 |
gap: 12px; |
| 416 |
padding: 12px; |
| 417 |
background: var(--dashboard-bg); |
| 418 |
border: 1px solid var(--dashboard-border); |
| 419 |
border-radius: 8px; |
| 420 |
cursor: pointer; |
| 421 |
transition: all 0.2s; |
| 422 |
} |
| 423 |
|
| 424 |
.metasync-checkbox-item:hover { |
| 425 |
background: var(--dashboard-card-hover); |
| 426 |
border-color: var(--dashboard-accent); |
| 427 |
} |
| 428 |
|
| 429 |
.metasync-checkbox-item input[type="checkbox"] { |
| 430 |
margin: 2px 0 0 0; |
| 431 |
width: 18px; |
| 432 |
height: 18px; |
| 433 |
cursor: pointer; |
| 434 |
} |
| 435 |
|
| 436 |
.metasync-checkbox-label { |
| 437 |
flex: 1; |
| 438 |
cursor: pointer; |
| 439 |
} |
| 440 |
|
| 441 |
.metasync-checkbox-label strong { |
| 442 |
color: var(--dashboard-text-primary); |
| 443 |
display: block; |
| 444 |
margin-bottom: 4px; |
| 445 |
} |
| 446 |
|
| 447 |
.metasync-checkbox-label span { |
| 448 |
color: var(--dashboard-text-secondary); |
| 449 |
font-size: 12px; |
| 450 |
line-height: 1.4; |
| 451 |
} |
| 452 |
|
| 453 |
/* Modal Buttons */ |
| 454 |
.metasync-modal-btn { |
| 455 |
padding: 10px 20px; |
| 456 |
border-radius: 8px; |
| 457 |
font-weight: 600; |
| 458 |
cursor: pointer; |
| 459 |
transition: all 0.2s; |
| 460 |
border: none; |
| 461 |
} |
| 462 |
|
| 463 |
.metasync-modal-btn-primary { |
| 464 |
background: var(--dashboard-accent); |
| 465 |
color: white; |
| 466 |
} |
| 467 |
|
| 468 |
.metasync-modal-btn-primary:hover:not(:disabled) { |
| 469 |
background: var(--dashboard-accent-hover); |
| 470 |
} |
| 471 |
|
| 472 |
.metasync-modal-btn-secondary { |
| 473 |
background: transparent; |
| 474 |
color: var(--dashboard-text-secondary); |
| 475 |
border: 1px solid var(--dashboard-border); |
| 476 |
} |
| 477 |
|
| 478 |
.metasync-modal-btn-secondary:hover { |
| 479 |
background: var(--dashboard-card-hover); |
| 480 |
color: var(--dashboard-text-primary); |
| 481 |
} |
| 482 |
|
| 483 |
.metasync-modal-btn:disabled { |
| 484 |
opacity: 0.5; |
| 485 |
cursor: not-allowed; |
| 486 |
} |
| 487 |
|
| 488 |
/* Progress Bar */ |
| 489 |
.metasync-progress-container { |
| 490 |
display: none; |
| 491 |
margin-top: 16px; |
| 492 |
} |
| 493 |
|
| 494 |
.metasync-progress-container.active { |
| 495 |
display: block; |
| 496 |
} |
| 497 |
|
| 498 |
.metasync-progress-bar { |
| 499 |
width: 100%; |
| 500 |
height: 8px; |
| 501 |
background: var(--dashboard-bg); |
| 502 |
border-radius: 4px; |
| 503 |
overflow: hidden; |
| 504 |
margin-bottom: 8px; |
| 505 |
} |
| 506 |
|
| 507 |
.metasync-progress-fill { |
| 508 |
height: 100%; |
| 509 |
background: linear-gradient(90deg, var(--dashboard-accent), var(--dashboard-accent-hover)); |
| 510 |
border-radius: 4px; |
| 511 |
transition: width 0.3s ease; |
| 512 |
width: 0%; |
| 513 |
} |
| 514 |
|
| 515 |
.metasync-progress-text { |
| 516 |
color: var(--dashboard-text-secondary); |
| 517 |
font-size: 12px; |
| 518 |
text-align: center; |
| 519 |
} |
| 520 |
|
| 521 |
.metasync-progress-status { |
| 522 |
color: var(--dashboard-text-primary); |
| 523 |
font-size: 13px; |
| 524 |
margin-top: 12px; |
| 525 |
text-align: center; |
| 526 |
} |
| 527 |
</style> |
| 528 |
|
| 529 |
<?php $this->render_layout_open('Import External Data', 'import_seo', 'Import SEO data, redirections, sitemaps, and more from other plugins.'); ?> |
| 530 |
|
| 531 |
<div class="metasync-import-wrapper"> |
| 532 |
|
| 533 |
<!-- Navigation Sidebar --> |
| 534 |
<div class="metasync-import-nav"> |
| 535 |
<?php foreach ($sections as $key => $section): ?> |
| 536 |
<a href="<?php echo esc_url(add_query_arg('tab', $key)); ?>" |
| 537 |
class="metasync-nav-item <?php echo $active_tab === $key ? 'active' : ''; ?>" |
| 538 |
id="nav-<?php echo esc_attr($key); ?>"> |
| 539 |
<span class="dashicons <?php echo esc_attr($section['icon']); ?>"></span> |
| 540 |
<?php echo esc_html($section['title']); ?> |
| 541 |
</a> |
| 542 |
<?php endforeach; ?> |
| 543 |
</div> |
| 544 |
|
| 545 |
<!-- Content Area --> |
| 546 |
<div class="metasync-import-content"> |
| 547 |
<?php |
| 548 |
$current_section = $sections[$active_tab]; |
| 549 |
$plugins = $importer->get_plugins_for_type($active_tab); |
| 550 |
?> |
| 551 |
|
| 552 |
<div class="metasync-section-header"> |
| 553 |
<h2 class="metasync-section-title"> |
| 554 |
<span class="dashicons <?php echo esc_attr($current_section['icon']); ?>" style="font-size: 24px; width: 24px; height: 24px;"></span> |
| 555 |
<?php echo esc_html($current_section['title']); ?> |
| 556 |
</h2> |
| 557 |
<p class="metasync-section-desc"><?php echo esc_html($current_section['desc']); ?></p> |
| 558 |
</div> |
| 559 |
|
| 560 |
<div class="metasync-plugins-grid"> |
| 561 |
<?php if (empty($plugins)): ?> |
| 562 |
<p>No compatible plugins found for this import type.</p> |
| 563 |
<?php else: ?> |
| 564 |
<?php foreach ($plugins as $plugin): ?> |
| 565 |
<div class="metasync-plugin-card"> |
| 566 |
<div class="metasync-plugin-header"> |
| 567 |
<h3 class="metasync-plugin-title"><?php echo esc_html($plugin['name']); ?></h3> |
| 568 |
<?php if ($plugin['has_data']): ?> |
| 569 |
<span class="metasync-plugin-badge metasync-badge-available">Available</span> |
| 570 |
<?php elseif ($plugin['installed']): ?> |
| 571 |
<span class="metasync-plugin-badge metasync-badge-unavailable">No Data</span> |
| 572 |
<?php else: ?> |
| 573 |
<span class="metasync-plugin-badge metasync-badge-unavailable">Not Found</span> |
| 574 |
<?php endif; ?> |
| 575 |
</div> |
| 576 |
|
| 577 |
<div class="metasync-plugin-body"> |
| 578 |
<?php if ($plugin['has_data']): ?> |
| 579 |
<?php if ($active_tab === 'seo_metadata'): ?> |
| 580 |
Found <strong><?php echo esc_html($plugin['count']); ?></strong> <?php echo $plugin['count'] === 1 ? 'post' : 'posts'; ?> with SEO titles or descriptions ready to import. |
| 581 |
<?php elseif ($active_tab === 'redirections'): ?> |
| 582 |
Found <strong><?php echo esc_html($plugin['count']); ?></strong> redirections ready to import. |
| 583 |
<?php elseif ($active_tab === 'indexation'): ?> |
| 584 |
Found <strong><?php echo esc_html($plugin['count']); ?></strong> <?php echo $plugin['count'] === 1 ? 'post' : 'posts'; ?> with indexation settings ready to import. |
| 585 |
<?php elseif ($active_tab === 'schema'): ?> |
| 586 |
Found <strong><?php echo esc_html($plugin['count']); ?></strong> <?php echo $plugin['count'] === 1 ? 'post' : 'posts'; ?> with schema markup ready to import. |
| 587 |
<?php else: ?> |
| 588 |
Settings detected and ready to import. |
| 589 |
<?php endif; ?> |
| 590 |
<?php elseif ($plugin['installed']): ?> |
| 591 |
Plugin is installed but no importable data was found. |
| 592 |
<?php else: ?> |
| 593 |
Plugin is not installed or active on this site. |
| 594 |
<?php endif; ?> |
| 595 |
</div> |
| 596 |
|
| 597 |
<button class="metasync-import-btn" |
| 598 |
data-type="<?php echo esc_attr($active_tab); ?>" |
| 599 |
data-plugin="<?php echo esc_attr($plugin['key']); ?>" |
| 600 |
<?php echo !$plugin['has_data'] ? 'disabled' : ''; ?>> |
| 601 |
<?php echo $plugin['has_data'] ? 'Import ' . esc_html($current_section['title']) : 'Unavailable'; ?> |
| 602 |
</button> |
| 603 |
|
| 604 |
<?php if ($active_tab === 'indexation'): ?> |
| 605 |
<div class="metasync-progress-container"> |
| 606 |
<div class="metasync-progress-bar"> |
| 607 |
<div class="metasync-progress-fill"></div> |
| 608 |
</div> |
| 609 |
<div class="metasync-progress-text">0%</div> |
| 610 |
</div> |
| 611 |
<?php endif; ?> |
| 612 |
|
| 613 |
<div class="metasync-import-result"></div> |
| 614 |
</div> |
| 615 |
<?php endforeach; ?> |
| 616 |
<?php endif; ?> |
| 617 |
</div> |
| 618 |
</div> |
| 619 |
</div> |
| 620 |
<?php $this->render_layout_close(); ?> |
| 621 |
|
| 622 |
<!-- SEO Metadata Import Options Modal --> |
| 623 |
<div class="metasync-modal-overlay" id="metasync-seo-options-modal"> |
| 624 |
<div class="metasync-modal"> |
| 625 |
<div class="metasync-modal-header"> |
| 626 |
<h2 class="metasync-modal-title">Import Options</h2> |
| 627 |
<button class="metasync-modal-close" aria-label="Close">×</button> |
| 628 |
</div> |
| 629 |
<div class="metasync-modal-body"> |
| 630 |
<div class="metasync-checkbox-group"> |
| 631 |
<label class="metasync-checkbox-item"> |
| 632 |
<input type="checkbox" id="import-titles" checked> |
| 633 |
<div class="metasync-checkbox-label"> |
| 634 |
<strong>Import Titles</strong> |
| 635 |
<span>Copy SEO title metadata to <?php echo esc_html(Metasync::get_effective_plugin_name()); ?> custom fields</span> |
| 636 |
</div> |
| 637 |
</label> |
| 638 |
|
| 639 |
<label class="metasync-checkbox-item"> |
| 640 |
<input type="checkbox" id="import-descriptions" checked> |
| 641 |
<div class="metasync-checkbox-label"> |
| 642 |
<strong>Import Descriptions</strong> |
| 643 |
<span>Copy SEO description metadata to <?php echo esc_html(Metasync::get_effective_plugin_name()); ?> custom fields</span> |
| 644 |
</div> |
| 645 |
</label> |
| 646 |
|
| 647 |
<label class="metasync-checkbox-item"> |
| 648 |
<input type="checkbox" id="import-social-text" checked> |
| 649 |
<div class="metasync-checkbox-label"> |
| 650 |
<strong>Import Social Text</strong> |
| 651 |
<span>Copy OG and Twitter title/description metadata to <?php echo esc_html(Metasync::get_effective_plugin_name()); ?> custom fields</span> |
| 652 |
</div> |
| 653 |
</label> |
| 654 |
|
| 655 |
<label class="metasync-checkbox-item"> |
| 656 |
<input type="checkbox" id="import-social-images" checked> |
| 657 |
<div class="metasync-checkbox-label"> |
| 658 |
<strong>Import Social Images</strong> |
| 659 |
<span>Copy OG and Twitter social sharing images to <?php echo esc_html(Metasync::get_effective_plugin_name()); ?> custom fields</span> |
| 660 |
</div> |
| 661 |
</label> |
| 662 |
|
| 663 |
<label class="metasync-checkbox-item"> |
| 664 |
<input type="checkbox" id="overwrite-existing"> |
| 665 |
<div class="metasync-checkbox-label"> |
| 666 |
<strong>Overwrite Existing Data</strong> |
| 667 |
<span>Replace existing <?php echo esc_html(Metasync::get_effective_plugin_name()); ?> data if already present (default: skip posts with existing data)</span> |
| 668 |
</div> |
| 669 |
</label> |
| 670 |
</div> |
| 671 |
|
| 672 |
<div class="metasync-progress-container"> |
| 673 |
<div class="metasync-progress-bar"> |
| 674 |
<div class="metasync-progress-fill"></div> |
| 675 |
</div> |
| 676 |
<div class="metasync-progress-text">0%</div> |
| 677 |
<div class="metasync-progress-status"></div> |
| 678 |
</div> |
| 679 |
</div> |
| 680 |
<div class="metasync-modal-footer"> |
| 681 |
<button class="metasync-modal-btn metasync-modal-btn-secondary" id="modal-cancel">Cancel</button> |
| 682 |
<button class="metasync-modal-btn metasync-modal-btn-primary" id="modal-start-import">Start Import</button> |
| 683 |
</div> |
| 684 |
</div> |
| 685 |
</div> |
| 686 |
|
| 687 |
|